To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / 51 / 519546b54485a90980ee98464e417cc62979df94.svn-base @ 1297:0a574315af3e
History | View | Annotate | Download (460 Bytes)
| 1 |
module CodeRay |
|---|---|
| 2 |
module Scanners |
| 3 |
|
| 4 |
# Scanner for plain text. |
| 5 |
# |
| 6 |
# Yields just one token of the kind :plain. |
| 7 |
# |
| 8 |
# Alias: +plaintext+, +plain+ |
| 9 |
class Text < Scanner |
| 10 |
|
| 11 |
register_for :text |
| 12 |
title 'Plain text' |
| 13 |
|
| 14 |
KINDS_NOT_LOC = [:plain] # :nodoc: |
| 15 |
|
| 16 |
protected |
| 17 |
|
| 18 |
def scan_tokens encoder, options |
| 19 |
encoder.text_token string, :plain |
| 20 |
encoder |
| 21 |
end |
| 22 |
|
| 23 |
end |
| 24 |
|
| 25 |
end |
| 26 |
end |