Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3effca8
commit aeac667
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module CodeRay | ||
module Scanners | ||
|
||
class Taskpaper < Scanner | ||
|
||
register_for :taskpaper | ||
file_extension 'taskpaper' | ||
|
||
protected | ||
|
||
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 | ||
encoder.text_token(match, :plain) | ||
elsif match = scan(/^.+$/) # comment | ||
encoder.text_token(match, :comment) | ||
elsif match = scan(/\s+/) # space | ||
encoder.text_token(match, :space) | ||
else # other | ||
encoder.text_token getch, :error | ||
end | ||
end | ||
|
||
encoder | ||
end | ||
|
||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters