Commit Graph

68 Commits

Author SHA1 Message Date
Mattia Giambirtone b99be47556 Added compilation mode flag 2022-11-23 10:40:45 +01:00
Mattia Giambirtone 9567319c40 Major error formatting refactoring. Improved warning system 2022-11-23 01:02:35 +01:00
Mattia Giambirtone a3b4fd1048 Initial warning support 2022-11-22 15:13:42 +01:00
Mattia Giambirtone 3dead5a555 Fixed various bugs and added more tests. Also added nim.cfg 2022-11-05 10:57:45 +01:00
Mattia Giambirtone e09db61bc6 Fixed support for type declarations in the parser 2022-11-04 14:56:42 +01:00
Mattia Giambirtone 31a995b0d8 Switched from TableRef to array for OperatorTable 2022-11-03 13:04:01 +01:00
Mattia Giambirtone 5e1c16bb39 Renamed lookupPaths to moduleLookupPaths 2022-11-03 11:01:28 +01:00
Mattia Giambirtone d33a597f19 Massive improvements to import system (added export statement, initial work on namespaces, module names can now be paths, added module search paths) 2022-10-17 11:28:00 +02:00
Mattia Giambirtone c7893fb14b Fixed issues with negative numbers and infinity. Variables can now accept function expressions as type arguments. Compiler.infer() now always returns a concrete type, minor bug fix in varDecl 2022-10-13 18:34:11 +02:00
Mattia Giambirtone 9ef80535f3 Minor fixes to operator system and updated compiler error messages 2022-10-11 09:52:49 +02:00
Mattia Giambirtone a4bccba6cd Various fixes to closures and function objects 2022-10-06 09:57:19 +02:00
Mattia Giambirtone c230142378 Broken work with closures and chained calls 2022-08-30 12:55:14 +02:00
Mattia Giambirtone 058b021493 Fixed some bugs with void functions in the compiler 2022-08-18 23:49:20 +02:00
Mattia Giambirtone 8e53b19233 Various parser adjustments and compiler fixes 2022-08-18 22:07:46 +02:00
Mattia Giambirtone 4fdd90614a Various fixes to the GC, added a few more tests 2022-08-18 19:18:29 +02:00
Mattia Giambirtone 77fd5931fa Further clean up 2022-08-17 19:31:27 +02:00
Mattia Giambirtone fc14cfec2d Added chained imports test 2022-08-16 14:23:58 +02:00
Mattia Giambirtone 13b432b2d2 Basic support for actual incremental compilation 2022-08-16 12:20:17 +02:00
Mattia Giambirtone 26c55c403e Removed debugging echo 2022-08-15 22:34:08 +02:00
Mattia Giambirtone 626375bc1f Added all missing comparison operators and fixed error reporting system 2022-08-15 22:15:06 +02:00
Mattia Giambirtone 0861135e7f Initial work on a stdlib of sorts, added comparison operators and refactored tests 2022-08-15 19:07:37 +02:00
Mattia Giambirtone edef50deca Made exception handling in main.nim module-aware and did some minor refactoring 2022-08-15 11:46:24 +02:00
Mattia Giambirtone c85fff8f67 Initial tests for an import system 2022-08-14 18:37:17 +02:00
Mattia Giambirtone cc49cb98a6 Updated the manual and changed the syntax for foreach loops 2022-08-01 11:03:49 +02:00
Mattia Giambirtone 33066d3b9b Fixed bug with calling a call 2022-07-31 16:09:22 +02:00
Mattia Giambirtone da2cfefe75 Removed the need for parentheses around control flow and looping statements, enforced braces instead. Got rid of the old C-style for loop 2022-07-16 13:21:40 +02:00
Mattia Giambirtone b40275b52f Added Compiler.check(), made type constraints mandatory in generics, reverted '\n' being converted to a semicolon, minor refactoring 2022-07-16 13:04:00 +02:00
Mattia Giambirtone 60028ed664 Fixed issues when debugSerializer == true 2022-07-10 16:31:30 +02:00
Mattia Giambirtone cc0aab850e Simplified calling convention, added for PeonObject, added some comments, fixed bug with StoreVar in stack frames, fixed issues with functions assigned to variables, changed the way closures are emitted so that empty jumps are no longer needed 2022-07-09 12:47:53 +02:00
Mattia Giambirtone 95880b7ba2 Updated .gitignore, slightly edited README and added some more tests 2022-06-19 14:45:38 +02:00
Mattia Giambirtone e32b8e258f Initial work on generics and fixed bugs in the parser with stropped operator names 2022-06-14 22:45:32 +02:00
Mattia Giambirtone 4591e5ca0e Added built-in operators as a single instruction (src/peon/stdlib/arithmetics.pn is now fully functional) 2022-06-14 18:10:13 +02:00
Mattia Giambirtone 5d572386a3 Initial work on pragma handling (+ some parser fixes). Changed the way the lexer handles indentation and made tabs illegal. Added instructions for some operations on primitive types, removed file argument from serializer 2022-06-14 12:12:56 +02:00
Mattia Giambirtone 11b15abc01 More work on pragmas, returning functions now works 2022-06-08 16:07:08 +02:00
Mattia Giambirtone dac0cca1bc Initial experimental support for parsing pragmas 2022-06-07 11:23:08 +02:00
Mattia Giambirtone aed0f6e8f2 Initial work on type declarations 2022-06-02 14:23:05 +02:00
Mattia Giambirtone 5bf5c6d3fd Fixed variable declarations not compiling in some cases 2022-05-25 12:15:45 +02:00
Mattia Giambirtone 9c14bfae91 Initial work on generics, fixed StoreVar. declareName no longer emits any bytecode (as it doesn't need to) 2022-05-23 11:53:34 +02:00
Mattia Giambirtone 21a9689f6c Functions can now return functions which return functions... recursively. Initial work on forward declarations and function call resolution 2022-05-22 15:27:28 +02:00
Mattia Giambirtone 42ab1d4c6e Initial work on call resolution, added support for running files 2022-05-22 13:02:57 +02:00
Mattia Giambirtone 6d6ae3ee7a Fixed and improved error reporting and made the parser ignore whitespace/tab (again) 2022-05-22 11:49:38 +02:00
Mattia Giambirtone 7cf69cf0cf Added hasExplicitReturn field to function and lambda declarations to fix some errors with compiling them. Fixed minor issues with function and lambda parsing, the parser is now able to skip whitespace/tab tokens trasparently, made parser.done() inline, removed invalid state error from funDecl 2022-05-21 12:20:12 +02:00
Mattia Giambirtone 1a0587d08b Minor style changes, removed findImpl from compiler, made the VM use the multibyte utilities, bytecode chunks now no longer store AST node objects and use a stream of bytes instead, fixed issues with endScope() in the compiler which would not pop properly from self.names, fixed issues with blockStmt in parser, added more multibyte utilities 2022-05-20 15:47:04 +02:00
Mattia Giambirtone cb21af4aa3 Added Makefile, prettyfied code, initial work on pragmas 2022-05-18 13:32:32 +02:00
Mattia Giambirtone e8cbec94bd Minor bug fixes 2022-05-16 19:40:13 +02:00
Mattia Giambirtone 620c56237a Fixed an issue with jump offsets and with functions return types 2022-05-16 19:23:38 +02:00
Mattia Giambirtone e823a459c8 Implemented jump opcodes and LoadUInt64 in the VM, some style and proc changes in the compiler, chunk constants are now type-aware, fixed various inheritance mistakes in the AST node, refined type inference system, moved types back to the compiler and completely redesigned operator parsing to be more modular 2022-05-07 10:48:42 +02:00
Mattia Giambirtone a1c5430773 Collections are no longer a compiler intrinsic. Added parser support for ptr/ref arguments 2022-05-04 14:01:38 +02:00
Mattia Giambirtone b4fffe18aa Completely reworked the type inference system. Initial work on specializing the constants table in the bytecode chunk 2022-05-02 17:26:38 +02:00
Mattia Giambirtone 0493181262 Removed broken optimizer module 2022-05-02 12:38:43 +02:00