-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Azpillaga Aldalur
committed
Nov 28, 2023
1 parent
92aab15
commit f69a240
Showing
13 changed files
with
187 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build and Deploy to GitHub Pages | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Build project | ||
run: npm run all | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
- name: Deploy to GitHub Pages | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
branch: gh-pages | ||
folder: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
<head> | ||
<link rel="stylesheet" href="./index.css"> | ||
<link rel="stylesheet" href="./styles.css"> | ||
<script src="index.js" type="module" defer></script> | ||
</head> | ||
<body style="margin: 0"> | ||
<section id="editor" style="height: 100vh;"></section> | ||
<body> | ||
<section id="editor"/> | ||
</body> | ||
|
||
<style> | ||
.updated-highlight | ||
{ | ||
color: red; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
body | ||
{ | ||
margin: 0; | ||
} | ||
|
||
#editor | ||
{ | ||
height: 100vh; | ||
} | ||
|
||
.number-member | ||
{ | ||
color: plum !important; | ||
} | ||
|
||
.string-member | ||
{ | ||
color: burlywood !important; | ||
} | ||
|
||
.boolean-member | ||
{ | ||
color: cadetblue !important; | ||
} | ||
|
||
.null-member | ||
{ | ||
color: gray !important; | ||
} | ||
|
||
.object-member | ||
{ | ||
color: lightgreen !important; | ||
} | ||
|
||
.array-member | ||
{ | ||
color: lightsalmon !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"integer": 123, | ||
"number": 123, | ||
"string": "abc", | ||
"boolean": true, | ||
"null": null, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"fontSize": 22, | ||
"fontFamily": "monospace", | ||
"cursorStyle": "block", | ||
"theme": "vs-dark", | ||
"lineNumbers": false, | ||
"minimap": { "enabled": false }, | ||
"scrollbar": { "horizontal": "off", "vertical": "off" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { assertASTsAreEqual } from "./testing"; | ||
|
||
import { test } from "mocha" | ||
import { JSONASTParser } from "../../main/typescript/ast/parser"; | ||
import { JSONArray, JSONBoolean, JSONMember, JSONNull, JSONNumber, JSONObject, JSONString } from "../../main/typescript/ast/ast"; | ||
import assert from "assert"; | ||
import { readFileSync } from "fs"; | ||
import { CharStreams, CommonTokenStream } from "antlr4ts"; | ||
import { JSONLexer } from "../../main/antlr/JSONLexer"; | ||
import { JSONParser } from "../../main/antlr/JSONParser"; | ||
|
||
test("comprehensive ast", () => | ||
{ | ||
let code = readFileSync(__dirname + "/../resources/comprehensive.json").toString(); | ||
let parser = new JSONASTParser(); | ||
let ast = parser.parse(code); | ||
|
||
let expected = new JSONObject | ||
( | ||
new JSONMember("number", new JSONNumber(123)), | ||
new JSONMember("string", new JSONString("abc")), | ||
new JSONMember("boolean", new JSONBoolean(true)), | ||
new JSONMember("null", new JSONNull()), | ||
new JSONMember("object", new JSONObject()), | ||
new JSONMember("array", new JSONArray | ||
( | ||
new JSONNumber(123), | ||
new JSONString("abc"), | ||
new JSONBoolean(false), | ||
new JSONNull(), | ||
new JSONObject(), | ||
new JSONArray() | ||
)) | ||
); | ||
|
||
assertASTsAreEqual(expected, ast.data); | ||
}); | ||
|
||
test("antlr", () => | ||
{ | ||
let code = readFileSync(__dirname + "/../resources/comprehensive.json").toString(); | ||
let characters = CharStreams.fromString(code); | ||
let lexer = new JSONLexer(characters); | ||
let tokens = new CommonTokenStream(lexer); | ||
let parser = new JSONParser(tokens); | ||
let tree = parser.json(); | ||
console.log(tree.value().obj().pair()); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{ | ||
"compilerOptions": | ||
{ | ||
"target": "ES6", | ||
"module": "NodeNext", | ||
"experimentalDecorators": true | ||
} | ||
} |