-
Notifications
You must be signed in to change notification settings - Fork 69
Add look-ahead for oldstyle decl #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
It seems this fails many tests, I'll investigate in the near future. |
Cool. Tests are passing 🍻 |
compiler/sc1.cpp
Outdated
@@ -5391,6 +5391,13 @@ static void statement(int *lastindent,int allow_decl) | |||
case tDECL: | |||
case tSTATIC: | |||
case tNEW: | |||
if (matchtoken(tSYMBOL)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want this to be if (tok == tNEW && matchtoken(tSYMBOL)) {
otherwise something like static MyMethodMap()
would go into doexpr.
compiler/sc1.cpp
Outdated
if (matchtoken(tSYMBOL)) { | ||
if (lexpeek('(')) { | ||
lexpush(); | ||
goto doxpr_jmp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: s/doxpr_jmp/doexpr_jmp/
Thanks! Looks good. |
This commit prevents anonymous instantiations in the form of
new Class()
from falling into declloc.Fixes #162