rip-lang 3.13.63 → 3.13.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/docs/RIP-LANG.md +19 -0
- package/docs/dist/rip.js +18 -13
- package/docs/dist/rip.min.js +175 -175
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/src/components.js +16 -12
package/docs/dist/rip.min.js.br
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/components.js
CHANGED
|
@@ -112,6 +112,8 @@ function isPublicProp(target) {
|
|
|
112
112
|
|
|
113
113
|
export function installComponentSupport(CodeGenerator, Lexer) {
|
|
114
114
|
|
|
115
|
+
let meta = (node, key) => node instanceof String ? node[key] : undefined;
|
|
116
|
+
|
|
115
117
|
// ==========================================================================
|
|
116
118
|
// Lexer: Context-sensitive 'offer'/'accept' (only inside component bodies)
|
|
117
119
|
// ==========================================================================
|
|
@@ -261,16 +263,18 @@ export function installComponentSupport(CodeGenerator, Lexer) {
|
|
|
261
263
|
if (!inRender) return 1;
|
|
262
264
|
|
|
263
265
|
// ─────────────────────────────────────────────────────────────────────
|
|
264
|
-
// Expression output: = expr →
|
|
266
|
+
// Expression output: = expr → text node (stamp .text, skip tag detection)
|
|
265
267
|
// ─────────────────────────────────────────────────────────────────────
|
|
266
268
|
if (tag === '=' && i > 0) {
|
|
267
269
|
let prev = tokens[i - 1][0];
|
|
268
270
|
if (prev === 'TERMINATOR' || prev === 'INDENT' || prev === 'RENDER') {
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
271
|
+
tokens.splice(i, 1);
|
|
272
|
+
if (tokens[i] && tokens[i][0] === 'IDENTIFIER') {
|
|
273
|
+
let val = tokens[i][1];
|
|
274
|
+
if (typeof val === 'string') { val = new String(val); tokens[i][1] = val; }
|
|
275
|
+
val.text = true;
|
|
276
|
+
}
|
|
277
|
+
return 0;
|
|
274
278
|
}
|
|
275
279
|
}
|
|
276
280
|
|
|
@@ -560,11 +564,11 @@ export function installComponentSupport(CodeGenerator, Lexer) {
|
|
|
560
564
|
current = current[1];
|
|
561
565
|
}
|
|
562
566
|
let raw = typeof current === 'string' ? current : (current instanceof String ? current.valueOf() : null);
|
|
563
|
-
if (raw === null) return { tag: null, classes, id: undefined };
|
|
567
|
+
if (raw === null) return { tag: null, classes, id: undefined, base: current };
|
|
564
568
|
// Split tag#id — e.g. "div#content" → tag: "div", id: "content"
|
|
565
569
|
let [tag, id] = raw.split('#');
|
|
566
570
|
if (!tag) tag = 'div'; // bare #id → div
|
|
567
|
-
return { tag, classes, id };
|
|
571
|
+
return { tag, classes, id, base: current };
|
|
568
572
|
};
|
|
569
573
|
|
|
570
574
|
// ==========================================================================
|
|
@@ -1061,7 +1065,7 @@ export function installComponentSupport(CodeGenerator, Lexer) {
|
|
|
1061
1065
|
}
|
|
1062
1066
|
|
|
1063
1067
|
// HTML tag (possibly with #id, e.g. div#content)
|
|
1064
|
-
if (headStr && this.isHtmlTag(headStr)) {
|
|
1068
|
+
if (headStr && this.isHtmlTag(headStr) && !meta(head, 'text')) {
|
|
1065
1069
|
let [tagName, id] = headStr.split('#');
|
|
1066
1070
|
return this.generateTag(tagName || 'div', [], rest, id);
|
|
1067
1071
|
}
|
|
@@ -1084,9 +1088,9 @@ export function installComponentSupport(CodeGenerator, Lexer) {
|
|
|
1084
1088
|
return slotVar;
|
|
1085
1089
|
}
|
|
1086
1090
|
|
|
1087
|
-
// HTML tag with classes (div.class)
|
|
1088
|
-
const { tag, classes, id } = this.collectTemplateClasses(sexpr);
|
|
1089
|
-
if (tag && this.isHtmlTag(tag)) {
|
|
1091
|
+
// HTML tag with classes (div.class) — skip if base is marked .text by = prefix
|
|
1092
|
+
const { tag, classes, id, base } = this.collectTemplateClasses(sexpr);
|
|
1093
|
+
if (!meta(base, 'text') && tag && this.isHtmlTag(tag)) {
|
|
1090
1094
|
return this.generateTag(tag, classes, [], id);
|
|
1091
1095
|
}
|
|
1092
1096
|
|