From e4c63912fa17ec13bbcbde8daf076e1206dba0da Mon Sep 17 00:00:00 2001 From: Alhadis Date: Thu, 19 Oct 2017 15:31:09 +1100 Subject: [PATCH 1/2] Allow Greek symbols to be matched in prompt strings --- grammars/shell-session.cson | 3 ++- spec/shell-session-spec.coffee | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/grammars/shell-session.cson b/grammars/shell-session.cson index 5d51e7b..37e0d83 100644 --- a/grammars/shell-session.cson +++ b/grammars/shell-session.cson @@ -19,7 +19,8 @@ \\s* )? ( - [>$#%] + [>$#%] | + \\p{Greek} ) \\s+ (.*) diff --git a/spec/shell-session-spec.coffee b/spec/shell-session-spec.coffee index 1110410..0010922 100644 --- a/spec/shell-session-spec.coffee +++ b/spec/shell-session-spec.coffee @@ -21,6 +21,18 @@ describe "Shell session grammar", -> expect(tokens[1]).toEqual value: ' ', scopes: ['text.shell-session'] expect(tokens[2]).toEqual value: 'echo', scopes: ['text.shell-session', 'source.shell', 'support.function.builtin.shell'] + it "tokenises prompts with Greek characters", -> + sigils = ["λ", "Λ", "Δ", "Σ", "Ω"] + for sigil in sigils + lines = grammar.tokenizeLines """ + #{sigil} echo #{sigil}μμ + O#{sigil}tput Ω + """ + expect(lines[0][0]).toEqual value: sigil, scopes: ['text.shell-session', 'punctuation.separator.prompt.shell-session'] + expect(lines[0][2]).toEqual value: 'echo', scopes: ['text.shell-session', 'source.shell', 'support.function.builtin.shell'] + expect(lines[0][3]).toEqual value: " #{sigil}μμ", scopes: ['text.shell-session', 'source.shell'] + expect(lines[1][0]).toEqual value: "O#{sigil}tput Ω", scopes: ['text.shell-session', 'meta.output.shell-session'] + it "does not tokenize prompts with indents", -> for delim in prompts {tokens} = grammar.tokenizeLine(' ' + delim + ' echo $FOO') From cc5b6e72ebb281fd2e145facedde254bb8b07669 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Thu, 19 Oct 2017 16:46:22 +1100 Subject: [PATCH 2/2] Delete redundant `.coffeelintignore` file Like every other grammar package, there never was a `spec/fixtures`. Relevant: * atom/language-gfm@181e691 * atom/language-javascript#464 * atom/language-todo@7d9c2bb9 --- .coffeelintignore | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .coffeelintignore diff --git a/.coffeelintignore b/.coffeelintignore deleted file mode 100644 index 1db51fe..0000000 --- a/.coffeelintignore +++ /dev/null @@ -1 +0,0 @@ -spec/fixtures