rip-lang 3.13.111 → 3.13.113
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 +1 -1
- package/docs/dist/rip.js +139 -140
- package/docs/dist/rip.min.js +113 -114
- package/docs/dist/rip.min.js.br +0 -0
- package/package.json +1 -1
- package/src/components.js +48 -25
- package/src/grammar/grammar.rip +2 -1
- package/src/parser.js +60 -59
- package/src/types.js +1 -23
package/src/types.js
CHANGED
|
@@ -1189,28 +1189,6 @@ function expandSuffixes(typeStr) {
|
|
|
1189
1189
|
return typeStr;
|
|
1190
1190
|
}
|
|
1191
1191
|
|
|
1192
|
-
function findInheritedTagNearLine(sourceLines, line, componentName = null) {
|
|
1193
|
-
if (!Array.isArray(sourceLines)) return null;
|
|
1194
|
-
if (Number.isInteger(line)) {
|
|
1195
|
-
const start = Math.max(0, line - 2);
|
|
1196
|
-
const end = Math.min(sourceLines.length - 1, line + 2);
|
|
1197
|
-
for (let i = start; i <= end; i++) {
|
|
1198
|
-
const m = sourceLines[i]?.match(/#\s*@inherits\s+([A-Za-z][\w-]*)/);
|
|
1199
|
-
if (m) return m[1];
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
if (componentName) {
|
|
1203
|
-
const escaped = componentName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
1204
|
-
const declRe = new RegExp(`\\b${escaped}\\b\\s*=\\s*component\\b`);
|
|
1205
|
-
for (const lineText of sourceLines) {
|
|
1206
|
-
if (!declRe.test(lineText)) continue;
|
|
1207
|
-
const m = lineText.match(/#\s*@inherits\s+([A-Za-z][\w-]*)/);
|
|
1208
|
-
if (m) return m[1];
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
return null;
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
1192
|
// ============================================================================
|
|
1215
1193
|
// Component type emission — walk s-expression for component declarations
|
|
1216
1194
|
// ============================================================================
|
|
@@ -1243,7 +1221,7 @@ function emitComponentTypes(sexpr, lines, indent, indentLevel, componentVars, so
|
|
|
1243
1221
|
|
|
1244
1222
|
if (name && compNode) {
|
|
1245
1223
|
let exp = exported ? 'export ' : '';
|
|
1246
|
-
let inheritsTag =
|
|
1224
|
+
let inheritsTag = compNode[1]?.valueOf?.() ?? null;
|
|
1247
1225
|
let inheritedPropsType = inheritsTag ? `__RipProps<'${inheritsTag}'>` : null;
|
|
1248
1226
|
if (inheritedPropsType) usesIntrinsicProps = true;
|
|
1249
1227
|
|