Class: Sexp::Remaining

Inherits:
Matcher show all
Defined in:
lib/sexp.rb

Overview

Matches all remaining input. If remaining comes before any other matchers, they will be ignored.

examples:

s(:a)         / s{ s(:a, ___ ) } #=> [s(:a)]
s(:a, :b, :c) / s{ s(:a, ___ ) } #=> [s(:a, :b, :c)]

Instance Attribute Summary

Attributes inherited from Sexp

#comments, #file, #line

Instance Method Summary collapse

Methods inherited from Matcher

#&, #-@, #/, #=~, #>>, match_subs=, match_subs?, parse, #|

Methods inherited from Sexp

#/, #==, #=~, _, ___, all, any, #array_type?, atom, child, #compact, #deep_each, #depth, #each_of_type, #each_sexp, #find_and_replace_all, #find_node, #find_nodes, from_array, #gsub, include, #initialize, #line_max, m, #map, #mass, #method_missing, #new, not?, #replace_sexp, #respond_to?, s, #search_each, #sexp_body, #sexp_body=, #sexp_type, #sexp_type=, #shift, #structure, #sub, t, #to_a

Constructor Details

This class inherits a constructor from Sexp

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Sexp

Instance Method Details

#greedy?Boolean

Returns:

  • (Boolean)


920
921
922
# File 'lib/sexp.rb', line 920

def greedy?
  true
end

#inspectObject

:nodoc:



924
925
926
# File 'lib/sexp.rb', line 924

def inspect # :nodoc:
  "___"
end

#pretty_print(q) ⇒ Object

:nodoc:



928
929
930
# File 'lib/sexp.rb', line 928

def pretty_print q # :nodoc:
  q.text "___"
end

#satisfy?(o) ⇒ Boolean

Always satisfied once this is reached. Think of it as a var arg.

Returns:

  • (Boolean)


916
917
918
# File 'lib/sexp.rb', line 916

def satisfy? o
  true
end