mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
add while and forever loops
This commit is contained in:
10
src/run.go
10
src/run.go
@@ -57,10 +57,20 @@ func runVal(line any, stack stack, stacklevel int) (any, ArErr) {
|
||||
return runDoWrap(x, stack, stacklevel+1)
|
||||
case CallReturn:
|
||||
return runReturn(x, stack, stacklevel+1)
|
||||
case CallBreak:
|
||||
return runBreak(x, stack, stacklevel+1)
|
||||
case ArDelete:
|
||||
return runDelete(x, stack, stacklevel+1)
|
||||
case not:
|
||||
return runNot(x, stack, stacklevel+1)
|
||||
case ifstatement:
|
||||
return runIfStatement(x, stack, stacklevel+1)
|
||||
case whileLoop:
|
||||
return runWhileLoop(x, stack, stacklevel+1)
|
||||
case bool:
|
||||
return x, ArErr{}
|
||||
case nil:
|
||||
return nil, ArErr{}
|
||||
}
|
||||
fmt.Println("unreachable", reflect.TypeOf(line))
|
||||
panic("unreachable")
|
||||
|
||||
Reference in New Issue
Block a user