diff options
author | murphy <murphy@rubychan.de> | 2010-06-01 21:35:29 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2010-06-01 21:35:29 +0000 |
commit | f9e4f054f7aa6129bf400188f58f7a8c359e2b2f (patch) | |
tree | e373f399634d8bf99d6a6b73ef44b85498847a7b /lib/coderay/encoder.rb | |
parent | 6f87649e90c55efac703d9c5b7838fceada89b9e (diff) | |
download | coderay-f9e4f054f7aa6129bf400188f58f7a8c359e2b2f.tar.gz |
Added Encoder#tokens, improved some error messages.
Diffstat (limited to 'lib/coderay/encoder.rb')
-rw-r--r-- | lib/coderay/encoder.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/coderay/encoder.rb b/lib/coderay/encoder.rb index 6e32e75..7acfe79 100644 --- a/lib/coderay/encoder.rb +++ b/lib/coderay/encoder.rb @@ -167,8 +167,7 @@ module CodeRay content = nil for item in tokens if item.is_a? Array - warn 'two-element array tokens are deprecated' - content, item = *item + raise ArgumentError, 'Two-element array tokens are no longer supported.' end if content token content, item @@ -177,8 +176,11 @@ module CodeRay content = item end end - raise if content + raise 'odd number list for Tokens' if content end + + alias tokens compile + public :tokens end |