Class: Sass::SCSS::Parser
- Inherits:
-
Object
- Object
- Sass::SCSS::Parser
- Includes:
- RX
- Defined in:
- /var/www/sass-pages/.sass/lib/sass/scss/parser.rb
Overview
The parser for SCSS. It parses a string of code into a tree of Sass::Tree::Nodes.
Direct Known Subclasses
Constant Summary
Instance Method Summary
- - (Parser) initialize(str, filename, line = 1) constructor A new instance of Parser.
- - (Sass::Tree::RootNode) parse Parses an SCSS document.
- - (Array<String, Sass::Script::Node>?) parse_interp_ident Parses an identifier with interpolation.
Methods included from RX
Constructor Details
- (Parser) initialize(str, filename, line = 1)
A new instance of Parser
14 15 16 17 18 19 |
# File '/var/www/sass-pages/.sass/lib/sass/scss/parser.rb', line 14
def initialize(str, filename, line = 1)
@template = str
@filename = filename
@line = line
@strs = []
end
|
Instance Method Details
- (Sass::Tree::RootNode) parse
Parses an SCSS document.
25 26 27 28 29 30 |
# File '/var/www/sass-pages/.sass/lib/sass/scss/parser.rb', line 25
def parse
init_scanner!
root = stylesheet
expected("selector or at-rule") unless @scanner.eos?
root
end
|
- (Array<String, Sass::Script::Node>?) parse_interp_ident
Parses an identifier with interpolation. Note that this won’t assert that the identifier takes up the entire input string; it’s meant to be used with StringScanners as part of other parsers.
38 39 40 41 |
# File '/var/www/sass-pages/.sass/lib/sass/scss/parser.rb', line 38
def parse_interp_ident
init_scanner!
interp_ident
end
|