Module: RubyLexer::SSWrapper
- Included in:
- RubyLexer
- Defined in:
- lib/ruby_lexer.rb
Instance Method Summary collapse
- #beginning_of_line? ⇒ Boolean (also: #bol?)
- #check(re) ⇒ Object
- #end_of_stream? ⇒ Boolean (also: #eos?)
- #getch ⇒ Object
- #in_heredoc? ⇒ Boolean
- #match ⇒ Object
- #matched ⇒ Object
- #maybe_pop_stack ⇒ Object
- #pos ⇒ Object
- #pos=(n) ⇒ Object
- #rest ⇒ Object
- #scan(re) ⇒ Object
-
#scanner_class ⇒ Object
TODO: design this out of oedipus_lex.
- #ss_string ⇒ Object
- #ss_string=(s) ⇒ Object
- #string=(s) ⇒ Object
- #unscan ⇒ Object
Instance Method Details
#beginning_of_line? ⇒ Boolean Also known as: bol?
995 996 997 |
# File 'lib/ruby_lexer.rb', line 995 def beginning_of_line? ss.bol? end |
#check(re) ⇒ Object
1001 1002 1003 1004 1005 |
# File 'lib/ruby_lexer.rb', line 1001 def check re maybe_pop_stack ss.check re end |
#end_of_stream? ⇒ Boolean Also known as: eos?
1007 1008 1009 |
# File 'lib/ruby_lexer.rb', line 1007 def end_of_stream? ss.eos? end |
#getch ⇒ Object
1013 1014 1015 1016 1017 |
# File 'lib/ruby_lexer.rb', line 1013 def getch c = ss.getch c = ss.getch if c == "\r" && ss.peek(1) == "\n" c end |
#in_heredoc? ⇒ Boolean
1027 1028 1029 |
# File 'lib/ruby_lexer.rb', line 1027 def in_heredoc? !!self.old_ss end |
#match ⇒ Object
1019 1020 1021 |
# File 'lib/ruby_lexer.rb', line 1019 def match ss end |
#matched ⇒ Object
1023 1024 1025 |
# File 'lib/ruby_lexer.rb', line 1023 def matched ss.matched end |
#maybe_pop_stack ⇒ Object
1031 1032 1033 1034 1035 1036 |
# File 'lib/ruby_lexer.rb', line 1031 def maybe_pop_stack if ss.eos? && in_heredoc? then self.ss_pop self.lineno_pop end end |
#pos ⇒ Object
1038 1039 1040 |
# File 'lib/ruby_lexer.rb', line 1038 def pos ss.pos end |
#pos=(n) ⇒ Object
1042 1043 1044 |
# File 'lib/ruby_lexer.rb', line 1042 def pos= n ss.pos = n end |
#rest ⇒ Object
1046 1047 1048 |
# File 'lib/ruby_lexer.rb', line 1046 def rest ss.rest end |
#scan(re) ⇒ Object
1050 1051 1052 1053 1054 |
# File 'lib/ruby_lexer.rb', line 1050 def scan re maybe_pop_stack ss.scan re end |
#scanner_class ⇒ Object
TODO: design this out of oedipus_lex. or something.
1056 1057 1058 |
# File 'lib/ruby_lexer.rb', line 1056 def scanner_class # TODO: design this out of oedipus_lex. or something. RPStringScanner end |
#ss_string ⇒ Object
1060 1061 1062 |
# File 'lib/ruby_lexer.rb', line 1060 def ss_string ss.string end |
#ss_string=(s) ⇒ Object
1064 1065 1066 1067 |
# File 'lib/ruby_lexer.rb', line 1064 def ss_string= s raise "Probably not" ss.string = s end |
#string=(s) ⇒ Object
991 992 993 |
# File 'lib/ruby_lexer.rb', line 991 def string= s ss.string= s end |
#unscan ⇒ Object
1069 1070 1071 |
# File 'lib/ruby_lexer.rb', line 1069 def unscan ss.unscan end |