summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-23 01:10:06 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-23 01:10:06 +0200
commit492dd5968be468db8d152edb6a525b8aee182632 (patch)
tree64eddda6c3afedbb054413a98eb17d6e5ed90dec
parentda1425058e9b9e04bd988ddf606331d9cd0c827b (diff)
parent546b489e4b3856d361a480de5f1f02cb55c7f002 (diff)
downloadcoderay-492dd5968be468db8d152edb6a525b8aee182632.tar.gz
Merge branch 'master' into lua-scanner
-rw-r--r--lib/coderay/tokens.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb
index 54358d4..e7bffce 100644
--- a/lib/coderay/tokens.rb
+++ b/lib/coderay/tokens.rb
@@ -3,17 +3,16 @@ module CodeRay
# The Tokens class represents a list of tokens returned from
# a Scanner. It's actually just an Array with a few helper methods.
#
- # A token itself is not a special object, just a two-element Array
- # consisting of
+ # A token itself is not a special object, just two elements in an Array:
# * the _token_ _text_ (the original source of the token in a String) or
# a _token_ _action_ (begin_group, end_group, begin_line, end_line)
# * the _token_ _kind_ (a Symbol representing the type of the token)
#
# It looks like this:
#
- # ['# It looks like this', :comment]
- # ['3.1415926', :float]
- # ['$^', :error]
+ # ..., '# It looks like this', :comment, ...
+ # ..., '3.1415926', :float, ...
+ # ..., '$^', :error, ...
#
# Some scanners also yield sub-tokens, represented by special
# token actions, for example :begin_group and :end_group.
@@ -21,11 +20,11 @@ module CodeRay
# The Ruby scanner, for example, splits "a string" into:
#
# [
- # [:begin_group, :string],
- # ['"', :delimiter],
- # ['a string', :content],
- # ['"', :delimiter],
- # [:end_group, :string]
+ # :begin_group, :string,
+ # '"', :delimiter,
+ # 'a string', :content,
+ # '"', :delimiter,
+ # :end_group, :string
# ]
#
# Tokens can be used to save the output of a Scanners in a simple