From eae3b8ab3a5bb42109354b1143e8118b741a8038 Mon Sep 17 00:00:00 2001 From: Dave Leaver Date: Sat, 15 Nov 2025 19:27:33 +1300 Subject: [PATCH 1/2] Fix grammar in Optional() section --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 54eaf903..44b31a24 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -131,7 +131,7 @@ It is not necessary to wrap `Terms` parsers with `SkipWhitespace()` as they alre ### `Optional()` usage -Use the `Optional()` combinator to make a parser optional. If will always return an instance of `Option` regardless of whether the parser matches or not. Use `HasValue` to check if the parser was successful. Or use `OrSome()` to provide a default value when the parser does not match. +Use the `Optional()` combinator to make a parser optional. Returns an instance of `Option` regardless of whether the parser matches or not. Use `HasValue` to check if the parser was successful. Or use `OrSome()` to provide a default value when the parser does not match. ```c# // Parse an integer or return -1 if not present From b7d1c389eb51aab6830a884ee29fa4e92a409fcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Sat, 15 Nov 2025 12:32:09 -0800 Subject: [PATCH 2/2] Update Optional() usage explanation Clarify the behavior of the Optional() combinator in the documentation. --- .github/copilot-instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 44b31a24..1e46bb05 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -131,7 +131,7 @@ It is not necessary to wrap `Terms` parsers with `SkipWhitespace()` as they alre ### `Optional()` usage -Use the `Optional()` combinator to make a parser optional. Returns an instance of `Option` regardless of whether the parser matches or not. Use `HasValue` to check if the parser was successful. Or use `OrSome()` to provide a default value when the parser does not match. +Use the `Optional()` combinator to make a parser optional. It will always return an instance of `Option` regardless of whether the parser matches or not. Use `HasValue` to check if the parser was successful. Or use `OrSome()` to provide a default value when the parser does not match. ```c# // Parse an integer or return -1 if not present