From 7668192a49aa76c641e2f428a944a324a251be62 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Fri, 10 Jan 2025 21:24:50 -0500 Subject: [PATCH] docs: clarify that the optional fields are a function that take in the grammar object --- docs/src/creating-parsers/2-the-grammar-dsl.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/src/creating-parsers/2-the-grammar-dsl.md b/docs/src/creating-parsers/2-the-grammar-dsl.md index bc11c670..181e7511 100644 --- a/docs/src/creating-parsers/2-the-grammar-dsl.md +++ b/docs/src/creating-parsers/2-the-grammar-dsl.md @@ -95,7 +95,8 @@ one passed into the `wordset` parameter. This is useful for contextual keywords, be used as a variable name in most contexts, but can be used as a property name. In addition to the `name` and `rules` fields, grammars have a few other optional public fields that influence the behavior -of the parser. +of the parser. Each of these fields is a function that accepts the grammar object (`$`) as its only parameter, like the +grammar rules themselves. These fields are: - **`extras`** — an array of tokens that may appear *anywhere* in the language. This is often used for whitespace and comments. The default value of `extras` is to accept whitespace. To control whitespace explicitly, specify