indutny / candor

Experimental VM for a `Candor` language
http://candor-lang.org/
177 stars 16 forks source link

Parser bugs near end of stream #3

Closed creationix closed 12 years ago

creationix commented 12 years ago

While testing the new "return" <-> "return nil" feature, I found a couple parser bugs.

Both "return\n// comment" and "return nill\n// comment\n" crash with the failed assertion:

test-parser: src/parser.cc:18: candor::internal::AstNode* candor::internal::Parser::Execute(): Assertion `Peek()->is(kEnd)' failed.
creationix commented 12 years ago

Interestingly, "return nil\n//comment" doesn't crash. (note there is no trailing newline, but there is an explicit nil.)

indutny commented 12 years ago

Thanks, fixed!