Skip to content

Add look-ahead for oldstyle decl#206

Merged
dvander merged 4 commits intoalliedmodders:masterfrom
Headline:add-lookahead
May 4, 2018
Merged

Add look-ahead for oldstyle decl#206
dvander merged 4 commits intoalliedmodders:masterfrom
Headline:add-lookahead

Conversation

@Headline
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Headline commented May 3, 2018

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

@Headline
Copy link
Copy Markdown
Member Author

Headline commented May 3, 2018

Cool. Tests are passing 🍻

Comment thread compiler/sc1.cpp Outdated
case tDECL:
case tSTATIC:
case tNEW:
if (matchtoken(tSYMBOL)) {
Copy link
Copy Markdown
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.

Comment thread compiler/sc1.cpp Outdated
if (matchtoken(tSYMBOL)) {
if (lexpeek('(')) {
lexpush();
goto doxpr_jmp;
Copy link
Copy Markdown
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
Copy Markdown
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