Commit Graph

116 Commits

Author SHA1 Message Date
ValKmjolnir
9610db3482 finish ast dumper 2023-06-25 22:25:13 +08:00
ValKmjolnir
cbb3906536 add cmakelists.txt 2023-05-06 21:12:40 +08:00
ValKmjolnir
5ae729676f add readline & os.arch
delete test file mandel.nas

change io.fin => io.readfile
2023-04-28 23:11:17 +08:00
ValKmjolnir
d73cb914a9 🐛 fix compilation error
in windows mingw-w64 win32 thread model,
but we do not suggest you to use this,
please use posix thread model
2023-04-23 00:02:39 +08:00
ValKmjolnir
8655c5091e merge runtime regs into struct context 2023-04-08 00:18:58 +08:00
ValKmjolnir
053dbf24b4 add multi-line error report and span 2023-03-08 01:12:01 +08:00
ValKmjolnir
034085e6cb 🚀 add operator ^= &= |=
fix bug of parsing expressions beginning with floater
2023-02-28 00:30:27 +08:00
ValKmjolnir
60a3f41f1d add detail location info in tokens
prepare for multi-line error reporter module
2023-01-10 22:22:27 +08:00
ValKmjolnir
34e29e398a 🎨 change code format 2022-11-26 22:49:22 +08:00
ValKmjolnir
7c075a6071 move lvalue check from parse to codegen 2022-11-20 17:06:13 +08:00
ValKmjolnir
be42d47c93 🐛 fix ast print bug & delete some macros 2022-10-30 18:40:03 +08:00
ValKmjolnir
d3fd8ce336 🎨 improve code format
delete option -v, --version, -l, --lex
2022-10-30 01:26:26 +08:00
ValKmjolnir
b5828137f2 🎨 improve format of code 2022-10-28 23:28:15 +08:00
ValKmjolnir
ce6a9865d7 🔥 change nasal_gc to gc 2022-10-23 01:29:20 +08:00
ValKmjolnir
1a0f81214f 🔥 change class name.
nasal_lexer -> lexer
nasal_parse -> parse
nasal_codegen -> codegen
nasal_vm -> vm
nasal_gc -> gc
nasal_dbg -> debugger
nasal_import -> linker
nas_ref -> var
2022-10-21 01:29:29 +08:00
ValKmjolnir
ac26105231 🚀 add stl/csv.nas & ast name change 2022-10-19 00:54:21 +08:00
ValKmjolnir
abd23b215c 📝 fix help info align 2022-09-15 23:37:46 +08:00
ValKmjolnir
fb00ddc19a 🚀 add colorful error info print. 2022-08-31 00:56:19 +08:00
ValKmjolnir
4dfc4012df 🐛 fix bug that make test failed 2022-08-29 00:48:06 +08:00
ValKmjolnir
99494c067c 🔥 delete --opcnt and replace the function of -o by --optimize. 2022-08-25 19:54:03 +08:00
ValKmjolnir
6318f7e9e8 optimize header file, now modules could generate smaller dynamic libs. 2022-08-24 22:08:47 +08:00
ValKmjolnir
a82ffe8b46 📝 add compilation time & update test/ppmgen.nas 2022-08-21 00:26:16 +08:00
ValKmjolnir
325a7236e7 several updates.
1. merge `--chkpath` `-cp` with `-d`

2. complete test/ppmgen.nas

3. update comments about why we don't use `atof` to convert string to
number

4. update .gitignore
2022-08-19 23:25:46 +08:00
ValKmjolnir
5d67648d06 update doc & notes, optimize code 2022-08-18 20:41:33 +08:00
ValKmjolnir
e92134c5e8 🚀 add [[noreturn]] 2022-08-16 01:40:22 +08:00
ValKmjolnir
e51ba92f30 🚀 optimize code 2022-08-08 22:10:51 +08:00
ValKmjolnir
e6fb388701 📝 little change 2022-08-05 23:22:32 +08:00
ValKmjolnir
9c779b871f optimize code & chdir will not trigger crash if failed to call 2022-07-30 19:17:33 +08:00
ValKmjolnir
ca6cb5daae 🐛 fix bug of incorrectly searching paths of lib.nas and dynamic libs.
`dylib.dlopen` now only needs file name of dynamic lib, not the real path.
2022-07-29 22:49:50 +08:00
ValKmjolnir
fb37283be0 🚀 move fg constants to stl/fg_env.nas, add io.exists. now dlopen and import can search file in PATH. 2022-07-28 21:44:55 +08:00
ValKmjolnir
bbfe3fff9a 📝 doc fix 2022-07-23 17:21:44 +08:00
ValKmjolnir
49a7ed28e9 🚀 change std::string to string, change identifiers' name, -o is now a function available in debug mode. 2022-07-23 17:00:25 +08:00
ValKmjolnir
65fe7daff6 📝 change name of used types 2022-07-23 12:35:21 +08:00
ValKmjolnir
7a9ce29710 🚀 change std::cout to std::clog to put some log info 2022-07-21 23:16:16 +08:00
ValKmjolnir
ec308f8053 optimize codes. details:
1. delete gc::builtin_alloc
2. add convenient way of getting new string object: gc::newstr, and shrink the size of codes
3. update doc
4. add gc::temp to be used in native/module functions to avoid being recognized as garbage incorrectly when triggered mark-sweep
2022-07-07 17:51:30 +08:00
ValKmjolnir
a166134cc5 🚀 add module/libsock.nas, preparing to add socket lib into this language. 2022-06-06 16:34:21 +08:00
ValKmjolnir
ec2866021f add native function runtime.argv() to get command line arguments 2022-06-04 20:12:00 +08:00
ValKmjolnir
c1808a7875 🚀 use ftime to calculate run time 2022-06-02 22:51:43 +08:00
ValKmjolnir
8b63c44266 optimize codes 2022-05-22 18:19:13 +08:00
ValKmjolnir
3e418dbcff 🐛 bug fix 2022-05-06 20:58:02 +08:00
ValKmjolnir
85490a3136 fix bug in codegen: foreach/forindex(id;vec/hash) may cause segmentation fault because of incorrect generated operand 2022-04-16 19:45:55 +08:00
ValKmjolnir
0b4db9467e add native function abort(), assert() 2022-04-06 21:25:20 +08:00
ValKmjolnir
51e9b0b5ab add math.pow 2022-03-27 16:14:55 +08:00
ValKmjolnir
d5d426d6eb update main.cpp and bug fix 2022-03-20 18:28:45 +08:00
ValKmjolnir
7958fd8919 update README.md 2022-02-14 17:29:26 +08:00
ValKmjolnir
f16259b2da update README & bug fixed 2022-02-13 16:10:02 +08:00
ValKmjolnir
0d5b0fa57d now local values are stored on stack. upvalue is generated when creating a new function in local scope.
may include some bugs inside. but all test files has passed the test so i decide to push it.
2022-02-12 23:12:30 +08:00
ValKmjolnir
ee01e0992c add garbage collector and memory allocator info. use '-d' to activate this function. 2022-02-08 23:40:52 +08:00
ValKmjolnir
666feae851 change increment arguments to a more efficiency level & change gc.nil, gc.one, gc.zero to constant nil, one, zero 2022-02-04 01:51:30 +08:00
ValKmjolnir
88ef0f8dd6 add constant string calculation in optimizer 2022-02-01 21:20:36 +08:00