Commit Graph

204 Commits

Author SHA1 Message Date
e074e2cd74 Use ref to a Token instead of a string value 2024-03-09 12:21:52 -05:00
f97b8e2e07 Improve function semantic check 2024-03-09 08:05:51 -05:00
a39b0c0d5a Properly handle errors in compilation pipeline 2024-03-01 17:38:04 -05:00
a219faf283 Add a return type to main 2024-03-01 16:52:32 -05:00
e1a0afba36 Check if functions are declared twice 2024-02-03 20:21:48 -05:00
af0eb6414a Small refactors 2024-02-03 19:51:33 -05:00
83c0c59ae9 Implement a rudimentary symbol table 2024-02-02 06:53:24 -05:00
cb1c0d80f8 Begin work on semantic analysis 2024-01-21 20:27:30 -05:00
2184f7e654 Parse function parameters 2024-01-21 15:06:53 -05:00
a605d182b4 Codegen function call parameters 2024-01-11 19:36:11 -05:00
a6bff95d24 Parse function call parameters 2024-01-11 19:29:19 -05:00
eb3b755a3c (lazily) codegen parsed expressions. v0.0.9 (rebase) 2024-01-06 19:09:35 -05:00
Araozu
02f3c9aee6 Use expressions as a function call callable 2024-01-02 12:45:45 -05:00
Araozu
6b65cd4fd4 Simple codegen for function calls 2024-01-02 09:50:48 -05:00
61de3b100f [Codegen] Minimal codegen for a Block 2024-01-02 07:06:46 -05:00
ef70bc1cc0 Minimal error display for syntax error 2024-01-02 06:32:56 -05:00
6e2b7da22f Improve code display in error msg 2023-12-26 20:39:30 -05:00
52bb445f90 Improve error messages for lexic errors 2023-12-24 19:43:51 -05:00
e0a33e22ba Re-enable REPL support 2023-12-23 18:55:21 -05:00
2830a1befd Refactor Binding 2023-12-16 20:51:12 -05:00
3e592392a8 Change syntax from val/var to let (mut) 2023-12-16 20:47:42 -05:00
7379c469d3 Small changes 2023-12-16 20:35:24 -05:00
498f8fb87f Re-enable compile command 2023-12-13 20:29:04 -05:00
3d5c7769e6 Now every cli command handles its own arguments 2023-12-13 20:03:23 -05:00
6c774f960a CLI help & empty commands 2023-12-13 06:33:32 -05:00
09c267139d CLI help command 2023-12-12 21:24:12 -05:00
2583c35f21 Use colored for CLI output 2023-12-12 20:58:09 -05:00
f6c1664816 Minimal CLI command & options parsing 2023-12-12 20:49:39 -05:00
6399bd338c Remove clap & colored 2023-12-10 20:32:20 -05:00
cae07fcc49 small changes 2023-12-09 19:23:03 -05:00
dcffe062a1 Parse binary operators 2023-11-21 21:40:11 -05:00
d4a633f7c0 Parse binary / * 2023-11-21 21:29:55 -05:00
a54abcc394 Structure for parsing operators. Parse unary operator 2023-11-21 21:02:50 -05:00
c045721f46 Change grammar to incorporate binary operators 2023-11-21 07:49:49 -05:00
c02e1c1f8e [Syntax] Parse function call inside a binding 2023-11-04 06:52:46 -05:00
799cda1bf0 [Syntax] Refactor the expression parser to use ParseResult 2023-11-04 06:46:42 -05:00
e02a95f065 fix tests 2023-11-04 05:41:16 -05:00
Araozu
ed0e163283 [Syntax] Refactor binding parsing 2023-10-05 20:26:47 -05:00
Araozu
f769a2ec1d tag 0.0.7 2023-10-05 06:56:21 -05:00
Araozu
18cbe2a8ab [Syntax] Parse var/val binding as statemente 2023-10-05 06:51:48 -05:00
Araozu
0630287e34 [Syntax] Parse function call as a statement 2023-10-05 06:31:24 -05:00
Araozu
9af450eaa0 Refactor 2023-10-01 18:41:00 -05:00
Araozu
971b9d9516 Parse minimal function call 2023-10-01 17:43:59 -05:00
Araozu
c4d13e76bc Parse empty arguments list 2023-10-01 17:37:19 -05:00
Araozu
03b5a1b6de Start function call parsing 2023-10-01 17:18:28 -05:00
Araozu
2e9776de01 [syntax] refactor bindings 2023-09-24 18:51:08 -05:00
Araozu
1fbc353ebf Extract params list parsing 2023-09-21 20:52:55 -05:00
Araozu
fec196d5aa Refactor function declaration parsing 2023-09-21 20:34:51 -05:00
Araozu
8bf24e3f1a Parse minimal block of code 2023-09-20 19:53:46 -05:00
Araozu
bbd82b07c4 Tag 0.0.6 2023-09-19 20:42:03 -05:00
Araozu
6604632d9e [syntax] Ignore whitespace when parsing a function declaration 2023-09-19 20:30:49 -05:00
Araozu
807c46314b [syntax] Alternative function to expect tokens 2023-09-19 20:06:38 -05:00
Araozu
5dd104bcc9 Parse multiple top level declarations 2023-09-17 17:58:56 -05:00
Araozu
1bccb70c97 Emit DEDENT for each indentation level remaining at EOF 2023-09-17 13:58:45 -05:00
Araozu
bd9e418ddd Emit a DEDENT for each indentation level decreased 2023-09-10 20:10:34 -05:00
Araozu
19474eb85e Refactor last change 2023-09-10 11:40:46 -05:00
Araozu
8b80dad589 Emit INDENT token on indentation increase 2023-09-10 11:16:34 -05:00
Araozu
2481b7297c Codegen minimal function declaration 2023-09-08 20:28:53 -05:00
Araozu
5f25bae3e0 Parse minimal function declaration 2023-09-08 20:18:19 -05:00
Araozu
c61f88aaaa Changes to codegen to move from JS to PHP generation 2023-09-08 19:34:08 -05:00
Araozu
94f0b0c92d Refactor AST location 2023-09-07 20:50:51 -05:00
Araozu
c0b5dde9cf Refactor token creation 2023-09-07 20:46:11 -05:00
Araozu
fe8f4f3fd1 Remove lifetimes 2023-09-07 20:32:59 -05:00
Araozu
4f1fc93ceb Remove doc from compiler 2023-09-07 20:18:35 -05:00
Araozu
a88729b395 Move folders to add a new documentation generator binary 2023-03-27 09:41:16 -05:00
Araozu
cc4f304d00 Fix bug with escape characters inside strings in the lexer 2023-03-16 13:56:54 -05:00
Araozu
def93715c7 Refactor. Fix invalid position field of Number tokens 2023-03-16 13:31:24 -05:00
Araozu
f882942f3f Specific reason for failure for syntax error 2023-03-15 16:41:04 -05:00
Araozu
e383d300f2 Show offending line and token when a syntax error is found 2023-03-15 16:33:00 -05:00
Araozu
cdafc40ff7 Add minimal error reporting for syntax analysis 2023-03-14 16:10:43 -05:00
Araozu
a88c8e9216 Error messages 2023-03-03 09:55:26 -05:00
Araozu
1b9a3377cb Add clap for CLI args parsing 2023-03-03 09:55:26 -05:00
Araozu
d8ea08b28b Add simple error reporting for lexical errors (rebase) 2023-03-03 09:55:20 -05:00
Araozu
c83cd23d49 Add functions for error handling (merge) 2023-03-03 09:53:29 -05:00
Araozu
f28e7394e9 Scan datatypes. Parse datatype annotations 2023-02-15 16:17:50 -05:00
Araozu
1849e11ebb v0.0.3 - token stream always ends with Semicolon & EOF 2023-02-14 15:32:45 -05:00
Araozu
cc6e3fc78a Simple ASI 2023-02-14 15:22:29 -05:00
Araozu
5d40be6d90 Get datatype from an identifier in the symbol table. Improve code documentation 2023-02-11 18:13:05 -05:00
Araozu
3a11000fe0 Get dataypes from sybols 2023-02-11 09:53:18 -05:00
Araozu
cfbb86ab68 Get correct type of a binding 2023-02-10 12:51:10 -05:00
Araozu
8aba492f15 Parse strings and booleans 2023-02-10 12:30:10 -05:00
Araozu
850ed4cdaf Parse simple var binding 2023-02-09 18:44:31 -05:00
Araozu
df772ec737 Report sytax errors 2023-02-08 19:53:02 -05:00
Araozu
236a9c296b Simple codegen 2023-01-24 08:05:49 -05:00
Araozu
418be5dc17 Simple type checking in the symbol table 2023-01-23 08:34:24 -05:00
Araozu
1c90ee293b Add simple symbol table 2023-01-23 07:58:53 -05:00
Araozu
6cecd6af52 Add binding parsing 2023-01-17 08:04:11 -05:00
Araozu
7d99920a71 Add parsing for simple declarations 2023-01-08 18:09:06 -05:00
Araozu
e080945d37 Start simple AST parsing 2023-01-05 18:20:58 -05:00
Araozu
0a22391bae Fix bugs and improve error messages 2023-01-05 12:48:34 -05:00
Araozu
5efcabbfc3 Scan strings and escape characters inside string 2022-12-01 12:53:14 -05:00
Araozu
f3ee68fcf1 Scan and keywords 2022-12-01 12:17:17 -05:00
Araozu
e580167682 Scan identifiers 2022-12-01 08:33:48 -05:00
Araozu
11ca7edb44 Refactor and scan grouping signs 2022-11-30 08:38:43 -05:00
Araozu
0951551a3e Scan scientific notation with decimal part 2022-11-29 20:41:12 -05:00
Araozu
c46291ed8a Refactor number scanners 2022-11-29 20:30:56 -05:00
Araozu
53fd824e8d Simple scientific notation scanning 2022-11-29 20:13:48 -05:00
Araozu
2c17557aad Fix errors in lexical analyzer 2022-11-28 19:16:55 -05:00
Araozu
0bb71c6822 Scan operators 2022-11-28 18:33:34 -05:00
Araozu
de34dd0b71 Scan simple floating point numbers 2022-11-28 17:31:02 -05:00
Araozu
a788a12eb3 Scan hex values 2022-11-28 17:05:43 -05:00
Araozu
730c5391d9 Scan simple hex value 2022-11-28 16:45:39 -05:00
Araozu
c2946e7a9b Scan integers 2022-11-21 16:58:51 -05:00
Araozu
7a929ac440 Initial commit 2022-11-18 12:40:09 -05:00