Commit Graph
86 Commits
Author SHA1 Message Date
cyclane 4738207523 refactor: make missing return type message more precise 2025-02-07 16:22:00 +00:00
cyclane d32855cc29 feat: detect pointer operators 2025-02-07 15:42:38 +00:00
cyclane 959c556eae fix: use verifiedExplain for missing return type check 2025-02-07 15:39:50 +00:00
cyclane 0955f19a81 feat: detect function declarations mid-body 2025-02-07 15:39:04 +00:00
cyclane af909b1492 refactor: remove offset property from position
Merge request lab2425_spring/WACC_37!16
2025-02-07 15:07:45 +00:00
cyclane ba5445a4c5 feat: improve semantic errors
Merge request lab2425_spring/WACC_37!15
2025-02-07 15:07:35 +00:00
cyclane 1f2adf4b82 refactor: remove offset property from position 2025-02-07 14:51:05 +00:00
cyclane ba1b7d67c7 fix: return proper type in non-array index error (instead of ?) 2025-02-07 14:32:15 +00:00
cyclane 88ddca2b98 feat: do not include ? type in error messages 2025-02-07 14:24:16 +00:00
cyclane 3430299847 feat: include operator name in type errors 2025-02-07 14:22:36 +00:00
cyclane 319fa606d9 fix: foldLeft when type checking, rather than foldRight which is unintuitive 2025-02-07 14:16:50 +00:00
cyclane 68e4762b37 feat: show expected and got types for TypeMismatch 2025-02-07 14:16:20 +00:00
cyclane c547a2a37f refactor: make functions non-semantic types
Merge request lab2425_spring/WACC_37!13
2025-02-07 14:12:58 +00:00
cyclane 4e10fb3fda refactor: fail on ? snd or fst type-check result 2025-02-07 13:54:35 +00:00
cyclane f143f685c4 refactor: make functions non-semantic types 2025-02-07 13:54:35 +00:00
cyclaneandJonny a635370522 feat: full type checker without user-friendly error messages
Merge request lab2425_spring/WACC_37!11

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-07 08:20:42 +00:00
cyclane 316500484a Merge branch 'master' into type-checker 2025-02-07 00:24:06 +00:00
cyclane bc5f28ab52 fix: disallow unknown type assignments and reads 2025-02-07 00:23:41 +00:00
cyclane 277d2f66af fix: check function calls have correct number of args 2025-02-07 00:09:10 +00:00
cyclane e57c89beec fix: extract retType from KnownType.Func when type-checking function bodies 2025-02-06 23:59:13 +00:00
cyclaneandjt2622 f6e734937f feat: implement satisfies function in type checker
Co-Authored-By: jt2622
2025-02-06 21:04:27 +00:00
4dc07c249a refactor: implemented labelAndExplain(), combining label and explain, and...
Merge request lab2425_spring/WACC_37!9

Co-authored-by: Barf-Vader <47476490+Barf-Vader@users.noreply.github.com>
Co-authored-by: Guy C <gc1523@ic.ac.uk>
2025-02-06 20:30:20 +00:00
cyclaneandjt2622 6548d895d5 feat: type checker without satisfies implemented
Co-Authored-By: jt2622
2025-02-06 20:26:15 +00:00
cyclane 0e2d1af878 refactor: add comments to renamer 2025-02-06 19:55:52 +00:00
cyclane 74f62ea933 fix: fix merge breaks, add function names to scope before renaming bodies 2025-02-06 19:55:52 +00:00
cyclane ae9625b586 fix: use apply() instead of get() for Maps 2025-02-06 19:55:52 +00:00
cyclane 30cf42ee3a fix: separate variable and function in scope 2025-02-06 19:55:52 +00:00
cyclane 3fbb90322f feat: renamer maybe maybe maybe maybe 2025-02-06 19:55:52 +00:00
cyclane e9ed197782 fix: remove unused applyCon from AST 2025-02-06 19:55:52 +00:00
cyclane 6d1c0b7a87 fix: make parser use only parsley parser bridge apply 2025-02-06 19:55:52 +00:00
cyclane 1486296b40 refactor: add position tracking to AST, UnaryOp, BinaryOp 2025-02-06 19:54:16 +00:00
cyclane 2fb520d891 feat: scope checker and renamer
Merge request lab2425_spring/WACC_37!8
2025-02-06 17:02:31 +00:00
cyclane 5210a55d9e refactor: add comments to renamer 2025-02-05 22:03:26 +00:00
cyclane 0f18bca7fd fix: fix merge breaks, add function names to scope before renaming bodies 2025-02-05 20:41:49 +00:00
cyclane 6027bea95e fix: use apply() instead of get() for Maps 2025-02-05 18:12:26 +00:00
cyclane 8c5b85b8c2 fix: separate variable and function in scope 2025-02-05 18:12:26 +00:00
cyclane 06c8a069fb feat: renamer maybe maybe maybe maybe 2025-02-05 18:12:25 +00:00
cyclane 539403fd36 fix: remove unused applyCon from AST 2025-02-05 04:49:05 +00:00
cyclane 5fffd01a6f fix: make parser use only parsley parser bridge apply 2025-02-05 04:47:43 +00:00
cyclane f3a59460ef refactor: add position tracking to AST, UnaryOp, BinaryOp 2025-02-05 02:12:16 +00:00
cyclane 3aae08ffd4 feat: implement CLI for parser 2025-02-02 13:48:54 +00:00
cyclaneandJonny d4b410bca9 feat: implement parser
Merge request lab2425_spring/WACC_37!6

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-02 13:45:25 +00:00
cyclane 1bb4939fcd Merge branch 'master' into parser 2025-02-02 13:41:12 +00:00
cyclaneandJonny feac5efb6a feat: implement abstract syntax tree
Merge request lab2425_spring/WACC_37!4

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-02 13:37:48 +00:00
cyclaneandJonny 41d541050f feat: implement lexer
Merge request lab2425_spring/WACC_37!5

Co-authored-by: Jonny <j.sinteix@gmail.com>
2025-02-02 13:37:36 +00:00
cyclane da4b398bf0 fix: do not allow negation of a positive int literal 2025-02-02 13:30:33 +00:00
cyclane 2588c8287d fix: change lhs of Assign to lvalue 2025-02-02 00:33:16 +00:00
cyclane 03fdbe01d9 fix: put functions "(" within atomic 2025-02-02 00:30:18 +00:00
cyclane b5a1f2565f Revert "fix: add function must return on all paths check"
This reverts commit a71045867a.
2025-02-02 00:27:04 +00:00
cyclane cb9796fa87 feat: show exact statement which must be returning at the end of a function 2025-02-02 00:00:09 +00:00
cyclane a71045867a fix: add function must return on all paths check 2025-02-01 21:22:48 +00:00
cyclane 0db7a30af0 refactor: remove excessive atomics 2025-02-01 21:05:42 +00:00
cyclane a110225c49 Merge branch 'ast' into parser 2025-02-01 20:56:03 +00:00
cyclane 993acddad3 Merge branch 'master' into lexer 2025-02-01 20:55:22 +00:00
cyclane 1d78072c22 feat: use NoneEmptyList from cats to enfroce non-empty statements 2025-02-01 20:39:56 +00:00
cyclane 1643628c60 Merge branch 'master' into ast 2025-02-01 20:37:29 +00:00
cyclane 7320052939 refactor: increase max line length to 100 2025-02-01 20:33:27 +00:00
cyclane f5f6628c89 fix: extract <ident> from <array-elem> 2025-02-01 20:29:04 +00:00
cyclane 5361373c01 refactor: non-recursive statements and array types 2025-02-01 18:10:25 +00:00
cyclane c5b02a00aa feat: initial parser implementation 2025-02-01 17:17:54 +00:00
cyclane cfad2f08f4 refactor: non-recursive statements and array types 2025-02-01 17:15:14 +00:00
cyclane 70aa58b879 fix: disallow exponents, export identifier from lexer 2025-02-01 03:42:02 +00:00
cyclane 4754858094 refactor: allow binPack Strings 2025-02-01 03:42:02 +00:00
cyclane 302fecc91b refactor: remove boilerplate parser 2025-02-01 03:42:02 +00:00
cyclane 4f02d7f2b0 fix: disallow exponents, export identifier from lexer 2025-02-01 02:21:45 +00:00
cyclane bf310b633a refactor: allow binPack Strings 2025-02-01 02:21:31 +00:00
cyclane 24b83c8448 refactor: remove boilerplate parser 2025-02-01 00:58:29 +00:00
cyclane cc97118e76 fix: add explicit Block statement (required for scoping) 2025-01-31 22:03:54 +00:00
cyclane af919742a0 fix: fully fix binary operators associativity 2025-01-31 20:39:45 +00:00
cyclane 292551aca0 refactor: format AST to follow BNF order 2025-01-31 20:01:44 +00:00
cyclane 1c0907f610 fix: add BaseType and correct PairElemType nodes 2025-01-31 19:52:45 +00:00
cyclane 373683b592 fix: correct usage of RValue (add to Expr, VarDecl, Assign, PairElem) 2025-01-31 19:52:45 +00:00
cyclane f4d0ef8e70 fix: replace String with Ident where applicable 2025-01-31 19:52:45 +00:00
cyclane 50a07cf5d4 feat: add Parens AST node 2025-01-31 19:52:45 +00:00
cyclane c0cf3692fd fix: unary and binary operators AST - consistent style, precedence and associativity 2025-01-31 19:52:40 +00:00
cyclane 78ef878fb2 ci: use coursier cache, do not use bloop 2025-01-31 17:42:25 +00:00
cyclane ef00cf1093 feat: setup cli parsing library, return exit code
Merge request lab2425_spring/WACC_37!3
2025-01-31 16:39:07 +00:00
cyclane 1a7aebb5cf feat: use cli parsing library and return randomly 0, 100 or 200 2025-01-31 16:32:17 +00:00
cyclane 160e8bcc1a refactor: simplify expectedResult type in tests 2025-01-31 15:53:12 +00:00
cyclane ef43e73cf6 refactor: use more generally-accepted scala3 format 2025-01-31 15:14:46 +00:00
cyclane c1fc1c2fc3 ci: check format, commits, compilation and tests
Merge request lab2425_spring/WACC_37!1
2025-01-27 21:30:36 +00:00
cyclane cb89bb54b6 test: test against wacc-examples repo 2025-01-27 21:21:03 +00:00
cyclane 56aa2210d8 docs: add contributing section to README 2025-01-27 16:06:26 +00:00
cyclane 6c166e4f76 ci: runner compile immediately 2025-01-27 15:57:35 +00:00
cyclane a52b384782 ci: check_format, check_commits, compile_jvm and test_jvm steps 2025-01-27 15:28:46 +00:00
cyclane 252ed1c925 refactor: use scalafmt to format code 2025-01-27 14:47:57 +00:00