diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-07 16:49:29 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-07 20:11:32 +0100 |
| commit | 3570869c9ae2c4df14b15423789919e514322916 (patch) | |
| tree | 6b990c9ec59fbdc7abce89c1307d22e66d0fd88a /lexers/taskpaper.lua | |
| parent | 098504f67aea8a862840d58c69e8f6360eef3073 (diff) | |
| download | vis-3570869c9ae2c4df14b15423789919e514322916.tar.gz vis-3570869c9ae2c4df14b15423789919e514322916.tar.xz | |
Move all lua related files to lua/ subfolder
Also remove the lexers sub directory from the Lua search path.
As a result we attempt to open fewer files during startup:
$ strace -e open -o log ./vis +q config.h && wc -l log
In order to avoid having to modifiy all lexers which `require('lexer')`
we instead place a symlink in the top level directory.
$ ./configure --disable-lua
$ rm -rf lua
Should result in a source tree with most lua specifc functionality
removed.
Diffstat (limited to 'lexers/taskpaper.lua')
| -rw-r--r-- | lexers/taskpaper.lua | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/lexers/taskpaper.lua b/lexers/taskpaper.lua deleted file mode 100644 index 5652f3a..0000000 --- a/lexers/taskpaper.lua +++ /dev/null @@ -1,59 +0,0 @@ --- Copyright (c) 2016 Larry Hynes. See LICENSE. --- Taskpaper LPeg lexer - -local l = require('lexer') -local token = l.token -local P, R, S = lpeg.P, lpeg.R, lpeg.S - -local M = {_NAME = 'taskpaper'} - -local delimiter = P(' ') + P('\t') - --- Whitespace -local ws = token(l.WHITESPACE, l.space^1) - --- Tags -local day_tag = token('day_tag', (P('@today') + P('@tomorrow'))) - -local overdue_tag = token('overdue_tag', P('@overdue')) - -local plain_tag = token('plain_tag', P('@') * l.word) - -local extended_tag = token('extended_tag', - P('@') * l.word * P('(') * - (l.word + R('09') + P('-'))^1 * P(')')) - --- Projects -local project = token('project', - l.nested_pair(l.starts_line(l.alnum), ':') * l.newline) - --- Notes -local note = token('note', delimiter^1 * l.alnum * l.nonnewline^0) - --- Tasks -local task = token('task', delimiter^1 * P('-') + l.newline) - -M._rules = { - {'note', note}, - {'task', task}, - {'project', project}, - {'extended_tag', extended_tag}, - {'day_tag', day_tag}, - {'overdue_tag', overdue_tag}, - {'plain_tag', plain_tag}, - {'whitespace', ws}, -} - -M._tokenstyles = { - note = l.STYLE_CONSTANT, - task = l.STYLE_FUNCTION, - project = l.STYLE_TAG, - extended_tag = l.STYLE_COMMENT, - day_tag = l.STYLE_CLASS, - overdue_tag = l.STYLE_PREPROCESSOR, - plain_tag = l.STYLE_COMMENT, -} - -M._LEXBYLINE = true - -return M |
