ircmaxell / PHP-Yacc

A PHP port of kmyacc
Other
152 stars 14 forks source link

Allows grammar input through STDIN #12

Closed mecha closed 3 years ago

mecha commented 3 years ago

Fixes a bug that basically prevented the grammar from being read from STDIN.

The script seemed to allow reading from STDIN, since it explicitly sets $grammarFile to "php://stdin" if it's equal to "-". However, "php://stdin" fails the file_exists check that happens shortly after, which causes the script to terminate with exit code 4. This fixes that.