Skip to content

Commit

Permalink
fixup: column_heading
Browse files Browse the repository at this point in the history
  • Loading branch information
clason committed Jun 1, 2024
1 parent 8608da5 commit 98ccbbb
Show file tree
Hide file tree
Showing 4 changed files with 3,524 additions and 3,664 deletions.
13 changes: 11 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ const _li_token = /[-•][ ]+/;
module.exports = grammar({
name: 'vimdoc',

conflicts: $ => [
[$._line_noli, $._column_heading],
[$._column_heading],
],

extras: () => [/[\t ]/],

// inline: ($) => [
Expand Down Expand Up @@ -177,10 +182,14 @@ module.exports = grammar({
// Intended for table column names per `:help help-writing`.
// TODO: children should be $.word (plaintext), not $.atom.
column_heading: ($) => seq(
alias(seq(choice($._atom_noli, $._uppercase_words), repeat($._atom)), $.heading),
alias($._column_heading, $.heading),
alias('~', $.delimiter),
token.immediate('\n'),
token.immediate(/\n/),
),
_column_heading: $ => prec.dynamic(1, seq(
choice($._atom_noli, $._uppercase_words),
repeat($._atom)
)),

h1: ($) =>
prec(1, seq(
Expand Down
68 changes: 42 additions & 26 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 98ccbbb

Please sign in to comment.