api
emitter.ch
Declarations in emitter.ch
1 declarationscss_parser
Declarations
Public only
CssEmitter#
Publicinterface
interface CssEmitter
CssEmitter is a static interface that abstracts how converted CSS output
is emitted.
The compiler plugin (css_cbi) implements this interface by accumulating text
into a buffer and emitting `page.append_css(...)` calls into the generated
chemical AST (through flush() and emit_chemical_value()).
The runtime package (css) implements this interface by appending text
directly into a std::string, so users can parse CSS and get the resulting
CSS source back as a string in their executable.
Since this is a static interface, only a single implementation may exist
in a program. The css_parser package contains the shared conversion logic
(CssConverter) which drives this interface.
emit_text#
Publicfunction
* Append raw CSS text to the output buffer.
emit_char#
Publicfunction
func emit_char(self : &CssEmitter, c : char) : void
* Append a single character to the output buffer.
emit_integer#
Publicfunction
func emit_integer(self : &CssEmitter, v : i64) : void
* Append an integer value to the output buffer.
emit_uinteger#
Publicfunction
func emit_uinteger(self : &CssEmitter, v : u64) : void
* Append an unsigned integer value to the output buffer.
flush#
Publicfunction
func flush(self : &CssEmitter) : void
* Called to flush any pending buffered text. In the compiler plugin,
* this emits a `page.append_css(str, len)` call. In the runtime,
* this is a no-op.
emit_chemical_value#
Publicfunction
* Called when a Chemical value (interpolation) is encountered inside
* a CSS value. In the compiler plugin, this emits the appropriate
* AST call. In the runtime, this is a no-op.