diff options
Diffstat (limited to 'lib/coderay/scanners/taskpaper.rb')
-rw-r--r-- | lib/coderay/scanners/taskpaper.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/coderay/scanners/taskpaper.rb b/lib/coderay/scanners/taskpaper.rb index c6eb3b3..42670bc 100644 --- a/lib/coderay/scanners/taskpaper.rb +++ b/lib/coderay/scanners/taskpaper.rb @@ -10,17 +10,19 @@ module Scanners def scan_tokens encoder, options until eos? - if match = scan(/^\S.*:.*$/) # project - encoder.text_token(match, :project) - elsif match = scan(/^-.+@done(?:\(.*)?.*$/) # completed task - encoder.text_token(match, :complete) - elsif match = scan(/^-.+$/) # task + if match = scan(/\S.*:.*$/) # project + encoder.text_token(match, :namespace) + elsif match = scan(/-.+@done.*/) # completed task + encoder.text_token(match, :done) + elsif match = scan(/-(?:[^@\n]+|@(?!due))*/) # task encoder.text_token(match, :plain) - elsif match = scan(/^.+$/) # comment + elsif match = scan(/@due.*/) # comment + encoder.text_token(match, :important) + elsif match = scan(/.+/) # comment encoder.text_token(match, :comment) - elsif match = scan(/\s+/) # space + elsif match = scan(/\s+/) # space encoder.text_token(match, :space) - else # other + else # other encoder.text_token getch, :error end end |