🐛 complete function of arg in all scopes

This commit is contained in:
ValKmjolnir
2023-07-09 16:21:09 +08:00
parent 3509655424
commit 7e72661332
12 changed files with 291 additions and 306 deletions

View File

@@ -761,6 +761,8 @@ If get this, Congratulations!
<details><summary>Must use `var` to define variables</summary>
This interpreter uses more strict syntax to make sure it is easier for you to program and debug.
And flightgear's nasal interpreter also has the same rule.
So do not use varibale without using `var` to declare it.
In Andy's interpreter:
@@ -794,32 +796,6 @@ code: undefined symbol "i"
</details>
<details><summary>Default dynamic arguments not supported</summary>
In this interpreter,
function doesn't put dynamic args into vector `arg` by default.
So if you use `arg` without definition,
you'll get an error of `undefined symbol`.
```javascript
var f=func(){
println(arg)
}
f(1,2,3);
```
Compilation result:
```javascript
code: undefined symbol "arg"
--> test.nas:2:15
|
2 | println(arg)
| ^ undefined symbol "arg"
```
</details>
## __Trace Back Info__
![stackoverflow](./doc/gif/stackoverflow.gif)