-
-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add gnu inline asm syntax #140
Conversation
7688778
to
12aeaf1
Compare
I have something similar in my Objective-C grammar, is it more or less the same? https://github.com/amaanq/tree-sitter-objc/blob/7938eb5e135574095d8baf2c758e1f69d8cccafa/grammar.js#L372 I also have one for ms's version, |
I think they are trying to do the same thing, but there are some issues with the objective-c version:
|
I added the optional identifiers after the strings because of this Is this valid then only in Objective-C? The other changes are good, I can then easily extend off of that from C which would be nice 🙂 |
We are talking about different parameters. The The last line of my test case uses a clobber list (with just "r2"). tree-sitter-c/test/corpus/expressions.txt Lines 135 to 143 in a53e6a3
From what I can tell, the asm syntax for obj-c, c and c++ is the same, but may need to be updated to support other features (ie raw string literals). |
For reference, the GNU specification for extended inline assmebly. |
Oh yeah, sorry about that! I appreciate the gnu reference - but I believe other compilers support it as well - can we rename the rules to drop the gnu prefix? |
While the main compilers (clang, gcc) all support this syntax, it is a GNU extension and not a language standard. I guess I chose the You want to drop the prefix altogether and figure out the other syntax names later? Or perhaps there is a prefix you like better? |
If it's a gnu extension then no worries (I wasn't sure about that), this looks good! |
Add the GNU inline assembly syntax. Let me know if you think the names of nodes or the tree structure should be different. The structure is a bit more lax than the specification, but I think it makes sense for simplicity.
closes #139