Hello, world

This commit is contained in:
Scott Richmond 2023-11-26 13:00:23 -05:00
parent 90dd597889
commit 04715704a6
5 changed files with 78 additions and 1 deletions

View File

@ -0,0 +1,10 @@
@top File { (Identifier | Number | String)+ }
@skip { space }
@tokens {
space { @whitespace+ }
Identifier { $[A-Za-z_]+ }
Number { $[0-9]+ }
String { '"' !["]* '"' }
}

45
package-lock.json generated Normal file
View File

@ -0,0 +1,45 @@
{
"name": "lezer-ludus",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "lezer-ludus",
"version": "0.1.0",
"license": "MIT",
"dependencies": {
"@lezer/lr": "^1.0.0"
},
"devDependencies": {
"@lezer/generator": "^1.0.0"
}
},
"node_modules/@lezer/common": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.1.tgz",
"integrity": "sha512-aAPB9YbvZHqAW+bIwiuuTDGB4DG0sYNRObGLxud8cW7osw1ZQxfDuTZ8KQiqfZ0QJGcR34CvpTMDXEyo/+Htgg=="
},
"node_modules/@lezer/generator": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@lezer/generator/-/generator-1.5.1.tgz",
"integrity": "sha512-vodJv2JPwsFsiBBHE463yBhvUI9TmhIu5duF/8MH304xNS6FyWH/vTyG61pjhERm5f+VBP94co0eiN+afWcvXw==",
"dev": true,
"dependencies": {
"@lezer/common": "^1.0.2",
"@lezer/lr": "^1.3.0"
},
"bin": {
"lezer-generator": "src/lezer-generator.cjs"
}
},
"node_modules/@lezer/lr": {
"version": "1.3.14",
"resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.14.tgz",
"integrity": "sha512-z5mY4LStlA3yL7aHT/rqgG614cfcvklS+8oFRFBYrs4YaWLJyKKM4+nN6KopToX0o9Hj6zmH6M5kinOYuy06ug==",
"dependencies": {
"@lezer/common": "^1.0.0"
}
}
}
}

View File

@ -11,7 +11,7 @@
"@lezer/lr": "^1.0.0" "@lezer/lr": "^1.0.0"
}, },
"scripts": { "scripts": {
"prepare": "lezer-generator src/my.grammar -o src/parser.js" "prepare": "lezer-generator ludus.grammar -o parser.js"
}, },
"author": "Scott Richmond", "author": "Scott Richmond",
"license": "MIT" "license": "MIT"

16
parser.js Normal file
View File

@ -0,0 +1,16 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
import {LRParser} from "@lezer/lr"
export const parser = LRParser.deserialize({
version: 14,
states: "hOVQPOOOOQO'#Ca'#CaQVQPOOOOQO-E6_-E6_",
stateData: "b~OWOS~OQPORPOSPO~O",
goto: "]UPPPPPVQQORRQ",
nodeNames: "⚠ File Identifier Number String",
maxTerm: 8,
skippedNodes: [0],
repeatNodeCount: 1,
tokenData: "#z~R_X^!Qpq!Qrs!u!Q![#d!c!}#l#R#S#l#T#o#l#y#z!Q$f$g!Q#BY#BZ!Q$IS$I_!Q$I|$JO!Q$JT$JU!Q$KV$KW!Q&FU&FV!Q~!VYW~X^!Qpq!Q#y#z!Q$f$g!Q#BY#BZ!Q$IS$I_!Q$I|$JO!Q$JT$JU!Q$KV$KW!Q&FU&FV!Q~!xTOr!urs#Xs;'S!u;'S;=`#^<%lO!u~#^OS~~#aP;=`<%l!u~#iPR~!Q![#d~#qRQ~!c!}#l#R#S#l#T#o#l",
tokenizers: [0],
topRules: {"File":[0,1]},
tokenPrec: 0
})

6
parser.terms.js Normal file
View File

@ -0,0 +1,6 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
export const
File = 1,
Identifier = 2,
Number = 3,
String = 4