Skip to content

Commit 768dc33

Browse files
committed
Remove RFC references
1 parent 79e4190 commit 768dc33

24 files changed

Lines changed: 87 additions & 89 deletions

Zend/zend_language_scanner.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
21922192
}
21932193

21942194
<ST_MARKUP_CONTENT>"<!--" {
2195-
/* An HTML comment, emitted verbatim (RFC §7). Scan to the closing "-->";
2195+
/* An HTML comment, emitted verbatim. Scan to the closing "-->";
21962196
* content is literal (no interpolation). */
21972197
while (YYCURSOR < YYLIMIT) {
21982198
if (YYCURSOR + 2 < YYLIMIT && YYCURSOR[0] == '-' && YYCURSOR[1] == '-' && YYCURSOR[2] == '>') {
@@ -2207,7 +2207,7 @@ OPTIONAL_WHITESPACE_OR_COMMENTS ({WHITESPACE}|{MULTI_LINE_COMMENT}|{SINGLE_LINE_
22072207
}
22082208

22092209
<ST_MARKUP_CONTENT>"<!doctype" {
2210-
/* An HTML doctype, emitted verbatim like a comment (RFC §6). Matches
2210+
/* An HTML doctype, emitted verbatim like a comment. Matches
22112211
* case-insensitively (--case-inverted); scan to the closing ">";
22122212
* content is literal (no interpolation). */
22132213
while (YYCURSOR < YYLIMIT) {

Zend/zend_markup.c

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
+----------------------------------------------------------------------+
1616
*/
1717

18-
/* Native markup (RFC: Native Markup Expressions) compile-time support:
18+
/* Native Markup Expressions compile-time support:
1919
*
2020
* - text normalization and character-reference decoding, called by the
2121
* lexer (Zend/zend_language_scanner.l) on markup text and literal
@@ -36,20 +36,20 @@
3636
#include "zend_markup.h"
3737
#include "zend_markup_entities.h"
3838

39-
/* Native markup whitespace normalization (RFC §7), following the JSX/Babel rules:
39+
/* Native markup whitespace normalization, following the JSX/Babel rules:
4040
* - split the text node into lines;
4141
* - trim leading whitespace on every line but the first, and trailing
4242
* whitespace on every line but the last;
4343
* - drop lines that are empty after trimming;
4444
* - join the surviving lines with a single space.
4545
* The net effect: indentation/newlines between block elements vanish, while a
4646
* meaningful single space between inline content is preserved. Returns a new
47-
* zend_string (possibly empty the caller drops empty text nodes).
47+
* zend_string (possibly empty - the caller drops empty text nodes).
4848
*
4949
* One streaming pass: because a non-first line is left-trimmed and a non-last
5050
* line is right-trimmed, any line that survives contains a non-whitespace
5151
* character, so "join surviving lines with a single space" is simply a space
52-
* before every surviving line except the first no line table or lookahead
52+
* before every surviving line except the first - no line table or lookahead
5353
* for the last non-blank line is needed. A single-line text is untouched apart
5454
* from the tab conversion, exactly as before. */
5555
zend_string *zend_markup_normalize_text(const char *text, size_t len)
@@ -108,13 +108,13 @@ zend_string *zend_markup_normalize_text(const char *text, size_t len)
108108
return result;
109109
}
110110

111-
/* Native markup character references (RFC §7). Markup text and literal
111+
/* Native markup character references. Markup text and literal
112112
* attribute values decode HTML character references at compile time: the
113113
* frozen WHATWG named set (semicolon-terminated forms only; the standard
114114
* guarantees the list will never grow) plus numeric &#123; / &#x1F600; forms.
115115
* Decoding is lenient like HTML and JSX: anything that does not parse as a
116-
* reference a bare "&", an unknown name, an out-of-range or surrogate
117-
* codepoint stays literal text, so "fish & chips" needs no escaping.
116+
* reference - a bare "&", an unknown name, an out-of-range or surrogate
117+
* codepoint - stays literal text, so "fish & chips" needs no escaping.
118118
* Decoded text is a plain string escaped at render time, so "&amp;" in source
119119
* round-trips to "&amp;" in output. Text decodes after whitespace
120120
* normalization, so "&#32;" survives it (the entity spelling of JSX's {' '}). */
@@ -256,7 +256,7 @@ zend_string *zend_markup_decode_entities(zend_string *str)
256256
return smart_str_extract(&buf);
257257
}
258258

259-
/* Native markup AST lowering (RFC: Native Markup Expressions, Phase 2/3).
259+
/* Native markup AST lowering.
260260
* Lower a markup element into an ordinary `new \Html\Element(tag, [], [children])`
261261
* (or `new \Html\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
@@ -273,7 +273,7 @@ static zend_ast *zend_ast_markup_fq_name(const char *name, size_t len)
273273
return ast;
274274
}
275275

276-
/* Element vs component classification (RFC §4): a tag whose first character is
276+
/* Element vs component classification: a tag whose first character is
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
@@ -302,7 +302,7 @@ static zend_ast *zend_ast_wrap_fragment(zend_ast *children)
302302
}
303303

304304
/* Wrap a string AST in a `\Html\raw(...)` call (trusted passthrough). Used for
305-
* `<!-- … -->` comments, which are emitted as literal HTML (RFC §7). */
305+
* `<!-- … -->` comments, which are emitted as literal HTML. */
306306
zend_ast *zend_ast_create_markup_raw(zend_ast *str)
307307
{
308308
zend_ast *fn = zend_ast_markup_fq_name(ZEND_STRL(ZEND_MARKUP_RAW_FQ));
@@ -311,16 +311,16 @@ 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]))` (RFC §5, the
315-
* `:lazy` directive). The arrow function defers building the child subtree
316-
* and running any side effects in its interpolations until the component
314+
* `new \Html\LazyFragment(fn() => new \Html\Fragment([children]))` (the
315+
* `:lazy` directive). The arrow function defers building the child subtree -
316+
* and running any side effects in its interpolations - until the component
317317
* actually renders the slot, so a component that discards its body never
318318
* evaluates it. Consumes `children`. */
319319
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 \Html\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);
@@ -362,24 +362,24 @@ static bool zend_markup_extract_lazy(zend_ast *attrs)
362362

363363
/* Lower a component tag (a capitalized or namespace-qualified name, or
364364
* "Class::method") into a call to \Html\render_component(component, props, slot)
365-
* (RFC §3). Attributes become the props array and the body content becomes a
365+
* Attributes become the props array and the body content becomes a
366366
* single \Html\Fragment passed as the slot (or a lazy \Html\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
372-
* part the same way with "::method" appended both honor `use` imports and
372+
* part the same way with "::method" appended - both honor `use` imports and
373373
* the current namespace, with a leading "\" fully qualified. The runtime then
374374
* resolves the name to a class implementing Html\Htmlable (instantiated) or a
375-
* public static method (called) see PHP_FUNCTION(Html_render_component) in
375+
* public static method (called) - see PHP_FUNCTION(Html_render_component) in
376376
* ext/html/html.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
380380
* the separate `use function` import table, so supporting them would need a
381381
* second compile-time resolution and a new AST kind to carry it. A static
382-
* method has no such ambiguity its class part resolves like any class. */
382+
* method has no such ambiguity - its class part resolves like any class. */
383383
static zend_ast *zend_ast_create_markup_component(zend_ast *name, zend_ast *attrs, zend_ast *children)
384384
{
385385
uint32_t lineno = zend_ast_get_lineno(name);
@@ -415,7 +415,7 @@ static zend_ast *zend_ast_create_markup_component(zend_ast *name, zend_ast *attr
415415
}
416416
attrs->attr = ZEND_ARRAY_SYNTAX_SHORT;
417417

418-
/* The `:lazy` directive is a compiler marker, not a prop strip it first. */
418+
/* The `:lazy` directive is a compiler marker, not a prop - strip it first. */
419419
bool lazy = zend_markup_extract_lazy(attrs);
420420

421421
/* The body becomes a single slot Fragment, or null when there is no body.
@@ -465,7 +465,7 @@ zend_ast *zend_ast_create_markup_element(zend_ast *name, zend_ast *attrs, zend_a
465465
? zend_ast_get_lineno(name) : zend_ast_get_lineno(children);
466466

467467
/* A capitalized name, a namespace-qualified name, or one containing "::"
468-
* is a component (RFC §3). */
468+
* is a component. */
469469
if (name != NULL && zend_markup_name_is_component(zend_ast_get_str(name))) {
470470
result = zend_ast_create_markup_component(name, attrs, children);
471471
result->lineno = lineno;
@@ -500,7 +500,7 @@ zend_ast *zend_ast_create_markup_element(zend_ast *name, zend_ast *attrs, zend_a
500500
}
501501

502502
/* Build a markup element (or, with `dynamic`, a dynamic tag) after checking
503-
* the closing tag matches the opener (RFC §7): `<div>…</span>` and
503+
* the closing tag matches the opener: `<div>…</span>` and
504504
* `<$a>…</$b>` are compile errors alike. Both `open` and `close` NULL means a
505505
* `<>…</>` fragment. `close` is consumed. */
506506
zend_ast *zend_ast_create_markup_checked(zend_ast *open, zend_ast *attrs, zend_ast *children, zend_ast *close, bool dynamic)
@@ -568,7 +568,7 @@ static zend_ast *zend_markup_dynamic_call(zend_ast *tag_expr, zend_ast *attrs, z
568568
return result;
569569
}
570570

571-
/* Lower a dynamic tag `<$tag …>…</$tag>` (RFC §4) into a call to
571+
/* Lower a dynamic tag `<$tag …>…</$tag>` into a call to
572572
* \Html\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
@@ -592,4 +592,3 @@ zend_ast *zend_ast_create_markup_dynamic_expr(zend_ast *expr, zend_ast *attrs, z
592592
{
593593
return zend_markup_dynamic_call(expr, attrs, children, zend_ast_get_lineno(expr));
594594
}
595-

Zend/zend_markup.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "zend_ast.h"
2222

23-
/* The fully-qualified names that native markup (RFC: Native Markup Expressions)
23+
/* The fully-qualified names that Native Markup Expressions
2424
* lowers into. This is the single home for the markup-to-runtime vocabulary:
2525
* the parser (Zend/zend_language_parser.y) lowers markup expressions to exactly
2626
* these symbols, and the ext/html runtime registers exactly them (asserted at
@@ -40,9 +40,9 @@
4040

4141
BEGIN_EXTERN_C()
4242

43-
/* Element vs component classification (RFC §4): uppercase first character,
43+
/* Element vs component classification: uppercase first character,
4444
* a "\", or a "::" dispatches as a component; anything else is a literal HTML
45-
* element. The single home for this rule the compiler applies it to static
45+
* element. The single home for this rule - the compiler applies it to static
4646
* tag names, and Html\render_dynamic applies it to a dynamic tag's runtime
4747
* value, so `<$tag>` decides at runtime exactly what `<tag>` decides at
4848
* compile time. */

Zend/zend_markup_entities.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* This is a generated file edit Zend/zend_markup_entities_gen.php instead.
1+
/* This is a generated file - edit Zend/zend_markup_entities_gen.php instead.
22
* Source data: ext/standard/html_tables/ents_html5.txt (the WHATWG HTML5
33
* named-reference table, frozen by the HTML standard; also feeds
44
* html_entity_decode()). Canonical semicolon-terminated forms only; sorted

Zend/zend_markup_entities_gen.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?php
2+
23
/**
3-
* Generates zend_markup_entities.h the named character reference table used
4-
* by native markup text/attribute decoding (RFC: Native Markup Expressions).
4+
* Generates zend_markup_entities.h - the named character reference table used
5+
* by native markup text/attribute decoding.
56
*
67
* Usage: php Zend/zend_markup_entities_gen.php > Zend/zend_markup_entities.h
78
*
8-
* The source data is ext/standard/html_tables/ents_html5.txt the same
9+
* The source data is ext/standard/html_tables/ents_html5.txt - the same
910
* WHATWG HTML5 named-reference table that feeds html_entity_decode(), so
1011
* there is a single copy of the data in the tree. The HTML standard
11-
* guarantees this list is frozen no named entity will ever be added so
12+
* guarantees this list is frozen - no named entity will ever be added - so
1213
* the generated header only changes if this generator does. The table
1314
* contains only the canonical semicolon-terminated forms: markup requires
1415
* the well-formed "&name;" spelling and treats legacy forms like "&amp"
@@ -23,7 +24,8 @@
2324
exit(1);
2425
}
2526

26-
function utf8_bytes(int $cp): string {
27+
function utf8_bytes(int $cp): string
28+
{
2729
if ($cp < 0x80) {
2830
return chr($cp);
2931
} elseif ($cp < 0x800) {
@@ -66,7 +68,7 @@ function utf8_bytes(int $cp): string {
6668
$count = count($entities);
6769

6870
echo <<<EOT
69-
/* This is a generated file edit Zend/zend_markup_entities_gen.php instead.
71+
/* This is a generated file - edit Zend/zend_markup_entities_gen.php instead.
7072
* Source data: ext/standard/html_tables/ents_html5.txt (the WHATWG HTML5
7173
* named-reference table, frozen by the HTML standard; also feeds
7274
* html_entity_decode()). Canonical semicolon-terminated forms only; sorted

0 commit comments

Comments
 (0)