There are dozens of grammar rules I am mad about in Ruby, and this is one of them
-
-
Replying to @penelope_zone @mountain_ghosts
The lexer is dependent on the parser state james
1 reply 0 retweets 1 like -
-
Replying to @mountain_ghosts
if I was the ruby parser I would simply make it possible to parse as ast = parser(lexer(input)) where parser and lexer are pure functions. But I am not the ruby parser and it is not simple
1 reply 0 retweets 2 likes -
Replying to @penelope_zone @mountain_ghosts
I didn’t even know you *could* have something other than parser(lexer(input))
2 replies 0 retweets 1 like -
You can't parse C with parser(lexer(input))
2 replies 0 retweets 0 likes -
this isn't *strictly* true (I mean you can parse any language with a composition of those functions, even if they're pure, for given definitions of those functions). Like we *could* build a ruby parser where the lexer was a pure scanner, but it would be very hard.
2 replies 0 retweets 0 likes -
where does the lexer use state from the parser?
1 reply 0 retweets 0 likes -
Symbol table to disambiguate typedefs in expressions like (A) * B.
2 replies 0 retweets 0 likes -
it is however possible to define "token" such that parse(lex(string)) works, it's just some tokens are ambiguous until parsed
1 reply 0 retweets 0 likes
Yes, "can't" was too strong of a term to use here
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.