MCPcopy Index your code
hub / github.com/Shopify/go-lua / simpleExpression

Method simpleExpression

parser.go:169–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167}
168
169func (p *parser) simpleExpression() (e exprDesc) {
170 switch p.t {
171 case tkNumber:
172 e = makeExpression(kindNumber, 0)
173 e.value = p.n
174 case tkString:
175 e = p.function.EncodeString(p.s)
176 case tkNil:
177 e = makeExpression(kindNil, 0)
178 case tkTrue:
179 e = makeExpression(kindTrue, 0)
180 case tkFalse:
181 e = makeExpression(kindFalse, 0)
182 case tkDots:
183 p.checkCondition(p.function.f.isVarArg, "cannot use '...' outside a vararg function")
184 e = makeExpression(kindVarArg, p.function.EncodeABC(opVarArg, 0, 1, 0))
185 case '{':
186 e = p.constructor()
187 return
188 case tkFunction:
189 p.next()
190 e = p.body(false, p.lineNumber)
191 return
192 default:
193 e = p.suffixedExpression()
194 return
195 }
196 p.next()
197 return
198}
199
200func unaryOp(op rune) int {
201 switch op {

Callers 1

subExpressionMethod · 0.95

Calls 8

checkConditionMethod · 0.95
constructorMethod · 0.95
bodyMethod · 0.95
suffixedExpressionMethod · 0.95
makeExpressionFunction · 0.85
EncodeStringMethod · 0.80
EncodeABCMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected