yash
yash copied to clipboard
Add an option to make it compatible with "goyacc"
Added a little modification so that it can parse the "union" of golang
Hi! Thank you for the PR!
We could add a new feature to support Golang as the embedded language. However, this PR is not enough since it only handles the union parsing part and not the syntax highlight part.
That is, if we want to add a new embedded language, we need to add it in full; which means we need to handle also the syntax highlighting inside the %{ %} block and all { } action blocks.
At this moment, the declaration of an embedded language is "hard coded" in the package.json file
https://github.com/babyraging/yash/blob/0379b1b910d0aa68f1f2fd4754333b5b59f28a12/package.json#L80-L86
If you can find an elegant way to dynamicly change the syntax highlight behavior for the embedded language that would be great!
Thank you for your reply:
Let me try !
I have recently been using this plugin with goyacc and would love this feature. If it only supported the union that would be a large improvement independent of the other concerns.
Found this PR and it appears to make this false-positive error message to go away:
Reason is: Go is type-last and C is type-first. So, IMO, even without Go syntax highlighting support it's a definitive improvement, and that's the reason for my "ping" here.
+1 to at least fixing the union parsing; it doesn't complain about My Go code in production blocks; indeed, they seem to be quite nicely syntax highlighted.