Commit Graph

79 Commits

Author SHA1 Message Date
ValKmjolnir 3fd1b25f79 🔥 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 025ff49ffc 🚀 add `stl/csv.nas` & ast name change 2022-10-19 00:54:21 +08:00
ValKmjolnir 1e0f0f8e7b 🐛 bug fix: fix sigsegv when parsing `[1,2,3][]=1;`, will report `expected index value` 2022-09-05 01:23:37 +08:00
ValKmjolnir 972ad49a4f improve error output info generated by codegen. 2022-09-05 00:41:36 +08:00
ValKmjolnir a91826607c optimize header file, now modules could generate smaller dynamic libs. 2022-08-24 22:08:47 +08:00
ValKmjolnir 987d3ce9e2 🚀 change indentation of `nasal_ast::print` & add new function
`nasal_ast::tree`.
2022-08-22 22:35:53 +08:00
ValKmjolnir 068743aa4c 📝 change `int` in code to `i32`, optimize code. 2022-07-31 02:19:29 +08:00
ValKmjolnir 3e8b9e4846 optimize nasal_parser 2022-07-26 20:04:57 +08:00
ValKmjolnir 99a131c552 🚀 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 46516485b5 📝 change name of used types 2022-07-23 12:35:21 +08:00
ValKmjolnir 8cc69c709f 📝 fix some warnings. 2022-07-10 23:55:51 +08:00
ValKmjolnir 9890b46f02 optimize code. 2022-07-08 23:00:36 +08:00
ValKmjolnir 452bb4a5d8 📝 change some identifiers' name. 2022-07-03 22:46:28 +08:00
ValKmjolnir e8bd4664b3 optimize codes 2022-07-02 18:08:41 +08:00
ValKmjolnir c993c77b78 change format of error info
parser now can report exact place where is lacking ';' or ','
2022-06-30 23:15:10 +08:00
ValKmjolnir 0515e388da 🐛 fix bug of forindex/foreach, which will cause SIGSEGV.
example:

var a=func{};
forindex(a();[0,1,2]);
2022-06-11 13:55:10 +08:00
ValKmjolnir 022460755f optimize codes 2022-04-12 18:26:54 +08:00
ValKmjolnir bf780514e6 add constant string calculation in optimizer 2022-02-01 21:20:36 +08:00
ValKmjolnir eaa54035ff 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 630c99c39a optimize codes 2022-01-16 22:48:00 +08:00
ValKmjolnir 70a43c2f03 bug fixed 2021-12-25 15:56:08 +08:00
ValKmjolnir f0ae63bce5 lexer,parser,import,codegen use the same error module. 2021-12-23 21:15:50 +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 183446d32a bug fixed 2021-10-26 22:34:02 +08:00
ValKmjolnir 540aeb73f4 optimize nasal_ast and fix bug in opr_slc2 2021-10-20 20:54:23 +08:00
ValKmjolnir 1bfa7d2638 update 2021-10-16 23:36:43 +08:00
ValKmjolnir d4a9412947 optimize code structure 2021-10-16 21:08:57 +08:00
ValKmjolnir e41f728589 update 2021-10-15 22:21:57 +08:00
ValKmjolnir 577546763f change function name and cli format 2021-10-14 23:22:28 +08:00
Li Haokun 618ce59233
bad access bug fixed 2021-09-13 19:55:03 +08:00
ValKmjolnir 65dfef0a33 update 2021-08-09 01:02:27 +08:00
ValKmjolnir 91771297d3 add test file 2021-08-01 22:34:02 +08:00
ValKmjolnir 4e1a3c5f2d syntax bug fixed
syntax like:
var f=func(){}
(var a,b,c)=(1,2,3);
will be incorrectly recognized like:
var f=func(){}(var a,b,c)

this bug is fixed now.
2021-08-01 02:11:27 +08:00
Li Haokun aa797142d1
update parser
one bug found, waiting to be fixed
2021-07-28 18:22:40 +08:00
Li Haokun 9ebabfe737
fixed bug in nasal_parse 2021-07-21 17:38:11 +08:00
Li Haokun 7a93f5b89b
update 2021-07-19 17:04:45 +08:00
ValKmjolnir 0b2fe61e6e add instruction & changes in codegen
add some instructions that execute const values.
the first symbol called in assignment will use op_load instead of op_meq,op_pop to assign.
2021-06-29 17:18:05 +08:00
ValKmjolnir 3c9a10d710 avoid unnecessary deep copy by using rvalue ref
and test file update.
bug fixed in test/lexer.nas
2021-06-24 22:10:08 +08:00
ValKmjolnir fd57e9a47c performance optimization of vm/lex/parse/test 2021-06-24 00:26:26 +08:00
ValKmjolnir ab99d2d1ed change mcall to call->mcall&allow differen lvalue in assignment 2021-06-21 16:46:47 +08:00
Valk Richard Li ae0dae5956 update 2021-06-21 01:02:09 +08:00
Valk Richard Li 00c6e3b4fd nothing changed 2021-06-20 01:27:01 +08:00
Valk Richard Li dd144305da update test file 2021-06-14 00:27:00 +08:00
Valk Richard Li 4f3ddf803a add tips 2021-06-13 01:01:32 +08:00
Valk Richard Li 1ae47807eb Add command line parameters & chr supports extended ASCII 2021-06-11 15:16:06 +08:00
Valk Richard Li 3deea632f8 front end optimization&stack overflow prompt
change parameter type to avoid unnecessary copies of string.
change stack depth from 65536<<4 to 16+(65536<<2).
now you could know stack overflow when it happens
2021-06-07 23:53:43 +08:00
Valk Richard Li b25a1bc3f4 more efficient str2num 2021-06-05 20:42:58 +08:00
Valk Richard Li a68bf85f04 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
Valk Richard Li a463af53b7 add license & other changes
parser recognizes syntax errors more accurately.
change some for loop to standard c++11 for(auto iter:obj)
add MIT license
change info in README.md
2021-05-04 17:39:24 +08:00