Commit Graph

296 Commits

Author SHA1 Message Date
ValKmjolnir 9c6996b54e update test files 2022-12-03 01:24:56 +08:00
ValKmjolnir eca978e2b3 little optimization 2022-11-30 01:11:26 +08:00
ValKmjolnir 4c5ffb0240 🎨 change code format 2022-11-26 22:49:22 +08:00
ValKmjolnir 54969681fc move lvalue check from parse to codegen 2022-11-20 17:06:13 +08:00
ValKmjolnir 9196d7815f 🎨 improve error report 2022-11-19 22:47:19 +08:00
ValKmjolnir 309a57070c 🚀 change module loading 2022-11-15 21:23:34 +08:00
ValKmjolnir 7e4faed4a6 🚀 add new native function `char` 2022-11-12 17:03:56 +08:00
ValKmjolnir f9179188a5 optimize test/console3D.nas 2022-11-11 00:37:14 +08:00
ValKmjolnir 97b3cefe75 add new ways of calling dylib function 2022-11-11 00:11:01 +08:00
ValKmjolnir ca527ec931 🚀 add new module matrix.cpp (in dev) 2022-11-06 23:30:18 +08:00
ValKmjolnir 4fd69c6ce4 🚀 optimize code 2022-11-06 18:20:10 +08:00
ValKmjolnir 1ced201cb5 🚀 add gc time info 2022-11-04 21:36:54 +08:00
ValKmjolnir cedb5e12f5 🚀 add test file `console3D.nas` 2022-11-04 01:18:38 +08:00
ValKmjolnir aaccfbda11 🐛 fix ast print bug & delete some macros 2022-10-30 18:40:03 +08:00
ValKmjolnir feea901e4d 🎨 improve code format
delete option -v, --version, -l, --lex
2022-10-30 01:26:26 +08:00
ValKmjolnir d121dcd630 🎨 improve format of code 2022-10-28 23:28:15 +08:00
ValKmjolnir c705b75513 🚀 change module function parameter format to avoid warnings 2022-10-24 01:12:25 +08:00
ValKmjolnir 025ff49ffc 🚀 add `stl/csv.nas` & ast name change 2022-10-19 00:54:21 +08:00
ValKmjolnir 7a93527948 add stl/json.nas & fix bug
bug: may cause program crash if stack overflow occurs on main stack
2022-10-08 21:34:47 +08:00
ValKmjolnir 405175061a 🚀 crashed coroutine will not make main thread crash. 2022-10-06 23:11:27 +08:00
ValKmjolnir e25eb76e94 🚀 delete unnecessary codes & add `stl/string.nas` 2022-10-05 16:03:47 +08:00
ValKmjolnir 946aa020a5 🚀 add high resolution progress bar 2022-09-28 23:45:15 +08:00
ValKmjolnir dc3770094a 🚀 update test file 2022-09-20 21:51:52 +08:00
ValKmjolnir 791de656c3 🚀 update `ascii-art.nas` and `stl/padding.nas` 2022-09-20 00:41:08 +08:00
ValKmjolnir cff9f91bee 🚀 move `pic` directory into `doc` 2022-09-19 00:10:08 +08:00
ValKmjolnir 0576459fbe 📝 add notes in test files & use system("color") to use ANSI esc seq 2022-09-14 23:15:36 +08:00
ValKmjolnir 518ce7fcb9 📝 add interesting gifs into docs 2022-09-13 23:00:48 +08:00
ValKmjolnir 26f4e1359f 🐛 fix bug that `int()` cannot convert numeric string 2022-09-12 22:45:35 +08:00
ValKmjolnir 6a6eab8db5 change parameter list of 2022-09-11 15:10:30 +08:00
ValKmjolnir 91b3074ce9 optimize `stl/sort.nas` and `test/calc.nas` 2022-09-10 15:45:25 +08:00
ValKmjolnir 10e579dabc 🐛 fix bug that word_collector.nas split some words incorrectly 2022-09-09 21:48:10 +08:00
ValKmjolnir add5e0c2cd 📝 update test file & add new test file `word_collector.nas` 2022-09-09 01:00:09 +08:00
ValKmjolnir 6c04487319 🚀 add new stl file `padding.nas` and update test files. 2022-09-04 17:53:00 +08:00
ValKmjolnir aa0023a23b 📝 use bold font in test/watchdog.nas 2022-09-01 00:04:14 +08:00
ValKmjolnir b022b25cea 🚀 add colorful error info print. 2022-08-31 00:56:19 +08:00
ValKmjolnir 8293f85c5b 🚀 add lib function `exit()` and add test file `watchdog.nas` to run the nasal file when it is changed. 2022-08-27 18:12:32 +08:00
ValKmjolnir 0e578b3e21 📝 update stl/file and test files. 2022-08-27 17:26:01 +08:00
ValKmjolnir 24ba300f3c 🔥 delete `--opcnt` and replace the function of `-o` by `--optimize`. 2022-08-25 19:54:03 +08:00
ValKmjolnir da8aa4744e 📝 add compilation time & update test/ppmgen.nas 2022-08-21 00:26:16 +08:00
ValKmjolnir caf048aae4 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 007b83bed5 📝 add test file `ppmgen.nas` 2022-08-17 21:09:22 +08:00
ValKmjolnir 73278ea2dd 📝 update test/ascii-art.nas 2022-08-16 20:41:05 +08:00
ValKmjolnir 7ddb8593ad 🚀 optimize stl/stack.nas, test/calc.nas & io.fin now returns empty string when cannot open file 2022-08-07 00:35:55 +08:00
ValKmjolnir 04a45064c8 📝 delete unnecessary code & change test file. 2022-07-31 19:26:13 +08:00
ValKmjolnir 854850d9b1 🐛 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 e9fc70bba8 optimize `op_para` and `op_deft`: change `hashmap<string,u64>` to `hashmap<u32,u32>` 2022-07-23 12:02:41 +08:00
ValKmjolnir cc4ff38f28 optimize codes 2022-07-19 23:55:12 +08:00
ValKmjolnir d904123695 🐛 fix bug in test/module_test.nas 2022-07-17 23:46:37 +08:00
ValKmjolnir 29084143d6 📝 change codes in test files. 2022-07-14 19:52:27 +08:00
ValKmjolnir 2ed20f6362 📝 change some identifiers' name. 2022-07-09 16:24:58 +08:00
ValKmjolnir bd5044add2 🚀 add a new way to import other files:
`import("./stl/queue.nas");` now has same function as `import.stl.queue;`
2022-07-06 22:21:01 +08:00
ValKmjolnir b638708722 📝 change identifiers' name and test/coroutine.nas, test/filesystem.nas 2022-07-06 16:04:21 +08:00
ValKmjolnir 452bb4a5d8 📝 change some identifiers' name. 2022-07-03 22:46:28 +08:00
ValKmjolnir 5bc1925082 📝 update test files 2022-07-02 15:48:02 +08:00
ValKmjolnir 8b8fb79013 📝 unify code style of ./stl ./test 2022-07-02 13:53:50 +08:00
ValKmjolnir a4a7f5075a 🚀 update test/httptest.nas and doc/.html 2022-06-24 15:47:53 +08:00
ValKmjolnir 4c0ef0fb99 📝 update test/httptest.nas 2022-06-23 22:16:24 +08:00
ValKmjolnir 478d1aadf9 📝 update test/hexdump.nas test/md5compare.nas 2022-06-16 18:21:11 +08:00
ValKmjolnir 393b37d109 📝 update stl/process_bar.nas 2022-06-16 01:03:51 +08:00
ValKmjolnir c2a23ecba6 📝 update stl/process_bar.nas and test/md5compare.nas 2022-06-15 20:21:03 +08:00
ValKmjolnir ef3afa14b9 🚀 add stl/log.nas and stl/process_bar.nas 2022-06-15 00:36:49 +08:00
ValKmjolnir f59c3c7787 📝 update stl/fg_env.nas 2022-06-11 20:53:13 +08:00
ValKmjolnir 21b345af27 📝 update test/httptest.nas 2022-06-11 12:49:26 +08:00
ValKmjolnir 04806fc2c5 📝 update test/httptest.nas 2022-06-08 20:01:22 +08:00
ValKmjolnir 12d7dde42d 🚀 finish socket library:
socket.socket()

socket.closesocket()

socket.shutdown()

socket.bind()

socket.listen()

socket.connect()

socket.accept()

socket.send() socket.sendto()

socket.recv() socket.recvfrom()

socket.errno()
2022-06-08 19:06:16 +08:00
ValKmjolnir a2e2d5d8f6 add native function runtime.argv() to get command line arguments 2022-06-04 20:12:00 +08:00
ValKmjolnir cb0fee04a9 🚀 add native function println & add test/occupation.nas 2022-06-04 19:22:28 +08:00
ValKmjolnir c3a8e118f5 add u32 and() xor() or() nand() not() 2022-06-03 21:34:02 +08:00
ValKmjolnir 04ab09586b 🚀 add stl/fg_env.nas & delete test/props props_sim maketimer_sim.nas 2022-05-31 20:36:39 +08:00
ValKmjolnir ab37495960 🐛 visual changement & bug fix in test/json.nas & optimize test/bp.nas 2022-05-30 21:27:24 +08:00
ValKmjolnir 36a7868b0b 📝 add maketimer_multi_coroutine_test(vm_num) in test/maketimer_sim.nas 2022-05-23 22:12:58 +08:00
ValKmjolnir 190014a3e5 🐛 fix bug that gc cannot mark values in coroutine & add maketimer_sim.nas
update props_sim.nas

update auto_crash.nas
2022-05-23 20:23:20 +08:00
ValKmjolnir dcad554eba 🎨 fix a bug in module/keyboard.cpp that if program exited with an error, the terminal may not echo the text you input 2022-05-20 21:42:28 +08:00
ValKmjolnir 07eeaadf96 optimize codes: store upvalue on stack & debugger now can output information of registers 2022-05-20 21:19:43 +08:00
ValKmjolnir 120ceb429a 🚀 add coroutine library(beta) and lib function settimer&maketimestamp 2022-05-19 20:09:23 +08:00
ValKmjolnir d567f5abf8 📝 update test/module_test.nas 2022-05-17 21:48:08 +08:00
ValKmjolnir f8692f1e4e 📝 update test files 2022-05-17 18:22:24 +08:00
ValKmjolnir 712a047a43 🐛 now builtin_md5 uses unsigned char instead of char 2022-05-15 20:35:20 +08:00
ValKmjolnir 07857d980c 📝 update test/utf8chk.nas 2022-05-07 17:18:29 +08:00
ValKmjolnir 51a1279110 add utf-8 identifier check in nasal_lexer & fix printf format at windows platform & add test file utf8chk.nas 2022-05-07 16:50:13 +08:00
ValKmjolnir 23a5c1b1ad 🐛 bug fix 2022-05-06 20:58:02 +08:00
ValKmjolnir fd8a148d0c bytecode info print and debugger will show the front 16 characters of strings whose length is greater than 16 2022-05-02 16:56:03 +08:00
ValKmjolnir 9c7f5f1a6e update test file diff.nas& add math.max math.min 2022-05-01 21:10:23 +08:00
ValKmjolnir f049e1f9fb add test file diff.nas 2022-04-30 20:00:15 +08:00
ValKmjolnir 785572634b change visual settings in -c/-dbg 2022-04-23 01:51:49 +08:00
ValKmjolnir ca073499ae optimize codes 2022-04-13 19:08:06 +08:00
ValKmjolnir b6f174e869 update test/wavecollapse.nas 2022-04-10 16:47:27 +08:00
ValKmjolnir 7b160c4589 add test file wavecollapse.nas 2022-04-10 15:34:20 +08:00
ValKmjolnir c12e812651 change test/md5compare.nas 2022-04-06 22:56:21 +08:00
ValKmjolnir 87cff700e8 change module/libmd5 to native function builtin_md5() in nasal_builtin.h 2022-04-06 22:30:49 +08:00
ValKmjolnir bf5737ecfd add native function abort(), assert() 2022-04-06 21:25:20 +08:00
ValKmjolnir 651ae4ef77 add native function isa(object,class) 2022-04-05 22:33:55 +08:00
ValKmjolnir e846e51175 add native function: srand, values, find. 2022-04-05 22:15:05 +08:00
ValKmjolnir 399b2f0ce9 bug fixed & add systime, finished vecindex 2022-04-04 19:08:48 +08:00
ValKmjolnir aed5e27409 bug fix & optimize test code & add lib function: subvec, floor, abs, isfunc, isghost, isint, isnum, isscalar, isstr, isvec, vecindex(unfinished) 2022-04-04 18:38:25 +08:00
ValKmjolnir a2b51fe212 optimize libmd5.nas & test/md5.nas 2022-04-03 18:10:00 +08:00
ValKmjolnir 92b684624d change module/makefile and test/md5compare.nas 2022-04-01 22:52:04 +08:00
ValKmjolnir 83a8632e8e update test/md5compare.nas & optimize test/md5.nas 2022-03-31 19:31:00 +08:00
ValKmjolnir 41b5304712 update test/md5compare.nas
and CAUTION: now the cpp&nas md5 program may not calculate strings including unicode
2022-03-30 21:42:30 +08:00
ValKmjolnir c5a12ade5c update md5compare.nas 2022-03-29 22:54:17 +08:00
ValKmjolnir 7a939b417d fix bug in test/md5.nas & add test file md5compare.nas 2022-03-29 22:36:28 +08:00
ValKmjolnir dd7740f1fd update test/md5.nas(still has bug) & add libmd5 in module(written in C++) 2022-03-28 17:14:11 +08:00
ValKmjolnir 617ad03d33 add math.pow 2022-03-27 16:14:55 +08:00
ValKmjolnir 7f22b25909 update README.md 2022-03-27 01:36:38 +08:00
ValKmjolnir 86f6296268 change opcode print format 2022-03-27 01:20:17 +08:00
ValKmjolnir cf722fd98c fix bug: windows ps/cmd output unicode in bytecodes abnormally.
so we use the hex format to print them.
2022-03-23 22:54:07 +08:00
ValKmjolnir 1dd3fd445c add test/snake.nas 2022-03-20 22:08:11 +08:00
ValKmjolnir 27e25f84ec update main.cpp and bug fix 2022-03-20 18:28:45 +08:00
ValKmjolnir c4d52a88cd update docs & fix bug in nasal_builtin.h 2022-03-16 15:30:34 +08:00
ValKmjolnir 9a099f66cb update docs 2022-03-14 20:29:49 +08:00
ValKmjolnir 82e9e97a26 add destructor for obj_file & change arguments in test/tetris.nas 2022-03-12 23:37:16 +08:00
ValKmjolnir 6a1338bb23 update test/tetris.nas 2022-03-11 23:42:09 +08:00
ValKmjolnir 3b8a092f36 fix bug in test/json.nas 2022-03-11 15:26:38 +08:00
ValKmjolnir 3d86a32b12 update fully functional test/json.nas 2022-03-11 15:11:24 +08:00
ValKmjolnir f26719e1d3 visual update 2022-03-10 16:05:49 +08:00
ValKmjolnir d8156e839b add unix.fork&unix.pipe(do not work on windows platform) 2022-03-09 19:03:12 +08:00
ValKmjolnir 61666d275d delete lstk&fstk, store local address and function on stack and in vm registers 2022-03-08 17:30:40 +08:00
ValKmjolnir 99f595e16f update num->string algorithm, now the to_string will output strings with no tailing zeros 2022-03-08 13:40:27 +08:00
ValKmjolnir debe32b187 safer stl/module.nas & add stl/file.nas encapsulated from lib.nas/io 2022-03-06 15:17:39 +08:00
ValKmjolnir d3df356299 add unix.environ() & use LPCWSTR in dylib.dlopen on Windows platform 2022-03-05 19:15:52 +08:00
ValKmjolnir f312250d27 update 2022-03-01 14:36:05 +08:00
ValKmjolnir 3fac8aa665 fix bug in test/tetris.nas 2022-02-25 23:34:02 +08:00
ValKmjolnir 6bc03601d9 update test/tetris.nas 2022-02-23 01:09:31 +08:00
ValKmjolnir f05acaecc7 fix bug in libkey and test/tetris.nas 2022-02-22 18:01:49 +08:00
ValKmjolnir 9456a903d7 finish tetris.nas 2022-02-21 17:10:13 +08:00
ValKmjolnir 984deed883 finish basic functions of tetris 2022-02-21 00:47:32 +08:00
ValKmjolnir 557cb2ebcf finish map drawing in test/tetris.nas 2022-02-20 17:58:13 +08:00
ValKmjolnir 9c055a9a23 add new third-lib libkey that includes function: kbhit,getch,nonblock 2022-02-19 16:55:54 +08:00
ValKmjolnir 8c67e04cc4 update test file 2022-02-18 15:36:34 +08:00
ValKmjolnir e77bb73a82 add special character `\e`. 2022-02-18 01:58:49 +08:00
ValKmjolnir a4738e8c7d delete operand `op_nop` 2022-02-16 23:27:22 +08:00
ValKmjolnir 0291908675 update README.md 2022-02-14 17:29:26 +08:00
ValKmjolnir 9139e34c0b update README & bug fixed 2022-02-13 16:10:02 +08:00
ValKmjolnir e7f503fae1 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 0ccd3c9bd0 update test/calc.nas & print function of nasal_vec/nasal_hash 2022-02-11 17:04:27 +08:00
ValKmjolnir a176022840 add notes in lib.nas & add runtime.gc() & add total instruction count in '-o'. 2022-02-09 15:53:09 +08:00
ValKmjolnir a09c6ae2f9 update/optimize test files 2022-02-07 23:41:50 +08:00
ValKmjolnir 2a85e92d4a optimize test file & little update. 2022-02-06 19:55:45 +08:00
ValKmjolnir 5778d1e38d update new test data 2022-01-24 15:19:27 +08:00
ValKmjolnir 40344455e6 add optimizer
optimizer now does one work: calculate const number before generating bytecode
2022-01-22 00:41:08 +08:00
ValKmjolnir 630c99c39a optimize codes 2022-01-16 22:48:00 +08:00
ValKmjolnir 46716620e3 add test file 'turingmachine.nas' & change output format of ast & bug fixed 2021-12-28 20:23:47 +08:00
ValKmjolnir f0ae63bce5 lexer,parser,import,codegen use the same error module. 2021-12-23 21:15:50 +08:00
ValKmjolnir 189d49fa4a add debugger framework
with function:backtrace,run,help,show global/local/upvalue,exit
2021-12-20 21:33:22 +08:00
ValKmjolnir 5a80258d20 bug fixed & add os.platform 2021-12-08 18:46:32 +08:00
ValKmjolnir 52b49edbcf add unix.isdir and unix.isfile 2021-11-15 22:47:52 +08:00
ValKmjolnir cd08b2d1bb change code structure 2021-11-02 22:44:42 +08:00
ValKmjolnir fd0d836c03 add io lib & bug fixed 2021-10-27 23:05:25 +08:00
ValKmjolnir d4a9412947 optimize code structure 2021-10-16 21:08:57 +08:00
ValKmjolnir 577546763f change function name and cli format 2021-10-14 23:22:28 +08:00