Skip to content

Conversation

@cmaglie
Copy link
Member

@cmaglie cmaglie commented May 11, 2023

Previously #line tags were not correctly parsed if they contained escaped chars like \"

$ cat /tmp/test.cpp
# 1 "/home/megabug/Workspace/arduino-cli/internal/integrationtest/testdata/PathWith\"Quotes/Sketch/Sketch.ino"
void setup() {
  foo();
}
void loop() {}
void foo() {}
$ ./ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/test.cpp
$

after this patch the line directives are parsed correctly:

$ cat /tmp/test.cpp
# 1 "/home/megabug/Workspace/arduino-cli/internal/integrationtest/testdata/PathWith\"Quotes/Sketch/Sketch.ino"
void setup() {
  foo();
}
void loop() {}
void foo() {}
$ ./ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/test.cpp
setup	/home/megabug/Workspace/arduino-cli/internal/integrationtest/testdata/PathWith"Quotes/Sketch/Sketch.ino	/^void setup() {$/;"	kind:function	line:1	signature:()	returntype:void
loop	/home/megabug/Workspace/arduino-cli/internal/integrationtest/testdata/PathWith"Quotes/Sketch/Sketch.ino	/^void loop() {}$/;"	kind:function	line:4	signature:()	returntype:void
foo	/home/megabug/Workspace/arduino-cli/internal/integrationtest/testdata/PathWith"Quotes/Sketch/Sketch.ino	/^void foo() {}$/;"	kind:function	line:5	signature:()	returntype:void
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant