btwael / mammouth

Unfancy PHP
http://mammouth.boutglay.com
MIT License
214 stars 22 forks source link

Chaining methods -- only first dot #59

Closed Manaus closed 8 years ago

Manaus commented 8 years ago

With the latest version, 3.0.1, I get an error when trying to chain methods, like

matches = page.images.find("selector").not("selector") 
// $matches = $page->images->find("selector")->not("selector");

Looks like the parser is halting at the first dot...

btwael commented 8 years ago

The problem here is that not is a mammouth reserved words so it's not allowed to use it as property or identifier. So maybe you can change not in your library. see this However I will try to add support for reserved words as proprties and class functions Thank you for reporting!