-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Adding support for the OpenSCAD language #3532
base: master
Are you sure you want to change the base?
Conversation
runtime/plugins/comment/comment.lua
Outdated
@@ -60,6 +60,7 @@ ft["yaml"] = "# %s" | |||
ft["zig"] = "// %s" | |||
ft["zscript"] = "// %s" | |||
ft["zsh"] = "# %s" | |||
ft["openscad"] = "// %s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably go between "ocaml" and "pascal" to maintain the alphabetic ordering.
runtime/syntax/openscad.yaml
Outdated
|
||
- constant: "\\b(pi|undef)\\b" | ||
|
||
- identifier: "\\b($fn|$fa|$fs|$t|$children)\\b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with OpenSCAD syntax but $
in regex marks the end of line so this is probably not what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, it works properly without escaping the $ symbol. Perhaps it only sees it as "end of string" if it can be at the end of a string. I will test with it escaped and see if it still works with the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, I was testing with my file, which does escape the $ symbol.
I withdraw my assertion that it works without escaping.
I got confused as to which syntax file the comment related to.
runtime/syntax/openscad.yaml
Outdated
filename: "\\.scad$" | ||
|
||
rules: | ||
- statement: "\\b(module|function|include|use|let|for|if|else|true|false)\\b" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't true
and false
be constants?
More or less a duplicate of #3410? |
Apologies for the duplicate—I'm new to this. I noticed that the previous
pull request was merged about two months ago, but I’m not seeing the
changes reflected on my instance. Could you please guide me on how to
proceed with the PR process? I’d also appreciate any tips on how to
contribute more effectively. Thanks
…On Tue, 5 Nov 2024, 01:00 Jöran Karl, ***@***.***> wrote:
More or less a duplicate of #3410
<#3410>?
—
Reply to this email directly, view it on GitHub
<#3532 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARP3OUEQ5HKKMFIOIC4H4J3Z674AFAVCNFSM6AAAAABRE7T5EOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJVHA3TGNJYGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Thank you for all your comments, I fixed the issues raised above. |
Maybe you have a look into the following two GitHub documentations:
Afterwards you edit the already existing scad.yaml and add the things you miss there. Then you can update this PR or close it and create a new one...depends what is easier for you to handle. |
Thank you for the references, @JoeKar. I was asking about a specific issue here: as you mentioned, this seems to be a duplicate of a previous one that was resolved and merged to master, but the changes don't appear to be reflected in the repo. @zyedidia, with your approval, I believe it's ready for merge now. Thank you for your time and consideration. |
@BenSiv It is definitely in the repo, maybe you missed it because the file is called scad.yaml instead of openscad.yaml like in this pull request? (Which is also why I didn't realize the syntax already exists when reviewing the PR.) Renaming it to openscad.yaml might be a good idea to be consistent with the other syntax files (nearly all of which are named after the language, not the file extension). |
@Andriamanitra Thank you for your comment; you are absolutely right. I have merged the two files to the naming convention. |
That was the reason, why I referred to:
😉
@jmcorey: |
Thanks for the heads up! I hadn't noticed the conversation. I have no preference for whether the file is named openscad.yaml or scad.yaml. The actual files end in .scad rather than .openscad, though to be honest openscad is the main program that parses and recognizes these files, so I guess it reflects poorly on me that I couldn't figure out whether to call it scad or openscad. Probably just scad, but I'm fine either way. |
As for whether it's ready to merge, there might be still more cleanup that could be done. For example, I remember when I did my patch, I was encouraged to put all the statement keywords on one single line, rather than splitting it out based on abstract groupings, to reduce the overall number of rules in the file for the sake of efficiency. Right now, it looks like in the proposed file there are multiple different "statements" lines, and there is even duplication between them, for example see the "else" keyword. It's also interesting that there's a numbers section in the middle of the file and one towards the end--suspect some duplication there as well, and am wondering if it's necessary to have them so far apart in the file. |
When it's looking more like finished draft material, I'd be happy to help test. I assume there's no way to |
I added a syntax file for the language, plus a comment identifier for line commenting.