@herb-tools/core 0.9.0 → 0.9.1

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.
@@ -157,7 +157,7 @@ class Token {
157
157
  }
158
158
 
159
159
  // NOTE: This file is generated by the templates/template.rb script and should not
160
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/errors.ts.erb
160
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/errors.ts.erb
161
161
  class HerbError {
162
162
  type;
163
163
  message;
@@ -1158,6 +1158,279 @@ class NestedERBTagError extends HerbError {
1158
1158
  return output;
1159
1159
  }
1160
1160
  }
1161
+ class RenderAmbiguousLocalsError extends HerbError {
1162
+ partial;
1163
+ static from(data) {
1164
+ return new RenderAmbiguousLocalsError({
1165
+ type: data.type,
1166
+ message: data.message,
1167
+ location: Location.from(data.location),
1168
+ partial: data.partial,
1169
+ });
1170
+ }
1171
+ constructor(props) {
1172
+ super(props.type, props.message, props.location);
1173
+ this.partial = props.partial;
1174
+ }
1175
+ toJSON() {
1176
+ return {
1177
+ ...super.toJSON(),
1178
+ type: "RENDER_AMBIGUOUS_LOCALS_ERROR",
1179
+ partial: this.partial,
1180
+ };
1181
+ }
1182
+ toMonacoDiagnostic() {
1183
+ return {
1184
+ line: this.location.start.line,
1185
+ column: this.location.start.column,
1186
+ endLine: this.location.end.line,
1187
+ endColumn: this.location.end.column,
1188
+ message: this.message,
1189
+ severity: 'error'
1190
+ };
1191
+ }
1192
+ treeInspect() {
1193
+ let output = "";
1194
+ output += `@ RenderAmbiguousLocalsError ${this.location.treeInspectWithLabel()}\n`;
1195
+ output += `├── message: "${this.message}"\n`;
1196
+ output += `└── partial: ${JSON.stringify(this.partial)}\n`;
1197
+ return output;
1198
+ }
1199
+ }
1200
+ class RenderMissingLocalsError extends HerbError {
1201
+ partial;
1202
+ keywords;
1203
+ static from(data) {
1204
+ return new RenderMissingLocalsError({
1205
+ type: data.type,
1206
+ message: data.message,
1207
+ location: Location.from(data.location),
1208
+ partial: data.partial,
1209
+ keywords: data.keywords,
1210
+ });
1211
+ }
1212
+ constructor(props) {
1213
+ super(props.type, props.message, props.location);
1214
+ this.partial = props.partial;
1215
+ this.keywords = props.keywords;
1216
+ }
1217
+ toJSON() {
1218
+ return {
1219
+ ...super.toJSON(),
1220
+ type: "RENDER_MISSING_LOCALS_ERROR",
1221
+ partial: this.partial,
1222
+ keywords: this.keywords,
1223
+ };
1224
+ }
1225
+ toMonacoDiagnostic() {
1226
+ return {
1227
+ line: this.location.start.line,
1228
+ column: this.location.start.column,
1229
+ endLine: this.location.end.line,
1230
+ endColumn: this.location.end.column,
1231
+ message: this.message,
1232
+ severity: 'error'
1233
+ };
1234
+ }
1235
+ treeInspect() {
1236
+ let output = "";
1237
+ output += `@ RenderMissingLocalsError ${this.location.treeInspectWithLabel()}\n`;
1238
+ output += `├── message: "${this.message}"\n`;
1239
+ output += `├── partial: ${JSON.stringify(this.partial)}\n`;
1240
+ output += `└── keywords: ${JSON.stringify(this.keywords)}\n`;
1241
+ return output;
1242
+ }
1243
+ }
1244
+ class RenderNoArgumentsError extends HerbError {
1245
+ static from(data) {
1246
+ return new RenderNoArgumentsError({
1247
+ type: data.type,
1248
+ message: data.message,
1249
+ location: Location.from(data.location),
1250
+ });
1251
+ }
1252
+ constructor(props) {
1253
+ super(props.type, props.message, props.location);
1254
+ }
1255
+ toJSON() {
1256
+ return {
1257
+ ...super.toJSON(),
1258
+ type: "RENDER_NO_ARGUMENTS_ERROR",
1259
+ };
1260
+ }
1261
+ toMonacoDiagnostic() {
1262
+ return {
1263
+ line: this.location.start.line,
1264
+ column: this.location.start.column,
1265
+ endLine: this.location.end.line,
1266
+ endColumn: this.location.end.column,
1267
+ message: this.message,
1268
+ severity: 'error'
1269
+ };
1270
+ }
1271
+ treeInspect() {
1272
+ let output = "";
1273
+ output += `@ RenderNoArgumentsError ${this.location.treeInspectWithLabel()}\n`;
1274
+ output += `└── message: "${this.message}"\n`;
1275
+ return output;
1276
+ }
1277
+ }
1278
+ class RenderConflictingPartialError extends HerbError {
1279
+ positional_partial;
1280
+ keyword_partial;
1281
+ static from(data) {
1282
+ return new RenderConflictingPartialError({
1283
+ type: data.type,
1284
+ message: data.message,
1285
+ location: Location.from(data.location),
1286
+ positional_partial: data.positional_partial,
1287
+ keyword_partial: data.keyword_partial,
1288
+ });
1289
+ }
1290
+ constructor(props) {
1291
+ super(props.type, props.message, props.location);
1292
+ this.positional_partial = props.positional_partial;
1293
+ this.keyword_partial = props.keyword_partial;
1294
+ }
1295
+ toJSON() {
1296
+ return {
1297
+ ...super.toJSON(),
1298
+ type: "RENDER_CONFLICTING_PARTIAL_ERROR",
1299
+ positional_partial: this.positional_partial,
1300
+ keyword_partial: this.keyword_partial,
1301
+ };
1302
+ }
1303
+ toMonacoDiagnostic() {
1304
+ return {
1305
+ line: this.location.start.line,
1306
+ column: this.location.start.column,
1307
+ endLine: this.location.end.line,
1308
+ endColumn: this.location.end.column,
1309
+ message: this.message,
1310
+ severity: 'error'
1311
+ };
1312
+ }
1313
+ treeInspect() {
1314
+ let output = "";
1315
+ output += `@ RenderConflictingPartialError ${this.location.treeInspectWithLabel()}\n`;
1316
+ output += `├── message: "${this.message}"\n`;
1317
+ output += `├── positional_partial: ${JSON.stringify(this.positional_partial)}\n`;
1318
+ output += `└── keyword_partial: ${JSON.stringify(this.keyword_partial)}\n`;
1319
+ return output;
1320
+ }
1321
+ }
1322
+ class RenderInvalidAsOptionError extends HerbError {
1323
+ as_value;
1324
+ static from(data) {
1325
+ return new RenderInvalidAsOptionError({
1326
+ type: data.type,
1327
+ message: data.message,
1328
+ location: Location.from(data.location),
1329
+ as_value: data.as_value,
1330
+ });
1331
+ }
1332
+ constructor(props) {
1333
+ super(props.type, props.message, props.location);
1334
+ this.as_value = props.as_value;
1335
+ }
1336
+ toJSON() {
1337
+ return {
1338
+ ...super.toJSON(),
1339
+ type: "RENDER_INVALID_AS_OPTION_ERROR",
1340
+ as_value: this.as_value,
1341
+ };
1342
+ }
1343
+ toMonacoDiagnostic() {
1344
+ return {
1345
+ line: this.location.start.line,
1346
+ column: this.location.start.column,
1347
+ endLine: this.location.end.line,
1348
+ endColumn: this.location.end.column,
1349
+ message: this.message,
1350
+ severity: 'error'
1351
+ };
1352
+ }
1353
+ treeInspect() {
1354
+ let output = "";
1355
+ output += `@ RenderInvalidAsOptionError ${this.location.treeInspectWithLabel()}\n`;
1356
+ output += `├── message: "${this.message}"\n`;
1357
+ output += `└── as_value: ${JSON.stringify(this.as_value)}\n`;
1358
+ return output;
1359
+ }
1360
+ }
1361
+ class RenderObjectAndCollectionError extends HerbError {
1362
+ static from(data) {
1363
+ return new RenderObjectAndCollectionError({
1364
+ type: data.type,
1365
+ message: data.message,
1366
+ location: Location.from(data.location),
1367
+ });
1368
+ }
1369
+ constructor(props) {
1370
+ super(props.type, props.message, props.location);
1371
+ }
1372
+ toJSON() {
1373
+ return {
1374
+ ...super.toJSON(),
1375
+ type: "RENDER_OBJECT_AND_COLLECTION_ERROR",
1376
+ };
1377
+ }
1378
+ toMonacoDiagnostic() {
1379
+ return {
1380
+ line: this.location.start.line,
1381
+ column: this.location.start.column,
1382
+ endLine: this.location.end.line,
1383
+ endColumn: this.location.end.column,
1384
+ message: this.message,
1385
+ severity: 'error'
1386
+ };
1387
+ }
1388
+ treeInspect() {
1389
+ let output = "";
1390
+ output += `@ RenderObjectAndCollectionError ${this.location.treeInspectWithLabel()}\n`;
1391
+ output += `└── message: "${this.message}"\n`;
1392
+ return output;
1393
+ }
1394
+ }
1395
+ class RenderLayoutWithoutBlockError extends HerbError {
1396
+ layout;
1397
+ static from(data) {
1398
+ return new RenderLayoutWithoutBlockError({
1399
+ type: data.type,
1400
+ message: data.message,
1401
+ location: Location.from(data.location),
1402
+ layout: data.layout,
1403
+ });
1404
+ }
1405
+ constructor(props) {
1406
+ super(props.type, props.message, props.location);
1407
+ this.layout = props.layout;
1408
+ }
1409
+ toJSON() {
1410
+ return {
1411
+ ...super.toJSON(),
1412
+ type: "RENDER_LAYOUT_WITHOUT_BLOCK_ERROR",
1413
+ layout: this.layout,
1414
+ };
1415
+ }
1416
+ toMonacoDiagnostic() {
1417
+ return {
1418
+ line: this.location.start.line,
1419
+ column: this.location.start.column,
1420
+ endLine: this.location.end.line,
1421
+ endColumn: this.location.end.column,
1422
+ message: this.message,
1423
+ severity: 'error'
1424
+ };
1425
+ }
1426
+ treeInspect() {
1427
+ let output = "";
1428
+ output += `@ RenderLayoutWithoutBlockError ${this.location.treeInspectWithLabel()}\n`;
1429
+ output += `├── message: "${this.message}"\n`;
1430
+ output += `└── layout: ${JSON.stringify(this.layout)}\n`;
1431
+ return output;
1432
+ }
1433
+ }
1161
1434
  function fromSerializedError(error) {
1162
1435
  switch (error.type) {
1163
1436
  case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
@@ -1183,6 +1456,13 @@ function fromSerializedError(error) {
1183
1456
  case "UNCLOSED_ERB_TAG_ERROR": return UnclosedERBTagError.from(error);
1184
1457
  case "STRAY_ERB_CLOSING_TAG_ERROR": return StrayERBClosingTagError.from(error);
1185
1458
  case "NESTED_ERB_TAG_ERROR": return NestedERBTagError.from(error);
1459
+ case "RENDER_AMBIGUOUS_LOCALS_ERROR": return RenderAmbiguousLocalsError.from(error);
1460
+ case "RENDER_MISSING_LOCALS_ERROR": return RenderMissingLocalsError.from(error);
1461
+ case "RENDER_NO_ARGUMENTS_ERROR": return RenderNoArgumentsError.from(error);
1462
+ case "RENDER_CONFLICTING_PARTIAL_ERROR": return RenderConflictingPartialError.from(error);
1463
+ case "RENDER_INVALID_AS_OPTION_ERROR": return RenderInvalidAsOptionError.from(error);
1464
+ case "RENDER_OBJECT_AND_COLLECTION_ERROR": return RenderObjectAndCollectionError.from(error);
1465
+ case "RENDER_LAYOUT_WITHOUT_BLOCK_ERROR": return RenderLayoutWithoutBlockError.from(error);
1186
1466
  default:
1187
1467
  throw new Error(`Unknown node type: ${error.type}`);
1188
1468
  }
@@ -21353,7 +21633,7 @@ function deserializePrismNode(bytes, source) {
21353
21633
  }
21354
21634
 
21355
21635
  // NOTE: This file is generated by the templates/template.rb script and should not
21356
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/nodes.ts.erb
21636
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/nodes.ts.erb
21357
21637
  class Node {
21358
21638
  type;
21359
21639
  location;
@@ -23897,6 +24177,225 @@ class ERBUnlessNode extends Node {
23897
24177
  return output;
23898
24178
  }
23899
24179
  }
24180
+ class RubyRenderLocalNode extends Node {
24181
+ name;
24182
+ value;
24183
+ static get type() {
24184
+ return "AST_RUBY_RENDER_LOCAL_NODE";
24185
+ }
24186
+ static from(data) {
24187
+ return new RubyRenderLocalNode({
24188
+ type: data.type,
24189
+ location: Location.from(data.location),
24190
+ errors: (data.errors || []).map(error => HerbError.from(error)),
24191
+ name: data.name ? Token.from(data.name) : null,
24192
+ value: data.value ? fromSerializedNode((data.value)) : null,
24193
+ });
24194
+ }
24195
+ constructor(props) {
24196
+ super(props.type, props.location, props.errors);
24197
+ this.name = props.name;
24198
+ this.value = props.value;
24199
+ }
24200
+ accept(visitor) {
24201
+ visitor.visitRubyRenderLocalNode(this);
24202
+ }
24203
+ childNodes() {
24204
+ return [
24205
+ this.value,
24206
+ ];
24207
+ }
24208
+ compactChildNodes() {
24209
+ return this.childNodes().filter(node => node !== null && node !== undefined);
24210
+ }
24211
+ recursiveErrors() {
24212
+ return [
24213
+ ...this.errors,
24214
+ this.value ? this.value.recursiveErrors() : [],
24215
+ ].flat();
24216
+ }
24217
+ toJSON() {
24218
+ return {
24219
+ ...super.toJSON(),
24220
+ type: "AST_RUBY_RENDER_LOCAL_NODE",
24221
+ name: this.name ? this.name.toJSON() : null,
24222
+ value: this.value ? this.value.toJSON() : null,
24223
+ };
24224
+ }
24225
+ treeInspect() {
24226
+ let output = "";
24227
+ output += `@ RubyRenderLocalNode ${this.location.treeInspectWithLabel()}\n`;
24228
+ output += `├── errors: ${this.inspectArray(this.errors, "│ ")}`;
24229
+ output += `├── name: ${this.name ? this.name.treeInspect() : "∅"}\n`;
24230
+ output += `└── value: ${this.inspectNode(this.value, " ")}`;
24231
+ return output;
24232
+ }
24233
+ }
24234
+ class ERBRenderNode extends Node {
24235
+ tag_opening;
24236
+ content;
24237
+ tag_closing;
24238
+ // no-op for analyzed_ruby
24239
+ prism_node;
24240
+ partial;
24241
+ template_path;
24242
+ layout;
24243
+ file;
24244
+ inline_template;
24245
+ body;
24246
+ plain;
24247
+ html;
24248
+ renderable;
24249
+ collection;
24250
+ object;
24251
+ as_name;
24252
+ spacer_template;
24253
+ formats;
24254
+ variants;
24255
+ handlers;
24256
+ content_type;
24257
+ locals;
24258
+ static get type() {
24259
+ return "AST_ERB_RENDER_NODE";
24260
+ }
24261
+ static from(data) {
24262
+ return new ERBRenderNode({
24263
+ type: data.type,
24264
+ location: Location.from(data.location),
24265
+ errors: (data.errors || []).map(error => HerbError.from(error)),
24266
+ tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
24267
+ content: data.content ? Token.from(data.content) : null,
24268
+ tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
24269
+ // no-op for analyzed_ruby
24270
+ prism_node: data.prism_node ? new Uint8Array(data.prism_node) : null,
24271
+ partial: data.partial ? Token.from(data.partial) : null,
24272
+ template_path: data.template_path ? Token.from(data.template_path) : null,
24273
+ layout: data.layout ? Token.from(data.layout) : null,
24274
+ file: data.file ? Token.from(data.file) : null,
24275
+ inline_template: data.inline_template ? Token.from(data.inline_template) : null,
24276
+ body: data.body ? Token.from(data.body) : null,
24277
+ plain: data.plain ? Token.from(data.plain) : null,
24278
+ html: data.html ? Token.from(data.html) : null,
24279
+ renderable: data.renderable ? Token.from(data.renderable) : null,
24280
+ collection: data.collection ? Token.from(data.collection) : null,
24281
+ object: data.object ? Token.from(data.object) : null,
24282
+ as_name: data.as_name ? Token.from(data.as_name) : null,
24283
+ spacer_template: data.spacer_template ? Token.from(data.spacer_template) : null,
24284
+ formats: data.formats ? Token.from(data.formats) : null,
24285
+ variants: data.variants ? Token.from(data.variants) : null,
24286
+ handlers: data.handlers ? Token.from(data.handlers) : null,
24287
+ content_type: data.content_type ? Token.from(data.content_type) : null,
24288
+ locals: (data.locals || []).map(node => fromSerializedNode(node)),
24289
+ });
24290
+ }
24291
+ constructor(props) {
24292
+ super(props.type, props.location, props.errors);
24293
+ this.tag_opening = props.tag_opening;
24294
+ this.content = props.content;
24295
+ this.tag_closing = props.tag_closing;
24296
+ // no-op for analyzed_ruby
24297
+ this.prism_node = props.prism_node;
24298
+ this.partial = props.partial;
24299
+ this.template_path = props.template_path;
24300
+ this.layout = props.layout;
24301
+ this.file = props.file;
24302
+ this.inline_template = props.inline_template;
24303
+ this.body = props.body;
24304
+ this.plain = props.plain;
24305
+ this.html = props.html;
24306
+ this.renderable = props.renderable;
24307
+ this.collection = props.collection;
24308
+ this.object = props.object;
24309
+ this.as_name = props.as_name;
24310
+ this.spacer_template = props.spacer_template;
24311
+ this.formats = props.formats;
24312
+ this.variants = props.variants;
24313
+ this.handlers = props.handlers;
24314
+ this.content_type = props.content_type;
24315
+ this.locals = props.locals;
24316
+ }
24317
+ accept(visitor) {
24318
+ visitor.visitERBRenderNode(this);
24319
+ }
24320
+ childNodes() {
24321
+ return [
24322
+ ...this.locals,
24323
+ ];
24324
+ }
24325
+ compactChildNodes() {
24326
+ return this.childNodes().filter(node => node !== null && node !== undefined);
24327
+ }
24328
+ get prismNode() {
24329
+ if (!this.prism_node || !this.source)
24330
+ return null;
24331
+ return deserializePrismNode(this.prism_node, this.source);
24332
+ }
24333
+ recursiveErrors() {
24334
+ return [
24335
+ ...this.errors,
24336
+ ...this.locals.map(node => node.recursiveErrors()),
24337
+ ].flat();
24338
+ }
24339
+ toJSON() {
24340
+ return {
24341
+ ...super.toJSON(),
24342
+ type: "AST_ERB_RENDER_NODE",
24343
+ tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
24344
+ content: this.content ? this.content.toJSON() : null,
24345
+ tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
24346
+ // no-op for analyzed_ruby
24347
+ prism_node: this.prism_node ? Array.from(this.prism_node) : null,
24348
+ partial: this.partial ? this.partial.toJSON() : null,
24349
+ template_path: this.template_path ? this.template_path.toJSON() : null,
24350
+ layout: this.layout ? this.layout.toJSON() : null,
24351
+ file: this.file ? this.file.toJSON() : null,
24352
+ inline_template: this.inline_template ? this.inline_template.toJSON() : null,
24353
+ body: this.body ? this.body.toJSON() : null,
24354
+ plain: this.plain ? this.plain.toJSON() : null,
24355
+ html: this.html ? this.html.toJSON() : null,
24356
+ renderable: this.renderable ? this.renderable.toJSON() : null,
24357
+ collection: this.collection ? this.collection.toJSON() : null,
24358
+ object: this.object ? this.object.toJSON() : null,
24359
+ as_name: this.as_name ? this.as_name.toJSON() : null,
24360
+ spacer_template: this.spacer_template ? this.spacer_template.toJSON() : null,
24361
+ formats: this.formats ? this.formats.toJSON() : null,
24362
+ variants: this.variants ? this.variants.toJSON() : null,
24363
+ handlers: this.handlers ? this.handlers.toJSON() : null,
24364
+ content_type: this.content_type ? this.content_type.toJSON() : null,
24365
+ locals: this.locals.map(node => node.toJSON()),
24366
+ };
24367
+ }
24368
+ treeInspect() {
24369
+ let output = "";
24370
+ output += `@ ERBRenderNode ${this.location.treeInspectWithLabel()}\n`;
24371
+ output += `├── errors: ${this.inspectArray(this.errors, "│ ")}`;
24372
+ output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
24373
+ output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
24374
+ output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
24375
+ if (this.prism_node) {
24376
+ output += `├── prism_node: ${this.source ? inspectPrismSerialized(this.prism_node, this.source, "│ ") : `(${this.prism_node.length} bytes)`}\n`;
24377
+ }
24378
+ output += `├── partial: ${this.partial ? this.partial.treeInspect() : "∅"}\n`;
24379
+ output += `├── template_path: ${this.template_path ? this.template_path.treeInspect() : "∅"}\n`;
24380
+ output += `├── layout: ${this.layout ? this.layout.treeInspect() : "∅"}\n`;
24381
+ output += `├── file: ${this.file ? this.file.treeInspect() : "∅"}\n`;
24382
+ output += `├── inline_template: ${this.inline_template ? this.inline_template.treeInspect() : "∅"}\n`;
24383
+ output += `├── body: ${this.body ? this.body.treeInspect() : "∅"}\n`;
24384
+ output += `├── plain: ${this.plain ? this.plain.treeInspect() : "∅"}\n`;
24385
+ output += `├── html: ${this.html ? this.html.treeInspect() : "∅"}\n`;
24386
+ output += `├── renderable: ${this.renderable ? this.renderable.treeInspect() : "∅"}\n`;
24387
+ output += `├── collection: ${this.collection ? this.collection.treeInspect() : "∅"}\n`;
24388
+ output += `├── object: ${this.object ? this.object.treeInspect() : "∅"}\n`;
24389
+ output += `├── as_name: ${this.as_name ? this.as_name.treeInspect() : "∅"}\n`;
24390
+ output += `├── spacer_template: ${this.spacer_template ? this.spacer_template.treeInspect() : "∅"}\n`;
24391
+ output += `├── formats: ${this.formats ? this.formats.treeInspect() : "∅"}\n`;
24392
+ output += `├── variants: ${this.variants ? this.variants.treeInspect() : "∅"}\n`;
24393
+ output += `├── handlers: ${this.handlers ? this.handlers.treeInspect() : "∅"}\n`;
24394
+ output += `├── content_type: ${this.content_type ? this.content_type.treeInspect() : "∅"}\n`;
24395
+ output += `└── locals: ${this.inspectArray(this.locals, " ")}`;
24396
+ return output;
24397
+ }
24398
+ }
23900
24399
  class ERBYieldNode extends Node {
23901
24400
  tag_opening;
23902
24401
  content;
@@ -24060,6 +24559,8 @@ function fromSerializedNode(node) {
24060
24559
  case "AST_ERB_ENSURE_NODE": return ERBEnsureNode.from(node);
24061
24560
  case "AST_ERB_BEGIN_NODE": return ERBBeginNode.from(node);
24062
24561
  case "AST_ERB_UNLESS_NODE": return ERBUnlessNode.from(node);
24562
+ case "AST_RUBY_RENDER_LOCAL_NODE": return RubyRenderLocalNode.from(node);
24563
+ case "AST_ERB_RENDER_NODE": return ERBRenderNode.from(node);
24063
24564
  case "AST_ERB_YIELD_NODE": return ERBYieldNode.from(node);
24064
24565
  case "AST_ERB_IN_NODE": return ERBInNode.from(node);
24065
24566
  default:
@@ -24083,6 +24584,7 @@ const ERBNodeClasses = [
24083
24584
  ERBEnsureNode,
24084
24585
  ERBBeginNode,
24085
24586
  ERBUnlessNode,
24587
+ ERBRenderNode,
24086
24588
  ERBYieldNode,
24087
24589
  ERBInNode,
24088
24590
  ];
@@ -24129,6 +24631,7 @@ const DEFAULT_PARSER_OPTIONS = {
24129
24631
  analyze: true,
24130
24632
  strict: true,
24131
24633
  action_view_helpers: false,
24634
+ render_nodes: false,
24132
24635
  prism_nodes: false,
24133
24636
  prism_nodes_deep: false,
24134
24637
  prism_program: false,
@@ -24145,6 +24648,8 @@ class ParserOptions {
24145
24648
  analyze;
24146
24649
  /** Whether ActionView tag helper transformation was enabled during parsing. */
24147
24650
  action_view_helpers;
24651
+ /** Whether ActionView render call detection was enabled during parsing. */
24652
+ render_nodes;
24148
24653
  /** Whether Prism node serialization was enabled during parsing. */
24149
24654
  prism_nodes;
24150
24655
  /** Whether deep Prism node serialization was enabled during parsing. */
@@ -24159,6 +24664,7 @@ class ParserOptions {
24159
24664
  this.track_whitespace = options.track_whitespace ?? DEFAULT_PARSER_OPTIONS.track_whitespace;
24160
24665
  this.analyze = options.analyze ?? DEFAULT_PARSER_OPTIONS.analyze;
24161
24666
  this.action_view_helpers = options.action_view_helpers ?? DEFAULT_PARSER_OPTIONS.action_view_helpers;
24667
+ this.render_nodes = options.render_nodes ?? DEFAULT_PARSER_OPTIONS.render_nodes;
24162
24668
  this.prism_nodes = options.prism_nodes ?? DEFAULT_PARSER_OPTIONS.prism_nodes;
24163
24669
  this.prism_nodes_deep = options.prism_nodes_deep ?? DEFAULT_PARSER_OPTIONS.prism_nodes_deep;
24164
24670
  this.prism_program = options.prism_program ?? DEFAULT_PARSER_OPTIONS.prism_program;
@@ -24238,7 +24744,7 @@ class ParseResult extends Result {
24238
24744
  }
24239
24745
 
24240
24746
  // NOTE: This file is generated by the templates/template.rb script and should not
24241
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/node-type-guards.ts.erb
24747
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/node-type-guards.ts.erb
24242
24748
  /**
24243
24749
  * Type guard functions for AST nodes.
24244
24750
  * These functions provide type checking by combining both instanceof
@@ -24533,6 +25039,22 @@ function isERBUnlessNode(node) {
24533
25039
  return false;
24534
25040
  return node instanceof ERBUnlessNode || node.type === "AST_ERB_UNLESS_NODE" || node.constructor.type === "AST_ERB_UNLESS_NODE";
24535
25041
  }
25042
+ /**
25043
+ * Checks if a node is a RubyRenderLocalNode
25044
+ */
25045
+ function isRubyRenderLocalNode(node) {
25046
+ if (!node)
25047
+ return false;
25048
+ return node instanceof RubyRenderLocalNode || node.type === "AST_RUBY_RENDER_LOCAL_NODE" || node.constructor.type === "AST_RUBY_RENDER_LOCAL_NODE";
25049
+ }
25050
+ /**
25051
+ * Checks if a node is a ERBRenderNode
25052
+ */
25053
+ function isERBRenderNode(node) {
25054
+ if (!node)
25055
+ return false;
25056
+ return node instanceof ERBRenderNode || node.type === "AST_ERB_RENDER_NODE" || node.constructor.type === "AST_ERB_RENDER_NODE";
25057
+ }
24536
25058
  /**
24537
25059
  * Checks if a node is a ERBYieldNode
24538
25060
  */
@@ -24590,6 +25112,7 @@ function isERBNode(node) {
24590
25112
  isERBEnsureNode(node) ||
24591
25113
  isERBBeginNode(node) ||
24592
25114
  isERBUnlessNode(node) ||
25115
+ isERBRenderNode(node) ||
24593
25116
  isERBYieldNode(node) ||
24594
25117
  isERBInNode(node);
24595
25118
  }
@@ -24640,6 +25163,8 @@ const NODE_TYPE_GUARDS = new Map([
24640
25163
  [ERBEnsureNode, isERBEnsureNode],
24641
25164
  [ERBBeginNode, isERBBeginNode],
24642
25165
  [ERBUnlessNode, isERBUnlessNode],
25166
+ [RubyRenderLocalNode, isRubyRenderLocalNode],
25167
+ [ERBRenderNode, isERBRenderNode],
24643
25168
  [ERBYieldNode, isERBYieldNode],
24644
25169
  [ERBInNode, isERBInNode],
24645
25170
  ]);
@@ -24690,6 +25215,8 @@ const AST_TYPE_GUARDS = new Map([
24690
25215
  ["AST_ERB_ENSURE_NODE", isERBEnsureNode],
24691
25216
  ["AST_ERB_BEGIN_NODE", isERBBeginNode],
24692
25217
  ["AST_ERB_UNLESS_NODE", isERBUnlessNode],
25218
+ ["AST_RUBY_RENDER_LOCAL_NODE", isRubyRenderLocalNode],
25219
+ ["AST_ERB_RENDER_NODE", isERBRenderNode],
24693
25220
  ["AST_ERB_YIELD_NODE", isERBYieldNode],
24694
25221
  ["AST_ERB_IN_NODE", isERBInNode],
24695
25222
  ]);
@@ -25021,6 +25548,18 @@ function filterERBBeginNodes(nodes) {
25021
25548
  function filterERBUnlessNodes(nodes) {
25022
25549
  return nodes.filter(isERBUnlessNode);
25023
25550
  }
25551
+ /**
25552
+ * Filters an array of nodes to only include RubyRenderLocalNode nodes
25553
+ */
25554
+ function filterRubyRenderLocalNodes(nodes) {
25555
+ return nodes.filter(isRubyRenderLocalNode);
25556
+ }
25557
+ /**
25558
+ * Filters an array of nodes to only include ERBRenderNode nodes
25559
+ */
25560
+ function filterERBRenderNodes(nodes) {
25561
+ return nodes.filter(isERBRenderNode);
25562
+ }
25024
25563
  /**
25025
25564
  * Filters an array of nodes to only include ERBYieldNode nodes
25026
25565
  */
@@ -25150,7 +25689,7 @@ function hasStaticAttributeName(attributeNameNode) {
25150
25689
  /**
25151
25690
  * Checks if an HTML attribute name node has dynamic content (contains ERB)
25152
25691
  */
25153
- function hasDynamicAttributeName(attributeNameNode) {
25692
+ function hasDynamicAttributeNameNode(attributeNameNode) {
25154
25693
  if (!attributeNameNode.children) {
25155
25694
  return false;
25156
25695
  }
@@ -25287,12 +25826,11 @@ function hasAttribute(node, attributeName) {
25287
25826
  }
25288
25827
  /**
25289
25828
  * Checks if an attribute has a dynamic (ERB-containing) name.
25290
- * Accepts an HTMLAttributeNode (wraps the core HTMLAttributeNameNode-level check).
25291
25829
  */
25292
- function hasDynamicAttributeNameOnAttribute(attributeNode) {
25830
+ function hasDynamicAttributeName(attributeNode) {
25293
25831
  if (!isHTMLAttributeNameNode(attributeNode.name))
25294
25832
  return false;
25295
- return hasDynamicAttributeName(attributeNode.name);
25833
+ return hasDynamicAttributeNameNode(attributeNode.name);
25296
25834
  }
25297
25835
  /**
25298
25836
  * Gets the combined string representation of an attribute name (including ERB syntax).
@@ -25950,7 +26488,7 @@ const DEFAULT_EXTRACT_RUBY_OPTIONS = {
25950
26488
  };
25951
26489
 
25952
26490
  var name = "@herb-tools/core";
25953
- var version = "0.9.0";
26491
+ var version = "0.9.1";
25954
26492
  var packageJSON = {
25955
26493
  name: name,
25956
26494
  version: version};
@@ -26172,7 +26710,7 @@ class HerbBackend {
26172
26710
  }
26173
26711
 
26174
26712
  // NOTE: This file is generated by the templates/template.rb script and should not
26175
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/visitor.ts.erb
26713
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/visitor.ts.erb
26176
26714
  class Visitor {
26177
26715
  visit(node) {
26178
26716
  if (!node)
@@ -26351,6 +26889,15 @@ class Visitor {
26351
26889
  this.visitERBNode(node);
26352
26890
  this.visitChildNodes(node);
26353
26891
  }
26892
+ visitRubyRenderLocalNode(node) {
26893
+ this.visitNode(node);
26894
+ this.visitChildNodes(node);
26895
+ }
26896
+ visitERBRenderNode(node) {
26897
+ this.visitNode(node);
26898
+ this.visitERBNode(node);
26899
+ this.visitChildNodes(node);
26900
+ }
26354
26901
  visitERBYieldNode(node) {
26355
26902
  this.visitNode(node);
26356
26903
  this.visitERBNode(node);
@@ -26386,6 +26933,7 @@ exports.ERBInNode = ERBInNode;
26386
26933
  exports.ERBMultipleBlocksInTagError = ERBMultipleBlocksInTagError;
26387
26934
  exports.ERBNodeClasses = ERBNodeClasses;
26388
26935
  exports.ERBOpenTagNode = ERBOpenTagNode;
26936
+ exports.ERBRenderNode = ERBRenderNode;
26389
26937
  exports.ERBRescueNode = ERBRescueNode;
26390
26938
  exports.ERBUnlessNode = ERBUnlessNode;
26391
26939
  exports.ERBUntilNode = ERBUntilNode;
@@ -26427,10 +26975,18 @@ exports.PrismBasicVisitor = BasicVisitor;
26427
26975
  exports.PrismNodes = nodes;
26428
26976
  exports.PrismVisitor = Visitor$1;
26429
26977
  exports.Range = Range;
26978
+ exports.RenderAmbiguousLocalsError = RenderAmbiguousLocalsError;
26979
+ exports.RenderConflictingPartialError = RenderConflictingPartialError;
26980
+ exports.RenderInvalidAsOptionError = RenderInvalidAsOptionError;
26981
+ exports.RenderLayoutWithoutBlockError = RenderLayoutWithoutBlockError;
26982
+ exports.RenderMissingLocalsError = RenderMissingLocalsError;
26983
+ exports.RenderNoArgumentsError = RenderNoArgumentsError;
26984
+ exports.RenderObjectAndCollectionError = RenderObjectAndCollectionError;
26430
26985
  exports.Result = Result;
26431
26986
  exports.RubyHTMLAttributesSplatNode = RubyHTMLAttributesSplatNode;
26432
26987
  exports.RubyLiteralNode = RubyLiteralNode;
26433
26988
  exports.RubyParseError = RubyParseError;
26989
+ exports.RubyRenderLocalNode = RubyRenderLocalNode;
26434
26990
  exports.StrayERBClosingTagError = StrayERBClosingTagError;
26435
26991
  exports.TOKEN_LIST_ATTRIBUTES = TOKEN_LIST_ATTRIBUTES;
26436
26992
  exports.TagNamesMismatchError = TagNamesMismatchError;
@@ -26472,6 +27028,7 @@ exports.filterERBForNodes = filterERBForNodes;
26472
27028
  exports.filterERBIfNodes = filterERBIfNodes;
26473
27029
  exports.filterERBInNodes = filterERBInNodes;
26474
27030
  exports.filterERBOpenTagNodes = filterERBOpenTagNodes;
27031
+ exports.filterERBRenderNodes = filterERBRenderNodes;
26475
27032
  exports.filterERBRescueNodes = filterERBRescueNodes;
26476
27033
  exports.filterERBUnlessNodes = filterERBUnlessNodes;
26477
27034
  exports.filterERBUntilNodes = filterERBUntilNodes;
@@ -26495,6 +27052,7 @@ exports.filterLiteralNodes = filterLiteralNodes;
26495
27052
  exports.filterNodes = filterNodes;
26496
27053
  exports.filterRubyHTMLAttributesSplatNodes = filterRubyHTMLAttributesSplatNodes;
26497
27054
  exports.filterRubyLiteralNodes = filterRubyLiteralNodes;
27055
+ exports.filterRubyRenderLocalNodes = filterRubyRenderLocalNodes;
26498
27056
  exports.filterWhitespaceNodes = filterWhitespaceNodes;
26499
27057
  exports.filterXMLDeclarationNodes = filterXMLDeclarationNodes;
26500
27058
  exports.findAttributeByName = findAttributeByName;
@@ -26530,7 +27088,7 @@ exports.hasAttribute = hasAttribute;
26530
27088
  exports.hasAttributeValue = hasAttributeValue;
26531
27089
  exports.hasChildren = hasChildren;
26532
27090
  exports.hasDynamicAttributeName = hasDynamicAttributeName;
26533
- exports.hasDynamicAttributeNameOnAttribute = hasDynamicAttributeNameOnAttribute;
27091
+ exports.hasDynamicAttributeNameNode = hasDynamicAttributeNameNode;
26534
27092
  exports.hasDynamicAttributeValue = hasDynamicAttributeValue;
26535
27093
  exports.hasERBContent = hasERBContent;
26536
27094
  exports.hasERBOutput = hasERBOutput;
@@ -26561,6 +27119,7 @@ exports.isERBInNode = isERBInNode;
26561
27119
  exports.isERBNode = isERBNode;
26562
27120
  exports.isERBOpenTagNode = isERBOpenTagNode;
26563
27121
  exports.isERBOutputNode = isERBOutputNode;
27122
+ exports.isERBRenderNode = isERBRenderNode;
26564
27123
  exports.isERBRescueNode = isERBRescueNode;
26565
27124
  exports.isERBUnlessNode = isERBUnlessNode;
26566
27125
  exports.isERBUntilNode = isERBUntilNode;
@@ -26595,6 +27154,7 @@ exports.isPositionEqual = isPositionEqual;
26595
27154
  exports.isPureWhitespaceNode = isPureWhitespaceNode;
26596
27155
  exports.isRubyHTMLAttributesSplatNode = isRubyHTMLAttributesSplatNode;
26597
27156
  exports.isRubyLiteralNode = isRubyLiteralNode;
27157
+ exports.isRubyRenderLocalNode = isRubyRenderLocalNode;
26598
27158
  exports.isToken = isToken;
26599
27159
  exports.isWhitespaceNode = isWhitespaceNode;
26600
27160
  exports.isXMLDeclarationNode = isXMLDeclarationNode;