Documentation
¶
Overview ¶
Package descriptor parses a RNBF rule descriptor.
Index ¶
Constants ¶
View Source
const ( TypeDefault = Type(iota) TypeBaseValue TypeBaseValueAndRadix TypeNegativeNumber TypeProperFraction TypeImproperFraction TypeInfinity TypeNaN )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Descriptor ¶
func Parse ¶
func Parse(s string) Descriptor
Parse parses a rule descriptor in the following format, or panics:
- bv and rad are the names of tokens formatted as decimal numbers expressed using ASCII digits with spaces, period, and commas ignored.
- bv specifies the rule's base value. The rule's divisor is the highest power of 10 less than or equal to the base value.
- bv/rad: The rule's divisor is the highest power of rad less than or equal to the base value.
- -x: The rule is a negative-number rule.
- x.x: The rule is an improper fraction rule.
- 0.x: The rule is a proper fraction rule.
- x.0: The rule is a default rule.
- Inf: The rule for infinity.
- NaN: The rule for an IEEE 754 NaN (not a number).
Click to show internal directories.
Click to hide internal directories.