From 525eb1c211ed5545142e5885837fa918fa8b810e Mon Sep 17 00:00:00 2001 From: Pranjal Raihan Date: Thu, 6 Feb 2025 13:40:27 -0800 Subject: [PATCH] Remove footer from spec Summary: If we have `export`s that are inlined in the `body` then we cannot have a `footer`. It will always be empty per the grammar because it's a strict subset of `body`. So let's remove it. Reviewed By: iahs Differential Revision: D69262859 fbshipit-source-id: 23b7d24368d4fbd5662d002df48c329e72da9f27 --- thrift/doc/contributions/whisker.md | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/thrift/doc/contributions/whisker.md b/thrift/doc/contributions/whisker.md index f435afc59d4..6fb91e961c5 100644 --- a/thrift/doc/contributions/whisker.md +++ b/thrift/doc/contributions/whisker.md @@ -86,30 +86,25 @@ The supported set of combinators are: ## File Structure -A Whisker source file's `body` is a repeated pattern of textual content, variable interpolations, and control flow constructs (condition, iteration). +A Whisker source file is composed of two sections: a leading `header` followed by the main `body`. -The source file's `body` is wrapped by a leading `header`, and a trailing `footer`. The rest of this document describes the contents of the `body`. +The `body` is a repeated pattern of textual content, variable interpolations, and control flow constructs (condition, iteration). +The rest of this document describes its contents. -`header` and `footer` are *unrendered* sections of the source. They may contain: +The `header` is an *unrendered* section of the source. It may contain: * [Comments](#comments) * [Pragma statements](#pragma-statements) * [Whitespace-only `text` (including `newline`)](#text). - -The `header` may also contain: * [Import statements](#modules) -The `footer` may also contain: - * [Export statements](#modules) - -Rendering ignores all whitespaces in the `header` and the `footer`. +Rendering ignores all whitespaces in the `header`. ``` -root → { (whitespace* ~ header)* ~ body* ~ (whitespace* ~ footer)* } +root → { (whitespace* ~ header)* ~ body* } header → { comment | pragma-statement | import-statement } -footer → { comment | pragma-statement | export-statement } body → { text | template } text → { }