|
|
|
|
|
by ridiculous_fish
656 days ago
|
|
Shells have somewhat unusual parsing requirements. For example "if" is a keyword when used as `if echo` but not `echo if`. So you either need to implement the lexer hack, or have a "string" token type which is disambiguated by the parser (which is what fish-shell does). https://en.wikipedia.org/wiki/Lexer_hack |
|
Lex/Flex takes care of that mostly for you which is one of the benefits of using a well worn lexer generator and not rolling your own.