Skip to content

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

Merged
merged 4 commits into from
May 4, 2018
Merged

Add look-ahead for oldstyle decl #206

merged 4 commits into from
May 4, 2018

Conversation

Headline
Copy link
Member

@Headline Headline commented May 3, 2018

This commit prevents anonymous instantiations in the form of new Class() from falling into declloc.

Fixes #162

@Headline
Copy link
Member Author

Headline commented May 3, 2018

It seems this fails many tests, I'll investigate in the near future.

@Headline
Copy link
Member Author

Headline commented May 3, 2018

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)) {
Copy link
Member

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;
Copy link
Member

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/

@dvander
Copy link
Member

dvander commented May 4, 2018

Thanks! Looks good.

@dvander dvander merged commit f691564 into alliedmodders:master May 4, 2018
@Headline Headline deleted the add-lookahead branch May 4, 2018 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants