diff --git a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg index 62c472c8a..903014e9e 100644 --- a/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg +++ b/tool/resources/org/antlr/v4/tool/templates/codegen/CSharp/CSharp.stg @@ -645,7 +645,7 @@ testShiftInRange(shiftAmount) ::= << // produces smaller bytecode only when bits.ttypes contains more than two items bitsetBitfieldComparison(s, bits) ::= <% -(})> && ((1L \<\< ) & ()}; separator=" | ">)) != 0) +(})> && ((1L \<\< ) & ()}; separator=" | ">)) != 0) %> isZero ::= [ @@ -659,11 +659,11 @@ offsetShift(shiftAmount, offset) ::= <% // produces more efficient bytecode when bits.ttypes contains at most two items bitsetInlineComparison(s, bits) ::= <% -==}; separator=" || "> +==}; separator=" || "> %> cases(ttypes) ::= << -:}; separator="\n"> +:}; separator="\n"> >> InvokeRule(r, argExprsChunks) ::= << @@ -671,7 +671,7 @@ State = ; = }>< >> MatchToken(m) ::= << -State = ; = }>Match(); +State = ; = }>Match(); >> MatchSet(m, expr, capture) ::= "" @@ -716,7 +716,7 @@ LexerSkipCommand() ::= "Skip();" LexerMoreCommand() ::= "More();" LexerPopModeCommand() ::= "PopMode();" -LexerTypeCommand(arg) ::= "_type = ;" +LexerTypeCommand(arg) ::= "_type = ;" LexerChannelCommand(arg) ::= "_channel = ;" LexerModeCommand(arg) ::= "_mode = ;" LexerPushModeCommand(arg) ::= "PushMode();" @@ -731,7 +731,7 @@ LocalRef(a) ::= "_localctx." RetValueRef(a) ::= "_localctx." QRetValueRef(a) ::= ".." /** How to translate $tokenLabel */ -TokenRef(t) ::= "." +TokenRef(t) ::= "." LabelRef(t) ::= "." ListLabelRef(t) ::= "." SetAttr(s,rhsChunks) ::= ". = ;" @@ -739,13 +739,13 @@ SetAttr(s,rhsChunks) ::= ". = ;" TokenLabelType() ::= "" InputSymbolType() ::= "" -TokenPropertyRef_text(t) ::= "(.!=null?..Text:null)" -TokenPropertyRef_type(t) ::= "(.!=null?..Type:0)" -TokenPropertyRef_line(t) ::= "(.!=null?..Line:0)" -TokenPropertyRef_pos(t) ::= "(.!=null?..CharPositionInLine:0)" -TokenPropertyRef_channel(t) ::= "(.!=null?..Channel:0)" -TokenPropertyRef_index(t) ::= "(.!=null?..TokenIndex:0)" -TokenPropertyRef_int(t) ::= "(.!=null?int.Parse(..Text):0)" +TokenPropertyRef_text(t) ::= "(.!=null?..Text:null)" +TokenPropertyRef_type(t) ::= "(.!=null?..Type:0)" +TokenPropertyRef_line(t) ::= "(.!=null?..Line:0)" +TokenPropertyRef_pos(t) ::= "(.!=null?..CharPositionInLine:0)" +TokenPropertyRef_channel(t) ::= "(.!=null?..Channel:0)" +TokenPropertyRef_index(t) ::= "(.!=null?..TokenIndex:0)" +TokenPropertyRef_int(t) ::= "(.!=null?int.Parse(..Text):0)" RulePropertyRef_start(r) ::= "(.!=null?(..start):null)" RulePropertyRef_stop(r) ::= "(.!=null?(..stop):null)" @@ -763,9 +763,9 @@ SetNonLocalAttr(s, rhsChunks) ::= AddToLabelList(a) ::= "..Add();" -TokenDecl(t) ::= "public ;" -TokenTypeDecl(t) ::= "int ;" -TokenListDecl(t) ::= "public IList\ = new List\();" +TokenDecl(t) ::= "public ;" +TokenTypeDecl(t) ::= "int ;" +TokenListDecl(t) ::= "public IList\ = new List\();" RuleContextDecl(r) ::= "public ;" RuleContextListDecl(rdecl) ::= "public IList\<> = new List\<>();" @@ -774,13 +774,13 @@ contextGetterCollection(elementType) ::= <% %> ContextTokenGetterDecl(t) ::= - "public ITerminalNode () { return GetToken(., 0); }" + "public ITerminalNode () { return GetToken(., 0); }" ContextTokenListGetterDecl(t) ::= << -public () { return GetTokens(.); } +public () { return GetTokens(.); } >> ContextTokenListIndexedGetterDecl(t) ::= << -public ITerminalNode (int i) { - return GetToken(., i); +public ITerminalNode (int i) { + return GetToken(., i); } >> ContextRuleGetterDecl(r) ::= << @@ -806,7 +806,7 @@ LexerRuleContext() ::= "RuleContext" */ RuleContextNameSuffix() ::= "Context" -ImplicitTokenLabel(tokenName) ::= "_" +ImplicitTokenLabel(tokenName) ::= "_" ImplicitRuleLabel(ruleName) ::= "_" ImplicitSetLabel(id) ::= "_tset" ListLabelName(label) ::= "_