diff options
author | murphy <murphy@rubychan.de> | 2010-04-14 23:59:03 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2010-04-14 23:59:03 +0000 |
commit | 200144dd009d33ff8334be24d0fb2cc91b3a87ab (patch) | |
tree | f46c939cd01b8d4165b5d9f3444c20e072b51408 /test/scanners/diff | |
parent | 612a14e17bdae5dbb5b13cdceec797523725cbbe (diff) | |
download | coderay-200144dd009d33ff8334be24d0fb2cc91b3a87ab.tar.gz |
Moving scanner tests into separate repository. The repository can be reached at http://svn.rubychan.de/coderay-scanner-tests/trunk.
Diffstat (limited to 'test/scanners/diff')
-rw-r--r-- | test/scanners/diff/coderay200vs250.expected.raydebug | 2241 | ||||
-rw-r--r-- | test/scanners/diff/coderay200vs250.in.diff | 2241 | ||||
-rw-r--r-- | test/scanners/diff/const_missing.expected.raydebug | 75 | ||||
-rw-r--r-- | test/scanners/diff/const_missing.in.diff | 75 | ||||
-rw-r--r-- | test/scanners/diff/example.expected.raydebug | 27 | ||||
-rw-r--r-- | test/scanners/diff/example.in.diff | 27 | ||||
-rw-r--r-- | test/scanners/diff/suite.rb | 2 |
7 files changed, 0 insertions, 4688 deletions
diff --git a/test/scanners/diff/coderay200vs250.expected.raydebug b/test/scanners/diff/coderay200vs250.expected.raydebug deleted file mode 100644 index 79ae9a5..0000000 --- a/test/scanners/diff/coderay200vs250.expected.raydebug +++ /dev/null @@ -1,2241 +0,0 @@ -head[head(Index: )plain(lib/coderay/token_classes.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/token_classes.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/token_classes.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,71 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+) reserved(class) class(Tokens)] -insert[insert(+) constant(ClassOfKind) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -insert[insert(+) ident(h)operator([)ident(k)operator(]) operator(=) ident(k)operator(.)ident(to_s)] -insert[insert(+) reserved(end)] -insert[insert(+) constant(ClassOfKind)operator(.)ident(update) ident(with) operator(=) operator({)] -insert[insert(+) symbol(:attribute_name) operator(=)operator(>) string<delimiter(')content(an)delimiter(')>operator(,)] -insert[insert(+) symbol(:attribute_name_fat) operator(=)operator(>) string<delimiter(')content(af)delimiter(')>operator(,)] -insert[insert(+) symbol(:attribute_value) operator(=)operator(>) string<delimiter(')content(av)delimiter(')>operator(,)] -insert[insert(+) symbol(:attribute_value_fat) operator(=)operator(>) string<delimiter(')content(aw)delimiter(')>operator(,)] -insert[insert(+) symbol(:bin) operator(=)operator(>) string<delimiter(')content(bi)delimiter(')>operator(,)] -insert[insert(+) symbol(:char) operator(=)operator(>) string<delimiter(')content(ch)delimiter(')>operator(,)] -insert[insert(+) symbol(:class) operator(=)operator(>) string<delimiter(')content(cl)delimiter(')>operator(,)] -insert[insert(+) symbol(:class_variable) operator(=)operator(>) string<delimiter(')content(cv)delimiter(')>operator(,)] -insert[insert(+) symbol(:color) operator(=)operator(>) string<delimiter(')content(cr)delimiter(')>operator(,)] -insert[insert(+) symbol(:comment) operator(=)operator(>) string<delimiter(')content(c)delimiter(')>operator(,)] -insert[insert(+) symbol(:constant) operator(=)operator(>) string<delimiter(')content(co)delimiter(')>operator(,)] -insert[insert(+) symbol(:content) operator(=)operator(>) string<delimiter(')content(k)delimiter(')>operator(,)] -insert[insert(+) symbol(:definition) operator(=)operator(>) string<delimiter(')content(df)delimiter(')>operator(,)] -insert[insert(+) symbol(:delimiter) operator(=)operator(>) string<delimiter(')content(dl)delimiter(')>operator(,)] -insert[insert(+) symbol(:directive) operator(=)operator(>) string<delimiter(')content(di)delimiter(')>operator(,)] -insert[insert(+) symbol(:doc) operator(=)operator(>) string<delimiter(')content(do)delimiter(')>operator(,)] -insert[insert(+) symbol(:doc_string) operator(=)operator(>) string<delimiter(')content(ds)delimiter(')>operator(,)] -insert[insert(+) symbol(:entity) operator(=)operator(>) string<delimiter(')content(en)delimiter(')>operator(,)] -insert[insert(+) symbol(:error) operator(=)operator(>) string<delimiter(')content(er)delimiter(')>operator(,)] -insert[insert(+) symbol(:escape) operator(=)operator(>) string<delimiter(')content(e)delimiter(')>operator(,)] -insert[insert(+) symbol(:exception) operator(=)operator(>) string<delimiter(')content(ex)delimiter(')>operator(,)] -insert[insert(+) symbol(:float) operator(=)operator(>) string<delimiter(')content(fl)delimiter(')>operator(,)] -insert[insert(+) symbol(:function) operator(=)operator(>) string<delimiter(')content(fu)delimiter(')>operator(,)] -insert[insert(+) symbol(:global_variable) operator(=)operator(>) string<delimiter(')content(gv)delimiter(')>operator(,)] -insert[insert(+) symbol(:hex) operator(=)operator(>) string<delimiter(')content(hx)delimiter(')>operator(,)] -insert[insert(+) symbol(:include) operator(=)operator(>) string<delimiter(')content(ic)delimiter(')>operator(,)] -insert[insert(+) symbol(:inline) operator(=)operator(>) string<delimiter(')content(il)delimiter(')>operator(,)] -insert[insert(+) symbol(:inline_delimiter) operator(=)operator(>) string<delimiter(')content(idl)delimiter(')>operator(,)] -insert[insert(+) symbol(:instance_variable) operator(=)operator(>) string<delimiter(')content(iv)delimiter(')>operator(,)] -insert[insert(+) symbol(:integer) operator(=)operator(>) string<delimiter(')content(i)delimiter(')>operator(,)] -insert[insert(+) symbol(:interpreted) operator(=)operator(>) string<delimiter(')content(in)delimiter(')>operator(,)] -insert[insert(+) symbol(:label) operator(=)operator(>) string<delimiter(')content(la)delimiter(')>operator(,)] -insert[insert(+) symbol(:local_variable) operator(=)operator(>) string<delimiter(')content(lv)delimiter(')>operator(,)] -insert[insert(+) symbol(:modifier) operator(=)operator(>) string<delimiter(')content(mod)delimiter(')>operator(,)] -insert[insert(+) symbol(:oct) operator(=)operator(>) string<delimiter(')content(oc)delimiter(')>operator(,)] -insert[insert(+) symbol(:operator_fat) operator(=)operator(>) string<delimiter(')content(of)delimiter(')>operator(,)] -insert[insert(+) symbol(:pre_constant) operator(=)operator(>) string<delimiter(')content(pc)delimiter(')>operator(,)] -insert[insert(+) symbol(:pre_type) operator(=)operator(>) string<delimiter(')content(pt)delimiter(')>operator(,)] -insert[insert(+) symbol(:predefined) operator(=)operator(>) string<delimiter(')content(pd)delimiter(')>operator(,)] -insert[insert(+) symbol(:preprocessor) operator(=)operator(>) string<delimiter(')content(pp)delimiter(')>operator(,)] -insert[insert(+) symbol(:regexp) operator(=)operator(>) string<delimiter(')content(rx)delimiter(')>operator(,)] -insert[insert(+) symbol(:reserved) operator(=)operator(>) string<delimiter(')content(r)delimiter(')>operator(,)] -insert[insert(+) symbol(:shell) operator(=)operator(>) string<delimiter(')content(sh)delimiter(')>operator(,)] -insert[insert(+) symbol(:string) operator(=)operator(>) string<delimiter(')content(s)delimiter(')>operator(,)] -insert[insert(+) symbol(:symbol) operator(=)operator(>) string<delimiter(')content(sy)delimiter(')>operator(,)] -insert[insert(+) symbol(:tag) operator(=)operator(>) string<delimiter(')content(ta)delimiter(')>operator(,)] -insert[insert(+) symbol(:tag_fat) operator(=)operator(>) string<delimiter(')content(tf)delimiter(')>operator(,)] -insert[insert(+) symbol(:tag_special) operator(=)operator(>) string<delimiter(')content(ts)delimiter(')>operator(,)] -insert[insert(+) symbol(:type) operator(=)operator(>) string<delimiter(')content(ty)delimiter(')>operator(,)] -insert[insert(+) symbol(:variable) operator(=)operator(>) string<delimiter(')content(v)delimiter(')>operator(,)] -insert[insert(+) symbol(:xml_text) operator(=)operator(>) string<delimiter(')content(xt)delimiter(')>operator(,)] -insert[insert(+)] -insert[insert(+) symbol(:ident) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'id')] -insert[insert(+) comment(#:operator => 'op',)] -insert[insert(+) symbol(:operator) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'op')] -insert[insert(+) symbol(:space) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'sp')] -insert[insert(+) symbol(:plain) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,)] -insert[insert(+) operator(})] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:procedure)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:method)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:function)operator(])] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:open)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:close)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:nesting_delimiter)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -insert[insert(+) constant(ClassOfKind)operator([)symbol(:escape)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -insert[insert(+) comment(#ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!')] -insert[insert(+) reserved(end)] -insert[insert(+)reserved(end)] -change[change(\\ )plain(No newline at end of file)] - -head[head(Property changes on: )plain(lib/coderay/token_classes.rb)] -head[head(___________________________________________________________________)filename()] -head[head(Added: )plain(svn:executable)] -insert[insert( +)plain( *)] - -head[head(Index: )plain(lib/coderay/encoder.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoder.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoder.rb)plain( (revision 250\))] -change[change(@@)plain( -1,3 +1,5 )change(@@)] -insert[insert(+)ident(require) string<delimiter(")content(stringio)delimiter(")>] -insert[insert(+)] - reserved(module) class(CodeRay) - - comment(# This module holds the Encoder class and its subclasses.) -change[change(@@)plain( -40,7 +42,7 )change(@@)] - comment(# downcase class name instead.) - reserved(def) method(const_missing) ident(sym) - reserved(if) ident(sym) operator(==) symbol(:FILE_EXTENSION) -delete[delete(-) ident(sym)operator(.)ident(to_s)operator(.)ident(downcase)] -insert[insert(+) ident(plugin_id)] - reserved(else) - reserved(super) - reserved(end) -change[change(@@)plain( -130,13 +132,15 )change(@@)] - comment(# By default, it calls text_token or block_token, depending on) - comment(# whether +text+ is a String.) - reserved(def) method(token) ident(text)operator(,) ident(kind) -delete[delete(-) reserved(if) ident(text)operator(.)ident(instance_of?) operator(::)constant(String) comment(# Ruby 1.9: :open.is_a? String)] -delete[delete(-) ident(text_token) ident(text)operator(,) ident(kind)] -delete[delete(-) reserved(elsif) ident(text)operator(.)ident(is_a?) operator(::)constant(Symbol)] -delete[delete(-) ident(block_token) ident(text)operator(,) ident(kind)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(raise) string<delimiter(')content(Unknown token text type: %p)delimiter(')> operator(%) ident(text)] -delete[delete(-) reserved(end)] -insert[insert(+) ident(out) operator(=)] -insert[insert(+) reserved(if) ident(text)operator(.)ident(is_a?) operator(::)constant(String) comment(# Ruby 1.9: :open.is_a? String)] -insert[insert(+) ident(text_token) ident(text)operator(,) ident(kind)] -insert[insert(+) reserved(elsif) ident(text)operator(.)ident(is_a?) operator(::)constant(Symbol)] -insert[insert(+) ident(block_token) ident(text)operator(,) ident(kind)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(raise) string<delimiter(')content(Unknown token text type: %p)delimiter(')> operator(%) ident(text)] -insert[insert(+) reserved(end)] -insert[insert(+) instance_variable(@out) operator(<<) ident(out) reserved(if) reserved(defined?)operator(()instance_variable(@out)operator(\)) operator(&&) instance_variable(@out)] - reserved(end) - - reserved(def) method(text_token) ident(text)operator(,) ident(kind) -change[change(@@)plain( -164,7 +168,8 )change(@@)] - comment(# The already created +tokens+ object must be used; it can be a) - comment(# TokenStream or a Tokens object.) - reserved(def) method(compile) ident(tokens)operator(,) ident(options) -delete[delete(-) ident(tokens)operator(.)ident(each)operator(()operator(&)pre_constant(self)operator(\))] -insert[insert(+) ident(tokens)operator(.)ident(each) operator({) operator(|)ident(text)operator(,) ident(kind)operator(|) ident(token) ident(text)operator(,) ident(kind) operator(}) comment(# FIXME for Ruby 1.9?)] -insert[insert(+) comment(#tokens.each(&self\))] - reserved(end) - - reserved(end) -head[head(Index: )plain(lib/coderay/encoders/xml.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/xml.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/xml.rb)plain( (revision 250\))] -change[change(@@)plain( -22,7 +22,6 )change(@@)] - ident(protected) - - reserved(def) method(setup) ident(options) -delete[delete(-) instance_variable(@out) operator(=) string<delimiter(')delimiter(')>] - instance_variable(@doc) operator(=) constant(REXML)operator(::)constant(Document)operator(.)ident(new) - instance_variable(@doc) operator(<<) constant(REXML)operator(::)constant(XMLDecl)operator(.)ident(new) - instance_variable(@tab_width) operator(=) ident(options)operator([)symbol(:tab_width)operator(]) -change[change(@@)plain( -33,7 +32,7 )change(@@)] - instance_variable(@doc)operator(.)ident(write) instance_variable(@out)operator(,) ident(options)operator([)symbol(:pretty)operator(])operator(,) ident(options)operator([)symbol(:transitive)operator(])operator(,) pre_constant(true) - instance_variable(@out) - reserved(end) -delete[delete(-)] -insert[insert(+) ] - reserved(def) method(text_token) ident(text)operator(,) ident(kind) - reserved(if) ident(kind) operator(==) symbol(:space) - ident(token) operator(=) instance_variable(@node) -head[head(Index: )plain(lib/coderay/encoders/html/classes.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/html/classes.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/html/classes.rb)plain( (revision 250\))] -change[change(@@)plain( -1,77 +0,0 )change(@@)] -delete[delete(-)reserved(module) class(CodeRay)] -delete[delete(-)reserved(module) class(Encoders)] -delete[delete(-)] -delete[delete(-) reserved(class) class(HTML)] -delete[delete(-)] -delete[delete(-) constant(ClassOfKind) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) ident(k)operator(.)ident(to_s)] -delete[delete(-) reserved(end)] -delete[delete(-) constant(ClassOfKind)operator(.)ident(update) ident(with) operator(=) operator({)] -delete[delete(-) symbol(:attribute_name) operator(=)operator(>) string<delimiter(')content(an)delimiter(')>operator(,)] -delete[delete(-) symbol(:attribute_name_fat) operator(=)operator(>) string<delimiter(')content(af)delimiter(')>operator(,)] -delete[delete(-) symbol(:attribute_value) operator(=)operator(>) string<delimiter(')content(av)delimiter(')>operator(,)] -delete[delete(-) symbol(:attribute_value_fat) operator(=)operator(>) string<delimiter(')content(aw)delimiter(')>operator(,)] -delete[delete(-) symbol(:bin) operator(=)operator(>) string<delimiter(')content(bi)delimiter(')>operator(,)] -delete[delete(-) symbol(:char) operator(=)operator(>) string<delimiter(')content(ch)delimiter(')>operator(,)] -delete[delete(-) symbol(:class) operator(=)operator(>) string<delimiter(')content(cl)delimiter(')>operator(,)] -delete[delete(-) symbol(:class_variable) operator(=)operator(>) string<delimiter(')content(cv)delimiter(')>operator(,)] -delete[delete(-) symbol(:color) operator(=)operator(>) string<delimiter(')content(cr)delimiter(')>operator(,)] -delete[delete(-) symbol(:comment) operator(=)operator(>) string<delimiter(')content(c)delimiter(')>operator(,)] -delete[delete(-) symbol(:constant) operator(=)operator(>) string<delimiter(')content(co)delimiter(')>operator(,)] -delete[delete(-) symbol(:content) operator(=)operator(>) string<delimiter(')content(k)delimiter(')>operator(,)] -delete[delete(-) symbol(:definition) operator(=)operator(>) string<delimiter(')content(df)delimiter(')>operator(,)] -delete[delete(-) symbol(:delimiter) operator(=)operator(>) string<delimiter(')content(dl)delimiter(')>operator(,)] -delete[delete(-) symbol(:directive) operator(=)operator(>) string<delimiter(')content(di)delimiter(')>operator(,)] -delete[delete(-) symbol(:doc) operator(=)operator(>) string<delimiter(')content(do)delimiter(')>operator(,)] -delete[delete(-) symbol(:doc_string) operator(=)operator(>) string<delimiter(')content(ds)delimiter(')>operator(,)] -delete[delete(-) symbol(:entity) operator(=)operator(>) string<delimiter(')content(en)delimiter(')>operator(,)] -delete[delete(-) symbol(:error) operator(=)operator(>) string<delimiter(')content(er)delimiter(')>operator(,)] -delete[delete(-) symbol(:escape) operator(=)operator(>) string<delimiter(')content(e)delimiter(')>operator(,)] -delete[delete(-) symbol(:exception) operator(=)operator(>) string<delimiter(')content(ex)delimiter(')>operator(,)] -delete[delete(-) symbol(:float) operator(=)operator(>) string<delimiter(')content(fl)delimiter(')>operator(,)] -delete[delete(-) symbol(:function) operator(=)operator(>) string<delimiter(')content(fu)delimiter(')>operator(,)] -delete[delete(-) symbol(:global_variable) operator(=)operator(>) string<delimiter(')content(gv)delimiter(')>operator(,)] -delete[delete(-) symbol(:hex) operator(=)operator(>) string<delimiter(')content(hx)delimiter(')>operator(,)] -delete[delete(-) symbol(:include) operator(=)operator(>) string<delimiter(')content(ic)delimiter(')>operator(,)] -delete[delete(-) symbol(:inline) operator(=)operator(>) string<delimiter(')content(il)delimiter(')>operator(,)] -delete[delete(-) symbol(:inline_delimiter) operator(=)operator(>) string<delimiter(')content(idl)delimiter(')>operator(,)] -delete[delete(-) symbol(:instance_variable) operator(=)operator(>) string<delimiter(')content(iv)delimiter(')>operator(,)] -delete[delete(-) symbol(:integer) operator(=)operator(>) string<delimiter(')content(i)delimiter(')>operator(,)] -delete[delete(-) symbol(:interpreted) operator(=)operator(>) string<delimiter(')content(in)delimiter(')>operator(,)] -delete[delete(-) symbol(:label) operator(=)operator(>) string<delimiter(')content(la)delimiter(')>operator(,)] -delete[delete(-) symbol(:local_variable) operator(=)operator(>) string<delimiter(')content(lv)delimiter(')>operator(,)] -delete[delete(-) symbol(:modifier) operator(=)operator(>) string<delimiter(')content(mod)delimiter(')>operator(,)] -delete[delete(-) symbol(:oct) operator(=)operator(>) string<delimiter(')content(oc)delimiter(')>operator(,)] -delete[delete(-) symbol(:operator_name) operator(=)operator(>) string<delimiter(')content(on)delimiter(')>operator(,)] -delete[delete(-) symbol(:pre_constant) operator(=)operator(>) string<delimiter(')content(pc)delimiter(')>operator(,)] -delete[delete(-) symbol(:pre_type) operator(=)operator(>) string<delimiter(')content(pt)delimiter(')>operator(,)] -delete[delete(-) symbol(:predefined) operator(=)operator(>) string<delimiter(')content(pd)delimiter(')>operator(,)] -delete[delete(-) symbol(:preprocessor) operator(=)operator(>) string<delimiter(')content(pp)delimiter(')>operator(,)] -delete[delete(-) symbol(:regexp) operator(=)operator(>) string<delimiter(')content(rx)delimiter(')>operator(,)] -delete[delete(-) symbol(:reserved) operator(=)operator(>) string<delimiter(')content(r)delimiter(')>operator(,)] -delete[delete(-) symbol(:shell) operator(=)operator(>) string<delimiter(')content(sh)delimiter(')>operator(,)] -delete[delete(-) symbol(:string) operator(=)operator(>) string<delimiter(')content(s)delimiter(')>operator(,)] -delete[delete(-) symbol(:symbol) operator(=)operator(>) string<delimiter(')content(sy)delimiter(')>operator(,)] -delete[delete(-) symbol(:tag) operator(=)operator(>) string<delimiter(')content(ta)delimiter(')>operator(,)] -delete[delete(-) symbol(:tag_fat) operator(=)operator(>) string<delimiter(')content(tf)delimiter(')>operator(,)] -delete[delete(-) symbol(:tag_special) operator(=)operator(>) string<delimiter(')content(ts)delimiter(')>operator(,)] -delete[delete(-) symbol(:type) operator(=)operator(>) string<delimiter(')content(ty)delimiter(')>operator(,)] -delete[delete(-) symbol(:variable) operator(=)operator(>) string<delimiter(')content(v)delimiter(')>operator(,)] -delete[delete(-) symbol(:xml_text) operator(=)operator(>) string<delimiter(')content(xt)delimiter(')>operator(,)] -delete[delete(-)] -delete[delete(-) symbol(:ident) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'id')] -delete[delete(-) comment(#:operator => 'op',)] -delete[delete(-) symbol(:operator) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'op')] -delete[delete(-) symbol(:space) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,) comment(# 'sp')] -delete[delete(-) symbol(:plain) operator(=)operator(>) symbol(:NO_HIGHLIGHT)operator(,)] -delete[delete(-) operator(})] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:procedure)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:method)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:function)operator(])] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:open)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:close)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:nesting_delimiter)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -delete[delete(-) constant(ClassOfKind)operator([)symbol(:escape)operator(]) operator(=) constant(ClassOfKind)operator([)symbol(:delimiter)operator(])] -delete[delete(-) comment(#ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!')] -delete[delete(-)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-)reserved(end)] -delete[delete(-)reserved(end)] -head[head(Index: )plain(lib/coderay/encoders/html/numerization.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/html/numerization.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/html/numerization.rb)plain( (revision 250\))] -change[change(@@)plain( -51,12 +51,12 )change(@@)] - reserved(case) ident(mode) - reserved(when) symbol(:inline) - ident(max_width) operator(=) operator(()ident(start) operator(+) ident(line_count)operator(\))operator(.)ident(to_s)operator(.)ident(size) -delete[delete(-) ident(line) operator(=) ident(start)] -insert[insert(+) ident(line_number) operator(=) ident(start)] - ident(gsub!)operator(()regexp<delimiter(/)content(^)delimiter(/)>operator(\)) reserved(do) -delete[delete(-) ident(line_number) operator(=) ident(bolding)operator(.)ident(call) ident(line)] -delete[delete(-) ident(indent) operator(=) string<delimiter(')content( )delimiter(')> operator(*) operator(()ident(max_width) operator(-) ident(line)operator(.)ident(to_s)operator(.)ident(size)operator(\))] -delete[delete(-) ident(res) operator(=) string<delimiter(")content(<span class=)char(\\")content(no)char(\\")content(>)inline<inline_delimiter(#{)ident(indent)inline_delimiter(})>inline<inline_delimiter(#{)ident(line_number)inline_delimiter(})>content(</span> )delimiter(")>] -delete[delete(-) ident(line) operator(+=) integer(1)] -insert[insert(+) ident(line_number_text) operator(=) ident(bolding)operator(.)ident(call) ident(line_number)] -insert[insert(+) ident(indent) operator(=) string<delimiter(')content( )delimiter(')> operator(*) operator(()ident(max_width) operator(-) ident(line_number)operator(.)ident(to_s)operator(.)ident(size)operator(\)) comment(# TODO: Optimize (10^x\))] -insert[insert(+) ident(res) operator(=) string<delimiter(")content(<span class=)char(\\")content(no)char(\\")content(>)inline<inline_delimiter(#{)ident(indent)inline_delimiter(})>inline<inline_delimiter(#{)ident(line_number_text)inline_delimiter(})>content(</span> )delimiter(")>] -insert[insert(+) ident(line_number) operator(+=) integer(1)] - ident(res) - reserved(end) - -head[head(Index: )plain(lib/coderay/encoders/tokens.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/tokens.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/tokens.rb)plain( (revision 250\))] -change[change(@@)plain( -33,9 +33,9 )change(@@)] - - constant(FILE_EXTENSION) operator(=) string<delimiter(')content(tok)delimiter(')> - -delete[delete(-) ident(protected)] -delete[delete(-) reserved(def) method(token) operator(*)ident(args)] -delete[delete(-) instance_variable(@out) operator(<<) constant(CodeRay)operator(::)constant(Tokens)operator(.)ident(write_token)operator(()operator(*)ident(args)operator(\))] -insert[insert(+) ident(protected)] -insert[insert(+) reserved(def) method(token) ident(text)operator(,) ident(kind)] -insert[insert(+) instance_variable(@out) operator(<<) constant(CodeRay)operator(::)constant(Tokens)operator(.)ident(write_token)operator(()ident(text)operator(,) ident(kind)operator(\))] - reserved(end) - - reserved(end) -head[head(Index: )plain(lib/coderay/encoders/html.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/html.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/html.rb)plain( (revision 250\))] -change[change(@@)plain( -1,3 +1,5 )change(@@)] -insert[insert(+)ident(require) string<delimiter(")content(set)delimiter(")>] -insert[insert(+)] - reserved(module) class(CodeRay) - reserved(module) class(Encoders) - -change[change(@@)plain( -10,7 +12,8 )change(@@)] - comment(#) - comment(# require 'coderay') - comment(# puts CodeRay.scan('Some /code/', :ruby\).html #-> a HTML page) -delete[delete(-) comment(# puts CodeRay.scan('Some /code/', :ruby\).html(:wrap => :span\) #-> <span class="CodeRay"><span class="co">Some</span> /code/</span>)] -insert[insert(+) comment(# puts CodeRay.scan('Some /code/', :ruby\).html(:wrap => :span\))] -insert[insert(+) comment(# #-> <span class="CodeRay"><span class="co">Some</span> /code/</span>)] - comment(# puts CodeRay.scan('Some /code/', :ruby\).span #-> the same) - comment(# ) - comment(# puts CodeRay.scan('Some code', :ruby\).html() -change[change(@@)plain( -55,7 +58,8 )change(@@)] - comment(#) - comment(# === :hint) - comment(# Include some information into the output using the title attribute.) -delete[delete(-) comment(# Can be :info (show token type on mouse-over\), :info_long (with full path\) or :debug (via inspect\).)] -insert[insert(+) comment(# Can be :info (show token type on mouse-over\), :info_long (with full path\))] -insert[insert(+) comment(# or :debug (via inspect\).)] - comment(#) - comment(# Default: false) - reserved(class) class(HTML) operator(<) constant(Encoder) -change[change(@@)plain( -82,7 +86,7 )change(@@)] - symbol(:hint) operator(=)operator(>) pre_constant(false)operator(,) - operator(}) - -delete[delete(-) ident(helper) symbol(:classes)operator(,) symbol(:output)operator(,) symbol(:css)] -insert[insert(+) ident(helper) symbol(:output)operator(,) symbol(:css)] - - ident(attr_reader) symbol(:css) - -change[change(@@)plain( -115,11 +119,14 )change(@@)] - reserved(end) - operator(}) - -insert[insert(+) constant(TRANSPARENT_TOKEN_KINDS) operator(=) operator([)] -insert[insert(+) symbol(:delimiter)operator(,) symbol(:modifier)operator(,) symbol(:content)operator(,) symbol(:escape)operator(,) symbol(:inline_delimiter)operator(,)] -insert[insert(+) operator(])operator(.)ident(to_set)] -insert[insert(+)] - comment(# Generate a hint about the given +classes+ in a +hint+ style.) - comment(#) - comment(# +hint+ may be :info, :info_long or :debug.) - reserved(def) pre_constant(self)operator(.)method(token_path_to_hint) ident(hint)operator(,) ident(classes) -delete[delete(-) reserved(return) string<delimiter(')delimiter(')> reserved(unless) ident(hint)] - ident(title) operator(=) - reserved(case) ident(hint) - reserved(when) symbol(:info) -change[change(@@)plain( -129,7 +136,7 )change(@@)] - reserved(when) symbol(:debug) - ident(classes)operator(.)ident(inspect) - reserved(end) -delete[delete(-) string<delimiter(")content( title=)char(\\")inline<inline_delimiter(#{)ident(title)inline_delimiter(})>char(\\")delimiter(")>] -insert[insert(+) ident(title) operator(?) string<delimiter(")content( title=)char(\\")inline<inline_delimiter(#{)ident(title)inline_delimiter(})>char(\\")delimiter(")> operator(:) string<delimiter(')delimiter(')>] - reserved(end) - - reserved(def) method(setup) ident(options) -change[change(@@)plain( -143,42 +150,45 )change(@@)] - - ident(hint) operator(=) ident(options)operator([)symbol(:hint)operator(]) - reserved(if) ident(hint) reserved(and) reserved(not) operator([)symbol(:debug)operator(,) symbol(:info)operator(,) symbol(:info_long)operator(])operator(.)ident(include?) ident(hint) -delete[delete(-) ident(raise) constant(ArgumentError)operator(,) string<delimiter(")content(Unknown value %p for :hint; expected :info, :debug, false or nil.)delimiter(")> operator(%) ident(hint)] -insert[insert(+) ident(raise) constant(ArgumentError)operator(,) string<delimiter(")content(Unknown value %p for :hint; )char(\\)>] -insert[insert(+) ident(expected) symbol(:info)operator(,) symbol(:debug)operator(,) pre_constant(false)operator(,) reserved(or) pre_constant(nil)operator(.)string<delimiter(")content( % hint)>] - reserved(end) - - reserved(case) ident(options)operator([)symbol(:css)operator(]) - - reserved(when) symbol(:class) - instance_variable(@css_style) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|) -delete[delete(-) reserved(if) ident(k)operator(.)ident(is_a?) constant(Array)] -delete[delete(-) ident(type) operator(=) ident(k)operator(.)ident(first)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(type) operator(=) ident(k)] -delete[delete(-) reserved(end)] -delete[delete(-) ident(c) operator(=) constant(ClassOfKind)operator([)ident(type)operator(])] -insert[insert(+) ident(c) operator(=) constant(CodeRay)operator(::)constant(Tokens)operator(::)constant(ClassOfKind)operator([)ident(k)operator(.)ident(first)operator(])] - reserved(if) ident(c) operator(==) symbol(:NO_HIGHLIGHT) reserved(and) reserved(not) ident(hint) -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) pre_constant(false)] -insert[insert(+) ident(h)operator([)ident(k)operator(.)ident(dup)operator(]) operator(=) pre_constant(false)] - reserved(else) -delete[delete(-) ident(title) operator(=) constant(HTML)operator(.)ident(token_path_to_hint) ident(hint)operator(,) operator(()ident(k)operator([)integer(1)operator(..)integer(-1)operator(]) operator(<<) ident(k)operator(.)ident(first)operator(\))] -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) string<delimiter(')content(<span%s class="%s">)delimiter(')> operator(%) operator([)ident(title)operator(,) ident(c)operator(])] -insert[insert(+) ident(title) operator(=) reserved(if) ident(hint)] -insert[insert(+) constant(HTML)operator(.)ident(token_path_to_hint)operator(()ident(hint)operator(,) ident(k)operator([)integer(1)operator(..)integer(-1)operator(]) operator(<<) ident(k)operator(.)ident(first)operator(\))] -insert[insert(+) reserved(else)] -insert[insert(+) string<delimiter(')delimiter(')>] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(if) ident(c) operator(==) symbol(:NO_HIGHLIGHT)] -insert[insert(+) ident(h)operator([)ident(k)operator(.)ident(dup)operator(]) operator(=) string<delimiter(')content(<span%s>)delimiter(')> operator(%) operator([)ident(title)operator(])] -insert[insert(+) reserved(else)] -insert[insert(+) ident(h)operator([)ident(k)operator(.)ident(dup)operator(]) operator(=) string<delimiter(')content(<span%s class="%s">)delimiter(')> operator(%) operator([)ident(title)operator(,) ident(c)operator(])] -insert[insert(+) reserved(end)] - reserved(end) - reserved(end) - - reserved(when) symbol(:style) - instance_variable(@css_style) operator(=) constant(Hash)operator(.)ident(new) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|) -delete[delete(-) reserved(if) ident(k)operator(.)ident(is_a?) constant(Array)] -insert[insert(+) reserved(if) ident(k)operator(.)ident(is_a?) operator(::)constant(Array)] - ident(styles) operator(=) ident(k)operator(.)ident(dup) - reserved(else) - ident(styles) operator(=) operator([)ident(k)operator(]) - reserved(end) - ident(type) operator(=) ident(styles)operator(.)ident(first) -delete[delete(-) ident(classes) operator(=) ident(styles)operator(.)ident(map) operator({) operator(|)ident(c)operator(|) constant(ClassOfKind)operator([)ident(c)operator(]) operator(})] -insert[insert(+) ident(classes) operator(=) ident(styles)operator(.)ident(map) operator({) operator(|)ident(c)operator(|) constant(Tokens)operator(::)constant(ClassOfKind)operator([)ident(c)operator(]) operator(})] - reserved(if) ident(classes)operator(.)ident(first) operator(==) symbol(:NO_HIGHLIGHT) reserved(and) reserved(not) ident(hint) - ident(h)operator([)ident(k)operator(]) operator(=) pre_constant(false) - reserved(else) -delete[delete(-) ident(styles)operator(.)ident(shift) reserved(if) operator([)symbol(:delimiter)operator(,) symbol(:modifier)operator(,) symbol(:content)operator(,) symbol(:escape)operator(])operator(.)ident(include?) ident(styles)operator(.)ident(first)] -insert[insert(+) ident(styles)operator(.)ident(shift) reserved(if) constant(TRANSPARENT_TOKEN_KINDS)operator(.)ident(include?) ident(styles)operator(.)ident(first)] - ident(title) operator(=) constant(HTML)operator(.)ident(token_path_to_hint) ident(hint)operator(,) ident(styles) -delete[delete(-) ident(classes)operator(.)ident(delete) string<delimiter(')content(il)delimiter(')>] - ident(style) operator(=) instance_variable(@css)operator([)operator(*)ident(classes)operator(]) - ident(h)operator([)ident(k)operator(]) operator(=) - reserved(if) ident(style) -change[change(@@)plain( -198,7 +208,9 )change(@@)] - reserved(def) method(finish) ident(options) - ident(not_needed) operator(=) instance_variable(@opened)operator(.)ident(shift) - instance_variable(@out) operator(<<) string<delimiter(')content(</span>)delimiter(')> operator(*) instance_variable(@opened)operator(.)ident(size) -delete[delete(-) ident(warn) string<delimiter(')content(%d tokens still open: %p)delimiter(')> operator(%) operator([)instance_variable(@opened)operator(.)ident(size)operator(,) instance_variable(@opened)operator(]) reserved(unless) instance_variable(@opened)operator(.)ident(empty?)] -insert[insert(+) reserved(unless) instance_variable(@opened)operator(.)ident(empty?)] -insert[insert(+) ident(warn) string<delimiter(')content(%d tokens still open: %p)delimiter(')> operator(%) operator([)instance_variable(@opened)operator(.)ident(size)operator(,) instance_variable(@opened)operator(])] -insert[insert(+) reserved(end)] - - instance_variable(@out)operator(.)ident(extend) constant(Output) - instance_variable(@out)operator(.)ident(css) operator(=) instance_variable(@css) -change[change(@@)plain( -229,8 +241,9 )change(@@)] - reserved(if) instance_variable(@opened)operator(.)ident(empty?) - comment(# nothing to close) - reserved(else) -delete[delete(-) reserved(if) instance_variable(@opened)operator(.)ident(size) operator(==) integer(1) reserved(or) instance_variable(@opened)operator(.)ident(last) operator(!=) ident(type)] -delete[delete(-) ident(raise) string<delimiter(')content(Malformed token stream: Trying to close a token (%p\) that is not open. Open are: %p.)delimiter(')> operator(%) operator([)ident(type)operator(,) instance_variable(@opened)operator([)integer(1)operator(..)integer(-1)operator(])operator(]) reserved(if) global_variable($DEBUG)] -insert[insert(+) reserved(if) global_variable($DEBUG) reserved(and) operator(()instance_variable(@opened)operator(.)ident(size) operator(==) integer(1) reserved(or) instance_variable(@opened)operator(.)ident(last) operator(!=) ident(type)operator(\))] -insert[insert(+) ident(raise) string<delimiter(')content(Malformed token stream: Trying to close a token (%p\) )error(\\)>] -insert[insert(+) ident(that) ident(is) reserved(not) ident(open)operator(.) ident(Open) ident(are)operator(:) operator(%)ident(p)operator(.)string<delimiter(')content( % [type, @opened[1..-1]])>] - reserved(end) - instance_variable(@out) operator(<<) string<delimiter(')content(</span>)delimiter(')> - instance_variable(@opened)operator(.)ident(pop) -head[head(Index: )plain(lib/coderay/encoders/text.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/text.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/text.rb)plain( (revision 250\))] -change[change(@@)plain( -14,13 +14,12 )change(@@)] - - ident(protected) - reserved(def) method(setup) ident(options) -delete[delete(-) reserved(super)] -insert[insert(+) instance_variable(@out) operator(=) string<delimiter(')delimiter(')>] - instance_variable(@sep) operator(=) ident(options)operator([)symbol(:separator)operator(]) - reserved(end) - - reserved(def) method(token) ident(text)operator(,) ident(kind) -delete[delete(-) reserved(return) reserved(unless) ident(text)operator(.)ident(respond_to?) symbol(:to_str)] -delete[delete(-) instance_variable(@out) operator(<<) ident(text) operator(+) instance_variable(@sep)] -insert[insert(+) instance_variable(@out) operator(<<) ident(text) operator(+) instance_variable(@sep) reserved(if) ident(text)operator(.)ident(is_a?) operator(::)constant(String)] - reserved(end) - - reserved(def) method(finish) ident(options) -head[head(Index: )plain(lib/coderay/encoders/debug.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/debug.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/debug.rb)plain( (revision 250\))] -change[change(@@)plain( -19,19 +19,14 )change(@@)] - - ident(protected) - reserved(def) method(text_token) ident(text)operator(,) ident(kind) -delete[delete(-) instance_variable(@out) operator(<<)] -delete[delete(-) reserved(if) ident(kind) operator(==) symbol(:space)] -delete[delete(-) ident(text)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(text) operator(=) ident(text)operator(.)ident(gsub)operator(()regexp<delimiter(/)content([\))char(\\\\)content(])delimiter(/)>operator(,) string<delimiter(')char(\\\\)char(\\\\)content(\\0)delimiter(')>operator(\))] -delete[delete(-) string<delimiter(")inline<inline_delimiter(#{)ident(kind)inline_delimiter(})>content(()inline<inline_delimiter(#{)ident(text)inline_delimiter(})>content(\))delimiter(")>] -delete[delete(-) reserved(end)] -insert[insert(+) reserved(if) ident(kind) operator(==) symbol(:space)] -insert[insert(+) ident(text)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(text) operator(=) ident(text)operator(.)ident(gsub)operator(()regexp<delimiter(/)content([\))char(\\\\)content(])delimiter(/)>operator(,) string<delimiter(')char(\\\\)char(\\\\)content(\\0)delimiter(')>operator(\)) comment(# escape \) and \\)] -insert[insert(+) string<delimiter(")inline<inline_delimiter(#{)ident(kind)inline_delimiter(})>content(()inline<inline_delimiter(#{)ident(text)inline_delimiter(})>content(\))delimiter(")>] -insert[insert(+) reserved(end)] - reserved(end) - -delete[delete(-) reserved(def) method(block_token) ident(action)operator(,) ident(kind)] -delete[delete(-) instance_variable(@out) operator(<<) reserved(super)] -delete[delete(-) reserved(end)] -delete[delete(-)] - reserved(def) method(open_token) ident(kind) - string<delimiter(")inline<inline_delimiter(#{)ident(kind)inline_delimiter(})>content(<)delimiter(")> - reserved(end) -head[head(Index: )plain(lib/coderay/encoders/statistic.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/statistic.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/statistic.rb)plain( (revision 250\))] -change[change(@@)plain( -28,19 +28,15 )change(@@)] - instance_variable(@type_stats)operator([)ident(kind)operator(])operator(.)ident(count) operator(+=) integer(1) - instance_variable(@type_stats)operator([)ident(kind)operator(])operator(.)ident(size) operator(+=) ident(text)operator(.)ident(size) - instance_variable(@type_stats)operator([)string<delimiter(')content(TOTAL)delimiter(')>operator(])operator(.)ident(size) operator(+=) ident(text)operator(.)ident(size) -insert[insert(+) instance_variable(@type_stats)operator([)string<delimiter(')content(TOTAL)delimiter(')>operator(])operator(.)ident(count) operator(+=) integer(1)] - reserved(end) - - comment(# TODO Hierarchy handling) - reserved(def) method(block_token) ident(action)operator(,) ident(kind) -delete[delete(-) comment(#@content_type = kind)] -insert[insert(+) instance_variable(@type_stats)operator([)string<delimiter(')content(TOTAL)delimiter(')>operator(])operator(.)ident(count) operator(+=) integer(1)] - instance_variable(@type_stats)operator([)string<delimiter(')content(open/close)delimiter(')>operator(])operator(.)ident(count) operator(+=) integer(1) - reserved(end) - -delete[delete(-) reserved(def) method(token) ident(text)operator(,) ident(kind)] -delete[delete(-) reserved(super)] -delete[delete(-) instance_variable(@type_stats)operator([)string<delimiter(')content(TOTAL)delimiter(')>operator(])operator(.)ident(count) operator(+=) integer(1)] -delete[delete(-) reserved(end)] -delete[delete(-)] - constant(STATS) operator(=) string<delimiter(<<-STATS)> - - constant(Code) constant(Statistics) -head[head(Index: )plain(lib/coderay/encoders/_map.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/encoders/_map.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/encoders/_map.rb)plain( (revision 250\))] -change[change(@@)plain( -2,7 +2,8 )change(@@)] - reserved(module) class(Encoders) - - ident(map) symbol(:stats) operator(=)operator(>) symbol(:statistic)operator(,) -delete[delete(-) symbol(:plain) operator(=)operator(>) symbol(:text)] -insert[insert(+) symbol(:plain) operator(=)operator(>) symbol(:text)operator(,)] -insert[insert(+) symbol(:tex) operator(=)operator(>) symbol(:latex)] - - reserved(end) - reserved(end) -head[head(Index: )plain(lib/coderay/helpers/filetype.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/filetype.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/filetype.rb)plain( (revision 250\))] -change[change(@@)plain( -1,180 +0,0 )change(@@)] -delete[delete(-)comment(# =FileType)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# A simple filetype recognizer)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# Author: murphy (mail to murphy cYcnus de\))] -delete[delete(-)comment(#)] -delete[delete(-)comment(# Version: 0.1 (2005.september.1\))] -delete[delete(-)comment(#)] -delete[delete(-)comment(# == Documentation)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# # determine the type of the given)] -delete[delete(-)comment(# lang = FileType[ARGV.first])] -delete[delete(-)comment(# )] -delete[delete(-)comment(# # return :plaintext if the file type is unknown)] -delete[delete(-)comment(# lang = FileType.fetch ARGV.first, :plaintext)] -delete[delete(-)comment(# )] -delete[delete(-)comment(# # try the shebang line, too)] -delete[delete(-)comment(# lang = FileType.fetch ARGV.first, :plaintext, true)] -delete[delete(-)reserved(module) class(FileType)] -delete[delete(-)] -delete[delete(-) constant(UnknownFileType) operator(=) constant(Class)operator(.)ident(new) constant(Exception)] -delete[delete(-)] -delete[delete(-) reserved(class) operator(<<) class(self)] -delete[delete(-)] -delete[delete(-) comment(# Try to determine the file type of the file.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# +filename+ is a relative or absolute path to a file.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# The file itself is only accessed when +read_shebang+ is set to true.)] -delete[delete(-) comment(# That means you can get filetypes from files that don't exist.)] -delete[delete(-) reserved(def) method([]) ident(filename)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -delete[delete(-) ident(name) operator(=) constant(File)operator(.)ident(basename) ident(filename)] -delete[delete(-) ident(ext) operator(=) constant(File)operator(.)ident(extname) ident(name)] -delete[delete(-) ident(ext)operator(.)ident(sub!)operator(()regexp<delimiter(/)content(^)char(\\.)delimiter(/)>operator(,) string<delimiter(')delimiter(')>operator(\)) comment(# delete the leading dot)] -delete[delete(-)] -delete[delete(-) ident(type) operator(=)] -delete[delete(-) constant(TypeFromExt)operator([)ident(ext)operator(]) operator(||)] -delete[delete(-) constant(TypeFromExt)operator([)ident(ext)operator(.)ident(downcase)operator(]) operator(||)] -delete[delete(-) constant(TypeFromName)operator([)ident(name)operator(]) operator(||)] -delete[delete(-) constant(TypeFromName)operator([)ident(name)operator(.)ident(downcase)operator(])] -delete[delete(-) ident(type) operator(||=) ident(shebang)operator(()ident(filename)operator(\)) reserved(if) ident(read_shebang)] -delete[delete(-)] -delete[delete(-) ident(type)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(shebang) ident(filename)] -delete[delete(-) reserved(begin)] -delete[delete(-) constant(File)operator(.)ident(open) ident(filename)operator(,) string<delimiter(')content(r)delimiter(')> reserved(do) operator(|)ident(f)operator(|)] -delete[delete(-) ident(first_line) operator(=) ident(f)operator(.)ident(gets)] -delete[delete(-) ident(first_line)operator([)constant(TypeFromShebang)operator(])] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(rescue) constant(IOError)] -delete[delete(-) pre_constant(nil)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) comment(# This works like Hash#fetch.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# If the filetype cannot be found, the +default+ value)] -delete[delete(-) comment(# is returned.)] -delete[delete(-) reserved(def) method(fetch) ident(filename)operator(,) ident(default) operator(=) pre_constant(nil)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -delete[delete(-) reserved(if) ident(default) reserved(and) ident(block_given?)] -delete[delete(-) ident(warn) string<delimiter(')content(block supersedes default value argument)delimiter(')>] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(unless) ident(type) operator(=) pre_constant(self)operator([)ident(filename)operator(,) ident(read_shebang)operator(])] -delete[delete(-) reserved(return) reserved(yield) reserved(if) ident(block_given?)] -delete[delete(-) reserved(return) ident(default) reserved(if) ident(default)] -delete[delete(-) ident(raise) constant(UnknownFileType)operator(,) string<delimiter(')content(Could not determine type of %p.)delimiter(')> operator(%) ident(filename)] -delete[delete(-) reserved(end)] -delete[delete(-) ident(type)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) constant(TypeFromExt) operator(=) operator({)] -delete[delete(-) string<delimiter(')content(rb)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string<delimiter(')content(rbw)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string<delimiter(')content(rake)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string<delimiter(')content(cpp)delimiter(')> operator(=)operator(>) symbol(:c)operator(,)] -delete[delete(-) string<delimiter(')content(c)delimiter(')> operator(=)operator(>) symbol(:c)operator(,)] -delete[delete(-) string<delimiter(')content(h)delimiter(')> operator(=)operator(>) symbol(:c)operator(,)] -delete[delete(-) string<delimiter(')content(xml)delimiter(')> operator(=)operator(>) symbol(:xml)operator(,)] -delete[delete(-) string<delimiter(')content(htm)delimiter(')> operator(=)operator(>) symbol(:html)operator(,)] -delete[delete(-) string<delimiter(')content(html)delimiter(')> operator(=)operator(>) symbol(:html)operator(,)] -delete[delete(-) string<delimiter(')content(xhtml)delimiter(')> operator(=)operator(>) symbol(:xhtml)operator(,)] -delete[delete(-) string<delimiter(')content(rhtml)delimiter(')> operator(=)operator(>) symbol(:rhtml)operator(,)] -delete[delete(-) string<delimiter(')content(yaml)delimiter(')> operator(=)operator(>) symbol(:yaml)operator(,)] -delete[delete(-) string<delimiter(')content(yml)delimiter(')> operator(=)operator(>) symbol(:yaml)operator(,)] -delete[delete(-) operator(})] -delete[delete(-)] -delete[delete(-) constant(TypeFromShebang) operator(=) regexp<delimiter(/)char(\\b)content((?:ruby|perl|python|sh\))char(\\b)delimiter(/)>] -delete[delete(-)] -delete[delete(-) constant(TypeFromName) operator(=) operator({)] -delete[delete(-) string<delimiter(')content(Rakefile)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) string<delimiter(')content(Rantfile)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -delete[delete(-) operator(})] -delete[delete(-)] -delete[delete(-)reserved(end)] -delete[delete(-)] -delete[delete(-)reserved(if) global_variable($0) operator(==) pre_constant(__FILE__)] -delete[delete(-) global_variable($VERBOSE) operator(=) pre_constant(true)] -delete[delete(-) ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)operator(+)integer(4)] -delete[delete(-)reserved(end)] -delete[delete(-)] -delete[delete(-)comment(__END__)] -delete[delete(-)] -delete[delete(-)ident(require) string<delimiter(')content(test/unit)delimiter(')>] -delete[delete(-)] -delete[delete(-)reserved(class) class(TC_FileType) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_fetch)] -delete[delete(-) ident(assert_raise) constant(FileType)operator(::)constant(UnknownFileType) reserved(do)] -delete[delete(-) constant(FileType)operator(.)ident(fetch) string<delimiter(')delimiter(')>] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) ident(assert_throws) symbol(:not_found) reserved(do)] -delete[delete(-) constant(FileType)operator(.)ident(fetch) string<delimiter(')content(.)delimiter(')> reserved(do)] -delete[delete(-) ident(throw) symbol(:not_found)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) ident(assert_equal) symbol(:default)operator(,) constant(FileType)operator(.)ident(fetch)operator(()string<delimiter(')content(c)delimiter(')>operator(,) symbol(:default)operator(\))] -delete[delete(-)] -delete[delete(-) ident(stderr)operator(,) ident(fake_stderr) operator(=) global_variable($stderr)operator(,) constant(Object)operator(.)ident(new)] -delete[delete(-) global_variable($err) operator(=) string<delimiter(')delimiter(')>] -delete[delete(-) reserved(def) ident(fake_stderr)operator(.)method(write) ident(x)] -delete[delete(-) global_variable($err) operator(<<) ident(x)] -delete[delete(-) reserved(end)] -delete[delete(-) global_variable($stderr) operator(=) ident(fake_stderr)] -delete[delete(-) constant(FileType)operator(.)ident(fetch)operator(()string<delimiter(')content(c)delimiter(')>operator(,) symbol(:default)operator(\)) operator({) operator(})] -delete[delete(-) ident(assert_equal) string<delimiter(")content(block supersedes default value argument)char(\\n)delimiter(")>operator(,) global_variable($err)] -delete[delete(-) global_variable($stderr) operator(=) ident(stderr)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_ruby)] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(test.rb)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(C:)char(\\\\)content(Program Files)char(\\\\)content(x)char(\\\\)content(y)char(\\\\)content(c)char(\\\\)content(test.rbw)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(/usr/bin/something/Rakefile)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(~/myapp/gem/Rantfile)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(./lib/tasks)content(\\r)content(epository.rake)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(test_rb)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(Makefile)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(set.rb/set)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(~/projects/blabla/rb)delimiter(')>operator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_c)] -delete[delete(-) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(test.c)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(C:)char(\\\\)content(Program Files)char(\\\\)content(x)char(\\\\)content(y)char(\\\\)content(c)char(\\\\)content(test.h)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(test_c)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(Makefile)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(set.h/set)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(~/projects/blabla/c)delimiter(')>operator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_html)] -delete[delete(-) ident(assert_equal) symbol(:html)operator(,) constant(FileType)operator([)string<delimiter(')content(test.htm)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.xhtml)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.html.xhtml)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:rhtml)operator(,) constant(FileType)operator([)string<delimiter(')content(_form.rhtml)delimiter(')>operator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_yaml)] -delete[delete(-) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.yml)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.yaml)delimiter(')>operator(])] -delete[delete(-) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(my.html.yaml)delimiter(')>operator(])] -delete[delete(-) ident(assert_not_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(YAML)delimiter(')>operator(])] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) reserved(def) method(test_shebang)] -delete[delete(-) ident(dir) operator(=) string<delimiter(')content(./test)delimiter(')>] -delete[delete(-) reserved(if) constant(File)operator(.)ident(directory?) ident(dir)] -delete[delete(-) constant(Dir)operator(.)ident(chdir) ident(dir) reserved(do)] -delete[delete(-) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(test.c)delimiter(')>operator(])] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-)reserved(end)] -head[head(Index: )plain(lib/coderay/helpers/plugin.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/plugin.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/plugin.rb)plain( (revision 250\))] -change[change(@@)plain( -1,3 +1,5 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+) ] - comment(# = PluginHost) - comment(#) - comment(# $Id$) -change[change(@@)plain( -20,7 +22,7 )change(@@)] - comment(#) - comment(# Generators[:fancy] #-> FancyGenerator) - comment(# # or) -delete[delete(-)comment(# require_plugin 'Generators/fancy')] -insert[insert(+)comment(# CodeRay.require_plugin 'Generators/fancy')] - reserved(module) class(PluginHost) - - comment(# Raised if Encoders::[] fails because:) -change[change(@@)plain( -310,17 +312,18 )change(@@)] - - reserved(end) - -delete[delete(-)] - comment(# Convenience method for plugin loading.) - comment(# The syntax used is:) - comment(#) -delete[delete(-)comment(# require_plugin '<Host ID>/<Plugin ID>')] -insert[insert(+)comment(# CodeRay.require_plugin '<Host ID>/<Plugin ID>')] - comment(#) - comment(# Returns the loaded plugin.) -delete[delete(-)reserved(def) method(require_plugin) ident(path)] -insert[insert(+)reserved(def) pre_constant(self)operator(.)method(require_plugin) ident(path)] - ident(host_id)operator(,) ident(plugin_id) operator(=) ident(path)operator(.)ident(split) string<delimiter(')content(/)delimiter(')>operator(,) integer(2) - ident(host) operator(=) constant(PluginHost)operator(.)ident(host_by_id)operator(()ident(host_id)operator(\)) - ident(raise) constant(PluginHost)operator(::)constant(HostNotFound)operator(,) - string<delimiter(")content(No host for )inline<inline_delimiter(#{)ident(host_id)operator(.)ident(inspect)inline_delimiter(})>content( found.)delimiter(")> reserved(unless) ident(host) - ident(host)operator(.)ident(load) ident(plugin_id) - reserved(end) -insert[insert(+)] -insert[insert(+)reserved(end)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/helpers/file_type.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/file_type.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/helpers/file_type.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,210 )change(@@)] -insert[insert(+)doctype(#!/usr/bin/env ruby)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+)] -insert[insert(+)comment(# = FileType)] -insert[insert(+)comment(#)] -insert[insert(+)comment(# A simple filetype recognizer.)] -insert[insert(+)comment(#)] -insert[insert(+)comment(# Copyright (c\) 2006 by murphy (Kornelius Kalnbach\) <murphy rubychan de>)] -insert[insert(+)comment(#)] -insert[insert(+)comment(# License:: LGPL / ask the author)] -insert[insert(+)comment(# Version:: 0.1 (2005-09-01\))] -insert[insert(+)comment(#)] -insert[insert(+)comment(# == Documentation)] -insert[insert(+)comment(#)] -insert[insert(+)comment(# # determine the type of the given)] -insert[insert(+)comment(# lang = FileType[ARGV.first])] -insert[insert(+)comment(# )] -insert[insert(+)comment(# # return :plaintext if the file type is unknown)] -insert[insert(+)comment(# lang = FileType.fetch ARGV.first, :plaintext)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# # try the shebang line, too)] -insert[insert(+)comment(# lang = FileType.fetch ARGV.first, :plaintext, true)] -insert[insert(+)reserved(module) class(FileType)] -insert[insert(+)] -insert[insert(+) constant(UnknownFileType) operator(=) constant(Class)operator(.)ident(new) constant(Exception)] -insert[insert(+)] -insert[insert(+) reserved(class) operator(<<) class(self)] -insert[insert(+)] -insert[insert(+) comment(# Try to determine the file type of the file.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# +filename+ is a relative or absolute path to a file.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# The file itself is only accessed when +read_shebang+ is set to true.)] -insert[insert(+) comment(# That means you can get filetypes from files that don't exist.)] -insert[insert(+) reserved(def) method([]) ident(filename)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -insert[insert(+) ident(name) operator(=) constant(File)operator(.)ident(basename) ident(filename)] -insert[insert(+) ident(ext) operator(=) constant(File)operator(.)ident(extname)operator(()ident(name)operator(\))operator(.)ident(sub)operator(()regexp<delimiter(/)content(^)char(\\.)delimiter(/)>operator(,) string<delimiter(')delimiter(')>operator(\)) comment(# from last dot, delete the leading dot)] -insert[insert(+) ident(ext2) operator(=) ident(filename)operator([)regexp<delimiter(/)char(\\.)content((.*\))delimiter(/)>operator(,) integer(1)operator(]) comment(# from first dot)] -insert[insert(+)] -insert[insert(+) ident(type) operator(=)] -insert[insert(+) constant(TypeFromExt)operator([)ident(ext)operator(.)ident(downcase)operator(]) operator(||)] -insert[insert(+) operator(()constant(TypeFromExt)operator([)ident(ext2)operator(.)ident(downcase)operator(]) reserved(if) ident(ext2)operator(\)) operator(||)] -insert[insert(+) constant(TypeFromName)operator([)ident(name)operator(]) operator(||)] -insert[insert(+) constant(TypeFromName)operator([)ident(name)operator(.)ident(downcase)operator(])] -insert[insert(+) ident(type) operator(||=) ident(shebang)operator(()ident(filename)operator(\)) reserved(if) ident(read_shebang)] -insert[insert(+)] -insert[insert(+) ident(type)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(shebang) ident(filename)] -insert[insert(+) reserved(begin)] -insert[insert(+) constant(File)operator(.)ident(open) ident(filename)operator(,) string<delimiter(')content(r)delimiter(')> reserved(do) operator(|)ident(f)operator(|)] -insert[insert(+) reserved(if) ident(first_line) operator(=) ident(f)operator(.)ident(gets)] -insert[insert(+) reserved(if) ident(type) operator(=) ident(first_line)operator([)constant(TypeFromShebang)operator(])] -insert[insert(+) ident(type)operator(.)ident(to_sym)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(rescue) constant(IOError)] -insert[insert(+) pre_constant(nil)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) comment(# This works like Hash#fetch.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# If the filetype cannot be found, the +default+ value)] -insert[insert(+) comment(# is returned.)] -insert[insert(+) reserved(def) method(fetch) ident(filename)operator(,) ident(default) operator(=) pre_constant(nil)operator(,) ident(read_shebang) operator(=) pre_constant(false)] -insert[insert(+) reserved(if) ident(default) reserved(and) ident(block_given?)] -insert[insert(+) ident(warn) string<delimiter(')content(block supersedes default value argument)delimiter(')>] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(unless) ident(type) operator(=) pre_constant(self)operator([)ident(filename)operator(,) ident(read_shebang)operator(])] -insert[insert(+) reserved(return) reserved(yield) reserved(if) ident(block_given?)] -insert[insert(+) reserved(return) ident(default) reserved(if) ident(default)] -insert[insert(+) ident(raise) constant(UnknownFileType)operator(,) string<delimiter(')content(Could not determine type of %p.)delimiter(')> operator(%) ident(filename)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(type)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) constant(TypeFromExt) operator(=) operator({)] -insert[insert(+) string<delimiter(')content(rb)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string<delimiter(')content(rbw)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string<delimiter(')content(rake)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string<delimiter(')content(mab)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string<delimiter(')content(cpp)delimiter(')> operator(=)operator(>) symbol(:c)operator(,)] -insert[insert(+) string<delimiter(')content(c)delimiter(')> operator(=)operator(>) symbol(:c)operator(,)] -insert[insert(+) string<delimiter(')content(h)delimiter(')> operator(=)operator(>) symbol(:c)operator(,)] -insert[insert(+) string<delimiter(')content(xml)delimiter(')> operator(=)operator(>) symbol(:xml)operator(,)] -insert[insert(+) string<delimiter(')content(htm)delimiter(')> operator(=)operator(>) symbol(:html)operator(,)] -insert[insert(+) string<delimiter(')content(html)delimiter(')> operator(=)operator(>) symbol(:html)operator(,)] -insert[insert(+) string<delimiter(')content(xhtml)delimiter(')> operator(=)operator(>) symbol(:xhtml)operator(,)] -insert[insert(+) string<delimiter(')content(raydebug)delimiter(')> operator(=)operator(>) symbol(:debug)operator(,)] -insert[insert(+) string<delimiter(')content(rhtml)delimiter(')> operator(=)operator(>) symbol(:rhtml)operator(,)] -insert[insert(+) string<delimiter(')content(html.erb)delimiter(')> operator(=)operator(>) symbol(:rhtml)operator(,)] -insert[insert(+) string<delimiter(')content(ss)delimiter(')> operator(=)operator(>) symbol(:scheme)operator(,)] -insert[insert(+) string<delimiter(')content(sch)delimiter(')> operator(=)operator(>) symbol(:scheme)operator(,)] -insert[insert(+) string<delimiter(')content(yaml)delimiter(')> operator(=)operator(>) symbol(:yaml)operator(,)] -insert[insert(+) string<delimiter(')content(yml)delimiter(')> operator(=)operator(>) symbol(:yaml)operator(,)] -insert[insert(+) operator(})] -insert[insert(+)] -insert[insert(+) constant(TypeFromShebang) operator(=) regexp<delimiter(/)char(\\b)content((?:ruby|perl|python|sh\))char(\\b)delimiter(/)>] -insert[insert(+)] -insert[insert(+) constant(TypeFromName) operator(=) operator({)] -insert[insert(+) string<delimiter(')content(Rakefile)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) string<delimiter(')content(Rantfile)delimiter(')> operator(=)operator(>) symbol(:ruby)operator(,)] -insert[insert(+) operator(})] -insert[insert(+)] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(if) global_variable($0) operator(==) pre_constant(__FILE__)] -insert[insert(+) global_variable($VERBOSE) operator(=) pre_constant(true)] -insert[insert(+) ident(eval) pre_constant(DATA)operator(.)ident(read)operator(,) pre_constant(nil)operator(,) global_variable($0)operator(,) pre_constant(__LINE__)operator(+)integer(4)] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)comment(__END__)] -insert[insert(+)ident(require) string<delimiter(')content(test/unit)delimiter(')>] -insert[insert(+)] -insert[insert(+)reserved(class) class(TC_FileType) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase)] -insert[insert(+) ] -insert[insert(+) ident(include) constant(CodeRay)] -insert[insert(+) ] -insert[insert(+) reserved(def) method(test_fetch)] -insert[insert(+) ident(assert_raise) constant(FileType)operator(::)constant(UnknownFileType) reserved(do)] -insert[insert(+) constant(FileType)operator(.)ident(fetch) string<delimiter(')delimiter(')>] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) ident(assert_throws) symbol(:not_found) reserved(do)] -insert[insert(+) constant(FileType)operator(.)ident(fetch) string<delimiter(')content(.)delimiter(')> reserved(do)] -insert[insert(+) ident(throw) symbol(:not_found)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) ident(assert_equal) symbol(:default)operator(,) constant(FileType)operator(.)ident(fetch)operator(()string<delimiter(')content(c)delimiter(')>operator(,) symbol(:default)operator(\))] -insert[insert(+)] -insert[insert(+) ident(stderr)operator(,) ident(fake_stderr) operator(=) global_variable($stderr)operator(,) constant(Object)operator(.)ident(new)] -insert[insert(+) global_variable($err) operator(=) string<delimiter(')delimiter(')>] -insert[insert(+) reserved(def) ident(fake_stderr)operator(.)method(write) ident(x)] -insert[insert(+) global_variable($err) operator(<<) ident(x)] -insert[insert(+) reserved(end)] -insert[insert(+) global_variable($stderr) operator(=) ident(fake_stderr)] -insert[insert(+) constant(FileType)operator(.)ident(fetch)operator(()string<delimiter(')content(c)delimiter(')>operator(,) symbol(:default)operator(\)) operator({) operator(})] -insert[insert(+) ident(assert_equal) string<delimiter(")content(block supersedes default value argument)char(\\n)delimiter(")>operator(,) global_variable($err)] -insert[insert(+) global_variable($stderr) operator(=) ident(stderr)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_ruby)] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(test.rb)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(C:)char(\\\\)content(Program Files)char(\\\\)content(x)char(\\\\)content(y)char(\\\\)content(c)char(\\\\)content(test.rbw)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(/usr/bin/something/Rakefile)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(~/myapp/gem/Rantfile)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(./lib/tasks)content(\\r)content(epository.rake)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(test_rb)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(Makefile)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(set.rb/set)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:ruby)operator(,) constant(FileType)operator([)string<delimiter(')content(~/projects/blabla/rb)delimiter(')>operator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_c)] -insert[insert(+) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(test.c)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(C:)char(\\\\)content(Program Files)char(\\\\)content(x)char(\\\\)content(y)char(\\\\)content(c)char(\\\\)content(test.h)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(test_c)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(Makefile)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(set.h/set)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(~/projects/blabla/c)delimiter(')>operator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_html)] -insert[insert(+) ident(assert_equal) symbol(:html)operator(,) constant(FileType)operator([)string<delimiter(')content(test.htm)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.xhtml)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:xhtml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.html.xhtml)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:rhtml)operator(,) constant(FileType)operator([)string<delimiter(')content(_form.rhtml)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:rhtml)operator(,) constant(FileType)operator([)string<delimiter(')content(_form.html.erb)delimiter(')>operator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_yaml)] -insert[insert(+) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.yml)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(test.yaml)delimiter(')>operator(])] -insert[insert(+) ident(assert_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(my.html.yaml)delimiter(')>operator(])] -insert[insert(+) ident(assert_not_equal) symbol(:yaml)operator(,) constant(FileType)operator([)string<delimiter(')content(YAML)delimiter(')>operator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(def) method(test_no_shebang)] -insert[insert(+) ident(dir) operator(=) string<delimiter(')content(./test)delimiter(')>] -insert[insert(+) reserved(if) constant(File)operator(.)ident(directory?) ident(dir)] -insert[insert(+) constant(Dir)operator(.)ident(chdir) ident(dir) reserved(do)] -insert[insert(+) ident(assert_equal) symbol(:c)operator(,) constant(FileType)operator([)string<delimiter(')content(test.c)delimiter(')>operator(])] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(def) method(test_shebang_empty_file)] -insert[insert(+) ident(require) string<delimiter(')content(tmpdir)delimiter(')>] -insert[insert(+) ident(tmpfile) operator(=) constant(File)operator(.)ident(join)operator(()constant(Dir)operator(.)ident(tmpdir)operator(,) string<delimiter(')content(bla)delimiter(')>operator(\))] -insert[insert(+) constant(File)operator(.)ident(open)operator(()ident(tmpfile)operator(,) string<delimiter(')content(w)delimiter(')>operator(\)) operator({) operator(}) comment(# touch)] -insert[insert(+) ident(assert_equal) pre_constant(nil)operator(,) constant(FileType)operator([)ident(tmpfile)operator(])] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(def) method(test_shebang)] -insert[insert(+) ident(require) string<delimiter(')content(tmpdir)delimiter(')>] -insert[insert(+) ident(tmpfile) operator(=) constant(File)operator(.)ident(join)operator(()constant(Dir)operator(.)ident(tmpdir)operator(,) string<delimiter(')content(bla)delimiter(')>operator(\))] -insert[insert(+) constant(File)operator(.)ident(open)operator(()ident(tmpfile)operator(,) string<delimiter(')content(w)delimiter(')>operator(\)) operator({) operator(|)ident(f)operator(|) ident(f)operator(.)ident(puts) string<delimiter(')content(#!/usr/bin/env ruby)delimiter(')> operator(})] -insert[insert(+) ident(assert_equal) symbol(:ruby)operator(,) constant(FileType)operator([)ident(tmpfile)operator(,) pre_constant(true)operator(])] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(end)] - -head[head(Property changes on: )plain(lib/coderay/helpers/file_type.rb)] -head[head(___________________________________________________________________)filename()] -head[head(Added: )plain(svn:keywords)] -insert[insert( +)plain( Id Rev)] - -head[head(Index: )plain(lib/coderay/helpers/gzip_simple.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/gzip_simple.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/gzip_simple.rb)plain( (revision 250\))] -change[change(@@)plain( -46,6 +46,7 )change(@@)] - reserved(end) - reserved(end) - -insert[insert(+)] - comment(# String extensions to use the GZip module.) - comment(#) - comment(# The methods gzip and gunzip provide an even more simple) -head[head(Index: )plain(lib/coderay/helpers/word_list.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/helpers/word_list.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/helpers/word_list.rb)plain( (revision 250\))] -change[change(@@)plain( -1,15 +1,19 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+)] - comment(# = WordList) -insert[insert(+)comment(# )] -insert[insert(+)comment(# <b>A Hash subclass designed for mapping word lists to token types.</b>)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# Copyright (c\) 2006 by murphy (Kornelius Kalnbach\) <murphy rubychan de>)] - comment(#) -delete[delete(-)comment(# Copyright (c\) 2006 by murphy (Kornelius Kalnbach\) <murphy cYcnus de>)] -delete[delete(-)comment(#)] - comment(# License:: LGPL / ask the author) -delete[delete(-)comment(# Version:: 1.0 (2006-Feb-3\))] -insert[insert(+)comment(# Version:: 1.1 (2006-Oct-19\))] - comment(#) - comment(# A WordList is a Hash with some additional features.) - comment(# It is intended to be used for keyword recognition.) - comment(#) - comment(# WordList is highly optimized to be used in Scanners,) -delete[delete(-)comment(# typically to decide whether a given ident is a keyword.)] -insert[insert(+)comment(# typically to decide whether a given ident is a special token.)] - comment(#) - comment(# For case insensitive words use CaseIgnoringWordList.) - comment(#) -change[change(@@)plain( -47,25 +51,30 )change(@@)] - comment(# ...) - reserved(class) class(WordList) operator(<) constant(Hash) - -delete[delete(-) comment(# Create a WordList for the given +words+.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# This WordList responds to [] with +true+, if the word is)] -delete[delete(-) comment(# in +words+, and with +false+ otherwise.)] -delete[delete(-) reserved(def) pre_constant(self)operator(.)method(for) ident(words)] -delete[delete(-) ident(new)operator(.)ident(add) ident(words)] -delete[delete(-) reserved(end)] -delete[delete(-)] - comment(# Creates a new WordList with +default+ as default value.) -delete[delete(-) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) operator(&)ident(block)] -delete[delete(-) reserved(super) ident(default)operator(,) operator(&)ident(block)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# You can activate +caching+ to store the results for every [] request.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# With caching, methods like +include?+ or +delete+ may no longer behave)] -insert[insert(+) comment(# as you expect. Therefore, it is recommended to use the [] method only.)] -insert[insert(+) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) ident(caching) operator(=) pre_constant(false)operator(,) operator(&)ident(block)] -insert[insert(+) reserved(if) ident(block)] -insert[insert(+) ident(raise) constant(ArgumentError)operator(,) string<delimiter(')content(Can)char(\\')content(t combine block with caching.)delimiter(')> reserved(if) ident(caching)] -insert[insert(+) reserved(super)operator(()operator(&)ident(block)operator(\))] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(if) ident(caching)] -insert[insert(+) reserved(super)operator(()operator(\)) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -insert[insert(+) ident(h)operator([)ident(k)operator(]) operator(=) ident(h)operator(.)ident(fetch) ident(k)operator(,) ident(default)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(super) ident(default)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] - reserved(end) - -delete[delete(-) comment(# Checks if a word is included.)] -delete[delete(-) reserved(def) method(include?) ident(word)] -delete[delete(-) ident(has_key?) ident(word)] -delete[delete(-) reserved(end)] -delete[delete(-)] - comment(# Add words to the list and associate them with +kind+.) -insert[insert(+) comment(# )] -insert[insert(+) comment(# Returns +self+, so you can concat add calls.)] - reserved(def) method(add) ident(words)operator(,) ident(kind) operator(=) pre_constant(true) - ident(words)operator(.)ident(each) reserved(do) operator(|)ident(word)operator(|) - pre_constant(self)operator([)ident(word)operator(]) operator(=) ident(kind) -change[change(@@)plain( -78,24 +87,30 )change(@@)] - - comment(# A CaseIgnoringWordList is like a WordList, only that) - comment(# keys are compared case-insensitively.) -insert[insert(+)comment(# )] -insert[insert(+)comment(# Ignoring the text case is realized by sending the +downcase+ message to)] -insert[insert(+)comment(# all keys.)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# Caching usually makes a CaseIgnoringWordList faster, but it has to be)] -insert[insert(+)comment(# activated explicitely.)] - reserved(class) class(CaseIgnoringWordList) operator(<) constant(WordList) - -delete[delete(-) comment(# Creates a new WordList with +default+ as default value.)] -delete[delete(-) comment(#)] -delete[delete(-) comment(# Text case is ignored.)] -delete[delete(-) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) operator(&)ident(block)] -delete[delete(-) ident(block) operator(||=) ident(proc) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -delete[delete(-) ident(h)operator([)ident(k)operator(]) operator(=) ident(h)operator(.)ident(fetch) ident(k)operator(.)ident(downcase)operator(,) ident(default)] -insert[insert(+) comment(# Creates a new case-insensitive WordList with +default+ as default value.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# You can activate caching to store the results for every [] request.)] -insert[insert(+) reserved(def) method(initialize) ident(default) operator(=) pre_constant(false)operator(,) ident(caching) operator(=) pre_constant(false)] -insert[insert(+) reserved(if) ident(caching)] -insert[insert(+) reserved(super)operator(()ident(default)operator(,) pre_constant(false)operator(\)) reserved(do) operator(|)ident(h)operator(,) ident(k)operator(|)] -insert[insert(+) ident(h)operator([)ident(k)operator(]) operator(=) ident(h)operator(.)ident(fetch) ident(k)operator(.)ident(downcase)operator(,) ident(default)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(def) pre_constant(self)operator(.)method([]) ident(key) comment(# :nodoc:)] -insert[insert(+) reserved(super)operator(()ident(key)operator(.)ident(downcase)operator(\))] -insert[insert(+) reserved(end)] - reserved(end) -delete[delete(-) reserved(super) ident(default)] - reserved(end) - -delete[delete(-) comment(# Checks if a word is included.)] -delete[delete(-) reserved(def) method(include?) ident(word)] -delete[delete(-) ident(has_key?) ident(word)operator(.)ident(downcase)] -delete[delete(-) reserved(end)] -delete[delete(-)] -delete[delete(-) comment(# Add words to the list and associate them with +kind+.)] -insert[insert(+) comment(# Add +words+ to the list and associate them with +kind+.)] - reserved(def) method(add) ident(words)operator(,) ident(kind) operator(=) pre_constant(true) - ident(words)operator(.)ident(each) reserved(do) operator(|)ident(word)operator(|) - pre_constant(self)operator([)ident(word)operator(.)ident(downcase)operator(]) operator(=) ident(kind) -change[change(@@)plain( -104,3 +119,5 )change(@@)] - reserved(end) - - reserved(end) -insert[insert(+)] -insert[insert(+)reserved(end)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/styles/cycnus.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/styles/cycnus.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/styles/cycnus.rb)plain( (revision 250\))] -change[change(@@)plain( -42,12 +42,14 )change(@@)] - constant(MAIN) - - constant(TOKEN_COLORS) operator(=) string<delimiter(<<-'TOKENS')> -insert[insert(+)operator(.)ident(debug) operator({) ident(color)symbol(:white) operator(!) ident(important)operator(;) ident(background)symbol(:blue) operator(!) ident(important)operator(;) operator(})] -insert[insert(+)] - operator(.)ident(af) operator({) ident(color)operator(:)comment(#00C }) - operator(.)ident(an) operator({) ident(color)operator(:)comment(#007 }) - operator(.)ident(av) operator({) ident(color)operator(:)comment(#700 }) - operator(.)ident(aw) operator({) ident(color)operator(:)comment(#C00 }) - operator(.)ident(bi) operator({) ident(color)operator(:)comment(#509; font-weight:bold }) -delete[delete(-)operator(.)ident(c) operator({) ident(color)operator(:)comment(#888 })] -insert[insert(+)operator(.)ident(c) operator({) ident(color)operator(:)comment(#666; })] - - operator(.)ident(ch) operator({) ident(color)operator(:)comment(#04D }) - operator(.)ident(ch) operator(.)ident(k) operator({) ident(color)operator(:)comment(#04D }) -change[change(@@)plain( -83,7 +85,7 )change(@@)] - operator(.)ident(la) operator({) ident(color)operator(:)comment(#970; font-weight:bold }) - operator(.)ident(lv) operator({) ident(color)operator(:)comment(#963 }) - operator(.)ident(oc) operator({) ident(color)operator(:)comment(#40E; font-weight:bold }) -delete[delete(-)operator(.)ident(on) operator({) ident(color)operator(:)comment(#000; font-weight:bold })] -insert[insert(+)operator(.)ident(of) operator({) ident(color)operator(:)comment(#000; font-weight:bold })] - operator(.)ident(op) operator({) operator(}) - operator(.)ident(pc) operator({) ident(color)operator(:)comment(#038; font-weight:bold }) - operator(.)ident(pd) operator({) ident(color)operator(:)comment(#369; font-weight:bold }) -head[head(Index: )plain(lib/coderay/styles/murphy.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/styles/murphy.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/styles/murphy.rb)plain( (revision 250\))] -change[change(@@)plain( -47,7 +47,7 )change(@@)] - operator(.)ident(av) operator({) ident(color)operator(:)comment(#700; }) - operator(.)ident(aw) operator({) ident(color)operator(:)comment(#C00; }) - operator(.)ident(bi) operator({) ident(color)operator(:)comment(#509; font-weight:bold; }) -delete[delete(-)operator(.)ident(c) operator({) ident(color)operator(:)comment(#666; })] -insert[insert(+)operator(.)ident(c) operator({) ident(color)operator(:)comment(#555; background-color: black; })] - - operator(.)ident(ch) operator({) ident(color)operator(:)comment(#88F; }) - operator(.)ident(ch) operator(.)ident(k) operator({) ident(color)operator(:)comment(#04D; }) -change[change(@@)plain( -77,7 +77,7 )change(@@)] - operator(.)ident(la) operator({) ident(color)operator(:)comment(#970; font-weight:bold; }) - operator(.)ident(lv) operator({) ident(color)operator(:)comment(#963; }) - operator(.)ident(oc) operator({) ident(color)operator(:)comment(#40E; font-weight:bold; }) -delete[delete(-)operator(.)ident(on) operator({) ident(color)operator(:)comment(#000; font-weight:bold; })] -insert[insert(+)operator(.)ident(of) operator({) ident(color)operator(:)comment(#000; font-weight:bold; })] - operator(.)ident(op) operator({) operator(}) - operator(.)ident(pc) operator({) ident(color)operator(:)comment(#08f; font-weight:bold; }) - operator(.)ident(pd) operator({) ident(color)operator(:)comment(#369; font-weight:bold; }) -head[head(Index: )plain(lib/coderay/tokens.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/tokens.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/tokens.rb)plain( (revision 250\))] -change[change(@@)plain( -115,7 +115,7 )change(@@)] - comment(# tokens.each_text_token { |text, kind| text.replace html_escape(text\) }) - reserved(def) method(each_text_token) - ident(each) reserved(do) operator(|)ident(text)operator(,) ident(kind)operator(|) -delete[delete(-) reserved(next) reserved(unless) ident(text)operator(.)ident(respond_to?) symbol(:to_str)] -insert[insert(+) reserved(next) reserved(unless) ident(text)operator(.)ident(is_a?) operator(::)constant(String)] - reserved(yield) ident(text)operator(,) ident(kind) - reserved(end) - reserved(end) -change[change(@@)plain( -252,7 +252,7 )change(@@)] - comment(#) - comment(# You can configure the level of compression,) - comment(# but the default value 7 should be what you want) -delete[delete(-) comment(# in most cases as it is a good comprimise between)] -insert[insert(+) comment(# in most cases as it is a good compromise between)] - comment(# speed and compression rate.) - comment(#) - comment(# See GZip module.) -change[change(@@)plain( -267,9 +267,20 )change(@@)] - comment(# Should be equal to the input size before) - comment(# scanning.) - reserved(def) method(text_size) -delete[delete(-) ident(map) operator({) operator(|)ident(t)operator(,) ident(k)operator(|) ident(t) operator(})operator(.)ident(join)operator(.)ident(size)] -insert[insert(+) ident(size) operator(=) integer(0)] -insert[insert(+) ident(each_text_token) reserved(do) operator(|)ident(t)operator(,) ident(k)operator(|)] -insert[insert(+) ident(size) operator(+) ident(t)operator(.)ident(size)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(size)] - reserved(end) - -insert[insert(+) comment(# The total size of the tokens.)] -insert[insert(+) comment(# Should be equal to the input size before)] -insert[insert(+) comment(# scanning.)] -insert[insert(+) reserved(def) method(text)] -insert[insert(+) ident(map) operator({) operator(|)ident(t)operator(,) ident(k)operator(|) ident(t) reserved(if) ident(t)operator(.)ident(is_a?) operator(::)constant(String) operator(})operator(.)ident(join)] -insert[insert(+) reserved(end)] -insert[insert(+)] - comment(# Include this module to give an object an #undump) - comment(# method.) - comment(#) -change[change(@@)plain( -342,7 +353,7 )change(@@)] - comment(#) - comment(# Returns self.) - reserved(def) method(<<) ident(token) -delete[delete(-) instance_variable(@callback)operator(.)ident(call) ident(token)] -insert[insert(+) instance_variable(@callback)operator(.)ident(call)operator(()operator(*)ident(token)operator(\))] - instance_variable(@size) operator(+=) integer(1) - pre_constant(self) - reserved(end) -change[change(@@)plain( -365,4 +376,8 )change(@@)] - - reserved(end) - -insert[insert(+) ] -insert[insert(+) comment(# Token name abbreviations)] -insert[insert(+) ident(require) string<delimiter(')content(coderay/token_classes)delimiter(')>] -insert[insert(+)] - reserved(end) -head[head(Index: )plain(lib/coderay/duo.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/duo.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/duo.rb)plain( (revision 250\))] -change[change(@@)plain( -4,26 +4,84 )change(@@)] - comment(#) - comment(# $Id: scanner.rb 123 2006-03-21 14:46:34Z murphy $) - comment(#) -delete[delete(-) comment(# TODO: Doc.)] -insert[insert(+) comment(# A Duo is a convenient way to use CodeRay. You just create a Duo,)] -insert[insert(+) comment(# giving it a lang (language of the input code\) and a format (desired)] -insert[insert(+) comment(# output format\), and call Duo#highlight with the code.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Duo makes it easy to re-use both scanner and encoder for a repetitive)] -insert[insert(+) comment(# task. It also provides a very easy interface syntax:)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# require 'coderay')] -insert[insert(+) comment(# CodeRay::Duo[:python, :div].highlight 'import this')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Until you want to do uncommon things with CodeRay, I recommend to use)] -insert[insert(+) comment(# this method, since it takes care of everything.)] - reserved(class) class(Duo) - -delete[delete(-) ident(attr_accessor) symbol(:scanner)operator(,) symbol(:encoder)] -delete[delete(-)] -delete[delete(-) reserved(def) method(initialize) ident(lang)operator(,) ident(format)operator(,) ident(options) operator(=) operator({)operator(})] -delete[delete(-) instance_variable(@scanner) operator(=) constant(CodeRay)operator(.)ident(scanner) ident(lang)operator(,) constant(CodeRay)operator(.)ident(get_scanner_options)operator(()ident(options)operator(\))] -delete[delete(-) instance_variable(@encoder) operator(=) constant(CodeRay)operator(.)ident(encoder) ident(format)operator(,) ident(options)] -insert[insert(+) ident(attr_accessor) symbol(:lang)operator(,) symbol(:format)operator(,) symbol(:options)] -insert[insert(+) ] -insert[insert(+) comment(# Create a new Duo, holding a lang and a format to highlight code.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# simple:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby, :page].highlight 'bla 42')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# streaming:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby, :page].highlight 'bar 23', :stream => true)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# with options:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# alternative syntax without options:)] -insert[insert(+) comment(# CodeRay::Duo[:ruby => :statistic].encode 'class << self; end')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# alternative syntax with options:)] -insert[insert(+) comment(# CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc')] -insert[insert(+) comment(# )] -insert[insert(+) comment(# The options are forwarded to scanner and encoder)] -insert[insert(+) comment(# (see CodeRay.get_scanner_options\).)] -insert[insert(+) reserved(def) method(initialize) ident(lang) operator(=) pre_constant(nil)operator(,) ident(format) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(})] -insert[insert(+) reserved(if) ident(format) operator(==) pre_constant(nil) reserved(and) ident(lang)operator(.)ident(is_a?) constant(Hash) reserved(and) ident(lang)operator(.)ident(size) operator(==) integer(1)] -insert[insert(+) instance_variable(@lang) operator(=) ident(lang)operator(.)ident(keys)operator(.)ident(first)] -insert[insert(+) instance_variable(@format) operator(=) ident(lang)operator([)instance_variable(@lang)operator(])] -insert[insert(+) reserved(else)] -insert[insert(+) instance_variable(@lang) operator(=) ident(lang)] -insert[insert(+) instance_variable(@format) operator(=) ident(format)] -insert[insert(+) reserved(end)] -insert[insert(+) instance_variable(@options) operator(=) ident(options)] - reserved(end) - - reserved(class) operator(<<) class(self) -insert[insert(+) comment(# To allow calls like Duo[:ruby, :html].highlight.)] - reserved(alias) method([]) method(new) - reserved(end) - -delete[delete(-) reserved(def) method(encode) ident(code)] -delete[delete(-) instance_variable(@scanner)operator(.)ident(string) operator(=) ident(code)] -delete[delete(-) instance_variable(@encoder)operator(.)ident(encode_tokens)operator(()ident(scanner)operator(.)ident(tokenize)operator(\))] -insert[insert(+) comment(# The scanner of the duo. Only created once.)] -insert[insert(+) reserved(def) method(scanner)] -insert[insert(+) instance_variable(@scanner) operator(||=) constant(CodeRay)operator(.)ident(scanner) instance_variable(@lang)operator(,) constant(CodeRay)operator(.)ident(get_scanner_options)operator(()instance_variable(@options)operator(\))] - reserved(end) -insert[insert(+) ] -insert[insert(+) comment(# The encoder of the duo. Only created once.)] -insert[insert(+) reserved(def) method(encoder)] -insert[insert(+) instance_variable(@encoder) operator(||=) constant(CodeRay)operator(.)ident(encoder) instance_variable(@format)operator(,) instance_variable(@options)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) comment(# Tokenize and highlight the code using +scanner+ and +encoder+.)] -insert[insert(+) comment(#)] -insert[insert(+) comment(# If the :stream option is set, the Duo will go into streaming mode,)] -insert[insert(+) comment(# saving memory for the cost of time.)] -insert[insert(+) reserved(def) method(encode) ident(code)operator(,) ident(options) operator(=) operator({) symbol(:stream) operator(=)operator(>) pre_constant(false) operator(})] -insert[insert(+) ident(stream) operator(=) ident(options)operator(.)ident(delete) symbol(:stream)] -insert[insert(+) ident(options) operator(=) instance_variable(@options)operator(.)ident(merge) ident(options)] -insert[insert(+) reserved(if) ident(stream)] -insert[insert(+) ident(encoder)operator(.)ident(encode_stream)operator(()ident(code)operator(,) instance_variable(@lang)operator(,) ident(options)operator(\))] -insert[insert(+) reserved(else)] -insert[insert(+) ident(scanner)operator(.)ident(code) operator(=) ident(code)] -insert[insert(+) ident(encoder)operator(.)ident(encode_tokens)operator(()ident(scanner)operator(.)ident(tokenize)operator(,) ident(options)operator(\))] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] - reserved(alias) method(highlight) method(encode) - - reserved(end) - - reserved(end) -insert[insert(+)] -head[head(Index: )plain(lib/coderay/scanner.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanner.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanner.rb)plain( (revision 250\))] -change[change(@@)plain( -66,8 +66,18 )change(@@)] - reserved(end) - - reserved(def) method(normify) ident(code) -delete[delete(-) ident(code) operator(=) ident(code)operator(.)ident(to_s)operator(.)ident(to_unix)] -insert[insert(+) ident(code) operator(=) ident(code)operator(.)ident(to_s)] -insert[insert(+) ident(code)operator(.)ident(force_encoding) string<delimiter(')content(binary)delimiter(')> reserved(if) ident(code)operator(.)ident(respond_to?) symbol(:force_encoding)] -insert[insert(+) ident(code)operator(.)ident(to_unix)] - reserved(end) -insert[insert(+) ] -insert[insert(+) reserved(def) method(file_extension) ident(extension) operator(=) pre_constant(nil)] -insert[insert(+) reserved(if) ident(extension)] -insert[insert(+) instance_variable(@file_extension) operator(=) ident(extension)operator(.)ident(to_s)] -insert[insert(+) reserved(else)] -insert[insert(+) instance_variable(@file_extension) operator(||=) ident(plugin_id)operator(.)ident(to_s)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end) ] - - reserved(end) - -change[change(@@)plain( -117,9 +127,6 )change(@@)] - ident(setup) - reserved(end) - -delete[delete(-) comment(# More mnemonic accessor name for the input string.)] -delete[delete(-) reserved(alias) method(code) method(string)] -delete[delete(-)] - reserved(def) method(reset) - reserved(super) - ident(reset_instance) -change[change(@@)plain( -131,6 +138,10 )change(@@)] - ident(reset_instance) - reserved(end) - -insert[insert(+) comment(# More mnemonic accessor name for the input string.)] -insert[insert(+) reserved(alias) method(code) method(string)] -insert[insert(+) reserved(alias) method(code=) method(string=)] -insert[insert(+)] - comment(# Scans the code and returns all tokens in a Tokens object.) - reserved(def) method(tokenize) ident(new_string)operator(=)pre_constant(nil)operator(,) ident(options) operator(=) operator({)operator(}) - ident(options) operator(=) instance_variable(@options)operator(.)ident(merge)operator(()ident(options)operator(\)) -change[change(@@)plain( -148,6 +159,11 )change(@@)] - reserved(def) method(tokens) - instance_variable(@cached_tokens) operator(||=) ident(tokenize) - reserved(end) -insert[insert(+) ] -insert[insert(+) comment(# Whether the scanner is in streaming mode.)] -insert[insert(+) reserved(def) method(streaming?)] -insert[insert(+) operator(!)operator(!)instance_variable(@options)operator([)symbol(:stream)operator(])] -insert[insert(+) reserved(end)] - - comment(# Traverses the tokens.) - reserved(def) method(each) operator(&)ident(block) -change[change(@@)plain( -195,7 +211,7 )change(@@)] - ident(raise) constant(ScanError)operator(,) string<delimiter(<<-EOE)> operator(%) operator([) - - -delete[delete(-)operator(**)operator(*)constant(ERROR) reserved(in) symbol<delimiter(%s:)content( %s)>] -insert[insert(+)operator(**)operator(*)constant(ERROR) reserved(in) symbol<delimiter(%s:)content( %s (after %d tokens\))>] - - ident(tokens)operator(:) - operator(%)ident(s) -change[change(@@)plain( -211,13 +227,14 )change(@@)] - operator(**)operator(*)constant(ERROR)operator(**)operator(*) - - constant(EOE) -delete[delete(-) constant(File)operator(.)ident(basename)operator(()ident(caller)operator([)integer(0)operator(])operator(\))operator(,)] -delete[delete(-) ident(msg)operator(,)] -delete[delete(-) ident(tokens)operator(.)ident(last)operator(()integer(10)operator(\))operator(.)ident(map) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(inspect) operator(})operator(.)ident(join)operator(()string<delimiter(")char(\\n)delimiter(")>operator(\))operator(,)] -delete[delete(-) ident(line)operator(,) ident(pos)operator(,)] -delete[delete(-) ident(matched)operator(,) ident(state)operator(,) ident(bol?)operator(,) ident(eos?)operator(,)] -delete[delete(-) ident(string)operator([)ident(pos)operator(-)ident(ambit)operator(,)ident(ambit)operator(])operator(,)] -delete[delete(-) ident(string)operator([)ident(pos)operator(,)ident(ambit)operator(])operator(,)] -insert[insert(+) constant(File)operator(.)ident(basename)operator(()ident(caller)operator([)integer(0)operator(])operator(\))operator(,)] -insert[insert(+) ident(msg)operator(,)] -insert[insert(+) ident(tokens)operator(.)ident(size)operator(,)] -insert[insert(+) ident(tokens)operator(.)ident(last)operator(()integer(10)operator(\))operator(.)ident(map) operator({) operator(|)ident(t)operator(|) ident(t)operator(.)ident(inspect) operator(})operator(.)ident(join)operator(()string<delimiter(")char(\\n)delimiter(")>operator(\))operator(,)] -insert[insert(+) ident(line)operator(,) ident(pos)operator(,)] -insert[insert(+) ident(matched)operator(,) ident(state)operator(,) ident(bol?)operator(,) ident(eos?)operator(,)] -insert[insert(+) ident(string)operator([)ident(pos)operator(-)ident(ambit)operator(,)ident(ambit)operator(])operator(,)] -insert[insert(+) ident(string)operator([)ident(pos)operator(,)ident(ambit)operator(])operator(,)] - operator(]) - reserved(end) - -head[head(Index: )plain(lib/coderay/for_redcloth.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/for_redcloth.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/for_redcloth.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,72 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay) comment(# :nodoc:)] -insert[insert(+) ] -insert[insert(+) comment(# A little hack to enable CodeRay highlighting in RedCloth.)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Usage:)] -insert[insert(+) comment(# require 'coderay')] -insert[insert(+) comment(# require 'coderay/for_redcloth')] -insert[insert(+) comment(# RedCloth.new('@[ruby]puts "Hello, World!"@'\).to_html)] -insert[insert(+) comment(# )] -insert[insert(+) comment(# Make sure you have RedCloth 4.0.3 activated, for example by calling)] -insert[insert(+) comment(# require 'rubygems')] -insert[insert(+) comment(# before RedCloth is loaded and before calling CodeRay.for_redcloth.)] -insert[insert(+) reserved(module) class(ForRedCloth)] -insert[insert(+) ] -insert[insert(+) reserved(def) pre_constant(self)operator(.)method(install)] -insert[insert(+) ident(gem) string<delimiter(')content(RedCloth)delimiter(')>operator(,) string<delimiter(')content(>= 4.0.3)delimiter(')> reserved(rescue) pre_constant(nil)] -insert[insert(+) ident(require) string<delimiter(')content(redcloth)delimiter(')>] -insert[insert(+) ident(raise) string<delimiter(')content(CodeRay.for_redcloth needs RedCloth 4.0.3 or later.)delimiter(')> reserved(unless) constant(RedCloth)operator(::)constant(VERSION)operator(.)ident(to_s) operator(>)operator(=) string<delimiter(')content(4.0.3)delimiter(')>] -insert[insert(+) constant(RedCloth)operator(::)constant(TextileDoc)operator(.)ident(send) symbol(:include)operator(,) constant(ForRedCloth)operator(::)constant(TextileDoc)] -insert[insert(+) constant(RedCloth)operator(::)constant(Formatters)operator(::)constant(HTML)operator(.)ident(module_eval) reserved(do)] -insert[insert(+) reserved(def) method(unescape)operator(()ident(html)operator(\))] -insert[insert(+) ident(replacements) operator(=) operator({)] -insert[insert(+) string<delimiter(')content(&)delimiter(')> operator(=)operator(>) string<delimiter(')content(&)delimiter(')>operator(,)] -insert[insert(+) string<delimiter(')content(")delimiter(')> operator(=)operator(>) string<delimiter(')content(")delimiter(')>operator(,)] -insert[insert(+) string<delimiter(')content(>)delimiter(')> operator(=)operator(>) string<delimiter(')content(>)delimiter(')>operator(,)] -insert[insert(+) string<delimiter(')content(<)delimiter(')> operator(=)operator(>) string<delimiter(')content(<)delimiter(')>operator(,)] -insert[insert(+) operator(})] -insert[insert(+) ident(html)operator(.)ident(gsub)operator(()regexp<delimiter(/)content(&(?:amp|quot|[gl]t\);)delimiter(/)>operator(\)) operator({) operator(|)ident(entity)operator(|) ident(replacements)operator([)ident(entity)operator(]) operator(})] -insert[insert(+) reserved(end)] -insert[insert(+) ident(undef_method) symbol(:code)operator(,) symbol(:bc_open)operator(,) symbol(:bc_close)operator(,) symbol(:escape_pre)] -insert[insert(+) reserved(def) method(code)operator(()ident(opts)operator(\)) comment(# :nodoc:)] -insert[insert(+) ident(opts)operator([)symbol(:block)operator(]) operator(=) pre_constant(true)] -insert[insert(+) reserved(if) ident(opts)operator([)symbol(:lang)operator(]) operator(&&) operator(!)ident(filter_coderay)] -insert[insert(+) ident(require) string<delimiter(')content(coderay)delimiter(')>] -insert[insert(+) instance_variable(@in_bc) operator(||=) pre_constant(nil)] -insert[insert(+) ident(format) operator(=) instance_variable(@in_bc) operator(?) symbol(:div) operator(:) symbol(:span)] -insert[insert(+) ident(highlighted_code) operator(=) constant(CodeRay)operator(.)ident(encode) ident(opts)operator([)symbol(:text)operator(])operator(,) ident(opts)operator([)symbol(:lang)operator(])operator(,) ident(format)operator(,) symbol(:stream) operator(=)operator(>) pre_constant(true)] -insert[insert(+) ident(highlighted_code)operator(.)ident(sub!)operator(()regexp<delimiter(/)char(\\A)content(<(span|div\))delimiter(/)>operator(\)) operator({) operator(|)ident(m)operator(|) ident(m) operator(+) ident(pba)operator(()instance_variable(@in_bc) operator(||) ident(opts)operator(\)) operator(})] -insert[insert(+) ident(highlighted_code) operator(=) ident(unescape)operator(()ident(highlighted_code)operator(\)) reserved(unless) instance_variable(@in_bc)] -insert[insert(+) ident(highlighted_code)] -insert[insert(+) reserved(else)] -insert[insert(+) string<delimiter(")content(<code)inline<inline_delimiter(#{)ident(pba)operator(()ident(opts)operator(\))inline_delimiter(})>content(>)inline<inline_delimiter(#{)ident(opts)operator([)symbol(:text)operator(])inline_delimiter(})>content(</code>)delimiter(")>] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(def) method(bc_open)operator(()ident(opts)operator(\)) comment(# :nodoc:)] -insert[insert(+) ident(opts)operator([)symbol(:block)operator(]) operator(=) pre_constant(true)] -insert[insert(+) instance_variable(@in_bc) operator(=) ident(opts)] -insert[insert(+) ident(opts)operator([)symbol(:lang)operator(]) operator(?) string<delimiter(')delimiter(')> operator(:) string<delimiter(")content(<pre)inline<inline_delimiter(#{)ident(pba)operator(()ident(opts)operator(\))inline_delimiter(})>content(>)delimiter(")>] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(def) method(bc_close)operator(()ident(opts)operator(\)) comment(# :nodoc:)] -insert[insert(+) instance_variable(@in_bc) operator(=) pre_constant(nil)] -insert[insert(+) ident(opts)operator([)symbol(:lang)operator(]) operator(?) string<delimiter(')delimiter(')> operator(:) string<delimiter(")content(</pre>)char(\\n)delimiter(")>] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(def) method(escape_pre)operator(()ident(text)operator(\))] -insert[insert(+) reserved(if) instance_variable(@in_bc) operator(||=) pre_constant(nil)] -insert[insert(+) ident(text)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(html_esc)operator(()ident(text)operator(,) symbol(:html_escape_preformatted)operator(\))] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(module) class(TextileDoc) comment(# :nodoc:)] -insert[insert(+) ident(attr_accessor) symbol(:filter_coderay)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+)reserved(end)] -insert[insert(+)] -insert[insert(+)constant(CodeRay)operator(::)constant(ForRedCloth)operator(.)ident(install)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/scanners/ruby/patterns.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/ruby/patterns.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/ruby/patterns.rb)plain( (revision 250\))] -change[change(@@)plain( -14,19 +14,14 )change(@@)] - - constant(DEF_KEYWORDS) operator(=) string<delimiter(%w[)content( def )delimiter(])> - constant(UNDEF_KEYWORDS) operator(=) string<delimiter(%w[)content( undef )delimiter(])> -insert[insert(+) constant(ALIAS_KEYWORDS) operator(=) string<delimiter(%w[)content( alias )delimiter(])>] - constant(MODULE_KEYWORDS) operator(=) string<delimiter(%w[)content(class module)delimiter(])> - constant(DEF_NEW_STATE) operator(=) constant(WordList)operator(.)ident(new)operator(()symbol(:initial)operator(\))operator(.) - ident(add)operator(()constant(DEF_KEYWORDS)operator(,) symbol(:def_expected)operator(\))operator(.) - ident(add)operator(()constant(UNDEF_KEYWORDS)operator(,) symbol(:undef_expected)operator(\))operator(.) -insert[insert(+) ident(add)operator(()constant(ALIAS_KEYWORDS)operator(,) symbol(:alias_expected)operator(\))operator(.)] - ident(add)operator(()constant(MODULE_KEYWORDS)operator(,) symbol(:module_expected)operator(\)) - -delete[delete(-) constant(IDENTS_ALLOWING_REGEXP) operator(=) string<delimiter(%w[)>] -delete[delete(-) reserved(and) reserved(or) reserved(not) reserved(while) reserved(until) reserved(unless) reserved(if) reserved(then) reserved(elsif) reserved(when) ident(sub) ident(sub!) ident(gsub) ident(gsub!)] -delete[delete(-) ident(scan) ident(slice) ident(slice!) ident(split)] -delete[delete(-) operator(])] -delete[delete(-) constant(REGEXP_ALLOWED) operator(=) constant(WordList)operator(.)ident(new)operator(()pre_constant(false)operator(\))operator(.)] -delete[delete(-) ident(add)operator(()constant(IDENTS_ALLOWING_REGEXP)operator(,) symbol(:set)operator(\))] -delete[delete(-)] - constant(PREDEFINED_CONSTANTS) operator(=) string<delimiter(%w[)> - pre_constant(nil) pre_constant(true) pre_constant(false) pre_constant(self) - pre_constant(DATA) pre_constant(ARGV) pre_constant(ARGF) pre_constant(__FILE__) pre_constant(__LINE__) -change[change(@@)plain( -41,19 +36,20 )change(@@)] - constant(METHOD_NAME) operator(=) regexp<delimiter(/)content( )inline<inline_delimiter(#{)constant(IDENT)inline_delimiter(})>content( [?!]? )delimiter(/)modifier(ox)> - constant(METHOD_NAME_OPERATOR) operator(=) regexp<delimiter(/)> - error(\\)operator(*)error(\\)operator(*)operator(?) comment(# multiplication and power) -delete[delete(-) operator(|) operator([)operator(-)operator(+)operator(])error(@)operator(?) comment(# plus, minus)] -delete[delete(-) operator(|) operator([)error(\\)regexp<delimiter(/)content(%&|^`~] # division, modulo or format strings, &and, |or, ^xor, `system`, tilde)>] -insert[insert(+) operator(|) operator([)operator(-)operator(+)operator(~)operator(])error(@)operator(?) comment(# plus, minus, tilde with and without @)] -insert[insert(+) operator(|) operator([)error(\\)regexp<delimiter(/)content(%&|^`] # division, modulo or format strings, &and, |or, ^xor, `system`)>] - operator(|) error(\\)operator([)error(\\)operator(])operator(=)operator(?) comment(# array getter and setter) - operator(|) operator(<<) operator(|) operator(>>) comment(# append or shift left, shift right) - operator(|) operator(<=)integer(?>)operator(?) operator(|) operator(>)operator(=)operator(?) comment(# comparison, rocket operator) -delete[delete(-) operator(|) operator(===)operator(?) comment(# simple equality and case equality)] -insert[insert(+) operator(|) operator(===)operator(?) operator(|) operator(=)operator(~) comment(# simple equality, case equality, match)] -insert[insert(+) operator(|) operator(!)operator([)operator(~=)error(@)operator(])operator(?) comment(# negation with and without @, not-equal and not-match)] - regexp<delimiter(/)content(ox)> - constant(METHOD_NAME_EX) operator(=) regexp<delimiter(/)content( )inline<inline_delimiter(#{)constant(IDENT)inline_delimiter(})>content( (?:[?!]|=(?!>\)\)? | )inline<inline_delimiter(#{)constant(METHOD_NAME_OPERATOR)inline_delimiter(})>content( )delimiter(/)modifier(ox)> - constant(INSTANCE_VARIABLE) operator(=) regexp<delimiter(/)content( @ )inline<inline_delimiter(#{)constant(IDENT)inline_delimiter(})>content( )delimiter(/)modifier(ox)> - constant(CLASS_VARIABLE) operator(=) regexp<delimiter(/)content( @@ )inline<inline_delimiter(#{)constant(IDENT)inline_delimiter(})>content( )delimiter(/)modifier(ox)> - constant(OBJECT_VARIABLE) operator(=) regexp<delimiter(/)content( @@? )inline<inline_delimiter(#{)constant(IDENT)inline_delimiter(})>content( )delimiter(/)modifier(ox)> - constant(GLOBAL_VARIABLE) operator(=) regexp<delimiter(/)content( )char(\\$)content( (?: )inline<inline_delimiter(#{)constant(IDENT)inline_delimiter(})>content( | [1-9])char(\\d)content(* | 0)char(\\w)content(* | [~&+`'=)char(\\/)content(,;_.<>!@$?*":)char(\\\\)content(] | -[a-zA-Z_0-9] \) )delimiter(/)modifier(ox)> -delete[delete(-) constant(PREFIX_VARIABLE) operator(=) regexp<delimiter(/)content( )inline<inline_delimiter(#{)constant(GLOBAL_VARIABLE)inline_delimiter(})>content( |)inline<inline_delimiter(#{)constant(OBJECT_VARIABLE)inline_delimiter(})>content( )delimiter(/)modifier(ox)>] -insert[insert(+) constant(PREFIX_VARIABLE) operator(=) regexp<delimiter(/)content( )inline<inline_delimiter(#{)constant(GLOBAL_VARIABLE)inline_delimiter(})>content( | )inline<inline_delimiter(#{)constant(OBJECT_VARIABLE)inline_delimiter(})>content( )delimiter(/)modifier(ox)>] - constant(VARIABLE) operator(=) regexp<delimiter(/)content( @?@? )inline<inline_delimiter(#{)constant(IDENT)inline_delimiter(})>content( | )inline<inline_delimiter(#{)constant(GLOBAL_VARIABLE)inline_delimiter(})>content( )delimiter(/)modifier(ox)> - - constant(QUOTE_TO_TYPE) operator(=) operator({) -change[change(@@)plain( -73,7 +69,7 )change(@@)] - constant(EXPONENT) operator(=) regexp<delimiter(/)content( [eE] [+-]? )inline<inline_delimiter(#{)constant(DECIMAL)inline_delimiter(})>content( )delimiter(/)modifier(ox)> - constant(FLOAT_SUFFIX) operator(=) regexp<delimiter(/)content( )inline<inline_delimiter(#{)constant(EXPONENT)inline_delimiter(})>content( | )char(\\.)content( )inline<inline_delimiter(#{)constant(DECIMAL)inline_delimiter(})>content( )inline<inline_delimiter(#{)constant(EXPONENT)inline_delimiter(})>content(? )delimiter(/)modifier(ox)> - constant(FLOAT_OR_INT) operator(=) regexp<delimiter(/)content( )inline<inline_delimiter(#{)constant(DECIMAL)inline_delimiter(})>content( (?: )inline<inline_delimiter(#{)constant(FLOAT_SUFFIX)inline_delimiter(})>content( (\) \)? )delimiter(/)modifier(ox)> -delete[delete(-) constant(NUMERIC) operator(=) regexp<delimiter(/)content( [-+]? (?: (?=0\) (?: )inline<inline_delimiter(#{)constant(OCTAL)inline_delimiter(})>content( | )inline<inline_delimiter(#{)constant(HEXADECIMAL)inline_delimiter(})>content( | )inline<inline_delimiter(#{)constant(BINARY)inline_delimiter(})>content( \) | )inline<inline_delimiter(#{)constant(FLOAT_OR_INT)inline_delimiter(})>content( \) )delimiter(/)modifier(ox)>] -insert[insert(+) constant(NUMERIC) operator(=) regexp<delimiter(/)content( (?: (?=0\) (?: )inline<inline_delimiter(#{)constant(OCTAL)inline_delimiter(})>content( | )inline<inline_delimiter(#{)constant(HEXADECIMAL)inline_delimiter(})>content( | )inline<inline_delimiter(#{)constant(BINARY)inline_delimiter(})>content( \) | )inline<inline_delimiter(#{)constant(FLOAT_OR_INT)inline_delimiter(})>content( \) )delimiter(/)modifier(ox)>] - - constant(SYMBOL) operator(=) regexp<delimiter(/)> - operator(:) -change[change(@@)plain( -83,6 +79,7 )change(@@)] - operator(|) operator([)string<delimiter(')content("])> - operator(\)) - regexp<delimiter(/)content(ox)> -insert[insert(+) constant(METHOD_NAME_OR_SYMBOL) operator(=) regexp<delimiter(/)content( )inline<inline_delimiter(#{)constant(METHOD_NAME_EX)inline_delimiter(})>content( | )inline<inline_delimiter(#{)constant(SYMBOL)inline_delimiter(})>content( )delimiter(/)modifier(ox)>] - - comment(# TODO investigste \\M, \\c and \\C escape sequences) - comment(# (?: M-\\\\C-|C-\\\\M-|M-\\\\c|c\\\\M-|c|C-|M-\)? (?: \\\\ (?: [0-7]{3} | x[0-9A-Fa-f]{2} | . \) \)) -change[change(@@)plain( -111,7 +108,7 )change(@@)] - operator(()integer(?:) - operator(() operator([)constant(A)operator(-)constant(Za)operator(-)ident(z_0)operator(-)integer(9)operator(])operator(+) operator(\)) comment(# $2 = delim) - operator(|) -delete[delete(-) operator(() operator([)string<delimiter(")content('`] \) # $3 = quote, type)>] -insert[insert(+) operator(() operator([)string<delimiter(")content('`)char(\\/)content(] \) # $3 = quote, type)>] - operator(() operator([)operator(^)error(\\)ident(n)operator(])operator(*)operator(?) operator(\)) error(\\)integer(3) comment(# $4 = delim) - operator(\)) - regexp<delimiter(/)content(mx)> -change[change(@@)plain( -129,15 +126,14 )change(@@)] - regexp<delimiter(/)content(mx)> - - comment(# Checks for a valid value to follow. This enables) -delete[delete(-) comment(# fancy_allowed in method calls.)] -insert[insert(+) comment(# value_expected in method calls without parentheses.)] - constant(VALUE_FOLLOWS) operator(=) regexp<delimiter(/)> -delete[delete(-) error(\\)ident(s)operator(+)] -insert[insert(+) operator(()integer(?>)operator([) error(\\)ident(t)error(\\)ident(f)error(\\)ident(v)operator(])operator(+)operator(\))] - operator(()integer(?:) - operator([)string<delimiter(%\\)content(/][^)delimiter(\\)>ident(s)operator(=)operator(]) -delete[delete(-) operator(|)] -delete[delete(-) operator(<<)operator(-)integer(?\\S)] -delete[delete(-) operator(|)] -delete[delete(-) comment(#{CHARACTER})] -insert[insert(+) operator(|) operator(<<)operator(-)integer(?\\S)] -insert[insert(+) operator(|) operator([)operator(-)operator(+)operator(]) error(\\)ident(d)] -insert[insert(+) operator(|) comment(#{CHARACTER})] - operator(\)) - regexp<delimiter(/)content(x)> - -head[head(Index: )plain(lib/coderay/scanners/ruby.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/ruby.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/ruby.rb)plain( (revision 250\))] -change[change(@@)plain( -18,6 +18,7 )change(@@)] - ident(include) constant(Streamable) - - ident(register_for) symbol(:ruby) -insert[insert(+) ident(file_extension) string<delimiter(')content(rb)delimiter(')>] - - ident(helper) symbol(:patterns) - -change[change(@@)plain( -90,15 +91,15 )change(@@)] - reserved(end) - - reserved(when) string<delimiter(')content(#)delimiter(')> -delete[delete(-) reserved(case) ident(peek)operator(()integer(1)operator(\))operator([)integer(0)operator(])] -delete[delete(-) reserved(when) integer(?{)] -insert[insert(+) reserved(case) ident(peek)operator(()integer(1)operator(\))] -insert[insert(+) reserved(when) string<delimiter(')content({)delimiter(')>] - ident(inline_block_stack) operator(<<) operator([)ident(state)operator(,) ident(depth)operator(,) ident(heredocs)operator(]) - ident(value_expected) operator(=) pre_constant(true) - ident(state) operator(=) symbol(:initial) - ident(depth) operator(=) integer(1) - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) - ident(tokens) operator(<<) operator([)ident(match) operator(+) ident(getch)operator(,) symbol(:inline_delimiter)operator(]) -delete[delete(-) reserved(when) integer(?$)operator(,) integer(?@)] -insert[insert(+) reserved(when) string<delimiter(')content($)delimiter(')>operator(,) string<delimiter(')content(@)delimiter(')>] - ident(tokens) operator(<<) operator([)ident(match)operator(,) symbol(:escape)operator(]) - ident(last_state) operator(=) ident(state) comment(# scan one token as normal code, then return here) - ident(state) operator(=) symbol(:initial) -change[change(@@)plain( -121,36 +122,37 )change(@@)] - comment(# }}}) - reserved(else) - comment(# {{{) -delete[delete(-) reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( [ )char(\\t)char(\\f)content(]+ | )char(\\\\)content(? )char(\\n)content( | )char(\\#)content( .* )delimiter(/)modifier(x)>operator(\)) reserved(or)] -delete[delete(-) operator(() ident(bol?) reserved(and) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(RUBYDOC_OR_DATA)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) operator(\))] -delete[delete(-) reserved(case) ident(m) operator(=) ident(match)operator([)integer(0)operator(])] -delete[delete(-) reserved(when) integer(?\\s)operator(,) integer(?\\t)operator(,) integer(?\\f)] -delete[delete(-) ident(match) operator(<<) ident(scan)operator(()regexp<delimiter(/)char(\\s)content(*)delimiter(/)>operator(\)) reserved(unless) ident(eos?) reserved(or) ident(heredocs)] -delete[delete(-) ident(kind) operator(=) symbol(:space)] -delete[delete(-) reserved(when) integer(?\\n)operator(,) integer(?\\\\)] -delete[delete(-) ident(kind) operator(=) symbol(:space)] -delete[delete(-) reserved(if) ident(m) operator(==) integer(?\\n)] -delete[delete(-) ident(value_expected) operator(=) pre_constant(true) comment(# FIXME not quite true)] -delete[delete(-) ident(state) operator(=) symbol(:initial) reserved(if) ident(state) operator(==) symbol(:undef_comma_expected)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(if) ident(heredocs)] -delete[delete(-) ident(unscan) comment(# heredoc scanning needs \\n at start)] -delete[delete(-) ident(state) operator(=) ident(heredocs)operator(.)ident(shift)] -delete[delete(-) ident(tokens) operator(<<) operator([)symbol(:open)operator(,) ident(state)operator(.)ident(type)operator(])] -delete[delete(-) ident(heredocs) operator(=) pre_constant(nil) reserved(if) ident(heredocs)operator(.)ident(empty?)] -delete[delete(-) reserved(next)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(match) operator(<<) ident(scan)operator(()regexp<delimiter(/)char(\\s)content(*)delimiter(/)>operator(\)) reserved(unless) ident(eos?)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(when) integer(?#)operator(,) integer(?=)operator(,) integer(?_)] -delete[delete(-) ident(kind) operator(=) symbol(:comment)] -delete[delete(-) ident(value_expected) operator(=) pre_constant(true)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content([ )char(\\t)char(\\f)content(]+)delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:space)] -insert[insert(+) ident(match) operator(<<) ident(scan)operator(()regexp<delimiter(/)char(\\s)content(*)delimiter(/)>operator(\)) reserved(unless) ident(eos?) operator(||) ident(heredocs)] -insert[insert(+) ident(value_expected) operator(=) pre_constant(true) reserved(if) ident(match)operator(.)ident(index)operator(()integer(?\\n)operator(\)) comment(# FIXME not quite true)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)char(\\\\)content(?)char(\\n)delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:space)] -insert[insert(+) reserved(if) ident(match) operator(==) string<delimiter(")char(\\n)delimiter(")>] -insert[insert(+) ident(value_expected) operator(=) pre_constant(true) comment(# FIXME not quite true)] -insert[insert(+) ident(state) operator(=) symbol(:initial) reserved(if) ident(state) operator(==) symbol(:undef_comma_expected)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(if) ident(heredocs)] -insert[insert(+) ident(unscan) comment(# heredoc scanning needs \\n at start)] -insert[insert(+) ident(state) operator(=) ident(heredocs)operator(.)ident(shift)] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:open)operator(,) ident(state)operator(.)ident(type)operator(])] -insert[insert(+) ident(heredocs) operator(=) pre_constant(nil) reserved(if) ident(heredocs)operator(.)ident(empty?)] -insert[insert(+) reserved(next)] - reserved(else) -delete[delete(-) ident(raise_inspect) string<delimiter(')content(else-case _ reached, because case %p was)>] -delete[delete(-) reserved(not) ident(handled)string<delimiter(')content( % [matched[0].chr], tokens)>] -insert[insert(+) ident(match) operator(<<) ident(scan)operator(()regexp<delimiter(/)char(\\s)content(*)delimiter(/)>operator(\)) reserved(unless) ident(eos?)] - reserved(end) - ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(]) - reserved(next) -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)char(\\#)content(.*)delimiter(/)>operator(\)) reserved(or)] -insert[insert(+) operator(() ident(bol?) reserved(and) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(RUBYDOC_OR_DATA)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:comment)] -insert[insert(+) ident(value_expected) operator(=) pre_constant(true)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) reserved(next)] - - reserved(elsif) ident(state) operator(==) symbol(:initial) - -change[change(@@)plain( -167,19 +169,19 )change(@@)] - reserved(end) - reserved(end) - comment(## experimental!) -delete[delete(-) ident(value_expected) operator(=) symbol(:set) reserved(if)] -delete[delete(-) ident(patterns)operator(::)constant(REGEXP_ALLOWED)operator([)ident(match)operator(]) reserved(or) ident(check)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(VALUE_FOLLOWS)inline_delimiter(})>delimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(value_expected) operator(=) symbol(:set) reserved(if) ident(check)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(VALUE_FOLLOWS)inline_delimiter(})>delimiter(/)modifier(o)>operator(\))] - - reserved(elsif) ident(last_token_dot) reserved(and) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(METHOD_NAME_OPERATOR)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) - ident(kind) operator(=) symbol(:ident) - ident(value_expected) operator(=) symbol(:set) reserved(if) ident(check)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(VALUE_FOLLOWS)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) - - comment(# OPERATORS #) -delete[delete(-) reserved(elsif) reserved(not) ident(last_token_dot) reserved(and) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( ==?=? | )char(\\.)char(\\.)content(?)char(\\.)content(? | [)char(\\()char(\\\))char(\\[)char(\\])char(\\{)char(\\})content(] | :: | , )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) comment(# TODO: match (\), [], {} as one single operator)] -insert[insert(+) reserved(elsif) reserved(not) ident(last_token_dot) reserved(and) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( )char(\\.)char(\\.)char(\\.)content(? | (?:)char(\\.)content(|::\)(\) | [,)char(\\()char(\\\))char(\\[)char(\\])char(\\{)char(\\})content(] | ==?=? )delimiter(/)modifier(x)>operator(\))] - reserved(if) ident(match) operator(!)operator(~) regexp<delimiter(/)content( [.)char(\\\))char(\\])char(\\})content(] )delimiter(/)modifier(x)> reserved(or) ident(match) operator(=)operator(~) regexp<delimiter(/)char(\\.)char(\\.)char(\\.)content(?)delimiter(/)> - ident(value_expected) operator(=) symbol(:set) - reserved(end) -delete[delete(-) ident(last_token_dot) operator(=) symbol(:set) reserved(if) ident(match) operator(==) string<delimiter(')content(.)delimiter(')> reserved(or) ident(match) operator(==) string<delimiter(')content(::)delimiter(')>] -insert[insert(+) ident(last_token_dot) operator(=) symbol(:set) reserved(if) pre_constant(self)operator([)integer(1)operator(])] - ident(kind) operator(=) symbol(:operator) - reserved(unless) ident(inline_block_stack)operator(.)ident(empty?) - reserved(case) ident(match) -change[change(@@)plain( -210,8 +212,9 )change(@@)] - ident(interpreted) operator(=) pre_constant(true) - ident(state) operator(=) ident(patterns)operator(::)constant(StringState)operator(.)ident(new) symbol(:regexp)operator(,) ident(interpreted)operator(,) ident(match) - -delete[delete(-) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(NUMERIC)inline_delimiter(})>delimiter(/)modifier(o)>operator(\))] -delete[delete(-) ident(kind) operator(=) reserved(if) pre_constant(self)operator([)integer(1)operator(]) reserved(then) symbol(:float) reserved(else) symbol(:integer) reserved(end)] -insert[insert(+) comment(# elsif match = scan(/[-+]?#{patterns::NUMERIC}/o\))] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(value_expected) operator(?) ident(scan)operator(()regexp<delimiter(/)content([-+]?)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(NUMERIC)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) operator(:) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(NUMERIC)inline_delimiter(})>delimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(kind) operator(=) pre_constant(self)operator([)integer(1)operator(]) operator(?) symbol(:float) operator(:) symbol(:integer)] - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(SYMBOL)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) - reserved(case) ident(delim) operator(=) ident(match)operator([)integer(1)operator(]) -change[change(@@)plain( -285,6 +288,18 )change(@@)] - reserved(next) - reserved(end) - -insert[insert(+) reserved(elsif) ident(state) operator(==) symbol(:module_expected)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content(<<)delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( (?:)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(IDENT)inline_delimiter(})>content(::\)* )inline<inline_delimiter(#{)ident(patterns)operator(::)constant(IDENT)inline_delimiter(})>content( )delimiter(/)modifier(ox)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:class)] -insert[insert(+) reserved(else)] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(end)] -insert[insert(+) reserved(end)] -insert[insert(+)] - reserved(elsif) ident(state) operator(==) symbol(:undef_expected) - ident(state) operator(=) symbol(:undef_comma_expected) - reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(METHOD_NAME_EX)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) -change[change(@@)plain( -306,6 +321,15 )change(@@)] - reserved(next) - reserved(end) - -insert[insert(+) reserved(elsif) ident(state) operator(==) symbol(:alias_expected)] -insert[insert(+) reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content(()inline<inline_delimiter(#{)ident(patterns)operator(::)constant(METHOD_NAME_OR_SYMBOL)inline_delimiter(})>content(\)([ )char(\\t)content(]+\)()inline<inline_delimiter(#{)ident(patterns)operator(::)constant(METHOD_NAME_OR_SYMBOL)inline_delimiter(})>content(\))delimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)pre_constant(self)operator([)integer(1)operator(])operator(,) operator(()pre_constant(self)operator([)integer(1)operator(])operator([)integer(0)operator(]) operator(==) integer(?:) operator(?) symbol(:symbol) operator(:) symbol(:method)operator(\))operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)pre_constant(self)operator([)integer(2)operator(])operator(,) symbol(:space)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)pre_constant(self)operator([)integer(3)operator(])operator(,) operator(()pre_constant(self)operator([)integer(3)operator(])operator([)integer(0)operator(]) operator(==) integer(?:) operator(?) symbol(:symbol) operator(:) symbol(:method)operator(\))operator(])] -insert[insert(+) reserved(end)] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) reserved(next)] -insert[insert(+)] - reserved(elsif) ident(state) operator(==) symbol(:undef_comma_expected) - reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content(,)delimiter(/)>operator(\)) - ident(kind) operator(=) symbol(:operator) -change[change(@@)plain( -315,24 +339,14 )change(@@)] - reserved(next) - reserved(end) - -delete[delete(-) reserved(elsif) ident(state) operator(==) symbol(:module_expected)] -delete[delete(-) reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content(<<)delimiter(/)>operator(\))] -delete[delete(-) ident(kind) operator(=) symbol(:operator)] -delete[delete(-) reserved(else)] -delete[delete(-) ident(state) operator(=) symbol(:initial)] -delete[delete(-) reserved(if) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( (?:)inline<inline_delimiter(#{)ident(patterns)operator(::)constant(IDENT)inline_delimiter(})>content(::\)* )inline<inline_delimiter(#{)ident(patterns)operator(::)constant(IDENT)inline_delimiter(})>content( )delimiter(/)modifier(ox)>operator(\))] -delete[delete(-) ident(kind) operator(=) symbol(:class)] -delete[delete(-) reserved(else)] -delete[delete(-) reserved(next)] -delete[delete(-) reserved(end)] -delete[delete(-) reserved(end)] -delete[delete(-)] - reserved(end) - comment(# }}}) -insert[insert(+) ] -insert[insert(+) reserved(unless) ident(kind) operator(==) symbol(:error)] -insert[insert(+) ident(value_expected) operator(=) ident(value_expected) operator(==) symbol(:set)] -insert[insert(+) ident(last_token_dot) operator(=) ident(last_token_dot) operator(==) symbol(:set)] -insert[insert(+) reserved(end)] - -delete[delete(-) ident(value_expected) operator(=) ident(value_expected) operator(==) symbol(:set)] -delete[delete(-) ident(last_token_dot) operator(=) ident(last_token_dot) operator(==) symbol(:set)] -delete[delete(-)] - reserved(if) global_variable($DEBUG) reserved(and) reserved(not) ident(kind) - ident(raise_inspect) string<delimiter(')content(Error token %p in line %d)delimiter(')> operator(%) - operator([)operator([)ident(match)operator(,) ident(kind)operator(])operator(,) ident(line)operator(])operator(,) ident(tokens)operator(,) ident(state) -head[head(Index: )plain(lib/coderay/scanners/c.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/c.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/c.rb)plain( (revision 250\))] -change[change(@@)plain( -4,6 +4,8 )change(@@)] - reserved(class) class(C) operator(<) constant(Scanner) - - ident(register_for) symbol(:c) -insert[insert(+) ] -insert[insert(+) ident(include) constant(Streamable)] - - constant(RESERVED_WORDS) operator(=) operator([) - string<delimiter(')content(asm)delimiter(')>operator(,) string<delimiter(')content(break)delimiter(')>operator(,) string<delimiter(')content(case)delimiter(')>operator(,) string<delimiter(')content(continue)delimiter(')>operator(,) string<delimiter(')content(default)delimiter(')>operator(,) string<delimiter(')content(do)delimiter(')>operator(,) string<delimiter(')content(else)delimiter(')>operator(,) -change[change(@@)plain( -42,7 +44,7 )change(@@)] - - ident(kind) operator(=) pre_constant(nil) - ident(match) operator(=) pre_constant(nil) -delete[delete(-)] -insert[insert(+) ] - reserved(case) ident(state) - - reserved(when) symbol(:initial) -head[head(Index: )plain(lib/coderay/scanners/scheme.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/scheme.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/scanners/scheme.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,142 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+) reserved(module) class(Scanners)] -insert[insert(+)] -insert[insert(+) comment(# Scheme scanner for CodeRay (by closure\).)] -insert[insert(+) comment(# Thanks to murphy for putting CodeRay into public.)] -insert[insert(+) reserved(class) class(Scheme) operator(<) constant(Scanner)] -insert[insert(+) ] -insert[insert(+) ident(register_for) symbol(:scheme)] -insert[insert(+) ident(file_extension) symbol(:scm)] -insert[insert(+)] -insert[insert(+) constant(CORE_FORMS) operator(=) string<delimiter(%w[)>] -insert[insert(+) ident(lambda) ident(let) ident(let)operator(*) ident(letrec) ident(syntax)operator(-)reserved(case) ident(define)operator(-)ident(syntax) ident(let)operator(-)ident(syntax)] -insert[insert(+) ident(letrec)operator(-)ident(syntax) reserved(begin) ident(define) ident(quote) reserved(if) reserved(or) reserved(and) ident(cond) reserved(case) reserved(do) ident(delay)] -insert[insert(+) ident(quasiquote) ident(set!) ident(cons) ident(force) ident(call)operator(-)ident(with)operator(-)ident(current)operator(-)ident(continuation) ident(call)operator(/)ident(cc)] -insert[insert(+) operator(])] -insert[insert(+)] -insert[insert(+) constant(IDENT_KIND) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()symbol(:ident)operator(\))operator(.)] -insert[insert(+) ident(add)operator(()constant(CORE_FORMS)operator(,) symbol(:reserved)operator(\))] -insert[insert(+) ] -insert[insert(+) comment(#IDENTIFIER_INITIAL = /[a-z!@\\$%&\\*\\/\\:<=>\\?~_\\^]/i)] -insert[insert(+) comment(#IDENTIFIER_SUBSEQUENT = /#{IDENTIFIER_INITIAL}|\\d|\\.|\\+|-/)] -insert[insert(+) comment(#IDENTIFIER = /#{IDENTIFIER_INITIAL}#{IDENTIFIER_SUBSEQUENT}*|\\+|-|\\.{3}/)] -insert[insert(+) constant(IDENTIFIER) operator(=) regexp<delimiter(/)content([a-zA-Z!@$%&*)char(\\/)content(:<=>?~_^][)char(\\w)content(!@$%&*)char(\\/)content(:<=>?~^.+)char(\\-)content(]*|[+-]|)char(\\.)char(\\.)char(\\.)delimiter(/)>] -insert[insert(+) constant(DIGIT) operator(=) regexp<delimiter(/)char(\\d)delimiter(/)>] -insert[insert(+) constant(DIGIT10) operator(=) constant(DIGIT)] -insert[insert(+) constant(DIGIT16) operator(=) regexp<delimiter(/)content([0-9a-f])delimiter(/)modifier(i)>] -insert[insert(+) constant(DIGIT8) operator(=) regexp<delimiter(/)content([0-7])delimiter(/)>] -insert[insert(+) constant(DIGIT2) operator(=) regexp<delimiter(/)content([01])delimiter(/)>] -insert[insert(+) constant(RADIX16) operator(=) regexp<delimiter(/)char(\\#)content(x)delimiter(/)modifier(i)>] -insert[insert(+) constant(RADIX8) operator(=) regexp<delimiter(/)char(\\#)content(o)delimiter(/)modifier(i)>] -insert[insert(+) constant(RADIX2) operator(=) regexp<delimiter(/)char(\\#)content(b)delimiter(/)modifier(i)>] -insert[insert(+) constant(RADIX10) operator(=) regexp<delimiter(/)char(\\#)content(d)delimiter(/)modifier(i)>] -insert[insert(+) constant(EXACTNESS) operator(=) regexp<delimiter(/)content(#i|#e)delimiter(/)modifier(i)>] -insert[insert(+) constant(SIGN) operator(=) regexp<delimiter(/)content([)char(\\+)content(-]?)delimiter(/)>] -insert[insert(+) constant(EXP_MARK) operator(=) regexp<delimiter(/)content([esfdl])delimiter(/)modifier(i)>] -insert[insert(+) constant(EXP) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(EXP_MARK)inline_delimiter(})>inline<inline_delimiter(#{)constant(SIGN)inline_delimiter(})>inline<inline_delimiter(#{)constant(DIGIT)inline_delimiter(})>content(+)delimiter(/)>] -insert[insert(+) constant(SUFFIX) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(EXP)inline_delimiter(})>content(?)delimiter(/)>] -insert[insert(+) constant(PREFIX10) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(RADIX10)inline_delimiter(})>content(?)inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?|)inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?)inline<inline_delimiter(#{)constant(RADIX10)inline_delimiter(})>content(?)delimiter(/)>] -insert[insert(+) constant(PREFIX16) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(RADIX16)inline_delimiter(})>inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?|)inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?)inline<inline_delimiter(#{)constant(RADIX16)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(PREFIX8) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(RADIX8)inline_delimiter(})>inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?|)inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?)inline<inline_delimiter(#{)constant(RADIX8)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(PREFIX2) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(RADIX2)inline_delimiter(})>inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?|)inline<inline_delimiter(#{)constant(EXACTNESS)inline_delimiter(})>content(?)inline<inline_delimiter(#{)constant(RADIX2)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(UINT10) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(DIGIT10)inline_delimiter(})>content(+#*)delimiter(/)>] -insert[insert(+) constant(UINT16) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(DIGIT16)inline_delimiter(})>content(+#*)delimiter(/)>] -insert[insert(+) constant(UINT8) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(DIGIT8)inline_delimiter(})>content(+#*)delimiter(/)>] -insert[insert(+) constant(UINT2) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(DIGIT2)inline_delimiter(})>content(+#*)delimiter(/)>] -insert[insert(+) constant(DECIMAL) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(DIGIT10)inline_delimiter(})>content(+#+)char(\\.)content(#*)inline<inline_delimiter(#{)constant(SUFFIX)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(DIGIT10)inline_delimiter(})>content(+)char(\\.)inline<inline_delimiter(#{)constant(DIGIT10)inline_delimiter(})>content(*#*)inline<inline_delimiter(#{)constant(SUFFIX)inline_delimiter(})>content(|)char(\\.)inline<inline_delimiter(#{)constant(DIGIT10)inline_delimiter(})>content(+#*)inline<inline_delimiter(#{)constant(SUFFIX)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(UINT10)inline_delimiter(})>inline<inline_delimiter(#{)constant(EXP)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(UREAL10) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(UINT10)inline_delimiter(})>char(\\/)inline<inline_delimiter(#{)constant(UINT10)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(DECIMAL)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(UINT10)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(UREAL16) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(UINT16)inline_delimiter(})>char(\\/)inline<inline_delimiter(#{)constant(UINT16)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(UINT16)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(UREAL8) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(UINT8)inline_delimiter(})>char(\\/)inline<inline_delimiter(#{)constant(UINT8)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(UINT8)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(UREAL2) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(UINT2)inline_delimiter(})>char(\\/)inline<inline_delimiter(#{)constant(UINT2)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(UINT2)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(REAL10) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(SIGN)inline_delimiter(})>inline<inline_delimiter(#{)constant(UREAL10)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(REAL16) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(SIGN)inline_delimiter(})>inline<inline_delimiter(#{)constant(UREAL16)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(REAL8) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(SIGN)inline_delimiter(})>inline<inline_delimiter(#{)constant(UREAL8)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(REAL2) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(SIGN)inline_delimiter(})>inline<inline_delimiter(#{)constant(UREAL2)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(IMAG10) operator(=) regexp<delimiter(/)content(i|)inline<inline_delimiter(#{)constant(UREAL10)inline_delimiter(})>content(i)delimiter(/)>] -insert[insert(+) constant(IMAG16) operator(=) regexp<delimiter(/)content(i|)inline<inline_delimiter(#{)constant(UREAL16)inline_delimiter(})>content(i)delimiter(/)>] -insert[insert(+) constant(IMAG8) operator(=) regexp<delimiter(/)content(i|)inline<inline_delimiter(#{)constant(UREAL8)inline_delimiter(})>content(i)delimiter(/)>] -insert[insert(+) constant(IMAG2) operator(=) regexp<delimiter(/)content(i|)inline<inline_delimiter(#{)constant(UREAL2)inline_delimiter(})>content(i)delimiter(/)>] -insert[insert(+) constant(COMPLEX10) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(REAL10)inline_delimiter(})>content(@)inline<inline_delimiter(#{)constant(REAL10)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL10)inline_delimiter(})>char(\\+)inline<inline_delimiter(#{)constant(IMAG10)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL10)inline_delimiter(})>content(-)inline<inline_delimiter(#{)constant(IMAG10)inline_delimiter(})>content(|)char(\\+)inline<inline_delimiter(#{)constant(IMAG10)inline_delimiter(})>content(|-)inline<inline_delimiter(#{)constant(IMAG10)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL10)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(COMPLEX16) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(REAL16)inline_delimiter(})>content(@)inline<inline_delimiter(#{)constant(REAL16)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL16)inline_delimiter(})>char(\\+)inline<inline_delimiter(#{)constant(IMAG16)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL16)inline_delimiter(})>content(-)inline<inline_delimiter(#{)constant(IMAG16)inline_delimiter(})>content(|)char(\\+)inline<inline_delimiter(#{)constant(IMAG16)inline_delimiter(})>content(|-)inline<inline_delimiter(#{)constant(IMAG16)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL16)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(COMPLEX8) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(REAL8)inline_delimiter(})>content(@)inline<inline_delimiter(#{)constant(REAL8)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL8)inline_delimiter(})>char(\\+)inline<inline_delimiter(#{)constant(IMAG8)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL8)inline_delimiter(})>content(-)inline<inline_delimiter(#{)constant(IMAG8)inline_delimiter(})>content(|)char(\\+)inline<inline_delimiter(#{)constant(IMAG8)inline_delimiter(})>content(|-)inline<inline_delimiter(#{)constant(IMAG8)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL8)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(COMPLEX2) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(REAL2)inline_delimiter(})>content(@)inline<inline_delimiter(#{)constant(REAL2)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL2)inline_delimiter(})>char(\\+)inline<inline_delimiter(#{)constant(IMAG2)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL2)inline_delimiter(})>content(-)inline<inline_delimiter(#{)constant(IMAG2)inline_delimiter(})>content(|)char(\\+)inline<inline_delimiter(#{)constant(IMAG2)inline_delimiter(})>content(|-)inline<inline_delimiter(#{)constant(IMAG2)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(REAL2)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(NUM10) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(PREFIX10)inline_delimiter(})>content(?)inline<inline_delimiter(#{)constant(COMPLEX10)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(NUM16) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(PREFIX16)inline_delimiter(})>inline<inline_delimiter(#{)constant(COMPLEX16)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(NUM8) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(PREFIX8)inline_delimiter(})>inline<inline_delimiter(#{)constant(COMPLEX8)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(NUM2) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(PREFIX2)inline_delimiter(})>inline<inline_delimiter(#{)constant(COMPLEX2)inline_delimiter(})>delimiter(/)>] -insert[insert(+) constant(NUM) operator(=) regexp<delimiter(/)inline<inline_delimiter(#{)constant(NUM10)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(NUM16)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(NUM8)inline_delimiter(})>content(|)inline<inline_delimiter(#{)constant(NUM2)inline_delimiter(})>delimiter(/)>] -insert[insert(+) ] -insert[insert(+) ident(private)] -insert[insert(+) reserved(def) method(scan_tokens) ident(tokens)operator(,)ident(options)] -insert[insert(+) ] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) ident(ident_kind) operator(=) constant(IDENT_KIND)] -insert[insert(+) ] -insert[insert(+) reserved(until) ident(eos?)] -insert[insert(+) ident(kind) operator(=) ident(match) operator(=) pre_constant(nil)] -insert[insert(+) ] -insert[insert(+) reserved(case) ident(state)] -insert[insert(+) reserved(when) symbol(:initial)] -insert[insert(+) reserved(if) ident(scan)operator(()regexp<delimiter(/)content( )char(\\s)content(+ | )char(\\\\)char(\\n)content( )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:space)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content([')char(\\()char(\\[)char(\\\))char(\\])content(]|#)char(\\()delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator_fat)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content(;.*)delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:comment)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content(#)char(\\\\)content((?:newline|space|.?\))delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:char)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content(#[ft])delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:pre_constant)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)constant(IDENTIFIER)inline_delimiter(})>delimiter(/)modifier(o)>operator(\))] -insert[insert(+) ident(kind) operator(=) ident(ident_kind)operator([)ident(matched)operator(])] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)char(\\.)delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content(")delimiter(/)>operator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:string)operator(])] -insert[insert(+) ident(state) operator(=) symbol(:string)] -insert[insert(+) ident(tokens) operator(<<) operator([)string<delimiter(')content(")delimiter(')>operator(,) symbol(:delimiter)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)constant(NUM)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) reserved(and) reserved(not) ident(matched)operator(.)ident(empty?)] -insert[insert(+) ident(kind) operator(=) symbol(:integer)] -insert[insert(+) reserved(elsif) ident(getch)] -insert[insert(+) ident(kind) operator(=) symbol(:error)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(when) symbol(:string)] -insert[insert(+) reserved(if) ident(scan)operator(()regexp<delimiter(/)content([^")char(\\\\)content(]+)delimiter(/)>operator(\)) reserved(or) ident(scan)operator(()regexp<delimiter(/)char(\\\\)content(.?)delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:content)] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content(")delimiter(/)>operator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)string<delimiter(')content(")delimiter(')>operator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:string)operator(])] -insert[insert(+) ident(state) operator(=) symbol(:initial)] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(else)] -insert[insert(+) ident(raise_inspect) string<delimiter(")content(else case )char(\\")content( reached; %p not handled.)delimiter(")> operator(%) ident(peek)operator(()integer(1)operator(\))operator(,)] -insert[insert(+) ident(tokens)operator(,) ident(state)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) reserved(else)] -insert[insert(+) ident(raise) string<delimiter(")content(else case reached)delimiter(")>] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(match) operator(||=) ident(matched)] -insert[insert(+) reserved(if) global_variable($DEBUG) reserved(and) reserved(not) ident(kind)] -insert[insert(+) ident(raise_inspect) string<delimiter(')content(Error token %p in line %d)delimiter(')> operator(%)] -insert[insert(+) operator([)operator([)ident(match)operator(,) ident(kind)operator(])operator(,) ident(line)operator(])operator(,) ident(tokens)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(raise_inspect) string<delimiter(')content(Empty token)delimiter(')>operator(,) ident(tokens)operator(,) ident(state) reserved(unless) ident(match)] -insert[insert(+) ] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) ] -insert[insert(+) reserved(end) comment(# until eos)] -insert[insert(+) ] -insert[insert(+) reserved(if) ident(state) operator(==) symbol(:string)] -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:string)operator(])] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(tokens)] -insert[insert(+) ] -insert[insert(+) reserved(end) comment(#scan_tokens)] -insert[insert(+) reserved(end) comment(#class)] -insert[insert(+) reserved(end) comment(#module scanners)] -insert[insert(+)reserved(end) comment(#module coderay)] -change[change(\\ )plain(No newline at end of file)] -head[head(Index: )plain(lib/coderay/scanners/delphi.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/delphi.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/delphi.rb)plain( (revision 250\))] -change[change(@@)plain( -29,13 +29,18 )change(@@)] - string<delimiter(')content(virtual)delimiter(')>operator(,) string<delimiter(')content(write)delimiter(')>operator(,) string<delimiter(')content(writeonly)delimiter(')> - operator(]) - -delete[delete(-) constant(IDENT_KIND) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()symbol(:ident)operator(\))operator(.)] -insert[insert(+) constant(IDENT_KIND) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()symbol(:ident)operator(,) ident(caching)operator(=)pre_constant(true)operator(\))operator(.)] - ident(add)operator(()constant(RESERVED_WORDS)operator(,) symbol(:reserved)operator(\))operator(.) - ident(add)operator(()constant(DIRECTIVES)operator(,) symbol(:directive)operator(\)) -insert[insert(+) ] -insert[insert(+) constant(NAME_FOLLOWS) operator(=) constant(CaseIgnoringWordList)operator(.)ident(new)operator(()pre_constant(false)operator(,) ident(caching)operator(=)pre_constant(true)operator(\))operator(.)] -insert[insert(+) ident(add)operator(()string<delimiter(%w()content(procedure function .)delimiter(\))>operator(\))] - -insert[insert(+) ident(private)] - reserved(def) method(scan_tokens) ident(tokens)operator(,) ident(options) - - ident(state) operator(=) symbol(:initial) -insert[insert(+) ident(last_token) operator(=) string<delimiter(')delimiter(')>] - - reserved(until) ident(eos?) - -change[change(@@)plain( -45,19 +50,29 )change(@@)] - reserved(if) ident(state) operator(==) symbol(:initial) - - reserved(if) ident(scan)operator(()regexp<delimiter(/)content( )char(\\s)content(+ )delimiter(/)modifier(x)>operator(\)) -delete[delete(-) ident(kind) operator(=) symbol(:space)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:space)operator(])] -insert[insert(+) reserved(next)] - - reserved(elsif) ident(scan)operator(()regexp<delimiter(%r!)content( )char(\\{)content( )char(\\$)content( [^}]* )char(\\})content(? | )char(\\()char(\\*)content( )char(\\$)content( (?: .*? )char(\\*)char(\\\))content( | .* \) )delimiter(!)modifier(mx)>operator(\)) -delete[delete(-) ident(kind) operator(=) symbol(:preprocessor)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:preprocessor)operator(])] -insert[insert(+) reserved(next)] - - reserved(elsif) ident(scan)operator(()regexp<delimiter(%r!)content( // [^)char(\\n)content(]* | )char(\\{)content( [^}]* )char(\\})content(? | )char(\\()char(\\*)content( (?: .*? )char(\\*)char(\\\))content( | .* \) )delimiter(!)modifier(mx)>operator(\)) -delete[delete(-) ident(kind) operator(=) symbol(:comment)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:comment)operator(])] -insert[insert(+) reserved(next)] - -delete[delete(-) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content( [-+*)char(\\/)content(=<>:;,.@)char(\\^)content(|)char(\\()char(\\\))char(\\[)char(\\])content(]+ )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( <[>=]? | >=? | :=? | [-+=*)char(\\/)content(;,@)char(\\^)content(|)char(\\()char(\\\))char(\\[)char(\\])content(] | )char(\\.)char(\\.)content( )delimiter(/)modifier(x)>operator(\))] - ident(kind) operator(=) symbol(:operator) -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)char(\\.)delimiter(/)>operator(\))] -insert[insert(+) ident(kind) operator(=) symbol(:operator)] -insert[insert(+) reserved(if) ident(last_token) operator(==) string<delimiter(')content(end)delimiter(')>] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) reserved(end)] - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( [A-Za-z_][A-Za-z_0-9]* )delimiter(/)modifier(x)>operator(\)) -delete[delete(-) ident(kind) operator(=) constant(IDENT_KIND)operator([)ident(match)operator(])] -insert[insert(+) ident(kind) operator(=) constant(NAME_FOLLOWS)operator([)ident(last_token)operator(]) operator(?) symbol(:ident) operator(:) constant(IDENT_KIND)operator([)ident(match)operator(])] - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)content( ' ( [^)char(\\n)content(']|'' \) (?:'|$\) )delimiter(/)modifier(x)>operator(\)) - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:char)operator(]) -change[change(@@)plain( -101,6 +116,7 )change(@@)] - ident(state) operator(=) symbol(:initial) - reserved(next) - reserved(elsif) ident(scan)operator(()regexp<delimiter(/)char(\\n)delimiter(/)>operator(\)) -insert[insert(+) ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:string)operator(])] - ident(kind) operator(=) symbol(:error) - ident(state) operator(=) symbol(:initial) - reserved(else) -change[change(@@)plain( -119,6 +135,7 )change(@@)] - reserved(end) - ident(raise_inspect) string<delimiter(')content(Empty token)delimiter(')>operator(,) ident(tokens) reserved(unless) ident(match) - -insert[insert(+) ident(last_token) operator(=) ident(match)] - ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(]) - - reserved(end) -head[head(Index: )plain(lib/coderay/scanners/debug.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/debug.rb)plain( (revision 0\))] -head[head(+++ )filename(lib/coderay/scanners/debug.rb)plain( (revision 250\))] -change[change(@@)plain( -0,0 +1,60 )change(@@)] -insert[insert(+)reserved(module) class(CodeRay)] -insert[insert(+)reserved(module) class(Scanners)] -insert[insert(+)] -insert[insert(+) comment(# = Debug Scanner)] -insert[insert(+) reserved(class) class(Debug) operator(<) constant(Scanner)] -insert[insert(+)] -insert[insert(+) ident(include) constant(Streamable)] -insert[insert(+) ident(register_for) symbol(:debug)] -insert[insert(+)] -insert[insert(+) ident(protected)] -insert[insert(+) reserved(def) method(scan_tokens) ident(tokens)operator(,) ident(options)] -insert[insert(+)] -insert[insert(+) ident(opened_tokens) operator(=) operator([)operator(])] -insert[insert(+)] -insert[insert(+) reserved(until) ident(eos?)] -insert[insert(+)] -insert[insert(+) ident(kind) operator(=) pre_constant(nil)] -insert[insert(+) ident(match) operator(=) pre_constant(nil)] -insert[insert(+)] -insert[insert(+) reserved(if) ident(scan)operator(()regexp<delimiter(/)char(\\s)content(+)delimiter(/)>operator(\))] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(matched)operator(,) symbol(:space)operator(])] -insert[insert(+) reserved(next)] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content( ()char(\\w)content(+\) )char(\\()content( ( [^)char(\\\))char(\\\\)content(]* ( )char(\\\\)content(. [^)char(\\\))char(\\\\)content(]* \)* \) )char(\\\))content( )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) ident(kind) operator(=) pre_constant(self)operator([)integer(1)operator(])operator(.)ident(to_sym)] -insert[insert(+) ident(match) operator(=) pre_constant(self)operator([)integer(2)operator(])operator(.)ident(gsub)operator(()regexp<delimiter(/)char(\\\\)content((.\))delimiter(/)>operator(,) string<delimiter(')content(\\1)delimiter(')>operator(\))] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content( ()char(\\w)content(+\) < )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) ident(kind) operator(=) pre_constant(self)operator([)integer(1)operator(])operator(.)ident(to_sym)] -insert[insert(+) ident(opened_tokens) operator(<<) ident(kind)] -insert[insert(+) ident(match) operator(=) symbol(:open)] -insert[insert(+) ] -insert[insert(+) reserved(elsif) ident(scan)operator(()regexp<delimiter(/)content( > )delimiter(/)modifier(x)>operator(\))] -insert[insert(+) ident(kind) operator(=) ident(opened_tokens)operator(.)ident(pop)] -insert[insert(+) ident(match) operator(=) symbol(:close)] -insert[insert(+) ] -insert[insert(+) reserved(else)] -insert[insert(+) ident(kind) operator(=) symbol(:error)] -insert[insert(+) ident(getch)] -insert[insert(+)] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(match) operator(||=) ident(matched)] -insert[insert(+) reserved(if) global_variable($DEBUG) reserved(and) reserved(not) ident(kind)] -insert[insert(+) ident(raise_inspect) string<delimiter(')content(Error token %p in line %d)delimiter(')> operator(%)] -insert[insert(+) operator([)operator([)ident(match)operator(,) ident(kind)operator(])operator(,) ident(line)operator(])operator(,) ident(tokens)] -insert[insert(+) reserved(end)] -insert[insert(+) ident(raise_inspect) string<delimiter(')content(Empty token)delimiter(')>operator(,) ident(tokens) reserved(unless) ident(match)] -insert[insert(+)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(match)operator(,) ident(kind)operator(])] -insert[insert(+) ] -insert[insert(+) reserved(end)] -insert[insert(+) ] -insert[insert(+) ident(tokens)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+) reserved(end)] -insert[insert(+)] -insert[insert(+)reserved(end)] -insert[insert(+)reserved(end)] -head[head(Index: )plain(lib/coderay/scanners/rhtml.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/rhtml.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/rhtml.rb)plain( (revision 250\))] -change[change(@@)plain( -51,10 +51,10 )change(@@)] - ident(start_tag) operator(=) ident(match)operator([)regexp<delimiter(/)char(\\A)content(<%[-=]?)delimiter(/)>operator(]) - ident(end_tag) operator(=) ident(match)operator([)regexp<delimiter(/)content(-?%?>?)char(\\z)delimiter(/)>operator(]) - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:inline_delimiter)operator(])] - ident(code) operator(=) ident(match)operator([)ident(start_tag)operator(.)ident(size) operator(..) integer(-1) operator(-) ident(end_tag)operator(.)ident(size)operator(]) - instance_variable(@ruby_scanner)operator(.)ident(tokenize) ident(code) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:inline_delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] - ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:inline)operator(]) - - reserved(else) -head[head(Index: )plain(lib/coderay/scanners/nitro_xhtml.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/nitro_xhtml.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/nitro_xhtml.rb)plain( (revision 250\))] -change[change(@@)plain( -95,20 +95,20 )change(@@)] - ident(delimiter) operator(=) constant(CLOSING_PAREN)operator([)ident(start_tag)operator([)integer(1)operator(,)integer(1)operator(])operator(]) - ident(end_tag) operator(=) ident(match)operator([)integer(-1)operator(,)integer(1)operator(]) operator(==) ident(delimiter) operator(?) ident(delimiter) operator(:) string<delimiter(')delimiter(')> - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:inline_delimiter)operator(])] - ident(code) operator(=) ident(match)operator([)ident(start_tag)operator(.)ident(size) operator(..) integer(-1) operator(-) ident(end_tag)operator(.)ident(size)operator(]) - instance_variable(@ruby_scanner)operator(.)ident(tokenize) ident(code) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:inline_delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] - ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:inline)operator(]) - - reserved(elsif) ident(match) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)constant(NITRO_RUBY_BLOCK)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) - ident(start_tag) operator(=) string<delimiter(')content(<?r)delimiter(')> - ident(end_tag) operator(=) ident(match)operator([)integer(-2)operator(,)integer(2)operator(]) operator(==) string<delimiter(')content(?>)delimiter(')> operator(?) string<delimiter(')content(?>)delimiter(')> operator(:) string<delimiter(')delimiter(')> - ident(tokens) operator(<<) operator([)symbol(:open)operator(,) symbol(:inline)operator(]) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:delimiter)operator(])] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(start_tag)operator(,) symbol(:inline_delimiter)operator(])] - ident(code) operator(=) ident(match)operator([)ident(start_tag)operator(.)ident(size) operator(..) operator(-)operator(()ident(end_tag)operator(.)ident(size)operator(\))operator(-)integer(1)operator(]) - instance_variable(@ruby_scanner)operator(.)ident(tokenize) ident(code) -delete[delete(-) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] -insert[insert(+) ident(tokens) operator(<<) operator([)ident(end_tag)operator(,) symbol(:inline_delimiter)operator(]) reserved(unless) ident(end_tag)operator(.)ident(empty?)] - ident(tokens) operator(<<) operator([)symbol(:close)operator(,) symbol(:inline)operator(]) - - reserved(elsif) ident(entity) operator(=) ident(scan)operator(()regexp<delimiter(/)inline<inline_delimiter(#{)constant(NITRO_ENTITY)inline_delimiter(})>delimiter(/)modifier(o)>operator(\)) -head[head(Index: )plain(lib/coderay/scanners/plaintext.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay/scanners/plaintext.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay/scanners/plaintext.rb)plain( (revision 250\))] -change[change(@@)plain( -4,6 +4,8 )change(@@)] - reserved(class) class(Plaintext) operator(<) constant(Scanner) - - ident(register_for) symbol(:plaintext)operator(,) symbol(:plain) -insert[insert(+) ] -insert[insert(+) ident(include) constant(Streamable)] - - reserved(def) method(scan_tokens) ident(tokens)operator(,) ident(options) - ident(text) operator(=) operator(()ident(scan_until)operator(()regexp<delimiter(/)char(\\z)delimiter(/)>operator(\)) operator(||) string<delimiter(')delimiter(')>operator(\)) -head[head(Index: )plain(lib/coderay.rb)] -head[head(===================================================================)filename()] -head[head(--- )filename(lib/coderay.rb)plain( (revision 200\))] -head[head(+++ )filename(lib/coderay.rb)plain( (revision 250\))] -change[change(@@)plain( -24,8 +24,8 )change(@@)] - comment(#) - comment(# == Usage) - comment(#) -delete[delete(-)comment(# Remember you need RubyGems to use CodeRay. Run Ruby with -rubygems option)] -delete[delete(-)comment(# if required.)] -insert[insert(+)comment(# Remember you need RubyGems to use CodeRay, unless you have it in your load path. Run Ruby with)] -insert[insert(+)comment(# -rubygems option if required.)] - comment(#) - comment(# === Highlight Ruby code in a string as html) - comment(# ) -change[change(@@)plain( -44,19 +44,15 )change(@@)] - comment(# ) - comment(# You can include this div in your page. The used CSS styles can be printed with) - comment(# ) -delete[delete(-)comment(# % ruby -rcoderay -e "print CodeRay::Encoders[:html]::CSS")] -insert[insert(+)comment(# % coderay_stylesheet)] - comment(# ) - comment(# === Highlight without typing too much) -delete[delete(-)comment(#)] -insert[insert(+)comment(# )] - comment(# If you are one of the hasty (or lazy, or extremely curious\) people, just run this file:) -delete[delete(-)comment(#)] -delete[delete(-)comment(# % ruby -rubygems coderay.rb)] - comment(# ) -delete[delete(-)comment(# If the output was to fast for you, try)] -insert[insert(+)comment(# % ruby -rubygems /path/to/coderay/coderay.rb > example.html)] - comment(# ) -delete[delete(-)comment(# % ruby -rubygems coderay.rb > example.html)] -delete[delete(-)comment(#)] -delete[delete(-)comment(# and look at the file it created.)] -insert[insert(+)comment(# and look at the file it created in your browser.)] - comment(# ) - comment(# = CodeRay Module) - comment(#) -change[change(@@)plain( -111,7 +107,7 )change(@@)] - comment(#) - comment(# CodeRay.scan_stream:: Scan in stream mode.) - comment(#) -delete[delete(-)comment(# == All-in-One Encoding)] -insert[insert(+)comment(# == All-in-One Encoding)] - comment(#) - comment(# CodeRay.encode:: Highlight a string with a given input and output format.) - comment(#) -change[change(@@)plain( -121,11 +117,16 )change(@@)] - comment(# for this Encoder must only be done once.) - comment(#) - comment(# CodeRay.encoder:: Create an Encoder instance with format and options.) -insert[insert(+)comment(# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code.)] - comment(#) -delete[delete(-)comment(# There is no CodeRay.scanner method because Scanners are bound to an input string)] -delete[delete(-)comment(# on creation; you can't re-use them with another string.)] -insert[insert(+)comment(# To make use of CodeRay.scanner, use CodeRay::Scanner::code=.)] - comment(#) -delete[delete(-)comment(# The scanning methods provide more flexibility; we recommend to use these.)] -insert[insert(+)comment(# The scanning methods provide more flexibility; we recommend to use these.)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# == Reusing Scanners and Encoders)] -insert[insert(+)comment(# )] -insert[insert(+)comment(# If you want to re-use scanners and encoders (because that is faster\), see)] -insert[insert(+)comment(# CodeRay::Duo for the most convenient (and recommended\) interface.)] - reserved(module) class(CodeRay) - - comment(# Version: Major.Minor.Teeny[.Revision]) -change[change(@@)plain( -133,7 +134,7 )change(@@)] - comment(# Minor: odd for beta, even for stable) - comment(# Teeny: development state) - comment(# Revision: Subversion Revision number (generated on rake\)) -delete[delete(-) constant(VERSION) operator(=) string<delimiter(')content(0.7.4)delimiter(')>] -insert[insert(+) constant(VERSION) operator(=) string<delimiter(')content(0.7.9)delimiter(')>] - - ident(require) string<delimiter(')content(coderay/tokens)delimiter(')> - ident(require) string<delimiter(')content(coderay/scanner)delimiter(')> -change[change(@@)plain( -170,7 +171,7 )change(@@)] - reserved(def) method(scan_file) ident(filename)operator(,) ident(lang) operator(=) symbol(:auto)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(block) - ident(file) operator(=) constant(IO)operator(.)ident(read) ident(filename) - reserved(if) ident(lang) operator(==) symbol(:auto) -delete[delete(-) ident(require) string<delimiter(')content(coderay/helpers/filetype)delimiter(')>] -insert[insert(+) ident(require) string<delimiter(')content(coderay/helpers/file_type)delimiter(')>] - ident(lang) operator(=) constant(FileType)operator(.)ident(fetch) ident(filename)operator(,) symbol(:plaintext)operator(,) pre_constant(true) - reserved(end) - ident(scan) ident(file)operator(,) ident(lang)operator(,) ident(options) operator(=) operator({)operator(})operator(,) operator(&)ident(block) -change[change(@@)plain( -314,6 +315,7 )change(@@)] - comment(# Run a test script.) - reserved(if) global_variable($0) operator(==) pre_constant(__FILE__) - global_variable($stderr)operator(.)ident(print) string<delimiter(')content(Press key to print demo.)delimiter(')>operator(;) ident(gets) -delete[delete(-) ident(code) operator(=) constant(File)operator(.)ident(read)operator(()global_variable($0)operator(\))operator([)regexp<delimiter(/)content(module CodeRay.*)delimiter(/)modifier(m)>operator(])] -insert[insert(+) comment(# Just use this file as an example of Ruby code.)] -insert[insert(+) ident(code) operator(=) constant(File)operator(.)ident(read)operator(()pre_constant(__FILE__)operator(\))operator([)regexp<delimiter(/)content(module CodeRay.*)delimiter(/)modifier(m)>operator(])] - ident(print) constant(CodeRay)operator(.)ident(scan)operator(()ident(code)operator(,) symbol(:ruby)operator(\))operator(.)ident(html) - reserved(end) - -head[head(Property changes on: )plain(lib)] -head[head(___________________________________________________________________)filename()] -head[head(Added: )plain(svn:externals)] -insert[insert( +)plain( term http://term-ansicolor.rubyforge.org/svn/trunk/lib/term/)] - - diff --git a/test/scanners/diff/coderay200vs250.in.diff b/test/scanners/diff/coderay200vs250.in.diff deleted file mode 100644 index f7b99ca..0000000 --- a/test/scanners/diff/coderay200vs250.in.diff +++ /dev/null @@ -1,2241 +0,0 @@ -Index: lib/coderay/token_classes.rb -=================================================================== ---- lib/coderay/token_classes.rb (revision 0) -+++ lib/coderay/token_classes.rb (revision 250) -@@ -0,0 +1,71 @@ -+module CodeRay -+ class Tokens -+ ClassOfKind = Hash.new do |h, k| -+ h[k] = k.to_s -+ end -+ ClassOfKind.update with = { -+ :attribute_name => 'an', -+ :attribute_name_fat => 'af', -+ :attribute_value => 'av', -+ :attribute_value_fat => 'aw', -+ :bin => 'bi', -+ :char => 'ch', -+ :class => 'cl', -+ :class_variable => 'cv', -+ :color => 'cr', -+ :comment => 'c', -+ :constant => 'co', -+ :content => 'k', -+ :definition => 'df', -+ :delimiter => 'dl', -+ :directive => 'di', -+ :doc => 'do', -+ :doc_string => 'ds', -+ :entity => 'en', -+ :error => 'er', -+ :escape => 'e', -+ :exception => 'ex', -+ :float => 'fl', -+ :function => 'fu', -+ :global_variable => 'gv', -+ :hex => 'hx', -+ :include => 'ic', -+ :inline => 'il', -+ :inline_delimiter => 'idl', -+ :instance_variable => 'iv', -+ :integer => 'i', -+ :interpreted => 'in', -+ :label => 'la', -+ :local_variable => 'lv', -+ :modifier => 'mod', -+ :oct => 'oc', -+ :operator_fat => 'of', -+ :pre_constant => 'pc', -+ :pre_type => 'pt', -+ :predefined => 'pd', -+ :preprocessor => 'pp', -+ :regexp => 'rx', -+ :reserved => 'r', -+ :shell => 'sh', -+ :string => 's', -+ :symbol => 'sy', -+ :tag => 'ta', -+ :tag_fat => 'tf', -+ :tag_special => 'ts', -+ :type => 'ty', -+ :variable => 'v', -+ :xml_text => 'xt', -+ -+ :ident => :NO_HIGHLIGHT, # 'id' -+ #:operator => 'op', -+ :operator => :NO_HIGHLIGHT, # 'op' -+ :space => :NO_HIGHLIGHT, # 'sp' -+ :plain => :NO_HIGHLIGHT, -+ } -+ ClassOfKind[:procedure] = ClassOfKind[:method] = ClassOfKind[:function] -+ ClassOfKind[:open] = ClassOfKind[:close] = ClassOfKind[:delimiter] -+ ClassOfKind[:nesting_delimiter] = ClassOfKind[:delimiter] -+ ClassOfKind[:escape] = ClassOfKind[:delimiter] -+ #ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!' -+ end -+end -\ No newline at end of file - -Property changes on: lib/coderay/token_classes.rb -___________________________________________________________________ -Added: svn:executable - + * - -Index: lib/coderay/encoder.rb -=================================================================== ---- lib/coderay/encoder.rb (revision 200) -+++ lib/coderay/encoder.rb (revision 250) -@@ -1,3 +1,5 @@ -+require "stringio" -+ - module CodeRay - - # This module holds the Encoder class and its subclasses. -@@ -40,7 +42,7 @@ - # downcase class name instead. - def const_missing sym - if sym == :FILE_EXTENSION -- sym.to_s.downcase -+ plugin_id - else - super - end -@@ -130,13 +132,15 @@ - # By default, it calls text_token or block_token, depending on - # whether +text+ is a String. - def token text, kind -- if text.instance_of? ::String # Ruby 1.9: :open.is_a? String -- text_token text, kind -- elsif text.is_a? ::Symbol -- block_token text, kind -- else -- raise 'Unknown token text type: %p' % text -- end -+ out = -+ if text.is_a? ::String # Ruby 1.9: :open.is_a? String -+ text_token text, kind -+ elsif text.is_a? ::Symbol -+ block_token text, kind -+ else -+ raise 'Unknown token text type: %p' % text -+ end -+ @out << out if defined?(@out) && @out - end - - def text_token text, kind -@@ -164,7 +168,8 @@ - # The already created +tokens+ object must be used; it can be a - # TokenStream or a Tokens object. - def compile tokens, options -- tokens.each(&self) -+ tokens.each { |text, kind| token text, kind } # FIXME for Ruby 1.9? -+ #tokens.each(&self) - end - - end -Index: lib/coderay/encoders/xml.rb -=================================================================== ---- lib/coderay/encoders/xml.rb (revision 200) -+++ lib/coderay/encoders/xml.rb (revision 250) -@@ -22,7 +22,6 @@ - protected - - def setup options -- @out = '' - @doc = REXML::Document.new - @doc << REXML::XMLDecl.new - @tab_width = options[:tab_width] -@@ -33,7 +32,7 @@ - @doc.write @out, options[:pretty], options[:transitive], true - @out - end -- -+ - def text_token text, kind - if kind == :space - token = @node -Index: lib/coderay/encoders/html/classes.rb -=================================================================== ---- lib/coderay/encoders/html/classes.rb (revision 200) -+++ lib/coderay/encoders/html/classes.rb (revision 250) -@@ -1,77 +0,0 @@ --module CodeRay --module Encoders -- -- class HTML -- -- ClassOfKind = Hash.new do |h, k| -- h[k] = k.to_s -- end -- ClassOfKind.update with = { -- :attribute_name => 'an', -- :attribute_name_fat => 'af', -- :attribute_value => 'av', -- :attribute_value_fat => 'aw', -- :bin => 'bi', -- :char => 'ch', -- :class => 'cl', -- :class_variable => 'cv', -- :color => 'cr', -- :comment => 'c', -- :constant => 'co', -- :content => 'k', -- :definition => 'df', -- :delimiter => 'dl', -- :directive => 'di', -- :doc => 'do', -- :doc_string => 'ds', -- :entity => 'en', -- :error => 'er', -- :escape => 'e', -- :exception => 'ex', -- :float => 'fl', -- :function => 'fu', -- :global_variable => 'gv', -- :hex => 'hx', -- :include => 'ic', -- :inline => 'il', -- :inline_delimiter => 'idl', -- :instance_variable => 'iv', -- :integer => 'i', -- :interpreted => 'in', -- :label => 'la', -- :local_variable => 'lv', -- :modifier => 'mod', -- :oct => 'oc', -- :operator_name => 'on', -- :pre_constant => 'pc', -- :pre_type => 'pt', -- :predefined => 'pd', -- :preprocessor => 'pp', -- :regexp => 'rx', -- :reserved => 'r', -- :shell => 'sh', -- :string => 's', -- :symbol => 'sy', -- :tag => 'ta', -- :tag_fat => 'tf', -- :tag_special => 'ts', -- :type => 'ty', -- :variable => 'v', -- :xml_text => 'xt', -- -- :ident => :NO_HIGHLIGHT, # 'id' -- #:operator => 'op', -- :operator => :NO_HIGHLIGHT, # 'op' -- :space => :NO_HIGHLIGHT, # 'sp' -- :plain => :NO_HIGHLIGHT, -- } -- ClassOfKind[:procedure] = ClassOfKind[:method] = ClassOfKind[:function] -- ClassOfKind[:open] = ClassOfKind[:close] = ClassOfKind[:delimiter] -- ClassOfKind[:nesting_delimiter] = ClassOfKind[:delimiter] -- ClassOfKind[:escape] = ClassOfKind[:delimiter] -- #ClassOfKind.default = ClassOfKind[:error] or raise 'no class found for :error!' -- -- end -- --end --end -Index: lib/coderay/encoders/html/numerization.rb -=================================================================== ---- lib/coderay/encoders/html/numerization.rb (revision 200) -+++ lib/coderay/encoders/html/numerization.rb (revision 250) -@@ -51,12 +51,12 @@ - case mode - when :inline - max_width = (start + line_count).to_s.size -- line = start -+ line_number = start - gsub!(/^/) do -- line_number = bolding.call line -- indent = ' ' * (max_width - line.to_s.size) -- res = "<span class=\"no\">#{indent}#{line_number}</span> " -- line += 1 -+ line_number_text = bolding.call line_number -+ indent = ' ' * (max_width - line_number.to_s.size) # TODO: Optimize (10^x) -+ res = "<span class=\"no\">#{indent}#{line_number_text}</span> " -+ line_number += 1 - res - end - -Index: lib/coderay/encoders/tokens.rb -=================================================================== ---- lib/coderay/encoders/tokens.rb (revision 200) -+++ lib/coderay/encoders/tokens.rb (revision 250) -@@ -33,9 +33,9 @@ - - FILE_EXTENSION = 'tok' - -- protected -- def token *args -- @out << CodeRay::Tokens.write_token(*args) -+ protected -+ def token text, kind -+ @out << CodeRay::Tokens.write_token(text, kind) - end - - end -Index: lib/coderay/encoders/html.rb -=================================================================== ---- lib/coderay/encoders/html.rb (revision 200) -+++ lib/coderay/encoders/html.rb (revision 250) -@@ -1,3 +1,5 @@ -+require "set" -+ - module CodeRay - module Encoders - -@@ -10,7 +12,8 @@ - # - # require 'coderay' - # puts CodeRay.scan('Some /code/', :ruby).html #-> a HTML page -- # puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span) #-> <span class="CodeRay"><span class="co">Some</span> /code/</span> -+ # puts CodeRay.scan('Some /code/', :ruby).html(:wrap => :span) -+ # #-> <span class="CodeRay"><span class="co">Some</span> /code/</span> - # puts CodeRay.scan('Some /code/', :ruby).span #-> the same - # - # puts CodeRay.scan('Some code', :ruby).html( -@@ -55,7 +58,8 @@ - # - # === :hint - # Include some information into the output using the title attribute. -- # Can be :info (show token type on mouse-over), :info_long (with full path) or :debug (via inspect). -+ # Can be :info (show token type on mouse-over), :info_long (with full path) -+ # or :debug (via inspect). - # - # Default: false - class HTML < Encoder -@@ -82,7 +86,7 @@ - :hint => false, - } - -- helper :classes, :output, :css -+ helper :output, :css - - attr_reader :css - -@@ -115,11 +119,14 @@ - end - } - -+ TRANSPARENT_TOKEN_KINDS = [ -+ :delimiter, :modifier, :content, :escape, :inline_delimiter, -+ ].to_set -+ - # Generate a hint about the given +classes+ in a +hint+ style. - # - # +hint+ may be :info, :info_long or :debug. - def self.token_path_to_hint hint, classes -- return '' unless hint - title = - case hint - when :info -@@ -129,7 +136,7 @@ - when :debug - classes.inspect - end -- " title=\"#{title}\"" -+ title ? " title=\"#{title}\"" : '' - end - - def setup options -@@ -143,42 +150,45 @@ - - hint = options[:hint] - if hint and not [:debug, :info, :info_long].include? hint -- raise ArgumentError, "Unknown value %p for :hint; expected :info, :debug, false or nil." % hint -+ raise ArgumentError, "Unknown value %p for :hint; \ -+ expected :info, :debug, false, or nil." % hint - end - - case options[:css] - - when :class - @css_style = Hash.new do |h, k| -- if k.is_a? Array -- type = k.first -- else -- type = k -- end -- c = ClassOfKind[type] -+ c = CodeRay::Tokens::ClassOfKind[k.first] - if c == :NO_HIGHLIGHT and not hint -- h[k] = false -+ h[k.dup] = false - else -- title = HTML.token_path_to_hint hint, (k[1..-1] << k.first) -- h[k] = '<span%s class="%s">' % [title, c] -+ title = if hint -+ HTML.token_path_to_hint(hint, k[1..-1] << k.first) -+ else -+ '' -+ end -+ if c == :NO_HIGHLIGHT -+ h[k.dup] = '<span%s>' % [title] -+ else -+ h[k.dup] = '<span%s class="%s">' % [title, c] -+ end - end - end - - when :style - @css_style = Hash.new do |h, k| -- if k.is_a? Array -+ if k.is_a? ::Array - styles = k.dup - else - styles = [k] - end - type = styles.first -- classes = styles.map { |c| ClassOfKind[c] } -+ classes = styles.map { |c| Tokens::ClassOfKind[c] } - if classes.first == :NO_HIGHLIGHT and not hint - h[k] = false - else -- styles.shift if [:delimiter, :modifier, :content, :escape].include? styles.first -+ styles.shift if TRANSPARENT_TOKEN_KINDS.include? styles.first - title = HTML.token_path_to_hint hint, styles -- classes.delete 'il' - style = @css[*classes] - h[k] = - if style -@@ -198,7 +208,9 @@ - def finish options - not_needed = @opened.shift - @out << '</span>' * @opened.size -- warn '%d tokens still open: %p' % [@opened.size, @opened] unless @opened.empty? -+ unless @opened.empty? -+ warn '%d tokens still open: %p' % [@opened.size, @opened] -+ end - - @out.extend Output - @out.css = @css -@@ -229,8 +241,9 @@ - if @opened.empty? - # nothing to close - else -- if @opened.size == 1 or @opened.last != type -- raise 'Malformed token stream: Trying to close a token (%p) that is not open. Open are: %p.' % [type, @opened[1..-1]] if $DEBUG -+ if $DEBUG and (@opened.size == 1 or @opened.last != type) -+ raise 'Malformed token stream: Trying to close a token (%p) \ -+ that is not open. Open are: %p.' % [type, @opened[1..-1]] - end - @out << '</span>' - @opened.pop -Index: lib/coderay/encoders/text.rb -=================================================================== ---- lib/coderay/encoders/text.rb (revision 200) -+++ lib/coderay/encoders/text.rb (revision 250) -@@ -14,13 +14,12 @@ - - protected - def setup options -- super -+ @out = '' - @sep = options[:separator] - end - - def token text, kind -- return unless text.respond_to? :to_str -- @out << text + @sep -+ @out << text + @sep if text.is_a? ::String - end - - def finish options -Index: lib/coderay/encoders/debug.rb -=================================================================== ---- lib/coderay/encoders/debug.rb (revision 200) -+++ lib/coderay/encoders/debug.rb (revision 250) -@@ -19,19 +19,14 @@ - - protected - def text_token text, kind -- @out << -- if kind == :space -- text -- else -- text = text.gsub(/[)\\]/, '\\\\\0') -- "#{kind}(#{text})" -- end -+ if kind == :space -+ text -+ else -+ text = text.gsub(/[)\\]/, '\\\\\0') # escape ) and \ -+ "#{kind}(#{text})" -+ end - end - -- def block_token action, kind -- @out << super -- end -- - def open_token kind - "#{kind}<" - end -Index: lib/coderay/encoders/statistic.rb -=================================================================== ---- lib/coderay/encoders/statistic.rb (revision 200) -+++ lib/coderay/encoders/statistic.rb (revision 250) -@@ -28,19 +28,15 @@ - @type_stats[kind].count += 1 - @type_stats[kind].size += text.size - @type_stats['TOTAL'].size += text.size -+ @type_stats['TOTAL'].count += 1 - end - - # TODO Hierarchy handling - def block_token action, kind -- #@content_type = kind -+ @type_stats['TOTAL'].count += 1 - @type_stats['open/close'].count += 1 - end - -- def token text, kind -- super -- @type_stats['TOTAL'].count += 1 -- end -- - STATS = <<-STATS - - Code Statistics -Index: lib/coderay/encoders/_map.rb -=================================================================== ---- lib/coderay/encoders/_map.rb (revision 200) -+++ lib/coderay/encoders/_map.rb (revision 250) -@@ -2,7 +2,8 @@ - module Encoders - - map :stats => :statistic, -- :plain => :text -+ :plain => :text, -+ :tex => :latex - - end - end -Index: lib/coderay/helpers/filetype.rb -=================================================================== ---- lib/coderay/helpers/filetype.rb (revision 200) -+++ lib/coderay/helpers/filetype.rb (revision 250) -@@ -1,180 +0,0 @@ --# =FileType --# --# A simple filetype recognizer --# --# Author: murphy (mail to murphy cYcnus de) --# --# Version: 0.1 (2005.september.1) --# --# == Documentation --# --# # determine the type of the given --# lang = FileType[ARGV.first] --# --# # return :plaintext if the file type is unknown --# lang = FileType.fetch ARGV.first, :plaintext --# --# # try the shebang line, too --# lang = FileType.fetch ARGV.first, :plaintext, true --module FileType -- -- UnknownFileType = Class.new Exception -- -- class << self -- -- # Try to determine the file type of the file. -- # -- # +filename+ is a relative or absolute path to a file. -- # -- # The file itself is only accessed when +read_shebang+ is set to true. -- # That means you can get filetypes from files that don't exist. -- def [] filename, read_shebang = false -- name = File.basename filename -- ext = File.extname name -- ext.sub!(/^\./, '') # delete the leading dot -- -- type = -- TypeFromExt[ext] || -- TypeFromExt[ext.downcase] || -- TypeFromName[name] || -- TypeFromName[name.downcase] -- type ||= shebang(filename) if read_shebang -- -- type -- end -- -- def shebang filename -- begin -- File.open filename, 'r' do |f| -- first_line = f.gets -- first_line[TypeFromShebang] -- end -- rescue IOError -- nil -- end -- end -- -- # This works like Hash#fetch. -- # -- # If the filetype cannot be found, the +default+ value -- # is returned. -- def fetch filename, default = nil, read_shebang = false -- if default and block_given? -- warn 'block supersedes default value argument' -- end -- -- unless type = self[filename, read_shebang] -- return yield if block_given? -- return default if default -- raise UnknownFileType, 'Could not determine type of %p.' % filename -- end -- type -- end -- -- end -- -- TypeFromExt = { -- 'rb' => :ruby, -- 'rbw' => :ruby, -- 'rake' => :ruby, -- 'cpp' => :c, -- 'c' => :c, -- 'h' => :c, -- 'xml' => :xml, -- 'htm' => :html, -- 'html' => :html, -- 'xhtml' => :xhtml, -- 'rhtml' => :rhtml, -- 'yaml' => :yaml, -- 'yml' => :yaml, -- } -- -- TypeFromShebang = /\b(?:ruby|perl|python|sh)\b/ -- -- TypeFromName = { -- 'Rakefile' => :ruby, -- 'Rantfile' => :ruby, -- } -- --end -- --if $0 == __FILE__ -- $VERBOSE = true -- eval DATA.read, nil, $0, __LINE__+4 --end -- --__END__ -- --require 'test/unit' -- --class TC_FileType < Test::Unit::TestCase -- -- def test_fetch -- assert_raise FileType::UnknownFileType do -- FileType.fetch '' -- end -- -- assert_throws :not_found do -- FileType.fetch '.' do -- throw :not_found -- end -- end -- -- assert_equal :default, FileType.fetch('c', :default) -- -- stderr, fake_stderr = $stderr, Object.new -- $err = '' -- def fake_stderr.write x -- $err << x -- end -- $stderr = fake_stderr -- FileType.fetch('c', :default) { } -- assert_equal "block supersedes default value argument\n", $err -- $stderr = stderr -- end -- -- def test_ruby -- assert_equal :ruby, FileType['test.rb'] -- assert_equal :ruby, FileType['C:\\Program Files\\x\\y\\c\\test.rbw'] -- assert_equal :ruby, FileType['/usr/bin/something/Rakefile'] -- assert_equal :ruby, FileType['~/myapp/gem/Rantfile'] -- assert_equal :ruby, FileType['./lib/tasks\repository.rake'] -- assert_not_equal :ruby, FileType['test_rb'] -- assert_not_equal :ruby, FileType['Makefile'] -- assert_not_equal :ruby, FileType['set.rb/set'] -- assert_not_equal :ruby, FileType['~/projects/blabla/rb'] -- end -- -- def test_c -- assert_equal :c, FileType['test.c'] -- assert_equal :c, FileType['C:\\Program Files\\x\\y\\c\\test.h'] -- assert_not_equal :c, FileType['test_c'] -- assert_not_equal :c, FileType['Makefile'] -- assert_not_equal :c, FileType['set.h/set'] -- assert_not_equal :c, FileType['~/projects/blabla/c'] -- end -- -- def test_html -- assert_equal :html, FileType['test.htm'] -- assert_equal :xhtml, FileType['test.xhtml'] -- assert_equal :xhtml, FileType['test.html.xhtml'] -- assert_equal :rhtml, FileType['_form.rhtml'] -- end -- -- def test_yaml -- assert_equal :yaml, FileType['test.yml'] -- assert_equal :yaml, FileType['test.yaml'] -- assert_equal :yaml, FileType['my.html.yaml'] -- assert_not_equal :yaml, FileType['YAML'] -- end -- -- def test_shebang -- dir = './test' -- if File.directory? dir -- Dir.chdir dir do -- assert_equal :c, FileType['test.c'] -- end -- end -- end -- --end -Index: lib/coderay/helpers/plugin.rb -=================================================================== ---- lib/coderay/helpers/plugin.rb (revision 200) -+++ lib/coderay/helpers/plugin.rb (revision 250) -@@ -1,3 +1,5 @@ -+module CodeRay -+ - # = PluginHost - # - # $Id$ -@@ -20,7 +22,7 @@ - # - # Generators[:fancy] #-> FancyGenerator - # # or --# require_plugin 'Generators/fancy' -+# CodeRay.require_plugin 'Generators/fancy' - module PluginHost - - # Raised if Encoders::[] fails because: -@@ -310,17 +312,18 @@ - - end - -- - # Convenience method for plugin loading. - # The syntax used is: - # --# require_plugin '<Host ID>/<Plugin ID>' -+# CodeRay.require_plugin '<Host ID>/<Plugin ID>' - # - # Returns the loaded plugin. --def require_plugin path -+def self.require_plugin path - host_id, plugin_id = path.split '/', 2 - host = PluginHost.host_by_id(host_id) - raise PluginHost::HostNotFound, - "No host for #{host_id.inspect} found." unless host - host.load plugin_id - end -+ -+end -\ No newline at end of file -Index: lib/coderay/helpers/file_type.rb -=================================================================== ---- lib/coderay/helpers/file_type.rb (revision 0) -+++ lib/coderay/helpers/file_type.rb (revision 250) -@@ -0,0 +1,210 @@ -+#!/usr/bin/env ruby -+module CodeRay -+ -+# = FileType -+# -+# A simple filetype recognizer. -+# -+# Copyright (c) 2006 by murphy (Kornelius Kalnbach) <murphy rubychan de> -+# -+# License:: LGPL / ask the author -+# Version:: 0.1 (2005-09-01) -+# -+# == Documentation -+# -+# # determine the type of the given -+# lang = FileType[ARGV.first] -+# -+# # return :plaintext if the file type is unknown -+# lang = FileType.fetch ARGV.first, :plaintext -+# -+# # try the shebang line, too -+# lang = FileType.fetch ARGV.first, :plaintext, true -+module FileType -+ -+ UnknownFileType = Class.new Exception -+ -+ class << self -+ -+ # Try to determine the file type of the file. -+ # -+ # +filename+ is a relative or absolute path to a file. -+ # -+ # The file itself is only accessed when +read_shebang+ is set to true. -+ # That means you can get filetypes from files that don't exist. -+ def [] filename, read_shebang = false -+ name = File.basename filename -+ ext = File.extname(name).sub(/^\./, '') # from last dot, delete the leading dot -+ ext2 = filename[/\.(.*)/, 1] # from first dot -+ -+ type = -+ TypeFromExt[ext.downcase] || -+ (TypeFromExt[ext2.downcase] if ext2) || -+ TypeFromName[name] || -+ TypeFromName[name.downcase] -+ type ||= shebang(filename) if read_shebang -+ -+ type -+ end -+ -+ def shebang filename -+ begin -+ File.open filename, 'r' do |f| -+ if first_line = f.gets -+ if type = first_line[TypeFromShebang] -+ type.to_sym -+ end -+ end -+ end -+ rescue IOError -+ nil -+ end -+ end -+ -+ # This works like Hash#fetch. -+ # -+ # If the filetype cannot be found, the +default+ value -+ # is returned. -+ def fetch filename, default = nil, read_shebang = false -+ if default and block_given? -+ warn 'block supersedes default value argument' -+ end -+ -+ unless type = self[filename, read_shebang] -+ return yield if block_given? -+ return default if default -+ raise UnknownFileType, 'Could not determine type of %p.' % filename -+ end -+ type -+ end -+ -+ end -+ -+ TypeFromExt = { -+ 'rb' => :ruby, -+ 'rbw' => :ruby, -+ 'rake' => :ruby, -+ 'mab' => :ruby, -+ 'cpp' => :c, -+ 'c' => :c, -+ 'h' => :c, -+ 'xml' => :xml, -+ 'htm' => :html, -+ 'html' => :html, -+ 'xhtml' => :xhtml, -+ 'raydebug' => :debug, -+ 'rhtml' => :rhtml, -+ 'html.erb' => :rhtml, -+ 'ss' => :scheme, -+ 'sch' => :scheme, -+ 'yaml' => :yaml, -+ 'yml' => :yaml, -+ } -+ -+ TypeFromShebang = /\b(?:ruby|perl|python|sh)\b/ -+ -+ TypeFromName = { -+ 'Rakefile' => :ruby, -+ 'Rantfile' => :ruby, -+ } -+ -+end -+ -+end -+ -+if $0 == __FILE__ -+ $VERBOSE = true -+ eval DATA.read, nil, $0, __LINE__+4 -+end -+ -+__END__ -+require 'test/unit' -+ -+class TC_FileType < Test::Unit::TestCase -+ -+ include CodeRay -+ -+ def test_fetch -+ assert_raise FileType::UnknownFileType do -+ FileType.fetch '' -+ end -+ -+ assert_throws :not_found do -+ FileType.fetch '.' do -+ throw :not_found -+ end -+ end -+ -+ assert_equal :default, FileType.fetch('c', :default) -+ -+ stderr, fake_stderr = $stderr, Object.new -+ $err = '' -+ def fake_stderr.write x -+ $err << x -+ end -+ $stderr = fake_stderr -+ FileType.fetch('c', :default) { } -+ assert_equal "block supersedes default value argument\n", $err -+ $stderr = stderr -+ end -+ -+ def test_ruby -+ assert_equal :ruby, FileType['test.rb'] -+ assert_equal :ruby, FileType['C:\\Program Files\\x\\y\\c\\test.rbw'] -+ assert_equal :ruby, FileType['/usr/bin/something/Rakefile'] -+ assert_equal :ruby, FileType['~/myapp/gem/Rantfile'] -+ assert_equal :ruby, FileType['./lib/tasks\repository.rake'] -+ assert_not_equal :ruby, FileType['test_rb'] -+ assert_not_equal :ruby, FileType['Makefile'] -+ assert_not_equal :ruby, FileType['set.rb/set'] -+ assert_not_equal :ruby, FileType['~/projects/blabla/rb'] -+ end -+ -+ def test_c -+ assert_equal :c, FileType['test.c'] -+ assert_equal :c, FileType['C:\\Program Files\\x\\y\\c\\test.h'] -+ assert_not_equal :c, FileType['test_c'] -+ assert_not_equal :c, FileType['Makefile'] -+ assert_not_equal :c, FileType['set.h/set'] -+ assert_not_equal :c, FileType['~/projects/blabla/c'] -+ end -+ -+ def test_html -+ assert_equal :html, FileType['test.htm'] -+ assert_equal :xhtml, FileType['test.xhtml'] -+ assert_equal :xhtml, FileType['test.html.xhtml'] -+ assert_equal :rhtml, FileType['_form.rhtml'] -+ assert_equal :rhtml, FileType['_form.html.erb'] -+ end -+ -+ def test_yaml -+ assert_equal :yaml, FileType['test.yml'] -+ assert_equal :yaml, FileType['test.yaml'] -+ assert_equal :yaml, FileType['my.html.yaml'] -+ assert_not_equal :yaml, FileType['YAML'] -+ end -+ -+ def test_no_shebang -+ dir = './test' -+ if File.directory? dir -+ Dir.chdir dir do -+ assert_equal :c, FileType['test.c'] -+ end -+ end -+ end -+ -+ def test_shebang_empty_file -+ require 'tmpdir' -+ tmpfile = File.join(Dir.tmpdir, 'bla') -+ File.open(tmpfile, 'w') { } # touch -+ assert_equal nil, FileType[tmpfile] -+ end -+ -+ def test_shebang -+ require 'tmpdir' -+ tmpfile = File.join(Dir.tmpdir, 'bla') -+ File.open(tmpfile, 'w') { |f| f.puts '#!/usr/bin/env ruby' } -+ assert_equal :ruby, FileType[tmpfile, true] -+ end -+ -+end - -Property changes on: lib/coderay/helpers/file_type.rb -___________________________________________________________________ -Added: svn:keywords - + Id Rev - -Index: lib/coderay/helpers/gzip_simple.rb -=================================================================== ---- lib/coderay/helpers/gzip_simple.rb (revision 200) -+++ lib/coderay/helpers/gzip_simple.rb (revision 250) -@@ -46,6 +46,7 @@ - end - end - -+ - # String extensions to use the GZip module. - # - # The methods gzip and gunzip provide an even more simple -Index: lib/coderay/helpers/word_list.rb -=================================================================== ---- lib/coderay/helpers/word_list.rb (revision 200) -+++ lib/coderay/helpers/word_list.rb (revision 250) -@@ -1,15 +1,19 @@ -+module CodeRay -+ - # = WordList -+# -+# <b>A Hash subclass designed for mapping word lists to token types.</b> -+# -+# Copyright (c) 2006 by murphy (Kornelius Kalnbach) <murphy rubychan de> - # --# Copyright (c) 2006 by murphy (Kornelius Kalnbach) <murphy cYcnus de> --# - # License:: LGPL / ask the author --# Version:: 1.0 (2006-Feb-3) -+# Version:: 1.1 (2006-Oct-19) - # - # A WordList is a Hash with some additional features. - # It is intended to be used for keyword recognition. - # - # WordList is highly optimized to be used in Scanners, --# typically to decide whether a given ident is a keyword. -+# typically to decide whether a given ident is a special token. - # - # For case insensitive words use CaseIgnoringWordList. - # -@@ -47,25 +51,30 @@ - # ... - class WordList < Hash - -- # Create a WordList for the given +words+. -- # -- # This WordList responds to [] with +true+, if the word is -- # in +words+, and with +false+ otherwise. -- def self.for words -- new.add words -- end -- - # Creates a new WordList with +default+ as default value. -- def initialize default = false, &block -- super default, &block -+ # -+ # You can activate +caching+ to store the results for every [] request. -+ # -+ # With caching, methods like +include?+ or +delete+ may no longer behave -+ # as you expect. Therefore, it is recommended to use the [] method only. -+ def initialize default = false, caching = false, &block -+ if block -+ raise ArgumentError, 'Can\'t combine block with caching.' if caching -+ super(&block) -+ else -+ if caching -+ super() do |h, k| -+ h[k] = h.fetch k, default -+ end -+ else -+ super default -+ end -+ end - end - -- # Checks if a word is included. -- def include? word -- has_key? word -- end -- - # Add words to the list and associate them with +kind+. -+ # -+ # Returns +self+, so you can concat add calls. - def add words, kind = true - words.each do |word| - self[word] = kind -@@ -78,24 +87,30 @@ - - # A CaseIgnoringWordList is like a WordList, only that - # keys are compared case-insensitively. -+# -+# Ignoring the text case is realized by sending the +downcase+ message to -+# all keys. -+# -+# Caching usually makes a CaseIgnoringWordList faster, but it has to be -+# activated explicitely. - class CaseIgnoringWordList < WordList - -- # Creates a new WordList with +default+ as default value. -- # -- # Text case is ignored. -- def initialize default = false, &block -- block ||= proc do |h, k| -- h[k] = h.fetch k.downcase, default -+ # Creates a new case-insensitive WordList with +default+ as default value. -+ # -+ # You can activate caching to store the results for every [] request. -+ def initialize default = false, caching = false -+ if caching -+ super(default, false) do |h, k| -+ h[k] = h.fetch k.downcase, default -+ end -+ else -+ def self.[] key # :nodoc: -+ super(key.downcase) -+ end - end -- super default - end - -- # Checks if a word is included. -- def include? word -- has_key? word.downcase -- end -- -- # Add words to the list and associate them with +kind+. -+ # Add +words+ to the list and associate them with +kind+. - def add words, kind = true - words.each do |word| - self[word.downcase] = kind -@@ -104,3 +119,5 @@ - end - - end -+ -+end -\ No newline at end of file -Index: lib/coderay/styles/cycnus.rb -=================================================================== ---- lib/coderay/styles/cycnus.rb (revision 200) -+++ lib/coderay/styles/cycnus.rb (revision 250) -@@ -42,12 +42,14 @@ - MAIN - - TOKEN_COLORS = <<-'TOKENS' -+.debug { color:white ! important; background:blue ! important; } -+ - .af { color:#00C } - .an { color:#007 } - .av { color:#700 } - .aw { color:#C00 } - .bi { color:#509; font-weight:bold } --.c { color:#888 } -+.c { color:#666; } - - .ch { color:#04D } - .ch .k { color:#04D } -@@ -83,7 +85,7 @@ - .la { color:#970; font-weight:bold } - .lv { color:#963 } - .oc { color:#40E; font-weight:bold } --.on { color:#000; font-weight:bold } -+.of { color:#000; font-weight:bold } - .op { } - .pc { color:#038; font-weight:bold } - .pd { color:#369; font-weight:bold } -Index: lib/coderay/styles/murphy.rb -=================================================================== ---- lib/coderay/styles/murphy.rb (revision 200) -+++ lib/coderay/styles/murphy.rb (revision 250) -@@ -47,7 +47,7 @@ - .av { color:#700; } - .aw { color:#C00; } - .bi { color:#509; font-weight:bold; } --.c { color:#666; } -+.c { color:#555; background-color: black; } - - .ch { color:#88F; } - .ch .k { color:#04D; } -@@ -77,7 +77,7 @@ - .la { color:#970; font-weight:bold; } - .lv { color:#963; } - .oc { color:#40E; font-weight:bold; } --.on { color:#000; font-weight:bold; } -+.of { color:#000; font-weight:bold; } - .op { } - .pc { color:#08f; font-weight:bold; } - .pd { color:#369; font-weight:bold; } -Index: lib/coderay/tokens.rb -=================================================================== ---- lib/coderay/tokens.rb (revision 200) -+++ lib/coderay/tokens.rb (revision 250) -@@ -115,7 +115,7 @@ - # tokens.each_text_token { |text, kind| text.replace html_escape(text) } - def each_text_token - each do |text, kind| -- next unless text.respond_to? :to_str -+ next unless text.is_a? ::String - yield text, kind - end - end -@@ -252,7 +252,7 @@ - # - # You can configure the level of compression, - # but the default value 7 should be what you want -- # in most cases as it is a good comprimise between -+ # in most cases as it is a good compromise between - # speed and compression rate. - # - # See GZip module. -@@ -267,9 +267,20 @@ - # Should be equal to the input size before - # scanning. - def text_size -- map { |t, k| t }.join.size -+ size = 0 -+ each_text_token do |t, k| -+ size + t.size -+ end -+ size - end - -+ # The total size of the tokens. -+ # Should be equal to the input size before -+ # scanning. -+ def text -+ map { |t, k| t if t.is_a? ::String }.join -+ end -+ - # Include this module to give an object an #undump - # method. - # -@@ -342,7 +353,7 @@ - # - # Returns self. - def << token -- @callback.call token -+ @callback.call(*token) - @size += 1 - self - end -@@ -365,4 +376,8 @@ - - end - -+ -+ # Token name abbreviations -+ require 'coderay/token_classes' -+ - end -Index: lib/coderay/duo.rb -=================================================================== ---- lib/coderay/duo.rb (revision 200) -+++ lib/coderay/duo.rb (revision 250) -@@ -4,26 +4,84 @@ - # - # $Id: scanner.rb 123 2006-03-21 14:46:34Z murphy $ - # -- # TODO: Doc. -+ # A Duo is a convenient way to use CodeRay. You just create a Duo, -+ # giving it a lang (language of the input code) and a format (desired -+ # output format), and call Duo#highlight with the code. -+ # -+ # Duo makes it easy to re-use both scanner and encoder for a repetitive -+ # task. It also provides a very easy interface syntax: -+ # -+ # require 'coderay' -+ # CodeRay::Duo[:python, :div].highlight 'import this' -+ # -+ # Until you want to do uncommon things with CodeRay, I recommend to use -+ # this method, since it takes care of everything. - class Duo - -- attr_accessor :scanner, :encoder -- -- def initialize lang, format, options = {} -- @scanner = CodeRay.scanner lang, CodeRay.get_scanner_options(options) -- @encoder = CodeRay.encoder format, options -+ attr_accessor :lang, :format, :options -+ -+ # Create a new Duo, holding a lang and a format to highlight code. -+ # -+ # simple: -+ # CodeRay::Duo[:ruby, :page].highlight 'bla 42' -+ # -+ # streaming: -+ # CodeRay::Duo[:ruby, :page].highlight 'bar 23', :stream => true -+ # -+ # with options: -+ # CodeRay::Duo[:ruby, :html, :hint => :debug].highlight '????::??' -+ # -+ # alternative syntax without options: -+ # CodeRay::Duo[:ruby => :statistic].encode 'class << self; end' -+ # -+ # alternative syntax with options: -+ # CodeRay::Duo[{ :ruby => :statistic }, :do => :something].encode 'abc' -+ # -+ # The options are forwarded to scanner and encoder -+ # (see CodeRay.get_scanner_options). -+ def initialize lang = nil, format = nil, options = {} -+ if format == nil and lang.is_a? Hash and lang.size == 1 -+ @lang = lang.keys.first -+ @format = lang[@lang] -+ else -+ @lang = lang -+ @format = format -+ end -+ @options = options - end - - class << self -+ # To allow calls like Duo[:ruby, :html].highlight. - alias [] new - end - -- def encode code -- @scanner.string = code -- @encoder.encode_tokens(scanner.tokenize) -+ # The scanner of the duo. Only created once. -+ def scanner -+ @scanner ||= CodeRay.scanner @lang, CodeRay.get_scanner_options(@options) - end -+ -+ # The encoder of the duo. Only created once. -+ def encoder -+ @encoder ||= CodeRay.encoder @format, @options -+ end -+ -+ # Tokenize and highlight the code using +scanner+ and +encoder+. -+ # -+ # If the :stream option is set, the Duo will go into streaming mode, -+ # saving memory for the cost of time. -+ def encode code, options = { :stream => false } -+ stream = options.delete :stream -+ options = @options.merge options -+ if stream -+ encoder.encode_stream(code, @lang, options) -+ else -+ scanner.code = code -+ encoder.encode_tokens(scanner.tokenize, options) -+ end -+ end - alias highlight encode - - end - - end -+ -Index: lib/coderay/scanner.rb -=================================================================== ---- lib/coderay/scanner.rb (revision 200) -+++ lib/coderay/scanner.rb (revision 250) -@@ -66,8 +66,18 @@ - end - - def normify code -- code = code.to_s.to_unix -+ code = code.to_s -+ code.force_encoding 'binary' if code.respond_to? :force_encoding -+ code.to_unix - end -+ -+ def file_extension extension = nil -+ if extension -+ @file_extension = extension.to_s -+ else -+ @file_extension ||= plugin_id.to_s -+ end -+ end - - end - -@@ -117,9 +127,6 @@ - setup - end - -- # More mnemonic accessor name for the input string. -- alias code string -- - def reset - super - reset_instance -@@ -131,6 +138,10 @@ - reset_instance - end - -+ # More mnemonic accessor name for the input string. -+ alias code string -+ alias code= string= -+ - # Scans the code and returns all tokens in a Tokens object. - def tokenize new_string=nil, options = {} - options = @options.merge(options) -@@ -148,6 +159,11 @@ - def tokens - @cached_tokens ||= tokenize - end -+ -+ # Whether the scanner is in streaming mode. -+ def streaming? -+ !!@options[:stream] -+ end - - # Traverses the tokens. - def each &block -@@ -195,7 +211,7 @@ - raise ScanError, <<-EOE % [ - - --***ERROR in %s: %s -+***ERROR in %s: %s (after %d tokens) - - tokens: - %s -@@ -211,13 +227,14 @@ - ***ERROR*** - - EOE -- File.basename(caller[0]), -- msg, -- tokens.last(10).map { |t| t.inspect }.join("\n"), -- line, pos, -- matched, state, bol?, eos?, -- string[pos-ambit,ambit], -- string[pos,ambit], -+ File.basename(caller[0]), -+ msg, -+ tokens.size, -+ tokens.last(10).map { |t| t.inspect }.join("\n"), -+ line, pos, -+ matched, state, bol?, eos?, -+ string[pos-ambit,ambit], -+ string[pos,ambit], - ] - end - -Index: lib/coderay/for_redcloth.rb -=================================================================== ---- lib/coderay/for_redcloth.rb (revision 0) -+++ lib/coderay/for_redcloth.rb (revision 250) -@@ -0,0 +1,72 @@ -+module CodeRay # :nodoc: -+ -+ # A little hack to enable CodeRay highlighting in RedCloth. -+ # -+ # Usage: -+ # require 'coderay' -+ # require 'coderay/for_redcloth' -+ # RedCloth.new('@[ruby]puts "Hello, World!"@').to_html -+ # -+ # Make sure you have RedCloth 4.0.3 activated, for example by calling -+ # require 'rubygems' -+ # before RedCloth is loaded and before calling CodeRay.for_redcloth. -+ module ForRedCloth -+ -+ def self.install -+ gem 'RedCloth', '>= 4.0.3' rescue nil -+ require 'redcloth' -+ raise 'CodeRay.for_redcloth needs RedCloth 4.0.3 or later.' unless RedCloth::VERSION.to_s >= '4.0.3' -+ RedCloth::TextileDoc.send :include, ForRedCloth::TextileDoc -+ RedCloth::Formatters::HTML.module_eval do -+ def unescape(html) -+ replacements = { -+ '&' => '&', -+ '"' => '"', -+ '>' => '>', -+ '<' => '<', -+ } -+ html.gsub(/&(?:amp|quot|[gl]t);/) { |entity| replacements[entity] } -+ end -+ undef_method :code, :bc_open, :bc_close, :escape_pre -+ def code(opts) # :nodoc: -+ opts[:block] = true -+ if opts[:lang] && !filter_coderay -+ require 'coderay' -+ @in_bc ||= nil -+ format = @in_bc ? :div : :span -+ highlighted_code = CodeRay.encode opts[:text], opts[:lang], format, :stream => true -+ highlighted_code.sub!(/\A<(span|div)/) { |m| m + pba(@in_bc || opts) } -+ highlighted_code = unescape(highlighted_code) unless @in_bc -+ highlighted_code -+ else -+ "<code#{pba(opts)}>#{opts[:text]}</code>" -+ end -+ end -+ def bc_open(opts) # :nodoc: -+ opts[:block] = true -+ @in_bc = opts -+ opts[:lang] ? '' : "<pre#{pba(opts)}>" -+ end -+ def bc_close(opts) # :nodoc: -+ @in_bc = nil -+ opts[:lang] ? '' : "</pre>\n" -+ end -+ def escape_pre(text) -+ if @in_bc ||= nil -+ text -+ else -+ html_esc(text, :html_escape_preformatted) -+ end -+ end -+ end -+ end -+ -+ module TextileDoc # :nodoc: -+ attr_accessor :filter_coderay -+ end -+ -+ end -+ -+end -+ -+CodeRay::ForRedCloth.install -\ No newline at end of file -Index: lib/coderay/scanners/ruby/patterns.rb -=================================================================== ---- lib/coderay/scanners/ruby/patterns.rb (revision 200) -+++ lib/coderay/scanners/ruby/patterns.rb (revision 250) -@@ -14,19 +14,14 @@ - - DEF_KEYWORDS = %w[ def ] - UNDEF_KEYWORDS = %w[ undef ] -+ ALIAS_KEYWORDS = %w[ alias ] - MODULE_KEYWORDS = %w[class module] - DEF_NEW_STATE = WordList.new(:initial). - add(DEF_KEYWORDS, :def_expected). - add(UNDEF_KEYWORDS, :undef_expected). -+ add(ALIAS_KEYWORDS, :alias_expected). - add(MODULE_KEYWORDS, :module_expected) - -- IDENTS_ALLOWING_REGEXP = %w[ -- and or not while until unless if then elsif when sub sub! gsub gsub! -- scan slice slice! split -- ] -- REGEXP_ALLOWED = WordList.new(false). -- add(IDENTS_ALLOWING_REGEXP, :set) -- - PREDEFINED_CONSTANTS = %w[ - nil true false self - DATA ARGV ARGF __FILE__ __LINE__ -@@ -41,19 +36,20 @@ - METHOD_NAME = / #{IDENT} [?!]? /ox - METHOD_NAME_OPERATOR = / - \*\*? # multiplication and power -- | [-+]@? # plus, minus -- | [\/%&|^`~] # division, modulo or format strings, &and, |or, ^xor, `system`, tilde -+ | [-+~]@? # plus, minus, tilde with and without @ -+ | [\/%&|^`] # division, modulo or format strings, &and, |or, ^xor, `system` - | \[\]=? # array getter and setter - | << | >> # append or shift left, shift right - | <=?>? | >=? # comparison, rocket operator -- | ===? # simple equality and case equality -+ | ===? | =~ # simple equality, case equality, match -+ | ![~=@]? # negation with and without @, not-equal and not-match - /ox - METHOD_NAME_EX = / #{IDENT} (?:[?!]|=(?!>))? | #{METHOD_NAME_OPERATOR} /ox - INSTANCE_VARIABLE = / @ #{IDENT} /ox - CLASS_VARIABLE = / @@ #{IDENT} /ox - OBJECT_VARIABLE = / @@? #{IDENT} /ox - GLOBAL_VARIABLE = / \$ (?: #{IDENT} | [1-9]\d* | 0\w* | [~&+`'=\/,;_.<>!@$?*":\\] | -[a-zA-Z_0-9] ) /ox -- PREFIX_VARIABLE = / #{GLOBAL_VARIABLE} |#{OBJECT_VARIABLE} /ox -+ PREFIX_VARIABLE = / #{GLOBAL_VARIABLE} | #{OBJECT_VARIABLE} /ox - VARIABLE = / @?@? #{IDENT} | #{GLOBAL_VARIABLE} /ox - - QUOTE_TO_TYPE = { -@@ -73,7 +69,7 @@ - EXPONENT = / [eE] [+-]? #{DECIMAL} /ox - FLOAT_SUFFIX = / #{EXPONENT} | \. #{DECIMAL} #{EXPONENT}? /ox - FLOAT_OR_INT = / #{DECIMAL} (?: #{FLOAT_SUFFIX} () )? /ox -- NUMERIC = / [-+]? (?: (?=0) (?: #{OCTAL} | #{HEXADECIMAL} | #{BINARY} ) | #{FLOAT_OR_INT} ) /ox -+ NUMERIC = / (?: (?=0) (?: #{OCTAL} | #{HEXADECIMAL} | #{BINARY} ) | #{FLOAT_OR_INT} ) /ox - - SYMBOL = / - : -@@ -83,6 +79,7 @@ - | ['"] - ) - /ox -+ METHOD_NAME_OR_SYMBOL = / #{METHOD_NAME_EX} | #{SYMBOL} /ox - - # TODO investigste \M, \c and \C escape sequences - # (?: M-\\C-|C-\\M-|M-\\c|c\\M-|c|C-|M-)? (?: \\ (?: [0-7]{3} | x[0-9A-Fa-f]{2} | . ) ) -@@ -111,7 +108,7 @@ - (?: - ( [A-Za-z_0-9]+ ) # $2 = delim - | -- ( ["'`] ) # $3 = quote, type -+ ( ["'`\/] ) # $3 = quote, type - ( [^\n]*? ) \3 # $4 = delim - ) - /mx -@@ -129,15 +126,14 @@ - /mx - - # Checks for a valid value to follow. This enables -- # fancy_allowed in method calls. -+ # value_expected in method calls without parentheses. - VALUE_FOLLOWS = / -- \s+ -+ (?>[ \t\f\v]+) - (?: - [%\/][^\s=] -- | -- <<-?\S -- | -- #{CHARACTER} -+ | <<-?\S -+ | [-+] \d -+ | #{CHARACTER} - ) - /x - -Index: lib/coderay/scanners/ruby.rb -=================================================================== ---- lib/coderay/scanners/ruby.rb (revision 200) -+++ lib/coderay/scanners/ruby.rb (revision 250) -@@ -18,6 +18,7 @@ - include Streamable - - register_for :ruby -+ file_extension 'rb' - - helper :patterns - -@@ -90,15 +91,15 @@ - end - - when '#' -- case peek(1)[0] -- when ?{ -+ case peek(1) -+ when '{' - inline_block_stack << [state, depth, heredocs] - value_expected = true - state = :initial - depth = 1 - tokens << [:open, :inline] - tokens << [match + getch, :inline_delimiter] -- when ?$, ?@ -+ when '$', '@' - tokens << [match, :escape] - last_state = state # scan one token as normal code, then return here - state = :initial -@@ -121,36 +122,37 @@ - # }}} - else - # {{{ -- if match = scan(/ [ \t\f]+ | \\? \n | \# .* /x) or -- ( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) ) -- case m = match[0] -- when ?\s, ?\t, ?\f -- match << scan(/\s*/) unless eos? or heredocs -- kind = :space -- when ?\n, ?\\ -- kind = :space -- if m == ?\n -- value_expected = true # FIXME not quite true -- state = :initial if state == :undef_comma_expected -- end -- if heredocs -- unscan # heredoc scanning needs \n at start -- state = heredocs.shift -- tokens << [:open, state.type] -- heredocs = nil if heredocs.empty? -- next -- else -- match << scan(/\s*/) unless eos? -- end -- when ?#, ?=, ?_ -- kind = :comment -- value_expected = true -+ if match = scan(/[ \t\f]+/) -+ kind = :space -+ match << scan(/\s*/) unless eos? || heredocs -+ value_expected = true if match.index(?\n) # FIXME not quite true -+ tokens << [match, kind] -+ next -+ -+ elsif match = scan(/\\?\n/) -+ kind = :space -+ if match == "\n" -+ value_expected = true # FIXME not quite true -+ state = :initial if state == :undef_comma_expected -+ end -+ if heredocs -+ unscan # heredoc scanning needs \n at start -+ state = heredocs.shift -+ tokens << [:open, state.type] -+ heredocs = nil if heredocs.empty? -+ next - else -- raise_inspect 'else-case _ reached, because case %p was -- not handled' % [matched[0].chr], tokens -+ match << scan(/\s*/) unless eos? - end - tokens << [match, kind] - next -+ -+ elsif match = scan(/\#.*/) or -+ ( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) ) -+ kind = :comment -+ value_expected = true -+ tokens << [match, kind] -+ next - - elsif state == :initial - -@@ -167,19 +169,19 @@ - end - end - ## experimental! -- value_expected = :set if -- patterns::REGEXP_ALLOWED[match] or check(/#{patterns::VALUE_FOLLOWS}/o) -+ value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o) - - elsif last_token_dot and match = scan(/#{patterns::METHOD_NAME_OPERATOR}/o) - kind = :ident - value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o) - - # OPERATORS # -- elsif not last_token_dot and match = scan(/ ==?=? | \.\.?\.? | [\(\)\[\]\{\}] | :: | , /x) -+ # TODO: match (), [], {} as one single operator -+ elsif not last_token_dot and match = scan(/ \.\.\.? | (?:\.|::)() | [,\(\)\[\]\{\}] | ==?=? /x) - if match !~ / [.\)\]\}] /x or match =~ /\.\.\.?/ - value_expected = :set - end -- last_token_dot = :set if match == '.' or match == '::' -+ last_token_dot = :set if self[1] - kind = :operator - unless inline_block_stack.empty? - case match -@@ -210,8 +212,9 @@ - interpreted = true - state = patterns::StringState.new :regexp, interpreted, match - -- elsif match = scan(/#{patterns::NUMERIC}/o) -- kind = if self[1] then :float else :integer end -+ # elsif match = scan(/[-+]?#{patterns::NUMERIC}/o) -+ elsif match = value_expected ? scan(/[-+]?#{patterns::NUMERIC}/o) : scan(/#{patterns::NUMERIC}/o) -+ kind = self[1] ? :float : :integer - - elsif match = scan(/#{patterns::SYMBOL}/o) - case delim = match[1] -@@ -285,6 +288,18 @@ - next - end - -+ elsif state == :module_expected -+ if match = scan(/<</) -+ kind = :operator -+ else -+ state = :initial -+ if match = scan(/ (?:#{patterns::IDENT}::)* #{patterns::IDENT} /ox) -+ kind = :class -+ else -+ next -+ end -+ end -+ - elsif state == :undef_expected - state = :undef_comma_expected - if match = scan(/#{patterns::METHOD_NAME_EX}/o) -@@ -306,6 +321,15 @@ - next - end - -+ elsif state == :alias_expected -+ if match = scan(/(#{patterns::METHOD_NAME_OR_SYMBOL})([ \t]+)(#{patterns::METHOD_NAME_OR_SYMBOL})/o) -+ tokens << [self[1], (self[1][0] == ?: ? :symbol : :method)] -+ tokens << [self[2], :space] -+ tokens << [self[3], (self[3][0] == ?: ? :symbol : :method)] -+ end -+ state = :initial -+ next -+ - elsif state == :undef_comma_expected - if match = scan(/,/) - kind = :operator -@@ -315,24 +339,14 @@ - next - end - -- elsif state == :module_expected -- if match = scan(/<</) -- kind = :operator -- else -- state = :initial -- if match = scan(/ (?:#{patterns::IDENT}::)* #{patterns::IDENT} /ox) -- kind = :class -- else -- next -- end -- end -- - end - # }}} -+ -+ unless kind == :error -+ value_expected = value_expected == :set -+ last_token_dot = last_token_dot == :set -+ end - -- value_expected = value_expected == :set -- last_token_dot = last_token_dot == :set -- - if $DEBUG and not kind - raise_inspect 'Error token %p in line %d' % - [[match, kind], line], tokens, state -Index: lib/coderay/scanners/c.rb -=================================================================== ---- lib/coderay/scanners/c.rb (revision 200) -+++ lib/coderay/scanners/c.rb (revision 250) -@@ -4,6 +4,8 @@ - class C < Scanner - - register_for :c -+ -+ include Streamable - - RESERVED_WORDS = [ - 'asm', 'break', 'case', 'continue', 'default', 'do', 'else', -@@ -42,7 +44,7 @@ - - kind = nil - match = nil -- -+ - case state - - when :initial -Index: lib/coderay/scanners/scheme.rb -=================================================================== ---- lib/coderay/scanners/scheme.rb (revision 0) -+++ lib/coderay/scanners/scheme.rb (revision 250) -@@ -0,0 +1,142 @@ -+module CodeRay -+ module Scanners -+ -+ # Scheme scanner for CodeRay (by closure). -+ # Thanks to murphy for putting CodeRay into public. -+ class Scheme < Scanner -+ -+ register_for :scheme -+ file_extension :scm -+ -+ CORE_FORMS = %w[ -+ lambda let let* letrec syntax-case define-syntax let-syntax -+ letrec-syntax begin define quote if or and cond case do delay -+ quasiquote set! cons force call-with-current-continuation call/cc -+ ] -+ -+ IDENT_KIND = CaseIgnoringWordList.new(:ident). -+ add(CORE_FORMS, :reserved) -+ -+ #IDENTIFIER_INITIAL = /[a-z!@\$%&\*\/\:<=>\?~_\^]/i -+ #IDENTIFIER_SUBSEQUENT = /#{IDENTIFIER_INITIAL}|\d|\.|\+|-/ -+ #IDENTIFIER = /#{IDENTIFIER_INITIAL}#{IDENTIFIER_SUBSEQUENT}*|\+|-|\.{3}/ -+ IDENTIFIER = /[a-zA-Z!@$%&*\/:<=>?~_^][\w!@$%&*\/:<=>?~^.+\-]*|[+-]|\.\.\./ -+ DIGIT = /\d/ -+ DIGIT10 = DIGIT -+ DIGIT16 = /[0-9a-f]/i -+ DIGIT8 = /[0-7]/ -+ DIGIT2 = /[01]/ -+ RADIX16 = /\#x/i -+ RADIX8 = /\#o/i -+ RADIX2 = /\#b/i -+ RADIX10 = /\#d/i -+ EXACTNESS = /#i|#e/i -+ SIGN = /[\+-]?/ -+ EXP_MARK = /[esfdl]/i -+ EXP = /#{EXP_MARK}#{SIGN}#{DIGIT}+/ -+ SUFFIX = /#{EXP}?/ -+ PREFIX10 = /#{RADIX10}?#{EXACTNESS}?|#{EXACTNESS}?#{RADIX10}?/ -+ PREFIX16 = /#{RADIX16}#{EXACTNESS}?|#{EXACTNESS}?#{RADIX16}/ -+ PREFIX8 = /#{RADIX8}#{EXACTNESS}?|#{EXACTNESS}?#{RADIX8}/ -+ PREFIX2 = /#{RADIX2}#{EXACTNESS}?|#{EXACTNESS}?#{RADIX2}/ -+ UINT10 = /#{DIGIT10}+#*/ -+ UINT16 = /#{DIGIT16}+#*/ -+ UINT8 = /#{DIGIT8}+#*/ -+ UINT2 = /#{DIGIT2}+#*/ -+ DECIMAL = /#{DIGIT10}+#+\.#*#{SUFFIX}|#{DIGIT10}+\.#{DIGIT10}*#*#{SUFFIX}|\.#{DIGIT10}+#*#{SUFFIX}|#{UINT10}#{EXP}/ -+ UREAL10 = /#{UINT10}\/#{UINT10}|#{DECIMAL}|#{UINT10}/ -+ UREAL16 = /#{UINT16}\/#{UINT16}|#{UINT16}/ -+ UREAL8 = /#{UINT8}\/#{UINT8}|#{UINT8}/ -+ UREAL2 = /#{UINT2}\/#{UINT2}|#{UINT2}/ -+ REAL10 = /#{SIGN}#{UREAL10}/ -+ REAL16 = /#{SIGN}#{UREAL16}/ -+ REAL8 = /#{SIGN}#{UREAL8}/ -+ REAL2 = /#{SIGN}#{UREAL2}/ -+ IMAG10 = /i|#{UREAL10}i/ -+ IMAG16 = /i|#{UREAL16}i/ -+ IMAG8 = /i|#{UREAL8}i/ -+ IMAG2 = /i|#{UREAL2}i/ -+ COMPLEX10 = /#{REAL10}@#{REAL10}|#{REAL10}\+#{IMAG10}|#{REAL10}-#{IMAG10}|\+#{IMAG10}|-#{IMAG10}|#{REAL10}/ -+ COMPLEX16 = /#{REAL16}@#{REAL16}|#{REAL16}\+#{IMAG16}|#{REAL16}-#{IMAG16}|\+#{IMAG16}|-#{IMAG16}|#{REAL16}/ -+ COMPLEX8 = /#{REAL8}@#{REAL8}|#{REAL8}\+#{IMAG8}|#{REAL8}-#{IMAG8}|\+#{IMAG8}|-#{IMAG8}|#{REAL8}/ -+ COMPLEX2 = /#{REAL2}@#{REAL2}|#{REAL2}\+#{IMAG2}|#{REAL2}-#{IMAG2}|\+#{IMAG2}|-#{IMAG2}|#{REAL2}/ -+ NUM10 = /#{PREFIX10}?#{COMPLEX10}/ -+ NUM16 = /#{PREFIX16}#{COMPLEX16}/ -+ NUM8 = /#{PREFIX8}#{COMPLEX8}/ -+ NUM2 = /#{PREFIX2}#{COMPLEX2}/ -+ NUM = /#{NUM10}|#{NUM16}|#{NUM8}|#{NUM2}/ -+ -+ private -+ def scan_tokens tokens,options -+ -+ state = :initial -+ ident_kind = IDENT_KIND -+ -+ until eos? -+ kind = match = nil -+ -+ case state -+ when :initial -+ if scan(/ \s+ | \\\n /x) -+ kind = :space -+ elsif scan(/['\(\[\)\]]|#\(/) -+ kind = :operator_fat -+ elsif scan(/;.*/) -+ kind = :comment -+ elsif scan(/#\\(?:newline|space|.?)/) -+ kind = :char -+ elsif scan(/#[ft]/) -+ kind = :pre_constant -+ elsif scan(/#{IDENTIFIER}/o) -+ kind = ident_kind[matched] -+ elsif scan(/\./) -+ kind = :operator -+ elsif scan(/"/) -+ tokens << [:open, :string] -+ state = :string -+ tokens << ['"', :delimiter] -+ next -+ elsif scan(/#{NUM}/o) and not matched.empty? -+ kind = :integer -+ elsif getch -+ kind = :error -+ end -+ -+ when :string -+ if scan(/[^"\\]+/) or scan(/\\.?/) -+ kind = :content -+ elsif scan(/"/) -+ tokens << ['"', :delimiter] -+ tokens << [:close, :string] -+ state = :initial -+ next -+ else -+ raise_inspect "else case \" reached; %p not handled." % peek(1), -+ tokens, state -+ end -+ -+ else -+ raise "else case reached" -+ end -+ -+ match ||= matched -+ if $DEBUG and not kind -+ raise_inspect 'Error token %p in line %d' % -+ [[match, kind], line], tokens -+ end -+ raise_inspect 'Empty token', tokens, state unless match -+ -+ tokens << [match, kind] -+ -+ end # until eos -+ -+ if state == :string -+ tokens << [:close, :string] -+ end -+ -+ tokens -+ -+ end #scan_tokens -+ end #class -+ end #module scanners -+end #module coderay -\ No newline at end of file -Index: lib/coderay/scanners/delphi.rb -=================================================================== ---- lib/coderay/scanners/delphi.rb (revision 200) -+++ lib/coderay/scanners/delphi.rb (revision 250) -@@ -29,13 +29,18 @@ - 'virtual', 'write', 'writeonly' - ] - -- IDENT_KIND = CaseIgnoringWordList.new(:ident). -+ IDENT_KIND = CaseIgnoringWordList.new(:ident, caching=true). - add(RESERVED_WORDS, :reserved). - add(DIRECTIVES, :directive) -+ -+ NAME_FOLLOWS = CaseIgnoringWordList.new(false, caching=true). -+ add(%w(procedure function .)) - -+ private - def scan_tokens tokens, options - - state = :initial -+ last_token = '' - - until eos? - -@@ -45,19 +50,29 @@ - if state == :initial - - if scan(/ \s+ /x) -- kind = :space -+ tokens << [matched, :space] -+ next - - elsif scan(%r! \{ \$ [^}]* \}? | \(\* \$ (?: .*? \*\) | .* ) !mx) -- kind = :preprocessor -+ tokens << [matched, :preprocessor] -+ next - - elsif scan(%r! // [^\n]* | \{ [^}]* \}? | \(\* (?: .*? \*\) | .* ) !mx) -- kind = :comment -+ tokens << [matched, :comment] -+ next - -- elsif scan(/ [-+*\/=<>:;,.@\^|\(\)\[\]]+ /x) -+ elsif match = scan(/ <[>=]? | >=? | :=? | [-+=*\/;,@\^|\(\)\[\]] | \.\. /x) - kind = :operator -+ -+ elsif match = scan(/\./) -+ kind = :operator -+ if last_token == 'end' -+ tokens << [match, kind] -+ next -+ end - - elsif match = scan(/ [A-Za-z_][A-Za-z_0-9]* /x) -- kind = IDENT_KIND[match] -+ kind = NAME_FOLLOWS[last_token] ? :ident : IDENT_KIND[match] - - elsif match = scan(/ ' ( [^\n']|'' ) (?:'|$) /x) - tokens << [:open, :char] -@@ -101,6 +116,7 @@ - state = :initial - next - elsif scan(/\n/) -+ tokens << [:close, :string] - kind = :error - state = :initial - else -@@ -119,6 +135,7 @@ - end - raise_inspect 'Empty token', tokens unless match - -+ last_token = match - tokens << [match, kind] - - end -Index: lib/coderay/scanners/debug.rb -=================================================================== ---- lib/coderay/scanners/debug.rb (revision 0) -+++ lib/coderay/scanners/debug.rb (revision 250) -@@ -0,0 +1,60 @@ -+module CodeRay -+module Scanners -+ -+ # = Debug Scanner -+ class Debug < Scanner -+ -+ include Streamable -+ register_for :debug -+ -+ protected -+ def scan_tokens tokens, options -+ -+ opened_tokens = [] -+ -+ until eos? -+ -+ kind = nil -+ match = nil -+ -+ if scan(/\s+/) -+ tokens << [matched, :space] -+ next -+ -+ elsif scan(/ (\w+) \( ( [^\)\\]* ( \\. [^\)\\]* )* ) \) /x) -+ kind = self[1].to_sym -+ match = self[2].gsub(/\\(.)/, '\1') -+ -+ elsif scan(/ (\w+) < /x) -+ kind = self[1].to_sym -+ opened_tokens << kind -+ match = :open -+ -+ elsif scan(/ > /x) -+ kind = opened_tokens.pop -+ match = :close -+ -+ else -+ kind = :error -+ getch -+ -+ end -+ -+ match ||= matched -+ if $DEBUG and not kind -+ raise_inspect 'Error token %p in line %d' % -+ [[match, kind], line], tokens -+ end -+ raise_inspect 'Empty token', tokens unless match -+ -+ tokens << [match, kind] -+ -+ end -+ -+ tokens -+ end -+ -+ end -+ -+end -+end -Index: lib/coderay/scanners/rhtml.rb -=================================================================== ---- lib/coderay/scanners/rhtml.rb (revision 200) -+++ lib/coderay/scanners/rhtml.rb (revision 250) -@@ -51,10 +51,10 @@ - start_tag = match[/\A<%[-=]?/] - end_tag = match[/-?%?>?\z/] - tokens << [:open, :inline] -- tokens << [start_tag, :delimiter] -+ tokens << [start_tag, :inline_delimiter] - code = match[start_tag.size .. -1 - end_tag.size] - @ruby_scanner.tokenize code -- tokens << [end_tag, :delimiter] unless end_tag.empty? -+ tokens << [end_tag, :inline_delimiter] unless end_tag.empty? - tokens << [:close, :inline] - - else -Index: lib/coderay/scanners/nitro_xhtml.rb -=================================================================== ---- lib/coderay/scanners/nitro_xhtml.rb (revision 200) -+++ lib/coderay/scanners/nitro_xhtml.rb (revision 250) -@@ -95,20 +95,20 @@ - delimiter = CLOSING_PAREN[start_tag[1,1]] - end_tag = match[-1,1] == delimiter ? delimiter : '' - tokens << [:open, :inline] -- tokens << [start_tag, :delimiter] -+ tokens << [start_tag, :inline_delimiter] - code = match[start_tag.size .. -1 - end_tag.size] - @ruby_scanner.tokenize code -- tokens << [end_tag, :delimiter] unless end_tag.empty? -+ tokens << [end_tag, :inline_delimiter] unless end_tag.empty? - tokens << [:close, :inline] - - elsif match = scan(/#{NITRO_RUBY_BLOCK}/o) - start_tag = '<?r' - end_tag = match[-2,2] == '?>' ? '?>' : '' - tokens << [:open, :inline] -- tokens << [start_tag, :delimiter] -+ tokens << [start_tag, :inline_delimiter] - code = match[start_tag.size .. -(end_tag.size)-1] - @ruby_scanner.tokenize code -- tokens << [end_tag, :delimiter] unless end_tag.empty? -+ tokens << [end_tag, :inline_delimiter] unless end_tag.empty? - tokens << [:close, :inline] - - elsif entity = scan(/#{NITRO_ENTITY}/o) -Index: lib/coderay/scanners/plaintext.rb -=================================================================== ---- lib/coderay/scanners/plaintext.rb (revision 200) -+++ lib/coderay/scanners/plaintext.rb (revision 250) -@@ -4,6 +4,8 @@ - class Plaintext < Scanner - - register_for :plaintext, :plain -+ -+ include Streamable - - def scan_tokens tokens, options - text = (scan_until(/\z/) || '') -Index: lib/coderay.rb -=================================================================== ---- lib/coderay.rb (revision 200) -+++ lib/coderay.rb (revision 250) -@@ -24,8 +24,8 @@ - # - # == Usage - # --# Remember you need RubyGems to use CodeRay. Run Ruby with -rubygems option --# if required. -+# Remember you need RubyGems to use CodeRay, unless you have it in your load path. Run Ruby with -+# -rubygems option if required. - # - # === Highlight Ruby code in a string as html - # -@@ -44,19 +44,15 @@ - # - # You can include this div in your page. The used CSS styles can be printed with - # --# % ruby -rcoderay -e "print CodeRay::Encoders[:html]::CSS" -+# % coderay_stylesheet - # - # === Highlight without typing too much --# -+# - # If you are one of the hasty (or lazy, or extremely curious) people, just run this file: --# --# % ruby -rubygems coderay.rb - # --# If the output was to fast for you, try -+# % ruby -rubygems /path/to/coderay/coderay.rb > example.html - # --# % ruby -rubygems coderay.rb > example.html --# --# and look at the file it created. -+# and look at the file it created in your browser. - # - # = CodeRay Module - # -@@ -111,7 +107,7 @@ - # - # CodeRay.scan_stream:: Scan in stream mode. - # --# == All-in-One Encoding -+# == All-in-One Encoding - # - # CodeRay.encode:: Highlight a string with a given input and output format. - # -@@ -121,11 +117,16 @@ - # for this Encoder must only be done once. - # - # CodeRay.encoder:: Create an Encoder instance with format and options. -+# CodeRay.scanner:: Create an Scanner instance for lang, with '' as default code. - # --# There is no CodeRay.scanner method because Scanners are bound to an input string --# on creation; you can't re-use them with another string. -+# To make use of CodeRay.scanner, use CodeRay::Scanner::code=. - # --# The scanning methods provide more flexibility; we recommend to use these. -+# The scanning methods provide more flexibility; we recommend to use these. -+# -+# == Reusing Scanners and Encoders -+# -+# If you want to re-use scanners and encoders (because that is faster), see -+# CodeRay::Duo for the most convenient (and recommended) interface. - module CodeRay - - # Version: Major.Minor.Teeny[.Revision] -@@ -133,7 +134,7 @@ - # Minor: odd for beta, even for stable - # Teeny: development state - # Revision: Subversion Revision number (generated on rake) -- VERSION = '0.7.4' -+ VERSION = '0.7.9' - - require 'coderay/tokens' - require 'coderay/scanner' -@@ -170,7 +171,7 @@ - def scan_file filename, lang = :auto, options = {}, &block - file = IO.read filename - if lang == :auto -- require 'coderay/helpers/filetype' -+ require 'coderay/helpers/file_type' - lang = FileType.fetch filename, :plaintext, true - end - scan file, lang, options = {}, &block -@@ -314,6 +315,7 @@ - # Run a test script. - if $0 == __FILE__ - $stderr.print 'Press key to print demo.'; gets -- code = File.read($0)[/module CodeRay.*/m] -+ # Just use this file as an example of Ruby code. -+ code = File.read(__FILE__)[/module CodeRay.*/m] - print CodeRay.scan(code, :ruby).html - end - -Property changes on: lib -___________________________________________________________________ -Added: svn:externals - + term http://term-ansicolor.rubyforge.org/svn/trunk/lib/term/ - - diff --git a/test/scanners/diff/const_missing.expected.raydebug b/test/scanners/diff/const_missing.expected.raydebug deleted file mode 100644 index 1fbae49..0000000 --- a/test/scanners/diff/const_missing.expected.raydebug +++ /dev/null @@ -1,75 +0,0 @@ -head[head(Index: )plain(error.c)] -head[head(===================================================================)filename()] -head[head(--- )filename(error.c)plain( (revision 26674\))] -head[head(+++ )filename(error.c)plain( (working copy\))] -change<change(@@)plain( -402,4 +402,6 )change(@@)> ident(VALUE) ident(rb_eSyntaxError)operator(;) - ident(VALUE) ident(rb_eLoadError)operator(;) - -insert[insert(+)ident(VALUE) ident(rb_eNoConstantError)operator(;)] -insert[insert(+)] - ident(VALUE) ident(rb_eSystemCallError)operator(;) - ident(VALUE) ident(rb_mErrno)operator(;) -change<change(@@)plain( -1143,4 +1145,5 )change(@@)> ident(Init_Exception)operator(()directive(void)operator(\)) - ident(rb_define_method)operator(()ident(rb_eNoMethodError)operator(,) string<delimiter(")content(initialize)delimiter(")>operator(,) ident(nometh_err_initialize)operator(,) operator(-)integer(1)operator(\);) - ident(rb_define_method)operator(()ident(rb_eNoMethodError)operator(,) string<delimiter(")content(args)delimiter(")>operator(,) ident(nometh_err_args)operator(,) integer(0)operator(\);) -insert[insert(+) ident(rb_eNoConstantError) operator(=) ident(rb_define_class)operator(()string<delimiter(")content(NoConstantError)delimiter(")>operator(,) ident(rb_eNameError)operator(\);)] - - ident(rb_eRuntimeError) operator(=) ident(rb_define_class)operator(()string<delimiter(")content(RuntimeError)delimiter(")>operator(,) ident(rb_eStandardError)operator(\);) -head[head(Index: )plain(variable.c)] -head[head(===================================================================)filename()] -head[head(--- )filename(variable.c)plain( (revision 26674\))] -head[head(+++ )filename(variable.c)plain( (working copy\))] -change<change(@@)plain( -1356,7 +1356,29 )change(@@)> ident(uninitialized_constant)operator(()ident(VALUE) ident(klass)operator(,) ident(ID) ident(i) - - directive(static) ident(VALUE) -insert[insert(+)ident(const_missing_call)operator(()ident(VALUE) ident(arg)operator(\))] -insert[insert(+)operator({)] -insert[insert(+) ident(VALUE) operator(*)ident(args) operator(=) operator(()ident(VALUE) operator(*\))ident(arg)operator(;)] -insert[insert(+) ident(ID) ident(const_missing_id)operator(;)] -insert[insert(+) ident(CONST_ID)operator(()ident(const_missing_id)operator(,) string<delimiter(")content(const_missing)delimiter(")>operator(\);)] -insert[insert(+) reserved(return) ident(rb_check_funcall)operator(()ident(args)operator([)integer(0)operator(],) ident(const_missing_id)operator(,) integer(1)operator(,) operator(&)ident(args)operator([)integer(1)operator(]\);)] -insert[insert(+)operator(})] -insert[insert(+)] -insert[insert(+)directive(static) ident(VALUE)] -insert[insert(+)ident(const_missing_rescue)operator(()ident(VALUE) ident(arg)operator(,) ident(VALUE) ident(errinfo)operator(\))] -insert[insert(+)operator({)] -insert[insert(+) reserved(return) ident(arg)operator(;)] -insert[insert(+)operator(})] -insert[insert(+)] -insert[insert(+)directive(extern) ident(VALUE) ident(rb_eNoConstantError)operator(;)] -insert[insert(+)] -insert[insert(+)directive(static) ident(VALUE)] - ident(const_missing)operator(()ident(VALUE) ident(klass)operator(,) ident(ID) ident(id)operator(\)) - operator({) -delete[delete(-) reserved(return) ident(rb_funcall)operator(()ident(klass)operator(,) ident(rb_intern)operator(()string<delimiter(")content(const_missing)delimiter(")>operator(\),) integer(1)operator(,) ident(ID2SYM)operator(()ident(id)operator(\)\);)] -insert[insert(+) ident(VALUE) ident(args)operator([)integer(2)operator(];)] -insert[insert(+) ident(args)operator([)integer(0)operator(]) operator(=) ident(klass)operator(;)] -insert[insert(+) ident(args)operator([)integer(1)operator(]) operator(=) ident(ID2SYM)operator(()ident(id)operator(\);)] -insert[insert(+) reserved(return) ident(rb_rescue2)operator(()ident(const_missing_call)operator(,) operator(()ident(VALUE)operator(\))ident(args)operator(,)] -insert[insert(+) ident(const_missing_rescue)operator(,) operator(()ident(VALUE)operator(\))ident(Qundef)operator(,)] -insert[insert(+) ident(rb_eNoConstantError)operator(,) operator(()ident(VALUE)operator(\))integer(0)operator(\);)] - operator(}) - -change<change(@@)plain( -1598,5 +1620,21 )change(@@)> ident(rb_const_get_0)operator(()ident(VALUE) ident(klass)operator(,) ident(ID) ident(id)operator(,) pre_type(int) ident(e) - operator(}) - -delete[delete(-) ident(value) operator(=) ident(const_missing)operator(()ident(klass)operator(,) ident(id)operator(\);)] -insert[insert(+) reserved(if) operator((()ident(value) operator(=) ident(const_missing)operator(()ident(tmp)operator(,) ident(id)operator(\)\)) operator(==) ident(Qundef)operator(\)) operator({)] -insert[insert(+) ident(NODE) operator(*)ident(rb_vm_cref)operator(()directive(void)operator(\);)] -insert[insert(+) ident(NODE) operator(*)ident(cref) operator(=) ident(rb_vm_cref)operator((\);)] -insert[insert(+) reserved(while) operator(()ident(cref) operator(&&) ident(cref)operator(->)ident(nd_next) operator(&&)] -insert[insert(+) operator((()ident(cref)operator(->)ident(flags) operator(&) ident(NODE_FL_CREF_PUSHED_BY_EVAL)operator(\)) operator(||)] -insert[insert(+) ident(NIL_P)operator(()ident(tmp) operator(=) ident(cref)operator(->)ident(nd_clss)operator(\)) operator(||)] -insert[insert(+) operator(()ident(value) operator(=) ident(const_missing)operator(()ident(tmp)operator(,) ident(id)operator(\)\)) operator(==) ident(Qundef)operator(\)\)) operator({)] -insert[insert(+) ident(cref) operator(=) ident(cref)operator(->)ident(nd_next)operator(;)] -insert[insert(+) operator(})] -insert[insert(+) reserved(if) operator(()ident(value) operator(==) ident(Qundef)operator(\)) operator({)] -insert[insert(+) reserved(if) operator((!)ident(exclude) operator(&&) ident(BUILTIN_TYPE)operator(()ident(klass)operator(\)) operator(==) ident(T_MODULE) operator(&&)] -insert[insert(+) operator(()ident(value) operator(=) ident(const_missing)operator(()ident(rb_cObject)operator(,) ident(id)operator(\)\)) operator(==) ident(Qundef)operator(\)) operator({)] -insert[insert(+) ident(uninitialized_constant)operator(()ident(klass)operator(,) ident(id)operator(\);)] -insert[insert(+) operator(})] -insert[insert(+) operator(})] -insert[insert(+) operator(})] -insert[insert(+)] - ident(rb_vm_inc_const_missing_count)operator((\);) - reserved(return) ident(value)operator(;) diff --git a/test/scanners/diff/const_missing.in.diff b/test/scanners/diff/const_missing.in.diff deleted file mode 100644 index 5549794..0000000 --- a/test/scanners/diff/const_missing.in.diff +++ /dev/null @@ -1,75 +0,0 @@ -Index: error.c -=================================================================== ---- error.c (revision 26674) -+++ error.c (working copy) -@@ -402,4 +402,6 @@ VALUE rb_eSyntaxError; - VALUE rb_eLoadError; - -+VALUE rb_eNoConstantError; -+ - VALUE rb_eSystemCallError; - VALUE rb_mErrno; -@@ -1143,4 +1145,5 @@ Init_Exception(void) - rb_define_method(rb_eNoMethodError, "initialize", nometh_err_initialize, -1); - rb_define_method(rb_eNoMethodError, "args", nometh_err_args, 0); -+ rb_eNoConstantError = rb_define_class("NoConstantError", rb_eNameError); - - rb_eRuntimeError = rb_define_class("RuntimeError", rb_eStandardError); -Index: variable.c -=================================================================== ---- variable.c (revision 26674) -+++ variable.c (working copy) -@@ -1356,7 +1356,29 @@ uninitialized_constant(VALUE klass, ID i - - static VALUE -+const_missing_call(VALUE arg) -+{ -+ VALUE *args = (VALUE *)arg; -+ ID const_missing_id; -+ CONST_ID(const_missing_id, "const_missing"); -+ return rb_check_funcall(args[0], const_missing_id, 1, &args[1]); -+} -+ -+static VALUE -+const_missing_rescue(VALUE arg, VALUE errinfo) -+{ -+ return arg; -+} -+ -+extern VALUE rb_eNoConstantError; -+ -+static VALUE - const_missing(VALUE klass, ID id) - { -- return rb_funcall(klass, rb_intern("const_missing"), 1, ID2SYM(id)); -+ VALUE args[2]; -+ args[0] = klass; -+ args[1] = ID2SYM(id); -+ return rb_rescue2(const_missing_call, (VALUE)args, -+ const_missing_rescue, (VALUE)Qundef, -+ rb_eNoConstantError, (VALUE)0); - } - -@@ -1598,5 +1620,21 @@ rb_const_get_0(VALUE klass, ID id, int e - } - -- value = const_missing(klass, id); -+ if ((value = const_missing(tmp, id)) == Qundef) { -+ NODE *rb_vm_cref(void); -+ NODE *cref = rb_vm_cref(); -+ while (cref && cref->nd_next && -+ ((cref->flags & NODE_FL_CREF_PUSHED_BY_EVAL) || -+ NIL_P(tmp = cref->nd_clss) || -+ (value = const_missing(tmp, id)) == Qundef)) { -+ cref = cref->nd_next; -+ } -+ if (value == Qundef) { -+ if (!exclude && BUILTIN_TYPE(klass) == T_MODULE && -+ (value = const_missing(rb_cObject, id)) == Qundef) { -+ uninitialized_constant(klass, id); -+ } -+ } -+ } -+ - rb_vm_inc_const_missing_count(); - return value; diff --git a/test/scanners/diff/example.expected.raydebug b/test/scanners/diff/example.expected.raydebug deleted file mode 100644 index 01eae8c..0000000 --- a/test/scanners/diff/example.expected.raydebug +++ /dev/null @@ -1,27 +0,0 @@ -head[head(===================================================================)filename()] -head[head(--- )filename(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb)plain( (revision 1431\))] -head[head(+++ )filename(/Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb)plain( (revision 1437\))] -change[change(@@)plain( -1,6 +1,10 )change(@@)] -insert[insert(+)ident(require) string<delimiter(')content(login_system)delimiter(')>] - ident(require) string<delimiter(')content(coderay)delimiter(')> - - reserved(class) class(PastesController) operator(<) constant(ApplicationController) -insert[insert(+) ident(include) constant(LoginSystem)] -insert[insert(+)] -insert[insert(+) ident(before_filter) symbol(:attempt_cookie_login)] - - comment(# caches_action :recent) - -change[change(@@)plain( -10,11 +14,7 )change(@@)] - - reserved(def) method(show) - instance_variable(@paste) operator(=) constant(Paste)operator(.)ident(find)operator(()ident(params)operator([)symbol(:id)operator(])operator(\)) -delete[delete(-) reserved(if) ident(params)operator([)symbol(:key)operator(]) reserved(and) ident(params)operator([)symbol(:key)operator(])operator(==)constant(User)operator(.)ident(new)operator(()instance_variable(@paste)operator(.)ident(nick)operator(\))operator(.)ident(magic_mojo)] -delete[delete(-) ident(session)operator([)symbol(:login)operator(])operator(=)instance_variable(@paste)operator(.)ident(nick)] -delete[delete(-) reserved(return) ident(redirect_to)operator(()symbol(:action) operator(=)operator(>) string<delimiter(')content(show)delimiter(')>operator(,) symbol(:id) operator(=)operator(>) instance_variable(@paste)operator(.)ident(id)operator(\))] -delete[delete(-) reserved(end)] -delete[delete(-) ] -insert[insert(+) ident(attempt_key_login) reserved(if) reserved(not) ident(logged_in?)] - reserved(unless) instance_variable(@paste)operator(.)ident(asset) reserved(or) reserved(not) instance_variable(@paste)operator(.)ident(body)operator(.)ident(blank?) - ident(render) symbol(:action) operator(=)operator(>) string<delimiter(")content(edit)delimiter(")> - reserved(end)
\ No newline at end of file diff --git a/test/scanners/diff/example.in.diff b/test/scanners/diff/example.in.diff deleted file mode 100644 index 319d51b..0000000 --- a/test/scanners/diff/example.in.diff +++ /dev/null @@ -1,27 +0,0 @@ -=================================================================== ---- /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1431) -+++ /Users/jgoebel/rails/pastie/app/controllers/pastes_controller.rb (revision 1437) -@@ -1,6 +1,10 @@ -+require 'login_system' - require 'coderay' - - class PastesController < ApplicationController -+ include LoginSystem -+ -+ before_filter :attempt_cookie_login - - # caches_action :recent - -@@ -10,11 +14,7 @@ - - def show - @paste = Paste.find(params[:id]) -- if params[:key] and params[:key]==User.new(@paste.nick).magic_mojo -- session[:login]=@paste.nick -- return redirect_to(:action => 'show', :id => @paste.id) -- end -- -+ attempt_key_login if not logged_in? - unless @paste.asset or not @paste.body.blank? - render :action => "edit" - end
\ No newline at end of file diff --git a/test/scanners/diff/suite.rb b/test/scanners/diff/suite.rb deleted file mode 100644 index ce978d6..0000000 --- a/test/scanners/diff/suite.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Diff < CodeRay::TestCase -end |