mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 05:28:41 +00:00
little update
This commit is contained in:
parent
756f37e265
commit
64dbdd97ba
1
packages/haskell/.gitignore
vendored
1
packages/haskell/.gitignore
vendored
@ -24,3 +24,4 @@ dist-ssr
|
|||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
public/tree-sitter.wasm
|
public/tree-sitter.wasm
|
||||||
|
public/tree-sitter-haskell.wasm
|
||||||
@ -23,3 +23,9 @@ I've tried to generate it using <https://www.npmjs.com/package/tree-sitter-haske
|
|||||||
It seems a lot of work has gone into this package in <https://github.com/tree-sitter/tree-sitter-haskell/pull/29>, without a new npm package version being released, which is why I've written this comment: <https://github.com/tree-sitter/tree-sitter-haskell/pull/29#issuecomment-1865951565>.
|
It seems a lot of work has gone into this package in <https://github.com/tree-sitter/tree-sitter-haskell/pull/29>, without a new npm package version being released, which is why I've written this comment: <https://github.com/tree-sitter/tree-sitter-haskell/pull/29#issuecomment-1865951565>.
|
||||||
|
|
||||||
So either someone authorized releases a new version of the package or we might need to pull the changes and try to build it from the tree-sitter master branch.
|
So either someone authorized releases a new version of the package or we might need to pull the changes and try to build it from the tree-sitter master branch.
|
||||||
|
|
||||||
|
## Update 1
|
||||||
|
|
||||||
|
I've managed to make it work by using [this tree-sitter-haskell.wasm](https://github.com/tree-sitter/tree-sitter-haskell/blob/master/tree-sitter-haskell.wasm), instead of using the version on npm! Make sure both `tree-sitter.wasm` and `tree-sitter-haskell.wasm` are in the public dir, then run `pnpm dev`. The console should log a tree sitter AST string.
|
||||||
|
|
||||||
|
Next step: understand how the ast works to then transform it into JS function calls!
|
||||||
|
|||||||
@ -2,6 +2,10 @@ import Parser from 'web-tree-sitter';
|
|||||||
|
|
||||||
console.log('Parser', Parser);
|
console.log('Parser', Parser);
|
||||||
|
|
||||||
Parser.init().then(() => {
|
Parser.init().then(async () => {
|
||||||
console.log('init done..');
|
const parser = new Parser();
|
||||||
|
const Lang = await Parser.Language.load('tree-sitter-haskell.wasm');
|
||||||
|
parser.setLanguage(Lang);
|
||||||
|
const tree = parser.parse('d1 $ s "hh*3"');
|
||||||
|
console.log(tree.rootNode.toString());
|
||||||
});
|
});
|
||||||
|
|||||||
3
packages/haskell/public/README.md
Normal file
3
packages/haskell/public/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# public
|
||||||
|
|
||||||
|
this file is just here to make sure the public folder exists
|
||||||
Loading…
x
Reference in New Issue
Block a user