epics-extensions / tree-sitter-epics

Parsers for various EPICS-specific syntaxes
MIT License
7 stars 1 forks source link

Double macro in cmd call (with `< `) seems not supported #19

Open vnadot opened 1 month ago

vnadot commented 1 month ago

It seems that double macro in cmd file are not supported:

This works:

< ${TOP}/myApp/.cmd
$ tree-sitter parse --stat --quiet --scope source.epics.cmd temp.cmd 

Total parses: 1; successful parses: 1; failed parses: 0; success percentage: 100.00%; average speed: 7006 bytes/ms

But this does not:

< ${TOP}/myApp/${cmdName}.cmd
$ tree-sitter parse --stat --quiet --scope source.epics.cmd temp.cmd 
temp.cmd       2.09 ms    7340 bytes/ms (ERROR [284, 25] - [284, 29])

Total parses: 1; successful parses: 0; failed parses: 1; success percentage: 0.00%; average speed: 7343 bytes/ms
minijackson commented 1 month ago

Can you try this:

< "${TOP}/myApp/${cmdName}.cmd"

I think it may be that the macro is inside the argument, and tree-sitter gets confused and split the argument in two.