yash icon indicating copy to clipboard operation
yash copied to clipboard

Add an option to make it compatible with "goyacc"

Open YT315 opened this issue 4 years ago • 5 comments

Added a little modification so that it can parse the "union" of golang

YT315 avatar Mar 22 '21 07:03 YT315

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!

babyraging avatar Mar 22 '21 17:03 babyraging

Thank you for your reply:

Let me try !

YT315 avatar Mar 23 '21 03:03 YT315

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.

joe-elliott avatar May 06 '22 16:05 joe-elliott

Found this PR and it appears to make this false-positive error message to go away:

image

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.

Lercher avatar Sep 30 '23 15:09 Lercher

+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.

theory avatar Mar 22 '24 13:03 theory