by ridiculous_fish · 2y ago · 0 comments
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).
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.
As the "Lexer hack" Wiki page says, this is only a problem if you're lexing in the first place. If you just parse the grammar, this isn't a problem.
git "commit" "-am" "message"
ls "-l"
etc