Commit Graph

65 Commits

Author SHA1 Message Date
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 81daeca4cb 📝 add test file ppmgen.nas 2022-08-17 21:09:22 +08:00
ValKmjolnir 4ab8a730a6 📝 change int in code to i32, optimize code. 2022-07-31 02:19:29 +08:00
ValKmjolnir fa8a568f72 🚀 shrink stack size & optimize nasal_vm::traceback 2022-07-25 00:23:07 +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 dea85929cd 📝 change identifiers' name 2022-07-18 23:54:44 +08:00
ValKmjolnir 7c1d45a200 🚀 update makefile to choose different compilers by users & fix some codes for MSVC to compile. 2022-07-16 16:53:11 +08:00
ValKmjolnir 2f89c95307 first step trying to make this project compiled by MSVC: using indirect-threading, change \e to \033. 2022-07-16 01:02:33 +08:00
ValKmjolnir 00c7c4044a optimize code & replace all printf with std::cout. 2022-07-09 23:36:14 +08:00
ValKmjolnir fdcd85dadf optimize code. 2022-07-08 23:00:36 +08:00
ValKmjolnir 87d7de5d73 📝 change some identifiers' name. 2022-07-08 18:16:00 +08:00
ValKmjolnir aea8b317c7 🚀 shrink code size & now import module can search lib file from local dir and dirs in PATH 2022-07-08 00:42:56 +08:00
ValKmjolnir fe808f6d9f 🚀 change usleep in builtin_sleep to cross platform c++11::std::this_thread::sleep_for.
Although this is not so accurate in Windows platform, the accuracy is still improved and this line of code does not need MinGW to build on Windows platform.
2022-07-07 14:35:10 +08:00
ValKmjolnir a402e6d7d2 🚀 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 9110a44b90 📝 change name of some identifiers. shrink size of main stack. 2022-07-05 18:13:54 +08:00
ValKmjolnir 7e25bc15e0 optimize vm 2022-07-04 00:16:04 +08:00
ValKmjolnir f3ba80b41c 📝 unify code style of ./stl ./test 2022-07-02 13:53:50 +08:00
ValKmjolnir beba975ff0 change format of error info
parser now can report exact place where is lacking ';' or ','
2022-06-30 23:15:10 +08:00
ValKmjolnir 8b63c44266 optimize codes 2022-05-22 18:19:13 +08:00
ValKmjolnir 8915a9b96a 🚀 add coroutine library(beta) and lib function settimer&maketimestamp 2022-05-19 20:09:23 +08:00
ValKmjolnir 9364789896 🐛 now builtin_md5 uses unsigned char instead of char 2022-05-15 20:35:20 +08:00
ValKmjolnir 7263b1552f fix some warnings 2022-05-09 18:42:40 +08:00
ValKmjolnir e1c09fb4a2 💬 change code related to macros 'PRTHEX' 2022-05-08 19:43:27 +08:00
ValKmjolnir a4bbb100b6 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 7f51676833 🎨 improve rawstr() and builtin_getcwd(..), change format output in nasal_vm::valinfo() 2022-05-07 02:22:49 +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 b3a8b421f8 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 1d5e2f5654 add unix.waitpid 2022-03-16 18:44:38 +08:00
ValKmjolnir 9cbbbe2058 add special character \e. 2022-02-18 01:58:49 +08:00
ValKmjolnir 6c3e5e6a02 add optimizer
optimizer now does one work: calculate const number before generating bytecode
2022-01-22 00:41:08 +08:00
ValKmjolnir 1ae354c0cf lexer,parser,import,codegen use the same error module. 2021-12-23 21:15:50 +08:00
ValKmjolnir 82181b7af4 add debugger framework
with function:backtrace,run,help,show global/local/upvalue,exit
2021-12-20 21:33:22 +08:00
ValKmjolnir ab6c194d71 add dylib.dlopen dylib.dlsym dylib.dlclose dylib.dlcall
now you could add your own modules into nasal without changing the source code!
2021-12-03 19:31:03 +08:00
ValKmjolnir aeefaebcec add unix.opendir unix.readdir unix.closedir 2021-10-31 23:11:04 +08:00
ValKmjolnir 6b4116aece add unix.time unix.chdir unix.sleep unix.getcwd unix.getenv 2021-10-29 19:52:49 +08:00
ValKmjolnir b131a3ea9e add io lib & bug fixed 2021-10-27 23:05:25 +08:00
ValKmjolnir 95451490ca bug fixed 2021-10-26 22:34:02 +08:00
ValKmjolnir 515a2685fe add detail crash info 2021-10-17 22:57:45 +08:00
ValKmjolnir a7b1851967 optimize code structure 2021-10-16 21:08:57 +08:00
ValKmjolnir 645a652830 change function name and cli format 2021-10-14 23:22:28 +08:00
Li Haokun 52fbd729cc bad access bug fixed 2021-09-13 19:55:03 +08:00
Li Haokun e7afc86d97 add isnan 2021-08-27 17:43:01 +08:00
ValKmjolnir 49e9412915 use same indentation 2021-08-09 21:30:18 +08:00
Li Haokun e9bd033883 update 2021-08-09 19:13:39 +08:00
ValKmjolnir 26bbdcf463 bug fixed & raw string print 2021-07-21 00:20:25 +08:00
Valk Richard Li 40a1189b18 nothing changed 2021-06-20 01:27:01 +08:00
Valk Richard Li 1cd627d9c7 Add command line parameters & chr supports extended ASCII 2021-06-11 15:16:06 +08:00
Valk Richard Li a0ff523229 more efficient str2num 2021-06-05 20:42:58 +08:00
Valk Richard Li b2e85de7a7 bug fixed
a gc bug which causes  fatal error.
add member value collect to make sure that nasal_val is not collected repeatedly.
use builtin_alloc in builtin function to avoid incorrect collection of value in use(gc_alloc).
change free_list to free_list[vm_type_size] to avoid too many calls of new/delete(but seems useless?)
but the most important thing is fixing this bug.
2021-05-31 19:10:59 +08:00