Skip to content

Need help with creating linker script parser #3009

Closed Answered by mingodad
mtoohey31 asked this question in Q&A
Discussion options

You must be logged in to vote

I've been looking at it and found that changing the order of wildcard_name seems to fix the problem (see bellow).

Looking the original lexer here https://github.com/bminor/binutils-gdb/blob/0fd455766e7f1bd7df328e104281b49a5268677f/ld/ldlex.l#L95 we can see that the character set for each type of NAME is shown form the more general to less general, to reproduce it in tree-sitter we should order then in less general to more general (shortest match first, longest match last).

Probably you should review the order of the other NAMEs too.

---------------------------------- grammar.js ----------------------------------
index b192b3d..4e2dc01 100644
@@ -57,7 +57,6 @@ module.exports = grammar({
  …

Replies: 5 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@mtoohey31
Comment options

Comment options

You must be logged in to vote
1 reply
@mtoohey31
Comment options

Answer selected by mtoohey31
Comment options

You must be logged in to vote
1 reply
@amaanq
Comment options

Comment options

You must be logged in to vote
3 replies
@amaanq
Comment options

@amaanq
Comment options

@mtoohey31
Comment options

Comment options

You must be logged in to vote
1 reply
@amaanq
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants