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] }