Commit graph

107 commits

Author SHA1 Message Date
67c2ed3a26
source: wrap input with a caching reader, allowing to reference source even from REPLInput.
Will be especially useful when we support files as input.
2024-04-12 16:34:32 +02:00
a98f38d43f
ir: better register shrinkage pretty printing 2024-04-12 16:28:06 +02:00
37bfd831f4
main+ir: fix errors with REPL input (and wrong output in error messages) 2024-04-11 20:45:30 +02:00
103339d666
parser: fix EOF being incorrectly returned if we already peeked it 2024-04-11 20:21:45 +02:00
92e02c8973
main+errors: move pretty printing errors into a method 2024-04-11 20:20:00 +02:00
d2823f5abf
main: improve REPL use (still broken though). 2024-01-11 18:50:02 +01:00
6778a5e5c8
source: fix crash when len(source) is zero! 2024-01-11 18:49:27 +01:00
c2751847d8
lexer: fix EOF error when feeding partial input to the lexer. 2024-01-11 18:48:30 +01:00
9921d9fccd
main: convert to use new iterator Lexer 2024-01-11 00:55:08 +01:00
a69788ca52
source: avoid printing source file twice if it is the same for beginning and end (which is very likely). 2024-01-11 00:54:35 +01:00
ff2435171c
lexer: convert to an iterator
This avoids requiring to read all the data at once (will be useful for REPL).
2024-01-11 00:54:02 +01:00
530214b254
parser: only require an iterator of tokens instead of a list 2024-01-11 00:52:17 +01:00
46c7907165
nodes: make some obvious dead-code raise a log message (Info) 2024-01-11 00:06:06 +01:00
7106e400aa
errors: add Info and Note loglevels 2024-01-11 00:05:50 +01:00
ddd3b13d28
nodes: add several asserts to make debugging some weird internal issues easier 2024-01-11 00:04:39 +01:00
d2d519acf4
lexer+parser: add BEGIN token + add delimiting pseudo_nodes to anonymous blocks (including root) 2024-01-11 00:02:08 +01:00
6d4c999be7
nodes: Block now accepts a pseudo_node list 2024-01-11 00:00:13 +01:00
76cdfc0b5f
semantic: make unused variables print a warning instead of raising an error 2024-01-10 23:58:29 +01:00
fcf0b9c12d
meta: add FORCE_COLOR to mock run environment variables 2024-01-10 23:57:49 +01:00
8067d8178e
main+ir: refactor ir from being entirely guided from main to a dedicated class in ir module 2024-01-09 17:16:11 +01:00
692ee511eb
main+errors: use stdout instead of stderr 2024-01-09 17:14:41 +01:00
8b0ec8cbe2
errors: use termcolor for terminal output coloring + enable raising non-fatal errors 2024-01-06 00:17:47 +01:00
cd42fac98e
nodes: add missing reader tracking to function calls 2024-01-05 23:41:41 +01:00
714c9b490e
semantic: warn on variable shadowing 2024-01-05 23:40:58 +01:00
1bf549eda4
semantic: better handle builtins
Attach them to a pseudo-node "builtin" for the sake of better diagnostics and assignment tracking
2024-01-05 23:40:31 +01:00
dfa24f2d67
main+ir: do register allocation + show updated register names 2024-01-05 23:37:56 +01:00
3e59cc84a7
main: update IR locations + catch and print warnings 2024-01-05 23:34:42 +01:00
5ed4c55522
main: refactor IR printing 2024-01-05 23:31:47 +01:00
c29d4cd9ec
optimizations/register_allocation: init 2024-01-05 23:29:53 +01:00
393615b234
ir: IRAssignable add helper property to give a sorted list of all uses (read or write) of the value 2024-01-05 23:28:07 +01:00
4469a94096
ir: track value reads and writes in every IRAction manipulating data 2024-01-05 23:27:19 +01:00
6af9c367c6
ir: automatically add read-from/written-to values in IRAction if declared 2024-01-05 23:22:37 +01:00
39c12a360c
source: add IRLocation type specifically for generated IR 2024-01-05 23:17:31 +01:00
6bbe2b195e
ir: IRRegister: track registers (statefully) 2024-01-05 23:15:52 +01:00
fb62c3b34a
ir: IRAssignable: track writers 2024-01-05 23:14:55 +01:00
27ccb1a68a
ir: IRValue: track readers 2024-01-05 23:13:45 +01:00
18a813f4c7
utils: add equivalence 2024-01-05 23:12:22 +01:00
43b2dc9e93
source: Location: prepare for builtins 2024-01-05 23:11:32 +01:00
3fa039110b
errors: add warning implementation + fix a few issues 2024-01-05 23:03:32 +01:00
29d6d1a8de
meta: add GPLv3 license 2023-05-24 00:58:50 +02:00
6ccf556150
logger: fix missing whitespace 2023-05-24 00:49:05 +02:00
9463af0014
parser: move parenthesized expression handling to a dedicated function 2023-05-24 00:48:43 +02:00
275728a635
parser: update factor unexpected token error message 2023-05-24 00:46:04 +02:00
92a6686097
main: comment unused variables in mock 2023-05-24 00:45:09 +02:00
ab7ee592c3
main+lexer: add support for single-line comments 2023-05-24 00:44:46 +02:00
3f84890b52
nodes: allow adding pseudo nodes to Expression 2023-05-24 00:44:16 +02:00
1fa3317d93
main: do context semantic checking 2023-05-24 00:25:16 +02:00
f060608e73
semantic: add semantic checks for variables
Check read before first assignment
Check unused variables
2023-05-24 00:24:44 +02:00
bcca6d4a6e
source: make SourceLocation comparable 2023-05-24 00:22:50 +02:00
8c26293416
semantic+nodes: record variable definitions 2023-05-24 00:22:22 +02:00