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

Add Greek characters to list of acceptable prompt-symbols #85

Merged
merged 2 commits into from
Oct 19, 2017
Merged

Add Greek characters to list of acceptable prompt-symbols #85

merged 2 commits into from
Oct 19, 2017

Conversation

Alhadis
Copy link
Contributor

@Alhadis Alhadis commented Oct 19, 2017

Description of the Change

This PR enables Greek characters to be tokenised as prompt-string symbols in shell-session snippets:

λ echo $foo $bar
Foo
Bar
λ man apm
No manual entry for apm
λ man atom
No manual entry for atom.
Pathetic.
λ quit

As the above snippet illustrates, the lines beginning with λ aren't being scoped as command lines.

Compare with $:

$ echo $foo $bar
Foo
Bar
$ man apm

Note:
My shell's PS1 isn't an isolated case. Lambda calculus, functional programming, and probably Half-life have helped propagate spiffy-looking Greek things in any notation intended to look mathematical or programming-related.

Mocha's homepage features screenshots which also show λ in use.

Alternate Designs

I thought to include \p{S} in the pattern-block, which matches anything with a Unicode Symbol property.
The scope was too broad, and compatibility issues between Oniguruma and PCRE reared its ugly head.

Thankfully, both engines agree on the syntax for matching Unicode script-properties.

Benefits

Improved highlighting on GitHub. Specifically in README files, where example usage often takes the form of a terminal session's output.

Possible Drawbacks / Applicable Issues

None I can think of.

@Alhadis
Copy link
Contributor Author

Alhadis commented Oct 19, 2017

/cc @50Wliu, because I know he loves SourcePawn and Half-Life and stuff. =)

Like every other grammar package, there never was a `spec/fixtures`.

Relevant:
* atom/language-gfm@181e691
* atom/language-javascript#464
* atom/language-todo@7d9c2bb9
@winstliu
Copy link
Contributor

Ha!

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

Successfully merging this pull request may close these issues.

2 participants