Skip to content

Commit

Permalink
Massive reformatting + debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
arnav-ag committed Mar 31, 2024
1 parent 6015202 commit 2fad310
Show file tree
Hide file tree
Showing 19 changed files with 8,506 additions and 7,808 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/src/scm-slang/
/src/py-slang/
/src/**/__tests__/**/__snapshots__
/src/**/__tests__/**/__snapshots__
/src/parser/ooga.pegjs
9 changes: 6 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 100,
"parser": "typescript",
"trailingComma": "none",
"trailingComma": "es5",
"arrowParens": "avoid",
"endOfLine": "lf"
"endOfLine": "lf",
"semi": true,
"tabWidth": 4,
"useTabs": false,
"bracketSpacing": true
}
32 changes: 10 additions & 22 deletions booga.bm
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
{"tag":"ENTER_SCOPE","num":1}
{"tag":"LDF","arity":1,"addr":3}
{"tag":"GOTO","addr":23}
{"tag":"LD","sym":"y","pos":[2,0]}
{"tag":"LDCI","val":0}
{"tag":"LOG","operator":"=="}
{"tag":"JOF","addr":10}
{"tag":"LD","sym":"y","pos":[2,0]}
{"tag":"RESET"}
{"tag":"GOTO","addr":11}
{"tag":"LDU"}
{"tag":"POP"}
{"tag":"LDCI","val":5}
{"tag":"ASSIGN","pos":[1,0]}
{"tag":"LD","sym":"i","pos":[1,0]}
{"tag":"LDCI","val":10}
{"tag":"LOG","operator":"<"}
{"tag":"JOF","addr":16}
{"tag":"LD","sym":"print","pos":[0,0]}
{"tag":"LD","sym":"y","pos":[2,0]}
{"tag":"LD","sym":"i","pos":[1,0]}
{"tag":"CALL","arity":1}
{"tag":"POP"}
{"tag":"LD","sym":"foo","pos":[1,0]}
{"tag":"LD","sym":"y","pos":[2,0]}
{"tag":"LD","sym":"i","pos":[1,0]}
{"tag":"LDCI","val":1}
{"tag":"BINOP","operator":"-"}
{"tag":"CALL","arity":1}
{"tag":"LDU"}
{"tag":"RESET"}
{"tag":"BINOP","operator":"+"}
{"tag":"ASSIGN","pos":[1,0]}
{"tag":"POP"}
{"tag":"LD","sym":"foo","pos":[1,0]}
{"tag":"LDCI","val":5}
{"tag":"CALL","arity":1}
{"tag":"GOTO","addr":3}
{"tag":"EXIT_SCOPE"}
{"tag":"DONE"}
7 changes: 2 additions & 5 deletions booga.ooga
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
var j = 5
for var i = 5; i < 10; i = i + 1 {
for i:=5; i < 10; i = i + 1 {
print (i);
}

print(j)
}
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"@types/node": "^20.11.28",
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"debug": "^4.3.4",
"eslint": "^8.57.0",
"express": "^4.19.2",
"peggy": "^4.0.2",
Expand All @@ -28,7 +29,14 @@
"test": "node ./dist/tests/test.js",
"tooga": "yarn build && yarn test",
"pooga": "yarn peggy && yarn build",
"tooga": "yarn build && yarn test",
"server": "node ./dist/server/server.js"
"server": "node ./dist/server/server.js",
"format": "npx prettier --write ./src/"
},
"devDependencies": {
"@types/debug": "^4.1.12",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-simple-import-sort": "^12.0.0"
}
}
Loading

0 comments on commit 2fad310

Please sign in to comment.