stephens2424 / php

Parser for PHP written in Go
BSD 3-Clause "New" or "Revised" License
529 stars 77 forks source link

Lexer identifies class as Class token type in "$this->class" context. #31

Closed silbinarywolf closed 7 years ago

silbinarywolf commented 7 years ago

Not sure if this intentional / a non-issue for your tooling, but I was hoping to iterate over each token to find out the class this way. Now I'm required to do additional ObjectOperator/ScopeResolutionOperator checks with the previous token.

stephens2424 commented 7 years ago

Nope. That sounds like a bug. There are other cases I think it does catch, like $null recognizes null as an identifier in that context. Pushing up a fix.