Skip to content

Commit

Permalink
constrain (argument) definition
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmk committed Jun 21, 2023
1 parent 6bae42a commit 1723454
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 20 deletions.
24 changes: 20 additions & 4 deletions corpus/arguments.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
argument
================================================================================
argument: {arg}
argument: {arg arg}
CTRL-R CTRL-R {register CTRL-F}
tuple: {arg,arg}
keycode: CTRL-R {CTRL-R} {register CTRL-F}
list of { uri:string, name: string } tables


Expand All @@ -23,7 +23,12 @@ list of { uri:string, name: string } tables
(word)
(keycode)
(argument
(word)))
(word))
(word)
(ERROR
(word))
(keycode)
(word))
(line
(word)
(word)
Expand Down Expand Up @@ -71,6 +76,7 @@ argument in parentheses
================================================================================
NOT an argument
================================================================================
a '{' '}' block
{foo "{bar}" `{baz}` |{baz| } {}
foo { bar
{ {} foo{{ foo{{{
Expand All @@ -92,10 +98,20 @@ EXTERNAL *netrw-externapp* {{{2
(help_file
(block
(line
(word)
(word)
(word)
(ERROR
(word)
(word))
(word)
(word)
(word)
(word))
(line
(word)
(ERROR
(word))
(word)
(codespan
(word))
(taglink
Expand Down
7 changes: 3 additions & 4 deletions corpus/optionlink.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ Regular / :help /[
(word))
(word)
(word)
(word)
(ERROR
(word))
(argument
(word))
(word)
Expand All @@ -112,7 +109,9 @@ Regular / :help /[
(word)
(word)
(word)
(word))
(word
(ERROR
(word))))
(line
(word)
(word)
Expand Down
3 changes: 2 additions & 1 deletion corpus/taglink.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ Note: ":autocmd" can...
(line
(word)
(word)
(word)
(ERROR
(word))
(word))
(line
(word)
Expand Down
18 changes: 9 additions & 9 deletions corpus/tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ NOT a tag
(word)
(word)
(word)
(tag
(word)
(MISSING "*")))
(word)
(ERROR
(word)))
(line
(word)
(word)
Expand All @@ -121,16 +121,16 @@ NOT a tag
(word))
(line
(word)
(tag
(word)
(MISSING "*"))
(word)
(ERROR
(word))
(word)))
(block
(line
(word)
(tag
(word)
(MISSING "*"))
(word)
(ERROR
(word))
(word)
(word)
(word))))
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ module.exports = grammar({
'|', '|'),
// Inline code (may contain whitespace!): `foo bar`
codespan: ($) => _word($, /[^``\n]+/, '`', '`'),
// Argument: {arg}
argument: ($) => _word($, /[^{}\n\t ][^{}\n\t]*/, '{', '}'),
// Argument: {arg} (no whitespace allowed)
argument: ($) => _word($, /[^}\n\t ]+/, '{', '}'),
},
});

Expand Down

0 comments on commit 1723454

Please sign in to comment.