Bug 15404 – [internal] DotIdExp(TOKdot) and DotExp(TOKdotexp)

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-12-04T01:13:00Z
Last change time
2017-08-02T08:07:05Z
Keywords
ice, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2015-12-04T01:13:17Z
In expression.d: extern (C++) final class DotIdExp : UnaExp { public: Identifier ident; extern (D) this(Loc loc, Expression e, Identifier ident) { super(loc, TOKdot, __traits(classInstanceSize, DotIdExp), e); this.ident = ident; } and: extern (C++) final class DotExp : BinExp { public: extern (D) this(Loc loc, Expression e1, Expression e2) { super(loc, TOKdotexp, __traits(classInstanceSize, DotExp), e1, e2); } Few years ago when I started to read dmd code, I had confused about that TOKdot is not associated with DotExp. And also I couldn't understand why there isn't TOKdotid token for DotIdExp, because, in contrast, DotTemplateExp and DotTemplateInstanceExp are using TOKdottd and TOKdotti. The two classes DotIdExp and DotExp have similar names, so the inconsistency of AST class names and token names would be unfriendly for beginner contributors. I'd propose to fix them as: 1. Introduce a new token TOKdotid and use it for DotIdExp. 2. Use TOKdot for DotExp, then remove TOKdotexp.
Comment #1 by k.hara.pg — 2015-12-04T01:56:03Z
Comment #2 by github-bugzilla — 2015-12-04T03:55:32Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c82fa39aae1dbb5960c709fab63aa01150bad684 fix Issue 15404 (1) - Use TOKdotid for DotIdExp https://github.com/D-Programming-Language/dmd/commit/f8b8f70b115dca9818abf2296e84c43304b34be9 fix Issue 15404 (2) - Use TOKdot for DotExp https://github.com/D-Programming-Language/dmd/commit/a98741fb8f2e3c078b1d405d4708b381fa801f1d Merge pull request #5298 from 9rnsr/fix15404 Issue 15404 - [internal] DotIdExp(TOKdot) and DotExp(TOKdotexp)
Comment #3 by github-bugzilla — 2016-01-03T14:02:43Z
Comment #4 by github-bugzilla — 2017-08-02T08:07:05Z
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3013487062c87bb585b1362d80b071f59a28e3fc Issue 15404: Use TOKdotid for DotIdExp, TOKdot for DotExp