Skip to content
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

Add an option to make it compatible with "goyacc" #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YT315
Copy link

@YT315 YT315 commented Mar 22, 2021

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

@babyraging
Copy link
Owner

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

yash/package.json

Lines 80 to 86 in 0379b1b

"language": "yacc",
"scopeName": "source.y",
"path": "./syntaxes/yacc.tmLanguage.json",
"embeddedLanguages": {
"entity.prologue.yacc": "cpp",
"entity.action.yacc": "cpp"
}

If you can find an elegant way to dynamicly change the syntax highlight behavior for the embedded language that would be great!

@YT315
Copy link
Author

YT315 commented Mar 23, 2021

Thank you for your reply:

Let me try !

@joe-elliott
Copy link

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.

@Lercher
Copy link

Lercher commented Sep 30, 2023

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.

@theory
Copy link

theory commented Mar 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants