diff options
-rw-r--r-- | Changes.textile | 24 | ||||
-rw-r--r-- | lib/coderay/scanners/ruby.rb | 232 | ||||
-rw-r--r-- | lib/coderay/scanners/ruby/patterns.rb | 52 | ||||
-rw-r--r-- | test/scanners/ruby/1.expected.raydebug | 8 | ||||
-rw-r--r-- | test/scanners/ruby/def.expected.raydebug | 5 | ||||
-rw-r--r-- | test/scanners/ruby/def.in.rb | 5 | ||||
-rw-r--r-- | test/scanners/ruby/evil.expected.raydebug | 24 | ||||
-rw-r--r-- | test/scanners/ruby/example.expected.raydebug | 38 | ||||
-rw-r--r-- | test/scanners/ruby/jarh.expected.raydebug | 2 | ||||
-rw-r--r-- | test/scanners/ruby/pleac.expected.raydebug | 68 | ||||
-rw-r--r-- | test/scanners/ruby/rails.expected.raydebug | 204 | ||||
-rw-r--r-- | test/scanners/ruby/ruby19.expected.raydebug | 5 | ||||
-rw-r--r-- | test/scanners/ruby/ruby19.in.rb | 5 |
13 files changed, 369 insertions, 303 deletions
diff --git a/Changes.textile b/Changes.textile index e645c65..8b68f30 100644 --- a/Changes.textile +++ b/Changes.textile @@ -55,6 +55,11 @@ h3. @Scanners@ Note: This is still buggy for multi-line tokens. * *NEW*: Highlighting of the file name in the change headers as @:filename@. +h3. @Scanners::Debug@ + +* *NEW*: Support for line tokens (@begin_line@ and @end_line@ represented by @[@ and @]@.) +* *FIXED*: Doesn't send @:error@ and @nil@ tokens for buggy input any more. + h3. @Scanners::Diff@ * *FIXED* Ruby 1.9.2 compatibility problem (see revision 463). @@ -70,20 +75,25 @@ h3. @Scanners::JavaScript@ * *IMPROVED* Added @NaN@ and @Infinity@ to list of predefined constants. * *FIXED* Don't keep state of XML scanner between calls for E4X literals. -h3. @Scanners::Debug@ - -* *NEW*: Support for line tokens (@begin_line@ and @end_line@ represented by @[@ and @]@.) -* *FIXED*: Doesn't send @:error@ and @nil@ tokens for bugy input any more. - h3. @Scanners::Plaintext@ * *IMPROVED* Just returns the string without scanning (faster). This is much faster than scanning until @/\z/@ in Ruby 1.8. +h3. @Scanners::Ruby@ + +* *ADDED* more predefined keywords (see http://murfy.de/ruby-constants). +* *IMPROVED* support for singleton method definitions. + See "#147":http://redmine.rubychan.de/issues/147. +* *FIXED*: Don't highlight methods with a capital letter as constants + (eg. GL.PushMatrix). +* *NEW*: Highlight buggy floats (like .5) as @:error@. +* *CLEANUP* of documentation, names of constants and variables, state handling. + h3. @Scanners::Scheme@ -* *CHANGED*: Does use @:opertor@ instead of @:opertor_fat@ now. +* *CHANGED*: Does use @:operator@ instead of @:operator_fat@ now. h3. @Scanners::SQL@ @@ -98,7 +108,7 @@ h3. @Styles::Alpha@ h3. @FileType@ * *REMOVED* @FileType#shebang@ is a protected method now. -* *NEW*: Regonizes @.gemspec@, @.rjs@, @.rpdf@ extensions and @Capfile@ as Ruby. +* *NEW*: Recognizes @.gemspec@, @.rjs@, @.rpdf@ extensions and @Capfile@ as Ruby. Thanks to the authors of the TextMate Ruby bundle! diff --git a/lib/coderay/scanners/ruby.rb b/lib/coderay/scanners/ruby.rb index 34a682b..5317d62 100644 --- a/lib/coderay/scanners/ruby.rb +++ b/lib/coderay/scanners/ruby.rb @@ -13,6 +13,8 @@ module Scanners # any highlighter I was able to find, except Caleb's RubyLexer. # # I hope it's also better than the rdoc/irb lexer. + # + # Alias: +irb+ class Ruby < Scanner include Streamable @@ -22,19 +24,23 @@ module Scanners helper :patterns - if not defined? EncodingError - EncodingError = Class.new Exception + unless defined? EncodingError + EncodingError = Class.new Exception # :nodoc: end - - private + + protected + def scan_tokens tokens, options - last_token_dot = false + + state = :initial + last_state = nil + method_call_expected = false value_expected = true heredocs = nil - last_state = nil - state = :initial - depth = nil - inline_block_stack = [] + inline_block_stack = nil + inline_block_curly_depth = 0 + def_object_stack = nil + def_object_paren_depth = 0 unicode = string.respond_to?(:encoding) && string.encoding.name == 'UTF-8' patterns = Patterns # avoid constant lookup @@ -44,7 +50,7 @@ module Scanners kind = nil if state.instance_of? patterns::StringState -# {{{ + match = scan_until(state.pattern) || scan_until(/\z/) tokens << [match, :content] unless match.empty? break if eos? @@ -61,7 +67,7 @@ module Scanners case match = getch when state.delim - if state.paren + if state.paren_depth state.paren_depth -= 1 if state.paren_depth > 0 tokens << [match, :nesting_delimiter] @@ -98,21 +104,23 @@ module Scanners when '#' case peek(1) when '{' - inline_block_stack << [state, depth, heredocs] + inline_block_stack ||= [] + inline_block_stack << [state, inline_block_curly_depth, heredocs] value_expected = true state = :initial - depth = 1 + inline_block_curly_depth = 1 tokens << [:open, :inline] tokens << [match + getch, :inline_delimiter] when '$', '@' tokens << [match, :escape] - last_state = state # scan one token as normal code, then return here + last_state = state state = :initial else - raise_inspect 'else-case # reached; #%p not handled' % peek(1), tokens + raise_inspect 'else-case # reached; #%p not handled' % + [peek(1)], tokens end - when state.paren + when state.opening_paren state.paren_depth += 1 tokens << [match, :nesting_delimiter] @@ -120,13 +128,14 @@ module Scanners tokens << [match, :function] else - raise_inspect 'else-case " reached; %p not handled, state = %p' % [match, state], tokens + raise_inspect 'else-case " reached; %p not handled, state = %p' % + [match, state], tokens end next -# }}} + else -# {{{ + if match = scan(/[ \t\f]+/) kind = :space match << scan(/\s*/) unless eos? || heredocs @@ -157,48 +166,55 @@ module Scanners next elsif match = scan(/\#.*/) or - ( bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o) ) - kind = :comment - tokens << [match, kind] - next + (bol? and match = scan(/#{patterns::RUBYDOC_OR_DATA}/o)) + kind = :comment + tokens << [match, kind] + next elsif state == :initial # IDENTS # - if match = scan(unicode ? /#{patterns::METHOD_NAME}/uo : + if !method_call_expected and + match = scan(unicode ? /#{patterns::METHOD_NAME}/uo : /#{patterns::METHOD_NAME}/o) - if last_token_dot - kind = if match[/^[A-Z]/] and not match?(/\(/) then :constant else :ident end - else - kind = patterns::IDENT_KIND[match] - if kind == :ident and match[/^[A-Z]/] and not match[/[!?]$/] and not match?(/\(/) + value_expected = false + kind = patterns::IDENT_KIND[match] + if kind == :ident + if match[/^[A-Z]/] && !match[/[!?]$/] && !match?(/\(/) kind = :constant - elsif kind == :reserved - state = patterns::DEF_NEW_STATE[match] - value_expected = :set if patterns::KEYWORDS_EXPECTING_VALUE[match] end + elsif kind == :reserved + state = patterns::KEYWORD_NEW_STATE[match] + value_expected = true if patterns::KEYWORDS_EXPECTING_VALUE[match] end - value_expected = :set if check(/#{patterns::VALUE_FOLLOWS}/o) + value_expected = true if !value_expected && 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) + elsif method_call_expected and + match = scan(unicode ? /#{patterns::METHOD_AFTER_DOT}/uo : + /#{patterns::METHOD_AFTER_DOT}/o) + kind = + if method_call_expected == '::' && match[/^[A-Z]/] && !match?(/\(/) + :constant + else + :ident + end + method_call_expected = false + value_expected = check(/#{patterns::VALUE_FOLLOWS}/o) # OPERATORS # - elsif not last_token_dot and match = scan(/ \.\.\.? | (?:\.|::)() | [,\(\)\[\]\{\}] | ==?=? /x) - if match !~ / [.\)\]\}] /x or match =~ /\.\.\.?/ - value_expected = :set - end - last_token_dot = :set if self[1] + elsif not method_call_expected and match = scan(/ \.\.\.? | (\.|::) | [,\(\)\[\]\{\}] | ==?=? /x) + value_expected = match !~ / [.\)\]\}] /x || match =~ /\A\.\./ + method_call_expected = self[1] kind = :operator - unless inline_block_stack.empty? + if inline_block_stack case match when '{' - depth += 1 + inline_block_curly_depth += 1 when '}' - depth -= 1 - if depth == 0 # closing brace of inline block reached - state, depth, heredocs = inline_block_stack.pop + inline_block_curly_depth -= 1 + if inline_block_curly_depth == 0 # closing brace of inline block reached + state, inline_block_curly_depth, heredocs = inline_block_stack.pop + inline_block_stack = nil if inline_block_stack.empty? heredocs = nil if heredocs && heredocs.empty? tokens << [match, :inline_delimiter] kind = :inline @@ -212,7 +228,9 @@ module Scanners kind = :delimiter state = patterns::StringState.new :string, match == '"', match # important for streaming - elsif match = scan(/#{patterns::INSTANCE_VARIABLE}/o) + elsif match = scan(unicode ? /#{patterns::INSTANCE_VARIABLE}/uo : + /#{patterns::INSTANCE_VARIABLE}/o) + value_expected = false kind = :instance_variable elsif value_expected and match = scan(/\//) @@ -221,11 +239,17 @@ module Scanners interpreted = true state = patterns::StringState.new :regexp, interpreted, match - # elsif match = scan(/[-+]?#{patterns::NUMERIC}/o) elsif match = value_expected ? scan(/[-+]?#{patterns::NUMERIC}/o) : scan(/#{patterns::NUMERIC}/o) - kind = self[1] ? :float : :integer + if method_call_expected + kind = :error + method_call_expected = false + else + kind = self[1] ? :float : :integer + end + value_expected = false - elsif match = scan(/#{patterns::SYMBOL}/o) + elsif match = scan(unicode ? /#{patterns::SYMBOL}/uo : + /#{patterns::SYMBOL}/o) case delim = match[1] when ?', ?" tokens << [:open, :symbol] @@ -235,10 +259,11 @@ module Scanners state = patterns::StringState.new :symbol, delim == ?", match else kind = :symbol + value_expected = false end elsif match = scan(/ [-+!~^]=? | [*|&]{1,2}=? | >>? /x) - value_expected = :set + value_expected = true kind = :operator elsif value_expected and match = scan(/#{patterns::HEREDOC_OPEN}/o) @@ -249,11 +274,13 @@ module Scanners tokens << [:open, kind] tokens << [match, :delimiter] match = :close - heredoc = patterns::StringState.new kind, quote != '\'', delim, (indented ? :indented : :linestart ) + heredoc = patterns::StringState.new kind, quote != '\'', + delim, (indented ? :indented : :linestart ) heredocs ||= [] # create heredocs if empty heredocs << heredoc + value_expected = false - elsif value_expected and match = scan(/#{patterns::FANCY_START_CORRECT}/o) + elsif value_expected and match = scan(/#{patterns::FANCY_START}/o) kind, interpreted = *patterns::FancyStringType.fetch(self[1]) do raise_inspect 'Unknown fancy string: %%%p' % k, tokens end @@ -262,49 +289,81 @@ module Scanners kind = :delimiter elsif value_expected and match = scan(/#{patterns::CHARACTER}/o) + value_expected = false kind = :integer elsif match = scan(/ [\/%]=? | <(?:<|=>?)? | [?:;] /x) - value_expected = :set + value_expected = true kind = :operator elsif match = scan(/`/) - if last_token_dot + if method_call_expected kind = :operator + value_expected = true else tokens << [:open, :shell] kind = :delimiter state = patterns::StringState.new :shell, true, match end - elsif match = scan(/#{patterns::GLOBAL_VARIABLE}/o) + elsif match = scan(unicode ? /#{patterns::GLOBAL_VARIABLE}/uo : + /#{patterns::GLOBAL_VARIABLE}/o) kind = :global_variable + value_expected = false - elsif match = scan(/#{patterns::CLASS_VARIABLE}/o) + elsif match = scan(unicode ? /#{patterns::CLASS_VARIABLE}/uo : + /#{patterns::CLASS_VARIABLE}/o) kind = :class_variable + value_expected = false else - kind = :error - match = (scan(/./mu) rescue nil) || getch - if !unicode && match.size > 1 - # warn 'Switching to unicode mode because of char %p' % [match] - unicode = true - unscan + if method_call_expected + method_call_expected = false next end + if !unicode + # check for unicode + debug, $DEBUG = $DEBUG, false + begin + if check(/./mu).size > 1 + # seems like we should try again with unicode + unicode = true + end + rescue + # bad unicode char; use getch + ensure + $DEBUG = debug + end + next if unicode + end + kind = :error + match = getch end + + if last_state + state = last_state + last_state = nil + end elsif state == :def_expected - state = :initial - if scan(/self\./) - tokens << ['self', :pre_constant] - tokens << ['.', :operator] - end if match = scan(unicode ? /(?>#{patterns::METHOD_NAME_EX})(?!\.|::)/uo : /(?>#{patterns::METHOD_NAME_EX})(?!\.|::)/o) kind = :method + state = :initial + else + last_state = :dot_expected + state = :initial + next + end + + elsif state == :dot_expected + if match = scan(/\.|::/) + # invalid definition + state = :def_expected + kind = :operator else + state = :initial next end @@ -313,7 +372,8 @@ module Scanners kind = :operator else state = :initial - if match = scan(/ (?:#{patterns::IDENT}::)* #{patterns::IDENT} /ox) + if match = scan(unicode ? / (?:#{patterns::IDENT}::)* #{patterns::IDENT} /oux : + / (?:#{patterns::IDENT}::)* #{patterns::IDENT} /ox) kind = :class else next @@ -322,7 +382,8 @@ module Scanners elsif state == :undef_expected state = :undef_comma_expected - if match = scan(/#{patterns::METHOD_NAME_EX}/o) + if match = scan(unicode ? /(?>#{patterns::METHOD_NAME_EX})(?!\.|::)/uo : + /(?>#{patterns::METHOD_NAME_EX})(?!\.|::)/o) kind = :method elsif match = scan(/#{patterns::SYMBOL}/o) case delim = match[1] @@ -363,35 +424,28 @@ module Scanners end end -# }}} - - unless kind == :error - value_expected = value_expected == :set - last_token_dot = last_token_dot == :set - end - if $DEBUG and not kind + if $CODERAY_DEBUG and not kind raise_inspect 'Error token %p in line %d' % [[match, kind], line], tokens, state end - raise_inspect 'Empty token', tokens unless match + raise_inspect 'Empty token', tokens, state unless match tokens << [match, kind] - - if last_state - state = last_state - last_state = nil - end end end - inline_block_stack << [state] if state.is_a? patterns::StringState - until inline_block_stack.empty? - this_block = inline_block_stack.pop - tokens << [:close, :inline] if this_block.size > 1 - state = this_block.first + # cleaning up + if state.is_a? patterns::StringState tokens << [:close, state.type] end + if inline_block_stack + until inline_block_stack.empty? + state, *more = inline_block_stack.pop + tokens << [:close, :inline] if more + tokens << [:close, state.type] + end + end tokens end @@ -400,5 +454,3 @@ module Scanners end end - -# vim:fdm=marker diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb index 576beda..0388bde 100644 --- a/lib/coderay/scanners/ruby/patterns.rb +++ b/lib/coderay/scanners/ruby/patterns.rb @@ -2,7 +2,7 @@ module CodeRay module Scanners - module Ruby::Patterns # :nodoc: + module Ruby::Patterns # :nodoc: all RESERVED_WORDS = %w[ and def end in or unless begin @@ -13,25 +13,28 @@ module Scanners undef yield ] - 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) - + # See http://murfy.de/ruby-constants. PREDEFINED_CONSTANTS = %w[ nil true false self - DATA ARGV ARGF __FILE__ __LINE__ + DATA ARGV ARGF ENV + FALSE TRUE NIL + STDERR STDIN STDOUT + TOPLEVEL_BINDING + RUBY_COPYRIGHT RUBY_DESCRIPTION RUBY_ENGINE RUBY_PATCHLEVEL + RUBY_PLATFORM RUBY_RELEASE_DATE RUBY_REVISION RUBY_VERSION + __FILE__ __LINE__ __ENCODING__ ] IDENT_KIND = WordList.new(:ident). add(RESERVED_WORDS, :reserved). add(PREDEFINED_CONSTANTS, :pre_constant) + KEYWORD_NEW_STATE = WordList.new(:initial). + add(%w[ def ], :def_expected). + add(%w[ undef ], :undef_expected). + add(%w[ alias ], :alias_expected). + add(%w[ class module ], :module_expected) + IDENT = 'ä'[/[[:alpha:]]/] == 'ä' ? /[[:alpha:]_][[:alnum:]_]*/ : /[^\W\d]\w*/ METHOD_NAME = / #{IDENT} [?!]? /ox @@ -45,7 +48,9 @@ module Scanners | ===? | =~ # simple equality, case equality, match | ![~=@]? # negation with and without at sign, not-equal and not-match /ox - METHOD_NAME_EX = / #{IDENT} (?:[?!]|=(?!>))? | #{METHOD_NAME_OPERATOR} /ox + METHOD_SUFFIX = / (?: [?!] | = (?![~>]|=(?!>)) ) /x + METHOD_NAME_EX = / #{IDENT} #{METHOD_SUFFIX}? | #{METHOD_NAME_OPERATOR} /ox + METHOD_AFTER_DOT = / #{IDENT} [?!]? | #{METHOD_NAME_OPERATOR} /ox INSTANCE_VARIABLE = / @ #{IDENT} /ox CLASS_VARIABLE = / @@ #{IDENT} /ox OBJECT_VARIABLE = / @@? #{IDENT} /ox @@ -59,7 +64,7 @@ module Scanners } QUOTE_TO_TYPE.default = :string - REGEXP_MODIFIERS = /[mixounse]*/ + REGEXP_MODIFIERS = /[mousenix]*/ REGEXP_SYMBOLS = /[|?*+(){}\[\].^$]/ DECIMAL = /\d+(?:_\d+)*/ @@ -131,6 +136,8 @@ module Scanners (?: \Z | (?=^\#CODE) ) /mx + RUBYDOC_OR_DATA = / #{RUBYDOC} | #{DATA} /xo + # Checks for a valid value to follow. This enables # value_expected in method calls without parentheses. VALUE_FOLLOWS = / @@ -141,7 +148,7 @@ module Scanners | [-+] \d | #{CHARACTER} ) - /x + /ox KEYWORDS_EXPECTING_VALUE = WordList.new.add(%w[ and end in or unless begin defined? ensure redo super until @@ -151,11 +158,7 @@ module Scanners yield ]) - RUBYDOC_OR_DATA = / #{RUBYDOC} | #{DATA} /xo - - RDOC_DATA_START = / ^=begin (?!\S) | ^__END__$ /x - - FANCY_START_CORRECT = / % ( [qQwWxsr] | (?![a-zA-Z0-9]) ) ([^a-zA-Z0-9]) /mx + FANCY_START = / % ( [qQwWxsr] | (?![a-zA-Z0-9]) ) ([^a-zA-Z0-9]) /mx FancyStringType = { 'q' => [:string, false], @@ -168,7 +171,7 @@ module Scanners FancyStringType['W'] = FancyStringType[''] = FancyStringType['Q'] class StringState < Struct.new :type, :interpreted, :delim, :heredoc, - :paren, :paren_depth, :pattern, :next_state + :opening_paren, :paren_depth, :pattern, :next_state CLOSING_PAREN = Hash[ *%w[ ( ) @@ -223,12 +226,13 @@ module Scanners delim = nil else pattern = STRING_PATTERN[ [delim, interpreted] ] - if paren = CLOSING_PAREN[delim] - delim, paren = paren, delim + if closing_paren = CLOSING_PAREN[delim] + opening_paren = delim + delim = closing_paren paren_depth = 1 end end - super kind, interpreted, delim, heredoc, paren, paren_depth, pattern, :initial + super kind, interpreted, delim, heredoc, opening_paren, paren_depth, pattern, :initial end end unless defined? StringState diff --git a/test/scanners/ruby/1.expected.raydebug b/test/scanners/ruby/1.expected.raydebug index 6b28d8b..8f5b7be 100644 --- a/test/scanners/ruby/1.expected.raydebug +++ b/test/scanners/ruby/1.expected.raydebug @@ -13,11 +13,11 @@ reserved(module) class(Bytes) constant(FactorOfSuffix)operator([)ident(c)operator([)integer(0)operator(,)integer(1)operator(])operator(]) operator(=) ident(const_get) ident(c) reserved(end) - reserved(def) constant(Bytes)operator(.)ident(factor_of_suffix) ident(suff) + reserved(def) constant(Bytes)operator(.)method(factor_of_suffix) ident(suff) constant(FactorOfSuffix)operator([)ident(suff)operator(]) reserved(end) - reserved(def) constant(Bytes)operator(.)ident([]) ident(str) + reserved(def) constant(Bytes)operator(.)method([]) ident(str) ident(n)operator(,) ident(fac) operator(=) ident(str) operator(/) regexp<delimiter(/)content((.+\)([A-Z]\))delimiter(/)> ident(n) operator(=) ident(n)operator(.)ident(to_i) ident(fac) operator(=) ident(factor_of_suffix) ident(fac) @@ -676,12 +676,12 @@ reserved(module) class(Chess) string<delimiter(')content(Position(%p, %p\))delimiter(')> operator(%) operator([)ident(x)operator(,) ident(y)operator(]) reserved(end) - reserved(def) constant(Position)operator(.)ident(decode) ident(pos) + reserved(def) constant(Position)operator(.)method(decode) ident(pos) ident(x)operator(,) ident(y) operator(=) ident(pos)operator(.)ident(split)operator(()string<delimiter(')delimiter(')>operator(\)) reserved(return) ident(x)operator(.)ident(upcase)operator([)integer(0)operator(]) operator(-) integer(?A) operator(+) integer(1)operator(,) instance_variable(@y) operator(=) ident(y)operator([)integer(0)operator(]) operator(-) integer(?0) reserved(end) - reserved(def) constant(Position)operator(.)ident(valid?) ident(x)operator(,) ident(y) + reserved(def) constant(Position)operator(.)method(valid?) ident(x)operator(,) ident(y) constant(BOARD_RANGE)operator(.)ident(include?) ident(x) reserved(and) constant(BOARD_RANGE)operator(.)ident(include?) ident(y) reserved(end) reserved(end) diff --git a/test/scanners/ruby/def.expected.raydebug b/test/scanners/ruby/def.expected.raydebug index 3438491..9d6ac01 100644 --- a/test/scanners/ruby/def.expected.raydebug +++ b/test/scanners/ruby/def.expected.raydebug @@ -32,7 +32,7 @@ reserved(def) method(!)operator(;) reserved(end) comment(# Ruby 1.9) comment(# singleton methods) -reserved(def) constant(Class)operator(.)ident(method) +reserved(def) constant(Class)operator(.)method(method) reserved(end) reserved(def) pre_constant(self)operator(.)method(method) @@ -41,6 +41,9 @@ reserved(end) reserved(def) ident(object)operator(.)method(method) reserved(end) +reserved(def) ident(object)operator(.)method(Method) +reserved(end) + reserved(def) global_variable($~)operator(.)method(method) reserved(end) diff --git a/test/scanners/ruby/def.in.rb b/test/scanners/ruby/def.in.rb index 934dba1..b2cd085 100644 --- a/test/scanners/ruby/def.in.rb +++ b/test/scanners/ruby/def.in.rb @@ -27,7 +27,7 @@ def [];end def def;end def end?;end def a(*) end -def !; end # Ruby 1.9 +def !; end # Ruby 1.9.1 # singleton methods @@ -41,6 +41,9 @@ end def object.method end +def object.Method +end + def $~.method end diff --git a/test/scanners/ruby/evil.expected.raydebug b/test/scanners/ruby/evil.expected.raydebug index 1ac138c..448c327 100644 --- a/test/scanners/ruby/evil.expected.raydebug +++ b/test/scanners/ruby/evil.expected.raydebug @@ -4,10 +4,10 @@ reserved(class) class(Class) reserved(end) reserved(end) comment(#def String(x\) x.to_s end #it's already built-in. duh!) -reserved(def) constant(String)operator(.)ident(*)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)ident(right)operator(]) reserved(end) -reserved(def) constant(String)operator(.)ident(<<)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:<<)operator(,)ident(right)operator(]) reserved(end) -reserved(def) constant(String)operator(.)ident(/)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:/)operator(,)ident(right)operator(]) reserved(end) -reserved(def) constant(String)operator(.)ident([])operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:[])operator(,)ident(right)operator(]) reserved(end) +reserved(def) constant(String)operator(.)method(*)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)ident(right)operator(]) reserved(end) +reserved(def) constant(String)operator(.)method(<<)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:<<)operator(,)ident(right)operator(]) reserved(end) +reserved(def) constant(String)operator(.)method(/)operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:/)operator(,)ident(right)operator(]) reserved(end) +reserved(def) constant(String)operator(.)method([])operator(()ident(right)operator(\)) operator([)pre_constant(self)operator(,)symbol(:[])operator(,)ident(right)operator(]) reserved(end) ident(p)operator(()constant(String)operator(::)constant(Class)operator(\)) ident(p)operator(()constant(String)operator(::) constant(Class)operator(\)) ident(p)operator(()constant(String) operator(::)constant(Class)operator(\)) @@ -110,10 +110,10 @@ ident(p) operator(/) integer(5)operator(/)ident(mix) reserved(module) class(M33) ident(p)operator(=)string<delimiter(")content(var:)delimiter(")> constant(Q)operator(=)string<delimiter(")content(func:)delimiter(")> - reserved(def) constant(Q)operator(.)ident(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) + reserved(def) constant(Q)operator(.)method(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) pre_constant(self)operator(+)ident(name)operator(.)ident(to_s)operator(+)operator(()ident(args)operator(.)ident(join)string<delimiter(')content( )delimiter(')>operator(\)) reserved(end) - reserved(def) ident(p)operator(.)ident(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) + reserved(def) ident(p)operator(.)method(method_missing)operator(()ident(name)operator(,)operator(*)ident(args)operator(\)) pre_constant(self)operator(+)ident(name)operator(.)ident(to_s)operator(+)operator(()ident(args)operator(.)ident(join)string<delimiter(')content( )delimiter(')>operator(\)) reserved(end) reserved(def) pre_constant(self)operator(.)method(p)operator(()operator(*)ident(a)operator(\))operator(;) reserved(super)operator(;) constant(Q) reserved(end) @@ -402,8 +402,8 @@ ident(a)operator(=)integer(5) ident(p) ident(p) integer(+5) ident(p) ident(a) integer(+5) -reserved(def) pre_constant(nil)operator(.)ident(+)operator(()ident(x)operator(\)) operator(~)ident(x) reserved(end) -reserved(def) pre_constant(nil)operator(.)ident([])operator(()operator(*)ident(x)operator(\)) operator([)ident(x)operator(]) reserved(end) +reserved(def) pre_constant(nil)operator(.)method(+)operator(()ident(x)operator(\)) operator(~)ident(x) reserved(end) +reserved(def) pre_constant(nil)operator(.)method([])operator(()operator(*)ident(x)operator(\)) operator([)ident(x)operator(]) reserved(end) ident(p)operator(() ident(p) operator(+) integer(5) operator(\)) ident(p)operator(() ident(p) integer(+5) operator(\)) ident(p)operator(() ident(p)operator(+)integer(5) operator(\)) @@ -490,7 +490,7 @@ ident(p) operator(-)operator(()integer(4)operator(\)) ident(p) symbol<symbol(:)delimiter(')char(\\\\)delimiter(')> reserved(class) class(Foop) - reserved(def) constant(Foop)operator(.)ident(bar) ident(a)operator(,)ident(b) + reserved(def) constant(Foop)operator(.)method(bar) ident(a)operator(,)ident(b) ident(p) ident(a)operator(,)ident(b) reserved(end) reserved(end) @@ -499,7 +499,7 @@ constant(Foop)operator(::)ident(bar) integer(3)operator(,)integer(4) reserved(class) class(Foop) - reserved(def) constant(Foop)operator(::)ident(baz) ident(a)operator(,)ident(b) + reserved(def) constant(Foop)operator(::)method(baz) ident(a)operator(,)ident(b) ident(p) symbol(:baz)operator(,)ident(a)operator(,)ident(b) reserved(end) reserved(end) @@ -792,7 +792,7 @@ reserved(def) method(params_quoted)operator(()ident(field_name)operator(,) ident reserved(if) ident(block_given?) reserved(then) reserved(yield) ident(field_name) reserved(else) ident(default) reserved(end) reserved(end) reserved(def) method(==)operator(()ident(o)operator(\)) integer(444) reserved(end) -reserved(def) constant(String)operator(.)ident(ffff4)operator(()operator(\)) pre_constant(self)operator(.)ident(to_s)operator(+)string<delimiter(")content(ffff)delimiter(")> reserved(end) +reserved(def) constant(String)operator(.)method(ffff4)operator(()operator(\)) pre_constant(self)operator(.)ident(to_s)operator(+)string<delimiter(")content(ffff)delimiter(")> reserved(end) ident(p) operator(*)operator([)operator(]) reserved(for) ident(i) reserved(in) \ @@ -996,7 +996,7 @@ the quick brown fox jumped over the lazy dog stuff =end) -ident(p) constant(ENV)operator([)string<delimiter(")content(AmritaCacheDir)delimiter(")>operator(]) +ident(p) pre_constant(ENV)operator([)string<delimiter(")content(AmritaCacheDir)delimiter(")>operator(]) ident(p) string<delimiter(<<-BEGIN)> operator(+) string<delimiter(<<-END)>string<content( def element_downcase(attributes = {}\))delimiter( BEGIN)>string<content( diff --git a/test/scanners/ruby/example.expected.raydebug b/test/scanners/ruby/example.expected.raydebug index 0bcb704..3b3ae57 100644 --- a/test/scanners/ruby/example.expected.raydebug +++ b/test/scanners/ruby/example.expected.raydebug @@ -914,7 +914,7 @@ reserved(class) class(Rweb) instance_variable(@output_allowed) operator(=) pre_constant(false)operator(;) instance_variable(@mod_ruby) operator(=) pre_constant(false) - instance_variable(@env) operator(=) constant(ENV)operator(.)ident(to_hash) + instance_variable(@env) operator(=) pre_constant(ENV)operator(.)ident(to_hash) reserved(if) reserved(defined?)operator(()constant(MOD_RUBY)operator(\)) instance_variable(@output_method) operator(=) string<delimiter(")content(mod_ruby)delimiter(")> @@ -1302,7 +1302,7 @@ reserved(class) class(Rweb) reserved(end) comment(# Decodes URL encoded data, %20 for example stands for a space.) - reserved(def) constant(Rweb)operator(.)ident(unescape)operator(()ident(str)operator(\)) + reserved(def) constant(Rweb)operator(.)method(unescape)operator(()ident(str)operator(\)) comment(# {{{) reserved(if) reserved(defined?) ident(str) reserved(and) ident(str)operator(.)ident(is_a?) constant(String) ident(str)operator(.)ident(gsub!)operator(()regexp<delimiter(/)char(\\+)delimiter(/)>operator(,) string<delimiter(")content( )delimiter(")>operator(\)) @@ -1320,9 +1320,9 @@ reserved(class) class(Rweb) constant(Cookie)operator(.)ident(disallow) comment(# no more cookies can be set or modified) reserved(if) operator(!)operator(()instance_variable(@settings)operator(.)ident(has_key?)operator(()string<delimiter(")content(silent)delimiter(")>operator(\)) reserved(and) instance_variable(@settings)operator([)string<delimiter(")content(silent)delimiter(")>operator(]) operator(==) pre_constant(true)operator(\)) reserved(and) operator(!)instance_variable(@header)operator(.)ident(has_key?)operator(()string<delimiter(")content(x-powered-by)delimiter(")>operator(\)) reserved(if) instance_variable(@mod_ruby) - ident(header)operator(()string<delimiter(")content(x-powered-by: )inline<inline_delimiter(#{)constant(RWEB)inline_delimiter(})>content( (Ruby/)inline<inline_delimiter(#{)constant(RUBY_VERSION)inline_delimiter(})>content(, )inline<inline_delimiter(#{)constant(MOD_RUBY)inline_delimiter(})>content(\))delimiter(")>operator(\))operator(;) + ident(header)operator(()string<delimiter(")content(x-powered-by: )inline<inline_delimiter(#{)constant(RWEB)inline_delimiter(})>content( (Ruby/)inline<inline_delimiter(#{)pre_constant(RUBY_VERSION)inline_delimiter(})>content(, )inline<inline_delimiter(#{)constant(MOD_RUBY)inline_delimiter(})>content(\))delimiter(")>operator(\))operator(;) reserved(else) - ident(header)operator(()string<delimiter(")content(x-powered-by: )inline<inline_delimiter(#{)constant(RWEB)inline_delimiter(})>content( (Ruby/)inline<inline_delimiter(#{)constant(RUBY_VERSION)inline_delimiter(})>content(\))delimiter(")>operator(\))operator(;) + ident(header)operator(()string<delimiter(")content(x-powered-by: )inline<inline_delimiter(#{)constant(RWEB)inline_delimiter(})>content( (Ruby/)inline<inline_delimiter(#{)pre_constant(RUBY_VERSION)inline_delimiter(})>content(\))delimiter(")>operator(\))operator(;) reserved(end) reserved(end) @@ -1610,7 +1610,7 @@ reserved(class) class(Cookie) comment(# Changes the type of all cookies.) comment(# Allowed values are RFC2109 and netscape (default\).) - reserved(def) constant(Cookie)operator(.)ident(type)operator(=)operator(()ident(type)operator(\)) + reserved(def) constant(Cookie)operator(.)method(type=)operator(()ident(type)operator(\)) comment(# {{{) reserved(unless) class_variable(@@allowed) ident(raise) string<delimiter(")content(The cookies are allready send, so you can't change the type anymore.)delimiter(")> @@ -1624,7 +1624,7 @@ reserved(class) class(Cookie) comment(# After sending this message, no cookies can be set or modified. Use it, when) comment(# HTTP-Headers are send. Rweb does this for you.) - reserved(def) constant(Cookie)operator(.)ident(disallow) + reserved(def) constant(Cookie)operator(.)method(disallow) comment(# {{{) class_variable(@@allowed) operator(=) pre_constant(false) pre_constant(true) @@ -1633,7 +1633,7 @@ reserved(class) class(Cookie) comment(# Returns a HTTP header (type String\) with all cookies. Rweb does this for) comment(# you.) - reserved(def) constant(Cookie)operator(.)ident(getHttpHeader) + reserved(def) constant(Cookie)operator(.)method(getHttpHeader) comment(# {{{) reserved(if) reserved(defined?)operator(()class_variable(@@list)operator(\)) reserved(if) class_variable(@@type) operator(==) string<delimiter(")content(netscape)delimiter(")> @@ -1851,7 +1851,7 @@ comment(=begin reserved(end) reserved(class) class(Parser) - reserved(def) constant(Parser)operator(.)ident(flatten) ident(str) + reserved(def) constant(Parser)operator(.)method(flatten) ident(str) comment(# replace mac & dos newlines with unix style) ident(str)operator(.)ident(gsub)operator(()regexp<delimiter(/)char(\\r)char(\\n)content(?)delimiter(/)>operator(,) string<delimiter(")char(\\n)delimiter(")>operator(\)) reserved(end) @@ -2772,7 +2772,7 @@ reserved(module) class(WhyTheLuckyStiff) reserved(end) reserved(end) - reserved(def) constant(Book)operator(::)ident(load)operator(() ident(file_name) operator(\)) + reserved(def) constant(Book)operator(::)method(load)operator(() ident(file_name) operator(\)) constant(YAML)operator(::)ident(load)operator(() constant(File)operator(.)ident(open)operator(() ident(file_name) operator(\)) operator(\)) reserved(end) @@ -2977,7 +2977,7 @@ comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) reserved(for) ident(y) reserved(in) operator(-)constant(D_MAX)operator(..)constant(D_MAX) ident(h1) operator(=) operator(()ident(x) operator(+) ident(y) operator(-) integer(2)operator(\))operator(.)ident(abs) ident(h2) operator(=) operator(()ident(y) operator(-) ident(x) operator(+) integer(1)operator(\))operator(.)ident(abs) - constant(GL)operator(.)constant(PushMatrix) + constant(GL)operator(.)ident(PushMatrix) ident(c) operator(=) operator([)integer(1)operator(,) integer(0)operator(,) integer(0)operator(,) integer(1)operator(]) constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) @@ -2994,11 +2994,11 @@ comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)constant(End) + constant(GL)operator(.)ident(End) - constant(GL)operator(.)constant(PopMatrix) + constant(GL)operator(.)ident(PopMatrix) - constant(GL)operator(.)constant(PushMatrix) + constant(GL)operator(.)ident(PushMatrix) ident(c) operator(=) operator([)integer(0)operator(,) integer(0)operator(,) integer(1)operator(,) integer(1)operator(]) constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) @@ -3015,11 +3015,11 @@ comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)constant(End) + constant(GL)operator(.)ident(End) - constant(GL)operator(.)constant(PopMatrix) + constant(GL)operator(.)ident(PopMatrix) - constant(GL)operator(.)constant(PushMatrix) + constant(GL)operator(.)ident(PushMatrix) ident(c) operator(=) operator([)float(0.0) operator(+) operator(()ident(x)operator(/)float(10.0)operator(\))operator(,) float(0.0) operator(+) operator(()ident(y)operator(/)float(10.0)operator(\))operator(,) integer(0)operator(,) integer(1)operator(]) constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(AMBIENT)operator(,) ident(c)operator(\)) constant(GL)operator(.)ident(Material)operator(()constant(GL)operator(::)constant(FRONT)operator(,) constant(GL)operator(::)constant(DIFFUSE)operator(,) ident(c)operator(\)) @@ -3036,9 +3036,9 @@ comment(# @size = 0.5 + 0.2 * Math.cos(Deg2Rad * @angle\)) constant(GL)operator(.)ident(Vertex)operator(()operator(-)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(-)constant(SQUARE_SIZE)operator(\)) constant(GL)operator(.)ident(Vertex)operator(()operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(,) operator(+)constant(SQUARE_SIZE)operator(\)) - constant(GL)operator(.)constant(End) + constant(GL)operator(.)ident(End) - constant(GL)operator(.)constant(PopMatrix) + constant(GL)operator(.)ident(PopMatrix) reserved(end) reserved(end) @@ -3542,7 +3542,7 @@ reserved(class) class(Scanner) comment(# To allow Scanner.new without parameters.) constant(DUMMY_INPUT) operator(=) string<delimiter(')content(dummy file)delimiter(')> - reserved(def) constant(DUMMY_INPUT)operator(.)ident(getc) + reserved(def) constant(DUMMY_INPUT)operator(.)method(getc) pre_constant(nil) reserved(end) diff --git a/test/scanners/ruby/jarh.expected.raydebug b/test/scanners/ruby/jarh.expected.raydebug index 27938b2..014010b 100644 --- a/test/scanners/ruby/jarh.expected.raydebug +++ b/test/scanners/ruby/jarh.expected.raydebug @@ -197,7 +197,7 @@ ident(print) string<delimiter(')content(Just )delimiter(')> string<delimiter(')c ident(print) constant(File)operator(.)ident(dirname)operator(()string<delimiter(')content(Just another Ruby hacker,/Just another Ruby porter,)delimiter(')>operator(\)) -reserved(def) global_variable($_)operator(.)ident(singleton_method_added)operator(()operator(*)operator(\)) ident(print) string<delimiter(')content(Just another Ruby hacker,)delimiter(')> reserved(end) +reserved(def) global_variable($_)operator(.)method(singleton_method_added)operator(()operator(*)operator(\)) ident(print) string<delimiter(')content(Just another Ruby hacker,)delimiter(')> reserved(end) ident(print) operator([)string<delimiter(')content(Just another Ruby hacker,)delimiter(')>operator(])operator(.)ident(delete_at)operator(()integer(0)operator(\)) diff --git a/test/scanners/ruby/pleac.expected.raydebug b/test/scanners/ruby/pleac.expected.raydebug index 021b8c3..778433c 100644 --- a/test/scanners/ruby/pleac.expected.raydebug +++ b/test/scanners/ruby/pleac.expected.raydebug @@ -290,7 +290,7 @@ reserved(def) method(login_names) reserved(end) ident(puts) string<delimiter(")content(Lookup user: )delimiter(")> -ident(user) operator(=) constant(STDIN)operator(.)ident(gets) +ident(user) operator(=) pre_constant(STDIN)operator(.)ident(gets) ident(user)operator(.)ident(chomp!) ident(exit) reserved(unless) ident(user) ident(name_code) operator(=) constant(Text)operator(::)constant(Soundex)operator(.)ident(soundex)operator(()ident(user)operator(\)) @@ -427,7 +427,7 @@ reserved(class) class(Integer) ident(roman) reserved(end) - reserved(def) constant(Integer)operator(.)ident(from_roman)operator(()ident(roman)operator(\)) + reserved(def) constant(Integer)operator(.)method(from_roman)operator(()ident(roman)operator(\)) ident(ustr) operator(=) ident(roman)operator(.)ident(upcase) ident(sum) operator(=) integer(0) reserved(for) ident(entry) reserved(in) class_variable(@@romanlist) @@ -539,22 +539,22 @@ ident(tan_val) operator(=) constant(Math)operator(.)ident(tan)operator(()ident(a comment(# AFAIK Ruby's Math module doesn't provide acos/asin) comment(# While we're at it, let's also define missing hyperbolic functions) reserved(module) class(Math) - reserved(def) constant(Math)operator(.)ident(asin)operator(()ident(x)operator(\)) + reserved(def) constant(Math)operator(.)method(asin)operator(()ident(x)operator(\)) ident(atan2)operator(()ident(x)operator(,) ident(sqrt)operator(()integer(1) operator(-) ident(x)operator(**)integer(2)operator(\))operator(\)) reserved(end) - reserved(def) constant(Math)operator(.)ident(acos)operator(()ident(x)operator(\)) + reserved(def) constant(Math)operator(.)method(acos)operator(()ident(x)operator(\)) ident(atan2)operator(()ident(sqrt)operator(()integer(1) operator(-) ident(x)operator(**)integer(2)operator(\))operator(,) ident(x)operator(\)) reserved(end) - reserved(def) constant(Math)operator(.)ident(atan)operator(()ident(x)operator(\)) + reserved(def) constant(Math)operator(.)method(atan)operator(()ident(x)operator(\)) ident(atan2)operator(()ident(x)operator(,) integer(1)operator(\)) reserved(end) - reserved(def) constant(Math)operator(.)ident(sinh)operator(()ident(x)operator(\)) + reserved(def) constant(Math)operator(.)method(sinh)operator(()ident(x)operator(\)) operator(()ident(exp)operator(()ident(x)operator(\)) operator(-) ident(exp)operator(()operator(-)ident(x)operator(\))operator(\)) operator(/) integer(2) reserved(end) - reserved(def) constant(Math)operator(.)ident(cosh)operator(()ident(x)operator(\)) + reserved(def) constant(Math)operator(.)method(cosh)operator(()ident(x)operator(\)) operator(()ident(exp)operator(()ident(x)operator(\)) operator(+) ident(exp)operator(()operator(-)ident(x)operator(\))operator(\)) operator(/) integer(2) reserved(end) - reserved(def) constant(Math)operator(.)ident(tanh)operator(()ident(x)operator(\)) + reserved(def) constant(Math)operator(.)method(tanh)operator(()ident(x)operator(\)) ident(sinh)operator(()ident(x)operator(\)) operator(/) ident(cosh)operator(()ident(x)operator(\)) reserved(end) reserved(end) @@ -980,8 +980,8 @@ reserved(for) ident(user) reserved(in) ident(bad_users) ident(complain)operator(()ident(user)operator(\)) reserved(end) -reserved(for) ident(var) reserved(in) constant(ENV)operator(.)ident(keys)operator(.)ident(sort) - ident(puts) string<delimiter(")inline<inline_delimiter(#{)ident(var)inline_delimiter(})>content(=)inline<inline_delimiter(#{)constant(ENV)operator([)ident(var)operator(])inline_delimiter(})>delimiter(")> +reserved(for) ident(var) reserved(in) pre_constant(ENV)operator(.)ident(keys)operator(.)ident(sort) + ident(puts) string<delimiter(")inline<inline_delimiter(#{)ident(var)inline_delimiter(})>content(=)inline<inline_delimiter(#{)pre_constant(ENV)operator([)ident(var)operator(])inline_delimiter(})>delimiter(")> reserved(end) reserved(for) ident(user) reserved(in) ident(all_users) @@ -1011,7 +1011,7 @@ reserved(end) comment(# same drawback as in problem 1.4, we can't mutate a Numeric...) ident(array)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v) operator(-) integer(1) operator(}) -ident(a) operator(=) operator([) operator(.)integer(5)operator(,) integer(3) operator(])operator(;) ident(b) operator(=) operator([) integer(0)operator(,) integer(1) operator(]) +ident(a) operator(=) operator([) operator(.)error(5)operator(,) integer(3) operator(])operator(;) ident(b) operator(=) operator([) integer(0)operator(,) integer(1) operator(]) reserved(for) ident(ary) reserved(in) operator([) ident(a)operator(,) ident(b) operator(]) ident(ary)operator(.)ident(collect!) operator({) operator(|)ident(v)operator(|) ident(v) operator(*) integer(7) operator(}) reserved(end) @@ -1130,7 +1130,7 @@ ident(sorted) operator(=) ident(unsorted)operator(.)ident(sort) operator({) oper comment(# let's use the list of my own PID's) shell<delimiter(`)content(ps ux)delimiter(`)>operator(.)ident(split)operator(()string<delimiter(")char(\\n)delimiter(")>operator(\))operator([)integer(1)operator(..)integer(-1)operator(])operator(.) - ident(select) operator({) operator(|)ident(i)operator(|) ident(i) operator(=)operator(~) regexp<delimiter(/)content(^)inline<inline_delimiter(#{)constant(ENV)operator([)string<delimiter(')content(USER)delimiter(')>operator(])inline_delimiter(})>delimiter(/)> operator(})operator(.) + ident(select) operator({) operator(|)ident(i)operator(|) ident(i) operator(=)operator(~) regexp<delimiter(/)content(^)inline<inline_delimiter(#{)pre_constant(ENV)operator([)string<delimiter(')content(USER)delimiter(')>operator(])inline_delimiter(})>delimiter(/)> operator(})operator(.) ident(collect) operator({) operator(|)ident(i)operator(|) ident(i)operator(.)ident(split)operator([)integer(1)operator(]) operator(})operator(.) ident(sort) operator({) operator(|)ident(a)operator(,)ident(b)operator(|) ident(a)operator(.)ident(to_i) operator(<=>) ident(b)operator(.)ident(to_i) operator(})operator(.)ident(each) operator({) operator(|)ident(i)operator(|) ident(puts) ident(i) operator(}) ident(puts) string<delimiter(")content(Select a process ID to kill:)delimiter(")> @@ -1331,7 +1331,7 @@ comment(# we use a class with a class variable store the private cache) comment(# for the results of the factorial function.) reserved(class) class(Factorial) class_variable(@@fact) operator(=) operator([) integer(1) operator(]) - reserved(def) constant(Factorial)operator(.)ident(compute)operator(()ident(n)operator(\)) + reserved(def) constant(Factorial)operator(.)method(compute)operator(()ident(n)operator(\)) reserved(if) class_variable(@@fact)operator([)ident(n)operator(]) class_variable(@@fact)operator([)ident(n)operator(]) reserved(else) @@ -2592,9 +2592,9 @@ comment(#-----------------------------) constant(Dear) ident(someuser)instance_variable(@host)operator(.)ident(com)operator(,) constant(Please) ident(confirm) ident(the) ident(mail) ident(address) ident(you) ident(gave) ident(us) constant(Wed) constant(May) integer(6) integer(09)operator(:)integer(38)operator(:)integer(41) -constant(MDT) integer(1998) ident(by) ident(replying) ident(to) ident(this) ident(message)operator(.) constant(Include) ident(the) ident(string) +constant(MDT) integer(1998) ident(by) ident(replying) ident(to) ident(this) ident(message)operator(.) ident(Include) ident(the) ident(string) string<delimiter(")content(Rumpelstiltskin)delimiter(")> reserved(in) ident(that) ident(reply)operator(,) ident(but) ident(spelled) reserved(in) ident(reverse)operator(;) ident(that) ident(is)operator(,) -ident(start) ident(with) string<delimiter(")content(Nik...)delimiter(")>operator(.) constant(Once) ident(this) ident(is) ident(done)operator(,) ident(your) ident(confirmed) ident(address) ident(will) +ident(start) ident(with) string<delimiter(")content(Nik...)delimiter(")>operator(.) ident(Once) ident(this) ident(is) ident(done)operator(,) ident(your) ident(confirmed) ident(address) ident(will) ident(be) ident(entered) ident(into) ident(our) ident(records)operator(.) @@ -2672,7 +2672,7 @@ regexp<delimiter(%r/)content(^([01]?)char(\\d)char(\\d)content(|2[0-4])char(\\d) comment(#-----------------------------) ident(str)operator(.)ident(sub!)operator(()regexp<delimiter(%r|)content(^.*/)delimiter(|)>operator(,) string<delimiter(')delimiter(')>operator(\)) comment(#-----------------------------) -ident(cols) operator(=) operator(() operator(()constant(ENV)operator([)string<delimiter(')content(TERMCAP)delimiter(')>operator(]) operator(||) string<delimiter(")content( )delimiter(")>operator(\)) operator(=)operator(~) regexp<delimiter(/)content(:co#()char(\\d)content(+\):)delimiter(/)> operator(\)) operator(?) global_variable($1) operator(:) integer(80)operator(;) +ident(cols) operator(=) operator(() operator(()pre_constant(ENV)operator([)string<delimiter(')content(TERMCAP)delimiter(')>operator(]) operator(||) string<delimiter(")content( )delimiter(")>operator(\)) operator(=)operator(~) regexp<delimiter(/)content(:co#()char(\\d)content(+\):)delimiter(/)> operator(\)) operator(?) global_variable($1) operator(:) integer(80)operator(;) comment(#-----------------------------) ident(name) operator(=) string<delimiter(")content( )inline<inline_delimiter(#{)global_variable($0)inline_delimiter(})>content( )inline<inline_delimiter(#{)pre_constant(ARGV)inline_delimiter(})>delimiter(")>operator(.)ident(gsub)operator(()regexp<delimiter(%r|)content( /)char(\\S)content(+/)delimiter(|)>operator(,) string<delimiter(')content( )delimiter(')>operator(\)) comment(#-----------------------------) @@ -3028,7 +3028,7 @@ reserved(while) ident(gets) ident(gsub!)operator(()regexp<delimiter(/)content(DATE)delimiter(/)>operator(\))operator({)constant(Time)operator(.)ident(now)operator(}) ident(print) reserved(end) -global_variable($stdout) operator(=) constant(STDOUT) +global_variable($stdout) operator(=) pre_constant(STDOUT) comment(#-----------------------------) comment(#% ruby -i.old -pe 'gsub!(%r{\\bhisvar\\b}, 'hervar'\)' *.[Cchy]) @@ -3393,7 +3393,7 @@ reserved(if) pre_constant(ARGV)operator(.)ident(length) operator(!=) integer(1) reserved(end) ident(file) operator(=) pre_constant(ARGV)operator([)integer(0)operator(]) ident(atime)operator(,) ident(mtime) operator(=) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(atime)operator(,) constant(File)operator(.)ident(stat)operator(()ident(file)operator(\))operator(.)ident(mtime) -ident(system)operator(()constant(ENV)operator([)string<delimiter(")content(EDITOR)delimiter(")>operator(]) operator(||) string<delimiter(")content(vi)delimiter(")>operator(,) ident(file)operator(\)) +ident(system)operator(()pre_constant(ENV)operator([)string<delimiter(")content(EDITOR)delimiter(")>operator(]) operator(||) string<delimiter(")content(vi)delimiter(")>operator(,) ident(file)operator(\)) constant(File)operator(.)ident(utime)operator(()ident(atime)operator(,) ident(mtime)operator(,) ident(file)operator(\)) comment(#-----------------------------) @@ -3422,7 +3422,7 @@ ident(filenames)operator(.)ident(each) reserved(do) operator(|)ident(file)operat reserved(end) reserved(end) reserved(if) ident(count) operator(!=) ident(filenames)operator(.)ident(length) - constant(STDERR)operator(.)ident(puts) string<delimiter(")content(could only delete )inline<inline_delimiter(#{)ident(count)inline_delimiter(})>content( of )inline<inline_delimiter(#{)ident(filenames)operator(.)ident(length)inline_delimiter(})>content( files)delimiter(")> + pre_constant(STDERR)operator(.)ident(puts) string<delimiter(")content(could only delete )inline<inline_delimiter(#{)ident(count)inline_delimiter(})>content( of )inline<inline_delimiter(#{)ident(filenames)operator(.)ident(length)inline_delimiter(})>content( files)delimiter(")> reserved(end) @@ -3848,15 +3848,15 @@ comment(# In Ruby, it can be written as a static method and a static) comment(# variable) reserved(class) class(Counter) class_variable(@@counter) operator(=) integer(0) - reserved(def) constant(Counter)operator(.)ident(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) + reserved(def) constant(Counter)operator(.)method(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) reserved(end) comment(# There is no need of BEGIN since the variable will get) comment(# initialized when parsing) reserved(class) class(Counter) class_variable(@@counter) operator(=) integer(42) - reserved(def) constant(Counter)operator(.)ident(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) - reserved(def) constant(Counter)operator(.)ident(prev_counter)operator(;) class_variable(@@counter) operator(-=) integer(1)operator(;) reserved(end) + reserved(def) constant(Counter)operator(.)method(next_counter)operator(;) class_variable(@@counter) operator(+=) integer(1)operator(;) reserved(end) + reserved(def) constant(Counter)operator(.)method(prev_counter)operator(;) class_variable(@@counter) operator(-=) integer(1)operator(;) reserved(end) reserved(end) @@ -4297,7 +4297,7 @@ reserved(module) class(Your_Module) comment(# this would be called as Your_Module.function) reserved(end) - reserved(def) constant(Your_Module)operator(.)ident(another) + reserved(def) constant(Your_Module)operator(.)method(another) comment(# this is the same as above, but more specific) reserved(end) reserved(end) @@ -4495,7 +4495,7 @@ reserved(class) class(Person) reserved(end) comment(# Class method (also called static method\)) - reserved(def) constant(Person)operator(.)ident(number_of_people) + reserved(def) constant(Person)operator(.)method(number_of_people) class_variable(@@person_counter) reserved(end) reserved(end) @@ -4562,7 +4562,7 @@ reserved(class) class(MyClass) constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) reserved(end) - reserved(def) constant(MyClass)operator(.)ident(finalize)operator(()ident(id)operator(\)) + reserved(def) constant(MyClass)operator(.)method(finalize)operator(()ident(id)operator(\)) ident(puts) string<delimiter(")content(Object )inline<inline_delimiter(#{)ident(id)inline_delimiter(})>content( dying at )inline<inline_delimiter(#{)constant(Time)operator(.)ident(new)inline_delimiter(})>delimiter(")> reserved(end) reserved(end) @@ -4604,7 +4604,7 @@ reserved(class) class(Person) comment(# Class variables (also called static attributes\) are prefixed by @@) class_variable(@@person_counter) operator(=) integer(0) - reserved(def) constant(Person)operator(.)ident(population) + reserved(def) constant(Person)operator(.)method(population) class_variable(@@person_counter) reserved(end) reserved(def) method(initialize) @@ -4612,7 +4612,7 @@ reserved(class) class(Person) constant(ObjectSpace)operator(.)ident(define_finalizer)operator(()pre_constant(self)operator(,) pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) reserved(end) - reserved(def) constant(Person)operator(.)ident(finalize)operator(()ident(id)operator(\)) + reserved(def) constant(Person)operator(.)method(finalize)operator(()ident(id)operator(\)) class_variable(@@person_counter) operator(-=) integer(1) reserved(end) reserved(end) @@ -4644,7 +4644,7 @@ reserved(class) class(FixedArray) reserved(end) comment(# class method. This can only be called on a class,) comment(# but not on the instances) - reserved(def) constant(FixedArray)operator(.)ident(class_max_bounds)operator(=)operator(()ident(value)operator(\)) + reserved(def) constant(FixedArray)operator(.)method(class_max_bounds=)operator(()ident(value)operator(\)) class_variable(@@max_bounds) operator(=) ident(value) reserved(end) reserved(end) @@ -4879,11 +4879,11 @@ reserved(class) class(RingNode) pre_constant(self)operator(.)ident(class)operator(.)ident(method)operator(()symbol(:finalize)operator(\))operator(.)ident(to_proc)operator(\)) reserved(end) - reserved(def) constant(RingNode)operator(.)ident(finalize)operator(()ident(id)operator(\)) + reserved(def) constant(RingNode)operator(.)method(finalize)operator(()ident(id)operator(\)) ident(puts) string<delimiter(")content(Node )inline<inline_delimiter(#{)ident(id)inline_delimiter(})>content( dying)delimiter(")> reserved(end) - reserved(def) constant(RingNode)operator(.)ident(show_all_objects) + reserved(def) constant(RingNode)operator(.)method(show_all_objects) constant(ObjectSpace)operator(.)ident(each_object) operator({)operator(|)ident(id)operator(|) ident(puts) ident(id)operator(.)ident(name) reserved(if) ident(id)operator(.)ident(class) operator(==) constant(RingNode) operator(}) @@ -5642,7 +5642,7 @@ reserved(while) ident(gets)operator(()operator(\)) reserved(do) ident(print) reserved(end) comment(#-----------------------------) -integer(1)operator(:) operator(>) constant(Welcome) ident(to) constant(Linux)operator(,) ident(version) float(2.0)operator(.)integer(33) ident(on) ident(a) ident(i686) +integer(1)operator(:) operator(>) constant(Welcome) ident(to) constant(Linux)operator(,) ident(version) float(2.0)operator(.)error(33) ident(on) ident(a) ident(i686) integer(2)operator(:) operator(>) @@ -5650,7 +5650,7 @@ integer(3)operator(:) operator(>) string<delimiter(")content(The software re 4: > so I installed Linux.)delimiter(")> comment(#-----------------------------) -operator(>) integer(1)operator(:) constant(Welcome) ident(to) constant(Linux)operator(,) constant(Kernel) ident(version) float(2.0)operator(.)integer(33) ident(on) ident(a) ident(i686) +operator(>) integer(1)operator(:) constant(Welcome) ident(to) constant(Linux)operator(,) constant(Kernel) ident(version) float(2.0)operator(.)error(33) ident(on) ident(a) ident(i686) operator(>) integer(2)operator(:) @@ -5985,7 +5985,7 @@ reserved(class) class(Preforker) operator(()instance_variable(@prefork) operator(-) instance_variable(@child_count)operator(\))operator(.)ident(times) operator({) operator(|)ident(i)operator(|) ident(make_new_child) operator(}) - ident(sleep) operator(.)integer(1) + ident(sleep) operator(.)error(1) operator(}) reserved(end) reserved(end) @@ -6267,7 +6267,7 @@ doctype(#!/usr/bin/ruby) comment(# os_snipe - redirect to a Jargon File entry about current OS) ident(dir) operator(=) string<delimiter(')content(http://www.elsewhere.org/jargon/html/entry)delimiter(')> -ident(agent) operator(=) constant(ENV)operator([)string<delimiter(')content(HTTP_USER_AGENT)delimiter(')>operator(]) +ident(agent) operator(=) pre_constant(ENV)operator([)string<delimiter(')content(HTTP_USER_AGENT)delimiter(')>operator(]) ident(page) operator(=) reserved(case) reserved(when) ident(agent) operator(=)operator(~) regexp<delimiter(/)content(Mac)delimiter(/)>operator(:) string<delimiter(')content(Macintrash.html)delimiter(')> diff --git a/test/scanners/ruby/rails.expected.raydebug b/test/scanners/ruby/rails.expected.raydebug index 783a098..17cd1e7 100644 --- a/test/scanners/ruby/rails.expected.raydebug +++ b/test/scanners/ruby/rails.expected.raydebug @@ -2456,7 +2456,7 @@ reserved(module) class(TMail) ident(include) constant(TextUtils) - reserved(def) constant(Address)operator(.)ident(parse)operator(() ident(str) operator(\)) + reserved(def) constant(Address)operator(.)method(parse)operator(() ident(str) operator(\)) constant(Parser)operator(.)ident(parse) symbol(:ADDRESS)operator(,) ident(str) reserved(end) @@ -2831,7 +2831,7 @@ reserved(module) class(TMail) constant(DEFAULT_CONFIG) operator(=) constant(Config)operator(.)ident(new)operator(()pre_constant(false)operator(\)) constant(DEFAULT_STRICT_CONFIG) operator(=) constant(Config)operator(.)ident(new)operator(()pre_constant(true)operator(\)) - reserved(def) constant(Config)operator(.)ident(to_config)operator(() ident(arg) operator(\)) + reserved(def) constant(Config)operator(.)method(to_config)operator(() ident(arg) operator(\)) reserved(return) constant(DEFAULT_STRICT_CONFIG) reserved(if) ident(arg) operator(==) pre_constant(true) reserved(return) constant(DEFAULT_CONFIG) reserved(if) ident(arg) operator(==) pre_constant(false) ident(arg) reserved(or) constant(DEFAULT_CONFIG) @@ -3009,7 +3009,7 @@ reserved(module) class(TMail) constant(BENCODE_DEBUG) operator(=) pre_constant(false) reserved(unless) reserved(defined?)operator(()constant(BENCODE_DEBUG)operator(\)) - reserved(def) constant(Encoder)operator(.)ident(encode)operator(() ident(str) operator(\)) + reserved(def) constant(Encoder)operator(.)method(encode)operator(() ident(str) operator(\)) ident(e) operator(=) ident(new)operator(()operator(\)) ident(e)operator(.)ident(header_body) ident(str) ident(e)operator(.)ident(terminate) @@ -5404,7 +5404,7 @@ reserved(module) class(TMail) reserved(class) class(UNIXMbox) - reserved(def) constant(UNIXMbox)operator(.)ident(lock)operator(() ident(fname) operator(\)) + reserved(def) constant(UNIXMbox)operator(.)method(lock)operator(() ident(fname) operator(\)) reserved(begin) ident(f) operator(=) constant(File)operator(.)ident(open)operator(()ident(fname)operator(\)) ident(f)operator(.)ident(flock) constant(File)operator(::)constant(LOCK_EX) @@ -5419,12 +5419,12 @@ reserved(module) class(TMail) reserved(alias) method(newobj) method(new) reserved(end) - reserved(def) constant(UNIXMbox)operator(.)ident(new)operator(() ident(fname)operator(,) ident(tmpdir) operator(=) pre_constant(nil)operator(,) ident(readonly) operator(=) pre_constant(false) operator(\)) - ident(tmpdir) operator(=) constant(ENV)operator([)string<delimiter(')content(TEMP)delimiter(')>operator(]) operator(||) constant(ENV)operator([)string<delimiter(')content(TMP)delimiter(')>operator(]) operator(||) string<delimiter(')content(/tmp)delimiter(')> + reserved(def) constant(UNIXMbox)operator(.)method(new)operator(() ident(fname)operator(,) ident(tmpdir) operator(=) pre_constant(nil)operator(,) ident(readonly) operator(=) pre_constant(false) operator(\)) + ident(tmpdir) operator(=) pre_constant(ENV)operator([)string<delimiter(')content(TEMP)delimiter(')>operator(]) operator(||) pre_constant(ENV)operator([)string<delimiter(')content(TMP)delimiter(')>operator(]) operator(||) string<delimiter(')content(/tmp)delimiter(')> ident(newobj)operator(()ident(fname)operator(,) string<delimiter(")inline<inline_delimiter(#{)ident(tmpdir)inline_delimiter(})>content(/ruby_tmail_)inline<inline_delimiter(#{)global_variable($$)inline_delimiter(})>content(_)inline<inline_delimiter(#{)ident(rand)operator(()operator(\))inline_delimiter(})>delimiter(")>operator(,) ident(readonly)operator(,) pre_constant(false)operator(\)) reserved(end) - reserved(def) constant(UNIXMbox)operator(.)ident(static_new)operator(() ident(fname)operator(,) ident(dir)operator(,) ident(readonly) operator(=) pre_constant(false) operator(\)) + reserved(def) constant(UNIXMbox)operator(.)method(static_new)operator(() ident(fname)operator(,) ident(dir)operator(,) ident(readonly) operator(=) pre_constant(false) operator(\)) ident(newobj)operator(()ident(fname)operator(,) ident(dir)operator(,) ident(readonly)operator(,) pre_constant(true)operator(\)) reserved(end) @@ -5439,7 +5439,7 @@ reserved(module) class(TMail) constant(ObjectSpace)operator(.)ident(define_finalizer) pre_constant(self)operator(,) instance_variable(@finalizer) reserved(end) - reserved(def) constant(UNIXMbox)operator(.)ident(mkfinal)operator(() ident(mh)operator(,) ident(mboxfile)operator(,) ident(writeback_p)operator(,) ident(cleanup_p) operator(\)) + reserved(def) constant(UNIXMbox)operator(.)method(mkfinal)operator(() ident(mh)operator(,) ident(mboxfile)operator(,) ident(writeback_p)operator(,) ident(cleanup_p) operator(\)) ident(lambda) operator({) reserved(if) ident(writeback_p) ident(lock)operator(()ident(mboxfile)operator(\)) operator({)operator(|)ident(f)operator(|) @@ -5462,12 +5462,12 @@ reserved(module) class(TMail) reserved(end) comment(# make _From line) - reserved(def) constant(UNIXMbox)operator(.)ident(create_from_line)operator(() ident(port) operator(\)) + reserved(def) constant(UNIXMbox)operator(.)method(create_from_line)operator(() ident(port) operator(\)) ident(sprintf) string<delimiter(')content(From %s %s)delimiter(')>operator(,) ident(fromaddr)operator(()operator(\))operator(,) constant(TextUtils)operator(.)ident(time2str)operator(()constant(File)operator(.)ident(mtime)operator(()ident(port)operator(.)ident(filename)operator(\))operator(\)) reserved(end) - reserved(def) constant(UNIXMbox)operator(.)ident(fromaddr) + reserved(def) constant(UNIXMbox)operator(.)method(fromaddr) ident(h) operator(=) constant(HeaderField)operator(.)ident(new_from_port)operator(()ident(port)operator(,) string<delimiter(')content(Return-Path)delimiter(')>operator(\)) operator(||) constant(HeaderField)operator(.)ident(new_from_port)operator(()ident(port)operator(,) string<delimiter(')content(From)delimiter(')>operator(\)) reserved(or) reserved(return) string<delimiter(')content(nobody)delimiter(')> ident(a) operator(=) ident(h)operator(.)ident(addrs)operator([)integer(0)operator(]) reserved(or) reserved(return) string<delimiter(')content(nobody)delimiter(')> @@ -5575,7 +5575,7 @@ reserved(module) class(TMail) constant(PORT_CLASS) operator(=) constant(MaildirPort) instance_variable(@seq) operator(=) integer(0) - reserved(def) constant(Maildir)operator(.)ident(unique_number) + reserved(def) constant(Maildir)operator(.)method(unique_number) ident(synchronize) operator({) instance_variable(@seq) operator(+=) integer(1) reserved(return) instance_variable(@seq) @@ -5583,7 +5583,7 @@ reserved(module) class(TMail) reserved(end) reserved(def) method(initialize)operator(() ident(dir) operator(=) pre_constant(nil) operator(\)) - instance_variable(@dirname) operator(=) ident(dir) operator(||) constant(ENV)operator([)string<delimiter(')content(MAILDIR)delimiter(')>operator(]) + instance_variable(@dirname) operator(=) ident(dir) operator(||) pre_constant(ENV)operator([)string<delimiter(')content(MAILDIR)delimiter(')>operator(]) ident(raise) constant(ArgumentError)operator(,) string<delimiter(")content(not directory: )inline<inline_delimiter(#{)instance_variable(@dirname)inline_delimiter(})>delimiter(")>\ reserved(unless) constant(FileTest)operator(.)ident(directory?) instance_variable(@dirname) instance_variable(@new) operator(=) string<delimiter(")inline<inline_delimiter(#{)instance_variable(@dirname)inline_delimiter(})>content(/new)delimiter(")> @@ -6094,11 +6094,11 @@ reserved(module) class(TMail) reserved(alias) method(new_msgid) method(new_message_id) reserved(end) - reserved(def) constant(Mail)operator(.)ident(boundary) + reserved(def) constant(Mail)operator(.)method(boundary) operator(::)constant(TMail)operator(.)ident(new_boundary) reserved(end) - reserved(def) constant(Mail)operator(.)ident(msgid) + reserved(def) constant(Mail)operator(.)method(msgid) operator(::)constant(TMail)operator(.)ident(new_message_id) reserved(end) @@ -8161,7 +8161,7 @@ ident(require) string<delimiter(')content(tmail/utils)delimiter(')> reserved(module) class(TMail) ident(require) string<delimiter(')content(tmail/scanner_r.rb)delimiter(')> reserved(begin) - ident(raise) constant(LoadError)operator(,) string<delimiter(')content(Turn off Ruby extention by user choice)delimiter(')> reserved(if) constant(ENV)operator([)string<delimiter(')content(NORUBYEXT)delimiter(')>operator(]) + ident(raise) constant(LoadError)operator(,) string<delimiter(')content(Turn off Ruby extention by user choice)delimiter(')> reserved(if) pre_constant(ENV)operator([)string<delimiter(')content(NORUBYEXT)delimiter(')>operator(]) ident(require) string<delimiter(')content(tmail/scanner_c.so)delimiter(')> constant(Scanner) operator(=) constant(Scanner_C) reserved(rescue) constant(LoadError) @@ -8743,16 +8743,16 @@ reserved(module) class(TMail) reserved(class) class(SyntaxError) operator(<) constant(StandardError)operator(;) reserved(end) - reserved(def) constant(TMail)operator(.)ident(new_boundary) + reserved(def) constant(TMail)operator(.)method(new_boundary) string<delimiter(')content(mimepart_)delimiter(')> operator(+) ident(random_tag) reserved(end) - reserved(def) constant(TMail)operator(.)ident(new_message_id)operator(() ident(fqdn) operator(=) pre_constant(nil) operator(\)) + reserved(def) constant(TMail)operator(.)method(new_message_id)operator(() ident(fqdn) operator(=) pre_constant(nil) operator(\)) ident(fqdn) operator(||=) operator(::)constant(Socket)operator(.)ident(gethostname) string<delimiter(")content(<)inline<inline_delimiter(#{)ident(random_tag)operator(()operator(\))inline_delimiter(})>content(@)inline<inline_delimiter(#{)ident(fqdn)inline_delimiter(})>content(.tmail>)delimiter(")> reserved(end) - reserved(def) constant(TMail)operator(.)ident(random_tag) + reserved(def) constant(TMail)operator(.)method(random_tag) instance_variable(@uniq) operator(+=) integer(1) ident(t) operator(=) constant(Time)operator(.)ident(now) ident(sprintf)operator(()string<delimiter(')content(%x%x_%x%x%d%x)delimiter(')>operator(,) @@ -12268,7 +12268,7 @@ reserved(class) class(CGIMethods) comment(#:nodoc:) ident(public) comment(# Returns a hash with the pairs from the query string. The implicit hash construction that is done in) comment(# parse_request_params is not done here.) - reserved(def) constant(CGIMethods)operator(.)ident(parse_query_parameters)operator(()ident(query_string)operator(\)) + reserved(def) constant(CGIMethods)operator(.)method(parse_query_parameters)operator(()ident(query_string)operator(\)) ident(parsed_params) operator(=) operator({)operator(}) ident(query_string)operator(.)ident(split)operator(()regexp<delimiter(/)content([&;])delimiter(/)>operator(\))operator(.)ident(each) operator({) operator(|)ident(p)operator(|) @@ -12301,7 +12301,7 @@ reserved(class) class(CGIMethods) comment(#:nodoc:) comment(# Returns the request (POST/GET\) parameters in a parsed form where pairs such as "customer[address][street]" / ) comment(# "Somewhere cool!" are translated into a full hash hierarchy, like) comment(# { "customer" => { "address" => { "street" => "Somewhere cool!" } } }) - reserved(def) constant(CGIMethods)operator(.)ident(parse_request_parameters)operator(()ident(params)operator(\)) + reserved(def) constant(CGIMethods)operator(.)method(parse_request_parameters)operator(()ident(params)operator(\)) ident(parsed_params) operator(=) operator({)operator(}) reserved(for) ident(key)operator(,) ident(value) reserved(in) ident(params) @@ -12399,7 +12399,7 @@ reserved(class) class(CGIMethods) comment(#:nodoc:) comment(# Splits the given key into several pieces. Example keys are 'name', 'person[name]',) comment(# 'person[name][first]', and 'people[]'. In each instance, an Array instance is returned.) comment(# 'person[name][first]' produces ['person', 'name', 'first']; 'people[]' produces ['people', '']) - reserved(def) constant(CGIMethods)operator(.)ident(split_key)operator(()ident(key)operator(\)) + reserved(def) constant(CGIMethods)operator(.)method(split_key)operator(()ident(key)operator(\)) reserved(if) regexp<delimiter(/)content(^([^)char(\\[)content(]+\)((?:)char(\\[)content([^)char(\\])content(]*)char(\\])content(\)+\)$)delimiter(/)> operator(=)operator(~) ident(key) ident(keys) operator(=) operator([)global_variable($1)operator(]) @@ -12412,7 +12412,7 @@ reserved(class) class(CGIMethods) comment(#:nodoc:) reserved(end) reserved(end) - reserved(def) constant(CGIMethods)operator(.)ident(get_typed_value)operator(()ident(value)operator(\)) + reserved(def) constant(CGIMethods)operator(.)method(get_typed_value)operator(()ident(value)operator(\)) comment(# test most frequent case first) reserved(if) ident(value)operator(.)ident(is_a?)operator(()constant(String)operator(\)) ident(value) @@ -12452,7 +12452,7 @@ reserved(class) class(CGIMethods) comment(#:nodoc:) reserved(end) constant(PARAMS_HASH_RE) operator(=) regexp<delimiter(/)content(^([^)char(\\[)content(]+\)()char(\\[)content(.*)char(\\])content(\)?(.\)?.*$)delimiter(/)> - reserved(def) constant(CGIMethods)operator(.)ident(get_levels)operator(()ident(key)operator(\)) + reserved(def) constant(CGIMethods)operator(.)method(get_levels)operator(()ident(key)operator(\)) ident(all)operator(,) ident(main)operator(,) ident(bracketed)operator(,) ident(trailing) operator(=) constant(PARAMS_HASH_RE)operator(.)ident(match)operator(()ident(key)operator(\))operator(.)ident(to_a) reserved(if) ident(main)operator(.)ident(nil?) operator([)operator(]) @@ -12465,7 +12465,7 @@ reserved(class) class(CGIMethods) comment(#:nodoc:) reserved(end) reserved(end) - reserved(def) constant(CGIMethods)operator(.)ident(build_deep_hash)operator(()ident(value)operator(,) ident(hash)operator(,) ident(levels)operator(\)) + reserved(def) constant(CGIMethods)operator(.)method(build_deep_hash)operator(()ident(value)operator(,) ident(hash)operator(,) ident(levels)operator(\)) reserved(if) ident(levels)operator(.)ident(length) operator(==) integer(0) ident(value) reserved(elsif) ident(hash)operator(.)ident(nil?) @@ -12523,7 +12523,7 @@ reserved(class) class(CGI) comment(#:nodoc:) comment(# simple support for IE) reserved(unless) instance_variable(@path) - regexp<delimiter(%r|)content(^(.*/\))delimiter(|)>operator(.)ident(match)operator(()constant(ENV)operator([)string<delimiter(')content(SCRIPT_NAME)delimiter(')>operator(])operator(\)) + regexp<delimiter(%r|)content(^(.*/\))delimiter(|)>operator(.)ident(match)operator(()pre_constant(ENV)operator([)string<delimiter(')content(SCRIPT_NAME)delimiter(')>operator(])operator(\)) instance_variable(@path) operator(=) operator(()global_variable($1) reserved(or) string<delimiter(')delimiter(')>operator(\)) reserved(end) @@ -18470,7 +18470,7 @@ reserved(module) class(ActionController) comment(#:nodoc:) global_variable($stdout) operator(=) ident(sio) ident(body)operator(.)ident(call) reserved(ensure) - global_variable($stdout) operator(=) constant(STDOUT) + global_variable($stdout) operator(=) pre_constant(STDOUT) reserved(end) ident(sio)operator(.)ident(rewind) @@ -19773,7 +19773,7 @@ reserved(class) class(XmlSimple) comment(#:nodoc:) reserved(end) comment(# This is the functional version of the instance method xml_in.) - reserved(def) constant(XmlSimple)operator(.)ident(xml_in)operator(()ident(string) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) + reserved(def) constant(XmlSimple)operator(.)method(xml_in)operator(()ident(string) operator(=) pre_constant(nil)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) ident(xml_simple) operator(=) constant(XmlSimple)operator(.)ident(new) ident(xml_simple)operator(.)ident(xml_in)operator(()ident(string)operator(,) ident(options)operator(\)) reserved(end) @@ -19829,7 +19829,7 @@ reserved(class) class(XmlSimple) comment(#:nodoc:) reserved(end) comment(# This is the functional version of the instance method xml_out.) - reserved(def) constant(XmlSimple)operator(.)ident(xml_out)operator(()ident(hash)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) + reserved(def) constant(XmlSimple)operator(.)method(xml_out)operator(()ident(hash)operator(,) ident(options) operator(=) pre_constant(nil)operator(\)) ident(xml_simple) operator(=) constant(XmlSimple)operator(.)ident(new) ident(xml_simple)operator(.)ident(xml_out)operator(()ident(hash)operator(,) ident(options)operator(\)) reserved(end) @@ -21771,7 +21771,7 @@ reserved(module) class(ActionView) reserved(end) reserved(def) method(rails_asset_id)operator(()ident(source)operator(\)) - constant(ENV)operator([)string<delimiter(")content(RAILS_ASSET_ID)delimiter(")>operator(]) operator(||) + pre_constant(ENV)operator([)string<delimiter(")content(RAILS_ASSET_ID)delimiter(")>operator(]) operator(||) constant(File)operator(.)ident(mtime)operator(()string<delimiter(")inline<inline_delimiter(#{)constant(RAILS_ROOT)inline_delimiter(})>content(/public/)inline<inline_delimiter(#{)ident(source)inline_delimiter(})>delimiter(")>operator(\))operator(.)ident(to_i)operator(.)ident(to_s) reserved(rescue) string<delimiter(")delimiter(")> reserved(end) reserved(end) @@ -25983,7 +25983,7 @@ reserved(class) class(ActiveRecordStoreTest) operator(<) constant(Test)operator( reserved(def) method(setup) ident(session_class)operator(.)ident(create_table!) - constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(GET)delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(GET)delimiter(')> constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(.)ident(session_class) operator(=) ident(session_class) instance_variable(@cgi) operator(=) constant(CGI)operator(.)ident(new) @@ -26051,7 +26051,7 @@ reserved(class) class(DeprecatedActiveRecordStoreTest) operator(<) constant(Acti ident(session_class)operator(.)ident(table_name) operator(=) string<delimiter(')content(old_sessions)delimiter(')> ident(session_class)operator(.)ident(send) symbol(:setup_sessid_compatibility!) - constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(GET)delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(GET)delimiter(')> constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(.)ident(session_class) operator(=) ident(session_class) instance_variable(@new_session) operator(=) constant(CGI)operator(::)constant(Session)operator(.)ident(new)operator(()constant(CGI)operator(.)ident(new)operator(,) string<delimiter(')content(database_manager)delimiter(')> operator(=)operator(>) constant(CGI)operator(::)constant(Session)operator(::)constant(ActiveRecordStore)operator(,) string<delimiter(')content(new_session)delimiter(')> operator(=)operator(>) pre_constant(true)operator(\)) @@ -26744,11 +26744,11 @@ ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__ reserved(class) class(Address) - reserved(def) constant(Address)operator(.)ident(count)operator(()ident(conditions) operator(=) pre_constant(nil)operator(,) ident(join) operator(=) pre_constant(nil)operator(\)) + reserved(def) constant(Address)operator(.)method(count)operator(()ident(conditions) operator(=) pre_constant(nil)operator(,) ident(join) operator(=) pre_constant(nil)operator(\)) pre_constant(nil) reserved(end) - reserved(def) constant(Address)operator(.)ident(find_all)operator(()ident(arg1)operator(,) ident(arg2)operator(,) ident(arg3)operator(,) ident(arg4)operator(\)) + reserved(def) constant(Address)operator(.)method(find_all)operator(()ident(arg1)operator(,) ident(arg2)operator(,) ident(arg3)operator(,) ident(arg4)operator(\)) operator([)operator(]) reserved(end) @@ -27276,9 +27276,9 @@ reserved(class) class(MultipartCGITest) operator(<) constant(Test)operator(::)co constant(FIXTURE_PATH) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(')content(/../fixtures/multipart)delimiter(')> reserved(def) method(setup) - constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(POST)delimiter(')> - constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) string<delimiter(')content(0)delimiter(')> - constant(ENV)operator([)string<delimiter(')content(CONTENT_TYPE)delimiter(')>operator(]) operator(=) string<delimiter(')content(multipart/form-data, boundary=AaB03x)delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(POST)delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) string<delimiter(')content(0)delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(CONTENT_TYPE)delimiter(')>operator(]) operator(=) string<delimiter(')content(multipart/form-data, boundary=AaB03x)delimiter(')> reserved(end) reserved(def) method(test_single_parameter) @@ -27343,7 +27343,7 @@ reserved(class) class(MultipartCGITest) operator(<) constant(Test)operator(::)co reserved(def) method(process)operator(()ident(name)operator(\)) ident(old_stdin) operator(=) global_variable($stdin) constant(File)operator(.)ident(open)operator(()constant(File)operator(.)ident(join)operator(()constant(FIXTURE_PATH)operator(,) ident(name)operator(\))operator(,) string<delimiter(')content(rb)delimiter(')>operator(\)) reserved(do) operator(|)ident(file)operator(|) - constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) ident(file)operator(.)ident(stat)operator(.)ident(size)operator(.)ident(to_s) + pre_constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) ident(file)operator(.)ident(stat)operator(.)ident(size)operator(.)ident(to_s) global_variable($stdin) operator(=) ident(file) constant(CGIMethods)operator(.)ident(parse_request_parameters) constant(CGI)operator(.)ident(new)operator(.)ident(params) reserved(end) @@ -28982,7 +28982,7 @@ reserved(class) class(NewRenderTestController) operator(<) constant(ActionContro reserved(def) method(rendering_with_conflicting_local_vars) instance_variable(@name) operator(=) string<delimiter(")content(David)delimiter(")> - reserved(def) instance_variable(@template)operator(.)ident(name)operator(()operator(\)) pre_constant(nil) reserved(end) + reserved(def) instance_variable(@template)operator(.)method(name)operator(()operator(\)) pre_constant(nil) reserved(end) ident(render) symbol(:action) operator(=)operator(>) string<delimiter(")content(potential_conflicts)delimiter(")> reserved(end) @@ -29397,9 +29397,9 @@ ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__ reserved(class) class(RawPostDataTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) reserved(def) method(setup) - constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(POST)delimiter(')> - constant(ENV)operator([)string<delimiter(')content(CONTENT_TYPE)delimiter(')>operator(]) operator(=) string<delimiter(')delimiter(')> - constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) string<delimiter(')content(0)delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(REQUEST_METHOD)delimiter(')>operator(]) operator(=) string<delimiter(')content(POST)delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(CONTENT_TYPE)delimiter(')>operator(]) operator(=) string<delimiter(')delimiter(')> + pre_constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) string<delimiter(')content(0)delimiter(')> reserved(end) reserved(def) method(test_raw_post_data) @@ -29411,11 +29411,11 @@ reserved(class) class(RawPostDataTest) operator(<) constant(Test)operator(::)con ident(old_stdin) operator(=) global_variable($stdin) reserved(begin) global_variable($stdin) operator(=) constant(StringIO)operator(.)ident(new)operator(()ident(query_string)operator(.)ident(dup)operator(\)) - constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) global_variable($stdin)operator(.)ident(size)operator(.)ident(to_s) + pre_constant(ENV)operator([)string<delimiter(')content(CONTENT_LENGTH)delimiter(')>operator(]) operator(=) global_variable($stdin)operator(.)ident(size)operator(.)ident(to_s) constant(CGI)operator(.)ident(new) - ident(assert_not_nil) constant(ENV)operator([)string<delimiter(')content(RAW_POST_DATA)delimiter(')>operator(]) - ident(assert) constant(ENV)operator([)string<delimiter(')content(RAW_POST_DATA)delimiter(')>operator(])operator(.)ident(frozen?) - ident(assert_equal) ident(query_string)operator(,) constant(ENV)operator([)string<delimiter(')content(RAW_POST_DATA)delimiter(')>operator(]) + ident(assert_not_nil) pre_constant(ENV)operator([)string<delimiter(')content(RAW_POST_DATA)delimiter(')>operator(]) + ident(assert) pre_constant(ENV)operator([)string<delimiter(')content(RAW_POST_DATA)delimiter(')>operator(])operator(.)ident(frozen?) + ident(assert_equal) ident(query_string)operator(,) pre_constant(ENV)operator([)string<delimiter(')content(RAW_POST_DATA)delimiter(')>operator(]) reserved(ensure) global_variable($stdin) operator(=) ident(old_stdin) reserved(end) @@ -32345,7 +32345,7 @@ reserved(class) class(ActiveRecordHelperTest) operator(<) constant(Test)operator reserved(def) method(setup) instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - reserved(def) instance_variable(@post)operator(.)ident(errors) + reserved(def) instance_variable(@post)operator(.)method(errors) constant(Class)operator(.)ident(new) operator({) reserved(def) method(on)operator(()ident(field)operator(\)) ident(field) operator(==) string<delimiter(")content(author_name)delimiter(")> operator(||) ident(field) operator(==) string<delimiter(")content(body)delimiter(")> reserved(end) reserved(def) method(empty?)operator(()operator(\)) pre_constant(false) reserved(end) @@ -32354,14 +32354,14 @@ reserved(class) class(ActiveRecordHelperTest) operator(<) constant(Test)operator operator(})operator(.)ident(new) reserved(end) - reserved(def) instance_variable(@post)operator(.)ident(new_record?)operator(()operator(\)) pre_constant(true) reserved(end) - reserved(def) instance_variable(@post)operator(.)ident(to_param)operator(()operator(\)) pre_constant(nil) reserved(end) + reserved(def) instance_variable(@post)operator(.)method(new_record?)operator(()operator(\)) pre_constant(true) reserved(end) + reserved(def) instance_variable(@post)operator(.)method(to_param)operator(()operator(\)) pre_constant(nil) reserved(end) - reserved(def) instance_variable(@post)operator(.)ident(column_for_attribute)operator(()ident(attr_name)operator(\)) + reserved(def) instance_variable(@post)operator(.)method(column_for_attribute)operator(()ident(attr_name)operator(\)) constant(Post)operator(.)ident(content_columns)operator(.)ident(select) operator({) operator(|)ident(column)operator(|) ident(column)operator(.)ident(name) operator(==) ident(attr_name) operator(})operator(.)ident(first) reserved(end) - reserved(def) constant(Post)operator(.)ident(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:string)operator(,) string<delimiter(")content(title)delimiter(")>operator(,) string<delimiter(")content(Title)delimiter(")>operator(\))operator(,) constant(Column)operator(.)ident(new)operator(()symbol(:text)operator(,) string<delimiter(")content(body)delimiter(")>operator(,) string<delimiter(")content(Body)delimiter(")>operator(\)) operator(]) reserved(end) + reserved(def) constant(Post)operator(.)method(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:string)operator(,) string<delimiter(")content(title)delimiter(")>operator(,) string<delimiter(")content(Title)delimiter(")>operator(\))operator(,) constant(Column)operator(.)ident(new)operator(()symbol(:text)operator(,) string<delimiter(")content(body)delimiter(")>operator(,) string<delimiter(")content(Body)delimiter(")>operator(\)) operator(]) reserved(end) instance_variable(@post)operator(.)ident(title) operator(=) string<delimiter(")content(Hello World)delimiter(")> instance_variable(@post)operator(.)ident(author_name) operator(=) string<delimiter(")delimiter(")> @@ -32370,7 +32370,7 @@ reserved(class) class(ActiveRecordHelperTest) operator(<) constant(Test)operator instance_variable(@post)operator(.)ident(written_on) operator(=) constant(Date)operator(.)ident(new)operator(()integer(2004)operator(,) integer(6)operator(,) integer(15)operator(\)) instance_variable(@controller) operator(=) constant(Object)operator(.)ident(new) - reserved(def) instance_variable(@controller)operator(.)ident(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) + reserved(def) instance_variable(@controller)operator(.)method(url_for)operator(()ident(options)operator(,) operator(*)ident(parameters_for_method_reference)operator(\)) ident(options) operator(=) ident(options)operator(.)ident(symbolize_keys) operator([)ident(options)operator([)symbol(:action)operator(])operator(,) ident(options)operator([)symbol(:id)operator(])operator(.)ident(to_param)operator(])operator(.)ident(compact)operator(.)ident(join)operator(()string<delimiter(')content(/)delimiter(')>operator(\)) @@ -32415,7 +32415,7 @@ reserved(class) class(ActiveRecordHelperTest) operator(<) constant(Test)operator reserved(end) reserved(def) method(test_form_with_date) - reserved(def) constant(Post)operator(.)ident(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:date)operator(,) string<delimiter(")content(written_on)delimiter(")>operator(,) string<delimiter(")content(Written on)delimiter(")>operator(\)) operator(]) reserved(end) + reserved(def) constant(Post)operator(.)method(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:date)operator(,) string<delimiter(")content(written_on)delimiter(")>operator(,) string<delimiter(")content(Written on)delimiter(")>operator(\)) operator(]) reserved(end) ident(assert_dom_equal)operator(() string<delimiter(%()content(<form action="create" method="post"><p><label for="post_written_on">Written on</label><br /><select name="post[written_on)nesting_delimiter(()content(1i)nesting_delimiter(\))content(]">)char(\\n)content(<option value="1999">1999</option>)char(\\n)content(<option value="2000">2000</option>)char(\\n)content(<option value="2001">2001</option>)char(\\n)content(<option value="2002">2002</option>)char(\\n)content(<option value="2003">2003</option>)char(\\n)content(<option value="2004" selected="selected">2004</option>)char(\\n)content(<option value="2005">2005</option>)char(\\n)content(<option value="2006">2006</option>)char(\\n)content(<option value="2007">2007</option>)char(\\n)content(<option value="2008">2008</option>)char(\\n)content(<option value="2009">2009</option>)char(\\n)content(</select>)char(\\n)content(<select name="post[written_on)nesting_delimiter(()content(2i)nesting_delimiter(\))content(]">)char(\\n)content(<option value="1">January</option>)char(\\n)content(<option value="2">February</option>)char(\\n)content(<option value="3">March</option>)char(\\n)content(<option value="4">April</option>)char(\\n)content(<option value="5">May</option>)char(\\n)content(<option value="6" selected="selected">June</option>)char(\\n)content(<option value="7">July</option>)char(\\n)content(<option value="8">August</option>)char(\\n)content(<option value="9">September</option>)char(\\n)content(<option value="10">October</option>)char(\\n)content(<option value="11">November</option>)char(\\n)content(<option value="12">December</option>)char(\\n)content(</select>)char(\\n)content(<select name="post[written_on)nesting_delimiter(()content(3i)nesting_delimiter(\))content(]">)char(\\n)content(<option value="1">1</option>)char(\\n)content(<option value="2">2</option>)char(\\n)content(<option value="3">3</option>)char(\\n)content(<option value="4">4</option>)char(\\n)content(<option value="5">5</option>)char(\\n)content(<option value="6">6</option>)char(\\n)content(<option value="7">7</option>)char(\\n)content(<option value="8">8</option>)char(\\n)content(<option value="9">9</option>)char(\\n)content(<option value="10">10</option>)char(\\n)content(<option value="11">11</option>)char(\\n)content(<option value="12">12</option>)char(\\n)content(<option value="13">13</option>)char(\\n)content(<option value="14">14</option>)char(\\n)content(<option value="15" selected="selected">15</option>)char(\\n)content(<option value="16">16</option>)char(\\n)content(<option value="17">17</option>)char(\\n)content(<option value="18">18</option>)char(\\n)content(<option value="19">19</option>)char(\\n)content(<option value="20">20</option>)char(\\n)content(<option value="21">21</option>)char(\\n)content(<option value="22">22</option>)char(\\n)content(<option value="23">23</option>)char(\\n)content(<option value="24">24</option>)char(\\n)content(<option value="25">25</option>)char(\\n)content(<option value="26">26</option>)char(\\n)content(<option value="27">27</option>)char(\\n)content(<option value="28">28</option>)char(\\n)content(<option value="29">29</option>)char(\\n)content(<option value="30">30</option>)char(\\n)content(<option value="31">31</option>)char(\\n)content(</select>)char(\\n)content(</p><input name="commit" type="submit" value="Create" /></form>)delimiter(\))>operator(,) @@ -32424,7 +32424,7 @@ reserved(class) class(ActiveRecordHelperTest) operator(<) constant(Test)operator reserved(end) reserved(def) method(test_form_with_datetime) - reserved(def) constant(Post)operator(.)ident(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:datetime)operator(,) string<delimiter(")content(written_on)delimiter(")>operator(,) string<delimiter(")content(Written on)delimiter(")>operator(\)) operator(]) reserved(end) + reserved(def) constant(Post)operator(.)method(content_columns)operator(()operator(\)) operator([) constant(Column)operator(.)ident(new)operator(()symbol(:datetime)operator(,) string<delimiter(")content(written_on)delimiter(")>operator(,) string<delimiter(")content(Written on)delimiter(")>operator(\)) operator(]) reserved(end) instance_variable(@post)operator(.)ident(written_on) operator(=) constant(Time)operator(.)ident(gm)operator(()integer(2004)operator(,) integer(6)operator(,) integer(15)operator(,) integer(16)operator(,) integer(30)operator(\)) ident(assert_dom_equal)operator(() @@ -32480,7 +32480,7 @@ reserved(class) class(AssetTagHelperTest) operator(<) constant(Test)operator(::) reserved(def) method(teardown) constant(Object)operator(.)ident(send)operator(()symbol(:remove_const)operator(,) symbol(:RAILS_ROOT)operator(\)) reserved(if) reserved(defined?)operator(()constant(RAILS_ROOT)operator(\)) - constant(ENV)operator([)string<delimiter(")content(RAILS_ASSET_ID)delimiter(")>operator(]) operator(=) pre_constant(nil) + pre_constant(ENV)operator([)string<delimiter(")content(RAILS_ASSET_ID)delimiter(")>operator(]) operator(=) pre_constant(nil) reserved(end) constant(AutoDiscoveryToTag) operator(=) operator({) @@ -32584,7 +32584,7 @@ reserved(class) class(AssetTagHelperTest) operator(<) constant(Test)operator(::) reserved(def) method(test_preset_asset_id) constant(Object)operator(.)ident(send)operator(()symbol(:const_set)operator(,) symbol(:RAILS_ROOT)operator(,) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(")content(/../fixtures/)delimiter(")>operator(\)) - constant(ENV)operator([)string<delimiter(")content(RAILS_ASSET_ID)delimiter(")>operator(]) operator(=) string<delimiter(")content(4500)delimiter(")> + pre_constant(ENV)operator([)string<delimiter(")content(RAILS_ASSET_ID)delimiter(")>operator(]) operator(=) string<delimiter(")content(4500)delimiter(")> ident(assert_equal) string<delimiter(%()content(<img alt="Rails" src="/images/rails.png?4500" />)delimiter(\))>operator(,) ident(image_tag)operator(()string<delimiter(")content(rails.png)delimiter(")>operator(\)) reserved(end) reserved(end) @@ -33557,10 +33557,10 @@ reserved(class) class(FormHelperTest) operator(<) constant(Test)operator(::)cons reserved(def) method(setup) instance_variable(@post) operator(=) constant(Post)operator(.)ident(new) - reserved(def) instance_variable(@post)operator(.)ident(errors)operator(()operator(\)) constant(Class)operator(.)ident(new)operator({) reserved(def) method(on)operator(()ident(field)operator(\)) ident(field) operator(==) string<delimiter(")content(author_name)delimiter(")> reserved(end) operator(})operator(.)ident(new) reserved(end) + reserved(def) instance_variable(@post)operator(.)method(errors)operator(()operator(\)) constant(Class)operator(.)ident(new)operator({) reserved(def) method(on)operator(()ident(field)operator(\)) ident(field) operator(==) string<delimiter(")content(author_name)delimiter(")> reserved(end) operator(})operator(.)ident(new) reserved(end) - reserved(def) instance_variable(@post)operator(.)ident(id)operator(;) integer(123)operator(;) reserved(end) - reserved(def) instance_variable(@post)operator(.)ident(id_before_type_cast)operator(;) integer(123)operator(;) reserved(end) + reserved(def) instance_variable(@post)operator(.)method(id)operator(;) integer(123)operator(;) reserved(end) + reserved(def) instance_variable(@post)operator(.)method(id_before_type_cast)operator(;) integer(123)operator(;) reserved(end) instance_variable(@post)operator(.)ident(title) operator(=) string<delimiter(")content(Hello World)delimiter(")> instance_variable(@post)operator(.)ident(author_name) operator(=) string<delimiter(")delimiter(")> @@ -35881,7 +35881,7 @@ reserved(class) class(GoogleSearchController) operator(<) constant(ApplicationCo reserved(def) method(doGoogleSearch) ident(resultElement) operator(=) constant(ResultElement)operator(.)ident(new) ident(resultElement)operator(.)ident(summary) operator(=) string<delimiter(")content(ONlamp.com: Rolling with Ruby on Rails)delimiter(")> - ident(resultElement)operator(.)constant(URL) operator(=) string<delimiter(")content(http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html)delimiter(")> + ident(resultElement)operator(.)ident(URL) operator(=) string<delimiter(")content(http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html)delimiter(")> ident(resultElement)operator(.)ident(snippet) operator(=) string<delimiter(")content(Curt Hibbs shows off Ruby on Rails by building a simple application that requires )delimiter(")> operator(+) string<delimiter(")content(almost no Ruby experience. ... Rolling with Ruby on Rails. ...)delimiter(")> ident(resultElement)operator(.)ident(title) operator(=) string<delimiter(")content(Teh Railz0r)delimiter(")> @@ -35989,7 +35989,7 @@ reserved(class) class(GoogleSearchService) operator(<) constant(ActionWebService reserved(def) method(doGoogleSearch)operator(()ident(key)operator(,) ident(q)operator(,) ident(start)operator(,) ident(maxResults)operator(,) ident(filter)operator(,) ident(restrict)operator(,) ident(safeSearch)operator(,) ident(lr)operator(,) ident(ie)operator(,) ident(oe)operator(\)) ident(resultElement) operator(=) constant(ResultElement)operator(.)ident(new) ident(resultElement)operator(.)ident(summary) operator(=) string<delimiter(")content(ONlamp.com: Rolling with Ruby on Rails)delimiter(")> - ident(resultElement)operator(.)constant(URL) operator(=) string<delimiter(")content(http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html)delimiter(")> + ident(resultElement)operator(.)ident(URL) operator(=) string<delimiter(")content(http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html)delimiter(")> ident(resultElement)operator(.)ident(snippet) operator(=) string<delimiter(")content(Curt Hibbs shows off Ruby on Rails by building a simple application that requires )delimiter(")> operator(+) string<delimiter(")content(almost no Ruby experience. ... Rolling with Ruby on Rails. ...)delimiter(")> ident(resultElement)operator(.)ident(title) operator(=) string<delimiter(")content(Teh Railz0r)delimiter(")> @@ -36104,7 +36104,7 @@ reserved(class) class(SearchController) operator(<) constant(ApplicationControll reserved(def) method(doGoogleSearch) ident(resultElement) operator(=) constant(ResultElement)operator(.)ident(new) ident(resultElement)operator(.)ident(summary) operator(=) string<delimiter(")content(ONlamp.com: Rolling with Ruby on Rails)delimiter(")> - ident(resultElement)operator(.)constant(URL) operator(=) string<delimiter(")content(http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html)delimiter(")> + ident(resultElement)operator(.)ident(URL) operator(=) string<delimiter(")content(http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html)delimiter(")> ident(resultElement)operator(.)ident(snippet) operator(=) string<delimiter(")content(Curt Hibbs shows off Ruby on Rails by building a simple application that requires )delimiter(")> operator(+) string<delimiter(")content(almost no Ruby experience. ... Rolling with Ruby on Rails. ...)delimiter(")> ident(resultElement)operator(.)ident(title) operator(=) string<delimiter(")content(Teh Railz0r)delimiter(")> @@ -39530,21 +39530,21 @@ reserved(unless) constant(Enumerable)operator(.)ident(method_defined?)operator(( reserved(end) reserved(unless) constant(File)operator(.)ident(respond_to?)operator(()symbol(:read)operator(\)) comment(# Ruby 1.6) - reserved(def) constant(File)operator(.)ident(read)operator(()ident(fname)operator(\)) + reserved(def) constant(File)operator(.)method(read)operator(()ident(fname)operator(\)) ident(open)operator(()ident(fname)operator(\)) operator({)operator(|)ident(f)operator(|) reserved(return) ident(f)operator(.)ident(read) operator(}) reserved(end) reserved(end) -reserved(def) constant(File)operator(.)ident(binread)operator(()ident(fname)operator(\)) +reserved(def) constant(File)operator(.)method(binread)operator(()ident(fname)operator(\)) ident(open)operator(()ident(fname)operator(,) string<delimiter(')content(rb)delimiter(')>operator(\)) operator({)operator(|)ident(f)operator(|) reserved(return) ident(f)operator(.)ident(read) operator(}) reserved(end) comment(# for corrupted windows stat(2\)) -reserved(def) constant(File)operator(.)ident(dir?)operator(()ident(path)operator(\)) +reserved(def) constant(File)operator(.)method(dir?)operator(()ident(path)operator(\)) constant(File)operator(.)ident(directory?)operator(()operator(()ident(path)operator([)integer(-1)operator(,)integer(1)operator(]) operator(==) string<delimiter(')content(/)delimiter(')>operator(\)) operator(?) ident(path) operator(:) ident(path) operator(+) string<delimiter(')content(/)delimiter(')>operator(\)) reserved(end) @@ -40185,13 +40185,13 @@ reserved(class) class(ToplevelInstaller) operator([) string<delimiter(')content(distclean)delimiter(')>operator(,)string<delimiter(")content(does `make distclean' for each extention)delimiter(")> operator(]) operator(]) - reserved(def) constant(ToplevelInstaller)operator(.)ident(invoke) + reserved(def) constant(ToplevelInstaller)operator(.)method(invoke) ident(instance)operator(()operator(\))operator(.)ident(invoke) reserved(end) instance_variable(@singleton) operator(=) pre_constant(nil) - reserved(def) constant(ToplevelInstaller)operator(.)ident(instance) + reserved(def) constant(ToplevelInstaller)operator(.)method(instance) instance_variable(@singleton) operator(||=) ident(new)operator(()constant(File)operator(.)ident(dirname)operator(()global_variable($0)operator(\))operator(\)) instance_variable(@singleton) reserved(end) @@ -41557,7 +41557,7 @@ reserved(module) class(DispatcherCommonTests) ident(return_value) reserved(end) reserved(end) -constant(ENV)operator([)string<delimiter(")content(RAILS_ENV)delimiter(")>operator(]) operator(=) string<delimiter(")content(test)delimiter(")> +pre_constant(ENV)operator([)string<delimiter(")content(RAILS_ENV)delimiter(")>operator(]) operator(=) string<delimiter(")content(test)delimiter(")> global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(')content(/../lib)delimiter(')>operator(\)) global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(')content(/../../activesupport/lib)delimiter(')>operator(\)) global_variable($:)operator(.)ident(unshift)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(')content(/../../actionpack/lib)delimiter(')>operator(\)) @@ -42885,7 +42885,7 @@ reserved(class) class(TestInvokeTest) operator(<) constant(Test)operator(::)cons reserved(end) ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(')content(/shared_setup)delimiter(')> -ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()constant(STDOUT)operator(\)) +ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(STDOUT)operator(\)) comment(# Database setup ---------------) @@ -42976,7 +42976,7 @@ global_variable($:) operator(<<) constant(File)operator(.)ident(dirname)operator ident(require) string<delimiter(')content(active_record)delimiter(')> ident(require) string<delimiter(')content(logger)delimiter(')>operator(;) reserved(class) class(Logger)operator(;) reserved(def) method(format_message)operator(()ident(severity)operator(,) ident(timestamp)operator(,) ident(msg)operator(,) ident(progname)operator(\)) string<delimiter(")inline<inline_delimiter(#{)ident(msg)inline_delimiter(})>char(\\n)delimiter(")> reserved(end)operator(;) reserved(end) -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()constant(STDOUT)operator(\)) +constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(STDOUT)operator(\)) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() symbol(:adapter) operator(=)operator(>) string<delimiter(")content(mysql)delimiter(")>operator(,) symbol(:host) operator(=)operator(>) string<delimiter(")content(localhost)delimiter(")>operator(,) @@ -42986,7 +42986,7 @@ constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_conne operator(\)) ident(require) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(')content(/shared_setup)delimiter(')> -ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()constant(STDOUT)operator(\)) +ident(logger) operator(=) constant(Logger)operator(.)ident(new)operator(()pre_constant(STDOUT)operator(\)) comment(# Database setup ---------------) @@ -55960,7 +55960,7 @@ reserved(module) class(ActiveRecord) ident(cattr_accessor) symbol(:ignore_tables) class_variable(@@ignore_tables) operator(=) operator([)operator(]) - reserved(def) pre_constant(self)operator(.)method(dump)operator(()ident(connection)operator(=)constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(=)constant(STDOUT)operator(\)) + reserved(def) pre_constant(self)operator(.)method(dump)operator(()ident(connection)operator(=)constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(connection)operator(,) ident(stream)operator(=)pre_constant(STDOUT)operator(\)) ident(new)operator(()ident(connection)operator(\))operator(.)ident(dump)operator(()ident(stream)operator(\)) ident(stream) reserved(end) @@ -57551,12 +57551,12 @@ reserved(class) class(Mysql) reserved(def) method(real_connect)operator(()ident(host)operator(=)pre_constant(nil)operator(,) ident(user)operator(=)pre_constant(nil)operator(,) ident(passwd)operator(=)pre_constant(nil)operator(,) ident(db)operator(=)pre_constant(nil)operator(,) ident(port)operator(=)pre_constant(nil)operator(,) ident(socket)operator(=)pre_constant(nil)operator(,) ident(flag)operator(=)pre_constant(nil)operator(\)) instance_variable(@server_status) operator(=) constant(SERVER_STATUS_AUTOCOMMIT) reserved(if) operator(()ident(host) operator(==) pre_constant(nil) reserved(or) ident(host) operator(==) string<delimiter(")content(localhost)delimiter(")>operator(\)) reserved(and) reserved(defined?) constant(UNIXSocket) reserved(then) - ident(unix_socket) operator(=) ident(socket) operator(||) constant(ENV)operator([)string<delimiter(")content(MYSQL_UNIX_PORT)delimiter(")>operator(]) operator(||) constant(MYSQL_UNIX_ADDR) + ident(unix_socket) operator(=) ident(socket) operator(||) pre_constant(ENV)operator([)string<delimiter(")content(MYSQL_UNIX_PORT)delimiter(")>operator(]) operator(||) constant(MYSQL_UNIX_ADDR) ident(sock) operator(=) constant(UNIXSocket)operator(::)ident(new)operator(()ident(unix_socket)operator(\)) instance_variable(@host_info) operator(=) constant(Error)operator(::)ident(err)operator(()constant(Error)operator(::)constant(CR_LOCALHOST_CONNECTION)operator(\)) instance_variable(@unix_socket) operator(=) ident(unix_socket) reserved(else) - ident(sock) operator(=) constant(TCPSocket)operator(::)ident(new)operator(()ident(host)operator(,) ident(port)operator(||)constant(ENV)operator([)string<delimiter(")content(MYSQL_TCP_PORT)delimiter(")>operator(])operator(||)operator(()constant(Socket)operator(::)ident(getservbyname)operator(()string<delimiter(")content(mysql)delimiter(")>operator(,)string<delimiter(")content(tcp)delimiter(")>operator(\)) reserved(rescue) constant(MYSQL_PORT)operator(\))operator(\)) + ident(sock) operator(=) constant(TCPSocket)operator(::)ident(new)operator(()ident(host)operator(,) ident(port)operator(||)pre_constant(ENV)operator([)string<delimiter(")content(MYSQL_TCP_PORT)delimiter(")>operator(])operator(||)operator(()constant(Socket)operator(::)ident(getservbyname)operator(()string<delimiter(")content(mysql)delimiter(")>operator(,)string<delimiter(")content(tcp)delimiter(")>operator(\)) reserved(rescue) constant(MYSQL_PORT)operator(\))operator(\)) instance_variable(@host_info) operator(=) ident(sprintf) constant(Error)operator(::)ident(err)operator(()constant(Error)operator(::)constant(CR_TCP_CONNECTION)operator(\))operator(,) ident(host) reserved(end) instance_variable(@host) operator(=) ident(host) operator(?) ident(host)operator(.)ident(dup) operator(:) pre_constant(nil) @@ -58507,7 +58507,7 @@ reserved(class) class(Mysql) reserved(end) ident(attr_reader) symbol(:errno)operator(,) symbol(:error) - reserved(def) constant(Error)operator(::)ident(err)operator(()ident(errno)operator(\)) + reserved(def) constant(Error)operator(::)method(err)operator(()ident(errno)operator(\)) constant(CLIENT_ERRORS)operator([)ident(errno) operator(-) constant(Error)operator(::)constant(CR_MIN_ERROR)operator(]) reserved(end) reserved(end) @@ -58567,15 +58567,15 @@ reserved(class) class(Mysql) instance_variable(@sock)operator(.)ident(close) reserved(end) - reserved(def) constant(Net)operator(::)ident(int2str)operator(()ident(n)operator(\)) + reserved(def) constant(Net)operator(::)method(int2str)operator(()ident(n)operator(\)) operator([)ident(n)operator(])operator(.)ident(pack)operator(()string<delimiter(")content(v)delimiter(")>operator(\)) reserved(end) - reserved(def) constant(Net)operator(::)ident(int3str)operator(()ident(n)operator(\)) + reserved(def) constant(Net)operator(::)method(int3str)operator(()ident(n)operator(\)) operator([)ident(n)operator(%)integer(256)operator(,) ident(n)operator(>>)integer(8)operator(])operator(.)ident(pack)operator(()string<delimiter(")content(cv)delimiter(")>operator(\)) reserved(end) - reserved(def) constant(Net)operator(::)ident(int4str)operator(()ident(n)operator(\)) + reserved(def) constant(Net)operator(::)method(int4str)operator(()ident(n)operator(\)) operator([)ident(n)operator(])operator(.)ident(pack)operator(()string<delimiter(")content(V)delimiter(")>operator(\)) reserved(end) @@ -59568,7 +59568,7 @@ constant(QUOTED_TYPE) operator(=) constant(ActiveRecord)operator(::)constant(Bas reserved(class) class(Test::Unit::TestCase) comment(#:nodoc:) pre_constant(self)operator(.)ident(fixture_path) operator(=) constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(")content(/fixtures/)delimiter(")> pre_constant(self)operator(.)ident(use_instantiated_fixtures) operator(=) pre_constant(false) - pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) operator(()constant(ENV)operator([)string<delimiter(')content(AR_NO_TX_FIXTURES)delimiter(')>operator(]) operator(!=) string<delimiter(")content(yes)delimiter(")>operator(\)) + pre_constant(self)operator(.)ident(use_transactional_fixtures) operator(=) operator(()pre_constant(ENV)operator([)string<delimiter(')content(AR_NO_TX_FIXTURES)delimiter(')>operator(]) operator(!=) string<delimiter(")content(yes)delimiter(")>operator(\)) reserved(def) method(create_fixtures)operator(()operator(*)ident(table_names)operator(,) operator(&)ident(block)operator(\)) constant(Fixtures)operator(.)ident(create_fixtures)operator(()constant(File)operator(.)ident(dirname)operator(()pre_constant(__FILE__)operator(\)) operator(+) string<delimiter(")content(/fixtures/)delimiter(")>operator(,) ident(table_names)operator(,) operator({)operator(})operator(,) operator(&)ident(block)operator(\)) @@ -59694,12 +59694,12 @@ reserved(class) class(AdapterTest) operator(<) constant(Test)operator(::)constan reserved(def) method(test_current_database) reserved(if) instance_variable(@connection)operator(.)ident(respond_to?)operator(()symbol(:current_database)operator(\)) - ident(assert_equal) constant(ENV)operator([)string<delimiter(')content(ARUNIT_DB_NAME)delimiter(')>operator(]) operator(||) string<delimiter(")content(activerecord_unittest)delimiter(")>operator(,) instance_variable(@connection)operator(.)ident(current_database) + ident(assert_equal) pre_constant(ENV)operator([)string<delimiter(')content(ARUNIT_DB_NAME)delimiter(')>operator(]) operator(||) string<delimiter(")content(activerecord_unittest)delimiter(")>operator(,) instance_variable(@connection)operator(.)ident(current_database) reserved(end) reserved(end) reserved(def) method(test_table_alias) - reserved(def) instance_variable(@connection)operator(.)ident(test_table_alias_length)operator(()operator(\)) integer(10)operator(;) reserved(end) + reserved(def) instance_variable(@connection)operator(.)method(test_table_alias_length)operator(()operator(\)) integer(10)operator(;) reserved(end) reserved(class) operator(<<) instance_variable(@connection) ident(alias_method) symbol(:old_table_alias_length)operator(,) symbol(:table_alias_length) ident(alias_method) symbol(:table_alias_length)operator(,) symbol(:test_table_alias_length) @@ -64397,11 +64397,11 @@ ident(print) string<delimiter(")content(Using Oracle)char(\\n)delimiter(")> ident(require_dependency) string<delimiter(')content(fixtures/course)delimiter(')> ident(require) string<delimiter(')content(logger)delimiter(')> -constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new) constant(STDOUT) +constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger) operator(=) constant(Logger)operator(.)ident(new) pre_constant(STDOUT) constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(logger)operator(.)ident(level) operator(=) constant(Logger)operator(::)constant(WARN) comment(# Set these to your database connection strings) -ident(db) operator(=) constant(ENV)operator([)string<delimiter(')content(ARUNIT_DB)delimiter(')>operator(]) operator(||) string<delimiter(')content(activerecord_unittest)delimiter(')> +ident(db) operator(=) pre_constant(ENV)operator([)string<delimiter(')content(ARUNIT_DB)delimiter(')>operator(]) operator(||) string<delimiter(')content(activerecord_unittest)delimiter(')> constant(ActiveRecord)operator(::)constant(Base)operator(.)ident(establish_connection)operator(() symbol(:adapter) operator(=)operator(>) string<delimiter(')content(oracle)delimiter(')>operator(,) @@ -66769,7 +66769,7 @@ reserved(class) class(InheritanceTest) operator(<) constant(Test)operator(::)con ident(c)operator(.)ident(save) reserved(end) - reserved(def) constant(Company)operator(.)ident(inheritance_column)operator(()operator(\)) string<delimiter(")content(ruby_type)delimiter(")> reserved(end) + reserved(def) constant(Company)operator(.)method(inheritance_column)operator(()operator(\)) string<delimiter(")content(ruby_type)delimiter(")> reserved(end) reserved(end) reserved(end) ident(require) string<delimiter(')content(abstract_unit)delimiter(')> @@ -68714,8 +68714,8 @@ ident(require) string<delimiter(')content(fixtures/reader)delimiter(')> ident(require) string<delimiter(')content(fixtures/person)delimiter(')> comment(# Dummy class methods to test implicit association scoping.) -reserved(def) constant(Comment)operator(.)ident(foo)operator(()operator(\)) ident(find) symbol(:first) reserved(end) -reserved(def) constant(Project)operator(.)ident(foo)operator(()operator(\)) ident(find) symbol(:first) reserved(end) +reserved(def) constant(Comment)operator(.)method(foo)operator(()operator(\)) ident(find) symbol(:first) reserved(end) +reserved(def) constant(Project)operator(.)method(foo)operator(()operator(\)) ident(find) symbol(:first) reserved(end) reserved(class) class(ReadOnlyTest) operator(<) constant(Test)operator(::)constant(Unit)operator(::)constant(TestCase) @@ -70369,7 +70369,7 @@ reserved(end) reserved(class) class(ValidatesNumericalityTest) - constant(NIL) operator(=) operator([)pre_constant(nil)operator(,) string<delimiter(")delimiter(")>operator(,) string<delimiter(")content( )delimiter(")>operator(,) string<delimiter(")content( )char(\\t)content( )char(\\r)content( )char(\\n)delimiter(")>operator(]) + pre_constant(NIL) operator(=) operator([)pre_constant(nil)operator(,) string<delimiter(")delimiter(")>operator(,) string<delimiter(")content( )delimiter(")>operator(,) string<delimiter(")content( )char(\\t)content( )char(\\r)content( )char(\\n)delimiter(")>operator(]) constant(FLOAT_STRINGS) operator(=) string<delimiter(%w()content(0.0 +0.0 -0.0 10.0 10.5 -10.5 -0.0001 -090.1)delimiter(\))> constant(INTEGER_STRINGS) operator(=) string<delimiter(%w()content(0 +0 -0 10 +10 -10 0090 -090)delimiter(\))> constant(FLOATS) operator(=) operator([)float(0.0)operator(,) float(10.0)operator(,) float(10.5)operator(,) float(-10.5)operator(,) float(-0.0001)operator(]) operator(+) constant(FLOAT_STRINGS) @@ -70385,7 +70385,7 @@ reserved(class) class(ValidatesNumericalityTest) reserved(def) method(test_default_validates_numericality_of) constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved) - ident(invalid!)operator(()constant(NIL) operator(+) constant(JUNK)operator(\)) + ident(invalid!)operator(()pre_constant(NIL) operator(+) constant(JUNK)operator(\)) ident(valid!)operator(()constant(FLOATS) operator(+) constant(INTEGERS)operator(\)) reserved(end) @@ -70393,13 +70393,13 @@ reserved(class) class(ValidatesNumericalityTest) constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) ident(invalid!)operator(()constant(JUNK)operator(\)) - ident(valid!)operator(()constant(NIL) operator(+) constant(FLOATS) operator(+) constant(INTEGERS)operator(\)) + ident(valid!)operator(()pre_constant(NIL) operator(+) constant(FLOATS) operator(+) constant(INTEGERS)operator(\)) reserved(end) reserved(def) method(test_validates_numericality_of_with_integer_only) constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved)operator(,) symbol(:only_integer) operator(=)operator(>) pre_constant(true) - ident(invalid!)operator(()constant(NIL) operator(+) constant(JUNK) operator(+) constant(FLOATS)operator(\)) + ident(invalid!)operator(()pre_constant(NIL) operator(+) constant(JUNK) operator(+) constant(FLOATS)operator(\)) ident(valid!)operator(()constant(INTEGERS)operator(\)) reserved(end) @@ -70407,7 +70407,7 @@ reserved(class) class(ValidatesNumericalityTest) constant(Topic)operator(.)ident(validates_numericality_of) symbol(:approved)operator(,) symbol(:only_integer) operator(=)operator(>) pre_constant(true)operator(,) symbol(:allow_nil) operator(=)operator(>) pre_constant(true) ident(invalid!)operator(()constant(JUNK) operator(+) constant(FLOATS)operator(\)) - ident(valid!)operator(()constant(NIL) operator(+) constant(INTEGERS)operator(\)) + ident(valid!)operator(()pre_constant(NIL) operator(+) constant(INTEGERS)operator(\)) reserved(end) ident(private) @@ -70431,7 +70431,7 @@ reserved(begin) reserved(rescue) constant(LoadError) reserved(class) class(Continuation) comment(# :nodoc: # for RDoc) reserved(end) - reserved(def) constant(Continuation)operator(.)ident(create)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) comment(# :nodoc:) + reserved(def) constant(Continuation)operator(.)method(create)operator(()operator(*)ident(args)operator(,) operator(&)ident(block)operator(\)) comment(# :nodoc:) ident(cc) operator(=) pre_constant(nil)operator(;) ident(result) operator(=) ident(callcc) operator({)operator(|)ident(c)operator(|) ident(cc) operator(=) ident(c)operator(;) ident(block)operator(.)ident(call)operator(()ident(cc)operator(\)) reserved(if) ident(block) reserved(and) ident(args)operator(.)ident(empty?)operator(}) ident(result) operator(||=) ident(args) reserved(return) operator(*)operator([)ident(cc)operator(,) operator(*)ident(result)operator(]) @@ -70464,7 +70464,7 @@ comment(# This should be no problem however, because Ruby has closures.) comment(# If you don't do this an Exception will be raised. Because of) comment(# the way that Binding.of_caller is implemented it has to be) comment(# done this way.) -reserved(def) constant(Binding)operator(.)ident(of_caller)operator(()operator(&)ident(block)operator(\)) +reserved(def) constant(Binding)operator(.)method(of_caller)operator(()operator(&)ident(block)operator(\)) ident(old_critical) operator(=) constant(Thread)operator(.)ident(critical) constant(Thread)operator(.)ident(critical) operator(=) pre_constant(true) ident(count) operator(=) integer(0) @@ -70702,7 +70702,7 @@ reserved(module) class(Breakpoint) ident(sleep)operator(()float(0.5)operator(\)) reserved(until) constant(Breakpoint)operator(.)ident(drb_service)operator(.)ident(eval_handler) constant(Client)operator(.)ident(new)operator(()constant(Breakpoint)operator(.)ident(drb_service)operator(.)ident(eval_handler)operator(\)) reserved(else) - constant(Client)operator(.)ident(new)operator(()ident(lambda) operator({) operator(|)ident(code)operator(|) ident(eval)operator(()ident(code)operator(,) constant(TOPLEVEL_BINDING)operator(\)) operator(})operator(\)) + constant(Client)operator(.)ident(new)operator(()ident(lambda) operator({) operator(|)ident(code)operator(|) ident(eval)operator(()ident(code)operator(,) pre_constant(TOPLEVEL_BINDING)operator(\)) operator(})operator(\)) reserved(end) reserved(end) reserved(end) @@ -70963,16 +70963,16 @@ reserved(module) class(IRB) comment(#:nodoc:) reserved(alias) symbol(:old_CurrentContext) symbol(:CurrentContext) ident(remove_method) symbol(:CurrentContext) reserved(end) - reserved(def) constant(IRB)operator(.)constant(CurrentContext) + reserved(def) constant(IRB)operator(.)method(CurrentContext) reserved(if) ident(old_CurrentContext)operator(.)ident(nil?) reserved(and) constant(Breakpoint)operator(.)ident(use_drb?) reserved(then) ident(result) operator(=) constant(Object)operator(.)ident(new) - reserved(def) ident(result)operator(.)ident(last_value)operator(;) reserved(end) + reserved(def) ident(result)operator(.)method(last_value)operator(;) reserved(end) reserved(return) ident(result) reserved(else) ident(old_CurrentContext) reserved(end) reserved(end) - reserved(def) constant(IRB)operator(.)ident(parse_opts)operator(()operator(\)) reserved(end) + reserved(def) constant(IRB)operator(.)method(parse_opts)operator(()operator(\)) reserved(end) reserved(class) class(Context) comment(#:nodoc:) reserved(alias) symbol(:old_evaluate) symbol(:evaluate) @@ -71832,7 +71832,7 @@ reserved(class) class(Object) reserved(def) method(`)operator(()ident(command)operator(\)) comment(#:nodoc:) reserved(super) reserved(rescue) constant(Errno)operator(::)constant(ENOENT) operator(=)operator(>) ident(e) - constant(STDERR)operator(.)ident(puts) string<delimiter(")escape(#)global_variable($0)content(: )inline<inline_delimiter(#{)ident(e)inline_delimiter(})>delimiter(")> + pre_constant(STDERR)operator(.)ident(puts) string<delimiter(")escape(#)global_variable($0)content(: )inline<inline_delimiter(#{)ident(e)inline_delimiter(})>delimiter(")> reserved(end) ident(endmodule) constant(Kernel) comment(# Turns the current script into a daemon process that detaches from the console.) @@ -71843,9 +71843,9 @@ ident(endmodule) constant(Kernel) ident(exit) reserved(if) ident(fork) comment(# Zap session leader. See [1].) constant(Dir)operator(.)ident(chdir) string<delimiter(")content(/)delimiter(")> comment(# Release old working directory.) constant(File)operator(.)ident(umask) integer(0000) comment(# Ensure sensible umask. Adjust as needed.) - constant(STDIN)operator(.)ident(reopen) string<delimiter(")content(/dev/null)delimiter(")> comment(# Free file descriptors and) - constant(STDOUT)operator(.)ident(reopen) string<delimiter(")content(/dev/null)delimiter(")>operator(,) string<delimiter(")content(a)delimiter(")> comment(# point them somewhere sensible.) - constant(STDERR)operator(.)ident(reopen) constant(STDOUT) comment(# STDOUT/ERR should better go to a logfile.) + pre_constant(STDIN)operator(.)ident(reopen) string<delimiter(")content(/dev/null)delimiter(")> comment(# Free file descriptors and) + pre_constant(STDOUT)operator(.)ident(reopen) string<delimiter(")content(/dev/null)delimiter(")>operator(,) string<delimiter(")content(a)delimiter(")> comment(# point them somewhere sensible.) + pre_constant(STDERR)operator(.)ident(reopen) pre_constant(STDOUT) comment(# STDOUT/ERR should better go to a logfile.) ident(trap)operator(()string<delimiter(")content(TERM)delimiter(")>operator(\)) operator({) ident(exit) operator(}) reserved(end) ident(endmodule) constant(Kernel) @@ -71873,7 +71873,7 @@ ident(endmodule) constant(Kernel) comment(# For compatibility) reserved(def) method(silence_stderr) comment(#:nodoc:) - ident(silence_stream)operator(()constant(STDERR)operator(\)) operator({) reserved(yield) operator(}) + ident(silence_stream)operator(()pre_constant(STDERR)operator(\)) operator({) reserved(yield) operator(}) reserved(end) comment(# Silences any stream for the duration of the block.) @@ -71885,7 +71885,7 @@ ident(endmodule) constant(Kernel) comment(# puts 'But this will') reserved(def) method(silence_stream)operator(()ident(stream)operator(\)) ident(old_stream) operator(=) ident(stream)operator(.)ident(dup) - ident(stream)operator(.)ident(reopen)operator(()constant(RUBY_PLATFORM) operator(=)operator(~) regexp<delimiter(/)content(mswin)delimiter(/)> operator(?) string<delimiter(')content(NUL:)delimiter(')> operator(:) string<delimiter(')content(/dev/null)delimiter(')>operator(\)) + ident(stream)operator(.)ident(reopen)operator(()pre_constant(RUBY_PLATFORM) operator(=)operator(~) regexp<delimiter(/)content(mswin)delimiter(/)> operator(?) string<delimiter(')content(NUL:)delimiter(')> operator(:) string<delimiter(')content(/dev/null)delimiter(')>operator(\)) ident(stream)operator(.)ident(sync) operator(=) pre_constant(true) reserved(yield) reserved(ensure) diff --git a/test/scanners/ruby/ruby19.expected.raydebug b/test/scanners/ruby/ruby19.expected.raydebug index f3e40d5..d6e6581 100644 --- a/test/scanners/ruby/ruby19.expected.raydebug +++ b/test/scanners/ruby/ruby19.expected.raydebug @@ -1,4 +1 @@ -ident(block)operator(.)ident(()operator(*)ident(arguments)operator(\)) comment(# bovi's example) - -reserved(def) operator(()ident(foo)operator(\))operator(.)ident(bar) -reserved(end)
\ No newline at end of file +ident(block)operator(.)operator(()operator(*)ident(arguments)operator(\)) comment(# bovi's example)
\ No newline at end of file diff --git a/test/scanners/ruby/ruby19.in.rb b/test/scanners/ruby/ruby19.in.rb index 45ec5f9..59b9e9b 100644 --- a/test/scanners/ruby/ruby19.in.rb +++ b/test/scanners/ruby/ruby19.in.rb @@ -1,4 +1 @@ -block.(*arguments) # bovi's example - -def (foo).bar -end
\ No newline at end of file +block.(*arguments) # bovi's example
\ No newline at end of file |