Skip to content

Commit

Permalink
Remove footer from spec
Browse files Browse the repository at this point in the history
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
  • Loading branch information
praihan authored and facebook-github-bot committed Feb 6, 2025
1 parent 43d121d commit 525eb1c
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions thrift/doc/contributions/whisker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

<Grammar>

```
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 → { <see below> }
Expand Down

0 comments on commit 525eb1c

Please sign in to comment.