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?
1003 1004 1005 |
# File 'lib/ruby_lexer.rb', line 1003 def beginning_of_line? ss.bol? end |
#check(re) ⇒ Object
1009 1010 1011 1012 1013 |
# File 'lib/ruby_lexer.rb', line 1009 def check re maybe_pop_stack ss.check re end |
#end_of_stream? ⇒ Boolean Also known as: eos?
1015 1016 1017 |
# File 'lib/ruby_lexer.rb', line 1015 def end_of_stream? ss.eos? end |
#getch ⇒ Object
1021 1022 1023 1024 1025 |
# File 'lib/ruby_lexer.rb', line 1021 def getch c = ss.getch c = ss.getch if c == "\r" && ss.peek(1) == "\n" c end |
#in_heredoc? ⇒ Boolean
1035 1036 1037 |
# File 'lib/ruby_lexer.rb', line 1035 def in_heredoc? !!self.old_ss end |
#match ⇒ Object
1027 1028 1029 |
# File 'lib/ruby_lexer.rb', line 1027 def match ss end |
#matched ⇒ Object
1031 1032 1033 |
# File 'lib/ruby_lexer.rb', line 1031 def matched ss.matched end |
#maybe_pop_stack ⇒ Object
1039 1040 1041 1042 1043 1044 |
# File 'lib/ruby_lexer.rb', line 1039 def maybe_pop_stack if ss.eos? && in_heredoc? then self.ss_pop self.lineno_pop end end |
#pos ⇒ Object
1046 1047 1048 |
# File 'lib/ruby_lexer.rb', line 1046 def pos ss.pos end |
#pos=(n) ⇒ Object
1050 1051 1052 |
# File 'lib/ruby_lexer.rb', line 1050 def pos= n ss.pos = n end |
#rest ⇒ Object
1054 1055 1056 |
# File 'lib/ruby_lexer.rb', line 1054 def rest ss.rest end |
#scan(re) ⇒ Object
1058 1059 1060 1061 1062 |
# File 'lib/ruby_lexer.rb', line 1058 def scan re maybe_pop_stack ss.scan re end |
#scanner_class ⇒ Object
TODO: design this out of oedipus_lex. or something.
1064 1065 1066 |
# File 'lib/ruby_lexer.rb', line 1064 def scanner_class # TODO: design this out of oedipus_lex. or something. RPStringScanner end |
#ss_string ⇒ Object
1068 1069 1070 |
# File 'lib/ruby_lexer.rb', line 1068 def ss_string ss.string end |
#ss_string=(s) ⇒ Object
1072 1073 1074 1075 |
# File 'lib/ruby_lexer.rb', line 1072 def ss_string= s raise "Probably not" ss.string = s end |
#string=(s) ⇒ Object
999 1000 1001 |
# File 'lib/ruby_lexer.rb', line 999 def string= s ss.string= s end |
#unscan ⇒ Object
1077 1078 1079 |
# File 'lib/ruby_lexer.rb', line 1077 def unscan ss.unscan end |