-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added debugging and tests, added value types, fixed bugs
- Loading branch information
1 parent
b23f0dc
commit bda214c
Showing
55 changed files
with
6,692 additions
and
6,871 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extensions": ["ts"], | ||
"node-option": [ | ||
"loader=ts-node/esm" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 41 additions & 34 deletions
75
src/plugins/Codemirror/KlipperCfgLang/parser/klipperCfg.grammar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
src/plugins/Codemirror/KlipperCfgLang/parser/klipperCfgParser.d.ts
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/plugins/Codemirror/KlipperCfgLang/parser/klipperCfgParser.js
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
src/plugins/Codemirror/KlipperCfgLang/parser/klipperCfgParser.terms.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { nodeResolve } from '@rollup/plugin-node-resolve' | ||
|
||
export default { | ||
input: 'src/plugins/Codemirror/KlipperCfgLang/parser/klipperCfgParser.js', | ||
output: [ | ||
{ | ||
format: 'cjs', | ||
file: 'src/plugins/Codemirror/KlipperCfgLang/dist/klipperCfgParser.cjs', | ||
}, | ||
{ | ||
format: 'es', | ||
file: 'src/plugins/Codemirror/KlipperCfgLang/dist/klipperCfgParser.es.js', | ||
}, | ||
], | ||
external(id) { | ||
return !/^[\.\/]/.test(id) | ||
}, | ||
plugins: [nodeResolve()], | ||
} |
27 changes: 27 additions & 0 deletions
27
src/plugins/Codemirror/KlipperCfgLang/test/test-klipperCfg.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { parser } from '../dist/klipperCfgParser.cjs' | ||
import { fileTests } from '../../mochaFileTests.js' | ||
import * as fs from 'fs' | ||
import * as path from 'path' | ||
|
||
const caseDir = 'src/plugins/Codemirror/KlipperCfgLang/test/testCases' | ||
const testConfigsDir = 'src/plugins/Codemirror/KlipperCfgLang/test/testConfigs' | ||
|
||
for (let file of fs.readdirSync(caseDir)) { | ||
if (!/\.txt$/.test(file)) continue | ||
|
||
let result = /^[^.]+/.exec(file) | ||
let name = result ? result[0] : 'default-name' | ||
describe(name, () => { | ||
for (let { name, run } of fileTests(fs.readFileSync(path.join(caseDir, file), 'utf8'), file)) | ||
it(name, () => run(parser)) | ||
}) | ||
} | ||
|
||
for (let file of fs.readdirSync(testConfigsDir)) { | ||
let result = /^[^.]+/.exec(file) | ||
let name = result ? result[0] : 'default-name' | ||
describe(name, () => { | ||
for (let { name, run } of fileTests(fs.readFileSync(path.join(testConfigsDir, file), 'utf8'), file, true)) | ||
it(name, () => run(parser)) | ||
}) | ||
} |
Oops, something went wrong.