@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.
@@ -155,7 +155,7 @@ class Token {
155
155
  }
156
156
 
157
157
  // NOTE: This file is generated by the templates/template.rb script and should not
158
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/errors.ts.erb
158
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/errors.ts.erb
159
159
  class HerbError {
160
160
  type;
161
161
  message;
@@ -1156,6 +1156,279 @@ class NestedERBTagError extends HerbError {
1156
1156
  return output;
1157
1157
  }
1158
1158
  }
1159
+ class RenderAmbiguousLocalsError extends HerbError {
1160
+ partial;
1161
+ static from(data) {
1162
+ return new RenderAmbiguousLocalsError({
1163
+ type: data.type,
1164
+ message: data.message,
1165
+ location: Location.from(data.location),
1166
+ partial: data.partial,
1167
+ });
1168
+ }
1169
+ constructor(props) {
1170
+ super(props.type, props.message, props.location);
1171
+ this.partial = props.partial;
1172
+ }
1173
+ toJSON() {
1174
+ return {
1175
+ ...super.toJSON(),
1176
+ type: "RENDER_AMBIGUOUS_LOCALS_ERROR",
1177
+ partial: this.partial,
1178
+ };
1179
+ }
1180
+ toMonacoDiagnostic() {
1181
+ return {
1182
+ line: this.location.start.line,
1183
+ column: this.location.start.column,
1184
+ endLine: this.location.end.line,
1185
+ endColumn: this.location.end.column,
1186
+ message: this.message,
1187
+ severity: 'error'
1188
+ };
1189
+ }
1190
+ treeInspect() {
1191
+ let output = "";
1192
+ output += `@ RenderAmbiguousLocalsError ${this.location.treeInspectWithLabel()}\n`;
1193
+ output += `├── message: "${this.message}"\n`;
1194
+ output += `└── partial: ${JSON.stringify(this.partial)}\n`;
1195
+ return output;
1196
+ }
1197
+ }
1198
+ class RenderMissingLocalsError extends HerbError {
1199
+ partial;
1200
+ keywords;
1201
+ static from(data) {
1202
+ return new RenderMissingLocalsError({
1203
+ type: data.type,
1204
+ message: data.message,
1205
+ location: Location.from(data.location),
1206
+ partial: data.partial,
1207
+ keywords: data.keywords,
1208
+ });
1209
+ }
1210
+ constructor(props) {
1211
+ super(props.type, props.message, props.location);
1212
+ this.partial = props.partial;
1213
+ this.keywords = props.keywords;
1214
+ }
1215
+ toJSON() {
1216
+ return {
1217
+ ...super.toJSON(),
1218
+ type: "RENDER_MISSING_LOCALS_ERROR",
1219
+ partial: this.partial,
1220
+ keywords: this.keywords,
1221
+ };
1222
+ }
1223
+ toMonacoDiagnostic() {
1224
+ return {
1225
+ line: this.location.start.line,
1226
+ column: this.location.start.column,
1227
+ endLine: this.location.end.line,
1228
+ endColumn: this.location.end.column,
1229
+ message: this.message,
1230
+ severity: 'error'
1231
+ };
1232
+ }
1233
+ treeInspect() {
1234
+ let output = "";
1235
+ output += `@ RenderMissingLocalsError ${this.location.treeInspectWithLabel()}\n`;
1236
+ output += `├── message: "${this.message}"\n`;
1237
+ output += `├── partial: ${JSON.stringify(this.partial)}\n`;
1238
+ output += `└── keywords: ${JSON.stringify(this.keywords)}\n`;
1239
+ return output;
1240
+ }
1241
+ }
1242
+ class RenderNoArgumentsError extends HerbError {
1243
+ static from(data) {
1244
+ return new RenderNoArgumentsError({
1245
+ type: data.type,
1246
+ message: data.message,
1247
+ location: Location.from(data.location),
1248
+ });
1249
+ }
1250
+ constructor(props) {
1251
+ super(props.type, props.message, props.location);
1252
+ }
1253
+ toJSON() {
1254
+ return {
1255
+ ...super.toJSON(),
1256
+ type: "RENDER_NO_ARGUMENTS_ERROR",
1257
+ };
1258
+ }
1259
+ toMonacoDiagnostic() {
1260
+ return {
1261
+ line: this.location.start.line,
1262
+ column: this.location.start.column,
1263
+ endLine: this.location.end.line,
1264
+ endColumn: this.location.end.column,
1265
+ message: this.message,
1266
+ severity: 'error'
1267
+ };
1268
+ }
1269
+ treeInspect() {
1270
+ let output = "";
1271
+ output += `@ RenderNoArgumentsError ${this.location.treeInspectWithLabel()}\n`;
1272
+ output += `└── message: "${this.message}"\n`;
1273
+ return output;
1274
+ }
1275
+ }
1276
+ class RenderConflictingPartialError extends HerbError {
1277
+ positional_partial;
1278
+ keyword_partial;
1279
+ static from(data) {
1280
+ return new RenderConflictingPartialError({
1281
+ type: data.type,
1282
+ message: data.message,
1283
+ location: Location.from(data.location),
1284
+ positional_partial: data.positional_partial,
1285
+ keyword_partial: data.keyword_partial,
1286
+ });
1287
+ }
1288
+ constructor(props) {
1289
+ super(props.type, props.message, props.location);
1290
+ this.positional_partial = props.positional_partial;
1291
+ this.keyword_partial = props.keyword_partial;
1292
+ }
1293
+ toJSON() {
1294
+ return {
1295
+ ...super.toJSON(),
1296
+ type: "RENDER_CONFLICTING_PARTIAL_ERROR",
1297
+ positional_partial: this.positional_partial,
1298
+ keyword_partial: this.keyword_partial,
1299
+ };
1300
+ }
1301
+ toMonacoDiagnostic() {
1302
+ return {
1303
+ line: this.location.start.line,
1304
+ column: this.location.start.column,
1305
+ endLine: this.location.end.line,
1306
+ endColumn: this.location.end.column,
1307
+ message: this.message,
1308
+ severity: 'error'
1309
+ };
1310
+ }
1311
+ treeInspect() {
1312
+ let output = "";
1313
+ output += `@ RenderConflictingPartialError ${this.location.treeInspectWithLabel()}\n`;
1314
+ output += `├── message: "${this.message}"\n`;
1315
+ output += `├── positional_partial: ${JSON.stringify(this.positional_partial)}\n`;
1316
+ output += `└── keyword_partial: ${JSON.stringify(this.keyword_partial)}\n`;
1317
+ return output;
1318
+ }
1319
+ }
1320
+ class RenderInvalidAsOptionError extends HerbError {
1321
+ as_value;
1322
+ static from(data) {
1323
+ return new RenderInvalidAsOptionError({
1324
+ type: data.type,
1325
+ message: data.message,
1326
+ location: Location.from(data.location),
1327
+ as_value: data.as_value,
1328
+ });
1329
+ }
1330
+ constructor(props) {
1331
+ super(props.type, props.message, props.location);
1332
+ this.as_value = props.as_value;
1333
+ }
1334
+ toJSON() {
1335
+ return {
1336
+ ...super.toJSON(),
1337
+ type: "RENDER_INVALID_AS_OPTION_ERROR",
1338
+ as_value: this.as_value,
1339
+ };
1340
+ }
1341
+ toMonacoDiagnostic() {
1342
+ return {
1343
+ line: this.location.start.line,
1344
+ column: this.location.start.column,
1345
+ endLine: this.location.end.line,
1346
+ endColumn: this.location.end.column,
1347
+ message: this.message,
1348
+ severity: 'error'
1349
+ };
1350
+ }
1351
+ treeInspect() {
1352
+ let output = "";
1353
+ output += `@ RenderInvalidAsOptionError ${this.location.treeInspectWithLabel()}\n`;
1354
+ output += `├── message: "${this.message}"\n`;
1355
+ output += `└── as_value: ${JSON.stringify(this.as_value)}\n`;
1356
+ return output;
1357
+ }
1358
+ }
1359
+ class RenderObjectAndCollectionError extends HerbError {
1360
+ static from(data) {
1361
+ return new RenderObjectAndCollectionError({
1362
+ type: data.type,
1363
+ message: data.message,
1364
+ location: Location.from(data.location),
1365
+ });
1366
+ }
1367
+ constructor(props) {
1368
+ super(props.type, props.message, props.location);
1369
+ }
1370
+ toJSON() {
1371
+ return {
1372
+ ...super.toJSON(),
1373
+ type: "RENDER_OBJECT_AND_COLLECTION_ERROR",
1374
+ };
1375
+ }
1376
+ toMonacoDiagnostic() {
1377
+ return {
1378
+ line: this.location.start.line,
1379
+ column: this.location.start.column,
1380
+ endLine: this.location.end.line,
1381
+ endColumn: this.location.end.column,
1382
+ message: this.message,
1383
+ severity: 'error'
1384
+ };
1385
+ }
1386
+ treeInspect() {
1387
+ let output = "";
1388
+ output += `@ RenderObjectAndCollectionError ${this.location.treeInspectWithLabel()}\n`;
1389
+ output += `└── message: "${this.message}"\n`;
1390
+ return output;
1391
+ }
1392
+ }
1393
+ class RenderLayoutWithoutBlockError extends HerbError {
1394
+ layout;
1395
+ static from(data) {
1396
+ return new RenderLayoutWithoutBlockError({
1397
+ type: data.type,
1398
+ message: data.message,
1399
+ location: Location.from(data.location),
1400
+ layout: data.layout,
1401
+ });
1402
+ }
1403
+ constructor(props) {
1404
+ super(props.type, props.message, props.location);
1405
+ this.layout = props.layout;
1406
+ }
1407
+ toJSON() {
1408
+ return {
1409
+ ...super.toJSON(),
1410
+ type: "RENDER_LAYOUT_WITHOUT_BLOCK_ERROR",
1411
+ layout: this.layout,
1412
+ };
1413
+ }
1414
+ toMonacoDiagnostic() {
1415
+ return {
1416
+ line: this.location.start.line,
1417
+ column: this.location.start.column,
1418
+ endLine: this.location.end.line,
1419
+ endColumn: this.location.end.column,
1420
+ message: this.message,
1421
+ severity: 'error'
1422
+ };
1423
+ }
1424
+ treeInspect() {
1425
+ let output = "";
1426
+ output += `@ RenderLayoutWithoutBlockError ${this.location.treeInspectWithLabel()}\n`;
1427
+ output += `├── message: "${this.message}"\n`;
1428
+ output += `└── layout: ${JSON.stringify(this.layout)}\n`;
1429
+ return output;
1430
+ }
1431
+ }
1159
1432
  function fromSerializedError(error) {
1160
1433
  switch (error.type) {
1161
1434
  case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
@@ -1181,6 +1454,13 @@ function fromSerializedError(error) {
1181
1454
  case "UNCLOSED_ERB_TAG_ERROR": return UnclosedERBTagError.from(error);
1182
1455
  case "STRAY_ERB_CLOSING_TAG_ERROR": return StrayERBClosingTagError.from(error);
1183
1456
  case "NESTED_ERB_TAG_ERROR": return NestedERBTagError.from(error);
1457
+ case "RENDER_AMBIGUOUS_LOCALS_ERROR": return RenderAmbiguousLocalsError.from(error);
1458
+ case "RENDER_MISSING_LOCALS_ERROR": return RenderMissingLocalsError.from(error);
1459
+ case "RENDER_NO_ARGUMENTS_ERROR": return RenderNoArgumentsError.from(error);
1460
+ case "RENDER_CONFLICTING_PARTIAL_ERROR": return RenderConflictingPartialError.from(error);
1461
+ case "RENDER_INVALID_AS_OPTION_ERROR": return RenderInvalidAsOptionError.from(error);
1462
+ case "RENDER_OBJECT_AND_COLLECTION_ERROR": return RenderObjectAndCollectionError.from(error);
1463
+ case "RENDER_LAYOUT_WITHOUT_BLOCK_ERROR": return RenderLayoutWithoutBlockError.from(error);
1184
1464
  default:
1185
1465
  throw new Error(`Unknown node type: ${error.type}`);
1186
1466
  }
@@ -21351,7 +21631,7 @@ function deserializePrismNode(bytes, source) {
21351
21631
  }
21352
21632
 
21353
21633
  // NOTE: This file is generated by the templates/template.rb script and should not
21354
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/nodes.ts.erb
21634
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/nodes.ts.erb
21355
21635
  class Node {
21356
21636
  type;
21357
21637
  location;
@@ -23895,6 +24175,225 @@ class ERBUnlessNode extends Node {
23895
24175
  return output;
23896
24176
  }
23897
24177
  }
24178
+ class RubyRenderLocalNode extends Node {
24179
+ name;
24180
+ value;
24181
+ static get type() {
24182
+ return "AST_RUBY_RENDER_LOCAL_NODE";
24183
+ }
24184
+ static from(data) {
24185
+ return new RubyRenderLocalNode({
24186
+ type: data.type,
24187
+ location: Location.from(data.location),
24188
+ errors: (data.errors || []).map(error => HerbError.from(error)),
24189
+ name: data.name ? Token.from(data.name) : null,
24190
+ value: data.value ? fromSerializedNode((data.value)) : null,
24191
+ });
24192
+ }
24193
+ constructor(props) {
24194
+ super(props.type, props.location, props.errors);
24195
+ this.name = props.name;
24196
+ this.value = props.value;
24197
+ }
24198
+ accept(visitor) {
24199
+ visitor.visitRubyRenderLocalNode(this);
24200
+ }
24201
+ childNodes() {
24202
+ return [
24203
+ this.value,
24204
+ ];
24205
+ }
24206
+ compactChildNodes() {
24207
+ return this.childNodes().filter(node => node !== null && node !== undefined);
24208
+ }
24209
+ recursiveErrors() {
24210
+ return [
24211
+ ...this.errors,
24212
+ this.value ? this.value.recursiveErrors() : [],
24213
+ ].flat();
24214
+ }
24215
+ toJSON() {
24216
+ return {
24217
+ ...super.toJSON(),
24218
+ type: "AST_RUBY_RENDER_LOCAL_NODE",
24219
+ name: this.name ? this.name.toJSON() : null,
24220
+ value: this.value ? this.value.toJSON() : null,
24221
+ };
24222
+ }
24223
+ treeInspect() {
24224
+ let output = "";
24225
+ output += `@ RubyRenderLocalNode ${this.location.treeInspectWithLabel()}\n`;
24226
+ output += `├── errors: ${this.inspectArray(this.errors, "│ ")}`;
24227
+ output += `├── name: ${this.name ? this.name.treeInspect() : "∅"}\n`;
24228
+ output += `└── value: ${this.inspectNode(this.value, " ")}`;
24229
+ return output;
24230
+ }
24231
+ }
24232
+ class ERBRenderNode extends Node {
24233
+ tag_opening;
24234
+ content;
24235
+ tag_closing;
24236
+ // no-op for analyzed_ruby
24237
+ prism_node;
24238
+ partial;
24239
+ template_path;
24240
+ layout;
24241
+ file;
24242
+ inline_template;
24243
+ body;
24244
+ plain;
24245
+ html;
24246
+ renderable;
24247
+ collection;
24248
+ object;
24249
+ as_name;
24250
+ spacer_template;
24251
+ formats;
24252
+ variants;
24253
+ handlers;
24254
+ content_type;
24255
+ locals;
24256
+ static get type() {
24257
+ return "AST_ERB_RENDER_NODE";
24258
+ }
24259
+ static from(data) {
24260
+ return new ERBRenderNode({
24261
+ type: data.type,
24262
+ location: Location.from(data.location),
24263
+ errors: (data.errors || []).map(error => HerbError.from(error)),
24264
+ tag_opening: data.tag_opening ? Token.from(data.tag_opening) : null,
24265
+ content: data.content ? Token.from(data.content) : null,
24266
+ tag_closing: data.tag_closing ? Token.from(data.tag_closing) : null,
24267
+ // no-op for analyzed_ruby
24268
+ prism_node: data.prism_node ? new Uint8Array(data.prism_node) : null,
24269
+ partial: data.partial ? Token.from(data.partial) : null,
24270
+ template_path: data.template_path ? Token.from(data.template_path) : null,
24271
+ layout: data.layout ? Token.from(data.layout) : null,
24272
+ file: data.file ? Token.from(data.file) : null,
24273
+ inline_template: data.inline_template ? Token.from(data.inline_template) : null,
24274
+ body: data.body ? Token.from(data.body) : null,
24275
+ plain: data.plain ? Token.from(data.plain) : null,
24276
+ html: data.html ? Token.from(data.html) : null,
24277
+ renderable: data.renderable ? Token.from(data.renderable) : null,
24278
+ collection: data.collection ? Token.from(data.collection) : null,
24279
+ object: data.object ? Token.from(data.object) : null,
24280
+ as_name: data.as_name ? Token.from(data.as_name) : null,
24281
+ spacer_template: data.spacer_template ? Token.from(data.spacer_template) : null,
24282
+ formats: data.formats ? Token.from(data.formats) : null,
24283
+ variants: data.variants ? Token.from(data.variants) : null,
24284
+ handlers: data.handlers ? Token.from(data.handlers) : null,
24285
+ content_type: data.content_type ? Token.from(data.content_type) : null,
24286
+ locals: (data.locals || []).map(node => fromSerializedNode(node)),
24287
+ });
24288
+ }
24289
+ constructor(props) {
24290
+ super(props.type, props.location, props.errors);
24291
+ this.tag_opening = props.tag_opening;
24292
+ this.content = props.content;
24293
+ this.tag_closing = props.tag_closing;
24294
+ // no-op for analyzed_ruby
24295
+ this.prism_node = props.prism_node;
24296
+ this.partial = props.partial;
24297
+ this.template_path = props.template_path;
24298
+ this.layout = props.layout;
24299
+ this.file = props.file;
24300
+ this.inline_template = props.inline_template;
24301
+ this.body = props.body;
24302
+ this.plain = props.plain;
24303
+ this.html = props.html;
24304
+ this.renderable = props.renderable;
24305
+ this.collection = props.collection;
24306
+ this.object = props.object;
24307
+ this.as_name = props.as_name;
24308
+ this.spacer_template = props.spacer_template;
24309
+ this.formats = props.formats;
24310
+ this.variants = props.variants;
24311
+ this.handlers = props.handlers;
24312
+ this.content_type = props.content_type;
24313
+ this.locals = props.locals;
24314
+ }
24315
+ accept(visitor) {
24316
+ visitor.visitERBRenderNode(this);
24317
+ }
24318
+ childNodes() {
24319
+ return [
24320
+ ...this.locals,
24321
+ ];
24322
+ }
24323
+ compactChildNodes() {
24324
+ return this.childNodes().filter(node => node !== null && node !== undefined);
24325
+ }
24326
+ get prismNode() {
24327
+ if (!this.prism_node || !this.source)
24328
+ return null;
24329
+ return deserializePrismNode(this.prism_node, this.source);
24330
+ }
24331
+ recursiveErrors() {
24332
+ return [
24333
+ ...this.errors,
24334
+ ...this.locals.map(node => node.recursiveErrors()),
24335
+ ].flat();
24336
+ }
24337
+ toJSON() {
24338
+ return {
24339
+ ...super.toJSON(),
24340
+ type: "AST_ERB_RENDER_NODE",
24341
+ tag_opening: this.tag_opening ? this.tag_opening.toJSON() : null,
24342
+ content: this.content ? this.content.toJSON() : null,
24343
+ tag_closing: this.tag_closing ? this.tag_closing.toJSON() : null,
24344
+ // no-op for analyzed_ruby
24345
+ prism_node: this.prism_node ? Array.from(this.prism_node) : null,
24346
+ partial: this.partial ? this.partial.toJSON() : null,
24347
+ template_path: this.template_path ? this.template_path.toJSON() : null,
24348
+ layout: this.layout ? this.layout.toJSON() : null,
24349
+ file: this.file ? this.file.toJSON() : null,
24350
+ inline_template: this.inline_template ? this.inline_template.toJSON() : null,
24351
+ body: this.body ? this.body.toJSON() : null,
24352
+ plain: this.plain ? this.plain.toJSON() : null,
24353
+ html: this.html ? this.html.toJSON() : null,
24354
+ renderable: this.renderable ? this.renderable.toJSON() : null,
24355
+ collection: this.collection ? this.collection.toJSON() : null,
24356
+ object: this.object ? this.object.toJSON() : null,
24357
+ as_name: this.as_name ? this.as_name.toJSON() : null,
24358
+ spacer_template: this.spacer_template ? this.spacer_template.toJSON() : null,
24359
+ formats: this.formats ? this.formats.toJSON() : null,
24360
+ variants: this.variants ? this.variants.toJSON() : null,
24361
+ handlers: this.handlers ? this.handlers.toJSON() : null,
24362
+ content_type: this.content_type ? this.content_type.toJSON() : null,
24363
+ locals: this.locals.map(node => node.toJSON()),
24364
+ };
24365
+ }
24366
+ treeInspect() {
24367
+ let output = "";
24368
+ output += `@ ERBRenderNode ${this.location.treeInspectWithLabel()}\n`;
24369
+ output += `├── errors: ${this.inspectArray(this.errors, "│ ")}`;
24370
+ output += `├── tag_opening: ${this.tag_opening ? this.tag_opening.treeInspect() : "∅"}\n`;
24371
+ output += `├── content: ${this.content ? this.content.treeInspect() : "∅"}\n`;
24372
+ output += `├── tag_closing: ${this.tag_closing ? this.tag_closing.treeInspect() : "∅"}\n`;
24373
+ if (this.prism_node) {
24374
+ output += `├── prism_node: ${this.source ? inspectPrismSerialized(this.prism_node, this.source, "│ ") : `(${this.prism_node.length} bytes)`}\n`;
24375
+ }
24376
+ output += `├── partial: ${this.partial ? this.partial.treeInspect() : "∅"}\n`;
24377
+ output += `├── template_path: ${this.template_path ? this.template_path.treeInspect() : "∅"}\n`;
24378
+ output += `├── layout: ${this.layout ? this.layout.treeInspect() : "∅"}\n`;
24379
+ output += `├── file: ${this.file ? this.file.treeInspect() : "∅"}\n`;
24380
+ output += `├── inline_template: ${this.inline_template ? this.inline_template.treeInspect() : "∅"}\n`;
24381
+ output += `├── body: ${this.body ? this.body.treeInspect() : "∅"}\n`;
24382
+ output += `├── plain: ${this.plain ? this.plain.treeInspect() : "∅"}\n`;
24383
+ output += `├── html: ${this.html ? this.html.treeInspect() : "∅"}\n`;
24384
+ output += `├── renderable: ${this.renderable ? this.renderable.treeInspect() : "∅"}\n`;
24385
+ output += `├── collection: ${this.collection ? this.collection.treeInspect() : "∅"}\n`;
24386
+ output += `├── object: ${this.object ? this.object.treeInspect() : "∅"}\n`;
24387
+ output += `├── as_name: ${this.as_name ? this.as_name.treeInspect() : "∅"}\n`;
24388
+ output += `├── spacer_template: ${this.spacer_template ? this.spacer_template.treeInspect() : "∅"}\n`;
24389
+ output += `├── formats: ${this.formats ? this.formats.treeInspect() : "∅"}\n`;
24390
+ output += `├── variants: ${this.variants ? this.variants.treeInspect() : "∅"}\n`;
24391
+ output += `├── handlers: ${this.handlers ? this.handlers.treeInspect() : "∅"}\n`;
24392
+ output += `├── content_type: ${this.content_type ? this.content_type.treeInspect() : "∅"}\n`;
24393
+ output += `└── locals: ${this.inspectArray(this.locals, " ")}`;
24394
+ return output;
24395
+ }
24396
+ }
23898
24397
  class ERBYieldNode extends Node {
23899
24398
  tag_opening;
23900
24399
  content;
@@ -24058,6 +24557,8 @@ function fromSerializedNode(node) {
24058
24557
  case "AST_ERB_ENSURE_NODE": return ERBEnsureNode.from(node);
24059
24558
  case "AST_ERB_BEGIN_NODE": return ERBBeginNode.from(node);
24060
24559
  case "AST_ERB_UNLESS_NODE": return ERBUnlessNode.from(node);
24560
+ case "AST_RUBY_RENDER_LOCAL_NODE": return RubyRenderLocalNode.from(node);
24561
+ case "AST_ERB_RENDER_NODE": return ERBRenderNode.from(node);
24061
24562
  case "AST_ERB_YIELD_NODE": return ERBYieldNode.from(node);
24062
24563
  case "AST_ERB_IN_NODE": return ERBInNode.from(node);
24063
24564
  default:
@@ -24081,6 +24582,7 @@ const ERBNodeClasses = [
24081
24582
  ERBEnsureNode,
24082
24583
  ERBBeginNode,
24083
24584
  ERBUnlessNode,
24585
+ ERBRenderNode,
24084
24586
  ERBYieldNode,
24085
24587
  ERBInNode,
24086
24588
  ];
@@ -24127,6 +24629,7 @@ const DEFAULT_PARSER_OPTIONS = {
24127
24629
  analyze: true,
24128
24630
  strict: true,
24129
24631
  action_view_helpers: false,
24632
+ render_nodes: false,
24130
24633
  prism_nodes: false,
24131
24634
  prism_nodes_deep: false,
24132
24635
  prism_program: false,
@@ -24143,6 +24646,8 @@ class ParserOptions {
24143
24646
  analyze;
24144
24647
  /** Whether ActionView tag helper transformation was enabled during parsing. */
24145
24648
  action_view_helpers;
24649
+ /** Whether ActionView render call detection was enabled during parsing. */
24650
+ render_nodes;
24146
24651
  /** Whether Prism node serialization was enabled during parsing. */
24147
24652
  prism_nodes;
24148
24653
  /** Whether deep Prism node serialization was enabled during parsing. */
@@ -24157,6 +24662,7 @@ class ParserOptions {
24157
24662
  this.track_whitespace = options.track_whitespace ?? DEFAULT_PARSER_OPTIONS.track_whitespace;
24158
24663
  this.analyze = options.analyze ?? DEFAULT_PARSER_OPTIONS.analyze;
24159
24664
  this.action_view_helpers = options.action_view_helpers ?? DEFAULT_PARSER_OPTIONS.action_view_helpers;
24665
+ this.render_nodes = options.render_nodes ?? DEFAULT_PARSER_OPTIONS.render_nodes;
24160
24666
  this.prism_nodes = options.prism_nodes ?? DEFAULT_PARSER_OPTIONS.prism_nodes;
24161
24667
  this.prism_nodes_deep = options.prism_nodes_deep ?? DEFAULT_PARSER_OPTIONS.prism_nodes_deep;
24162
24668
  this.prism_program = options.prism_program ?? DEFAULT_PARSER_OPTIONS.prism_program;
@@ -24236,7 +24742,7 @@ class ParseResult extends Result {
24236
24742
  }
24237
24743
 
24238
24744
  // NOTE: This file is generated by the templates/template.rb script and should not
24239
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/node-type-guards.ts.erb
24745
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/node-type-guards.ts.erb
24240
24746
  /**
24241
24747
  * Type guard functions for AST nodes.
24242
24748
  * These functions provide type checking by combining both instanceof
@@ -24531,6 +25037,22 @@ function isERBUnlessNode(node) {
24531
25037
  return false;
24532
25038
  return node instanceof ERBUnlessNode || node.type === "AST_ERB_UNLESS_NODE" || node.constructor.type === "AST_ERB_UNLESS_NODE";
24533
25039
  }
25040
+ /**
25041
+ * Checks if a node is a RubyRenderLocalNode
25042
+ */
25043
+ function isRubyRenderLocalNode(node) {
25044
+ if (!node)
25045
+ return false;
25046
+ return node instanceof RubyRenderLocalNode || node.type === "AST_RUBY_RENDER_LOCAL_NODE" || node.constructor.type === "AST_RUBY_RENDER_LOCAL_NODE";
25047
+ }
25048
+ /**
25049
+ * Checks if a node is a ERBRenderNode
25050
+ */
25051
+ function isERBRenderNode(node) {
25052
+ if (!node)
25053
+ return false;
25054
+ return node instanceof ERBRenderNode || node.type === "AST_ERB_RENDER_NODE" || node.constructor.type === "AST_ERB_RENDER_NODE";
25055
+ }
24534
25056
  /**
24535
25057
  * Checks if a node is a ERBYieldNode
24536
25058
  */
@@ -24588,6 +25110,7 @@ function isERBNode(node) {
24588
25110
  isERBEnsureNode(node) ||
24589
25111
  isERBBeginNode(node) ||
24590
25112
  isERBUnlessNode(node) ||
25113
+ isERBRenderNode(node) ||
24591
25114
  isERBYieldNode(node) ||
24592
25115
  isERBInNode(node);
24593
25116
  }
@@ -24638,6 +25161,8 @@ const NODE_TYPE_GUARDS = new Map([
24638
25161
  [ERBEnsureNode, isERBEnsureNode],
24639
25162
  [ERBBeginNode, isERBBeginNode],
24640
25163
  [ERBUnlessNode, isERBUnlessNode],
25164
+ [RubyRenderLocalNode, isRubyRenderLocalNode],
25165
+ [ERBRenderNode, isERBRenderNode],
24641
25166
  [ERBYieldNode, isERBYieldNode],
24642
25167
  [ERBInNode, isERBInNode],
24643
25168
  ]);
@@ -24688,6 +25213,8 @@ const AST_TYPE_GUARDS = new Map([
24688
25213
  ["AST_ERB_ENSURE_NODE", isERBEnsureNode],
24689
25214
  ["AST_ERB_BEGIN_NODE", isERBBeginNode],
24690
25215
  ["AST_ERB_UNLESS_NODE", isERBUnlessNode],
25216
+ ["AST_RUBY_RENDER_LOCAL_NODE", isRubyRenderLocalNode],
25217
+ ["AST_ERB_RENDER_NODE", isERBRenderNode],
24691
25218
  ["AST_ERB_YIELD_NODE", isERBYieldNode],
24692
25219
  ["AST_ERB_IN_NODE", isERBInNode],
24693
25220
  ]);
@@ -25019,6 +25546,18 @@ function filterERBBeginNodes(nodes) {
25019
25546
  function filterERBUnlessNodes(nodes) {
25020
25547
  return nodes.filter(isERBUnlessNode);
25021
25548
  }
25549
+ /**
25550
+ * Filters an array of nodes to only include RubyRenderLocalNode nodes
25551
+ */
25552
+ function filterRubyRenderLocalNodes(nodes) {
25553
+ return nodes.filter(isRubyRenderLocalNode);
25554
+ }
25555
+ /**
25556
+ * Filters an array of nodes to only include ERBRenderNode nodes
25557
+ */
25558
+ function filterERBRenderNodes(nodes) {
25559
+ return nodes.filter(isERBRenderNode);
25560
+ }
25022
25561
  /**
25023
25562
  * Filters an array of nodes to only include ERBYieldNode nodes
25024
25563
  */
@@ -25148,7 +25687,7 @@ function hasStaticAttributeName(attributeNameNode) {
25148
25687
  /**
25149
25688
  * Checks if an HTML attribute name node has dynamic content (contains ERB)
25150
25689
  */
25151
- function hasDynamicAttributeName(attributeNameNode) {
25690
+ function hasDynamicAttributeNameNode(attributeNameNode) {
25152
25691
  if (!attributeNameNode.children) {
25153
25692
  return false;
25154
25693
  }
@@ -25285,12 +25824,11 @@ function hasAttribute(node, attributeName) {
25285
25824
  }
25286
25825
  /**
25287
25826
  * Checks if an attribute has a dynamic (ERB-containing) name.
25288
- * Accepts an HTMLAttributeNode (wraps the core HTMLAttributeNameNode-level check).
25289
25827
  */
25290
- function hasDynamicAttributeNameOnAttribute(attributeNode) {
25828
+ function hasDynamicAttributeName(attributeNode) {
25291
25829
  if (!isHTMLAttributeNameNode(attributeNode.name))
25292
25830
  return false;
25293
- return hasDynamicAttributeName(attributeNode.name);
25831
+ return hasDynamicAttributeNameNode(attributeNode.name);
25294
25832
  }
25295
25833
  /**
25296
25834
  * Gets the combined string representation of an attribute name (including ERB syntax).
@@ -25948,7 +26486,7 @@ const DEFAULT_EXTRACT_RUBY_OPTIONS = {
25948
26486
  };
25949
26487
 
25950
26488
  var name = "@herb-tools/core";
25951
- var version = "0.9.0";
26489
+ var version = "0.9.1";
25952
26490
  var packageJSON = {
25953
26491
  name: name,
25954
26492
  version: version};
@@ -26170,7 +26708,7 @@ class HerbBackend {
26170
26708
  }
26171
26709
 
26172
26710
  // NOTE: This file is generated by the templates/template.rb script and should not
26173
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.0/templates/javascript/packages/core/src/visitor.ts.erb
26711
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.9.1/templates/javascript/packages/core/src/visitor.ts.erb
26174
26712
  class Visitor {
26175
26713
  visit(node) {
26176
26714
  if (!node)
@@ -26349,6 +26887,15 @@ class Visitor {
26349
26887
  this.visitERBNode(node);
26350
26888
  this.visitChildNodes(node);
26351
26889
  }
26890
+ visitRubyRenderLocalNode(node) {
26891
+ this.visitNode(node);
26892
+ this.visitChildNodes(node);
26893
+ }
26894
+ visitERBRenderNode(node) {
26895
+ this.visitNode(node);
26896
+ this.visitERBNode(node);
26897
+ this.visitChildNodes(node);
26898
+ }
26352
26899
  visitERBYieldNode(node) {
26353
26900
  this.visitNode(node);
26354
26901
  this.visitERBNode(node);
@@ -26361,5 +26908,5 @@ class Visitor {
26361
26908
  }
26362
26909
  }
26363
26910
 
26364
- export { AST_TYPE_GUARDS, CDATANode, ConditionalElementConditionMismatchError, ConditionalElementMultipleTagsError, DEFAULT_EXTRACT_RUBY_OPTIONS, DEFAULT_PARSER_OPTIONS, DocumentNode, ERBBeginNode, ERBBlockNode, ERBCaseMatchNode, ERBCaseNode, ERBCaseWithConditionsError, ERBContentNode, ERBControlFlowScopeError, ERBElseNode, ERBEndNode, ERBEnsureNode, ERBForNode, ERBIfNode, ERBInNode, ERBMultipleBlocksInTagError, ERBNodeClasses, ERBOpenTagNode, ERBRescueNode, ERBUnlessNode, ERBUntilNode, ERBWhenNode, ERBWhileNode, ERBYieldNode, HTMLAttributeNameNode, HTMLAttributeNode, HTMLAttributeValueNode, HTMLCloseTagNode, HTMLCommentNode, HTMLConditionalElementNode, HTMLConditionalOpenTagNode, HTMLDoctypeNode, HTMLElementNode, HTMLOmittedCloseTagNode, HTMLOpenTagNode, HTMLTextNode, HTMLVirtualCloseTagNode, HerbBackend, HerbError, HerbWarning, InvalidCommentClosingTagError, LexResult, LiteralNode, Location, MissingAttributeValueError, MissingClosingTagError, MissingERBEndTagError, MissingOpeningTagError, NODE_TYPE_GUARDS, NestedERBTagError, Node, OmittedClosingTagError, ParseResult, ParserOptions, Position, BasicVisitor as PrismBasicVisitor, nodes as PrismNodes, Visitor$1 as PrismVisitor, Range, Result, RubyHTMLAttributesSplatNode, RubyLiteralNode, RubyParseError, StrayERBClosingTagError, TOKEN_LIST_ATTRIBUTES, TagNamesMismatchError, Token, TokenList, UnclosedCloseTagError, UnclosedERBTagError, UnclosedElementError, UnclosedOpenTagError, UnclosedQuoteError, UnexpectedError, UnexpectedTokenError, Visitor, VoidElementClosingTagError, WhitespaceNode, XMLDeclarationNode, _TYPECHECK, areAllOfType, createLiteral, createSyntheticToken, createWhitespaceNode, deserializePrismNode, deserializePrismParseResult, didyoumean, didyoumeanRanked, ensureLibHerbBackend, ensureString, filterCDATANodes, filterDocumentNodes, filterERBBeginNodes, filterERBBlockNodes, filterERBCaseMatchNodes, filterERBCaseNodes, filterERBContentNodes, filterERBElseNodes, filterERBEndNodes, filterERBEnsureNodes, filterERBForNodes, filterERBIfNodes, filterERBInNodes, filterERBOpenTagNodes, filterERBRescueNodes, filterERBUnlessNodes, filterERBUntilNodes, filterERBWhenNodes, filterERBWhileNodes, filterERBYieldNodes, filterHTMLAttributeNameNodes, filterHTMLAttributeNodes, filterHTMLAttributeValueNodes, filterHTMLCloseTagNodes, filterHTMLCommentNodes, filterHTMLConditionalElementNodes, filterHTMLConditionalOpenTagNodes, filterHTMLDoctypeNodes, filterHTMLElementNodes, filterHTMLOmittedCloseTagNodes, filterHTMLOpenTagNodes, filterHTMLTextNodes, filterHTMLVirtualCloseTagNodes, filterLiteralNodes, filterNodes, filterRubyHTMLAttributesSplatNodes, filterRubyLiteralNodes, filterWhitespaceNodes, filterXMLDeclarationNodes, findAttributeByName, findParentArray, forEachAttribute, fromSerializedError, fromSerializedNode, getAttribute, getAttributeName, getAttributeValue, getAttributeValueNodes, getAttributeValueQuoteType, getAttributes, getCombinedAttributeName, getCombinedAttributeNameString, getCombinedStringFromNodes, getNodesAfterLocation, getNodesAfterPosition, getNodesBeforeLocation, getNodesBeforePosition, getOpenTag, getStaticAttributeName, getStaticAttributeValue, getStaticAttributeValueContent, getStaticContentFromNodes, getStaticStringFromNodes, getTagLocalName, getTagName, getTokenList, getValidatableStaticContent, groupNodesByClass, hasAttribute, hasAttributeValue, hasChildren, hasDynamicAttributeName, hasDynamicAttributeNameOnAttribute, hasDynamicAttributeValue, hasERBContent, hasERBOutput, hasStaticAttributeName, hasStaticAttributeValue, hasStaticAttributeValueContent, hasStaticContent, inspectPrismNode, inspectPrismSerialized, isAnyOf, isAttributeValueQuoted, isCDATANode, isCommentNode, isDocumentNode, isERBBeginNode, isERBBlockNode, isERBCaseMatchNode, isERBCaseNode, isERBCommentNode, isERBContentNode, isERBControlFlowNode, isERBElseNode, isERBEndNode, isERBEnsureNode, isERBForNode, isERBIfNode, isERBInNode, isERBNode, isERBOpenTagNode, isERBOutputNode, isERBRescueNode, isERBUnlessNode, isERBUntilNode, isERBWhenNode, isERBWhileNode, isERBYieldNode, isEffectivelyStatic, isEquivalentAttribute, isEquivalentElement, isEquivalentOpenTag, isHTMLAttributeNameNode, isHTMLAttributeNode, isHTMLAttributeValueNode, isHTMLCloseTagNode, isHTMLCommentNode, isHTMLConditionalElementNode, isHTMLConditionalOpenTagNode, isHTMLDoctypeNode, isHTMLElementNode, isHTMLNode, isHTMLOmittedCloseTagNode, isHTMLOpenTagNode, isHTMLTextNode, isHTMLVirtualCloseTagNode, isLibHerbBackend, isLiteralNode, isNode, isNoneOf, isParseResult, isPositionAfter, isPositionEqual, isPureWhitespaceNode, isRubyHTMLAttributesSplatNode, isRubyLiteralNode, isToken, isWhitespaceNode, isXMLDeclarationNode, levenshtein, removeNodeFromArray, replaceNodeWithBody, splitLiteralsAtWhitespace, splitNodesAroundLocation, splitNodesAroundPosition, toMonacoDiagnostic };
26911
+ export { AST_TYPE_GUARDS, CDATANode, ConditionalElementConditionMismatchError, ConditionalElementMultipleTagsError, DEFAULT_EXTRACT_RUBY_OPTIONS, DEFAULT_PARSER_OPTIONS, DocumentNode, ERBBeginNode, ERBBlockNode, ERBCaseMatchNode, ERBCaseNode, ERBCaseWithConditionsError, ERBContentNode, ERBControlFlowScopeError, ERBElseNode, ERBEndNode, ERBEnsureNode, ERBForNode, ERBIfNode, ERBInNode, ERBMultipleBlocksInTagError, ERBNodeClasses, ERBOpenTagNode, ERBRenderNode, ERBRescueNode, ERBUnlessNode, ERBUntilNode, ERBWhenNode, ERBWhileNode, ERBYieldNode, HTMLAttributeNameNode, HTMLAttributeNode, HTMLAttributeValueNode, HTMLCloseTagNode, HTMLCommentNode, HTMLConditionalElementNode, HTMLConditionalOpenTagNode, HTMLDoctypeNode, HTMLElementNode, HTMLOmittedCloseTagNode, HTMLOpenTagNode, HTMLTextNode, HTMLVirtualCloseTagNode, HerbBackend, HerbError, HerbWarning, InvalidCommentClosingTagError, LexResult, LiteralNode, Location, MissingAttributeValueError, MissingClosingTagError, MissingERBEndTagError, MissingOpeningTagError, NODE_TYPE_GUARDS, NestedERBTagError, Node, OmittedClosingTagError, ParseResult, ParserOptions, Position, BasicVisitor as PrismBasicVisitor, nodes as PrismNodes, Visitor$1 as PrismVisitor, Range, RenderAmbiguousLocalsError, RenderConflictingPartialError, RenderInvalidAsOptionError, RenderLayoutWithoutBlockError, RenderMissingLocalsError, RenderNoArgumentsError, RenderObjectAndCollectionError, Result, RubyHTMLAttributesSplatNode, RubyLiteralNode, RubyParseError, RubyRenderLocalNode, StrayERBClosingTagError, TOKEN_LIST_ATTRIBUTES, TagNamesMismatchError, Token, TokenList, UnclosedCloseTagError, UnclosedERBTagError, UnclosedElementError, UnclosedOpenTagError, UnclosedQuoteError, UnexpectedError, UnexpectedTokenError, Visitor, VoidElementClosingTagError, WhitespaceNode, XMLDeclarationNode, _TYPECHECK, areAllOfType, createLiteral, createSyntheticToken, createWhitespaceNode, deserializePrismNode, deserializePrismParseResult, didyoumean, didyoumeanRanked, ensureLibHerbBackend, ensureString, filterCDATANodes, filterDocumentNodes, filterERBBeginNodes, filterERBBlockNodes, filterERBCaseMatchNodes, filterERBCaseNodes, filterERBContentNodes, filterERBElseNodes, filterERBEndNodes, filterERBEnsureNodes, filterERBForNodes, filterERBIfNodes, filterERBInNodes, filterERBOpenTagNodes, filterERBRenderNodes, filterERBRescueNodes, filterERBUnlessNodes, filterERBUntilNodes, filterERBWhenNodes, filterERBWhileNodes, filterERBYieldNodes, filterHTMLAttributeNameNodes, filterHTMLAttributeNodes, filterHTMLAttributeValueNodes, filterHTMLCloseTagNodes, filterHTMLCommentNodes, filterHTMLConditionalElementNodes, filterHTMLConditionalOpenTagNodes, filterHTMLDoctypeNodes, filterHTMLElementNodes, filterHTMLOmittedCloseTagNodes, filterHTMLOpenTagNodes, filterHTMLTextNodes, filterHTMLVirtualCloseTagNodes, filterLiteralNodes, filterNodes, filterRubyHTMLAttributesSplatNodes, filterRubyLiteralNodes, filterRubyRenderLocalNodes, filterWhitespaceNodes, filterXMLDeclarationNodes, findAttributeByName, findParentArray, forEachAttribute, fromSerializedError, fromSerializedNode, getAttribute, getAttributeName, getAttributeValue, getAttributeValueNodes, getAttributeValueQuoteType, getAttributes, getCombinedAttributeName, getCombinedAttributeNameString, getCombinedStringFromNodes, getNodesAfterLocation, getNodesAfterPosition, getNodesBeforeLocation, getNodesBeforePosition, getOpenTag, getStaticAttributeName, getStaticAttributeValue, getStaticAttributeValueContent, getStaticContentFromNodes, getStaticStringFromNodes, getTagLocalName, getTagName, getTokenList, getValidatableStaticContent, groupNodesByClass, hasAttribute, hasAttributeValue, hasChildren, hasDynamicAttributeName, hasDynamicAttributeNameNode, hasDynamicAttributeValue, hasERBContent, hasERBOutput, hasStaticAttributeName, hasStaticAttributeValue, hasStaticAttributeValueContent, hasStaticContent, inspectPrismNode, inspectPrismSerialized, isAnyOf, isAttributeValueQuoted, isCDATANode, isCommentNode, isDocumentNode, isERBBeginNode, isERBBlockNode, isERBCaseMatchNode, isERBCaseNode, isERBCommentNode, isERBContentNode, isERBControlFlowNode, isERBElseNode, isERBEndNode, isERBEnsureNode, isERBForNode, isERBIfNode, isERBInNode, isERBNode, isERBOpenTagNode, isERBOutputNode, isERBRenderNode, isERBRescueNode, isERBUnlessNode, isERBUntilNode, isERBWhenNode, isERBWhileNode, isERBYieldNode, isEffectivelyStatic, isEquivalentAttribute, isEquivalentElement, isEquivalentOpenTag, isHTMLAttributeNameNode, isHTMLAttributeNode, isHTMLAttributeValueNode, isHTMLCloseTagNode, isHTMLCommentNode, isHTMLConditionalElementNode, isHTMLConditionalOpenTagNode, isHTMLDoctypeNode, isHTMLElementNode, isHTMLNode, isHTMLOmittedCloseTagNode, isHTMLOpenTagNode, isHTMLTextNode, isHTMLVirtualCloseTagNode, isLibHerbBackend, isLiteralNode, isNode, isNoneOf, isParseResult, isPositionAfter, isPositionEqual, isPureWhitespaceNode, isRubyHTMLAttributesSplatNode, isRubyLiteralNode, isRubyRenderLocalNode, isToken, isWhitespaceNode, isXMLDeclarationNode, levenshtein, removeNodeFromArray, replaceNodeWithBody, splitLiteralsAtWhitespace, splitNodesAroundLocation, splitNodesAroundPosition, toMonacoDiagnostic };
26365
26912
  //# sourceMappingURL=herb-core.browser.js.map