Add pegjs test

This commit is contained in:
Namhyeon Go 2024-08-29 19:57:53 +09:00
parent a0e1e34974
commit af30097c6e
3 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1 @@
start = expression;expression = text + number;text = a: [a-z]+{return a.join("");};number = b:[0-9]+{return b.join("");}

View File

@ -1,6 +1,6 @@
{
"description": "WelsonJS test profile (test-misc.json)",
"released": "2024-01-04",
"released": "2024-08-29",
"dependencies": {
"welsonjs": "0.2.7"
},
@ -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",

View File

@ -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);
},