Skip to content

Commit

Permalink
Format tests, clean up, add automated runner
Browse files Browse the repository at this point in the history
  • Loading branch information
crummy committed Dec 22, 2024
1 parent 3635a7b commit 7130e22
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 178 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Unit tests

on:
push:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install
run: npm install
- name: Run tests
run: npm test
2 changes: 0 additions & 2 deletions pPEG.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,6 @@ function err_report(env) {
*/
function compile(grammar, extend, options) {
const peg = parse(pPEG_codex, grammar, {}, options);
// console.log(JSON.stringify(peg));
if (!peg.ok) {
return {
show_err: peg.show_err,
Expand All @@ -1233,7 +1232,6 @@ function compile(grammar, extend, options) {
}
try {
peg.codex = compiler(peg.ptree[1]);
// console.log("codex\n",JSON.stringify(peg.codex));
} catch (err) {
return {
err: 1,
Expand Down
59 changes: 27 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
{
"name": "ppegjs",
"version": "0.1.2",
"description": "A portable Parser Expression Grammar.",
"main": "index.js",
"type": "module",
"directories": {
"example": "examples",
"test": "tests"
},
"scripts": {
"test": "node peg-play.mjs tests",
"format": "biome format --write pPEG.mjs"
},
"repository": {
"type": "git",
"url": "git+https://github.com/crummy/pPEGjs.git"
},
"keywords": [
"ppeg",
"parser",
"expression",
"grammar"
],
"author": "Peter Cashin",
"license": "MIT",
"bugs": {
"url": "https://github.com/pcanz/pPEGjs/issues"
},
"homepage": "https://github.com/pcanz/pPEGjs#readme",
"devDependencies": {
"@biomejs/biome": "1.9.4"
}
"name": "ppegjs",
"version": "0.1.2",
"description": "A portable Parser Expression Grammar.",
"main": "index.js",
"type": "module",
"directories": {
"example": "examples",
"test": "tests"
},
"scripts": {
"test": "node peg-play.mjs tests",
"format": "biome format --write *.mjs"
},
"repository": {
"type": "git",
"url": "git+https://github.com/crummy/pPEGjs.git"
},
"keywords": ["ppeg", "parser", "expression", "grammar"],
"author": "Peter Cashin",
"license": "MIT",
"bugs": {
"url": "https://github.com/pcanz/pPEGjs/issues"
},
"homepage": "https://github.com/pcanz/pPEGjs#readme",
"devDependencies": {
"@biomejs/biome": "1.9.4"
}
}
Loading

0 comments on commit 7130e22

Please sign in to comment.