47379c6635implemented simple evaluator for program, statements and integer literals, together with tests
main
Karma Riuk
2025-07-19 15:03:38 +02:00
7b01840f4dmoved some stuff around in an attempt to make things cleaner (not sure it is, but we tryin)
Karma Riuk
2025-07-19 13:41:25 +02:00
c943380d58moved the utils for the parser to a global utils folder for the tests (that utils is includable only by the tests and not the src code, I added a compiler flag only for the tests in the makefile, but the compiler_flags.txt is global for the lsp, gotta be careful with that)
Karma Riuk
2025-07-19 13:27:25 +02:00
d1dd5f9dabmade our wrapper objects for all of our primitve datatypes: ints, bools and null
Karma Riuk
2025-07-19 13:04:30 +02:00
c841cfe680made the RLPL (read-lex-print-loop) become a RPPL (read-parse-print-loop)
Karma Riuk
2025-07-15 20:21:53 +02:00
20b2c4a818added checks for operator precedence with function call
Karma Riuk
2025-07-15 20:09:08 +02:00
2b811a4bb9added tests for malformed function call to check for memory safety
Karma Riuk
2025-07-15 20:00:30 +02:00
a016bbaa5eadded parsing of function call
Karma Riuk
2025-07-15 19:42:43 +02:00
59bff59cf7renamed function for parsing function literal to avoid confusion with parsing function calls
Karma Riuk
2025-07-15 09:25:00 +02:00
98fb161bbaadded macro for debugging
Karma Riuk
2025-07-15 01:43:39 +02:00
6313027d07reformulated the parsing of the parameters and made it memory safe
Karma Riuk
2025-07-15 01:43:22 +02:00
4a9deff8daextracted the parsing of the function parameters into it's own function (will be useful for the parsing of the parameters in the function calls)
Karma Riuk
2025-07-15 01:18:00 +02:00
e2dfca2679renamed function->block to function->body
Karma Riuk
2025-07-15 01:13:52 +02:00
c6daa5c2afadded tests for malformed function literal to check for memory leaks
Karma Riuk
2025-07-15 01:11:53 +02:00
afbabd6c9eadded check for corner case
Karma Riuk
2025-07-15 01:11:46 +02:00
0b2a12cef7added parsing for function literals
Karma Riuk
2025-07-15 00:56:12 +02:00
85f530f5f9made the parsing functions for the different nodes return the type they are parsing (necessary for the parsing of the identifiers while parsing the list of parameteres in a function literal)
Karma Riuk
2025-07-15 00:24:53 +02:00
586a172d90removed sus blank line
Karma Riuk
2025-07-15 00:07:39 +02:00
767a2ebcb1added tests for malformed if to check of memory leaks
Karma Riuk
2025-07-15 00:05:48 +02:00
d94bb99381fixed implementation of parse block
Karma Riuk
2025-07-15 00:04:58 +02:00
7c55e58e1aremoved captures that don't capture because of scope issues with doctest
Karma Riuk
2025-07-14 23:56:51 +02:00
cbafb2e814extracted and abstracted function
Karma Riuk
2025-07-14 20:15:51 +02:00
f0f748f7f5uncommented tracers and using a macro to enable it or disable it
Karma Riuk
2025-07-14 20:15:18 +02:00
1cda075f57added guards for freeing pointers because it caused seg faults
Karma Riuk
2025-07-14 20:14:54 +02:00
870567ec6bremoved dereferencing pointers when outputing to stdout because i wanted the option of seeing wethere a pointer was null or not
Karma Riuk
2025-07-14 20:14:03 +02:00
34e4bfe9c9fixed some memory leaks
Karma Riuk
2025-07-14 15:20:30 +02:00
9e63c923daadded parsing of if statements
Karma Riuk
2025-07-14 15:19:05 +02:00
86574552aaadded parsing and testing for grouped expressions
Karma Riuk
2025-07-12 15:22:45 +02:00
ab17545c93made another test for boolean parsing in general expression
Karma Riuk
2025-07-12 15:04:13 +02:00
e170afc840used overloaded function to make code cleaner
Karma Riuk
2025-07-11 22:17:01 +02:00
63f22a1b40removed unused include
Karma Riuk
2025-07-11 11:19:28 +02:00
2174781b77using smart pointers instead of normal ones for easier setup of tests (to call setup() multiple times without leaks)
Karma Riuk
2025-07-11 11:16:16 +02:00
74c555bfc0added possibility of printing nodes
Karma Riuk
2025-07-08 18:05:52 +02:00
96d76153d4added option for subcase
Karma Riuk
2025-07-08 18:05:29 +02:00
8fb0ef2be7added quotes to avoid any cli issue
Karma Riuk
2025-07-08 17:23:34 +02:00
c9e21213fdmade setup for expression parsing
Karma Riuk
2025-07-08 15:52:40 +02:00
d10e5676c1better use of fixtures for resource allocation and dealocation
Karma Riuk
2025-07-08 15:45:38 +02:00
83df4955d4added tests for the stringification of the program
Karma Riuk
2025-07-08 11:18:54 +02:00
902f5a16dfusing fixtures (not super necessary, but nice)
Karma Riuk
2025-07-08 10:58:51 +02:00
2dfff61346using test suites
Karma Riuk
2025-07-08 10:36:08 +02:00
ef624de4efa little bit of cleanup
Karma Riuk
2025-07-08 10:20:10 +02:00
31cb483602added string function to all nodes of ast
Karma Riuk
2025-07-08 10:17:38 +02:00
da2b6716b1moved program to it's own files
Karma Riuk
2025-07-08 09:58:02 +02:00
1d259e6988forgot pragma once
Karma Riuk
2025-07-08 09:56:47 +02:00
d13f9bf9f8added the parsing of expression statements
Karma Riuk
2025-07-08 09:51:15 +02:00
08aacf0416extracted the parsing of the "expressions" to it's own function so we can just modify that once we get there
Karma Riuk
2025-07-08 09:50:41 +02:00
b98424aa5frenamed let to let_stmt
Karma Riuk
2025-07-07 17:44:11 +02:00
39eafe2360made tests for return statements
Karma Riuk
2025-07-07 17:39:07 +02:00
7b916b2a0bcreated the parser dir test to avoid having a bunch of "unrelated" tests in one file
Karma Riuk
2025-07-07 17:20:21 +02:00
132dc65240added some sort of error generation when parsing errors occur
Karma Riuk
2025-07-07 15:02:06 +02:00
bbac513aa9checkign that the casting of the let statement doesn't throw
Karma Riuk
2025-07-07 15:01:46 +02:00
de465b6122very basic parser of let statements
Karma Riuk
2025-07-03 13:30:56 +02:00
c091f7f021added execution of valgrind on valgrind target
Karma Riuk
2025-07-03 11:59:26 +02:00
ca74b67bb0renamed tests to test
Karma Riuk
2025-07-03 10:10:22 +02:00
4da5313db5using require instead of check to fail fast
Karma Riuk
2025-07-02 23:12:28 +02:00
896b9001c7added default value to lexer field to avoid compiler complaints
Karma Riuk
2025-07-02 23:00:09 +02:00
6181fc8d9fadded valgrind to targets to check for memory leaks
Karma Riuk
2025-07-02 22:59:49 +02:00
d328ae60dfadded clangd config to disable semantic tokens on operators because seeing new and delete treated as operators was hurting my eyes
Karma Riuk
2025-07-02 22:42:21 +02:00
3547822d3eforgot the pragma once for the hpps
Karma Riuk
2025-07-02 11:17:34 +02:00
e773cb649fadded the current character to the lexer struct for cleaner structure
Karma Riuk
2025-07-01 18:59:43 +02:00
69bee723a2implemented very simple repl
Karma Riuk
2025-07-01 18:43:25 +02:00
aee7a741b1added EQ and NEQ
Karma Riuk
2025-07-01 18:01:45 +02:00
7973f7522cextended lexer to new keywords
Karma Riuk
2025-06-30 00:36:31 +02:00
5cc7147909extended single char tokens
Karma Riuk
2025-06-30 00:27:30 +02:00
dec93f8272implemented lexer for a more complex subset of the monkey language
Karma Riuk
2025-06-30 00:12:28 +02:00
69217fdf90added test for full lexer (missing impl)
Karma Riuk
2025-06-29 20:28:53 +02:00
c322b69590renamed IDENT to IDENTIFIER because i kept reading indent
Karma Riuk
2025-06-29 20:04:20 +02:00
ffff13b2e0lexer can now read single character tokens
Karma Riuk
2025-06-29 12:33:37 +02:00
ca05c3577arenamed EOF_ to END_OF_FILE
Karma Riuk
2025-06-29 12:33:09 +02:00
1c928616a4written structure and tests for lexer, missing implementation
Karma Riuk
2025-06-29 10:56:51 +02:00