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

Storage class get parsed as attributes #69

Closed
mathias-lang-sociomantic opened this issue Dec 16, 2015 · 1 comment
Closed

Storage class get parsed as attributes #69

mathias-lang-sociomantic opened this issue Dec 16, 2015 · 1 comment
Assignees
Milestone

Comments

@mathias-lang-sociomantic
Copy link
Contributor

Consider:

const Foobar = "Foobar";

Results in:

   1 dparse.parser.Parser.parseModule(1:1)
   2 dparse.parser.Parser.parseDeclaration(1:1)
   3 dparse.parser.Parser.parseAttribute(1:1)
   3 dparse.parser.Parser.parseAttribute(1:7)
   3 dparse.parser.Parser.parseVariableDeclaration(1:7)
   4 dparse.parser.Parser.parseAutoDeclaration(1:7)
   5 dparse.parser.Parser.parseNonVoidInitializer(1:16)
   6 dparse.parser.Parser.parseAssignExpression(1:16)
   7 dparse.parser.Parser.parseTernaryExpression(1:16)
   8 dparse.parser.Parser.parseOrOrExpression(1:16)
   9 dparse.parser.Parser.parseAndAndExpression(1:16)
  10 dparse.parser.Parser.parseOrExpression(1:16)
  11 dparse.parser.Parser.parseXorExpression(1:16)
  12 dparse.parser.Parser.parseAndExpression(1:16)
  13 dparse.parser.Parser.parseCmpExpression(1:16)
  14 dparse.parser.Parser.parseShiftExpression(1:16)
  15 dparse.parser.Parser.parseAddExpression(1:16)
  16 dparse.parser.Parser.parseMulExpression(1:16)
  17 dparse.parser.Parser.parsePowExpression(1:16)
  18 dparse.parser.Parser.parseUnaryExpression(1:16)
  19 dparse.parser.Parser.parsePrimaryExpression(1:16)
  19 dparse.parser.Parser.parsePrimaryExpression(1:24)
  18 dparse.parser.Parser.parseUnaryExpression(1:24)
  17 dparse.parser.Parser.parsePowExpression(1:24)
  16 dparse.parser.Parser.parseMulExpression(1:24)
  15 dparse.parser.Parser.parseAddExpression(1:24)
  14 dparse.parser.Parser.parseShiftExpression(1:24)
  13 dparse.parser.Parser.parseCmpExpression(1:24)
  12 dparse.parser.Parser.parseAndExpression(1:24)
  11 dparse.parser.Parser.parseXorExpression(1:24)
  10 dparse.parser.Parser.parseOrExpression(1:24)
   9 dparse.parser.Parser.parseAndAndExpression(1:24)
   8 dparse.parser.Parser.parseOrOrExpression(1:24)
   7 dparse.parser.Parser.parseTernaryExpression(1:24)
   6 dparse.parser.Parser.parseAssignExpression(1:24)
   5 dparse.parser.Parser.parseNonVoidInitializer(1:24)
   4 dparse.parser.Parser.parseAutoDeclaration(EOF:0)
   3 dparse.parser.Parser.parseVariableDeclaration(EOF:0)
   2 dparse.parser.Parser.parseDeclaration(EOF:0)
   1 dparse.parser.Parser.parseModule(EOF:0)

The problem is, we end up with an AutoDeclaration which has no StorageClass, which is not possible according to the grammar.
(It actually ends up as attribute for the VariableDeclaration instead of AutoDeclaration storage class).

@Hackerpilot Hackerpilot added this to the v0.3.0 milestone Jan 8, 2016
@Hackerpilot Hackerpilot self-assigned this Jan 8, 2016
@Hackerpilot
Copy link
Collaborator

This would be far easier if there wasn't such a huge overlap between attributes and storage classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants