Skip to content

Remove the 'Symbol' rule from the grammar. #1427

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hackerpilot
Copy link
Member

http://forum.dlang.org/thread/[email protected]

The Symbol rule only appears as an alternative to the Type, AssignExpression, or Expression rules, but the Symbol rule is a subset of these other rules. Because of this, the grammar is ambiguous.

The difference between a type, expression, and symbol is something that can only be determined during semantic analysis, and thus should not be part of the parse grammar.

@WalterBright
Copy link
Member

But a template argument to an alias parameter can be any symbol, such as a module name. A module name is neither a type nor an expression.

(Types and Expressions can also be ambiguous.)

@Hackerpilot
Copy link
Member Author

Hackerpilot commented Jul 12, 2016

I don't see what that kind of semantic information has to do with creating a parse tree, unless we're going the C++ route of requiring semantic in order to parse.

To clarify, a module name (e.g. std.experimental.allocator) parses as an expression through the PostfixExpression rule.

@JinShil JinShil added the Vision https://wiki.dlang.org/Vision/2018H1 label Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants