Commit Graph

995 Commits

Author SHA1 Message Date
ValKmjolnir de0a6d9388 change name of enum:ast_hashmember->ast_pair, ast_new_iter->ast_iter
change ast_hashmember to ast_pair is because this type in fact is the same as std::pair<std::string,nasal_ref> in C++
2022-01-31 17:22:44 +08:00
ValKmjolnir 93c0c47762 change error info of native function __builtin_import 2022-01-31 14:48:51 +08:00
ValKmjolnir 34f07ffb6b optimize nasal_import::check_import 2022-01-30 23:26:30 +08:00
ValKmjolnir 6601912de4 bug fixed in nasal_vec::print and nasal_hash::print
if vec's or hash's size is 0, a bug will occur because ++depth. now the ++depth has been put behind the size()
2022-01-29 19:51:43 +08:00
ValKmjolnir dfee0d713d change native function num()
num now returns nil if the argument is not a number or numerable string.
2022-01-27 21:41:06 +08:00
ValKmjolnir 454fe1cfa3 add notes of some native functions in lib.nas 2022-01-26 23:51:25 +08:00
ValKmjolnir 0b5b9ced12 update README.md 2022-01-25 15:02:57 +08:00
ValKmjolnir 6812a389dc update new test data 2022-01-24 15:19:27 +08:00
ValKmjolnir 8700fb31cc fix errors in README.md 2022-01-22 22:19:14 +08:00
ValKmjolnir ee6bc07b78 fix error in README.md 2022-01-22 22:09:00 +08:00
ValKmjolnir 9479fe8e78 add contents in README.md 2022-01-22 22:05:42 +08:00
ValKmjolnir 93b2edc08c add new option -op & --optimize to use optimizer | delete bytecode op_pone & op_pzero 2022-01-22 13:37: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 a51b7fe11a optimize codes 2022-01-16 22:48:00 +08:00
ValKmjolnir 2ff88b7073 add test file 'turingmachine.nas' & change output format of ast & bug fixed 2021-12-28 20:23:47 +08:00
ValKmjolnir 37b0d7f12a bug fixed 2021-12-25 15:56:08 +08:00
ValKmjolnir ac80216ea8 update README.md 2021-12-23 21:46:53 +08:00
ValKmjolnir 1ae354c0cf lexer,parser,import,codegen use the same error module. 2021-12-23 21:15:50 +08:00
ValKmjolnir bde94f8ec6 update error info (except parser)
prepare for nasal_err module
2021-12-23 14:09:54 +08:00
ValKmjolnir 57cc368029 debug info now shows both source code and bytecode 2021-12-21 19:57:23 +08:00
ValKmjolnir ffb0f07eec add debugger function: break point & next step 2021-12-21 15:27:38 +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
Li Haokun 7f3b754a04 Merge pull request #7 from sidi762/master
Update c-cpp.yml to solve failures
2021-12-17 00:31:16 +08:00
ValKmjolnir 083293e3db little update 2021-12-16 23:53:13 +08:00
Sidi Liang 58f492471f Merge branch 'ValKmjolnir:master' into master 2021-12-13 08:49:45 +08:00
Sidi Liang 25f019c6b0 Update c-cpp.yml 2021-12-13 08:46:20 +08:00
ValKmjolnir e706214854 bug fixed & add os.platform 2021-12-08 18:46:32 +08:00
Li Haokun 1e22493fd7 Merge pull request #6 from sidi762/master
New Github Action for nightly builds on macOS
2021-12-07 10:37:39 +08:00
Sidi Liang 8c59c968cc Change the asset name to 'nasal' 2021-12-06 23:00:25 +08:00
Sidi Liang d1880bbf16 Attempt to make nightly builds for macOS 2021-12-06 22:55:18 +08:00
Sidi Liang c7c9c69a0f Update c-cpp.yml 2021-12-06 22:47:37 +08:00
Sidi Liang b2b0ff092a Try out GitHub Actions 2021-12-06 22:36:08 +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 cabce9370a delete ret stack/ add math.lg
now return address is stored on value stack
2021-12-02 22:23:22 +08:00
ValKmjolnir 7169f25774 delete op_cntpop & counter stack
now the iterator will be type vm_cnt and be stored on value stack.
2021-11-25 18:13:31 +08:00
ValKmjolnir 56c9cb60ab fixed bug of in_foreach and in_forindex 2021-11-22 14:24:28 +08:00
ValKmjolnir e1d5ab2da5 add unix.isdir and unix.isfile 2021-11-15 22:47:52 +08:00
ValKmjolnir b67cd85cb4 2 bugs fixed:
empty string will be true in conditional expressions,but now it is false(and string that is not empty and is not numerable will be true)

foreach(var i;func(){return []}()); will cause sigsegv because codegen generates error op_pop and op_cntpop,now the counter in_foreach and in_forindex change after generating
foreach/forindex expression before block generation.
2021-11-14 23:05:34 +08:00
ValKmjolnir bc9039dd37 change code structure 2021-11-02 22:44:42 +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 d13e8084e5 add bits lib 2021-10-28 21:49:08 +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 101714986d optimize nasal_ast and fix bug in opr_slc2 2021-10-20 20:54:23 +08:00
ValKmjolnir cc9f3a8859 fix dynamic para error 2021-10-18 22:05:31 +08:00
ValKmjolnir 32465b92c8 fix sigsegv error 2021-10-18 21:50:25 +08:00
ValKmjolnir d18033d4cc add upvalue info into detail crash info 2021-10-18 19:59:41 +08:00
ValKmjolnir 515a2685fe add detail crash info 2021-10-17 22:57:45 +08:00
ValKmjolnir d7cffc76bd update 2021-10-16 23:36:43 +08:00