Skip to content
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

Add look-ahead for oldstyle decl #206

Merged
merged 4 commits into from May 4, 2018

Conversation

@Headline
Copy link
Member

Headline commented May 3, 2018

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

Fixes #162

@Headline

This comment has been minimized.

Copy link
Member Author

Headline commented May 3, 2018

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

@Headline Headline force-pushed the Headline:add-lookahead branch 2 times, most recently from 9dbe1fb to 00a71ab May 3, 2018
@Headline Headline force-pushed the Headline:add-lookahead branch 3 times, most recently from 2a2e275 to a165bc9 May 3, 2018
@Headline Headline force-pushed the Headline:add-lookahead branch from a165bc9 to e8831ea May 3, 2018
@Headline

This comment has been minimized.

Copy link
Member Author

Headline commented May 3, 2018

Cool. Tests are passing 🍻

@@ -5391,6 +5391,13 @@ static void statement(int *lastindent,int allow_decl)
case tDECL:
case tSTATIC:
case tNEW:
if (matchtoken(tSYMBOL)) {

This comment has been minimized.

Copy link
@dvander

dvander May 4, 2018

Member

I think you want this to be if (tok == tNEW && matchtoken(tSYMBOL)) { otherwise something like static MyMethodMap() would go into doexpr.

if (matchtoken(tSYMBOL)) {
if (lexpeek('(')) {
lexpush();
goto doxpr_jmp;

This comment has been minimized.

Copy link
@dvander

dvander May 4, 2018

Member

nit: s/doxpr_jmp/doexpr_jmp/

@dvander
dvander approved these changes May 4, 2018
@dvander

This comment has been minimized.

Copy link
Member

dvander commented May 4, 2018

Thanks! Looks good.

@dvander dvander merged commit f691564 into alliedmodders:master May 4, 2018
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@Headline Headline deleted the Headline:add-lookahead branch May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.