Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add injectionRegex to the tree-sitter grammar #314

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

Conversation

eugmes
Copy link

@eugmes eugmes commented Dec 23, 2019

This allows to use this grammar from other tree-sitter grammars.

See also: atom/atom#17551

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

This change adds injectionRegex regex key into tree-sitter-python.cson. Other grammars will be able to inject python grammar by specifying language py or anything that contains Python or python.

Alternate Designs

I don't know about any other alternatives.

Benefits

This will allow to use python grammar from other language packages that use tree-sitter. I'm developing https://github.com/eugmes/language-coccinelle that will benefit from this feature.

Possible Drawbacks

The grammar can be injected instead of some other grammar that uses similar injection regex. But I think that the proposed regex is specific enough to not cause many problems.

Applicable Issues

None?

This allows to use this grammar from other tree-sitter grammars.

See also: atom/atom#17551
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
1 participant