Commit Graph

102 Commits

Author SHA1 Message Date
ValKmjolnir 376d6a3d49 update 2023-06-21 00:03:46 +08:00
ValKmjolnir cbb3906536 add cmakelists.txt 2023-05-06 21:12:40 +08:00
ValKmjolnir a17e6d920a 🎨 improve code style 2023-04-12 01:11:31 +08:00
ValKmjolnir 8655c5091e merge runtime regs into struct context 2023-04-08 00:18:58 +08:00
ValKmjolnir ab5462f556 visual update 2023-03-11 18:15:27 +08:00
ValKmjolnir dd804ee9f9 update error report for parser&codegen 2023-03-08 23:53:02 +08:00
ValKmjolnir 053dbf24b4 add multi-line error report and span 2023-03-08 01:12:01 +08:00
ValKmjolnir 034085e6cb 🚀 add operator ^= &= |=
fix bug of parsing expressions beginning with floater
2023-02-28 00:30:27 +08:00
ValKmjolnir a06b17546e 🚀 add bitwise operators or, xor, and 2023-02-16 00:24:32 +08:00
ValKmjolnir 43371d5b4c 🐛 fix codegen for binary not on some ast nodes 2023-02-12 15:33:38 +08:00
ValKmjolnir 8c02aa0fff 🚀 add binary negation 2023-02-12 15:22:05 +08:00
ValKmjolnir 72551de9e9 🐛 fix bug that cannot parse return true/false 2023-02-02 19:35:42 +08:00
ValKmjolnir 21a8579d8f add keyword support 'true' and 'false'
true is now number 1.0

false is number 0.0
2023-01-16 17:44:56 +08:00
ValKmjolnir 60a3f41f1d add detail location info in tokens
prepare for multi-line error reporter module
2023-01-10 22:22:27 +08:00
ValKmjolnir b28e85a7a1 little optimization 2022-11-30 01:11:26 +08:00
ValKmjolnir 57619cc079 optimize lexer 2022-11-28 21:16:39 +08:00
ValKmjolnir ffd5961c0f change enum tok to enum class tok 2022-11-27 23:47:58 +08:00
ValKmjolnir 34e29e398a 🎨 change code format 2022-11-26 22:49:22 +08:00
ValKmjolnir 7c075a6071 move lvalue check from parse to codegen 2022-11-20 17:06:13 +08:00
ValKmjolnir 58b10b99a7 🎨 improve error report 2022-11-19 22:47:19 +08:00
ValKmjolnir be42d47c93 🐛 fix ast print bug & delete some macros 2022-10-30 18:40:03 +08:00
ValKmjolnir d3fd8ce336 🎨 improve code format
delete option -v, --version, -l, --lex
2022-10-30 01:26:26 +08:00
ValKmjolnir b5828137f2 🎨 improve format of code 2022-10-28 23:28:15 +08:00
ValKmjolnir 1a0f81214f 🔥 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 ac26105231 🚀 add stl/csv.nas & ast name change 2022-10-19 00:54:21 +08:00
ValKmjolnir 1cd55895a5 🐛 bug fix: fix sigsegv when parsing [1,2,3][]=1;, will report expected index value 2022-09-05 01:23:37 +08:00
ValKmjolnir 0f59028c82 improve error output info generated by codegen. 2022-09-05 00:41:36 +08:00
ValKmjolnir 6318f7e9e8 optimize header file, now modules could generate smaller dynamic libs. 2022-08-24 22:08:47 +08:00
ValKmjolnir d1f705998e 🚀 change indentation of nasal_ast::print & add new function
`nasal_ast::tree`.
2022-08-22 22:35:53 +08:00
ValKmjolnir 4ab8a730a6 📝 change int in code to i32, optimize code. 2022-07-31 02:19:29 +08:00
ValKmjolnir 99e16c1c43 optimize nasal_parser 2022-07-26 20:04:57 +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 0be63c8684 📝 fix some warnings. 2022-07-10 23:55:51 +08:00
ValKmjolnir fdcd85dadf optimize code. 2022-07-08 23:00:36 +08:00
ValKmjolnir b5f839bebe 📝 change some identifiers' name. 2022-07-03 22:46:28 +08:00
ValKmjolnir 8cc483b82a optimize codes 2022-07-02 18:08:41 +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 11d493c9e0 🐛 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 92989ed9f6 optimize codes 2022-04-12 18:26:54 +08:00
ValKmjolnir 88ef0f8dd6 add constant string calculation in optimizer 2022-02-01 21:20:36 +08:00
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 a51b7fe11a optimize codes 2022-01-16 22:48:00 +08:00
ValKmjolnir 37b0d7f12a bug fixed 2021-12-25 15:56:08 +08:00
ValKmjolnir 1ae354c0cf lexer,parser,import,codegen use the same error module. 2021-12-23 21:15:50 +08:00
ValKmjolnir bc9039dd37 change code structure 2021-11-02 22:44:42 +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 d7cffc76bd update 2021-10-16 23:36:43 +08:00