user34537
user34537

Reputation:

yacc/bison combined word problem

I have an if statement like the below

if false { expr }

It works, great! but i typed in

iffalse { expr }

and it works as well :| How do i fix that? the above should be a var name not an if statement

-edit- nevermind i figured it out

Upvotes: 1

Views: 106

Answers (1)

user34537
user34537

Reputation:

In your lex file define a pattern similar to this

[a-zA-Z][a-zA-Z0-9]*

If you accidentally wrote this above the if pattern you should get an error about the pattern never being matched. Just put that pattern above and that problem will be solved

Upvotes: 1

Related Questions