Fix bug in character set intersection calculation
Resolve token conflicts by tokens' order in grammar
Add if statements to javascript grammar