Support DIP61

This commit is contained in:
Hackerpilot 2014-04-29 15:46:00 -07:00
parent b47b2edbc0
commit bf2531b188
4 changed files with 11 additions and 3 deletions

View File

@ -1 +1 @@
dmd main.d stats.d imports.d highlighter.d ctags.d astprinter.d formatter.d outliner.d std/allocator.d std/lexer.d std/d/ast.d std/d/parser.d std/d/lexer.d analysis/base.d analysis/del.d analysis/enumarrayliteral.d analysis/constructors.d analysis/ifelsesame.d analysis/fish.d analysis/numbers.d analysis/objectconst.d analysis/package.d analysis/pokemon.d analysis/range.d analysis/run.d analysis/style.d -ofdscanner.exe -O -release -noboundscheck -inline
dmd main.d stats.d imports.d highlighter.d ctags.d astprinter.d formatter.d outliner.d std/allocator.d std/lexer.d std/d/ast.d std/d/parser.d std/d/lexer.d analysis/base.d analysis/del.d analysis/enumarrayliteral.d analysis/constructors.d analysis/ifelsesame.d analysis/fish.d analysis/numbers.d analysis/objectconst.d analysis/package.d analysis/pokemon.d analysis/range.d analysis/run.d analysis/style.d -ofdscanner.exe -version=DIP61 -O -release -noboundscheck -inline

View File

@ -10,6 +10,7 @@ dmd\
std/*.d\
std/d/*.d\
analysis/*.d\
-version=DIP61\
-ofdscanner\
-m64 -g\
-O -release

View File

@ -1873,10 +1873,12 @@ final class LinkageAttribute : ASTNode
public:
override void accept(ASTVisitor visitor) const
{
mixin (visitIfNotNull!(identifier));
version (DIP61) mixin (visitIfNotNull!(identifier, identifierChain));
else mixin (visitIfNotNull!(identifier));
}
/** */ Token identifier;
/** */ bool hasPlusPlus;
version (DIP61) /** */ IdentifierChain identifierChain;
mixin OpEquals;
}

View File

@ -3398,7 +3398,7 @@ invariant() foo();
* Parses a LinkageAttribute
*
* $(GRAMMAR $(RULEDEF linkageAttribute):
* $(LITERAL 'extern') $(LITERAL '$(LPAREN)') $(LITERAL Identifier) $(LITERAL '++')? $(LITERAL '$(RPAREN)')
* $(LITERAL 'extern') $(LITERAL '$(LPAREN)') $(LITERAL Identifier) ($(LITERAL '++') ($(LITERAL ',') $(RULE identifierChain))?)? $(LITERAL '$(RPAREN)')
* ;)
*/
LinkageAttribute parseLinkageAttribute()
@ -3414,6 +3414,11 @@ invariant() foo();
{
advance();
node.hasPlusPlus = true;
version(DIP61) if (currentIs(tok!","))
{
advance();
node.identifierChain = parseIdentifierChain();
}
}
expect(tok!")");
return node;