Method: Sass::Script::Lexer#str

Defined in:
lib/sass/script/lexer.rb

#str { ... } ⇒ String

Records all non-comment text the lexer consumes within the block and returns it as a string.

Yields:

  • A block in which text is recorded

Returns:

  • (String)
[View source]

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