Commit Graph

65 Commits

Author SHA1 Message Date
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
Valk Richard Li 6adb991c04 parser reports syntax error accurately
still need improvement
2021-05-04 01:13:53 +08:00
Valk Richard Li 125fc8a9fe bug fixed & test file changes
compare operators now run more efficiently.
2021-03-31 20:59:13 +08:00
Valk Richard Li 144e6f45da gc changed to mark-sweep 2021-03-27 01:08:05 +08:00
Valk Richard Li a421470715 change map to unordered_map 2021-03-01 15:54:58 +08:00
Valk Richard Li 80683c381f bug fixed 2021-02-13 23:57:53 +08:00
Valk Richard Li e2ee9cff4c update 2021-02-13 14:37:21 +08:00
Valk Richard Li 996ac59c79 update parser to LL(1) 2021-02-13 13:28:20 +08:00
Valk Richard Li 944f713ee9 update 2021-02-13 11:09:31 +08:00
Valk Richard Li 7329c70492 identifiers' name changed 2021-02-12 23:48:51 +08:00
Valk Richard Li 3be50116fa update 2021-02-10 00:12:22 +08:00
Valk Richard Li bb746dfbfb update 2021-01-23 17:57:05 +08:00
Valk Richard Li 9474ac9ef0 update & bug fixed 2021-01-05 23:17:32 +08:00
Valk Richard Li b862aa91eb update 2021-01-05 01:55:17 +08:00
Valk Richard Li 05800fe518 bug fixed 2020-12-25 13:22:57 +08:00