summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-12 15:49:44 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-12 15:49:44 +0200
commitabdc3e4a18b664e9d6e20e06913a0aa342f8ca73 (patch)
tree57cbbf918c76b8f3eb38d5ad92f3eb24bf1b0d59 /lib/coderay/scanners
parentce3f8389dda50a93a4aec151f6051841d7c65099 (diff)
downloadcoderay-abdc3e4a18b664e9d6e20e06913a0aa342f8ca73.tar.gz
tweak Taskpaper scanner, cleanup doc_string kind
Diffstat (limited to 'lib/coderay/scanners')
-rw-r--r--lib/coderay/scanners/taskpaper.rb18
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