From 40ca2bb03c8d29554a01ec9010e110792161a7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Ros?= Date: Mon, 26 Feb 2024 09:35:22 -0800 Subject: [PATCH] Document NumberOptions (#89) --- docs/parsers.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/parsers.md b/docs/parsers.md index 535345a..f9347ac 100644 --- a/docs/parsers.md +++ b/docs/parsers.md @@ -96,7 +96,7 @@ Result: ### Integer -Matches an integral numeric value. +Matches an integral numeric value. By default the plus `+` and `-` signs are not parsed unless the `NumberOptions.AllowSign` is specified. ```c# Parser Integer() @@ -106,7 +106,7 @@ Usage: ```c# var input = "-1234"; -var parser = Terms.Integer(); +var parser = Terms.Integer(NumberOptions.AllowSign); ``` Result: @@ -117,7 +117,7 @@ Result: ### Decimal -Matches a numeric value with optional digits. +Matches a numeric value with optional digits. By default the plus `+` and `-` signs are not parsed unless the `NumberOptions.AllowSign` is specified. ```c# Parser Decimal() @@ -127,7 +127,7 @@ Usage: ```c# var input = "-1234.56"; -var parser = Terms.Decimal(); +var parser = Terms.Decimal(NumberOptions.AllowSign); ``` Result: @@ -136,6 +136,8 @@ Result: -1,234.56 ``` +The parsers `Float` and `Double` are identical to `Decimal` with the difference that they return `float` and `double` respectively. + ### String Matches a quoted string literal, optionally use single or double enclosing quotes.