diff options
| author | mitchell <unknown> | 2020-04-25 16:26:31 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2020-04-25 16:26:31 -0400 |
| commit | fad15f79b1230b3076be515d6894c8919562809b (patch) | |
| tree | 72c848ef02c3331de5ca54eff7adaea3a9a6fb88 /lexlua/taskpaper.lua | |
| parent | 1fd02a367dec125c0b49dd9246a0928433866b96 (diff) | |
| download | scintilla-mirror-fad15f79b1230b3076be515d6894c8919562809b.tar.gz | |
Reformatted Lua LPeg lexers and added new convenience functions and pattern.
`lexer.range()` replaces `lexer.delimited_range()` and `lexer.nested_pair()`.
`lexer.to_eol()` replaces `patt * lexer.nonnewline^0` constructs.
`lexer.number` replaces `lexer.float + lexer.integer`.
Also added unit tests for lexer functions.
Diffstat (limited to 'lexlua/taskpaper.lua')
| -rw-r--r-- | lexlua/taskpaper.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lexlua/taskpaper.lua b/lexlua/taskpaper.lua index de9270286..a7a390c68 100644 --- a/lexlua/taskpaper.lua +++ b/lexlua/taskpaper.lua @@ -19,14 +19,12 @@ local overdue_tag = token('overdue_tag', P('@overdue')) local plain_tag = token('plain_tag', P('@') * lexer.word) -local extended_tag = token('extended_tag', - P('@') * lexer.word * P('(') * - (lexer.word + R('09') + P('-'))^1 * P(')')) +local extended_tag = token('extended_tag', P('@') * lexer.word * P('(') * + (lexer.word + R('09') + P('-'))^1 * P(')')) -- Projects -local project = token('project', - lexer.nested_pair(lexer.starts_line(lexer.alnum), ':') * - lexer.newline) +local project = token('project', lexer.range(lexer.starts_line(lexer.alnum), + ':', false, false, true) * lexer.newline) -- Notes local note = token('note', delimiter^1 * lexer.alnum * lexer.nonnewline^0) |
