Commit Graph

128 Commits

Author SHA1 Message Date
Nocturn9x 5cc2a60c8c Fixed many bugs in the serializer and added (de)serialization output to main.nim 2021-11-12 17:47:11 +01:00
Nocturn9x afa4369321 Made the serializer follow the spec (the 3 byte header was missing) 2021-11-12 16:56:41 +01:00
Nocturn9x df67e7db64 Initial work for loadBytes and removed dumpBytes 2021-11-12 16:35:55 +01:00
Nocturn9x 3d4680e94d Updated bytecode spec to take singletons into account 2021-11-12 16:27:12 +01:00
Nocturn9x 3fde477de6 Added serialization for singletons and updated bytecode spec 2021-11-12 16:15:30 +01:00
Nocturn9x cdd529dbd0 Fixed some compiler bugs with emitting constants (bin/oct/hex), added string constants to literal() (whoopsie) and implemented basic serialization in Serializer.dumpBytes 2021-11-12 15:37:00 +01:00
Nocturn9x b252749d0e Added compiler support for collection literals 2021-11-12 14:20:14 +01:00
Nocturn9x 23fe444a9e Added binary operations in compiler. Minor changes to bytecode spec. Initial ground work on the serializer 2021-11-12 13:29:26 +01:00
Nocturn9x ac8b21f21b Added support for unary + for consistency, initial working compiler for unary operations and literals (the optimizer has been disabled to show the work of the compiler) 2021-11-12 11:52:35 +01:00
nocturn9x e249f0bf7b Further ground work in the compiler 2021-11-08 10:14:46 +01:00
nocturn9x 08f68f09df Added opcodes to build collection literals 2021-10-31 10:43:45 +01:00
nocturn9x 033aac50c2 Further initial work on the compiler + fixed some parsing bugs with unterminated collection literals. Added initial serializer module for bytecode caching to file. Made token objects value types 2021-10-31 10:43:02 +01:00
Nocturn9x 53741cb0df Started ground work for the compiler 2021-10-30 13:21:54 +02:00
Nocturn9x df59bc8f0d Fixed bug in the optimizer when folding exponentiation with negative exponents 2021-10-30 11:48:46 +02:00
Nocturn9x a15aee3d23 Added temporary debugger 2021-10-30 15:05:04 +02:00
Nocturn9x 125e41864f Fixed license headers (whoops), started working on bytecode chunks, removed empty modules. Added config.nim and debugger.nim from japl v1 to start merging the two projects together 2021-10-30 14:38:46 +02:00
Nocturn9x cce5047a61 Got rid of Parser.context attribute (using Parser.currentFunction now) and added basic docs on the Parser object 2021-10-29 19:51:09 +02:00
Nocturn9x a8bb212092 Updated copyright notices 2021-10-29 12:41:15 +02:00
Nocturn9x ce3fbe6ced Fixed bug that always parsed function bodies as empty blocks 2021-10-29 12:38:59 +02:00
Nocturn9x fd336b5761 Minor documentation change in the lexer 2021-10-29 12:35:47 +02:00
Nocturn9x d81948ed23 Significantly improved generator/coroutine detection in the parser, extending it to all expressions variants. Fixed a bug where the lexer would spin up an infinite loop with unterminated string literals 2021-10-29 12:33:07 +02:00
Nocturn9x 759c4a4214 Updared grammar for try statement 2021-10-29 11:47:18 +02:00
Nocturn9x f80ac42101 Minor changes to error message for missing initializer in constant declaration 2021-10-29 10:51:27 +02:00
Nocturn9x d905f319b2 Ehnanced generator detection code 2021-10-29 10:34:07 +02:00
Nocturn9x 48087419b2 Improved error handling and parsing for try statements 2021-10-29 09:54:38 +02:00
Nocturn9x 73020fd48b Added exception handling parse handlers and slicing support 2021-10-28 15:48:23 +02:00
Nocturn9x c1a0ecca91 Minor reordering and numerous small fixes to grammar. Added try/except/finally/else syntax 2021-10-28 09:57:03 +02:00
Nocturn9x dc7c6b5f6d Added parser support for the 'defer' keyword 2021-10-27 18:47:16 +02:00
nocturn9x 16f1ffb7d0 Added lambda functions as expressions. Added 'as', 'is' and 'of' binary operators. Added collection literals. Renamed isLiteral to isConstant to better reflect usage. Added isLiteral for all literals, including collections. Fixed some edge cases with nested function scopes. Simplified some representation of AST nodes 2021-10-24 19:08:17 +02:00
nocturn9x e6dbc3cad6 Added 'is', 'as' and 'of' 2021-10-24 17:01:03 +02:00
nocturn9x d0a252e13c Fixed assignment expression, made lambda an expression 2021-10-24 16:39:32 +02:00
Nocturn9x 151b8da0d5 Initial (semi-broken) support for await and yield statements/expressions. Minor changes to the lexer and grammar 2021-10-25 11:50:12 +02:00
Nocturn9x 74b8328bf7 Implemented yield expressions vs yield statements 2021-10-23 12:58:23 +02:00
Nocturn9x 118b8e5ffc Added differentiation between yield statement and yield expressions and added missing semicolon to delStmt 2021-10-23 12:46:11 +02:00
Nocturn9x 7dc9ea17d5 Fixed assignment bug 2021-10-23 12:44:05 +02:00
Nocturn9x 73c00ab4ea Added missing '?' grammar rule for import statements 2021-10-23 12:00:26 +02:00
Nocturn9x 7a80bb071f Fixed grammar rule for import statements 2021-10-23 11:59:42 +02:00
Nocturn9x ef8a26492a Added checks for break and continue outside loops in the parser + some minor fixes/typos 2021-10-23 11:55:48 +02:00
Nocturn9x 8070803d05 Generalized errors and moved them to src/meta/errors.nim. Further work in the compiler 2021-10-23 11:48:52 +02:00
Nocturn9x 7237141ec1 Parser bugfixes + small changes in initializer methods for parser and compiler. Added generic error type for NimVM parsing exceptions 2021-10-23 09:12:05 +02:00
Nocturn9x 4ad34f30e4 Laid groundwork for the compiler 2021-10-23 09:00:16 +02:00
Nocturn9x 941a5221ad Extended bytecode spec with notes on various types 2021-10-22 09:39:28 +02:00
Nocturn9x a75342d27b Added headers 2021-10-20 16:25:56 +02:00
Nocturn9x 9580dc3745 Fixed missing quotes around declaration modifier 2021-10-20 16:17:26 +02:00
Nocturn9x 06b57f143a Fixed missing verb 2021-10-20 16:10:59 +02:00
Nocturn9x b9ed2d1410 Fixed unix epoch time 2021-10-20 16:09:51 +02:00
Nocturn9x 9043af131a Fixed missing article in sentence 2021-10-20 16:06:59 +02:00
Nocturn9x 602c7e8c57 Laid out initial bytecode spec 2021-10-21 12:22:37 +02:00
nocturn9x a2f9456de4 Removed support for the let keyword. Made the optimizer act in-place in most cases. Constant declarations now require initialization. Slight changes to main.nim due to changes in the optimizer 2021-10-16 17:50:31 +02:00
Nocturn9x 2e42e0fcb9 Slightly optimized constant folding of block statements 2021-10-15 15:46:27 +02:00