move lvalue check from parse to codegen

This commit is contained in:
ValKmjolnir
2022-11-20 17:06:13 +08:00
parent 9196d7815f
commit 54969681fc
9 changed files with 191 additions and 99 deletions

View File

@@ -593,16 +593,19 @@ Luckily, we have developed some useful native-functions to help you add modules
After 2021/12/3, there are some new functions added to `lib.nas`:
```javascript
var dylib=
{
dlopen: func(libname){return __dlopen;},
dlsym: func(lib,sym){return __dlsym; },
var dylib={
dlopen: func(libname){
...
},
dlclose: func(lib){return __dlclose; },
dlcall: func(funcptr,args...){return __dlcall;}
dlcall: func(ptr,args...){return __dlcallv},
limitcall: func(arg_size=0){
...
}
};
```
Aha, as you could see, these functions are used to load dynamic libraries into the nasal runtime and execute.
As you could see, these functions are used to load dynamic libraries into the nasal runtime and execute.
Let's see how they work.
First, write a cpp file that you want to generate the dynamic lib, take the `fib.cpp` as the example(example codes are in `./module`):