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 script to generate duplicate grammars for embedding #295

Merged
merged 10 commits into from
Aug 8, 2019

Conversation

matter123
Copy link
Collaborator

@matter123 matter123 commented Jul 8, 2019

This PR is from the updated master.

scripts/duplicateForEmbedding.js adds a generic way to support any number of early bailout patterns.

The grammar has been modified to use the macro embedded grammar for macros.

@jeff-hykin
Copy link
Owner

This looks nice 👍 I'll work on getting it merged in in the next few days

@matter123
Copy link
Collaborator Author

The Extension Development Host scopes don't match what the tests say the scopes are. I'm guessing that I'm not announcing the syntax file correctly.

@matter123
Copy link
Collaborator Author

matter123 commented Jul 9, 2019

While this might work, and is probably still useful if another grammar needs to embed c++. This is not the best route to go with macros.

There are a couple of disadvantages:

  • This duplicates non-range patterns
  • If an embeddable grammar is made it will need its own macro-fied version

@matter123 matter123 mentioned this pull request Jul 13, 2019
@matter123
Copy link
Collaborator Author

If you prefer I can rewrite this in ruby, but otherwise, I believe it works well enough to be merged in.

@matter123 matter123 changed the title WIP: Add script to generate duplicate grammars for embedding Add script to generate duplicate grammars for embedding Aug 1, 2019
@jeff-hykin
Copy link
Owner

jeff-hykin commented Aug 5, 2019

This looks nice 👍 I'll work on getting it merged in in the next few days

Oops 😬 I'll look over it now

@jeff-hykin
Copy link
Owner

jeff-hykin commented Aug 5, 2019

I'll work on merging this in before I do anything else. In the future lets turn it into feature inside the ruby gem. I'm fine with stuff being done in javascript in general though, its basically the universal programming language.

I was imagining the bailed-out patterns as part of the language-syntax file, so you could take any subset language, for example regex, add an early bailout to it, and then use that like any other tag.

@jeff-hykin jeff-hykin mentioned this pull request Aug 8, 2019
@jeff-hykin jeff-hykin merged commit 60ea39b into master Aug 8, 2019
@jeff-hykin jeff-hykin deleted the Add/generic-embedding-support-bailout-new branch August 8, 2019 23:40
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.

2 participants