class

Hwaro::Assets::Sass::Parser

Inherits Reference < Object

Constants

MAX_BLOCK_DEPTH = 256

Far beyond any real stylesheet's nesting; parse recursion past this must error instead of overflowing the stack — a stack overflow is unrescuable and would kill hwaro serve outright.

Constructors

new(source : String, path : String)
Source

Class methods

comment_template(text : String, path : String, line : Int32, column : Int32) : Ast::TextTemplate | Nil

Splits a loud comment's text into literal runs and #{...} interpolations. Positions inside the returned template are relative to the comment body, so errors carry the comment's own location instead. nil when the text doesn't parse as a template (a literal #{ with no closing brace) — plain-CSS comments must keep passing through verbatim, never become parse errors.

Source
parse(source : String, path : String) : Ast::Stylesheet
Source
split_top_level_commas(text : String) : Array(String)

Splits selector-ish text on commas outside strings/brackets/parens. Shared with the evaluator's selector resolution.

Source

Instance methods

parse
Source