Module: RubyLexer::SSWrapper

Included in:
RubyLexer
Defined in:
lib/ruby_lexer.rb

Instance Method Summary collapse

Instance Method Details

#beginning_of_line?Boolean Also known as: bol?

Returns:

  • (Boolean)


1002
1003
1004
# File 'lib/ruby_lexer.rb', line 1002

def beginning_of_line?
  ss.bol?
end

#check(re) ⇒ Object



1008
1009
1010
1011
1012
# File 'lib/ruby_lexer.rb', line 1008

def check re
  maybe_pop_stack

  ss.check re
end

#end_of_stream?Boolean Also known as: eos?

Returns:

  • (Boolean)


1014
1015
1016
# File 'lib/ruby_lexer.rb', line 1014

def end_of_stream?
  ss.eos?
end

#getchObject



1020
1021
1022
1023
1024
# File 'lib/ruby_lexer.rb', line 1020

def getch
  c = ss.getch
  c = ss.getch if c == "\r" && ss.peek(1) == "\n"
  c
end

#in_heredoc?Boolean

Returns:

  • (Boolean)


1034
1035
1036
# File 'lib/ruby_lexer.rb', line 1034

def in_heredoc?
  !!self.old_ss
end

#matchObject



1026
1027
1028
# File 'lib/ruby_lexer.rb', line 1026

def match
  ss
end

#matchedObject



1030
1031
1032
# File 'lib/ruby_lexer.rb', line 1030

def matched
  ss.matched
end

#maybe_pop_stackObject



1038
1039
1040
1041
1042
1043
# File 'lib/ruby_lexer.rb', line 1038

def maybe_pop_stack
  if ss.eos? && in_heredoc? then
    self.ss_pop
    self.lineno_pop
  end
end

#posObject



1045
1046
1047
# File 'lib/ruby_lexer.rb', line 1045

def pos
  ss.pos
end

#pos=(n) ⇒ Object



1049
1050
1051
# File 'lib/ruby_lexer.rb', line 1049

def pos= n
  ss.pos = n
end

#restObject



1053
1054
1055
# File 'lib/ruby_lexer.rb', line 1053

def rest
  ss.rest
end

#scan(re) ⇒ Object



1057
1058
1059
1060
1061
# File 'lib/ruby_lexer.rb', line 1057

def scan re
  maybe_pop_stack

  ss.scan re
end

#scanner_classObject

TODO: design this out of oedipus_lex. or something.



1063
1064
1065
# File 'lib/ruby_lexer.rb', line 1063

def scanner_class # TODO: design this out of oedipus_lex. or something.
  RPStringScanner
end

#ss_stringObject



1067
1068
1069
# File 'lib/ruby_lexer.rb', line 1067

def ss_string
  ss.string
end

#ss_string=(s) ⇒ Object



1071
1072
1073
1074
# File 'lib/ruby_lexer.rb', line 1071

def ss_string= s
  raise "Probably not"
  ss.string = s
end

#string=(s) ⇒ Object



998
999
1000
# File 'lib/ruby_lexer.rb', line 998

def string= s
  ss.string= s
end

#unscanObject



1076
1077
1078
# File 'lib/ruby_lexer.rb', line 1076

def unscan
  ss.unscan
end