createTagEnd function

Parser createTagEnd([
  1. LiquidConfig? config
])

Creates a tag end delimiter parser with optional custom config.

Returns a parser that matches the tag end delimiter (e.g., %} or -%}). The whitespace-stripping variant (e.g., -%}) strips following whitespace.

If config is null, uses standard Liquid delimiters.

Example

final config = LiquidConfig(tagStart: '[%', tagEnd: '%]');
final myTagEnd = createTagEnd(config);
// Matches: %] or -%]

Implementation

Parser createTagEnd([LiquidConfig? config]) {
  final cfg = config ?? LiquidConfig.standard;
  return (string(cfg.tagEndStrip).trim() | string(cfg.tagEnd)).labeled(
    'tagEnd',
  );
}