MCPcopy Create free account
hub / github.com/crossoverJie/gscript / ArithmeticOperators

Function ArithmeticOperators

syntax/parse.go:10–25  ·  view source on GitHub ↗
(script string)

Source from the content-addressed store, hash-verified

8)
9
10func ArithmeticOperators(script string) interface{} {
11 tokenTypes := token.Tokenize(script)
12 reader := NewTokenReader(tokenTypes)
13
14 root := NewASTNode(Program, App)
15 child, err := ExpressionStatement(reader)
16 if err != nil {
17 return 0
18 }
19 if child != nil {
20 root.AddChild(child)
21 } else {
22 return 0
23 }
24 return EvaluateWithRuntime(root, "\t")
25}
26
27// Parse syntax parsing.
28// Program -> IntDeclaration | ExpressionStatement | AssignmentStatement

Callers 1

TestArithmeticOperatorsFunction · 0.70

Calls 6

AddChildMethod · 0.95
TokenizeFunction · 0.92
NewTokenReaderFunction · 0.85
NewASTNodeFunction · 0.85
ExpressionStatementFunction · 0.85
EvaluateWithRuntimeFunction · 0.85

Tested by 1

TestArithmeticOperatorsFunction · 0.56