ignore vscode extension tmp/
This commit is contained in:
parent
6ae955e926
commit
259e7a7dd4
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -34,6 +34,7 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
/tmp
|
/tmp
|
||||||
|
vscode-extension/tmp
|
||||||
/docs
|
/docs
|
||||||
|
|
||||||
*.vsix
|
*.vsix
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
import { parser } from '../../src/parser/shrimp'
|
|
||||||
import { setGlobals } from '../../src/parser/tokenizer'
|
|
||||||
import { PRELUDE_NAMES } from '../server/src/prelude-names'
|
|
||||||
|
|
||||||
// Set globals for DotGet detection
|
|
||||||
setGlobals(PRELUDE_NAMES as unknown as string[])
|
|
||||||
|
|
||||||
// Test cases - does incomplete DotGet parse correctly?
|
|
||||||
const testCases = [
|
|
||||||
'dict.',
|
|
||||||
'dict.g',
|
|
||||||
'dict.get',
|
|
||||||
'$.',
|
|
||||||
'$.e',
|
|
||||||
'$.env',
|
|
||||||
]
|
|
||||||
|
|
||||||
for (const code of testCases) {
|
|
||||||
console.log(`\nTesting: "${code}"`)
|
|
||||||
const tree = parser.parse(code)
|
|
||||||
const cursor = tree.cursor()
|
|
||||||
|
|
||||||
// Print the parse tree
|
|
||||||
const printTree = (depth = 0) => {
|
|
||||||
const indent = ' '.repeat(depth)
|
|
||||||
console.log(`${indent}${cursor.name} [${cursor.from}-${cursor.to}]`)
|
|
||||||
|
|
||||||
if (cursor.firstChild()) {
|
|
||||||
do {
|
|
||||||
printTree(depth + 1)
|
|
||||||
} while (cursor.nextSibling())
|
|
||||||
cursor.parent()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
printTree()
|
|
||||||
|
|
||||||
// Check at cursor position (end of string)
|
|
||||||
const node = tree.resolveInner(code.length, -1)
|
|
||||||
console.log(`Node at end: ${node.name} (type: ${node.type.id})`)
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user