Comments (9)
@FoamScience I ran your setup in a debugger, and this is where the error occured.
I've gone into the surrounding code and I'm 80% this will be fixed by adding memset
in the same way as this pr.
There was a point at which it was looking up memset in a dict of the symbols we've marked as exported.
Why exactly it manifests in this way, I have no idea...
@wenkokke did you have to do anything special to get the nice undefined symbol
errors?
edit I guess it's slightly different, it can't find memset
, rather than _memset
from tree-sitter-haskell.
Yes, compile web-tree-sitter with the —debug flag.
from tree-sitter-haskell.
tree-sitter-haskell
no longer requires c++14, only c99. See this pr.
I've also added all required symbols to the WASM export.
Can you upgrade tree-sitter-haskell
?
If not, is it because the npm pakage needs updating? There's an issue for that. #50
from tree-sitter-haskell.
It won't work until the latest tree-sitter
is released. Until then, you can use the version in #68.
from tree-sitter-haskell.
Yes, I've seen the pure-c jump; I asked because I'm having similar problems with WASM files for my own language (was using a c++14 scanner library myself)
I think the best option for me is to revert back to C too 😄 Thanks!
from tree-sitter-haskell.
C is the most portable language :)
from tree-sitter-haskell.
OK, I think I'm in a much better position with the C-scanner;
I'm generating WASM files for my language with this CI workflow (please note that it's building the pure_c_scanner
branch)
Then, to test the generated WASM file:
const Parser = require('web-tree-sitter');
(async () => {
await Parser.init();
const parser = new Parser();
const Lang = await Parser.Language.load(`${__dirname}/languages/foam.wasm`);
parser.setLanguage(Lang);
const tree = parser.parse('wm 1;');
console.log(tree.rootNode.toString());
})();
BTW, no errors with any other WASM file (for cpp, haskell ... etc) just mine :(
Node errors out with:
(node:191242) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'apply' of undefined
at e.<computed> (/home/elwardi/repos/foamParser/node_modules/web-tree-sitter/tree-sitter.js:1:10542)
at tree_sitter_foam_external_scanner_scan (<anonymous>:wasm-function[11]:0xa1b)
at ts_parser_parse_wasm (<anonymous>:wasm-function[214]:0x22e29)
at Object.Module._ts_parser_parse_wasm (/home/elwardi/repos/foamParser/node_modules/web-tree-sitter/tree-sitter.js:1:20097)
at Parser.parse (/home/elwardi/repos/foamParser/node_modules/web-tree-sitter/tree-sitter.js:1:35112)
at /home/elwardi/repos/foamParser/test-wasm.js:8:23
Which suggests something is wrong with tree_sitter_foam_external_scanner_scan which is just a copy of yours.
I know very little about WebAssembly, but my WASM files and Haskell's are not much different so I can't really tell what's the problem.
Any idea on what might be the cause of this thing? Any kind of help is much appreciated
from tree-sitter-haskell.
@FoamScience On my machine, when I run tree-sitter build-wasm
and then run your node file (with paths updated), I get Error: bad export type for _ZNSt3__25ctypeIcE2idE: undefined
. Not sure if that's a step forward, or backward...
from tree-sitter-haskell.
@FoamScience On my machine, when I run
tree-sitter build-wasm
and then run your node file (with paths updated), I getError: bad export type for _ZNSt3__25ctypeIcE2idE: undefined
. Not sure if that's a step forward, or backward...
Yep, you're using the master branch which still needs C++14, please try pure_c_scanner
from tree-sitter-haskell.
Related Issues (20)
- Combining characters in identifiers are not parsed correctly HOT 1
- Include . from qualified modules and variables HOT 6
- Segfault on large files (in Neovim) HOT 1
- How do I build this outside of nvim-tree-sitter? HOT 16
- WASM build fails with error HOT 6
- Native and WASM parsers behave differently HOT 11
- Grammar defines trailing whitespace as part of lambda case statement HOT 4
- Parse errors when using DerivingVia HOT 4
- infixr and infixl not respected HOT 4
- Crashing (possibly while editing markdown) HOT 7
- Comments following function included in function pattern HOT 6
- Update to latest tree-sitter version
- Outermost function when using $ operator isn't parsed as a function HOT 8
- Instance with associated type, following TH top level splice, misparsed as function HOT 2
- Misparse of explicit-braced code
- UnicodeSyntax support HOT 10
- "undefined symbol: tree_sitter_haskell_external_scanner_create" when running "tree-sitter test" HOT 7
- Support `OverloadedRecordDot` HOT 8
- I added three more symbols for built-in syntax.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-sitter-haskell.