MCPcopy Index your code
hub / github.com/yuin/gopher-lua / compileStringConcatOpExpr

Function compileStringConcatOpExpr

compile.go:1453–1472  ·  view source on GitHub ↗

}}}

(context *funcContext, reg int, expr *ast.StringConcatOpExpr, ec *expcontext)

Source from the content-addressed store, hash-verified

1451} // }}}
1452
1453func compileStringConcatOpExpr(context *funcContext, reg int, expr *ast.StringConcatOpExpr, ec *expcontext) { // {{{
1454 code := context.Code
1455 crange := 1
1456 for current := expr.Rhs; current != nil; {
1457 if ex, ok := current.(*ast.StringConcatOpExpr); ok {
1458 crange += 1
1459 current = ex.Rhs
1460 } else {
1461 current = nil
1462 }
1463 }
1464 a := savereg(ec, reg)
1465 basereg := reg
1466 reg += compileExpr(context, reg, expr.Lhs, ecnone(0))
1467 reg += compileExpr(context, reg, expr.Rhs, ecnone(0))
1468 for pc := code.LastPC(); pc != 0 && opGetOpCode(code.At(pc)) == OP_CONCAT; pc-- {
1469 code.Pop()
1470 }
1471 code.AddABC(OP_CONCAT, a, basereg, basereg+crange, sline(expr))
1472} // }}}
1473
1474func compileUnaryOpExpr(context *funcContext, reg int, expr ast.Expr, ec *expcontext) { // {{{
1475 opcode := 0

Callers 1

compileExprFunction · 0.85

Calls 9

saveregFunction · 0.85
compileExprFunction · 0.85
ecnoneFunction · 0.85
opGetOpCodeFunction · 0.85
slineFunction · 0.85
LastPCMethod · 0.80
AddABCMethod · 0.80
AtMethod · 0.65
PopMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…