ocaml-tree-sitter-core icon indicating copy to clipboard operation
ocaml-tree-sitter-core copied to clipboard

Some tokens have the wrong string content

Open aryx opened this issue 4 years ago • 1 comments

See https://returntocorp.slack.com/archives/C01NXGX2EHZ/p1625677111141200

[pad@yrax yy (vue_p2)]$ cat ~/hello.vue 
<script>
hello
world
</script>
[pad@yrax yy (vue_p2)]$ semgrep-core -lang vue -dump_tree_sitter_cst ~/hello.vue 
+ /home/pad/yy/_build/default/src/cli/Main.exe -lang vue -dump_tree_sitter_cst /home/pad/hello.vue
[0.104  Info       Main.Dune__exe__Main ] loaded log_config.json
[0.104  Info       Main.Dune__exe__Main ] Executed as: /home/pad/yy/_build/default/src/cli/Main.exe -lang vue -dump_tree_sitter_cst /home/pad/hello.vue
[0.104  Info       Main.Dune__exe__Main ] Version: semgrep-core version: v0.57.0-26-g6a669dcb-dirty, pfff: 0.42
|   Script_elem
|   |   "<"
|   |   script
|   |   ">"
|   |   helloworld
|   |   "</"
|   |   script
|   |   ">"

aryx avatar Jul 09 '21 10:07 aryx

[note to self] I suspect it has to do with Src_file.get_region and the "safe" substring extraction functions in that module of the runtime library.

mjambon avatar Jul 09 '21 20:07 mjambon