Skip to content

Commit

Permalink
Add pegjs test
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 committed Aug 29, 2024
1 parent a0e1e34 commit af30097
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/assets/pegjs/test.pegjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
start = expression;expression = text + number;text = a: [a-z]+{return a.join("");};number = b:[0-9]+{return b.join("");}
7 changes: 6 additions & 1 deletion data/test-misc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "WelsonJS test profile (test-misc.json)",
"released": "2024-01-04",
"released": "2024-08-29",
"dependencies": {
"welsonjs": "0.2.7"
},
Expand Down Expand Up @@ -81,6 +81,11 @@
"description": "linq.js (LINQ for JavaScript) test",
"tags": ["Library"]
},
{
"id": "pegjs",
"description": "PEG.js (Parser generator for JavaScript) test",
"tags": ["Library"]
},
{
"id": "domparser_test",
"description": "DOMParser compatibility test",
Expand Down
6 changes: 6 additions & 0 deletions testloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,12 @@ var test_implements = {
console.log(JSON.stringify(b.toArray()));
},

"pegjs": {
var syntax = FILE.readFile("app/assets/pegjs/test.pegjs", FILE.CdoCharset.CdoUTF_8);
var parser = PEG.generate(syntax);
console.log(JSON.stringify(parser.parse("test123"));
},

"domparser_test": function() {
console.log(typeof DOMParser);
},
Expand Down

0 comments on commit af30097

Please sign in to comment.