Skip to content

Commit

Permalink
fix: Support More Assignment Statements
Browse files Browse the repository at this point in the history
- Update Docs
- Support More Assignment 
- Add Tests For Assignment Operators
  • Loading branch information
spotandjake committed Jan 7, 2023
1 parent 5d7cc71 commit 6a499b2
Show file tree
Hide file tree
Showing 6 changed files with 403 additions and 190 deletions.
36 changes: 4 additions & 32 deletions Documentation/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
+ [x] Look into creating our own wasm ir using https://github.com/iden3/wasmbuilder/blob/master/src/codebuilder.js instead of using binaryen for raw codegen
+ [ ] Tasks For Day 2
+ [ ] Write New Tests Based On The Improvements To The Compiler
+ [ ] Unary Operators
+ [ ] Order Of Operations
+ [ ] Post Fix Operator Testing
+ [ ] Tests For Type Definitions And TypeChecker
+ [ ] Tests For Object Spread Syntax
+ [x] Analyze Arrays
Expand All @@ -57,11 +54,6 @@
+ [ ] Implement wasm multivalue types and syntax
+ [ ] Look Into Complexity of using multivalue to allocate things like objects on the stack.
+ [ ] Determine Syntax For Wasm Reference Types
+ [ ] Tasks for Day 4
+ [ ] Look Into Writing Linker
+ [ ] Find Way To Parse Without Binaryen
+ [ ] Find Way To Compile Without Binaryen
+ [ ] Find Way To Optimize Without Binaryen
+ [ ] Tasks For Day 5
+ [ ] Rewrite Grammar in ENBF
+ [ ] Consider Simplifying Grammar Based Off Of This new Optimal Form
Expand Down Expand Up @@ -177,34 +169,13 @@
+ [x] Implement Analysis For ADT Enums
+ [ ] Implement Type Checking For ADT Enums
+ [ ] Expressions
+ [x] Fix Operator Precedence In Parsing
+ [x] Comparisons
+ [x] Equal
+ [x] Not Equal
+ [x] Less Then
+ [x] Greater Then
+ [x] Less Then Equal
+ [x] Greater Then Equal
+ [x] Arithmetic
+ [x] Addition
+ [x] Subtraction
+ [x] Multiplication
+ [x] Division
+ [ ] Logical
+ [x] Not
+ [ ] And
+ [ ] Or
+ [x] Support Custom Operators
+ [x] Member Access
+ [x] Parenthesis Expression
+ [x] Function Call
+ [ ] Statements
+ [x] Declaration
+ [ ] Assignment
+ [x] Equal
+ [ ] PlusEqual
+ [ ] SubtractEqual
+ [ ] MultiplyEqual
+ [ ] DivideEqual
+ [x] Custom Assignment Operator
+ [x] If Statement
+ [x] general Parsing
+ [x] Else
Expand Down Expand Up @@ -245,7 +216,7 @@
+ [ ] No Non Wasm Primitive's
+ [ ] Linker
+ [ ] Make Dependency Tree
+ [ ] Link Program
+ [x] Link Program
+ [ ] Runtime Globals
+ [ ] Malloc
+ [ ] GC
Expand All @@ -260,6 +231,7 @@
+ [ ] String
+ [ ] General
+ [ ] Print
+ [ ] Default Operators


Look Into https://istanbul.js.org/
9 changes: 8 additions & 1 deletion __tests__/Data/Parser/Operator_Precedence_Pass.br
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let cINFIX: i32 = 1n * 1n;
let dINFIX: i32 = 1n / 1n;
let eINFIX: i32 = 1n % 1n;
let fINFIX: i32 = 1n ^ 1n;
let fINFIX: i32 = 1n == 1n;
let gINFIX: i32 = 1n == 1n;
// Prefix Operators
let aPREFIX: i32 = +1n;
let bPREFIX: i32 = -1n;
Expand All @@ -20,6 +20,13 @@ let cPOSTFIX: i32 = 1n*;
let dPOSTFIX: i32 = 1n/;
let ePOSTFIX: i32 = 1n%;
let fPOSTFIX: i32 = 1n^;
// Assingment Operators
aINFIX += 1n;
bINFIX -= 1n;
cINFIX *= 1n;
dINFIX /= 1n;
eINFIX %= 1n;
fINFIX ^= 1n;

// Precedence
let aPrecedence: i32 = (1n!) + (1n!);
Expand Down
2 changes: 1 addition & 1 deletion __tests__/Data/Parser/Operator_Precedence_Pass.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6a499b2

Please sign in to comment.