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)


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?

Returns:

  • (Boolean)


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

def end_of_stream?
  ss.eos?
end

#getchObject



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

Returns:

  • (Boolean)


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

def in_heredoc?
  !!self.old_ss
end

#matchObject



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

def match
  ss
end

#matchedObject



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

def matched
  ss.matched
end

#maybe_pop_stackObject



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

#posObject



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

#restObject



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_classObject

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_stringObject



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

#unscanObject



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

def unscan
  ss.unscan
end