2222 * attribute values;
2323 * - AST lowering, called by the grammar actions
2424 * (Zend/zend_language_parser.y) to turn markup elements into ordinary
25- * `new \Html \Element(...)` / `\Html \render_component(...)` ASTs, so no
25+ * `new \Markup \Element(...)` / `\Markup \render_component(...)` ASTs, so no
2626 * new AST node kinds or zend_compile.c support are needed.
2727 *
2828 * The lexing mechanics themselves (scanner states, operand-position
@@ -257,8 +257,8 @@ zend_string *zend_markup_decode_entities(zend_string *str)
257257}
258258
259259/* Native markup AST lowering.
260- * Lower a markup element into an ordinary `new \Html \Element(tag, [], [children])`
261- * (or `new \Html \Fragment([children])` when the tag name is empty) so no new AST
260+ * Lower a markup element into an ordinary `new \Markup \Element(tag, [], [children])`
261+ * (or `new \Markup \Fragment([children])` when the tag name is empty) so no new AST
262262 * node kind or zend_compile.c support is needed. `name` is the tag-name zval AST
263263 * or NULL for a fragment; `children` is a ZEND_AST_ARRAY of ZEND_AST_ARRAY_ELEM.
264264 *
@@ -277,7 +277,7 @@ static zend_ast *zend_ast_markup_fq_name(const char *name, size_t len)
277277 * uppercase, which is namespace-qualified (contains "\"), or which names a
278278 * static method via "::", dispatches as a component; anything else is a literal
279279 * HTML element. The single home for this rule: the compiler applies it to
280- * static tag names here, and Html \render_dynamic applies it to a dynamic tag's
280+ * static tag names here, and Markup \render_dynamic applies it to a dynamic tag's
281281 * runtime value (hence ZEND_API). */
282282ZEND_API bool zend_markup_name_is_component (zend_string * tag )
283283{
@@ -286,7 +286,7 @@ ZEND_API bool zend_markup_name_is_component(zend_string *tag)
286286 || strstr (ZSTR_VAL (tag ), "::" ) != NULL ;
287287}
288288
289- /* Wrap a list of children in `new \Html \Fragment([children])`. Consumes (and, if
289+ /* Wrap a list of children in `new \Markup \Fragment([children])`. Consumes (and, if
290290 * NULL, creates) the children list. */
291291static zend_ast * zend_ast_wrap_fragment (zend_ast * children )
292292{
@@ -301,7 +301,7 @@ static zend_ast *zend_ast_wrap_fragment(zend_ast *children)
301301 zend_ast_create_list (1 , ZEND_AST_ARG_LIST , children ));
302302}
303303
304- /* Wrap a string AST in a `\Html \raw(...)` call (trusted passthrough). Used for
304+ /* Wrap a string AST in a `\Markup \raw(...)` call (trusted passthrough). Used for
305305 * `<!-- … -->` comments, which are emitted as literal HTML. */
306306zend_ast * zend_ast_create_markup_raw (zend_ast * str )
307307{
@@ -311,7 +311,7 @@ zend_ast *zend_ast_create_markup_raw(zend_ast *str)
311311}
312312
313313/* Wrap a children list in
314- * `new \Html \LazyFragment(fn() => new \Html \Fragment([children]))` (the
314+ * `new \Markup \LazyFragment(fn() => new \Markup \Fragment([children]))` (the
315315 * `:lazy` directive). The arrow function defers building the child subtree -
316316 * and running any side effects in its interpolations - until the component
317317 * actually renders the slot, so a component that discards its body never
@@ -320,7 +320,7 @@ static zend_ast *zend_ast_wrap_lazy_fragment(zend_ast *children, uint32_t lineno
320320{
321321 zend_ast * frag = zend_ast_wrap_fragment (children );
322322
323- /* fn() => new \Html \Fragment([...]) - an arrow function so its body
323+ /* fn() => new \Markup \Fragment([...]) - an arrow function so its body
324324 * auto-captures by value whatever it references, exactly as a hand-written
325325 * one would; only the expression evaluation is deferred. */
326326 zend_ast * params = zend_ast_create_list (0 , ZEND_AST_PARAM_LIST );
@@ -361,19 +361,19 @@ static bool zend_markup_extract_lazy(zend_ast *attrs)
361361}
362362
363363/* Lower a component tag (a capitalized or namespace-qualified name, or
364- * "Class::method") into a call to \Html \render_component(component, props, slot)
364+ * "Class::method") into a call to \Markup \render_component(component, props, slot)
365365 * Attributes become the props array and the body content becomes a
366- * single \Html \Fragment passed as the slot (or a lazy \Html \LazyFragment when
366+ * single \Markup \Fragment passed as the slot (or a lazy \Markup \LazyFragment when
367367 * the `:lazy` directive is present).
368368 *
369369 * Component resolution is two-stage, and every tag resolves through the *class*
370370 * name rules only: a bare/qualified tag lowers to ZEND_AST_CLASS_NAME (the
371371 * `Component::class` machinery), and a "Class::method" tag lowers the class
372372 * part the same way with "::method" appended - both honor `use` imports and
373373 * the current namespace, with a leading "\" fully qualified. The runtime then
374- * resolves the name to a class implementing Html\Htmlable (instantiated) or a
375- * public static method (called) - see PHP_FUNCTION(Html_render_component ) in
376- * ext/html/html .c.
374+ * resolves the name to a class implementing Markup\Html (instantiated) or a
375+ * public static method (called) - see PHP_FUNCTION(Markup_render_component ) in
376+ * ext/markup/markup .c.
377377 *
378378 * Plain *function* components are deliberately out of v1: a bare tag gives no
379379 * signal whether a class or a function is meant, and functions resolve through
@@ -419,7 +419,7 @@ static zend_ast *zend_ast_create_markup_component(zend_ast *name, zend_ast *attr
419419 bool lazy = zend_markup_extract_lazy (attrs );
420420
421421 /* The body becomes a single slot Fragment, or null when there is no body.
422- * With `:lazy` the fragment is wrapped in a deferred Html \LazyFragment. */
422+ * With `:lazy` the fragment is wrapped in a deferred Markup \LazyFragment. */
423423 zend_ast * slot ;
424424 if (children != NULL && zend_ast_get_list (children )-> children > 0 ) {
425425 children -> attr = ZEND_ARRAY_SYNTAX_SHORT ;
@@ -540,7 +540,7 @@ zend_ast *zend_ast_create_markup_checked(zend_ast *open, zend_ast *attrs, zend_a
540540 : zend_ast_create_markup_element (open , attrs , children );
541541}
542542
543- /* Build the \Html \render_dynamic(tag_expr, attributes, children) call both
543+ /* Build the \Markup \render_dynamic(tag_expr, attributes, children) call both
544544 * dynamic-tag forms lower into. `tag_expr` is an already-built expression AST
545545 * producing the tag name; `lineno` is the opening-tag line (see
546546 * zend_ast_create_markup_element for why it is stamped explicitly). */
@@ -569,7 +569,7 @@ static zend_ast *zend_markup_dynamic_call(zend_ast *tag_expr, zend_ast *attrs, z
569569}
570570
571571/* Lower a dynamic tag `<$tag …>…</$tag>` into a call to
572- * \Html \render_dynamic($tag, attributes, children). The variable's runtime
572+ * \Markup \render_dynamic($tag, attributes, children). The variable's runtime
573573 * value decides what a static tag name decides at compile time, by the same
574574 * classification rule (zend_markup_name_is_component); only classification
575575 * moves to runtime. `name` is the T_VARIABLE zval AST (without the "$"). */
0 commit comments