diff --git a/parser/grammar_data_test.go b/parser/grammar_data_test.go index 1db90b21..4079325a 100644 --- a/parser/grammar_data_test.go +++ b/parser/grammar_data_test.go @@ -60,6 +60,7 @@ var grammarTestData = []struct { {"[1,]", "eval", "Expression(body=List(elts=[Num(n=1)], ctx=Load()))", nil, ""}, {"[1,2]", "eval", "Expression(body=List(elts=[Num(n=1), Num(n=2)], ctx=Load()))", nil, ""}, {"[1,2,]", "eval", "Expression(body=List(elts=[Num(n=1), Num(n=2)], ctx=Load()))", nil, ""}, + {"[e for e in (1,2,3)]", "eval", "Expression(body=ListComp(elt=Name(id='e', ctx=Load()), generators=[comprehension(target=Name(id='e', ctx=Store()), iter=Tuple(elts=[Num(n=1), Num(n=2), Num(n=3)], ctx=Load()), ifs=[])]))", nil, ""}, {"( a for a in ab )", "eval", "Expression(body=GeneratorExp(elt=Name(id='a', ctx=Load()), generators=[comprehension(target=Name(id='a', ctx=Store()), iter=Name(id='ab', ctx=Load()), ifs=[])]))", nil, ""}, {"( a for a, in ab )", "eval", "Expression(body=GeneratorExp(elt=Name(id='a', ctx=Load()), generators=[comprehension(target=Tuple(elts=[Name(id='a', ctx=Store())], ctx=Store()), iter=Name(id='ab', ctx=Load()), ifs=[])]))", nil, ""}, {"( a for a, b in ab )", "eval", "Expression(body=GeneratorExp(elt=Name(id='a', ctx=Load()), generators=[comprehension(target=Tuple(elts=[Name(id='a', ctx=Store()), Name(id='b', ctx=Store())], ctx=Store()), iter=Name(id='ab', ctx=Load()), ifs=[])]))", nil, ""}, @@ -260,6 +261,9 @@ var grammarTestData = []struct { {"a, b = *a", "exec", "Module(body=[Assign(targets=[Tuple(elts=[Name(id='a', ctx=Store()), Name(id='b', ctx=Store())], ctx=Store())], value=Starred(value=Name(id='a', ctx=Load()), ctx=Load()))])", nil, ""}, {"a = yield a", "exec", "Module(body=[Assign(targets=[Name(id='a', ctx=Store())], value=Yield(value=Name(id='a', ctx=Load())))])", nil, ""}, {"a.b = 1", "exec", "Module(body=[Assign(targets=[Attribute(value=Name(id='a', ctx=Load()), attr='b', ctx=Store())], value=Num(n=1))])", nil, ""}, + {"[e for e in [1, 2, 3]] = 3", "exec", "", py.SyntaxError, "can't assign to list comprehension"}, + {"{e for e in [1, 2, 3]} = 3", "exec", "", py.SyntaxError, "can't assign to set comprehension"}, + {"{e: e**2 for e in [1, 2, 3]} = 3", "exec", "", py.SyntaxError, "can't assign to dict comprehension"}, {"f() = 1", "exec", "", py.SyntaxError, "can't assign to function call"}, {"lambda: x = 1", "exec", "", py.SyntaxError, "can't assign to lambda"}, {"(a + b) = 1", "exec", "", py.SyntaxError, "can't assign to operator"}, diff --git a/parser/parser.go b/parser/parser.go index ad7b1c8b..4c4cd808 100644 --- a/parser/parser.go +++ b/parser/parser.go @@ -7,5 +7,5 @@ // % go generate // % go build -//go:generate go tool yacc -v y.output grammar.y +//go:generate goyacc -v y.output grammar.y package parser diff --git a/parser/y.go b/parser/y.go index 086b0969..1f5bba73 100644 --- a/parser/y.go +++ b/parser/y.go @@ -2,16 +2,18 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//line grammar.y:2 +// Code generated by goyacc -v y.output grammar.y. DO NOT EDIT. +//line grammar.y:6 package parser import __yyfmt__ "fmt" -//line grammar.y:3 +//line grammar.y:7 // Grammar for Python import ( "fmt" + "github.com/go-python/gpython/ast" "github.com/go-python/gpython/py" ) @@ -100,7 +102,7 @@ func setCtxs(yylex yyLexer, exprs []ast.Expr, ctx ast.ExprContext) { } } -//line grammar.y:99 +//line grammar.y:103 type yySymType struct { yys int pos ast.Pos // kept up to date by the lexer @@ -199,7 +201,10 @@ const SINGLE_INPUT = 57409 const FILE_INPUT = 57410 const EVAL_INPUT = 57411 -var yyToknames = []string{ +var yyToknames = [...]string{ + "$end", + "error", + "$unk", "NEWLINE", "ENDMARKER", "NAME", @@ -290,14 +295,14 @@ var yyToknames = []string{ "FILE_INPUT", "EVAL_INPUT", } -var yyStatenames = []string{} +var yyStatenames = [...]string{} const yyEofCode = 1 const yyErrCode = 2 -const yyMaxDepth = 200 +const yyInitialStackSize = 16 //line yacctab:1 -var yyExca = []int{ +var yyExca = [...]int{ -1, 1, 1, -1, -2, 0, @@ -309,15 +314,11 @@ var yyExca = []int{ -2, 292, } -const yyNprod = 311 const yyPrivate = 57344 -var yyTokenNames []string -var yyStates []string - const yyLast = 1441 -var yyAct = []int{ +var yyAct = [...]int{ 59, 468, 61, 314, 160, 97, 165, 164, 456, 421, 401, 375, 321, 349, 361, 342, 141, 464, 224, 101, @@ -465,7 +466,7 @@ var yyAct = []int{ 0, 0, 0, 0, 0, 0, 0, 83, 0, 0, 78, } -var yyPact = []int{ +var yyPact = [...]int{ -14, -1000, 610, -1000, 1279, -1000, -1000, 380, 64, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 1279, 1279, @@ -517,7 +518,7 @@ var yyPact = []int{ -1000, 121, -1000, 683, 331, -1000, -1000, 1279, -1000, -1000, 1242, 104, -1000, 322, -1000, -1000, 1242, -1000, -1000, } -var yyPgo = []int{ +var yyPgo = [...]int{ 0, 511, 510, 509, 508, 507, 18, 28, 505, 504, 503, 25, 14, 390, 61, 502, 501, 500, 498, 497, @@ -533,7 +534,7 @@ var yyPgo = []int{ 6, 22, 17, 3, 11, 15, 416, 9, 414, 4, 410, 402, 400, 398, 394, } -var yyR1 = []int{ +var yyR1 = [...]int{ 0, 2, 2, 2, 4, 4, 3, 8, 8, 8, 5, 123, 123, 94, 94, 93, 93, 70, 81, 81, @@ -568,7 +569,7 @@ var yyR1 = []int{ 88, 88, 74, 74, 84, 84, 73, 73, 64, 64, 64, } -var yyR2 = []int{ +var yyR2 = [...]int{ 0, 2, 2, 2, 1, 2, 2, 0, 2, 2, 3, 0, 2, 0, 1, 0, 3, 4, 1, 2, @@ -603,7 +604,7 @@ var yyR2 = []int{ 2, 3, 1, 1, 4, 5, 2, 3, 1, 3, 2, } -var yyChk = []int{ +var yyChk = [...]int{ -1000, -2, 90, 91, 92, -4, -6, -13, -9, -31, -30, -32, -33, -34, -35, -36, -38, -14, 52, 64, @@ -655,7 +656,7 @@ var yyChk = []int{ -57, 56, -11, 71, 72, -113, -88, 14, -110, -74, 71, -119, -11, 14, -53, -56, 71, -113, -56, } -var yyDef = []int{ +var yyDef = [...]int{ 0, -2, 0, 7, 0, 1, 4, 0, 64, 152, 153, 154, 155, 156, 157, 158, 159, 66, 0, 0, @@ -707,7 +708,7 @@ var yyDef = []int{ 189, 0, 161, 0, 0, 42, 294, 0, 56, 307, 0, 0, 172, 0, 297, 192, 0, 39, 193, } -var yyTok1 = []int{ +var yyTok1 = [...]int{ 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -723,7 +724,7 @@ var yyTok1 = []int{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 85, 78, 86, 88, } -var yyTok2 = []int{ +var yyTok2 = [...]int{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, @@ -733,28 +734,55 @@ var yyTok2 = []int{ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 90, 91, 92, } -var yyTok3 = []int{ +var yyTok3 = [...]int{ 0, } +var yyErrorMessages = [...]struct { + state int + token int + msg string +}{} + //line yaccpar:1 /* parser for yacc output */ -var yyDebug = 0 +var ( + yyDebug = 0 + yyErrorVerbose = false +) type yyLexer interface { Lex(lval *yySymType) int Error(s string) } +type yyParser interface { + Parse(yyLexer) int + Lookahead() int +} + +type yyParserImpl struct { + lval yySymType + stack [yyInitialStackSize]yySymType + char int +} + +func (p *yyParserImpl) Lookahead() int { + return p.char +} + +func yyNewParser() yyParser { + return &yyParserImpl{} +} + const yyFlag = -1000 func yyTokname(c int) string { - // 4 is TOKSTART above - if c >= 4 && c-4 < len(yyToknames) { - if yyToknames[c-4] != "" { - return yyToknames[c-4] + if c >= 1 && c-1 < len(yyToknames) { + if yyToknames[c-1] != "" { + return yyToknames[c-1] } } return __yyfmt__.Sprintf("tok-%v", c) @@ -769,51 +797,127 @@ func yyStatname(s int) string { return __yyfmt__.Sprintf("state-%v", s) } -func yylex1(lex yyLexer, lval *yySymType) int { - c := 0 - char := lex.Lex(lval) +func yyErrorMessage(state, lookAhead int) string { + const TOKSTART = 4 + + if !yyErrorVerbose { + return "syntax error" + } + + for _, e := range yyErrorMessages { + if e.state == state && e.token == lookAhead { + return "syntax error: " + e.msg + } + } + + res := "syntax error: unexpected " + yyTokname(lookAhead) + + // To match Bison, suggest at most four expected tokens. + expected := make([]int, 0, 4) + + // Look for shiftable tokens. + base := yyPact[state] + for tok := TOKSTART; tok-1 < len(yyToknames); tok++ { + if n := base + tok; n >= 0 && n < yyLast && yyChk[yyAct[n]] == tok { + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + } + + if yyDef[state] == -2 { + i := 0 + for yyExca[i] != -1 || yyExca[i+1] != state { + i += 2 + } + + // Look for tokens that we accept or reduce. + for i += 2; yyExca[i] >= 0; i += 2 { + tok := yyExca[i] + if tok < TOKSTART || yyExca[i+1] == 0 { + continue + } + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + + // If the default action is to accept or reduce, give up. + if yyExca[i+1] != 0 { + return res + } + } + + for i, tok := range expected { + if i == 0 { + res += ", expecting " + } else { + res += " or " + } + res += yyTokname(tok) + } + return res +} + +func yylex1(lex yyLexer, lval *yySymType) (char, token int) { + token = 0 + char = lex.Lex(lval) if char <= 0 { - c = yyTok1[0] + token = yyTok1[0] goto out } if char < len(yyTok1) { - c = yyTok1[char] + token = yyTok1[char] goto out } if char >= yyPrivate { if char < yyPrivate+len(yyTok2) { - c = yyTok2[char-yyPrivate] + token = yyTok2[char-yyPrivate] goto out } } for i := 0; i < len(yyTok3); i += 2 { - c = yyTok3[i+0] - if c == char { - c = yyTok3[i+1] + token = yyTok3[i+0] + if token == char { + token = yyTok3[i+1] goto out } } out: - if c == 0 { - c = yyTok2[1] /* unknown char */ + if token == 0 { + token = yyTok2[1] /* unknown char */ } if yyDebug >= 3 { - __yyfmt__.Printf("lex %s(%d)\n", yyTokname(c), uint(char)) + __yyfmt__.Printf("lex %s(%d)\n", yyTokname(token), uint(char)) } - return c + return char, token } func yyParse(yylex yyLexer) int { + return yyNewParser().Parse(yylex) +} + +func (yyrcvr *yyParserImpl) Parse(yylex yyLexer) int { var yyn int - var yylval yySymType var yyVAL yySymType - yyS := make([]yySymType, yyMaxDepth) + var yyDollar []yySymType + _ = yyDollar // silence set and not used + yyS := yyrcvr.stack[:] Nerrs := 0 /* number of errors */ Errflag := 0 /* error recovery flag */ yystate := 0 - yychar := -1 + yyrcvr.char = -1 + yytoken := -1 // yyrcvr.char translated into internal numbering + defer func() { + // Make sure we report no lookahead when not parsing. + yystate = -1 + yyrcvr.char = -1 + yytoken = -1 + }() yyp := -1 goto yystack @@ -826,7 +930,7 @@ ret1: yystack: /* put a state and value onto the stack */ if yyDebug >= 4 { - __yyfmt__.Printf("char %v in %v\n", yyTokname(yychar), yyStatname(yystate)) + __yyfmt__.Printf("char %v in %v\n", yyTokname(yytoken), yyStatname(yystate)) } yyp++ @@ -843,17 +947,18 @@ yynewstate: if yyn <= yyFlag { goto yydefault /* simple state */ } - if yychar < 0 { - yychar = yylex1(yylex, &yylval) + if yyrcvr.char < 0 { + yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval) } - yyn += yychar + yyn += yytoken if yyn < 0 || yyn >= yyLast { goto yydefault } yyn = yyAct[yyn] - if yyChk[yyn] == yychar { /* valid shift */ - yychar = -1 - yyVAL = yylval + if yyChk[yyn] == yytoken { /* valid shift */ + yyrcvr.char = -1 + yytoken = -1 + yyVAL = yyrcvr.lval yystate = yyn if Errflag > 0 { Errflag-- @@ -865,8 +970,8 @@ yydefault: /* default state action */ yyn = yyDef[yystate] if yyn == -2 { - if yychar < 0 { - yychar = yylex1(yylex, &yylval) + if yyrcvr.char < 0 { + yyrcvr.char, yytoken = yylex1(yylex, &yyrcvr.lval) } /* look through exception table */ @@ -879,7 +984,7 @@ yydefault: } for xi += 2; ; xi += 2 { yyn = yyExca[xi+0] - if yyn < 0 || yyn == yychar { + if yyn < 0 || yyn == yytoken { break } } @@ -892,11 +997,11 @@ yydefault: /* error ... attempt to resume parsing */ switch Errflag { case 0: /* brand new error */ - yylex.Error("syntax error") + yylex.Error(yyErrorMessage(yystate, yytoken)) Nerrs++ if yyDebug >= 1 { __yyfmt__.Printf("%s", yyStatname(yystate)) - __yyfmt__.Printf(" saw %s\n", yyTokname(yychar)) + __yyfmt__.Printf(" saw %s\n", yyTokname(yytoken)) } fallthrough @@ -924,12 +1029,13 @@ yydefault: case 3: /* no shift yet; clobber input char */ if yyDebug >= 2 { - __yyfmt__.Printf("error recovery discards %s\n", yyTokname(yychar)) + __yyfmt__.Printf("error recovery discards %s\n", yyTokname(yytoken)) } - if yychar == yyEofCode { + if yytoken == yyEofCode { goto ret1 } - yychar = -1 + yyrcvr.char = -1 + yytoken = -1 goto yynewstate /* try again in the same state */ } } @@ -944,6 +1050,13 @@ yydefault: _ = yypt // guard against "declared and not used" yyp -= yyR2[yyn] + // yyp is now the index of $0. Perform the default action. Iff the + // reduced production is ε, $1 is possibly out of range. + if yyp+1 >= len(yyS) { + nyys := make([]yySymType, len(yyS)*2) + copy(nyys, yyS) + yyS = nyys + } yyVAL = yyS[yyp+1] /* consult goto table to find next state */ @@ -963,857 +1076,1014 @@ yydefault: switch yynt { case 1: - //line grammar.y:246 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:250 { - yylex.(*yyLex).mod = yyS[yypt-0].mod + yylex.(*yyLex).mod = yyDollar[2].mod return 0 } case 2: - //line grammar.y:251 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:255 { - yylex.(*yyLex).mod = yyS[yypt-0].mod + yylex.(*yyLex).mod = yyDollar[2].mod return 0 } case 3: - //line grammar.y:256 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:260 { - yylex.(*yyLex).mod = yyS[yypt-0].mod + yylex.(*yyLex).mod = yyDollar[2].mod return 0 } case 4: - //line grammar.y:270 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:274 { - yyVAL.mod = &ast.Interactive{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: yyS[yypt-0].stmts} + yyVAL.mod = &ast.Interactive{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: yyDollar[1].stmts} } case 5: - //line grammar.y:274 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:278 { // NB: compound_stmt in single_input is followed by extra NEWLINE! - yyVAL.mod = &ast.Interactive{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: []ast.Stmt{yyS[yypt-1].stmt}} + yyVAL.mod = &ast.Interactive{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: []ast.Stmt{yyDollar[1].stmt}} } case 6: - //line grammar.y:282 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:286 { - yyVAL.mod = &ast.Module{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: yyS[yypt-1].stmts} + yyVAL.mod = &ast.Module{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: yyDollar[1].stmts} } case 7: - //line grammar.y:288 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:292 { yyVAL.stmts = nil } case 8: - //line grammar.y:292 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:296 { } case 9: - //line grammar.y:295 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:299 { - yyVAL.stmts = append(yyVAL.stmts, yyS[yypt-0].stmts...) + yyVAL.stmts = append(yyVAL.stmts, yyDollar[2].stmts...) } case 10: - //line grammar.y:302 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:306 { - yyVAL.mod = &ast.Expression{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: yyS[yypt-2].expr} + yyVAL.mod = &ast.Expression{ModBase: ast.ModBase{Pos: yyVAL.pos}, Body: yyDollar[1].expr} } case 13: - //line grammar.y:311 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:315 { yyVAL.call = &ast.Call{ExprBase: ast.ExprBase{Pos: yyVAL.pos}} } case 14: - //line grammar.y:315 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:319 { - yyVAL.call = yyS[yypt-0].call + yyVAL.call = yyDollar[1].call } case 15: - //line grammar.y:320 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:324 { yyVAL.call = nil } case 16: - //line grammar.y:324 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:328 { - yyVAL.call = yyS[yypt-1].call + yyVAL.call = yyDollar[2].call } case 17: - //line grammar.y:330 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:334 { - fn := &ast.Name{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Id: ast.Identifier(yyS[yypt-2].str), Ctx: ast.Load} - if yyS[yypt-1].call == nil { + fn := &ast.Name{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Id: ast.Identifier(yyDollar[2].str), Ctx: ast.Load} + if yyDollar[3].call == nil { yyVAL.expr = fn } else { - call := *yyS[yypt-1].call + call := *yyDollar[3].call call.Func = fn yyVAL.expr = &call } } case 18: - //line grammar.y:343 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:347 { yyVAL.exprs = nil - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[1].expr) } case 19: - //line grammar.y:348 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:352 { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[2].expr) } case 20: - //line grammar.y:354 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:358 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 21: - //line grammar.y:358 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:362 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 22: - //line grammar.y:364 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:368 { - switch x := (yyS[yypt-0].stmt).(type) { + switch x := (yyDollar[2].stmt).(type) { case *ast.ClassDef: - x.DecoratorList = yyS[yypt-1].exprs + x.DecoratorList = yyDollar[1].exprs yyVAL.stmt = x case *ast.FunctionDef: - x.DecoratorList = yyS[yypt-1].exprs + x.DecoratorList = yyDollar[1].exprs yyVAL.stmt = x default: panic("bad type for decorated") } } case 23: - //line grammar.y:378 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:382 { yyVAL.expr = nil } case 24: - //line grammar.y:382 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:386 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[2].expr } case 25: - //line grammar.y:388 + yyDollar = yyS[yypt-6 : yypt+1] + //line grammar.y:392 { - yyVAL.stmt = &ast.FunctionDef{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Name: ast.Identifier(yyS[yypt-4].str), Args: yyS[yypt-3].arguments, Body: yyS[yypt-0].stmts, Returns: yyS[yypt-2].expr} + yyVAL.stmt = &ast.FunctionDef{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Name: ast.Identifier(yyDollar[2].str), Args: yyDollar[3].arguments, Body: yyDollar[6].stmts, Returns: yyDollar[4].expr} } case 26: - //line grammar.y:394 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:398 { - yyVAL.arguments = yyS[yypt-1].arguments + yyVAL.arguments = yyDollar[2].arguments } case 27: - //line grammar.y:399 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:403 { yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos} } case 28: - //line grammar.y:403 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:407 { - yyVAL.arguments = yyS[yypt-0].arguments + yyVAL.arguments = yyDollar[1].arguments } case 29: - //line grammar.y:410 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:414 { - yyVAL.arg = yyS[yypt-0].arg + yyVAL.arg = yyDollar[1].arg yyVAL.expr = nil } case 30: - //line grammar.y:415 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:419 { - yyVAL.arg = yyS[yypt-2].arg - yyVAL.expr = yyS[yypt-0].expr + yyVAL.arg = yyDollar[1].arg + yyVAL.expr = yyDollar[3].expr } case 31: - //line grammar.y:421 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:425 { yyVAL.args = nil yyVAL.exprs = nil } case 32: - //line grammar.y:426 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:430 { - yyVAL.args = append(yyVAL.args, yyS[yypt-0].arg) - if yyS[yypt-0].expr != nil { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.args = append(yyVAL.args, yyDollar[3].arg) + if yyDollar[3].expr != nil { + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } } case 33: - //line grammar.y:435 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:439 { yyVAL.args = nil - yyVAL.args = append(yyVAL.args, yyS[yypt-0].arg) + yyVAL.args = append(yyVAL.args, yyDollar[1].arg) yyVAL.exprs = nil - if yyS[yypt-0].expr != nil { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + if yyDollar[1].expr != nil { + yyVAL.exprs = append(yyVAL.exprs, yyDollar[1].expr) } } case 34: - //line grammar.y:444 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:448 { - yyVAL.args = append(yyVAL.args, yyS[yypt-0].arg) - if yyS[yypt-0].expr != nil { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.args = append(yyVAL.args, yyDollar[3].arg) + if yyDollar[3].expr != nil { + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } } case 35: - //line grammar.y:452 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:456 { yyVAL.arg = nil } case 36: - //line grammar.y:456 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:460 { - yyVAL.arg = yyS[yypt-0].arg + yyVAL.arg = yyDollar[1].arg } case 37: - //line grammar.y:463 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:467 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-1].args, Defaults: yyS[yypt-1].exprs} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs} } case 38: - //line grammar.y:467 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:471 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-4].args, Defaults: yyS[yypt-4].exprs, Vararg: yyS[yypt-1].arg, Kwonlyargs: yyS[yypt-0].args, KwDefaults: yyS[yypt-0].exprs} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs, Vararg: yyDollar[4].arg, Kwonlyargs: yyDollar[5].args, KwDefaults: yyDollar[5].exprs} } case 39: - //line grammar.y:471 + yyDollar = yyS[yypt-8 : yypt+1] + //line grammar.y:475 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-7].args, Defaults: yyS[yypt-7].exprs, Vararg: yyS[yypt-4].arg, Kwonlyargs: yyS[yypt-3].args, KwDefaults: yyS[yypt-3].exprs, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs, Vararg: yyDollar[4].arg, Kwonlyargs: yyDollar[5].args, KwDefaults: yyDollar[5].exprs, Kwarg: yyDollar[8].arg} } case 40: - //line grammar.y:475 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:479 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-3].args, Defaults: yyS[yypt-3].exprs, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs, Kwarg: yyDollar[4].arg} } case 41: - //line grammar.y:479 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:483 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyS[yypt-1].arg, Kwonlyargs: yyS[yypt-0].args, KwDefaults: yyS[yypt-0].exprs} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyDollar[2].arg, Kwonlyargs: yyDollar[3].args, KwDefaults: yyDollar[3].exprs} } case 42: - //line grammar.y:483 + yyDollar = yyS[yypt-6 : yypt+1] + //line grammar.y:487 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyS[yypt-4].arg, Kwonlyargs: yyS[yypt-3].args, KwDefaults: yyS[yypt-3].exprs, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyDollar[2].arg, Kwonlyargs: yyDollar[3].args, KwDefaults: yyDollar[3].exprs, Kwarg: yyDollar[6].arg} } case 43: - //line grammar.y:487 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:491 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Kwarg: yyDollar[2].arg} } case 44: - //line grammar.y:493 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:497 { - yyVAL.arg = &ast.Arg{Pos: yyVAL.pos, Arg: ast.Identifier(yyS[yypt-0].str)} + yyVAL.arg = &ast.Arg{Pos: yyVAL.pos, Arg: ast.Identifier(yyDollar[1].str)} } case 45: - //line grammar.y:497 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:501 { - yyVAL.arg = &ast.Arg{Pos: yyVAL.pos, Arg: ast.Identifier(yyS[yypt-2].str), Annotation: yyS[yypt-0].expr} + yyVAL.arg = &ast.Arg{Pos: yyVAL.pos, Arg: ast.Identifier(yyDollar[1].str), Annotation: yyDollar[3].expr} } case 46: - //line grammar.y:503 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:507 { - yyVAL.arg = yyS[yypt-0].arg + yyVAL.arg = yyDollar[1].arg yyVAL.expr = nil } case 47: - //line grammar.y:508 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:512 { - yyVAL.arg = yyS[yypt-2].arg - yyVAL.expr = yyS[yypt-0].expr + yyVAL.arg = yyDollar[1].arg + yyVAL.expr = yyDollar[3].expr } case 48: - //line grammar.y:514 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:518 { yyVAL.args = nil yyVAL.exprs = nil } case 49: - //line grammar.y:519 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:523 { - yyVAL.args = append(yyVAL.args, yyS[yypt-0].arg) - if yyS[yypt-0].expr != nil { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.args = append(yyVAL.args, yyDollar[3].arg) + if yyDollar[3].expr != nil { + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } } case 50: - //line grammar.y:528 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:532 { yyVAL.args = nil - yyVAL.args = append(yyVAL.args, yyS[yypt-0].arg) + yyVAL.args = append(yyVAL.args, yyDollar[1].arg) yyVAL.exprs = nil - if yyS[yypt-0].expr != nil { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + if yyDollar[1].expr != nil { + yyVAL.exprs = append(yyVAL.exprs, yyDollar[1].expr) } } case 51: - //line grammar.y:537 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:541 { - yyVAL.args = append(yyVAL.args, yyS[yypt-0].arg) - if yyS[yypt-0].expr != nil { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.args = append(yyVAL.args, yyDollar[3].arg) + if yyDollar[3].expr != nil { + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } } case 52: - //line grammar.y:545 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:549 { yyVAL.arg = nil } case 53: - //line grammar.y:549 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:553 { - yyVAL.arg = yyS[yypt-0].arg + yyVAL.arg = yyDollar[1].arg } case 54: - //line grammar.y:556 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:560 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-1].args, Defaults: yyS[yypt-1].exprs} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs} } case 55: - //line grammar.y:560 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:564 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-4].args, Defaults: yyS[yypt-4].exprs, Vararg: yyS[yypt-1].arg, Kwonlyargs: yyS[yypt-0].args, KwDefaults: yyS[yypt-0].exprs} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs, Vararg: yyDollar[4].arg, Kwonlyargs: yyDollar[5].args, KwDefaults: yyDollar[5].exprs} } case 56: - //line grammar.y:564 + yyDollar = yyS[yypt-8 : yypt+1] + //line grammar.y:568 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-7].args, Defaults: yyS[yypt-7].exprs, Vararg: yyS[yypt-4].arg, Kwonlyargs: yyS[yypt-3].args, KwDefaults: yyS[yypt-3].exprs, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs, Vararg: yyDollar[4].arg, Kwonlyargs: yyDollar[5].args, KwDefaults: yyDollar[5].exprs, Kwarg: yyDollar[8].arg} } case 57: - //line grammar.y:568 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:572 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyS[yypt-3].args, Defaults: yyS[yypt-3].exprs, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Args: yyDollar[1].args, Defaults: yyDollar[1].exprs, Kwarg: yyDollar[4].arg} } case 58: - //line grammar.y:572 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:576 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyS[yypt-1].arg, Kwonlyargs: yyS[yypt-0].args, KwDefaults: yyS[yypt-0].exprs} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyDollar[2].arg, Kwonlyargs: yyDollar[3].args, KwDefaults: yyDollar[3].exprs} } case 59: - //line grammar.y:576 + yyDollar = yyS[yypt-6 : yypt+1] + //line grammar.y:580 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyS[yypt-4].arg, Kwonlyargs: yyS[yypt-3].args, KwDefaults: yyS[yypt-3].exprs, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Vararg: yyDollar[2].arg, Kwonlyargs: yyDollar[3].args, KwDefaults: yyDollar[3].exprs, Kwarg: yyDollar[6].arg} } case 60: - //line grammar.y:580 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:584 { - yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Kwarg: yyS[yypt-0].arg} + yyVAL.arguments = &ast.Arguments{Pos: yyVAL.pos, Kwarg: yyDollar[2].arg} } case 61: - //line grammar.y:586 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:590 { - yyVAL.arg = &ast.Arg{Pos: yyVAL.pos, Arg: ast.Identifier(yyS[yypt-0].str)} + yyVAL.arg = &ast.Arg{Pos: yyVAL.pos, Arg: ast.Identifier(yyDollar[1].str)} } case 62: - //line grammar.y:592 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:596 { - yyVAL.stmts = yyS[yypt-0].stmts + yyVAL.stmts = yyDollar[1].stmts } case 63: - //line grammar.y:596 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:600 { - yyVAL.stmts = []ast.Stmt{yyS[yypt-0].stmt} + yyVAL.stmts = []ast.Stmt{yyDollar[1].stmt} } case 66: - //line grammar.y:604 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:608 { yyVAL.stmts = nil - yyVAL.stmts = append(yyVAL.stmts, yyS[yypt-0].stmt) + yyVAL.stmts = append(yyVAL.stmts, yyDollar[1].stmt) } case 67: - //line grammar.y:609 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:613 { - yyVAL.stmts = append(yyVAL.stmts, yyS[yypt-0].stmt) + yyVAL.stmts = append(yyVAL.stmts, yyDollar[3].stmt) } case 68: - //line grammar.y:615 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:619 { - yyVAL.stmts = yyS[yypt-2].stmts + yyVAL.stmts = yyDollar[1].stmts } case 69: - //line grammar.y:621 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:625 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 70: - //line grammar.y:625 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:629 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 71: - //line grammar.y:629 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:633 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 72: - //line grammar.y:633 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:637 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 73: - //line grammar.y:637 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:641 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 74: - //line grammar.y:641 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:645 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 75: - //line grammar.y:645 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:649 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 76: - //line grammar.y:649 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:653 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 77: - //line grammar.y:676 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:680 { - target := yyS[yypt-2].expr + target := yyDollar[1].expr setCtx(yylex, target, ast.Store) - yyVAL.stmt = &ast.AugAssign{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Target: target, Op: yyS[yypt-1].op, Value: yyS[yypt-0].expr} + yyVAL.stmt = &ast.AugAssign{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Target: target, Op: yyDollar[2].op, Value: yyDollar[3].expr} } case 78: - //line grammar.y:682 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:686 { - targets := []ast.Expr{yyS[yypt-1].expr} - targets = append(targets, yyS[yypt-0].exprs...) + targets := []ast.Expr{yyDollar[1].expr} + targets = append(targets, yyDollar[2].exprs...) value := targets[len(targets)-1] targets = targets[:len(targets)-1] setCtxs(yylex, targets, ast.Store) yyVAL.stmt = &ast.Assign{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Targets: targets, Value: value} } case 79: - //line grammar.y:691 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:695 { - yyVAL.stmt = &ast.ExprStmt{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Value: yyS[yypt-0].expr} + yyVAL.stmt = &ast.ExprStmt{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Value: yyDollar[1].expr} } case 80: - //line grammar.y:697 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:701 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 81: - //line grammar.y:701 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:705 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 82: - //line grammar.y:707 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:711 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 83: - //line grammar.y:711 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:715 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 84: - //line grammar.y:717 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:721 { yyVAL.exprs = nil - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[2].expr) } case 85: - //line grammar.y:722 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:726 { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } case 86: - //line grammar.y:728 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:732 { yyVAL.exprs = nil - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[1].expr) } case 87: - //line grammar.y:733 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:737 { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } case 88: - //line grammar.y:739 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:743 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 89: - //line grammar.y:743 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:747 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 90: - //line grammar.y:748 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:752 { yyVAL.comma = false } case 91: - //line grammar.y:752 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:756 { yyVAL.comma = true } case 92: - //line grammar.y:758 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:762 { - yyVAL.expr = tupleOrExpr(yyVAL.pos, yyS[yypt-1].exprs, yyS[yypt-0].comma) + yyVAL.expr = tupleOrExpr(yyVAL.pos, yyDollar[1].exprs, yyDollar[2].comma) } case 93: - //line grammar.y:764 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:768 { yyVAL.op = ast.Add } case 94: - //line grammar.y:768 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:772 { yyVAL.op = ast.Sub } case 95: - //line grammar.y:772 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:776 { yyVAL.op = ast.Mult } case 96: - //line grammar.y:776 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:780 { yyVAL.op = ast.Div } case 97: - //line grammar.y:780 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:784 { yyVAL.op = ast.Modulo } case 98: - //line grammar.y:784 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:788 { yyVAL.op = ast.BitAnd } case 99: - //line grammar.y:788 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:792 { yyVAL.op = ast.BitOr } case 100: - //line grammar.y:792 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:796 { yyVAL.op = ast.BitXor } case 101: - //line grammar.y:796 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:800 { yyVAL.op = ast.LShift } case 102: - //line grammar.y:800 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:804 { yyVAL.op = ast.RShift } case 103: - //line grammar.y:804 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:808 { yyVAL.op = ast.Pow } case 104: - //line grammar.y:808 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:812 { yyVAL.op = ast.FloorDiv } case 105: - //line grammar.y:815 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:819 { - setCtxs(yylex, yyS[yypt-0].exprs, ast.Del) - yyVAL.stmt = &ast.Delete{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Targets: yyS[yypt-0].exprs} + setCtxs(yylex, yyDollar[2].exprs, ast.Del) + yyVAL.stmt = &ast.Delete{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Targets: yyDollar[2].exprs} } case 106: - //line grammar.y:822 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:826 { yyVAL.stmt = &ast.Pass{StmtBase: ast.StmtBase{Pos: yyVAL.pos}} } case 107: - //line grammar.y:828 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:832 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 108: - //line grammar.y:832 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:836 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 109: - //line grammar.y:836 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:840 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 110: - //line grammar.y:840 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:844 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 111: - //line grammar.y:844 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:848 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 112: - //line grammar.y:850 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:854 { yyVAL.stmt = &ast.Break{StmtBase: ast.StmtBase{Pos: yyVAL.pos}} } case 113: - //line grammar.y:856 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:860 { yyVAL.stmt = &ast.Continue{StmtBase: ast.StmtBase{Pos: yyVAL.pos}} } case 114: - //line grammar.y:862 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:866 { yyVAL.stmt = &ast.Return{StmtBase: ast.StmtBase{Pos: yyVAL.pos}} } case 115: - //line grammar.y:866 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:870 { - yyVAL.stmt = &ast.Return{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Value: yyS[yypt-0].expr} + yyVAL.stmt = &ast.Return{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Value: yyDollar[2].expr} } case 116: - //line grammar.y:872 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:876 { - yyVAL.stmt = &ast.ExprStmt{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Value: yyS[yypt-0].expr} + yyVAL.stmt = &ast.ExprStmt{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Value: yyDollar[1].expr} } case 117: - //line grammar.y:878 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:882 { yyVAL.stmt = &ast.Raise{StmtBase: ast.StmtBase{Pos: yyVAL.pos}} } case 118: - //line grammar.y:882 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:886 { - yyVAL.stmt = &ast.Raise{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Exc: yyS[yypt-0].expr} + yyVAL.stmt = &ast.Raise{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Exc: yyDollar[2].expr} } case 119: - //line grammar.y:886 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:890 { - yyVAL.stmt = &ast.Raise{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Exc: yyS[yypt-2].expr, Cause: yyS[yypt-0].expr} + yyVAL.stmt = &ast.Raise{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Exc: yyDollar[2].expr, Cause: yyDollar[4].expr} } case 120: - //line grammar.y:892 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:896 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 121: - //line grammar.y:896 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:900 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 122: - //line grammar.y:902 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:906 { - yyVAL.stmt = &ast.Import{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Names: yyS[yypt-0].aliases} + yyVAL.stmt = &ast.Import{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Names: yyDollar[2].aliases} } case 123: - //line grammar.y:909 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:913 { yyVAL.level = 1 } case 124: - //line grammar.y:913 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:917 { yyVAL.level = 3 } case 125: - //line grammar.y:919 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:923 { - yyVAL.level = yyS[yypt-0].level + yyVAL.level = yyDollar[1].level } case 126: - //line grammar.y:923 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:927 { - yyVAL.level += yyS[yypt-0].level + yyVAL.level += yyDollar[2].level } case 127: - //line grammar.y:929 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:933 { yyVAL.level = 0 - yyVAL.str = yyS[yypt-0].str + yyVAL.str = yyDollar[1].str } case 128: - //line grammar.y:934 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:938 { - yyVAL.level = yyS[yypt-1].level - yyVAL.str = yyS[yypt-0].str + yyVAL.level = yyDollar[1].level + yyVAL.str = yyDollar[2].str } case 129: - //line grammar.y:939 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:943 { - yyVAL.level = yyS[yypt-0].level + yyVAL.level = yyDollar[1].level yyVAL.str = "" } case 130: - //line grammar.y:946 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:950 { - yyVAL.aliases = []*ast.Alias{{Pos: yyVAL.pos, Name: ast.Identifier("*")}} + yyVAL.aliases = []*ast.Alias{&ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier("*")}} } case 131: - //line grammar.y:950 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:954 { - yyVAL.aliases = yyS[yypt-2].aliases + yyVAL.aliases = yyDollar[2].aliases } case 132: - //line grammar.y:954 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:958 { - yyVAL.aliases = yyS[yypt-1].aliases + yyVAL.aliases = yyDollar[1].aliases } case 133: - //line grammar.y:960 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:964 { - yyVAL.stmt = &ast.ImportFrom{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Module: ast.Identifier(yyS[yypt-2].str), Names: yyS[yypt-0].aliases, Level: yyS[yypt-2].level} + yyVAL.stmt = &ast.ImportFrom{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Module: ast.Identifier(yyDollar[2].str), Names: yyDollar[4].aliases, Level: yyDollar[2].level} } case 134: - //line grammar.y:966 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:970 { - yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyS[yypt-0].str)} + yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyDollar[1].str)} } case 135: - //line grammar.y:970 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:974 { - yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyS[yypt-2].str), AsName: ast.Identifier(yyS[yypt-0].str)} + yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyDollar[1].str), AsName: ast.Identifier(yyDollar[3].str)} } case 136: - //line grammar.y:976 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:980 { - yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyS[yypt-0].str)} + yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyDollar[1].str)} } case 137: - //line grammar.y:980 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:984 { - yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyS[yypt-2].str), AsName: ast.Identifier(yyS[yypt-0].str)} + yyVAL.alias = &ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier(yyDollar[1].str), AsName: ast.Identifier(yyDollar[3].str)} } case 138: - //line grammar.y:986 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:990 { yyVAL.aliases = nil - yyVAL.aliases = append(yyVAL.aliases, yyS[yypt-0].alias) + yyVAL.aliases = append(yyVAL.aliases, yyDollar[1].alias) } case 139: - //line grammar.y:991 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:995 { - yyVAL.aliases = append(yyVAL.aliases, yyS[yypt-0].alias) + yyVAL.aliases = append(yyVAL.aliases, yyDollar[3].alias) } case 140: - //line grammar.y:997 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1001 { yyVAL.aliases = nil - yyVAL.aliases = append(yyVAL.aliases, yyS[yypt-0].alias) + yyVAL.aliases = append(yyVAL.aliases, yyDollar[1].alias) } case 141: - //line grammar.y:1002 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1006 { - yyVAL.aliases = append(yyVAL.aliases, yyS[yypt-0].alias) + yyVAL.aliases = append(yyVAL.aliases, yyDollar[3].alias) } case 142: - //line grammar.y:1008 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1012 { - yyVAL.str = yyS[yypt-0].str + yyVAL.str = yyDollar[1].str } case 143: - //line grammar.y:1012 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1016 { - yyVAL.str += "." + yyS[yypt-0].str + yyVAL.str += "." + yyDollar[3].str } case 144: - //line grammar.y:1018 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1022 { yyVAL.identifiers = nil - yyVAL.identifiers = append(yyVAL.identifiers, ast.Identifier(yyS[yypt-0].str)) + yyVAL.identifiers = append(yyVAL.identifiers, ast.Identifier(yyDollar[1].str)) } case 145: - //line grammar.y:1023 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1027 { - yyVAL.identifiers = append(yyVAL.identifiers, ast.Identifier(yyS[yypt-0].str)) + yyVAL.identifiers = append(yyVAL.identifiers, ast.Identifier(yyDollar[3].str)) } case 146: - //line grammar.y:1029 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1033 { - yyVAL.stmt = &ast.Global{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Names: yyS[yypt-0].identifiers} + yyVAL.stmt = &ast.Global{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Names: yyDollar[2].identifiers} } case 147: - //line grammar.y:1035 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1039 { - yyVAL.stmt = &ast.Nonlocal{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Names: yyS[yypt-0].identifiers} + yyVAL.stmt = &ast.Nonlocal{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Names: yyDollar[2].identifiers} } case 148: - //line grammar.y:1041 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1045 { yyVAL.exprs = nil - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[1].expr) } case 149: - //line grammar.y:1046 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1050 { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } case 150: - //line grammar.y:1052 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1056 { - yyVAL.stmt = &ast.Assert{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyS[yypt-0].expr} + yyVAL.stmt = &ast.Assert{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyDollar[2].expr} } case 151: - //line grammar.y:1056 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1060 { - yyVAL.stmt = &ast.Assert{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyS[yypt-2].expr, Msg: yyS[yypt-0].expr} + yyVAL.stmt = &ast.Assert{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyDollar[2].expr, Msg: yyDollar[4].expr} } case 152: - //line grammar.y:1062 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1066 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 153: - //line grammar.y:1066 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1070 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 154: - //line grammar.y:1070 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1074 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 155: - //line grammar.y:1074 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1078 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 156: - //line grammar.y:1078 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1082 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 157: - //line grammar.y:1082 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1086 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 158: - //line grammar.y:1086 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1090 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 159: - //line grammar.y:1090 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1094 { - yyVAL.stmt = yyS[yypt-0].stmt + yyVAL.stmt = yyDollar[1].stmt } case 160: - //line grammar.y:1095 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:1099 { yyVAL.ifstmt = nil yyVAL.lastif = nil } case 161: - //line grammar.y:1100 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:1104 { elifs := yyVAL.ifstmt - newif := &ast.If{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyS[yypt-2].expr, Body: yyS[yypt-0].stmts} + newif := &ast.If{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyDollar[3].expr, Body: yyDollar[5].stmts} if elifs == nil { yyVAL.ifstmt = newif } else { @@ -1822,25 +2092,28 @@ yydefault: yyVAL.lastif = newif } case 162: - //line grammar.y:1112 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:1116 { yyVAL.stmts = nil } case 163: - //line grammar.y:1116 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1120 { - yyVAL.stmts = yyS[yypt-0].stmts + yyVAL.stmts = yyDollar[3].stmts } case 164: - //line grammar.y:1122 + yyDollar = yyS[yypt-6 : yypt+1] + //line grammar.y:1126 { - newif := &ast.If{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyS[yypt-4].expr, Body: yyS[yypt-2].stmts} + newif := &ast.If{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyDollar[2].expr, Body: yyDollar[4].stmts} yyVAL.stmt = newif - elifs := yyS[yypt-1].ifstmt - optional_else := yyS[yypt-0].stmts + elifs := yyDollar[5].ifstmt + optional_else := yyDollar[6].stmts if len(optional_else) != 0 { if elifs != nil { - yyS[yypt-1].lastif.Orelse = optional_else + yyDollar[5].lastif.Orelse = optional_else newif.Orelse = []ast.Stmt{elifs} } else { newif.Orelse = optional_else @@ -1852,427 +2125,503 @@ yydefault: } } case 165: - //line grammar.y:1143 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:1147 { - yyVAL.stmt = &ast.While{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyS[yypt-3].expr, Body: yyS[yypt-1].stmts, Orelse: yyS[yypt-0].stmts} + yyVAL.stmt = &ast.While{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Test: yyDollar[2].expr, Body: yyDollar[4].stmts, Orelse: yyDollar[5].stmts} } case 166: - //line grammar.y:1149 + yyDollar = yyS[yypt-7 : yypt+1] + //line grammar.y:1153 { - target := tupleOrExpr(yyVAL.pos, yyS[yypt-5].exprs, false) + target := tupleOrExpr(yyVAL.pos, yyDollar[2].exprs, false) setCtx(yylex, target, ast.Store) - yyVAL.stmt = &ast.For{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Target: target, Iter: yyS[yypt-3].expr, Body: yyS[yypt-1].stmts, Orelse: yyS[yypt-0].stmts} + yyVAL.stmt = &ast.For{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Target: target, Iter: yyDollar[4].expr, Body: yyDollar[6].stmts, Orelse: yyDollar[7].stmts} } case 167: - //line grammar.y:1156 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:1160 { yyVAL.exchandlers = nil } case 168: - //line grammar.y:1160 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1164 { - exc := &ast.ExceptHandler{Pos: yyVAL.pos, ExprType: yyS[yypt-2].expr, Name: ast.Identifier(yyS[yypt-2].str), Body: yyS[yypt-0].stmts} + exc := &ast.ExceptHandler{Pos: yyVAL.pos, ExprType: yyDollar[2].expr, Name: ast.Identifier(yyDollar[2].str), Body: yyDollar[4].stmts} yyVAL.exchandlers = append(yyVAL.exchandlers, exc) } case 169: - //line grammar.y:1167 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1171 { - yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyS[yypt-1].stmts, Handlers: yyS[yypt-0].exchandlers} + yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyDollar[3].stmts, Handlers: yyDollar[4].exchandlers} } case 170: - //line grammar.y:1171 + yyDollar = yyS[yypt-7 : yypt+1] + //line grammar.y:1175 { - yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyS[yypt-4].stmts, Handlers: yyS[yypt-3].exchandlers, Orelse: yyS[yypt-0].stmts} + yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyDollar[3].stmts, Handlers: yyDollar[4].exchandlers, Orelse: yyDollar[7].stmts} } case 171: - //line grammar.y:1175 + yyDollar = yyS[yypt-7 : yypt+1] + //line grammar.y:1179 { - yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyS[yypt-4].stmts, Handlers: yyS[yypt-3].exchandlers, Finalbody: yyS[yypt-0].stmts} + yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyDollar[3].stmts, Handlers: yyDollar[4].exchandlers, Finalbody: yyDollar[7].stmts} } case 172: - //line grammar.y:1179 + yyDollar = yyS[yypt-10 : yypt+1] + //line grammar.y:1183 { - yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyS[yypt-7].stmts, Handlers: yyS[yypt-6].exchandlers, Orelse: yyS[yypt-3].stmts, Finalbody: yyS[yypt-0].stmts} + yyVAL.stmt = &ast.Try{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Body: yyDollar[3].stmts, Handlers: yyDollar[4].exchandlers, Orelse: yyDollar[7].stmts, Finalbody: yyDollar[10].stmts} } case 173: - //line grammar.y:1185 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1189 { yyVAL.withitems = nil - yyVAL.withitems = append(yyVAL.withitems, yyS[yypt-0].withitem) + yyVAL.withitems = append(yyVAL.withitems, yyDollar[1].withitem) } case 174: - //line grammar.y:1190 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1194 { - yyVAL.withitems = append(yyVAL.withitems, yyS[yypt-0].withitem) + yyVAL.withitems = append(yyVAL.withitems, yyDollar[3].withitem) } case 175: - //line grammar.y:1196 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1200 { - yyVAL.stmt = &ast.With{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Items: yyS[yypt-2].withitems, Body: yyS[yypt-0].stmts} + yyVAL.stmt = &ast.With{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Items: yyDollar[2].withitems, Body: yyDollar[4].stmts} } case 176: - //line grammar.y:1202 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1206 { - yyVAL.withitem = &ast.WithItem{Pos: yyVAL.pos, ContextExpr: yyS[yypt-0].expr} + yyVAL.withitem = &ast.WithItem{Pos: yyVAL.pos, ContextExpr: yyDollar[1].expr} } case 177: - //line grammar.y:1206 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1210 { - v := yyS[yypt-0].expr + v := yyDollar[3].expr setCtx(yylex, v, ast.Store) - yyVAL.withitem = &ast.WithItem{Pos: yyVAL.pos, ContextExpr: yyS[yypt-2].expr, OptionalVars: v} + yyVAL.withitem = &ast.WithItem{Pos: yyVAL.pos, ContextExpr: yyDollar[1].expr, OptionalVars: v} } case 178: - //line grammar.y:1215 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1219 { yyVAL.expr = nil yyVAL.str = "" } case 179: - //line grammar.y:1220 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1224 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[2].expr yyVAL.str = "" } case 180: - //line grammar.y:1225 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1229 { - yyVAL.expr = yyS[yypt-2].expr - yyVAL.str = yyS[yypt-0].str + yyVAL.expr = yyDollar[2].expr + yyVAL.str = yyDollar[4].str } case 181: - //line grammar.y:1232 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1236 { yyVAL.stmts = nil - yyVAL.stmts = append(yyVAL.stmts, yyS[yypt-0].stmts...) + yyVAL.stmts = append(yyVAL.stmts, yyDollar[1].stmts...) } case 182: - //line grammar.y:1237 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1241 { - yyVAL.stmts = append(yyVAL.stmts, yyS[yypt-0].stmts...) + yyVAL.stmts = append(yyVAL.stmts, yyDollar[2].stmts...) } case 183: - //line grammar.y:1243 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1247 { - yyVAL.stmts = yyS[yypt-0].stmts + yyVAL.stmts = yyDollar[1].stmts } case 184: - //line grammar.y:1247 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1251 { - yyVAL.stmts = yyS[yypt-1].stmts + yyVAL.stmts = yyDollar[3].stmts } case 185: - //line grammar.y:1253 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1257 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 186: - //line grammar.y:1257 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:1261 { - yyVAL.expr = &ast.IfExp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Test: yyS[yypt-2].expr, Body: yyS[yypt-4].expr, Orelse: yyS[yypt-0].expr} + yyVAL.expr = &ast.IfExp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Test: yyDollar[3].expr, Body: yyDollar[1].expr, Orelse: yyDollar[5].expr} } case 187: - //line grammar.y:1261 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1265 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 188: - //line grammar.y:1267 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1271 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 189: - //line grammar.y:1271 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1275 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 190: - //line grammar.y:1277 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1281 { args := &ast.Arguments{Pos: yyVAL.pos} - yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: args, Body: yyS[yypt-0].expr} + yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: args, Body: yyDollar[3].expr} } case 191: - //line grammar.y:1282 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1286 { - yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: yyS[yypt-2].arguments, Body: yyS[yypt-0].expr} + yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: yyDollar[2].arguments, Body: yyDollar[4].expr} } case 192: - //line grammar.y:1288 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1292 { args := &ast.Arguments{Pos: yyVAL.pos} - yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: args, Body: yyS[yypt-0].expr} + yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: args, Body: yyDollar[3].expr} } case 193: - //line grammar.y:1293 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1297 { - yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: yyS[yypt-2].arguments, Body: yyS[yypt-0].expr} + yyVAL.expr = &ast.Lambda{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Args: yyDollar[2].arguments, Body: yyDollar[4].expr} } case 194: - //line grammar.y:1299 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1303 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr yyVAL.isExpr = true } case 195: - //line grammar.y:1304 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1308 { - if !yyS[yypt-2].isExpr { + if !yyDollar[1].isExpr { boolop := yyVAL.expr.(*ast.BoolOp) - boolop.Values = append(boolop.Values, yyS[yypt-0].expr) + boolop.Values = append(boolop.Values, yyDollar[3].expr) } else { - yyVAL.expr = &ast.BoolOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.Or, Values: []ast.Expr{yyVAL.expr, yyS[yypt-0].expr}} + yyVAL.expr = &ast.BoolOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.Or, Values: []ast.Expr{yyVAL.expr, yyDollar[3].expr}} } yyVAL.isExpr = false } case 196: - //line grammar.y:1316 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1320 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr yyVAL.isExpr = true } case 197: - //line grammar.y:1321 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1325 { - if !yyS[yypt-2].isExpr { + if !yyDollar[1].isExpr { boolop := yyVAL.expr.(*ast.BoolOp) - boolop.Values = append(boolop.Values, yyS[yypt-0].expr) + boolop.Values = append(boolop.Values, yyDollar[3].expr) } else { - yyVAL.expr = &ast.BoolOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.And, Values: []ast.Expr{yyVAL.expr, yyS[yypt-0].expr}} + yyVAL.expr = &ast.BoolOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.And, Values: []ast.Expr{yyVAL.expr, yyDollar[3].expr}} } yyVAL.isExpr = false } case 198: - //line grammar.y:1333 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1337 { - yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.Not, Operand: yyS[yypt-0].expr} + yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.Not, Operand: yyDollar[2].expr} } case 199: - //line grammar.y:1337 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1341 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 200: - //line grammar.y:1343 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1347 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr yyVAL.isExpr = true } case 201: - //line grammar.y:1348 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1352 { - if !yyS[yypt-2].isExpr { + if !yyDollar[1].isExpr { comp := yyVAL.expr.(*ast.Compare) - comp.Ops = append(comp.Ops, yyS[yypt-1].cmpop) - comp.Comparators = append(comp.Comparators, yyS[yypt-0].expr) + comp.Ops = append(comp.Ops, yyDollar[2].cmpop) + comp.Comparators = append(comp.Comparators, yyDollar[3].expr) } else { - yyVAL.expr = &ast.Compare{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyVAL.expr, Ops: []ast.CmpOp{yyS[yypt-1].cmpop}, Comparators: []ast.Expr{yyS[yypt-0].expr}} + yyVAL.expr = &ast.Compare{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyVAL.expr, Ops: []ast.CmpOp{yyDollar[2].cmpop}, Comparators: []ast.Expr{yyDollar[3].expr}} } yyVAL.isExpr = false } case 202: - //line grammar.y:1363 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1367 { yyVAL.cmpop = ast.Lt } case 203: - //line grammar.y:1367 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1371 { yyVAL.cmpop = ast.Gt } case 204: - //line grammar.y:1371 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1375 { yyVAL.cmpop = ast.Eq } case 205: - //line grammar.y:1375 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1379 { yyVAL.cmpop = ast.GtE } case 206: - //line grammar.y:1379 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1383 { yyVAL.cmpop = ast.LtE } case 207: - //line grammar.y:1383 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1387 { yylex.(*yyLex).SyntaxError("invalid syntax") } case 208: - //line grammar.y:1387 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1391 { yyVAL.cmpop = ast.NotEq } case 209: - //line grammar.y:1391 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1395 { yyVAL.cmpop = ast.In } case 210: - //line grammar.y:1395 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1399 { yyVAL.cmpop = ast.NotIn } case 211: - //line grammar.y:1399 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1403 { yyVAL.cmpop = ast.Is } case 212: - //line grammar.y:1403 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1407 { yyVAL.cmpop = ast.IsNot } case 213: - //line grammar.y:1409 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1413 { - yyVAL.expr = &ast.Starred{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: yyS[yypt-0].expr, Ctx: ast.Load} + yyVAL.expr = &ast.Starred{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: yyDollar[2].expr, Ctx: ast.Load} } case 214: - //line grammar.y:1415 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1419 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 215: - //line grammar.y:1419 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1423 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.BitOr, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.BitOr, Right: yyDollar[3].expr} } case 216: - //line grammar.y:1425 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1429 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 217: - //line grammar.y:1429 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1433 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.BitXor, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.BitXor, Right: yyDollar[3].expr} } case 218: - //line grammar.y:1435 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1439 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 219: - //line grammar.y:1439 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1443 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.BitAnd, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.BitAnd, Right: yyDollar[3].expr} } case 220: - //line grammar.y:1445 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1449 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 221: - //line grammar.y:1449 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1453 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.LShift, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.LShift, Right: yyDollar[3].expr} } case 222: - //line grammar.y:1453 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1457 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.RShift, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.RShift, Right: yyDollar[3].expr} } case 223: - //line grammar.y:1459 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1463 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 224: - //line grammar.y:1463 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1467 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.Add, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.Add, Right: yyDollar[3].expr} } case 225: - //line grammar.y:1467 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1471 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.Sub, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.Sub, Right: yyDollar[3].expr} } case 226: - //line grammar.y:1473 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1477 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 227: - //line grammar.y:1477 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1481 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.Mult, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.Mult, Right: yyDollar[3].expr} } case 228: - //line grammar.y:1481 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1485 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.Div, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.Div, Right: yyDollar[3].expr} } case 229: - //line grammar.y:1485 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1489 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.Modulo, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.Modulo, Right: yyDollar[3].expr} } case 230: - //line grammar.y:1489 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1493 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyS[yypt-2].expr, Op: ast.FloorDiv, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: yyDollar[1].expr, Op: ast.FloorDiv, Right: yyDollar[3].expr} } case 231: - //line grammar.y:1495 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1499 { - yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.UAdd, Operand: yyS[yypt-0].expr} + yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.UAdd, Operand: yyDollar[2].expr} } case 232: - //line grammar.y:1499 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1503 { - yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.USub, Operand: yyS[yypt-0].expr} + yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.USub, Operand: yyDollar[2].expr} } case 233: - //line grammar.y:1503 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1507 { - yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.Invert, Operand: yyS[yypt-0].expr} + yyVAL.expr = &ast.UnaryOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Op: ast.Invert, Operand: yyDollar[2].expr} } case 234: - //line grammar.y:1507 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1511 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 235: - //line grammar.y:1513 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1517 { - yyVAL.expr = applyTrailers(yyS[yypt-1].expr, yyS[yypt-0].exprs) + yyVAL.expr = applyTrailers(yyDollar[1].expr, yyDollar[2].exprs) } case 236: - //line grammar.y:1517 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1521 { - yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: applyTrailers(yyS[yypt-3].expr, yyS[yypt-2].exprs), Op: ast.Pow, Right: yyS[yypt-0].expr} + yyVAL.expr = &ast.BinOp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Left: applyTrailers(yyDollar[1].expr, yyDollar[2].exprs), Op: ast.Pow, Right: yyDollar[4].expr} } case 237: - //line grammar.y:1523 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:1527 { yyVAL.exprs = nil } case 238: - //line grammar.y:1527 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1531 { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[2].expr) } case 239: - //line grammar.y:1533 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1537 { - yyVAL.obj = yyS[yypt-0].obj + yyVAL.obj = yyDollar[1].obj } case 240: - //line grammar.y:1537 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1541 { switch a := yyVAL.obj.(type) { case py.String: - switch b := yyS[yypt-0].obj.(type) { + switch b := yyDollar[2].obj.(type) { case py.String: yyVAL.obj = a + b default: yylex.(*yyLex).SyntaxError("cannot mix string and nonstring literals") } case py.Bytes: - switch b := yyS[yypt-0].obj.(type) { + switch b := yyDollar[2].obj.(type) { case py.Bytes: yyVAL.obj = append(a, b...) default: @@ -2281,64 +2630,76 @@ yydefault: } } case 241: - //line grammar.y:1558 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1562 { yyVAL.expr = &ast.Tuple{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Ctx: ast.Load} } case 242: - //line grammar.y:1562 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1566 { - yyVAL.expr = yyS[yypt-1].expr + yyVAL.expr = yyDollar[2].expr } case 243: - //line grammar.y:1566 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1570 { - yyVAL.expr = &ast.GeneratorExp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyS[yypt-2].expr, Generators: yyS[yypt-1].comprehensions} + yyVAL.expr = &ast.GeneratorExp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyDollar[2].expr, Generators: yyDollar[3].comprehensions} } case 244: - //line grammar.y:1570 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1574 { - yyVAL.expr = tupleOrExpr(yyVAL.pos, yyS[yypt-2].exprs, yyS[yypt-1].comma) + yyVAL.expr = tupleOrExpr(yyVAL.pos, yyDollar[2].exprs, yyDollar[3].comma) } case 245: - //line grammar.y:1574 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1578 { yyVAL.expr = &ast.List{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Ctx: ast.Load} } case 246: - //line grammar.y:1578 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1582 { - yyVAL.expr = &ast.ListComp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyS[yypt-2].expr, Generators: yyS[yypt-1].comprehensions} + yyVAL.expr = &ast.ListComp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyDollar[2].expr, Generators: yyDollar[3].comprehensions} } case 247: - //line grammar.y:1582 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1586 { - yyVAL.expr = &ast.List{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elts: yyS[yypt-2].exprs, Ctx: ast.Load} + yyVAL.expr = &ast.List{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elts: yyDollar[2].exprs, Ctx: ast.Load} } case 248: - //line grammar.y:1586 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1590 { yyVAL.expr = &ast.Dict{ExprBase: ast.ExprBase{Pos: yyVAL.pos}} } case 249: - //line grammar.y:1590 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1594 { - yyVAL.expr = yyS[yypt-1].expr + yyVAL.expr = yyDollar[2].expr } case 250: - //line grammar.y:1594 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1598 { - yyVAL.expr = &ast.Name{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Id: ast.Identifier(yyS[yypt-0].str), Ctx: ast.Load} + yyVAL.expr = &ast.Name{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Id: ast.Identifier(yyDollar[1].str), Ctx: ast.Load} } case 251: - //line grammar.y:1598 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1602 { - yyVAL.expr = &ast.Num{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, N: yyS[yypt-0].obj} + yyVAL.expr = &ast.Num{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, N: yyDollar[1].obj} } case 252: - //line grammar.y:1602 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1606 { - switch s := yyS[yypt-0].obj.(type) { + switch s := yyDollar[1].obj.(type) { case py.String: yyVAL.expr = &ast.Str{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, S: s} case py.Bytes: @@ -2348,39 +2709,46 @@ yydefault: } } case 253: - //line grammar.y:1613 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1617 { yyVAL.expr = &ast.Ellipsis{ExprBase: ast.ExprBase{Pos: yyVAL.pos}} } case 254: - //line grammar.y:1617 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1621 { yyVAL.expr = &ast.NameConstant{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: py.None} } case 255: - //line grammar.y:1621 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1625 { yyVAL.expr = &ast.NameConstant{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: py.True} } case 256: - //line grammar.y:1625 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1629 { yyVAL.expr = &ast.NameConstant{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: py.False} } case 257: - //line grammar.y:1632 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1636 { yyVAL.expr = &ast.Call{ExprBase: ast.ExprBase{Pos: yyVAL.pos}} } case 258: - //line grammar.y:1636 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1640 { - yyVAL.expr = yyS[yypt-1].call + yyVAL.expr = yyDollar[2].call } case 259: - //line grammar.y:1640 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1644 { - slice := yyS[yypt-1].slice + slice := yyDollar[2].slice // If all items of a ExtSlice are just Index then return as tuple if extslice, ok := slice.(*ast.ExtSlice); ok { elts := make([]ast.Expr, len(extslice.Dims)) @@ -2397,148 +2765,173 @@ yydefault: yyVAL.expr = &ast.Subscript{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Slice: slice, Ctx: ast.Load} } case 260: - //line grammar.y:1658 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1662 { - yyVAL.expr = &ast.Attribute{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Attr: ast.Identifier(yyS[yypt-0].str), Ctx: ast.Load} + yyVAL.expr = &ast.Attribute{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Attr: ast.Identifier(yyDollar[2].str), Ctx: ast.Load} } case 261: - //line grammar.y:1664 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1668 { - yyVAL.slice = yyS[yypt-0].slice + yyVAL.slice = yyDollar[1].slice yyVAL.isExpr = true } case 262: - //line grammar.y:1669 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1673 { - if !yyS[yypt-2].isExpr { + if !yyDollar[1].isExpr { extSlice := yyVAL.slice.(*ast.ExtSlice) - extSlice.Dims = append(extSlice.Dims, yyS[yypt-0].slice) + extSlice.Dims = append(extSlice.Dims, yyDollar[3].slice) } else { - yyVAL.slice = &ast.ExtSlice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Dims: []ast.Slicer{yyS[yypt-2].slice, yyS[yypt-0].slice}} + yyVAL.slice = &ast.ExtSlice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Dims: []ast.Slicer{yyDollar[1].slice, yyDollar[3].slice}} } yyVAL.isExpr = false } case 263: - //line grammar.y:1681 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1685 { - if yyS[yypt-0].comma && yyS[yypt-1].isExpr { - yyVAL.slice = &ast.ExtSlice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Dims: []ast.Slicer{yyS[yypt-1].slice}} + if yyDollar[2].comma && yyDollar[1].isExpr { + yyVAL.slice = &ast.ExtSlice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Dims: []ast.Slicer{yyDollar[1].slice}} } else { - yyVAL.slice = yyS[yypt-1].slice + yyVAL.slice = yyDollar[1].slice } } case 264: - //line grammar.y:1691 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1695 { - yyVAL.slice = &ast.Index{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Value: yyS[yypt-0].expr} + yyVAL.slice = &ast.Index{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Value: yyDollar[1].expr} } case 265: - //line grammar.y:1695 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1699 { yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: nil, Upper: nil, Step: nil} } case 266: - //line grammar.y:1699 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1703 { - yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: nil, Upper: nil, Step: yyS[yypt-0].expr} + yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: nil, Upper: nil, Step: yyDollar[2].expr} } case 267: - //line grammar.y:1703 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1707 { - yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: nil, Upper: yyS[yypt-0].expr, Step: nil} + yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: nil, Upper: yyDollar[2].expr, Step: nil} } case 268: - //line grammar.y:1707 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1711 { - yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: nil, Upper: yyS[yypt-1].expr, Step: yyS[yypt-0].expr} + yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: nil, Upper: yyDollar[2].expr, Step: yyDollar[3].expr} } case 269: - //line grammar.y:1711 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1715 { - yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyS[yypt-1].expr, Upper: nil, Step: nil} + yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyDollar[1].expr, Upper: nil, Step: nil} } case 270: - //line grammar.y:1715 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1719 { - yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyS[yypt-2].expr, Upper: nil, Step: yyS[yypt-0].expr} + yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyDollar[1].expr, Upper: nil, Step: yyDollar[3].expr} } case 271: - //line grammar.y:1719 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1723 { - yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyS[yypt-2].expr, Upper: yyS[yypt-0].expr, Step: nil} + yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyDollar[1].expr, Upper: yyDollar[3].expr, Step: nil} } case 272: - //line grammar.y:1723 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1727 { - yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyS[yypt-3].expr, Upper: yyS[yypt-1].expr, Step: yyS[yypt-0].expr} + yyVAL.slice = &ast.Slice{SliceBase: ast.SliceBase{Pos: yyVAL.pos}, Lower: yyDollar[1].expr, Upper: yyDollar[3].expr, Step: yyDollar[4].expr} } case 273: - //line grammar.y:1729 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1733 { yyVAL.expr = nil } case 274: - //line grammar.y:1733 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1737 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[2].expr } case 275: - //line grammar.y:1739 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1743 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 276: - //line grammar.y:1743 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1747 { - yyVAL.expr = yyS[yypt-0].expr + yyVAL.expr = yyDollar[1].expr } case 277: - //line grammar.y:1749 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1753 { yyVAL.exprs = nil - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[1].expr) } case 278: - //line grammar.y:1754 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1758 { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr) } case 279: - //line grammar.y:1760 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1764 { - yyVAL.exprs = yyS[yypt-1].exprs - yyVAL.comma = yyS[yypt-0].comma + yyVAL.exprs = yyDollar[1].exprs + yyVAL.comma = yyDollar[2].comma } case 280: - //line grammar.y:1767 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1771 { - elts := yyS[yypt-1].exprs - if yyS[yypt-0].comma || len(elts) > 1 { + elts := yyDollar[1].exprs + if yyDollar[2].comma || len(elts) > 1 { yyVAL.expr = &ast.Tuple{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elts: elts, Ctx: ast.Load} } else { yyVAL.expr = elts[0] } } case 281: - //line grammar.y:1778 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1782 { - yyVAL.exprs = yyS[yypt-1].exprs + yyVAL.exprs = yyDollar[1].exprs } case 282: - //line grammar.y:1785 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1789 { yyVAL.exprs = nil - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-2].expr, yyS[yypt-0].expr) // key, value order + yyVAL.exprs = append(yyVAL.exprs, yyDollar[1].expr, yyDollar[3].expr) // key, value order } case 283: - //line grammar.y:1790 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:1794 { - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-2].expr, yyS[yypt-0].expr) + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].expr, yyDollar[5].expr) } case 284: - //line grammar.y:1796 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1800 { - keyValues := yyS[yypt-1].exprs + keyValues := yyDollar[1].exprs d := &ast.Dict{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Keys: nil, Values: nil} for i := 0; i < len(keyValues)-1; i += 2 { d.Keys = append(d.Keys, keyValues[i]) @@ -2547,26 +2940,30 @@ yydefault: yyVAL.expr = d } case 285: - //line grammar.y:1806 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1810 { - yyVAL.expr = &ast.DictComp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Key: yyS[yypt-3].expr, Value: yyS[yypt-1].expr, Generators: yyS[yypt-0].comprehensions} + yyVAL.expr = &ast.DictComp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Key: yyDollar[1].expr, Value: yyDollar[3].expr, Generators: yyDollar[4].comprehensions} } case 286: - //line grammar.y:1810 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1814 { - yyVAL.expr = &ast.Set{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elts: yyS[yypt-0].exprs} + yyVAL.expr = &ast.Set{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elts: yyDollar[1].exprs} } case 287: - //line grammar.y:1814 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1818 { - yyVAL.expr = &ast.SetComp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyS[yypt-1].expr, Generators: yyS[yypt-0].comprehensions} + yyVAL.expr = &ast.SetComp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyDollar[1].expr, Generators: yyDollar[2].comprehensions} } case 288: - //line grammar.y:1820 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:1824 { - classDef := &ast.ClassDef{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Name: ast.Identifier(yyS[yypt-3].str), Body: yyS[yypt-0].stmts} + classDef := &ast.ClassDef{StmtBase: ast.StmtBase{Pos: yyVAL.pos}, Name: ast.Identifier(yyDollar[2].str), Body: yyDollar[5].stmts} yyVAL.stmt = classDef - args := yyS[yypt-2].call + args := yyDollar[3].call if args != nil { classDef.Bases = args.Args classDef.Keywords = args.Keywords @@ -2575,158 +2972,180 @@ yydefault: } } case 289: - //line grammar.y:1834 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1838 { - yyVAL.call = yyS[yypt-0].call + yyVAL.call = yyDollar[1].call } case 290: - //line grammar.y:1838 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1842 { - yyVAL.call.Args = append(yyVAL.call.Args, yyS[yypt-0].call.Args...) - yyVAL.call.Keywords = append(yyVAL.call.Keywords, yyS[yypt-0].call.Keywords...) + yyVAL.call.Args = append(yyVAL.call.Args, yyDollar[3].call.Args...) + yyVAL.call.Keywords = append(yyVAL.call.Keywords, yyDollar[3].call.Keywords...) } case 291: - //line grammar.y:1844 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:1848 { yyVAL.call = &ast.Call{} } case 292: - //line grammar.y:1848 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1852 { - yyVAL.call = yyS[yypt-1].call + yyVAL.call = yyDollar[1].call } case 293: - //line grammar.y:1853 + yyDollar = yyS[yypt-0 : yypt+1] + //line grammar.y:1857 { yyVAL.call = &ast.Call{} } case 294: - //line grammar.y:1857 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1861 { - yyVAL.call.Args = append(yyVAL.call.Args, yyS[yypt-0].call.Args...) - yyVAL.call.Keywords = append(yyVAL.call.Keywords, yyS[yypt-0].call.Keywords...) + yyVAL.call.Args = append(yyVAL.call.Args, yyDollar[3].call.Args...) + yyVAL.call.Keywords = append(yyVAL.call.Keywords, yyDollar[3].call.Keywords...) } case 295: - //line grammar.y:1864 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1868 { - yyVAL.call = yyS[yypt-1].call + yyVAL.call = yyDollar[1].call } case 296: - //line grammar.y:1868 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1872 { - call := yyS[yypt-3].call - call.Starargs = yyS[yypt-1].expr - if len(yyS[yypt-0].call.Args) != 0 { + call := yyDollar[1].call + call.Starargs = yyDollar[3].expr + if len(yyDollar[4].call.Args) != 0 { yylex.(*yyLex).SyntaxError("only named arguments may follow *expression") } - call.Keywords = append(call.Keywords, yyS[yypt-0].call.Keywords...) + call.Keywords = append(call.Keywords, yyDollar[4].call.Keywords...) yyVAL.call = call } case 297: - //line grammar.y:1878 + yyDollar = yyS[yypt-7 : yypt+1] + //line grammar.y:1882 { - call := yyS[yypt-6].call - call.Starargs = yyS[yypt-4].expr - call.Kwargs = yyS[yypt-0].expr - if len(yyS[yypt-3].call.Args) != 0 { + call := yyDollar[1].call + call.Starargs = yyDollar[3].expr + call.Kwargs = yyDollar[7].expr + if len(yyDollar[4].call.Args) != 0 { yylex.(*yyLex).SyntaxError("only named arguments may follow *expression") } - call.Keywords = append(call.Keywords, yyS[yypt-3].call.Keywords...) + call.Keywords = append(call.Keywords, yyDollar[4].call.Keywords...) yyVAL.call = call } case 298: - //line grammar.y:1889 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1893 { - call := yyS[yypt-2].call - call.Kwargs = yyS[yypt-0].expr + call := yyDollar[1].call + call.Kwargs = yyDollar[3].expr yyVAL.call = call } case 299: - //line grammar.y:1899 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1903 { yyVAL.call = &ast.Call{} - yyVAL.call.Args = []ast.Expr{yyS[yypt-0].expr} + yyVAL.call.Args = []ast.Expr{yyDollar[1].expr} } case 300: - //line grammar.y:1904 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1908 { yyVAL.call = &ast.Call{} yyVAL.call.Args = []ast.Expr{ - &ast.GeneratorExp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyS[yypt-1].expr, Generators: yyS[yypt-0].comprehensions}, + &ast.GeneratorExp{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Elt: yyDollar[1].expr, Generators: yyDollar[2].comprehensions}, } } case 301: - //line grammar.y:1911 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1915 { yyVAL.call = &ast.Call{} - test := yyS[yypt-2].expr + test := yyDollar[1].expr if name, ok := test.(*ast.Name); ok { - yyVAL.call.Keywords = []*ast.Keyword{{Pos: name.Pos, Arg: name.Id, Value: yyS[yypt-0].expr}} + yyVAL.call.Keywords = []*ast.Keyword{&ast.Keyword{Pos: name.Pos, Arg: name.Id, Value: yyDollar[3].expr}} } else { yylex.(*yyLex).SyntaxError("keyword can't be an expression") } } case 302: - //line grammar.y:1923 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1927 { - yyVAL.comprehensions = yyS[yypt-0].comprehensions + yyVAL.comprehensions = yyDollar[1].comprehensions yyVAL.exprs = nil } case 303: - //line grammar.y:1928 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1932 { - yyVAL.comprehensions = yyS[yypt-0].comprehensions - yyVAL.exprs = yyS[yypt-0].exprs + yyVAL.comprehensions = yyDollar[1].comprehensions + yyVAL.exprs = yyDollar[1].exprs } case 304: - //line grammar.y:1935 + yyDollar = yyS[yypt-4 : yypt+1] + //line grammar.y:1939 { c := ast.Comprehension{ - Target: tupleOrExpr(yyVAL.pos, yyS[yypt-2].exprs, yyS[yypt-2].comma), - Iter: yyS[yypt-0].expr, + Target: tupleOrExpr(yyVAL.pos, yyDollar[2].exprs, yyDollar[2].comma), + Iter: yyDollar[4].expr, } setCtx(yylex, c.Target, ast.Store) yyVAL.comprehensions = []ast.Comprehension{c} } case 305: - //line grammar.y:1944 + yyDollar = yyS[yypt-5 : yypt+1] + //line grammar.y:1948 { c := ast.Comprehension{ - Target: tupleOrExpr(yyVAL.pos, yyS[yypt-3].exprs, yyS[yypt-3].comma), - Iter: yyS[yypt-1].expr, - Ifs: yyS[yypt-0].exprs, + Target: tupleOrExpr(yyVAL.pos, yyDollar[2].exprs, yyDollar[2].comma), + Iter: yyDollar[4].expr, + Ifs: yyDollar[5].exprs, } setCtx(yylex, c.Target, ast.Store) yyVAL.comprehensions = []ast.Comprehension{c} - yyVAL.comprehensions = append(yyVAL.comprehensions, yyS[yypt-0].comprehensions...) + yyVAL.comprehensions = append(yyVAL.comprehensions, yyDollar[5].comprehensions...) } case 306: - //line grammar.y:1957 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1961 { - yyVAL.exprs = []ast.Expr{yyS[yypt-0].expr} + yyVAL.exprs = []ast.Expr{yyDollar[2].expr} yyVAL.comprehensions = nil } case 307: - //line grammar.y:1962 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1966 { - yyVAL.exprs = []ast.Expr{yyS[yypt-1].expr} - yyVAL.exprs = append(yyVAL.exprs, yyS[yypt-0].exprs...) - yyVAL.comprehensions = yyS[yypt-0].comprehensions + yyVAL.exprs = []ast.Expr{yyDollar[2].expr} + yyVAL.exprs = append(yyVAL.exprs, yyDollar[3].exprs...) + yyVAL.comprehensions = yyDollar[3].comprehensions } case 308: - //line grammar.y:1973 + yyDollar = yyS[yypt-1 : yypt+1] + //line grammar.y:1977 { yyVAL.expr = &ast.Yield{ExprBase: ast.ExprBase{Pos: yyVAL.pos}} } case 309: - //line grammar.y:1977 + yyDollar = yyS[yypt-3 : yypt+1] + //line grammar.y:1981 { - yyVAL.expr = &ast.YieldFrom{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: yyS[yypt-0].expr} + yyVAL.expr = &ast.YieldFrom{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: yyDollar[3].expr} } case 310: - //line grammar.y:1981 + yyDollar = yyS[yypt-2 : yypt+1] + //line grammar.y:1985 { - yyVAL.expr = &ast.Yield{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: yyS[yypt-0].expr} + yyVAL.expr = &ast.Yield{ExprBase: ast.ExprBase{Pos: yyVAL.pos}, Value: yyDollar[2].expr} } } goto yystack /* stack new state and value */ diff --git a/parser/y.output b/parser/y.output index 7b34411d..50da3d9d 100644 --- a/parser/y.output +++ b/parser/y.output @@ -113,7 +113,7 @@ state 3 inputs: FILE_INPUT.file_input nl_or_stmt: . (7) - . reduce 7 (src line 287) + . reduce 7 (src line 291) file_input goto 92 nl_or_stmt goto 93 @@ -161,13 +161,13 @@ state 4 state 5 inputs: SINGLE_INPUT single_input. (1) - . reduce 1 (src line 244) + . reduce 1 (src line 248) state 6 single_input: simple_stmt. (4) - . reduce 4 (src line 261) + . reduce 4 (src line 265) state 7 @@ -183,62 +183,62 @@ state 8 optional_semicolon: . (64) ';' shift 99 - . reduce 64 (src line 600) + . reduce 64 (src line 604) optional_semicolon goto 100 state 9 compound_stmt: if_stmt. (152) - . reduce 152 (src line 1060) + . reduce 152 (src line 1064) state 10 compound_stmt: while_stmt. (153) - . reduce 153 (src line 1065) + . reduce 153 (src line 1069) state 11 compound_stmt: for_stmt. (154) - . reduce 154 (src line 1069) + . reduce 154 (src line 1073) state 12 compound_stmt: try_stmt. (155) - . reduce 155 (src line 1073) + . reduce 155 (src line 1077) state 13 compound_stmt: with_stmt. (156) - . reduce 156 (src line 1077) + . reduce 156 (src line 1081) state 14 compound_stmt: funcdef. (157) - . reduce 157 (src line 1081) + . reduce 157 (src line 1085) state 15 compound_stmt: classdef. (158) - . reduce 158 (src line 1085) + . reduce 158 (src line 1089) state 16 compound_stmt: decorated. (159) - . reduce 159 (src line 1089) + . reduce 159 (src line 1093) state 17 small_stmts: small_stmt. (66) - . reduce 66 (src line 602) + . reduce 66 (src line 606) state 18 @@ -429,55 +429,55 @@ state 25 state 26 small_stmt: expr_stmt. (69) - . reduce 69 (src line 619) + . reduce 69 (src line 623) state 27 small_stmt: del_stmt. (70) - . reduce 70 (src line 624) + . reduce 70 (src line 628) state 28 small_stmt: pass_stmt. (71) - . reduce 71 (src line 628) + . reduce 71 (src line 632) state 29 small_stmt: flow_stmt. (72) - . reduce 72 (src line 632) + . reduce 72 (src line 636) state 30 small_stmt: import_stmt. (73) - . reduce 73 (src line 636) + . reduce 73 (src line 640) state 31 small_stmt: global_stmt. (74) - . reduce 74 (src line 640) + . reduce 74 (src line 644) state 32 small_stmt: nonlocal_stmt. (75) - . reduce 75 (src line 644) + . reduce 75 (src line 648) state 33 small_stmt: assert_stmt. (76) - . reduce 76 (src line 648) + . reduce 76 (src line 652) state 34 decorators: decorator. (18) - . reduce 18 (src line 341) + . reduce 18 (src line 345) state 35 @@ -498,7 +498,7 @@ state 35 HATEQ shift 127 PIPEEQ shift 126 '=' shift 132 - . reduce 79 (src line 690) + . reduce 79 (src line 694) augassign goto 118 equals_yield_expr_or_testlist_star_expr goto 119 @@ -540,49 +540,49 @@ state 36 state 37 pass_stmt: PASS. (106) - . reduce 106 (src line 820) + . reduce 106 (src line 824) state 38 flow_stmt: break_stmt. (107) - . reduce 107 (src line 826) + . reduce 107 (src line 830) state 39 flow_stmt: continue_stmt. (108) - . reduce 108 (src line 831) + . reduce 108 (src line 835) state 40 flow_stmt: return_stmt. (109) - . reduce 109 (src line 835) + . reduce 109 (src line 839) state 41 flow_stmt: raise_stmt. (110) - . reduce 110 (src line 839) + . reduce 110 (src line 843) state 42 flow_stmt: yield_stmt. (111) - . reduce 111 (src line 843) + . reduce 111 (src line 847) state 43 import_stmt: import_name. (120) - . reduce 120 (src line 890) + . reduce 120 (src line 894) state 44 import_stmt: import_from. (121) - . reduce 121 (src line 895) + . reduce 121 (src line 899) state 45 @@ -653,20 +653,20 @@ state 49 optional_comma: . (90) ',' shift 140 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 141 state 50 break_stmt: BREAK. (112) - . reduce 112 (src line 848) + . reduce 112 (src line 852) state 51 continue_stmt: CONTINUE. (113) - . reduce 113 (src line 854) + . reduce 113 (src line 858) state 52 @@ -688,7 +688,7 @@ state 52 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 114 (src line 860) + . reduce 114 (src line 864) strings goto 86 expr goto 69 @@ -729,7 +729,7 @@ state 53 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 117 (src line 876) + . reduce 117 (src line 880) strings goto 86 expr goto 69 @@ -751,7 +751,7 @@ state 53 state 54 yield_stmt: yield_expr. (116) - . reduce 116 (src line 870) + . reduce 116 (src line 874) state 55 @@ -780,7 +780,7 @@ state 56 state 57 test_or_star_exprs: test_or_star_expr. (86) - . reduce 86 (src line 726) + . reduce 86 (src line 730) state 58 @@ -804,7 +804,7 @@ state 58 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 308 (src line 1971) + . reduce 308 (src line 1975) strings goto 86 expr goto 69 @@ -828,13 +828,13 @@ state 58 state 59 test_or_star_expr: test. (88) - . reduce 88 (src line 737) + . reduce 88 (src line 741) state 60 test_or_star_expr: star_expr. (89) - . reduce 89 (src line 742) + . reduce 89 (src line 746) state 61 @@ -844,13 +844,13 @@ state 61 IF shift 155 OR shift 156 - . reduce 185 (src line 1251) + . reduce 185 (src line 1255) state 62 test: lambdef. (187) - . reduce 187 (src line 1260) + . reduce 187 (src line 1264) state 63 @@ -887,7 +887,7 @@ state 64 and_test: and_test.AND not_test AND shift 158 - . reduce 194 (src line 1297) + . reduce 194 (src line 1301) state 65 @@ -908,7 +908,7 @@ state 65 state 66 and_test: not_test. (196) - . reduce 196 (src line 1314) + . reduce 196 (src line 1318) state 67 @@ -957,7 +957,7 @@ state 68 NOT shift 177 '<' shift 169 '>' shift 170 - . reduce 199 (src line 1336) + . reduce 199 (src line 1340) comp_op goto 168 @@ -966,7 +966,7 @@ state 69 expr: expr.'|' xor_expr '|' shift 179 - . reduce 200 (src line 1341) + . reduce 200 (src line 1345) state 70 @@ -974,7 +974,7 @@ state 70 xor_expr: xor_expr.'^' and_expr '^' shift 180 - . reduce 214 (src line 1413) + . reduce 214 (src line 1417) state 71 @@ -982,7 +982,7 @@ state 71 and_expr: and_expr.'&' shift_expr '&' shift 181 - . reduce 216 (src line 1423) + . reduce 216 (src line 1427) state 72 @@ -992,7 +992,7 @@ state 72 LTLT shift 182 GTGT shift 183 - . reduce 218 (src line 1433) + . reduce 218 (src line 1437) state 73 @@ -1002,7 +1002,7 @@ state 73 '+' shift 184 '-' shift 185 - . reduce 220 (src line 1443) + . reduce 220 (src line 1447) state 74 @@ -1016,13 +1016,13 @@ state 74 '*' shift 186 '/' shift 187 '%' shift 188 - . reduce 223 (src line 1457) + . reduce 223 (src line 1461) state 75 term: factor. (226) - . reduce 226 (src line 1471) + . reduce 226 (src line 1475) state 76 @@ -1097,7 +1097,7 @@ state 78 state 79 factor: power. (234) - . reduce 234 (src line 1506) + . reduce 234 (src line 1510) state 80 @@ -1105,7 +1105,7 @@ state 80 power: atom.trailers STARSTAR factor trailers: . (237) - . reduce 237 (src line 1522) + . reduce 237 (src line 1526) trailers goto 193 @@ -1246,13 +1246,13 @@ state 83 state 84 atom: NAME. (250) - . reduce 250 (src line 1593) + . reduce 250 (src line 1597) state 85 atom: NUMBER. (251) - . reduce 251 (src line 1597) + . reduce 251 (src line 1601) state 86 @@ -1260,43 +1260,43 @@ state 86 atom: strings. (252) STRING shift 207 - . reduce 252 (src line 1601) + . reduce 252 (src line 1605) state 87 atom: ELIPSIS. (253) - . reduce 253 (src line 1612) + . reduce 253 (src line 1616) state 88 atom: NONE. (254) - . reduce 254 (src line 1616) + . reduce 254 (src line 1620) state 89 atom: TRUE. (255) - . reduce 255 (src line 1620) + . reduce 255 (src line 1624) state 90 atom: FALSE. (256) - . reduce 256 (src line 1624) + . reduce 256 (src line 1628) state 91 strings: STRING. (239) - . reduce 239 (src line 1531) + . reduce 239 (src line 1535) state 92 inputs: FILE_INPUT file_input. (2) - . reduce 2 (src line 250) + . reduce 2 (src line 254) state 93 @@ -1399,14 +1399,14 @@ state 93 state 94 inputs: EVAL_INPUT eval_input. (3) - . reduce 3 (src line 255) + . reduce 3 (src line 259) state 95 eval_input: testlist.nls ENDMARKER nls: . (11) - . reduce 11 (src line 307) + . reduce 11 (src line 311) nls goto 213 @@ -1416,20 +1416,20 @@ state 96 optional_comma: . (90) ',' shift 214 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 215 state 97 tests: test. (148) - . reduce 148 (src line 1039) + . reduce 148 (src line 1043) state 98 single_input: compound_stmt NEWLINE. (5) - . reduce 5 (src line 273) + . reduce 5 (src line 277) state 99 @@ -1464,7 +1464,7 @@ state 99 '*' shift 63 '{' shift 83 '~' shift 78 - . reduce 65 (src line 600) + . reduce 65 (src line 604) strings goto 86 small_stmt goto 216 @@ -1538,14 +1538,14 @@ state 104 optional_comma: . (90) ',' shift 221 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 222 state 105 expr_or_star_exprs: expr_or_star_expr. (277) - . reduce 277 (src line 1747) + . reduce 277 (src line 1751) state 106 @@ -1553,13 +1553,13 @@ state 106 expr_or_star_expr: expr. (275) '|' shift 179 - . reduce 275 (src line 1737) + . reduce 275 (src line 1741) state 107 expr_or_star_expr: star_expr. (276) - . reduce 276 (src line 1742) + . reduce 276 (src line 1746) state 108 @@ -1652,7 +1652,7 @@ state 109 state 110 with_items: with_item. (173) - . reduce 173 (src line 1183) + . reduce 173 (src line 1187) state 111 @@ -1660,7 +1660,7 @@ state 111 with_item: test.AS expr AS shift 228 - . reduce 176 (src line 1200) + . reduce 176 (src line 1204) state 112 @@ -1676,32 +1676,32 @@ state 113 optional_arglist_call: . (15) '(' shift 232 - . reduce 15 (src line 319) + . reduce 15 (src line 323) optional_arglist_call goto 231 state 114 decorators: decorators decorator. (19) - . reduce 19 (src line 347) + . reduce 19 (src line 351) state 115 decorated: decorators classdef_or_funcdef. (22) - . reduce 22 (src line 362) + . reduce 22 (src line 366) state 116 classdef_or_funcdef: classdef. (20) - . reduce 20 (src line 352) + . reduce 20 (src line 356) state 117 classdef_or_funcdef: funcdef. (21) - . reduce 21 (src line 357) + . reduce 21 (src line 361) state 118 @@ -1751,79 +1751,79 @@ state 119 equals_yield_expr_or_testlist_star_expr: equals_yield_expr_or_testlist_star_expr.'=' yield_expr_or_testlist_star_expr '=' shift 236 - . reduce 78 (src line 681) + . reduce 78 (src line 685) state 120 augassign: PLUSEQ. (93) - . reduce 93 (src line 762) + . reduce 93 (src line 766) state 121 augassign: MINUSEQ. (94) - . reduce 94 (src line 767) + . reduce 94 (src line 771) state 122 augassign: STAREQ. (95) - . reduce 95 (src line 771) + . reduce 95 (src line 775) state 123 augassign: DIVEQ. (96) - . reduce 96 (src line 775) + . reduce 96 (src line 779) state 124 augassign: PERCEQ. (97) - . reduce 97 (src line 779) + . reduce 97 (src line 783) state 125 augassign: ANDEQ. (98) - . reduce 98 (src line 783) + . reduce 98 (src line 787) state 126 augassign: PIPEEQ. (99) - . reduce 99 (src line 787) + . reduce 99 (src line 791) state 127 augassign: HATEQ. (100) - . reduce 100 (src line 791) + . reduce 100 (src line 795) state 128 augassign: LTLTEQ. (101) - . reduce 101 (src line 795) + . reduce 101 (src line 799) state 129 augassign: GTGTEQ. (102) - . reduce 102 (src line 799) + . reduce 102 (src line 803) state 130 augassign: STARSTAREQ. (103) - . reduce 103 (src line 803) + . reduce 103 (src line 807) state 131 augassign: DIVDIVEQ. (104) - . reduce 104 (src line 807) + . reduce 104 (src line 811) state 132 @@ -1874,7 +1874,7 @@ state 132 state 133 del_stmt: DEL exprlist. (105) - . reduce 105 (src line 813) + . reduce 105 (src line 817) state 134 @@ -1882,13 +1882,13 @@ state 134 global_stmt: GLOBAL names. (146) ',' shift 240 - . reduce 146 (src line 1027) + . reduce 146 (src line 1031) state 135 names: NAME. (144) - . reduce 144 (src line 1016) + . reduce 144 (src line 1020) state 136 @@ -1896,7 +1896,7 @@ state 136 nonlocal_stmt: NONLOCAL names. (147) ',' shift 240 - . reduce 147 (src line 1033) + . reduce 147 (src line 1037) state 137 @@ -1904,7 +1904,7 @@ state 137 assert_stmt: ASSERT test.',' test ',' shift 241 - . reduce 150 (src line 1050) + . reduce 150 (src line 1054) state 138 @@ -1914,14 +1914,14 @@ state 138 '(' shift 232 '.' shift 243 - . reduce 15 (src line 319) + . reduce 15 (src line 323) optional_arglist_call goto 242 state 139 dotted_name: NAME. (142) - . reduce 142 (src line 1006) + . reduce 142 (src line 1010) state 140 @@ -1944,7 +1944,7 @@ state 140 '*' shift 63 '{' shift 83 '~' shift 78 - . reduce 91 (src line 751) + . reduce 91 (src line 755) strings goto 86 expr goto 69 @@ -1968,13 +1968,13 @@ state 140 state 141 testlist_star_expr: test_or_star_exprs optional_comma. (92) - . reduce 92 (src line 756) + . reduce 92 (src line 760) state 142 return_stmt: RETURN testlist. (115) - . reduce 115 (src line 865) + . reduce 115 (src line 869) state 143 @@ -1982,7 +1982,7 @@ state 143 raise_stmt: RAISE test.FROM test FROM shift 245 - . reduce 118 (src line 881) + . reduce 118 (src line 885) state 144 @@ -1990,13 +1990,13 @@ state 144 dotted_as_names: dotted_as_names.',' dotted_as_name ',' shift 246 - . reduce 122 (src line 900) + . reduce 122 (src line 904) state 145 dotted_as_names: dotted_as_name. (140) - . reduce 140 (src line 995) + . reduce 140 (src line 999) state 146 @@ -2006,7 +2006,7 @@ state 146 AS shift 247 '.' shift 243 - . reduce 136 (src line 974) + . reduce 136 (src line 978) state 147 @@ -2021,7 +2021,7 @@ state 148 dotted_name: dotted_name.'.' NAME '.' shift 243 - . reduce 127 (src line 927) + . reduce 127 (src line 931) state 149 @@ -2032,7 +2032,7 @@ state 149 NAME shift 139 ELIPSIS shift 152 '.' shift 151 - . reduce 129 (src line 938) + . reduce 129 (src line 942) dot goto 249 dotted_name goto 250 @@ -2040,19 +2040,19 @@ state 149 state 150 dots: dot. (125) - . reduce 125 (src line 917) + . reduce 125 (src line 921) state 151 dot: '.'. (123) - . reduce 123 (src line 907) + . reduce 123 (src line 911) state 152 dot: ELIPSIS. (124) - . reduce 124 (src line 912) + . reduce 124 (src line 916) state 153 @@ -2095,7 +2095,7 @@ state 153 state 154 yield_expr: YIELD testlist. (310) - . reduce 310 (src line 1980) + . reduce 310 (src line 1984) state 155 @@ -2170,7 +2170,7 @@ state 157 expr: expr.'|' xor_expr '|' shift 179 - . reduce 213 (src line 1407) + . reduce 213 (src line 1411) state 158 @@ -2258,7 +2258,7 @@ state 161 optional_comma: . (90) ',' shift 257 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 258 @@ -2268,7 +2268,7 @@ state 162 optional_vfpdef: . (52) NAME shift 166 - . reduce 52 (src line 544) + . reduce 52 (src line 548) vfpdef goto 260 optional_vfpdef goto 259 @@ -2284,7 +2284,7 @@ state 163 state 164 vfpdeftests1: vfpdeftest. (50) - . reduce 50 (src line 526) + . reduce 50 (src line 530) state 165 @@ -2292,19 +2292,19 @@ state 165 vfpdeftest: vfpdef.'=' test '=' shift 262 - . reduce 46 (src line 501) + . reduce 46 (src line 505) state 166 vfpdef: NAME. (61) - . reduce 61 (src line 584) + . reduce 61 (src line 588) state 167 not_test: NOT not_test. (198) - . reduce 198 (src line 1331) + . reduce 198 (src line 1335) state 168 @@ -2339,49 +2339,49 @@ state 168 state 169 comp_op: '<'. (202) - . reduce 202 (src line 1361) + . reduce 202 (src line 1365) state 170 comp_op: '>'. (203) - . reduce 203 (src line 1366) + . reduce 203 (src line 1370) state 171 comp_op: EQEQ. (204) - . reduce 204 (src line 1370) + . reduce 204 (src line 1374) state 172 comp_op: GTEQ. (205) - . reduce 205 (src line 1374) + . reduce 205 (src line 1378) state 173 comp_op: LTEQ. (206) - . reduce 206 (src line 1378) + . reduce 206 (src line 1382) state 174 comp_op: LTGT. (207) - . reduce 207 (src line 1382) + . reduce 207 (src line 1386) state 175 comp_op: PLINGEQ. (208) - . reduce 208 (src line 1386) + . reduce 208 (src line 1390) state 176 comp_op: IN. (209) - . reduce 209 (src line 1390) + . reduce 209 (src line 1394) state 177 @@ -2396,7 +2396,7 @@ state 178 comp_op: IS.NOT NOT shift 265 - . reduce 211 (src line 1398) + . reduce 211 (src line 1402) state 179 @@ -2673,19 +2673,19 @@ state 189 state 190 factor: '+' factor. (231) - . reduce 231 (src line 1493) + . reduce 231 (src line 1497) state 191 factor: '-' factor. (232) - . reduce 232 (src line 1498) + . reduce 232 (src line 1502) state 192 factor: '~' factor. (233) - . reduce 233 (src line 1502) + . reduce 233 (src line 1506) state 193 @@ -2697,14 +2697,14 @@ state 193 '(' shift 279 '[' shift 280 '.' shift 281 - . reduce 235 (src line 1511) + . reduce 235 (src line 1515) trailer goto 278 state 194 atom: '(' ')'. (241) - . reduce 241 (src line 1556) + . reduce 241 (src line 1560) state 195 @@ -2719,7 +2719,7 @@ state 196 atom: '(' test_or_star_expr.comp_for ')' FOR shift 284 - . reduce 86 (src line 726) + . reduce 86 (src line 730) comp_for goto 283 @@ -2729,14 +2729,14 @@ state 197 optional_comma: . (90) ',' shift 140 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 285 state 198 atom: '[' ']'. (245) - . reduce 245 (src line 1573) + . reduce 245 (src line 1577) state 199 @@ -2744,7 +2744,7 @@ state 199 atom: '[' test_or_star_expr.comp_for ']' FOR shift 284 - . reduce 86 (src line 726) + . reduce 86 (src line 730) comp_for goto 286 @@ -2754,14 +2754,14 @@ state 200 optional_comma: . (90) ',' shift 140 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 287 state 201 atom: '{' '}'. (248) - . reduce 248 (src line 1585) + . reduce 248 (src line 1589) state 202 @@ -2777,7 +2777,7 @@ state 203 optional_comma: . (90) ',' shift 289 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 290 @@ -2789,14 +2789,14 @@ state 204 FOR shift 284 ':' shift 291 - . reduce 148 (src line 1039) + . reduce 148 (src line 1043) comp_for goto 292 state 205 dictorsetmaker: testlistraw. (286) - . reduce 286 (src line 1809) + . reduce 286 (src line 1813) state 206 @@ -2805,44 +2805,44 @@ state 206 optional_comma: . (90) ',' shift 214 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 293 state 207 strings: strings STRING. (240) - . reduce 240 (src line 1536) + . reduce 240 (src line 1540) state 208 file_input: nl_or_stmt ENDMARKER. (6) - . reduce 6 (src line 280) + . reduce 6 (src line 284) state 209 nl_or_stmt: nl_or_stmt NEWLINE. (8) - . reduce 8 (src line 291) + . reduce 8 (src line 295) state 210 nl_or_stmt: nl_or_stmt stmt. (9) - . reduce 9 (src line 294) + . reduce 9 (src line 298) state 211 stmt: simple_stmt. (62) - . reduce 62 (src line 590) + . reduce 62 (src line 594) state 212 stmt: compound_stmt. (63) - . reduce 63 (src line 595) + . reduce 63 (src line 599) state 213 @@ -2873,7 +2873,7 @@ state 214 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 91 (src line 751) + . reduce 91 (src line 755) strings goto 86 expr goto 69 @@ -2895,19 +2895,19 @@ state 214 state 215 testlist: tests optional_comma. (280) - . reduce 280 (src line 1765) + . reduce 280 (src line 1769) state 216 small_stmts: small_stmts ';' small_stmt. (67) - . reduce 67 (src line 608) + . reduce 67 (src line 612) state 217 simple_stmt: small_stmts optional_semicolon NEWLINE. (68) - . reduce 68 (src line 613) + . reduce 68 (src line 617) state 218 @@ -3117,7 +3117,7 @@ state 221 '*' shift 63 '{' shift 83 '~' shift 78 - . reduce 91 (src line 751) + . reduce 91 (src line 755) strings goto 86 expr_or_star_expr goto 300 @@ -3135,7 +3135,7 @@ state 221 state 222 exprlist: expr_or_star_exprs optional_comma. (279) - . reduce 279 (src line 1758) + . reduce 279 (src line 1762) state 223 @@ -3145,14 +3145,14 @@ state 223 try_stmt: TRY ':' suite.except_clauses ELSE ':' suite FINALLY ':' suite except_clauses: . (167) - . reduce 167 (src line 1155) + . reduce 167 (src line 1159) except_clauses goto 301 state 224 suite: simple_stmt. (183) - . reduce 183 (src line 1241) + . reduce 183 (src line 1245) state 225 @@ -3309,7 +3309,7 @@ state 229 optional_return_type: . (23) MINUSGT shift 307 - . reduce 23 (src line 377) + . reduce 23 (src line 381) optional_return_type goto 306 @@ -3320,7 +3320,7 @@ state 230 NAME shift 315 STARSTAR shift 312 '*' shift 311 - . reduce 27 (src line 398) + . reduce 27 (src line 402) tfpdeftest goto 313 tfpdef goto 314 @@ -3350,13 +3350,13 @@ state 232 LAMBDA shift 65 NOT shift 67 '(' shift 81 - ')' reduce 13 (src line 310) + ')' reduce 13 (src line 314) '[' shift 82 '+' shift 76 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 291 (src line 1843) + . reduce 291 (src line 1847) strings goto 86 expr goto 69 @@ -3383,19 +3383,19 @@ state 232 state 233 expr_stmt: testlist_star_expr augassign yield_expr_or_testlist. (77) - . reduce 77 (src line 674) + . reduce 77 (src line 678) state 234 yield_expr_or_testlist: yield_expr. (80) - . reduce 80 (src line 695) + . reduce 80 (src line 699) state 235 yield_expr_or_testlist: testlist. (81) - . reduce 81 (src line 700) + . reduce 81 (src line 704) state 236 @@ -3446,19 +3446,19 @@ state 236 state 237 equals_yield_expr_or_testlist_star_expr: '=' yield_expr_or_testlist_star_expr. (84) - . reduce 84 (src line 715) + . reduce 84 (src line 719) state 238 yield_expr_or_testlist_star_expr: yield_expr. (82) - . reduce 82 (src line 705) + . reduce 82 (src line 709) state 239 yield_expr_or_testlist_star_expr: testlist_star_expr. (83) - . reduce 83 (src line 710) + . reduce 83 (src line 714) state 240 @@ -3522,7 +3522,7 @@ state 243 state 244 test_or_star_exprs: test_or_star_exprs ',' test_or_star_expr. (87) - . reduce 87 (src line 732) + . reduce 87 (src line 736) state 245 @@ -3593,7 +3593,7 @@ state 248 state 249 dots: dots dot. (126) - . reduce 126 (src line 922) + . reduce 126 (src line 926) state 250 @@ -3601,13 +3601,13 @@ state 250 dotted_name: dotted_name.'.' NAME '.' shift 243 - . reduce 128 (src line 933) + . reduce 128 (src line 937) state 251 yield_expr: YIELD FROM test. (309) - . reduce 309 (src line 1976) + . reduce 309 (src line 1980) state 252 @@ -3624,19 +3624,19 @@ state 253 and_test: and_test.AND not_test AND shift 158 - . reduce 195 (src line 1303) + . reduce 195 (src line 1307) state 254 and_test: and_test AND not_test. (197) - . reduce 197 (src line 1320) + . reduce 197 (src line 1324) state 255 lambdef: LAMBDA ':' test. (190) - . reduce 190 (src line 1275) + . reduce 190 (src line 1279) state 256 @@ -3686,7 +3686,7 @@ state 257 NAME shift 166 STARSTAR shift 341 '*' shift 340 - . reduce 91 (src line 751) + . reduce 91 (src line 755) vfpdeftest goto 339 vfpdef goto 165 @@ -3694,7 +3694,7 @@ state 257 state 258 varargslist: vfpdeftests1 optional_comma. (54) - . reduce 54 (src line 554) + . reduce 54 (src line 558) state 259 @@ -3702,20 +3702,20 @@ state 259 varargslist: '*' optional_vfpdef.vfpdeftests ',' STARSTAR vfpdef vfpdeftests: . (48) - . reduce 48 (src line 513) + . reduce 48 (src line 517) vfpdeftests goto 342 state 260 optional_vfpdef: vfpdef. (53) - . reduce 53 (src line 548) + . reduce 53 (src line 552) state 261 varargslist: STARSTAR vfpdef. (60) - . reduce 60 (src line 579) + . reduce 60 (src line 583) state 262 @@ -3760,19 +3760,19 @@ state 263 expr: expr.'|' xor_expr '|' shift 179 - . reduce 201 (src line 1347) + . reduce 201 (src line 1351) state 264 comp_op: NOT IN. (210) - . reduce 210 (src line 1394) + . reduce 210 (src line 1398) state 265 comp_op: IS NOT. (212) - . reduce 212 (src line 1402) + . reduce 212 (src line 1406) state 266 @@ -3780,7 +3780,7 @@ state 266 xor_expr: xor_expr.'^' and_expr '^' shift 180 - . reduce 215 (src line 1418) + . reduce 215 (src line 1422) state 267 @@ -3788,7 +3788,7 @@ state 267 and_expr: and_expr.'&' shift_expr '&' shift 181 - . reduce 217 (src line 1428) + . reduce 217 (src line 1432) state 268 @@ -3798,7 +3798,7 @@ state 268 LTLT shift 182 GTGT shift 183 - . reduce 219 (src line 1438) + . reduce 219 (src line 1442) state 269 @@ -3808,7 +3808,7 @@ state 269 '+' shift 184 '-' shift 185 - . reduce 221 (src line 1448) + . reduce 221 (src line 1452) state 270 @@ -3818,7 +3818,7 @@ state 270 '+' shift 184 '-' shift 185 - . reduce 222 (src line 1452) + . reduce 222 (src line 1456) state 271 @@ -3832,7 +3832,7 @@ state 271 '*' shift 186 '/' shift 187 '%' shift 188 - . reduce 224 (src line 1462) + . reduce 224 (src line 1466) state 272 @@ -3846,31 +3846,31 @@ state 272 '*' shift 186 '/' shift 187 '%' shift 188 - . reduce 225 (src line 1466) + . reduce 225 (src line 1470) state 273 term: term '*' factor. (227) - . reduce 227 (src line 1476) + . reduce 227 (src line 1480) state 274 term: term '/' factor. (228) - . reduce 228 (src line 1480) + . reduce 228 (src line 1484) state 275 term: term '%' factor. (229) - . reduce 229 (src line 1484) + . reduce 229 (src line 1488) state 276 term: term DIVDIV factor. (230) - . reduce 230 (src line 1488) + . reduce 230 (src line 1492) state 277 @@ -3899,7 +3899,7 @@ state 277 state 278 trailers: trailers trailer. (238) - . reduce 238 (src line 1526) + . reduce 238 (src line 1530) state 279 @@ -3923,7 +3923,7 @@ state 279 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 291 (src line 1843) + . reduce 291 (src line 1847) strings goto 86 expr goto 69 @@ -3997,7 +3997,7 @@ state 281 state 282 atom: '(' yield_expr ')'. (242) - . reduce 242 (src line 1561) + . reduce 242 (src line 1565) state 283 @@ -4066,7 +4066,7 @@ state 287 state 288 atom: '{' dictorsetmaker '}'. (249) - . reduce 249 (src line 1589) + . reduce 249 (src line 1593) state 289 @@ -4088,7 +4088,7 @@ state 289 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 91 (src line 751) + . reduce 91 (src line 755) strings goto 86 expr goto 69 @@ -4110,7 +4110,7 @@ state 289 state 290 dictorsetmaker: test_colon_tests optional_comma. (284) - . reduce 284 (src line 1794) + . reduce 284 (src line 1798) state 291 @@ -4154,38 +4154,38 @@ state 291 state 292 dictorsetmaker: test comp_for. (287) - . reduce 287 (src line 1813) + . reduce 287 (src line 1817) state 293 testlistraw: tests optional_comma. (281) - . reduce 281 (src line 1776) + . reduce 281 (src line 1780) state 294 eval_input: testlist nls ENDMARKER. (10) - . reduce 10 (src line 300) + . reduce 10 (src line 304) state 295 nls: nls NEWLINE. (12) - . reduce 12 (src line 308) + . reduce 12 (src line 312) state 296 tests: tests ',' test. (149) - . reduce 149 (src line 1045) + . reduce 149 (src line 1049) state 297 if_stmt: IF test ':' suite.elifs optional_else elifs: . (160) - . reduce 160 (src line 1094) + . reduce 160 (src line 1098) elifs goto 360 @@ -4194,7 +4194,7 @@ state 298 optional_else: . (162) ELSE shift 362 - . reduce 162 (src line 1111) + . reduce 162 (src line 1115) optional_else goto 361 @@ -4208,7 +4208,7 @@ state 299 state 300 expr_or_star_exprs: expr_or_star_exprs ',' expr_or_star_expr. (278) - . reduce 278 (src line 1753) + . reduce 278 (src line 1757) state 301 @@ -4221,7 +4221,7 @@ state 301 ELSE shift 365 EXCEPT shift 367 FINALLY shift 366 - . reduce 169 (src line 1165) + . reduce 169 (src line 1169) except_clause goto 364 @@ -4322,13 +4322,13 @@ state 302 state 303 with_items: with_items ',' with_item. (174) - . reduce 174 (src line 1189) + . reduce 174 (src line 1193) state 304 with_stmt: WITH with_items ':' suite. (175) - . reduce 175 (src line 1194) + . reduce 175 (src line 1198) state 305 @@ -4336,7 +4336,7 @@ state 305 expr: expr.'|' xor_expr '|' shift 179 - . reduce 177 (src line 1205) + . reduce 177 (src line 1209) state 306 @@ -4393,7 +4393,7 @@ state 308 state 309 optional_typedargslist: typedargslist. (28) - . reduce 28 (src line 402) + . reduce 28 (src line 406) state 310 @@ -4405,7 +4405,7 @@ state 310 optional_comma: . (90) ',' shift 373 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 374 @@ -4415,7 +4415,7 @@ state 311 optional_tfpdef: . (35) NAME shift 315 - . reduce 35 (src line 451) + . reduce 35 (src line 455) tfpdef goto 376 optional_tfpdef goto 375 @@ -4431,7 +4431,7 @@ state 312 state 313 tfpdeftests1: tfpdeftest. (33) - . reduce 33 (src line 433) + . reduce 33 (src line 437) state 314 @@ -4439,7 +4439,7 @@ state 314 tfpdeftest: tfpdef.'=' test '=' shift 378 - . reduce 29 (src line 408) + . reduce 29 (src line 412) state 315 @@ -4447,7 +4447,7 @@ state 315 tfpdef: NAME.':' test ':' shift 379 - . reduce 44 (src line 491) + . reduce 44 (src line 495) state 316 @@ -4535,7 +4535,7 @@ state 317 state 318 optional_arglist: arglist. (14) - . reduce 14 (src line 314) + . reduce 14 (src line 318) state 319 @@ -4545,7 +4545,7 @@ state 319 optional_comma: . (90) ',' shift 382 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 383 @@ -4562,7 +4562,7 @@ state 320 state 321 arguments: argument. (289) - . reduce 289 (src line 1832) + . reduce 289 (src line 1836) state 322 @@ -4572,68 +4572,68 @@ state 322 FOR shift 284 '=' shift 387 - . reduce 299 (src line 1897) + . reduce 299 (src line 1901) comp_for goto 386 state 323 equals_yield_expr_or_testlist_star_expr: equals_yield_expr_or_testlist_star_expr '=' yield_expr_or_testlist_star_expr. (85) - . reduce 85 (src line 721) + . reduce 85 (src line 725) state 324 names: names ',' NAME. (145) - . reduce 145 (src line 1022) + . reduce 145 (src line 1026) state 325 assert_stmt: ASSERT test ',' test. (151) - . reduce 151 (src line 1055) + . reduce 151 (src line 1059) state 326 decorator: '@' dotted_name optional_arglist_call NEWLINE. (17) - . reduce 17 (src line 328) + . reduce 17 (src line 332) state 327 dotted_name: dotted_name '.' NAME. (143) - . reduce 143 (src line 1011) + . reduce 143 (src line 1015) state 328 raise_stmt: RAISE test FROM test. (119) - . reduce 119 (src line 885) + . reduce 119 (src line 889) state 329 dotted_as_names: dotted_as_names ',' dotted_as_name. (141) - . reduce 141 (src line 1001) + . reduce 141 (src line 1005) state 330 dotted_as_name: dotted_name AS NAME. (137) - . reduce 137 (src line 979) + . reduce 137 (src line 983) state 331 import_from: FROM from_arg IMPORT import_from_arg. (133) - . reduce 133 (src line 958) + . reduce 133 (src line 962) state 332 import_from_arg: '*'. (130) - . reduce 130 (src line 944) + . reduce 130 (src line 948) state 333 @@ -4651,14 +4651,14 @@ state 334 optional_comma: . (90) ',' shift 390 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 389 state 335 import_as_names: import_as_name. (138) - . reduce 138 (src line 984) + . reduce 138 (src line 988) state 336 @@ -4666,7 +4666,7 @@ state 336 import_as_name: NAME.AS NAME AS shift 391 - . reduce 134 (src line 964) + . reduce 134 (src line 968) state 337 @@ -4709,13 +4709,13 @@ state 337 state 338 lambdef: LAMBDA varargslist ':' test. (191) - . reduce 191 (src line 1281) + . reduce 191 (src line 1285) state 339 vfpdeftests1: vfpdeftests1 ',' vfpdeftest. (51) - . reduce 51 (src line 536) + . reduce 51 (src line 540) state 340 @@ -4724,7 +4724,7 @@ state 340 optional_vfpdef: . (52) NAME shift 166 - . reduce 52 (src line 544) + . reduce 52 (src line 548) vfpdef goto 260 optional_vfpdef goto 393 @@ -4743,25 +4743,25 @@ state 342 varargslist: '*' optional_vfpdef vfpdeftests.',' STARSTAR vfpdef ',' shift 395 - . reduce 58 (src line 571) + . reduce 58 (src line 575) state 343 vfpdeftest: vfpdef '=' test. (47) - . reduce 47 (src line 507) + . reduce 47 (src line 511) state 344 power: atom trailers STARSTAR factor. (236) - . reduce 236 (src line 1516) + . reduce 236 (src line 1520) state 345 trailer: '(' ')'. (257) - . reduce 257 (src line 1630) + . reduce 257 (src line 1634) state 346 @@ -4784,14 +4784,14 @@ state 348 optional_comma: . (90) ',' shift 398 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 399 state 349 subscripts: subscript. (261) - . reduce 261 (src line 1662) + . reduce 261 (src line 1666) state 350 @@ -4802,7 +4802,7 @@ state 350 subscript: test.':' test sliceop ':' shift 400 - . reduce 264 (src line 1689) + . reduce 264 (src line 1693) state 351 @@ -4827,7 +4827,7 @@ state 351 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 265 (src line 1694) + . reduce 265 (src line 1698) strings goto 86 expr goto 69 @@ -4850,13 +4850,13 @@ state 351 state 352 trailer: '.' NAME. (260) - . reduce 260 (src line 1657) + . reduce 260 (src line 1661) state 353 atom: '(' test_or_star_expr comp_for ')'. (243) - . reduce 243 (src line 1565) + . reduce 243 (src line 1569) state 354 @@ -4870,19 +4870,19 @@ state 354 state 355 atom: '(' test_or_star_exprs optional_comma ')'. (244) - . reduce 244 (src line 1569) + . reduce 244 (src line 1573) state 356 atom: '[' test_or_star_expr comp_for ']'. (246) - . reduce 246 (src line 1577) + . reduce 246 (src line 1581) state 357 atom: '[' test_or_star_exprs optional_comma ']'. (247) - . reduce 247 (src line 1581) + . reduce 247 (src line 1585) state 358 @@ -4897,7 +4897,7 @@ state 359 dictorsetmaker: test ':' test.comp_for FOR shift 284 - . reduce 282 (src line 1783) + . reduce 282 (src line 1787) comp_for goto 406 @@ -4908,14 +4908,14 @@ state 360 ELIF shift 407 ELSE shift 362 - . reduce 162 (src line 1111) + . reduce 162 (src line 1115) optional_else goto 408 state 361 while_stmt: WHILE test ':' suite optional_else. (165) - . reduce 165 (src line 1141) + . reduce 165 (src line 1145) state 362 @@ -5042,7 +5042,7 @@ state 367 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 178 (src line 1213) + . reduce 178 (src line 1217) strings goto 86 expr goto 69 @@ -5159,7 +5159,7 @@ state 368 state 369 stmts: stmt. (181) - . reduce 181 (src line 1230) + . reduce 181 (src line 1234) state 370 @@ -5240,13 +5240,13 @@ state 370 state 371 optional_return_type: MINUSGT test. (24) - . reduce 24 (src line 381) + . reduce 24 (src line 385) state 372 parameters: '(' optional_typedargslist ')'. (26) - . reduce 26 (src line 392) + . reduce 26 (src line 396) state 373 @@ -5259,7 +5259,7 @@ state 373 NAME shift 315 STARSTAR shift 420 '*' shift 419 - . reduce 91 (src line 751) + . reduce 91 (src line 755) tfpdeftest goto 418 tfpdef goto 314 @@ -5267,7 +5267,7 @@ state 373 state 374 typedargslist: tfpdeftests1 optional_comma. (37) - . reduce 37 (src line 461) + . reduce 37 (src line 465) state 375 @@ -5275,20 +5275,20 @@ state 375 typedargslist: '*' optional_tfpdef.tfpdeftests ',' STARSTAR tfpdef tfpdeftests: . (31) - . reduce 31 (src line 420) + . reduce 31 (src line 424) tfpdeftests goto 421 state 376 optional_tfpdef: tfpdef. (36) - . reduce 36 (src line 455) + . reduce 36 (src line 459) state 377 typedargslist: STARSTAR tfpdef. (43) - . reduce 43 (src line 486) + . reduce 43 (src line 490) state 378 @@ -5368,13 +5368,13 @@ state 379 state 380 classdef: CLASS NAME optional_arglist_call ':' suite. (288) - . reduce 288 (src line 1818) + . reduce 288 (src line 1822) state 381 optional_arglist_call: '(' optional_arglist ')'. (16) - . reduce 16 (src line 323) + . reduce 16 (src line 327) state 382 @@ -5392,13 +5392,13 @@ state 382 LAMBDA shift 65 NOT shift 67 '(' shift 81 - ')' reduce 91 (src line 751) + ')' reduce 91 (src line 755) '[' shift 82 '+' shift 76 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 292 (src line 1847) + . reduce 292 (src line 1851) strings goto 86 expr goto 69 @@ -5421,7 +5421,7 @@ state 382 state 383 arglist: arguments optional_comma. (295) - . reduce 295 (src line 1862) + . reduce 295 (src line 1866) state 384 @@ -5502,7 +5502,7 @@ state 385 state 386 argument: test comp_for. (300) - . reduce 300 (src line 1903) + . reduce 300 (src line 1907) state 387 @@ -5548,14 +5548,14 @@ state 388 optional_comma: . (90) ',' shift 390 - . reduce 90 (src line 747) + . reduce 90 (src line 751) optional_comma goto 428 state 389 import_from_arg: import_as_names optional_comma. (132) - . reduce 132 (src line 953) + . reduce 132 (src line 957) state 390 @@ -5563,7 +5563,7 @@ state 390 import_as_names: import_as_names ','.import_as_name NAME shift 336 - . reduce 91 (src line 751) + . reduce 91 (src line 755) import_as_name goto 429 @@ -5577,7 +5577,7 @@ state 391 state 392 test: or_test IF or_test ELSE test. (186) - . reduce 186 (src line 1256) + . reduce 186 (src line 1260) state 393 @@ -5585,14 +5585,14 @@ state 393 varargslist: vfpdeftests1 ',' '*' optional_vfpdef.vfpdeftests ',' STARSTAR vfpdef vfpdeftests: . (48) - . reduce 48 (src line 513) + . reduce 48 (src line 517) vfpdeftests goto 431 state 394 varargslist: vfpdeftests1 ',' STARSTAR vfpdef. (57) - . reduce 57 (src line 567) + . reduce 57 (src line 571) state 395 @@ -5609,13 +5609,13 @@ state 395 state 396 trailer: '(' arglist ')'. (258) - . reduce 258 (src line 1635) + . reduce 258 (src line 1639) state 397 trailer: '[' subscriptlist ']'. (259) - . reduce 259 (src line 1639) + . reduce 259 (src line 1643) state 398 @@ -5638,7 +5638,7 @@ state 398 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 91 (src line 751) + . reduce 91 (src line 755) strings goto 86 expr goto 69 @@ -5661,7 +5661,7 @@ state 398 state 399 subscriptlist: subscripts optional_comma. (263) - . reduce 263 (src line 1679) + . reduce 263 (src line 1683) state 400 @@ -5686,7 +5686,7 @@ state 400 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 269 (src line 1710) + . reduce 269 (src line 1714) strings goto 86 expr goto 69 @@ -5709,7 +5709,7 @@ state 400 state 401 subscript: ':' sliceop. (266) - . reduce 266 (src line 1698) + . reduce 266 (src line 1702) state 402 @@ -5717,7 +5717,7 @@ state 402 subscript: ':' test.sliceop ':' shift 403 - . reduce 267 (src line 1702) + . reduce 267 (src line 1706) sliceop goto 437 @@ -5740,7 +5740,7 @@ state 403 '-' shift 77 '{' shift 83 '~' shift 78 - . reduce 273 (src line 1727) + . reduce 273 (src line 1731) strings goto 86 expr goto 69 @@ -5834,7 +5834,7 @@ state 405 state 406 dictorsetmaker: test ':' test comp_for. (285) - . reduce 285 (src line 1805) + . reduce 285 (src line 1809) state 407 @@ -5877,7 +5877,7 @@ state 407 state 408 if_stmt: IF test ':' suite elifs optional_else. (164) - . reduce 164 (src line 1120) + . reduce 164 (src line 1124) state 409 @@ -5960,7 +5960,7 @@ state 410 optional_else: . (162) ELSE shift 362 - . reduce 162 (src line 1111) + . reduce 162 (src line 1115) optional_else goto 443 @@ -6195,31 +6195,31 @@ state 414 except_clause: EXCEPT test.AS NAME AS shift 447 - . reduce 179 (src line 1219) + . reduce 179 (src line 1223) state 415 stmts: stmts stmt. (182) - . reduce 182 (src line 1236) + . reduce 182 (src line 1240) state 416 suite: NEWLINE INDENT stmts DEDENT. (184) - . reduce 184 (src line 1246) + . reduce 184 (src line 1250) state 417 funcdef: DEF NAME parameters optional_return_type ':' suite. (25) - . reduce 25 (src line 386) + . reduce 25 (src line 390) state 418 tfpdeftests1: tfpdeftests1 ',' tfpdeftest. (34) - . reduce 34 (src line 443) + . reduce 34 (src line 447) state 419 @@ -6228,7 +6228,7 @@ state 419 optional_tfpdef: . (35) NAME shift 315 - . reduce 35 (src line 451) + . reduce 35 (src line 455) tfpdef goto 376 optional_tfpdef goto 448 @@ -6247,25 +6247,25 @@ state 421 typedargslist: '*' optional_tfpdef tfpdeftests.',' STARSTAR tfpdef ',' shift 450 - . reduce 41 (src line 478) + . reduce 41 (src line 482) state 422 tfpdeftest: tfpdef '=' test. (30) - . reduce 30 (src line 414) + . reduce 30 (src line 418) state 423 tfpdef: NAME ':' test. (45) - . reduce 45 (src line 496) + . reduce 45 (src line 500) state 424 arguments: arguments ',' argument. (290) - . reduce 290 (src line 1837) + . reduce 290 (src line 1841) state 425 @@ -6273,20 +6273,20 @@ state 425 arglist: optional_arguments '*' test.arguments2 ',' STARSTAR test arguments2: . (293) - . reduce 293 (src line 1852) + . reduce 293 (src line 1856) arguments2 goto 451 state 426 arglist: optional_arguments STARSTAR test. (298) - . reduce 298 (src line 1888) + . reduce 298 (src line 1892) state 427 argument: test '=' test. (301) - . reduce 301 (src line 1910) + . reduce 301 (src line 1914) state 428 @@ -6299,13 +6299,13 @@ state 428 state 429 import_as_names: import_as_names ',' import_as_name. (139) - . reduce 139 (src line 990) + . reduce 139 (src line 994) state 430 import_as_name: NAME AS NAME. (135) - . reduce 135 (src line 969) + . reduce 135 (src line 973) state 431 @@ -6314,13 +6314,13 @@ state 431 varargslist: vfpdeftests1 ',' '*' optional_vfpdef vfpdeftests.',' STARSTAR vfpdef ',' shift 453 - . reduce 55 (src line 559) + . reduce 55 (src line 563) state 432 vfpdeftests: vfpdeftests ',' vfpdeftest. (49) - . reduce 49 (src line 518) + . reduce 49 (src line 522) state 433 @@ -6334,13 +6334,13 @@ state 433 state 434 subscripts: subscripts ',' subscript. (262) - . reduce 262 (src line 1668) + . reduce 262 (src line 1672) state 435 subscript: test ':' sliceop. (270) - . reduce 270 (src line 1714) + . reduce 270 (src line 1718) state 436 @@ -6348,20 +6348,20 @@ state 436 subscript: test ':' test.sliceop ':' shift 403 - . reduce 271 (src line 1718) + . reduce 271 (src line 1722) sliceop goto 455 state 437 subscript: ':' test sliceop. (268) - . reduce 268 (src line 1706) + . reduce 268 (src line 1710) state 438 sliceop: ':' test. (274) - . reduce 274 (src line 1732) + . reduce 274 (src line 1736) state 439 @@ -6372,7 +6372,7 @@ state 439 FOR shift 284 IF shift 459 OR shift 156 - . reduce 304 (src line 1933) + . reduce 304 (src line 1937) comp_if goto 458 comp_iter goto 456 @@ -6381,7 +6381,7 @@ state 439 state 440 test_colon_tests: test_colon_tests ',' test ':' test. (283) - . reduce 283 (src line 1789) + . reduce 283 (src line 1793) state 441 @@ -6394,19 +6394,19 @@ state 441 state 442 optional_else: ELSE ':' suite. (163) - . reduce 163 (src line 1115) + . reduce 163 (src line 1119) state 443 for_stmt: FOR exprlist IN testlist ':' suite optional_else. (166) - . reduce 166 (src line 1147) + . reduce 166 (src line 1151) state 444 except_clauses: except_clauses except_clause ':' suite. (168) - . reduce 168 (src line 1159) + . reduce 168 (src line 1163) state 445 @@ -6414,13 +6414,13 @@ state 445 try_stmt: TRY ':' suite except_clauses ELSE ':' suite.FINALLY ':' suite FINALLY shift 461 - . reduce 170 (src line 1170) + . reduce 170 (src line 1174) state 446 try_stmt: TRY ':' suite except_clauses FINALLY ':' suite. (171) - . reduce 171 (src line 1174) + . reduce 171 (src line 1178) state 447 @@ -6435,14 +6435,14 @@ state 448 typedargslist: tfpdeftests1 ',' '*' optional_tfpdef.tfpdeftests ',' STARSTAR tfpdef tfpdeftests: . (31) - . reduce 31 (src line 420) + . reduce 31 (src line 424) tfpdeftests goto 463 state 449 typedargslist: tfpdeftests1 ',' STARSTAR tfpdef. (40) - . reduce 40 (src line 474) + . reduce 40 (src line 478) state 450 @@ -6462,13 +6462,13 @@ state 451 arglist: optional_arguments '*' test arguments2.',' STARSTAR test ',' shift 466 - . reduce 296 (src line 1867) + . reduce 296 (src line 1871) state 452 import_from_arg: '(' import_as_names optional_comma ')'. (131) - . reduce 131 (src line 949) + . reduce 131 (src line 953) state 453 @@ -6485,31 +6485,31 @@ state 453 state 454 varargslist: '*' optional_vfpdef vfpdeftests ',' STARSTAR vfpdef. (59) - . reduce 59 (src line 575) + . reduce 59 (src line 579) state 455 subscript: test ':' test sliceop. (272) - . reduce 272 (src line 1722) + . reduce 272 (src line 1726) state 456 comp_for: FOR exprlist IN or_test comp_iter. (305) - . reduce 305 (src line 1943) + . reduce 305 (src line 1947) state 457 comp_iter: comp_for. (302) - . reduce 302 (src line 1921) + . reduce 302 (src line 1925) state 458 comp_iter: comp_if. (303) - . reduce 303 (src line 1927) + . reduce 303 (src line 1931) state 459 @@ -6635,7 +6635,7 @@ state 461 state 462 except_clause: EXCEPT test AS NAME. (180) - . reduce 180 (src line 1224) + . reduce 180 (src line 1228) state 463 @@ -6644,13 +6644,13 @@ state 463 typedargslist: tfpdeftests1 ',' '*' optional_tfpdef tfpdeftests.',' STARSTAR tfpdef ',' shift 474 - . reduce 38 (src line 466) + . reduce 38 (src line 470) state 464 tfpdeftests: tfpdeftests ',' tfpdeftest. (32) - . reduce 32 (src line 425) + . reduce 32 (src line 429) state 465 @@ -6715,7 +6715,7 @@ state 468 FOR shift 284 IF shift 459 - . reduce 306 (src line 1955) + . reduce 306 (src line 1959) comp_if goto 458 comp_iter goto 479 @@ -6726,13 +6726,13 @@ state 469 or_test: or_test.OR and_test OR shift 156 - . reduce 188 (src line 1265) + . reduce 188 (src line 1269) state 470 test_nocond: lambdef_nocond. (189) - . reduce 189 (src line 1270) + . reduce 189 (src line 1274) state 471 @@ -6753,7 +6753,7 @@ state 471 state 472 elifs: elifs ELIF test ':' suite. (161) - . reduce 161 (src line 1099) + . reduce 161 (src line 1103) state 473 @@ -6845,13 +6845,13 @@ state 474 state 475 typedargslist: '*' optional_tfpdef tfpdeftests ',' STARSTAR tfpdef. (42) - . reduce 42 (src line 482) + . reduce 42 (src line 486) state 476 arguments2: arguments2 ',' argument. (294) - . reduce 294 (src line 1856) + . reduce 294 (src line 1860) state 477 @@ -6894,13 +6894,13 @@ state 477 state 478 varargslist: vfpdeftests1 ',' '*' optional_vfpdef vfpdeftests ',' STARSTAR vfpdef. (56) - . reduce 56 (src line 563) + . reduce 56 (src line 567) state 479 comp_if: IF test_nocond comp_iter. (307) - . reduce 307 (src line 1961) + . reduce 307 (src line 1965) state 480 @@ -6950,7 +6950,7 @@ state 481 state 482 try_stmt: TRY ':' suite except_clauses ELSE ':' suite FINALLY ':' suite. (172) - . reduce 172 (src line 1178) + . reduce 172 (src line 1182) state 483 @@ -6964,13 +6964,13 @@ state 483 state 484 arglist: optional_arguments '*' test arguments2 ',' STARSTAR test. (297) - . reduce 297 (src line 1877) + . reduce 297 (src line 1881) state 485 lambdef_nocond: LAMBDA ':' test_nocond. (192) - . reduce 192 (src line 1286) + . reduce 192 (src line 1290) state 486 @@ -7013,24 +7013,24 @@ state 486 state 487 typedargslist: tfpdeftests1 ',' '*' optional_tfpdef tfpdeftests ',' STARSTAR tfpdef. (39) - . reduce 39 (src line 470) + . reduce 39 (src line 474) state 488 lambdef_nocond: LAMBDA varargslist ':' test_nocond. (193) - . reduce 193 (src line 1292) + . reduce 193 (src line 1296) 92 terminals, 125 nonterminals -311 grammar rules, 489/2000 states +311 grammar rules, 489/8000 states 0 shift/reduce, 0 reduce/reduce conflicts reported 174 working sets used -memory: parser 2661/30000 +memory: parser 2661/120000 215 extra closures 1903 shift entries, 3 exceptions 303 goto entries 1644 entries saved by goto default -Optimizer space used: output 1441/30000 +Optimizer space used: output 1441/120000 1441 table entries, 530 zero maximum spread: 92, maximum offset: 486
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: