Method: Sass::Script::Lexer#str
- Defined in:
- lib/sass/script/lexer.rb
permalink #str { ... } ⇒ String
Records all non-comment text the lexer consumes within the block and returns it as a string.
248 249 250 251 252 253 |
# File 'lib/sass/script/lexer.rb', line 248
def str
old_pos = @tok ? @tok.pos : @scanner.pos
yield
new_pos = @tok ? @tok.pos : @scanner.pos
@scanner.string[old_pos...new_pos]
end
|