Fix some more tests

This commit is contained in:
Peter Boyer 2016-01-12 09:42:29 -05:00
parent 20e3b385ab
commit 7fc028409e
2 changed files with 5 additions and 5 deletions

View File

@ -159,9 +159,9 @@ True() ::= "true"
Not(v) ::= "!<v>" Not(v) ::= "!<v>"
Assert(s) ::= <<assert(<s>)>> Assert(s) ::= ""
Cast(t,v) ::= "((<t>)<v>)" Cast(t,v) ::= "(<v>)"
Append(a,b) ::= "<a> + fmt.Sprint(<b>)" Append(a,b) ::= "<a> + fmt.Sprint(<b>)"
@ -169,7 +169,7 @@ Concat(a,b) ::= "<a><b>"
DeclareLocal(s,v) ::= "<s> := <v>" DeclareLocal(s,v) ::= "<s> := <v>"
AssertIsList(v) ::= "List\<?> __ttt__ = <v>;" // just use type system AssertIsList(v) ::= ""
AssignLocal(s,v) ::= "<s> = <v>;" AssignLocal(s,v) ::= "<s> = <v>;"

View File

@ -596,7 +596,7 @@ TokenPropertyRef_line(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap
TokenPropertyRef_pos(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { return <ctx(t)>.get<t.label; format={cap}>().GetColumn() }}())" TokenPropertyRef_pos(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { return <ctx(t)>.get<t.label; format={cap}>().GetColumn() }}())"
TokenPropertyRef_channel(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { return <ctx(t)>.get<t.label; format={cap}>().GetChannel() }}())" TokenPropertyRef_channel(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { return <ctx(t)>.get<t.label; format={cap}>().GetChannel() }}())"
TokenPropertyRef_index(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { return <ctx(t)>.get<t.label; format={cap}>().GetTokenIndex() }}())" TokenPropertyRef_index(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { return <ctx(t)>.get<t.label; format={cap}>().GetTokenIndex() }}())"
TokenPropertyRef_int(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { return strconv.Atoi(<ctx(t)>.get<t.label; format={cap}>().GetText()) }}())" TokenPropertyRef_int(t) ::= "(func() int { if <ctx(t)>.get<t.label; format={cap}>() == nil { return 0 } else { i,_ := strconv.Atoi(<ctx(t)>.get<t.label; format={cap}>().GetText()); return i }}())"
RulePropertyRef_start(r) ::= "(func() antlr4.Token { if <ctx(r)>.get<r.label;format={cap}>() == nil { return nil } else { return <ctx(r)>.get<r.label;format={cap}>().GetStart() }}())" RulePropertyRef_start(r) ::= "(func() antlr4.Token { if <ctx(r)>.get<r.label;format={cap}>() == nil { return nil } else { return <ctx(r)>.get<r.label;format={cap}>().GetStart() }}())"
RulePropertyRef_stop(r) ::= "(func() antlr4.Token { if <ctx(r)>.get<r.label;format={cap}>() == nil { return nil } else { return <ctx(r)>.get<r.label;format={cap}>().GetStop() }}())" RulePropertyRef_stop(r) ::= "(func() antlr4.Token { if <ctx(r)>.get<r.label;format={cap}>() == nil { return nil } else { return <ctx(r)>.get<r.label;format={cap}>().GetStop() }}())"
@ -657,7 +657,7 @@ fail: ContextRuleListGetterDecl should never be called!
>> >>
ContextRuleListIndexedGetterDecl(r) ::= << ContextRuleListIndexedGetterDecl(r) ::= <<
<r.name; format="cap">(i int) []*<r.ctxName> { <r.name>(i int) []*<r.ctxName> {
var ts []antlr4.RuleContext; var ts []antlr4.RuleContext;
if i \< 0 { if i \< 0 {