Skip to content

[FEATURE]: Clearer, cleaner string template / pattern generation #450

Description

@josh-seidel-db

Summary

Redesign and clarify the string template / pattern generation mechanism (e.g. TemplateGenerator and template-based text generation) so the template mini-language is clearer to author and cleaner to maintain.

Background

dbldatagen supports template-driven text generation, where templates use escape sequences and special meta-characters to express patterns (digits, letters, words, ranges, repetition, alternation, etc.). As the template language has grown, the syntax and the code that parses it have become harder to read, document, and extend.

Problems

  • Template syntax (escapes / meta-characters) is not always intuitive and is easy to get wrong.
  • Edge cases — escaping literals, repetition counts, optional and alternation groups — are under-documented.
  • The parsing/handling code is harder to maintain and extend than it should be.

Proposed direction

  • Define a clear, documented grammar for the template / pattern language.
  • Improve error messages for malformed templates.
  • Separate parsing from generation to improve testability.
  • Provide a compatibility / migration path so existing templates continue to work.
  • Expand the documentation with a complete reference table and worked examples.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions