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

Function binaryOp

parser.go:212–246  ·  view source on GitHub ↗
(op rune)

Source from the content-addressed store, hash-verified

210}
211
212func binaryOp(op rune) int {
213 switch op {
214 case '+':
215 return oprAdd
216 case '-':
217 return oprSub
218 case '*':
219 return oprMul
220 case '/':
221 return oprDiv
222 case '%':
223 return oprMod
224 case '^':
225 return oprPow
226 case tkConcat:
227 return oprConcat
228 case tkNE:
229 return oprNE
230 case tkEq:
231 return oprEq
232 case '<':
233 return oprLT
234 case tkLE:
235 return oprLE
236 case '>':
237 return oprGT
238 case tkGE:
239 return oprGE
240 case tkAnd:
241 return oprAnd
242 case tkOr:
243 return oprOr
244 }
245 return oprNoBinary
246}
247
248var priority []struct{ left, right int } = []struct{ left, right int }{
249 {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, // `+' `-' `*' `/' `%'

Callers 1

subExpressionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected