Skip to main content

Overview

Bigodin is a Handlebars-flavored superset and is not a drop-in Mustache implementation. Against the official mustache/spec suite, 103 / 110 attempted tests currently pass (94%); the remaining 84 spec tests live in 5 deliberately-skipped feature files (partials, dynamic-names, set-delimiters, inheritance, lambdas), 3 HTML Escaping variants are skipped because Bigodin emits raw output by default, and 4 individual tests are skipped because they require auto-walking the context stack (Bigodin uses Handlebars-style strict scoping; use $parent / $root to walk up explicitly).

This directory documents Bigodin's per-feature compatibility. Each sub-doc describes what is supported, what is not, and (for unsupported features) why.

At a glance

FeatureStatusNotes
Variable interpolation {{x}}SupportedOutput is never HTML-escaped by default; register an escape helper if needed (see Render HTML safely)
Sections {{#x}}...{{/x}}SupportedEmpty arrays falsy on negated branch; truthy scalars do not push as context (Handlebars-style); use $parent / $root to walk the context stack
Inverted sections {{^x}}...{{/x}}SupportedEmpty arrays correctly treated as falsy
Comments {{! ... }}SupportedStandalone-line whitespace is stripped
Triple mustache {{{x}}}SupportedOutput is identical to {{x}} (Bigodin never HTML-escapes by default)
Ampersand {{&x}}SupportedOutput is identical to {{x}}
Standalone-line whitespace strippingSupportedApplied to comments and section open / close tags; see standalone-line-whitespace.md
Implicit iterator {{.}}SupportedResolves to current context (alias of {{$this}}); see implicit-iterator.md
Block heads with literal-named keysSupported{{#null}} / {{#true}} / {{#false}} / {{#undefined}} look up the matching key in context
HTML escaping for {{x}}Not supportedBigodin emits raw output; register an escape helper if needed
Auto context-stack walk on missing keysNot supportedBigodin uses strict scoping; use $parent / $root to walk explicitly
Set Delimiters {{=<% %>=}}Not plannedSee set-delimiters.md
Partials {{>name}}Not plannedSee partials.md
Dynamic names {{*name}} (optional)Not plannedDepends on partials; see dynamic-names.md
Inheritance {{<p}}{{$b}}... (optional)Not planned$ collides with Bigodin's variable syntax; see inheritance.md
Lambdas (optional)Not supportedBigodin's helper API (addHelper) is the recommended alternative; see lambdas.md

Run yarn test:spec to execute the full Mustache spec suite locally (it clones mustache/spec into test/mustache/ on first run).

Status snapshot

Run on main against the current dist/ build:

  • Passing: 103 / 110 attempted Mustache spec tests (94%)
  • Failing: 0
  • Skipped: 84 + 7, broken down as:
    • 84 tests in 5 unimplemented feature files (partials.json, ~dynamic-names.json, delimiters.json, ~inheritance.json, ~lambdas.json)
    • 3 HTML Escaping variants - deliberate divergence (Bigodin emits raw output by default)
    • 4 tests requiring auto context-stack walking (Parent contexts, List Contexts, Deeply Nested Contexts, Variable test) - Bigodin uses Handlebars-style strict scoping
  • Test runner: yarn test:spec (clones mustache/spec into test/mustache/, executes test/spec.spec.ts)

What's implemented

  • Implicit iterator {{.}} - resolves to the current context (alias of {{$this}})
  • Inverted-section empty-array falsy check
  • Triple mustache {{{x}}} and ampersand {{&x}} parsed as raw-emit aliases of {{x}}
  • Block heads with literal-named keys ({{#null}} etc.) resolve as paths
  • Standalone-line whitespace stripping for comments and block open/close tags

What's deliberately skipped

  • The 5 feature files above - see the per-category docs in this directory
  • HTML escaping for {{x}} - Bigodin emits raw output; the spec's HTML Escaping tests therefore fail by design
  • Truthy-scalar context push ({{#scalar}}{{.}}{{/scalar}}) - Bigodin's existing semantic is "don't change context for non-object values"
  • Auto walk of context stack - use explicit $parent / $root instead

Categories

#CategoryStatusDoc
1Triple mustache {{{x}}} and ampersand {{&x}}Supportedtriple-mustache-and-ampersand.md
2Standalone-line whitespace strippingSupportedstandalone-line-whitespace.md
3Implicit iterator {{.}}Supportedimplicit-iterator.md
4Section context & falsy edge casesMostly supportedsection-falsy-and-context.md
5Set Delimiters {{=<% %>=}}Not plannedset-delimiters.md
6Partials {{>name}}Not plannedpartials.md
7Dynamic names {{*name}} (optional)Not planneddynamic-names.md
8Inheritance {{<parent}}{{$block}}{{/parent}} (optional)Not plannedinheritance.md
9Lambdas (optional)Not supportedlambdas.md

Categories 1, 2, 3 ship the Mustache feature behind Bigodin's existing parser; category 4 is mostly aligned with the spec, with the documented exceptions of truthy-scalar context-push and auto context-stack walk. Categories 5–9 are new features Bigodin does not (and in most cases will not) provide.

Versioning notes

Bigodin's parser emits a version field on the AST root (src/parser/index.ts, currently VERSION = 5). The runner enforces a MIN_VERSION = 1, MAX_VERSION = 5 window (src/runner/index.ts). Any change that alters the AST shape (adding a new statement type, adding fields to existing statements, etc.) must bump VERSION and widen MAX_VERSION. Old persisted ASTs outside the window fail loudly with a "parse it again" error; this is intentional and must be preserved.

Test runner

test/spec.spec.ts controls what runs via two top-level lists:

const SKIPPED_SPECS = [
'partials.json',
'~dynamic-names.json',
'delimiters.json',
'~inheritance.json',
'~lambdas.json',
];

const SKIPPED_FEATURES = [
'Parent contexts',
'List Contexts',
'Deeply Nested Contexts',
'Variable test',
'HTML Escaping',
];

SKIPPED_SPECS skips an entire spec file; SKIPPED_FEATURES skips individual tests whose name contains the given substring (case-insensitive). If a category here is decided to be permanently out of scope, add the spec file or feature name to the appropriate list.