From 6150516ff0e5399c8e40bd65d472ca24e39826c7 Mon Sep 17 00:00:00 2001 From: John <37978984+johnridesabike@users.noreply.github.com> Date: Wed, 24 Apr 2024 07:20:11 -0400 Subject: [PATCH] Change echo syntax to use {% and %} This simplifies lexing and parsing, and there are no more special lexing rules for double-closed JSON objects }}. --- CHANGELOG.md | 4 +- docs/_includes/layout.acutis | 30 +- docs/_layouts/main.acutis | 2 +- docs/eleventy.config.js | 2 +- docs/index.md | 14 +- docs/manual.md | 80 +- docs/playground.acutis | 4 +- docs/playground.js | 6 +- lib/dune | 2 +- lib/lexer.mll | 69 +- lib/parser.messages | 36 +- lib/parser.mly | 70 +- test/cli.t/a.acutis | 2 +- test/data-test.t/template.acutis | 12 +- test/dune | 2 +- test/error_test.expected | 88 +- test/error_test.ml | 125 +- test/matching-test.t/dicts.acutis | 4 +- test/parse-test.t/component.acutis | 14 +- test/parse-test.t/component2.acutis | 2 +- test/parse-test.t/run.t | 1006 ++++++++--------- test/parse-test.t/template.acutis | 29 +- test/printjs/printjs-error.t/template.acutis | 8 +- test/printjs/printjs.t/component.acutis | 4 +- test/printjs/printjs.t/template.acutis | 52 +- test/printjs/printjs_example.acutis | 12 +- .../components/childrenProp.acutis | 2 +- .../render-test.t/components/nullProps.acutis | 2 +- .../components/nullPropsDefault.acutis | 2 +- test/render-test.t/components/ohHai.acutis | 2 +- .../components/passthroughChild.acutis | 2 +- test/render-test.t/constructing.acutis | 2 +- test/render-test.t/dicts.acutis | 8 +- test/render-test.t/echoes.acutis | 4 +- test/render-test.t/map.acutis | 14 +- test/render-test.t/nullables.acutis | 4 +- test/render-test.t/other.acutis | 2 +- test/render-test.t/tagged_unions.acutis | 2 +- test/render-test.t/whitespace_control.acutis | 2 +- test/typechecker-test.t/component_a.acutis | 4 +- test/typechecker-test.t/context.acutis | 14 +- test/typechecker-test.t/echoes.acutis | 2 +- test/typechecker-test.t/enum_open.acutis | 2 +- test/typechecker-test.t/interface.acutis | 2 +- test/typechecker-test.t/narrowing.acutis | 6 +- test/typechecker-test.t/nested.acutis | 2 +- test/typechecker-test.t/other.acutis | 2 +- .../typechecker-test.t/pathologic_enum.acutis | 2 +- test/typechecker-test.t/record_fields.acutis | 8 +- test/typechecker-test.t/union_boolean.acutis | 10 +- test/typechecker-test.t/union_closed.acutis | 4 +- test/typechecker-test.t/union_open.acutis | 6 +- 52 files changed, 830 insertions(+), 961 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffef8071..bfe1a07e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ Most changes are breaking changes. -## Latest +## 0.25.0 +- Echo syntax is now the same as other expressions, `{%` and `%}`. Unescaped + echoes use `{{%` and `%}}`. - All decode errors are reported instead of only the first one. - Decode errors are implemented in a promise type instead of raising an exception. diff --git a/docs/_includes/layout.acutis b/docs/_includes/layout.acutis index 6cb46b75..f14f87a8 100644 --- a/docs/_includes/layout.acutis +++ b/docs/_includes/layout.acutis @@ -23,17 +23,17 @@
-
-
+
- {{ title }}
+ {% title %}
{{ subtitle }}
+{% subtitle %}