mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-05-02 19:00:47 +08:00
🐛 complete function of arg in all scopes
This commit is contained in:
28
README.md
28
README.md
@@ -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__
|
||||
|
||||

|
||||
|
||||
Reference in New Issue
Block a user