Skip to content

Commit c6b69a8

Browse files
committed
cleanup: remove useless special cases
1 parent d1a283b commit c6b69a8

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

grammar.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module.exports = grammar({
9292
/CTRL-./,
9393
/CTRL-SHIFT-./,
9494
/CTRL-(Break|PageUp|PageDown|Insert|Del)/,
95-
/CTRL-\{char\}/,
95+
'CTRL-{char}',
9696
/META-./,
9797
/ALT-./,
9898
),
@@ -207,16 +207,7 @@ module.exports = grammar({
207207
// Link to option: 'foo'. Lowercase non-digit ASCII, minimum 2 chars. #14
208208
optionlink: ($) => _word($, /[a-z][a-z]+/, "'", "'"),
209209
// Link to tag: |foo|
210-
taglink: ($) => _word($, prec(1, choice(
211-
/[^|\n\t ]+/,
212-
// Special cases: |(| |{| …
213-
'{',
214-
'}',
215-
'(',
216-
')',
217-
'`',
218-
)),
219-
'|', '|'),
210+
taglink: ($) => _word($, prec(1, /[^|\n\t ]+/), '|', '|'),
220211
// Inline code (may contain whitespace!): `foo bar`
221212
codespan: ($) => _word($, /[^``\n]+/, '`', '`'),
222213
// Argument: {arg} (no whitespace allowed)
@@ -228,8 +219,6 @@ module.exports = grammar({
228219
// `rule` can be a rule function or regex. It is aliased to "word" because they are
229220
// semantically the same: atoms of captured plain text.
230221
function _word($, rule, c1, c2, fname) {
231-
// rule = rule.test ? token.immediate(rule) : rule
232-
// rule = token.immediate(rule)
233222
fname = fname ?? 'text';
234223
return seq(c1, field(fname, alias(token.immediate(rule), $.word)), token.immediate(c2));
235224
}

0 commit comments

Comments
 (0)