Skip to content

Commit ce5ea84

Browse files
committed
fixup: newlines
1 parent 98ccbbb commit ce5ea84

File tree

4 files changed

+2711
-3047
lines changed

4 files changed

+2711
-3047
lines changed

grammar.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ module.exports = grammar({
140140
'>',
141141
choice(
142142
alias(token.immediate(/[a-z0-9]+\n/), $.language),
143-
token.immediate('\n')),
143+
token.immediate(/\n/)),
144144
alias(repeat1(alias($.line_code, $.line)), $.code),
145145
// Codeblock ends if a line starts with non-whitespace.
146146
// Terminating "<" is consumed in other rules.
147147
)),
148148

149149
// Lines.
150-
_blank: () => field('blank', '\n'),
150+
_blank: () => field('blank', /\n/),
151151
line: ($) => choice(
152152
$.column_heading,
153153
$.h1,
@@ -161,18 +161,18 @@ module.exports = grammar({
161161
optional(token.immediate('<')), // Treat codeblock-terminating "<" as whitespace.
162162
_li_token,
163163
choice(
164-
alias(seq(repeat1($._atom), '\n'), $.line),
164+
alias(seq(repeat1($._atom), /\n/), $.line),
165165
seq(alias(repeat1($._atom), $.line), $.codeblock),
166166
),
167167
repeat(alias($._line_noli, $.line)),
168168
)),
169169
// Codeblock lines: must be indented by at least 1 space/tab.
170170
// Line content (incl. whitespace) is captured as a single atom.
171-
line_code: () => choice('\n', /[\t ]+[^\n]+\n/),
171+
line_code: () => choice(/\n/, /[\t ]+[^\n]+\n/),
172172
_line_noli: ($) => seq(
173173
choice($._atom_noli, $._uppercase_words),
174174
repeat($._atom),
175-
choice($.codeblock, '\n')
175+
choice($.codeblock, /\n/)
176176
),
177177

178178
// Modeline: must start with "vim:" (optionally preceded by whitespace)
@@ -196,23 +196,23 @@ module.exports = grammar({
196196
alias(token.immediate(/============+[\t ]*\n/), $.delimiter),
197197
alias(repeat1($._atom), $.heading),
198198
optional(seq($.tag, repeat($._atom))),
199-
'\n',
199+
/\n/,
200200
)),
201201

202202
h2: ($) =>
203203
prec(1, seq(
204204
alias(token.immediate(/------------+[\t ]*\n/), $.delimiter),
205205
alias(repeat1($._atom), $.heading),
206206
optional(seq($.tag, repeat($._atom))),
207-
'\n',
207+
/\n/,
208208
)),
209209

210210
// Heading 3: UPPERCASE NAME, followed by optional *tags*.
211211
h3: ($) =>
212212
seq(
213213
alias($.uppercase_name, $.heading),
214214
optional(seq($.tag, repeat($._atom))),
215-
'\n',
215+
/\n/,
216216
),
217217

218218
tag: ($) => _word($,

src/grammar.json

Lines changed: 16 additions & 16 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: 2 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)