mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Add pegjs test
This commit is contained in:
parent
a0e1e34974
commit
af30097c6e
1
app/assets/pegjs/test.pegjs
Normal file
1
app/assets/pegjs/test.pegjs
Normal file
|
@ -0,0 +1 @@
|
|||
start = expression;expression = text + number;text = a: [a-z]+{return a.join("");};number = b:[0-9]+{return b.join("");}
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user