From 13e7cedb607b496b69ffd73e615c3903010e5257 Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 6 Nov 2023 04:27:11 -0800 Subject: [PATCH] initial commits --- number/number.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/number/number.go b/number/number.go index 87c5fdb..587b96e 100644 --- a/number/number.go +++ b/number/number.go @@ -6,6 +6,27 @@ import ( "sourcecode.social/reiver/go-opt" ) +// Number represents a JSON number literal as defined by IETF RFC-8259. +// +// number = [ minus ] int [ frac ] [ exp ] +// +// decimal-point = %x2E ; . +// +// digit1-9 = %x31-39 ; 1-9 +// +// e = %x65 / %x45 ; e E +// +// exp = e [ minus / plus ] 1*DIGIT +// +// frac = decimal-point 1*DIGIT +// +// int = zero / ( digit1-9 *DIGIT ) + +// minus = %x2D ; - +// +// plus = %x2B ; + +// +// zero = %x30 ; 0 type Number struct { opt.Optional[string] }