Commit graph

68 commits

Author SHA1 Message Date
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
88526aa5e6
semantic+nodes: record variable reads 2023-05-24 00:19:07 +02:00
f08d697699
nodes: assignments are not pure if the value is not None 2023-05-24 00:13:56 +02:00
067dc7f982
lexer: identifier are bounded by word boundaries 2023-05-24 00:13:10 +02:00
1e9843ec0e
errors: show location before the message 2023-05-24 00:12:36 +02:00
717bd60e86
main: add function call to mock 2023-05-23 23:26:05 +02:00
ec1001bfd3
parser: parse function calls 2023-05-23 23:24:36 +02:00
a092c11216
nodes: add Call node 2023-05-23 23:23:20 +02:00
39a5f084ba
ir: add IRCall 2023-05-23 23:16:23 +02:00
5b42c05eab
semantic: add Function semantic type, which is a special case of Type
Also define display in builtin context
2023-05-23 23:14:16 +02:00
5252f772ed
semantic: display Types in context pretty-printing 2023-05-23 23:12:28 +02:00
20731d969e
nodes: fix some issues in Blocks (regarding purity consideration for IR)
No longer special case the last node in a Block.
Call super() semantic analysis for variables.
This may prevent some future issues.
2023-05-23 23:11:05 +02:00
6b3c0e8fe3
nodes: add PseudoNodes to statements, for better display and diagnostics 2023-05-23 23:07:50 +02:00
066470b120
nodes: introduce the concept of purity
IR of pure statements is not generated in Block node
2023-05-23 01:07:03 +02:00
49bb3f6aaa
semantic: separate assignments from definitions
Variables are no longer implicitly defined
2023-05-23 00:57:31 +02:00
c2faff23e1
parser: parse definitions
let var: type
let var: type = value
2023-05-23 00:55:36 +02:00
28ad2e2184
nodes: prepare Definition node 2023-05-23 00:54:38 +02:00
81316ead45
lexer: add keywords ("let") and their special handling 2023-05-23 00:50:40 +02:00
109a8aad13
utils: init with implies implementation 2023-05-23 00:50:11 +02:00
45ce13ae99
semantic+main: add the BuiltinContext and use it as semantic root 2023-05-23 00:48:52 +02:00
159ee81375
semantic: refactor types and variable handling 2023-05-23 00:47:09 +02:00
98f0465238
semantic: add the concept of Types 2023-05-23 00:45:02 +02:00
7bb14210a7
ir: add IRNop and IRVoid action and value (resp.) 2023-05-23 00:37:36 +02:00
a832cd1214
treewide: make beartype optional 2023-05-15 00:33:25 +02:00
bac49d20d7
lexer: rename tokenizer to lexer, and convert to sequence 2023-05-14 23:22:38 +02:00
36b1fad7fe
parser+nodes+tokenizer: add Blocks 2023-05-12 01:37:54 +02:00
0ef9960230
parser+nodes+tokenizer: add Statements 2023-05-12 01:36:53 +02:00
2b9943cdbf
parser: make many visitors handle non-mandatory traversals 2023-05-12 01:32:07 +02:00
4ef1e63ee4
nodes: add PseudoNode to store fake nodes used to improve diagnostics 2023-05-12 01:30:02 +02:00
4929efa7b0
nodes: rework variable and fix its intermediate representation 2023-05-12 01:28:29 +02:00
15e8c2bee3
logger: improve type hints 2023-05-12 01:24:15 +02:00
b7ba27f29d
semantic: fix pretty printing + allow adding child contexts 2023-05-12 01:23:02 +02:00
c656a98d3e
nodes: prevent infinite recursion in repr 2023-05-12 01:22:00 +02:00
0c42eabde1
meta: add new run configuration to Jetbrains IDEs 2023-05-10 01:40:20 +02:00
1f2a8460a8
parser: fix bug when expression begins by a variable 2023-05-10 01:38:49 +02:00
5bf52edd44
main: allow giving custom input to compiler 2023-05-10 01:37:42 +02:00
017aefa750
logger+parser: add a Tracer class featuring function-wrappers and reflection
Generates clean function call stack traces as they are called
2023-05-10 01:21:59 +02:00
3e9d308e40
errors: add a OverrideMandatoryError
Use introspection and reflexion to automatically generate the error message.
2023-05-10 01:19:42 +02:00
855e86022b
meta: add IDE files 2023-05-09 01:58:49 +02:00
04a2c6237e
meta: add gitignore to filter-out all Python things 2023-05-09 01:56:41 +02:00