Skip to content

Commit 53018b9

Browse files
committed
feat!: remove str_single_quote
1 parent 174afb8 commit 53018b9

7 files changed

Lines changed: 347045 additions & 347970 deletions

File tree

grammar.js

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,6 @@ module.exports = grammar({
895895
expr_double_quotes: ($) => expr_rule($, '"'),
896896
operator: (_) => /==|!=|<|>|<=|>=|\|\||&&/,
897897
attribute: (_) => /[a-z-]+/,
898-
str_single_quote: (_) => "'",
899898
str_single_quotes: ($) =>
900899
seq(
901900
"'",
@@ -936,15 +935,19 @@ module.exports = grammar({
936935
choice(
937936
$.backslash_escape,
938937
$.str_double_quotes,
939-
quoted_string("'", $.shell, $.str_single_quote),
938+
seq(
939+
"'",
940+
alias(field("content", new RegExp("([^']|\\\\')*")), $.shell),
941+
"'",
942+
),
940943
alias($._word, $.shell),
941944
$.block,
942945
),
943946
_tmux: ($) =>
944947
choice(
945948
$.backslash_escape,
946949
$.str_double_quotes,
947-
seq($.str_single_quote, $._command, $.str_single_quote),
950+
seq("'", $._command, "'"),
948951
$._command,
949952
$.block,
950953
),
@@ -980,18 +983,6 @@ function spaceSep1($, rule) {
980983
return sep1(choice(rule, $.comment), " ");
981984
}
982985

983-
function quoted_string(char, name, char_rule = null) {
984-
char_rule = char_rule || char;
985-
return seq(
986-
char_rule,
987-
alias(
988-
field("content", new RegExp("([^" + char + "]|\\\\" + char + ")*")),
989-
name,
990-
),
991-
char_rule,
992-
);
993-
}
994-
995986
function options($, chars) {
996987
return alias(new RegExp("-[" + chars + "]+"), $.command_line_option);
997988
}

src/grammar.json

Lines changed: 8 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 0 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)