Support DIP61
This commit is contained in:
parent
b47b2edbc0
commit
bf2531b188
|
@ -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
|
||||||
|
|
1
build.sh
1
build.sh
|
@ -10,6 +10,7 @@ dmd\
|
||||||
std/*.d\
|
std/*.d\
|
||||||
std/d/*.d\
|
std/d/*.d\
|
||||||
analysis/*.d\
|
analysis/*.d\
|
||||||
|
-version=DIP61\
|
||||||
-ofdscanner\
|
-ofdscanner\
|
||||||
-m64 -g\
|
-m64 -g\
|
||||||
-O -release
|
-O -release
|
||||||
|
|
|
@ -1873,10 +1873,12 @@ final class LinkageAttribute : ASTNode
|
||||||
public:
|
public:
|
||||||
override void accept(ASTVisitor visitor) const
|
override void accept(ASTVisitor visitor) const
|
||||||
{
|
{
|
||||||
mixin (visitIfNotNull!(identifier));
|
version (DIP61) mixin (visitIfNotNull!(identifier, identifierChain));
|
||||||
|
else mixin (visitIfNotNull!(identifier));
|
||||||
}
|
}
|
||||||
/** */ Token identifier;
|
/** */ Token identifier;
|
||||||
/** */ bool hasPlusPlus;
|
/** */ bool hasPlusPlus;
|
||||||
|
version (DIP61) /** */ IdentifierChain identifierChain;
|
||||||
mixin OpEquals;
|
mixin OpEquals;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3398,7 +3398,7 @@ invariant() foo();
|
||||||
* Parses a LinkageAttribute
|
* Parses a LinkageAttribute
|
||||||
*
|
*
|
||||||
* $(GRAMMAR $(RULEDEF 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()
|
LinkageAttribute parseLinkageAttribute()
|
||||||
|
@ -3414,6 +3414,11 @@ invariant() foo();
|
||||||
{
|
{
|
||||||
advance();
|
advance();
|
||||||
node.hasPlusPlus = true;
|
node.hasPlusPlus = true;
|
||||||
|
version(DIP61) if (currentIs(tok!","))
|
||||||
|
{
|
||||||
|
advance();
|
||||||
|
node.identifierChain = parseIdentifierChain();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
expect(tok!")");
|
expect(tok!")");
|
||||||
return node;
|
return node;
|
||||||
|
|
Loading…
Reference in New Issue