asciiunits 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.adoc +39 -1
- data/artifacts/unitsml.checksums.txt +5 -5
- data/artifacts/unitsml.json +1 -1
- data/corpora/unitsml/corpus.json +36 -1
- data/corpora/unitsml/expected-kinds.json +1 -1
- data/grammars/unitsml.parg +6 -3
- data/lib/asciiunits/model/nodes.rb +91 -0
- data/lib/asciiunits/model.rb +67 -0
- data/lib/asciiunits/version.rb +1 -1
- data/lib/asciiunits.rb +10 -0
- data/model/asciiunits.lml.checksums.txt +12 -0
- data/model/asciiunits.lml.json +269 -0
- metadata +28 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 11486d94ee312a27434930f8cc0e3efeb9bb5ca0c61114eb731cd651f3302d09
|
|
4
|
+
data.tar.gz: 83ccf03f9f1d437d3c51577b068d3ffe2f2059e336240f3519832fbe6d109c5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a57146b3e988f4130c76c1d86c8a634f246054864252364f3ea288fe1acaa1dcc724e6e4c5305e4b07debdf88d3cb9dc7f3c6d79be423056329a783c4bb3ac31
|
|
7
|
+
data.tar.gz: 7a48aa705fd5461718baa2786253191dd3e8a87685c4814bf8720d4ac9e9e5ca81b294159cc94578efe911c322e879e18bdd6c7e299e873c9e613ccf3097d80d
|
data/README.adoc
CHANGED
|
@@ -4,7 +4,7 @@ PARG grammar, checksummed artifact and conformance corpus for the
|
|
|
4
4
|
`unitsml(...)` expression content of https://github.com/unitsml/unitsml-ruby[UnitsML]
|
|
5
5
|
(the AsciiUnits unit-expression syntax).
|
|
6
6
|
|
|
7
|
-
This repository ships
|
|
7
|
+
This repository ships the contract and a typed model of its parse tree:
|
|
8
8
|
|
|
9
9
|
* `grammars/unitsml.parg` — the grammar source
|
|
10
10
|
* `artifacts/unitsml.json` — the compiled artifact (`parsanol-tree/v2`, checksummed)
|
|
@@ -12,6 +12,8 @@ This repository ships **no runtime code**. It ships the contract:
|
|
|
12
12
|
time; loaded from disk at parse time, see below)
|
|
13
13
|
* `corpora/unitsml/` — conformance corpus, oracle-frozen against the
|
|
14
14
|
unitsml-ruby Parslet parser
|
|
15
|
+
* `model/asciiunits.lml.json` — the LML declarations of the typed model
|
|
16
|
+
(`lib/asciiunits/model`), with their checksums
|
|
15
17
|
|
|
16
18
|
Runtime repositories (Ruby, Rust, TypeScript) load the artifact via their
|
|
17
19
|
Parsanol runtime and map parse trees to their own object models. In Ruby:
|
|
@@ -82,6 +84,9 @@ Parslet `.as()` names of the original (values are slices: `value` + `offset`
|
|
|
82
84
|
|
|
83
85
|
|`open_paren` / `close_paren`
|
|
84
86
|
|Fence characters captured by the named int-exp rules
|
|
87
|
+
|
|
88
|
+
|`hyphen`
|
|
89
|
+
|The trailing `-` of a prefix-only expression (`p-`)
|
|
85
90
|
|===
|
|
86
91
|
|
|
87
92
|
Post-parse semantics (sqrt → 0.5 powers, `/` and `//` inverting exponents)
|
|
@@ -105,6 +110,38 @@ artifact = Asciiunits.load_artifact
|
|
|
105
110
|
artifact.parse("expression", "mm*s^-2")
|
|
106
111
|
----
|
|
107
112
|
|
|
113
|
+
== Typed model
|
|
114
|
+
|
|
115
|
+
`Asciiunits.parse_model` parses an expression and returns an
|
|
116
|
+
`Asciiunits::Model::Document`, declared with LutaML Model. Its
|
|
117
|
+
`expression` holds the tree above as typed nodes: every text capture is a
|
|
118
|
+
`Slice` (`value`, `offset`, `length`, `line`, `column`), and every subtree
|
|
119
|
+
capture is a node class with one attribute per key it can hold.
|
|
120
|
+
|
|
121
|
+
[source,ruby]
|
|
122
|
+
----
|
|
123
|
+
require "asciiunits"
|
|
124
|
+
|
|
125
|
+
doc = Asciiunits.parse_model("m^(1/2)*s")
|
|
126
|
+
doc.expression.unit.value # => "m"
|
|
127
|
+
doc.expression.power_numerator.int_exp.integer.value # => "1/2"
|
|
128
|
+
doc.expression.sequence.unit.value # => "s"
|
|
129
|
+
----
|
|
130
|
+
|
|
131
|
+
The node classes in `lib/asciiunits/model/nodes.rb` are generated from the
|
|
132
|
+
static capture shapes of the artifact (`scripts/generate_model.rb`), so a
|
|
133
|
+
capture the corpus never exercises is still declared. The recursive
|
|
134
|
+
captures `int_exp`, `sequence` and `sqrt` share the class `Expression` with
|
|
135
|
+
the tree itself. A tree key the model does not declare raises
|
|
136
|
+
`Asciiunits::Model::UndeclaredCapture` instead of being dropped.
|
|
137
|
+
|
|
138
|
+
`model/asciiunits.lml.json` holds the LML export of every model class
|
|
139
|
+
(`Lutaml::Model::Lml.export`), and `model/asciiunits.lml.checksums.txt` their
|
|
140
|
+
checksums. `rake model:check` fails if either the classes or the export is
|
|
141
|
+
stale, and replays the corpus: the model built from each accepted input
|
|
142
|
+
serializes to the recorded tree, each recorded tree round-trips through the
|
|
143
|
+
model, and each rejected input still raises.
|
|
144
|
+
|
|
108
145
|
== Rebuilding
|
|
109
146
|
|
|
110
147
|
The `unitsml` gem (build-time only) supplies the terminal selection and the
|
|
@@ -117,6 +154,7 @@ rake tables:gen # regenerate terminal tables from the unitsml gem
|
|
|
117
154
|
rake oracle:regen # re-baseline accept/reject against the parslet parser
|
|
118
155
|
rake artifact:compile # compile with determinism check + checksums manifest
|
|
119
156
|
rake contracts:regen # replay artifact over the corpus, enforce parity
|
|
157
|
+
rake model:regen # regenerate the model classes and their LML export
|
|
120
158
|
rake ci # everything green before committing
|
|
121
159
|
----
|
|
122
160
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Written by scripts/compile.rb. Envelope checksum is Parsanol's own;
|
|
2
2
|
# the sha256 lines are of the files' bytes.
|
|
3
|
-
artifact_checksum sha256:
|
|
4
|
-
compiler_version 1.
|
|
5
|
-
source_hash sha256:
|
|
6
|
-
artifacts/unitsml.json sha256:
|
|
7
|
-
grammars/unitsml.parg sha256:
|
|
3
|
+
artifact_checksum sha256:3a5d423ea975d46e9ab4b98a652e9276849f540226466dbacdd5001b2f6a5016
|
|
4
|
+
compiler_version 1.5.8
|
|
5
|
+
source_hash sha256:7702a1bd52072d5d860e8176b50b5bebb218c1fda864592bb7313419e94506e3
|
|
6
|
+
artifacts/unitsml.json sha256:98e53c5fa31233725158a49af75361b0aacc4bf3292a8c09675995f85a0b7e4c
|
|
7
|
+
grammars/unitsml.parg sha256:7702a1bd52072d5d860e8176b50b5bebb218c1fda864592bb7313419e94506e3
|
|
8
8
|
tables/dimensions.yaml sha256:62715c12c96d0dcd0c640850e3e922e5708d5871a959b251dc714a7cd8c86836
|
|
9
9
|
tables/prefixed_units.yaml sha256:d1ee30a14db6087b3efedef71e486753fddfbf56f49ab2207fa8206923fc3bab
|
|
10
10
|
tables/prefixes_double.yaml sha256:523d8f9ffc270654e58fc131088777e2b5fb6afb0021da7d9a07c411eba27aee
|
data/artifacts/unitsml.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"UnitsmlAscii","shape":"parsanol-tree/v2","binding_version":1,"entries":{"expression":{"root":"expression","grammar":{"atoms":[{"Entity":{"atom":588}},{"Entity":{"atom":585}},{"Entity":{"atom":582}},{"Entity":{"atom":580}},{"Str":{"pattern":"sqrt"}},{"Entity":{"atom":6}},{"Str":{"pattern":"("}},{"Entity":{"atom":577}},{"Named":{"name":"implicit_extended","atom":1}},{"Entity":{"atom":18}},{"Entity":{"atom":17}},{"Re":{"pattern":"[\\x09]"}},{"Re":{"pattern":"[\\x0a]"}},{"Re":{"pattern":"[\\x0b]"}},{"Re":{"pattern":"[\\x0c]"}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[ ]"}},{"Alternative":{"atoms":[11,12,13,14,15,16]}},{"Repetition":{"atom":10,"min":1,"max":null,"tag":"Repetition"}},{"Repetition":{"atom":9,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":573}},{"Named":{"name":"sequence","atom":20}},{"Repetition":{"atom":21,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,19,22]}},{"Entity":{"atom":570}},{"Named":{"name":"first_set","atom":2}},{"Entity":{"atom":18}},{"Named":{"name":"extender","atom":26}},{"Entity":{"atom":546}},{"Entity":{"atom":543}},{"Entity":{"atom":38}},{"Entity":{"atom":34}},{"Str":{"pattern":"//"}},{"Str":{"pattern":"/"}},{"Alternative":{"atoms":[32,33]}},{"Entity":{"atom":36}},{"Str":{"pattern":"*"}},{"Alternative":{"atoms":[31,35]}},{"Named":{"name":"extender","atom":37}},{"Entity":{"atom":18}},{"Repetition":{"atom":39,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":541}},{"Named":{"name":"implicit_extended","atom":24}},{"Entity":{"atom":18}},{"Repetition":{"atom":43,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":538}},{"Named":{"name":"sequence","atom":48}},{"Sequence":{"atoms":[42,44,45,47,49]}},{"Entity":{"atom":536}},{"Entity":{"atom":6}},{"Entity":{"atom":18}},{"Repetition":{"atom":53,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":534}},{"Entity":{"atom":526}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":57}},{"Entity":{"atom":18}},{"Repetition":{"atom":59,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":520}},{"Entity":{"atom":68}},{"Named":{"name":"int_exp","atom":55}},{"Entity":{"atom":18}},{"Repetition":{"atom":64,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":67}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[52,54,63,65,66]}},{"Entity":{"atom":519}},{"Entity":{"atom":18}},{"Repetition":{"atom":70,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":73,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":516}},{"Named":{"name":"sequence","atom":75}},{"Sequence":{"atoms":[51,71,72,74,76]}},{"Entity":{"atom":486}},{"Repetition":{"atom":29,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[3,79]}},{"Str":{"pattern":"1"}},{"Named":{"name":"unit","atom":81}},{"Entity":{"atom":85}},{"Named":{"name":"sequence","atom":41}},{"Sequence":{"atoms":[30,40,84]}},{"Repetition":{"atom":83,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[82,86]}},{"Entity":{"atom":402}},{"Entity":{"atom":364}},{"Str":{"pattern":"ton-force (2000 lb)"}},{"Str":{"pattern":"ton_refrigeration"}},{"Str":{"pattern":"dprime_Hg_32degF"}},{"Str":{"pattern":"dprime_Hg_60degF"}},{"Str":{"pattern":"fl oz (US label)"}},{"Str":{"pattern":"a_sidereal_year"}},{"Str":{"pattern":"a_tropical_year"}},{"Str":{"pattern":"aW (Cardelli)"}},{"Str":{"pattern":"ftH_2O_39degF"}},{"Str":{"pattern":"inH_2O_39degF"}},{"Str":{"pattern":"inH_2O_60degF"}},{"Str":{"pattern":"liq pint (US)"}},{"Str":{"pattern":"oz (US label)"}},{"Str":{"pattern":"pica_computer"}},{"Str":{"pattern":"rad_radiation"}},{"Str":{"pattern":"cmH_2O_4degC"}},{"Str":{"pattern":"ft_US_survey"}},{"Str":{"pattern":"h-bar_atomic"}},{"Str":{"pattern":"in_US_survey"}},{"Str":{"pattern":"lambda-bar_C"}},{"Str":{"pattern":"mi_US_survey"}},{"Str":{"pattern":"min_sidereal"}},{"Str":{"pattern":"pica_printer"}},{"Str":{"pattern":"yd_US_survey"}},{"Str":{"pattern":"dry pt (US)"}},{"Str":{"pattern":"dry qt (US)"}},{"Str":{"pattern":"gi_imperial"}},{"Str":{"pattern":"hp_electric"}},{"Str":{"pattern":"inHg_32degF"}},{"Str":{"pattern":"inHg_60degF"}},{"Str":{"pattern":"liq qt (US)"}},{"Str":{"pattern":"pt_computer"}},{"Str":{"pattern":"statcoulomb"}},{"Str":{"pattern":"\"Hg_32degF"}},{"Str":{"pattern":"\"Hg_60degF"}},{"Str":{"pattern":"Btu_39degF"}},{"Str":{"pattern":"Btu_59degF"}},{"Str":{"pattern":"Btu_60degF"}},{"Str":{"pattern":"cmHg_0degC"}},{"Str":{"pattern":"d_sidereal"}},{"Str":{"pattern":"dwt (troy)"}},{"Str":{"pattern":"fl oz (UK)"}},{"Str":{"pattern":"fl oz (US)"}},{"Str":{"pattern":"h-bar_eV_s"}},{"Str":{"pattern":"h_sidereal"}},{"Str":{"pattern":"m_e_atomic"}},{"Str":{"pattern":"pt_printer"}},{"Str":{"pattern":"rh_percent"}},{"Str":{"pattern":"s_sidereal"}},{"Str":{"pattern":"tbsp_label"}},{"Str":{"pattern":"cup_label"}},{"Str":{"pattern":"dprime_Hg"}},{"Str":{"pattern":"dprime_in"}},{"Str":{"pattern":"dr (avdp)"}},{"Str":{"pattern":"hp_boiler"}},{"Str":{"pattern":"hp_metric"}},{"Str":{"pattern":"prime_min"}},{"Str":{"pattern":"scr (ap.)"}},{"Str":{"pattern":"ton_short"}},{"Str":{"pattern":"tsp_label"}},{"Str":{"pattern":"Btu_mean"}},{"Str":{"pattern":"E_erlang"}},{"Str":{"pattern":"bbl (US)"}},{"Str":{"pattern":"cwt (UK)"}},{"Str":{"pattern":"cwt (US)"}},{"Str":{"pattern":"dprime_s"}},{"Str":{"pattern":"gal (UK)"}},{"Str":{"pattern":"gal (US)"}},{"Str":{"pattern":"hp_water"}},{"Str":{"pattern":"mil_nato"}},{"Str":{"pattern":"prime_Hg"}},{"Str":{"pattern":"prime_ft"}},{"Str":{"pattern":"statwatt"}},{"Str":{"pattern":"thm (EC)"}},{"Str":{"pattern":"thm (US)"}},{"Str":{"pattern":"ton_long"}},{"Str":{"pattern":"Lambert"}},{"Str":{"pattern":"bu (US)"}},{"Str":{"pattern":"lb_troy"}},{"Str":{"pattern":"oz_troy"}},{"Str":{"pattern":"pt (UK)"}},{"Str":{"pattern":"qt (UK)"}},{"Str":{"pattern":"statmho"}},{"Str":{"pattern":"statohm"}},{"Str":{"pattern":"ton_TNT"}},{"Str":{"pattern":"Btu_th"}},{"Str":{"pattern":"a_year"}},{"Str":{"pattern":"byte_B"}},{"Str":{"pattern":"cal_IT"}},{"Str":{"pattern":"cal_th"}},{"Str":{"pattern":"cmH_2O"}},{"Str":{"pattern":"dprime"}},{"Str":{"pattern":"ftH_2O"}},{"Str":{"pattern":"inH_2O"}},{"Str":{"pattern":"kayser"}},{"Str":{"pattern":"micron"}},{"Str":{"pattern":"mmH_2O"}},{"Str":{"pattern":"statWb"}},{"Str":{"pattern":"'_min"}},{"Str":{"pattern":"Aring"}},{"Str":{"pattern":"Darcy"}},{"Str":{"pattern":"abohm"}},{"Str":{"pattern":"barye"}},{"Str":{"pattern":"bel_B"}},{"Str":{"pattern":"dB_mW"}},{"Str":{"pattern":"darcy"}},{"Str":{"pattern":"fermi"}},{"Str":{"pattern":"fl dr"}},{"Str":{"pattern":"gamma"}},{"Str":{"pattern":"h-bar"}},{"Str":{"pattern":"hp_UK"}},{"Str":{"pattern":"lbmol"}},{"Str":{"pattern":"minim"}},{"Str":{"pattern":"prime"}},{"Str":{"pattern":"shake"}},{"Str":{"pattern":"statA"}},{"Str":{"pattern":"statF"}},{"Str":{"pattern":"statH"}},{"Str":{"pattern":"statT"}},{"Str":{"pattern":"statV"}},{"Str":{"pattern":"\"_in"}},{"Str":{"pattern":"'_ft"}},{"Str":{"pattern":"Hart"}},{"Str":{"pattern":"Torr"}},{"Str":{"pattern":"barn"}},{"Str":{"pattern":"cmHg"}},{"Str":{"pattern":"cmil"}},{"Str":{"pattern":"degC"}},{"Str":{"pattern":"degF"}},{"Str":{"pattern":"degK"}},{"Str":{"pattern":"degR"}},{"Str":{"pattern":"fath"}},{"Str":{"pattern":"ft.L"}},{"Str":{"pattern":"ft.c"}},{"Str":{"pattern":"ftHg"}},{"Str":{"pattern":"inHg"}},{"Str":{"pattern":"l.h."}},{"Str":{"pattern":"l.m."}},{"Str":{"pattern":"l.s."}},{"Str":{"pattern":"l.w."}},{"Str":{"pattern":"l.y."}},{"Str":{"pattern":"mmHg"}},{"Str":{"pattern":"slug"}},{"Str":{"pattern":"tbsp"}},{"Str":{"pattern":"thou"}},{"Str":{"pattern":"\"Hg"}},{"Str":{"pattern":"\"_s"}},{"Str":{"pattern":"'Hg"}},{"Str":{"pattern":"Btu"}},{"Str":{"pattern":"E_h"}},{"Str":{"pattern":"Gal"}},{"Str":{"pattern":"Ohm"}},{"Str":{"pattern":"a_0"}},{"Str":{"pattern":"abA"}},{"Str":{"pattern":"abC"}},{"Str":{"pattern":"abF"}},{"Str":{"pattern":"abH"}},{"Str":{"pattern":"abS"}},{"Str":{"pattern":"abV"}},{"Str":{"pattern":"atm"}},{"Str":{"pattern":"bar"}},{"Str":{"pattern":"bit"}},{"Str":{"pattern":"c_0"}},{"Str":{"pattern":"cal"}},{"Str":{"pattern":"cup"}},{"Str":{"pattern":"dBm"}},{"Str":{"pattern":"dec"}},{"Str":{"pattern":"deg"}},{"Str":{"pattern":"den"}},{"Str":{"pattern":"dyn"}},{"Str":{"pattern":"erg"}},{"Str":{"pattern":"fur"}},{"Str":{"pattern":"gon"}},{"Str":{"pattern":"gpm"}},{"Str":{"pattern":"kat"}},{"Str":{"pattern":"kip"}},{"Str":{"pattern":"lbf"}},{"Str":{"pattern":"lnk"}},{"Str":{"pattern":"m_e"}},{"Str":{"pattern":"mil"}},{"Str":{"pattern":"min"}},{"Str":{"pattern":"mol"}},{"Str":{"pattern":"mpg"}},{"Str":{"pattern":"oct"}},{"Str":{"pattern":"pdl"}},{"Str":{"pattern":"ppm"}},{"Str":{"pattern":"psi"}},{"Str":{"pattern":"rad"}},{"Str":{"pattern":"rem"}},{"Str":{"pattern":"rhe"}},{"Str":{"pattern":"tex"}},{"Str":{"pattern":"tsp"}},{"Str":{"pattern":"var"}},{"Str":{"pattern":"Bd"}},{"Str":{"pattern":"Bi"}},{"Str":{"pattern":"Bq"}},{"Str":{"pattern":"Ci"}},{"Str":{"pattern":"Da"}},{"Str":{"pattern":"Gi"}},{"Str":{"pattern":"Gs"}},{"Str":{"pattern":"Gy"}},{"Str":{"pattern":"Hz"}},{"Str":{"pattern":"Mx"}},{"Str":{"pattern":"Np"}},{"Str":{"pattern":"Oe"}},{"Str":{"pattern":"Pa"}},{"Str":{"pattern":"Sh"}},{"Str":{"pattern":"St"}},{"Str":{"pattern":"Sv"}},{"Str":{"pattern":"Wb"}},{"Str":{"pattern":"ac"}},{"Str":{"pattern":"as"}},{"Str":{"pattern":"at"}},{"Str":{"pattern":"cd"}},{"Str":{"pattern":"ch"}},{"Str":{"pattern":"ct"}},{"Str":{"pattern":"dr"}},{"Str":{"pattern":"eV"}},{"Str":{"pattern":"ft"}},{"Str":{"pattern":"gf"}},{"Str":{"pattern":"gi"}},{"Str":{"pattern":"gr"}},{"Str":{"pattern":"ha"}},{"Str":{"pattern":"hp"}},{"Str":{"pattern":"in"}},{"Str":{"pattern":"kn"}},{"Str":{"pattern":"kp"}},{"Str":{"pattern":"lb"}},{"Str":{"pattern":"lm"}},{"Str":{"pattern":"lx"}},{"Str":{"pattern":"mi"}},{"Str":{"pattern":"oz"}},{"Str":{"pattern":"pH"}},{"Str":{"pattern":"pc"}},{"Str":{"pattern":"ph"}},{"Str":{"pattern":"pk"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"rh"}},{"Str":{"pattern":"sb"}},{"Str":{"pattern":"sr"}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"ua"}},{"Str":{"pattern":"yd"}},{"Str":{"pattern":"\""}},{"Str":{"pattern":"'"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"D"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"H"}},{"Str":{"pattern":"J"}},{"Str":{"pattern":"K"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"N"}},{"Str":{"pattern":"P"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"T"}},{"Str":{"pattern":"V"}},{"Str":{"pattern":"W"}},{"Str":{"pattern":"a"}},{"Str":{"pattern":"c"}},{"Str":{"pattern":"d"}},{"Str":{"pattern":"e"}},{"Str":{"pattern":"g"}},{"Str":{"pattern":"h"}},{"Str":{"pattern":"l"}},{"Str":{"pattern":"m"}},{"Str":{"pattern":"s"}},{"Str":{"pattern":"t"}},{"Str":{"pattern":"u"}},{"Alternative":{"atoms":[90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362]}},{"Named":{"name":"unit","atom":363}},{"Entity":{"atom":400}},{"Str":{"pattern":"^"}},{"Entity":{"atom":398}},{"Entity":{"atom":381}},{"Entity":{"atom":375}},{"Str":{"pattern":"-"}},{"Repetition":{"atom":370,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":373}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":372,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[371,374]}},{"Entity":{"atom":34}},{"Entity":{"atom":375}},{"Sequence":{"atoms":[376,377]}},{"Repetition":{"atom":378,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[369,379]}},{"Named":{"name":"integer","atom":380}},{"Entity":{"atom":6}},{"Entity":{"atom":395}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":384}},{"Entity":{"atom":390}},{"Named":{"name":"int_exp","atom":383}},{"Entity":{"atom":67}},{"Sequence":{"atoms":[382,387,388]}},{"Alternative":{"atoms":[368,389]}},{"Entity":{"atom":67}},{"Named":{"name":"close_paren","atom":391}},{"Sequence":{"atoms":[385,386,392]}},{"Entity":{"atom":390}},{"Alternative":{"atoms":[393,394]}},{"Named":{"name":"int_exp","atom":383}},{"Sequence":{"atoms":[382,396,388]}},{"Alternative":{"atoms":[368,397]}},{"Named":{"name":"power_numerator","atom":367}},{"Sequence":{"atoms":[366,399]}},{"Repetition":{"atom":365,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[89,401]}},{"Entity":{"atom":85}},{"Sequence":{"atoms":[88,403]}},{"Entity":{"atom":402}},{"Entity":{"atom":415}},{"Re":{"pattern":"[\\x00-\\u{10ffff}]"}},{"Lookahead":{"atom":407,"positive":false}},{"Entity":{"atom":38}},{"Entity":{"atom":6}},{"Entity":{"atom":67}},{"Entity":{"atom":18}},{"Alternative":{"atoms":[409,410,411,412]}},{"Lookahead":{"atom":413,"positive":true}},{"Alternative":{"atoms":[408,414]}},{"Sequence":{"atoms":[405,406]}},{"Entity":{"atom":428}},{"Str":{"pattern":"Ei"}},{"Str":{"pattern":"Gi"}},{"Str":{"pattern":"Ki"}},{"Str":{"pattern":"Mi"}},{"Str":{"pattern":"Pi"}},{"Str":{"pattern":"Ti"}},{"Str":{"pattern":"Yi"}},{"Str":{"pattern":"Zi"}},{"Str":{"pattern":"da"}},{"Alternative":{"atoms":[418,419,420,421,422,423,424,425,426]}},{"Named":{"name":"prefix","atom":427}},{"Entity":{"atom":402}},{"Entity":{"atom":85}},{"Sequence":{"atoms":[417,429,430]}},{"Entity":{"atom":428}},{"Entity":{"atom":402}},{"Sequence":{"atoms":[432,433]}},{"Entity":{"atom":461}},{"Str":{"pattern":"1"}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"P"}},{"Str":{"pattern":"Q"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"T"}},{"Str":{"pattern":"Y"}},{"Str":{"pattern":"Z"}},{"Str":{"pattern":"a"}},{"Str":{"pattern":"c"}},{"Str":{"pattern":"d"}},{"Str":{"pattern":"f"}},{"Str":{"pattern":"h"}},{"Str":{"pattern":"k"}},{"Str":{"pattern":"m"}},{"Str":{"pattern":"n"}},{"Str":{"pattern":"p"}},{"Str":{"pattern":"q"}},{"Str":{"pattern":"r"}},{"Str":{"pattern":"u"}},{"Str":{"pattern":"y"}},{"Str":{"pattern":"z"}},{"Alternative":{"atoms":[436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459]}},{"Named":{"name":"prefix","atom":460}},{"Entity":{"atom":402}},{"Entity":{"atom":85}},{"Sequence":{"atoms":[435,462,463]}},{"Entity":{"atom":461}},{"Entity":{"atom":402}},{"Sequence":{"atoms":[465,466]}},{"Entity":{"atom":481}},{"Str":{"pattern":"kcal_IT"}},{"Str":{"pattern":"kcal_th"}},{"Str":{"pattern":"mbar"}},{"Str":{"pattern":"cSt"}},{"Str":{"pattern":"kgf"}},{"Str":{"pattern":"uin"}},{"Str":{"pattern":"cP"}},{"Str":{"pattern":"dB"}},{"Str":{"pattern":"kg"}},{"Str":{"pattern":"mL"}},{"Str":{"pattern":"ml"}},{"Alternative":{"atoms":[469,470,471,472,473,474,475,476,477,478,479]}},{"Named":{"name":"unit","atom":480}},{"Entity":{"atom":400}},{"Repetition":{"atom":482,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":415}},{"Sequence":{"atoms":[468,483,484]}},{"Alternative":{"atoms":[80,87,404,416,431,434,464,467,485]}},{"Entity":{"atom":18}},{"Repetition":{"atom":487,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":490,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":513}},{"Named":{"name":"sequence","atom":492}},{"Sequence":{"atoms":[78,488,489,491,493]}},{"Entity":{"atom":68}},{"Entity":{"atom":509}},{"Named":{"name":"sequence","atom":496}},{"Repetition":{"atom":497,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[495,498]}},{"Entity":{"atom":486}},{"Entity":{"atom":505}},{"Named":{"name":"sequence","atom":501}},{"Repetition":{"atom":502,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[500,503]}},{"Alternative":{"atoms":[23,50,77,494,499,504]}},{"Named":{"name":"sequence","atom":501}},{"Repetition":{"atom":506,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[500,507]}},{"Alternative":{"atoms":[23,50,77,494,499,508]}},{"Named":{"name":"sequence","atom":496}},{"Repetition":{"atom":510,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[495,511]}},{"Alternative":{"atoms":[23,50,77,494,512,508]}},{"Named":{"name":"sequence","atom":492}},{"Sequence":{"atoms":[78,488,489,491,514]}},{"Alternative":{"atoms":[23,50,77,515,512,508]}},{"Named":{"name":"sequence","atom":75}},{"Sequence":{"atoms":[51,71,72,74,517]}},{"Alternative":{"atoms":[23,50,518,515,512,508]}},{"Alternative":{"atoms":[62,69]}},{"Named":{"name":"int_exp","atom":61}},{"Entity":{"atom":18}},{"Repetition":{"atom":522,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":67}},{"Named":{"name":"close_paren","atom":524}},{"Sequence":{"atoms":[58,60,521,523,525]}},{"Named":{"name":"int_exp","atom":56}},{"Entity":{"atom":519}},{"Entity":{"atom":85}},{"Alternative":{"atoms":[528,529]}},{"Repetition":{"atom":530,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[527,531]}},{"Entity":{"atom":519}},{"Alternative":{"atoms":[532,533]}},{"Named":{"name":"int_exp","atom":55}},{"Sequence":{"atoms":[52,54,535,65,66]}},{"Sequence":{"atoms":[51,71,72,74,517]}},{"Alternative":{"atoms":[23,50,537,515,512,508]}},{"Named":{"name":"sequence","atom":48}},{"Sequence":{"atoms":[42,44,45,47,539]}},{"Alternative":{"atoms":[23,540,537,515,512,508]}},{"Named":{"name":"sequence","atom":41}},{"Sequence":{"atoms":[30,40,542]}},{"Repetition":{"atom":29,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[3,544]}},{"Alternative":{"atoms":[545,87,404,416,431,434,464,467,485]}},{"Named":{"name":"second_set","atom":28}},{"Sequence":{"atoms":[25,27,547]}},{"Entity":{"atom":536}},{"Named":{"name":"first_int_exp_set","atom":549}},{"Entity":{"atom":18}},{"Repetition":{"atom":551,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":536}},{"Named":{"name":"second_int_exp_set","atom":553}},{"Sequence":{"atoms":[550,552,554]}},{"Entity":{"atom":546}},{"Named":{"name":"first_set","atom":556}},{"Entity":{"atom":18}},{"Repetition":{"atom":558,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":536}},{"Named":{"name":"second_int_exp_set","atom":560}},{"Sequence":{"atoms":[557,559,561]}},{"Entity":{"atom":536}},{"Named":{"name":"first_int_exp_set","atom":563}},{"Entity":{"atom":18}},{"Repetition":{"atom":565,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":546}},{"Named":{"name":"second_set","atom":567}},{"Sequence":{"atoms":[564,566,568]}},{"Alternative":{"atoms":[548,555,562,569]}},{"Named":{"name":"implicit_extended","atom":24}},{"Sequence":{"atoms":[571,44,45,47,539]}},{"Alternative":{"atoms":[23,572,537,515,512,508]}},{"Named":{"name":"sequence","atom":20}},{"Repetition":{"atom":574,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,19,575]}},{"Alternative":{"atoms":[576,572,537,515,512,508]}},{"Named":{"name":"sqrt","atom":7}},{"Entity":{"atom":67}},{"Sequence":{"atoms":[4,5,578,579]}},{"Sequence":{"atoms":[3,544]}},{"Alternative":{"atoms":[581,87,404,416,431,434,464,467,485]}},{"Named":{"name":"first_set","atom":2}},{"Sequence":{"atoms":[583,27,547]}},{"Alternative":{"atoms":[584,555,562,569]}},{"Named":{"name":"implicit_extended","atom":1}},{"Sequence":{"atoms":[586,19,575]}},{"Alternative":{"atoms":[587,572,537,515,512,508]}},{"Entity":{"atom":715}},{"Entity":{"atom":712}},{"Entity":{"atom":710}},{"Str":{"pattern":"sqrt"}},{"Entity":{"atom":6}},{"Entity":{"atom":707}},{"Named":{"name":"first_set","atom":590}},{"Entity":{"atom":18}},{"Named":{"name":"extender","atom":596}},{"Entity":{"atom":704}},{"Entity":{"atom":613}},{"Entity":{"atom":610}},{"Str":{"pattern":"dim_Theta"}},{"Str":{"pattern":"dim_phi"}},{"Str":{"pattern":"dim_I"}},{"Str":{"pattern":"dim_J"}},{"Str":{"pattern":"dim_L"}},{"Str":{"pattern":"dim_M"}},{"Str":{"pattern":"dim_N"}},{"Str":{"pattern":"dim_T"}},{"Alternative":{"atoms":[601,602,603,604,605,606,607,608]}},{"Named":{"name":"dimension","atom":609}},{"Entity":{"atom":400}},{"Repetition":{"atom":611,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[600,612]}},{"Alternative":{"atoms":[591,599]}},{"Entity":{"atom":702}},{"Entity":{"atom":18}},{"Repetition":{"atom":616,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":619,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":700}},{"Named":{"name":"second_set","atom":598}},{"Entity":{"atom":697}},{"Repetition":{"atom":623,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[595,597,622,624]}},{"Entity":{"atom":628}},{"Repetition":{"atom":615,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[614,627]}},{"Named":{"name":"first_set","atom":626}},{"Entity":{"atom":18}},{"Repetition":{"atom":630,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":694}},{"Entity":{"atom":6}},{"Entity":{"atom":692}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":635}},{"Entity":{"atom":678}},{"Named":{"name":"second_int_exp_set","atom":632}},{"Entity":{"atom":675}},{"Repetition":{"atom":639,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[629,631,638,640]}},{"Entity":{"atom":649}},{"Named":{"name":"int_exp","atom":634}},{"Entity":{"atom":67}},{"Entity":{"atom":647}},{"Named":{"name":"sequence","atom":621}},{"Sequence":{"atoms":[617,618,620,646]}},{"Repetition":{"atom":645,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[633,643,644,648]}},{"Named":{"name":"first_int_exp_set","atom":642}},{"Entity":{"atom":18}},{"Repetition":{"atom":651,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":628}},{"Named":{"name":"second_set","atom":653}},{"Entity":{"atom":672}},{"Repetition":{"atom":655,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[650,652,654,656]}},{"Entity":{"atom":649}},{"Named":{"name":"first_int_exp_set","atom":658}},{"Entity":{"atom":18}},{"Repetition":{"atom":660,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":649}},{"Named":{"name":"second_int_exp_set","atom":662}},{"Entity":{"atom":669}},{"Repetition":{"atom":664,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[659,661,663,665]}},{"Entity":{"atom":649}},{"Entity":{"atom":628}},{"Alternative":{"atoms":[625,641,657,666,667,668]}},{"Repetition":{"atom":664,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[659,661,663,670]}},{"Alternative":{"atoms":[625,641,657,671,667,668]}},{"Repetition":{"atom":655,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[650,652,654,673]}},{"Alternative":{"atoms":[625,641,674,671,667,668]}},{"Repetition":{"atom":639,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[629,631,638,676]}},{"Alternative":{"atoms":[625,677,674,671,667,668]}},{"Named":{"name":"int_exp","atom":637}},{"Entity":{"atom":67}},{"Named":{"name":"close_paren","atom":680}},{"Sequence":{"atoms":[636,679,681]}},{"Named":{"name":"int_exp","atom":682}},{"Entity":{"atom":18}},{"Repetition":{"atom":684,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":678}},{"Entity":{"atom":647}},{"Alternative":{"atoms":[686,687]}},{"Named":{"name":"sequence","atom":688}},{"Sequence":{"atoms":[683,685,689]}},{"Entity":{"atom":678}},{"Alternative":{"atoms":[690,691]}},{"Named":{"name":"int_exp","atom":634}},{"Sequence":{"atoms":[633,693,644,648]}},{"Named":{"name":"second_int_exp_set","atom":632}},{"Sequence":{"atoms":[629,631,695,676]}},{"Alternative":{"atoms":[625,696,674,671,667,668]}},{"Repetition":{"atom":623,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[595,597,622,698]}},{"Alternative":{"atoms":[699,696,674,671,667,668]}},{"Named":{"name":"sequence","atom":621}},{"Sequence":{"atoms":[617,618,620,701]}},{"Repetition":{"atom":615,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[614,703]}},{"Named":{"name":"second_set","atom":598}},{"Sequence":{"atoms":[595,597,705,698]}},{"Alternative":{"atoms":[706,696,674,671,667,668]}},{"Named":{"name":"sqrt","atom":594}},{"Entity":{"atom":67}},{"Sequence":{"atoms":[592,593,708,709]}},{"Alternative":{"atoms":[591,599]}},{"Sequence":{"atoms":[711,703]}},{"Named":{"name":"first_set","atom":590}},{"Sequence":{"atoms":[713,597,705,698]}},{"Alternative":{"atoms":[714,696,674,671,667,668]}},{"Entity":{"atom":461}},{"Entity":{"atom":718}},{"Str":{"pattern":"-"}},{"Sequence":{"atoms":[716,717]}},{"Entity":{"atom":428}},{"Entity":{"atom":718}},{"Sequence":{"atoms":[720,721]}},{"Alternative":{"atoms":[0,589,719,722]}}],"root":723},"bindings":[]}},"preprocess":{},"tables":{"units":{"file":"units.yaml","rows":[{"name":"ton-force (2000 lb)"},{"name":"ton_refrigeration"},{"name":"dprime_Hg_32degF"},{"name":"dprime_Hg_60degF"},{"name":"fl oz (US label)"},{"name":"a_sidereal_year"},{"name":"a_tropical_year"},{"name":"aW (Cardelli)"},{"name":"ftH_2O_39degF"},{"name":"inH_2O_39degF"},{"name":"inH_2O_60degF"},{"name":"liq pint (US)"},{"name":"oz (US label)"},{"name":"pica_computer"},{"name":"rad_radiation"},{"name":"cmH_2O_4degC"},{"name":"ft_US_survey"},{"name":"h-bar_atomic"},{"name":"in_US_survey"},{"name":"lambda-bar_C"},{"name":"mi_US_survey"},{"name":"min_sidereal"},{"name":"pica_printer"},{"name":"yd_US_survey"},{"name":"dry pt (US)"},{"name":"dry qt (US)"},{"name":"gi_imperial"},{"name":"hp_electric"},{"name":"inHg_32degF"},{"name":"inHg_60degF"},{"name":"liq qt (US)"},{"name":"pt_computer"},{"name":"statcoulomb"},{"name":"\"Hg_32degF"},{"name":"\"Hg_60degF"},{"name":"Btu_39degF"},{"name":"Btu_59degF"},{"name":"Btu_60degF"},{"name":"cmHg_0degC"},{"name":"d_sidereal"},{"name":"dwt (troy)"},{"name":"fl oz (UK)"},{"name":"fl oz (US)"},{"name":"h-bar_eV_s"},{"name":"h_sidereal"},{"name":"m_e_atomic"},{"name":"pt_printer"},{"name":"rh_percent"},{"name":"s_sidereal"},{"name":"tbsp_label"},{"name":"cup_label"},{"name":"dprime_Hg"},{"name":"dprime_in"},{"name":"dr (avdp)"},{"name":"hp_boiler"},{"name":"hp_metric"},{"name":"prime_min"},{"name":"scr (ap.)"},{"name":"ton_short"},{"name":"tsp_label"},{"name":"Btu_mean"},{"name":"E_erlang"},{"name":"bbl (US)"},{"name":"cwt (UK)"},{"name":"cwt (US)"},{"name":"dprime_s"},{"name":"gal (UK)"},{"name":"gal (US)"},{"name":"hp_water"},{"name":"mil_nato"},{"name":"prime_Hg"},{"name":"prime_ft"},{"name":"statwatt"},{"name":"thm (EC)"},{"name":"thm (US)"},{"name":"ton_long"},{"name":"Lambert"},{"name":"bu (US)"},{"name":"lb_troy"},{"name":"oz_troy"},{"name":"pt (UK)"},{"name":"qt (UK)"},{"name":"statmho"},{"name":"statohm"},{"name":"ton_TNT"},{"name":"Btu_th"},{"name":"a_year"},{"name":"byte_B"},{"name":"cal_IT"},{"name":"cal_th"},{"name":"cmH_2O"},{"name":"dprime"},{"name":"ftH_2O"},{"name":"inH_2O"},{"name":"kayser"},{"name":"micron"},{"name":"mmH_2O"},{"name":"statWb"},{"name":"'_min"},{"name":"Aring"},{"name":"Darcy"},{"name":"abohm"},{"name":"barye"},{"name":"bel_B"},{"name":"dB_mW"},{"name":"darcy"},{"name":"fermi"},{"name":"fl dr"},{"name":"gamma"},{"name":"h-bar"},{"name":"hp_UK"},{"name":"lbmol"},{"name":"minim"},{"name":"prime"},{"name":"shake"},{"name":"statA"},{"name":"statF"},{"name":"statH"},{"name":"statT"},{"name":"statV"},{"name":"\"_in"},{"name":"'_ft"},{"name":"Hart"},{"name":"Torr"},{"name":"barn"},{"name":"cmHg"},{"name":"cmil"},{"name":"degC"},{"name":"degF"},{"name":"degK"},{"name":"degR"},{"name":"fath"},{"name":"ft.L"},{"name":"ft.c"},{"name":"ftHg"},{"name":"inHg"},{"name":"l.h."},{"name":"l.m."},{"name":"l.s."},{"name":"l.w."},{"name":"l.y."},{"name":"mmHg"},{"name":"slug"},{"name":"tbsp"},{"name":"thou"},{"name":"\"Hg"},{"name":"\"_s"},{"name":"'Hg"},{"name":"Btu"},{"name":"E_h"},{"name":"Gal"},{"name":"Ohm"},{"name":"a_0"},{"name":"abA"},{"name":"abC"},{"name":"abF"},{"name":"abH"},{"name":"abS"},{"name":"abV"},{"name":"atm"},{"name":"bar"},{"name":"bit"},{"name":"c_0"},{"name":"cal"},{"name":"cup"},{"name":"dBm"},{"name":"dec"},{"name":"deg"},{"name":"den"},{"name":"dyn"},{"name":"erg"},{"name":"fur"},{"name":"gon"},{"name":"gpm"},{"name":"kat"},{"name":"kip"},{"name":"lbf"},{"name":"lnk"},{"name":"m_e"},{"name":"mil"},{"name":"min"},{"name":"mol"},{"name":"mpg"},{"name":"oct"},{"name":"pdl"},{"name":"ppm"},{"name":"psi"},{"name":"rad"},{"name":"rem"},{"name":"rhe"},{"name":"tex"},{"name":"tsp"},{"name":"var"},{"name":"Bd"},{"name":"Bi"},{"name":"Bq"},{"name":"Ci"},{"name":"Da"},{"name":"Gi"},{"name":"Gs"},{"name":"Gy"},{"name":"Hz"},{"name":"Mx"},{"name":"Np"},{"name":"Oe"},{"name":"Pa"},{"name":"Sh"},{"name":"St"},{"name":"Sv"},{"name":"Wb"},{"name":"ac"},{"name":"as"},{"name":"at"},{"name":"cd"},{"name":"ch"},{"name":"ct"},{"name":"dr"},{"name":"eV"},{"name":"ft"},{"name":"gf"},{"name":"gi"},{"name":"gr"},{"name":"ha"},{"name":"hp"},{"name":"in"},{"name":"kn"},{"name":"kp"},{"name":"lb"},{"name":"lm"},{"name":"lx"},{"name":"mi"},{"name":"oz"},{"name":"pH"},{"name":"pc"},{"name":"ph"},{"name":"pk"},{"name":"rd"},{"name":"rh"},{"name":"sb"},{"name":"sr"},{"name":"st"},{"name":"ua"},{"name":"yd"},{"name":"\""},{"name":"'"},{"name":"A"},{"name":"C"},{"name":"D"},{"name":"F"},{"name":"G"},{"name":"H"},{"name":"J"},{"name":"K"},{"name":"L"},{"name":"M"},{"name":"N"},{"name":"P"},{"name":"R"},{"name":"S"},{"name":"T"},{"name":"V"},{"name":"W"},{"name":"a"},{"name":"c"},{"name":"d"},{"name":"e"},{"name":"g"},{"name":"h"},{"name":"l"},{"name":"m"},{"name":"s"},{"name":"t"},{"name":"u"}]},"dimensions":{"file":"dimensions.yaml","rows":[{"name":"dim_Theta"},{"name":"dim_phi"},{"name":"dim_I"},{"name":"dim_J"},{"name":"dim_L"},{"name":"dim_M"},{"name":"dim_N"},{"name":"dim_T"}]},"prefixes_double":{"file":"prefixes_double.yaml","rows":[{"name":"Ei"},{"name":"Gi"},{"name":"Ki"},{"name":"Mi"},{"name":"Pi"},{"name":"Ti"},{"name":"Yi"},{"name":"Zi"},{"name":"da"}]},"prefixes_single":{"file":"prefixes_single.yaml","rows":[{"name":"1"},{"name":"E"},{"name":"G"},{"name":"M"},{"name":"P"},{"name":"Q"},{"name":"R"},{"name":"T"},{"name":"Y"},{"name":"Z"},{"name":"a"},{"name":"c"},{"name":"d"},{"name":"f"},{"name":"h"},{"name":"k"},{"name":"m"},{"name":"n"},{"name":"p"},{"name":"q"},{"name":"r"},{"name":"u"},{"name":"y"},{"name":"z"}]},"prefixed_units":{"file":"prefixed_units.yaml","rows":[{"name":"kcal_IT"},{"name":"kcal_th"},{"name":"mbar"},{"name":"cSt"},{"name":"kgf"},{"name":"uin"},{"name":"cP"},{"name":"dB"},{"name":"kg"},{"name":"mL"},{"name":"ml"}]}},"lint":{"order_warnings":["rule forward_slashes: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule end_guard: branches 1 and 2 are order-dependent (first set not statically known)","rule slashed_number_named_int_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 2 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 2 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 6 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 6 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 6 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 7 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 7 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 8 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule wrapper_prefixes_units_value: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule named_int_exp_prefixes_units: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule implicit_extended: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule implicit_extended: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_named_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 1 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"expression","render":{},"derive":{},"tests":[{"entry":"expression","kind":"accept","input":"mm*s^-2","expect":{}},{"entry":"expression","kind":"accept","input":"sqrt(Hz)","expect":{}},{"entry":"expression","kind":"accept","input":"K/(kg*m)","expect":{}},{"entry":"expression","kind":"accept","input":"p-","expect":{}},{"entry":"expression","kind":"accept","input":"(m)(s)","expect":{}},{"entry":"expression","kind":"accept","input":"dB","expect":{}},{"entry":"expression","kind":"accept","input":"dB^2","expect":{}},{"entry":"expression","kind":"accept","input":"mbar*s^-2","expect":{}},{"entry":"expression","kind":"accept","input":"kgf","expect":{}},{"entry":"expression","kind":"accept","input":"sqrt(sqrt(m))","expect":{}},{"entry":"expression","kind":"reject","input":"que?","expect":{}},{"entry":"expression","kind":"reject","input":"m2","expect":{}},{"entry":"expression","kind":"reject","input":"dim_Ldim_M","expect":{}},{"entry":"expression","kind":"reject","input":"mm*","expect":{}},{"entry":"expression","kind":"reject","input":"m*s/","expect":{}},{"entry":"expression","kind":"reject","input":"sqrt(m)^2","expect":{}}],"docs":{},"source":"# UnitsML AsciiUnits expression grammar.\n#\n# 1:1 transcription of unitsml-ruby lib/unitsml/parse.rb +\n# lib/unitsml/intermediate_exp_rules.rb (Parslet), rule for rule, in the\n# same alternative order — PEG ordered choice makes order decisive, and the\n# quirks (trailing-extender acceptance, guard fall-through to prefixed\n# units, no power after fenced/sqrt forms) are load-bearing.\n#\n# Terminal tables are generated from UnitsDB via scripts/gen_tables.rb and\n# embedded in the artifact at compile time.\n#\n# Capture names (unit, prefix, dimension, integer, power_numerator, extender,\n# sqrt, int_exp, sequence, first_set, second_set, open_paren, close_paren)\n# mirror the Parslet .as() names so consumers can map them 1:1.\n\ngrammar UnitsmlAscii version \"0.1.0\" {\n\n ws = %x09 / %x0A / %x0B / %x0C / %x0D / %x20\n spaces = 1*ws\n lparen = \"(\"\n rparen = \")\"\n hyphen = \"-\"\n star = \"*\"\n digit = %x30-39\n forward_slashes = \"//\" / \"/\"\n extender = (forward_slashes / star) as extender\n number = [\"-\"] 1*digit\n slashed_number = (number [forward_slashes number]) as integer\n end_guard = !ANY / &(extender / lparen / rparen / spaces)\n\n unit = alt from_table \"units\" column \"name\" as unit\n prefixed_units = alt from_table \"prefixed_units\" column \"name\" as unit\n single_letter_prefixes = alt from_table \"prefixes_single\" column \"name\" as prefix\n double_letter_prefixes = alt from_table \"prefixes_double\" column \"name\" as prefix\n dimensions = alt from_table \"dimensions\" column \"name\" as dimension\n\n power = \"^\" slashed_number_int_exp as power_numerator\n slashed_number_int_exp = slashed_number / (lparen slashed_number_named_int_exp as int_exp rparen)\n slashed_number_named_int_exp = (lparen as open_paren slashed_number_int_exp rparen as close_paren) / slashed_number_int_exp\n unit_and_power = unit [power]\n sqrt_sequence = \"sqrt\" lparen prefixes_units_int_exp as sqrt rparen\n sqrt_dimensions = \"sqrt\" lparen dimension_rules_int_exp as sqrt rparen\n extended_prefixed_units = extender [spaces] prefixes_units_int_exp as sequence\n powered_dimensions = dimensions [power]\n\n prefixes_units = (sqrt_sequence [extended_prefixed_units]) / (\"1\" as unit [extended_prefixed_units]) / (unit_and_power extended_prefixed_units) / (unit_and_power end_guard) / (double_letter_prefixes unit_and_power extended_prefixed_units) / (double_letter_prefixes unit_and_power) / (single_letter_prefixes unit_and_power extended_prefixed_units) / (single_letter_prefixes unit_and_power) / (prefixed_units [power] end_guard)\n\n wrapper_prefixes_units_value = int_exp_prefixes_units / prefixes_units_int_exp\n int_exp_prefixes_units = lparen [spaces] named_int_exp_prefixes_units as int_exp [spaces] rparen\n prefixes_units_named_int_exp = (lparen as open_paren [spaces] wrapper_prefixes_units_value as int_exp [spaces] rparen as close_paren)\n named_int_exp_prefixes_units = (prefixes_units_named_int_exp as int_exp [(prefixes_units_int_exp / extended_prefixed_units)]) / prefixes_units_int_exp\n\n implicit_extended = (prefixes_units as first_set spaces as extender prefixes_units as second_set) / (int_exp_prefixes_units as first_int_exp_set [spaces] int_exp_prefixes_units as second_int_exp_set) / (prefixes_units as first_set [spaces] int_exp_prefixes_units as second_int_exp_set) / (int_exp_prefixes_units as first_int_exp_set [spaces] prefixes_units as second_set)\n\n prefixes_units_int_exp = (implicit_extended as implicit_extended [spaces] [prefixes_units_int_exp as sequence]) / (implicit_extended as implicit_extended [spaces] extender [spaces] prefixes_units_int_exp as sequence) / (int_exp_prefixes_units [spaces] extender [spaces] prefixes_units_int_exp as sequence) / (prefixes_units [spaces] extender [spaces] prefixes_units_int_exp as sequence) / (int_exp_prefixes_units [prefixes_units_int_exp as sequence]) / (prefixes_units [prefixes_units_int_exp as sequence])\n\n dimension_rules = (sqrt_dimensions / powered_dimensions) [extended_dimension_rules]\n extended_dimension_rules = [spaces] extender [spaces] dimension_rules_int_exp as sequence\n int_exp_dimension_rules = lparen dimension_rules_named_exp as int_exp rparen [extended_dimension_rules]\n dimension_rules_named_exp = ((lparen as open_paren dimension_rules_int_exp as int_exp rparen as close_paren) as int_exp [spaces] (dimension_rules_int_exp / extended_dimension_rules) as sequence) / dimension_rules_int_exp\n\n dimension_rules_int_exp = (dimension_rules as first_set spaces as extender dimension_rules as second_set [dimension_rules_int_exp]) / (dimension_rules as first_set [spaces] int_exp_dimension_rules as second_int_exp_set [dimension_rules_int_exp]) / (int_exp_dimension_rules as first_int_exp_set [spaces] dimension_rules as second_set [dimension_rules_int_exp]) / (int_exp_dimension_rules as first_int_exp_set [spaces] int_exp_dimension_rules as second_int_exp_set [dimension_rules_int_exp]) / int_exp_dimension_rules / dimension_rules\n\n expression = prefixes_units_int_exp / dimension_rules_int_exp / (single_letter_prefixes hyphen) / (double_letter_prefixes hyphen)\n\n entry expression: expression\n\n test expression {\n accept \"mm*s^-2\"\n accept \"sqrt(Hz)\"\n accept \"K/(kg*m)\"\n accept \"p-\"\n accept \"(m)(s)\"\n accept \"dB\"\n accept \"dB^2\"\n accept \"mbar*s^-2\"\n accept \"kgf\"\n accept \"sqrt(sqrt(m))\"\n reject \"que?\"\n reject \"m2\"\n reject \"dim_Ldim_M\"\n reject \"mm*\"\n reject \"m*s/\"\n reject \"sqrt(m)^2\"\n }\n}\n","source_hash":"e9d24c02137568f4bd665c3e8769b583402b1da2e8dbd10941e801fea4f6b210","compiler_version":"1.3.108","checksum":"sha256:da65d7cb155970ca2b2492dfc464ad5407d4a3b1c951c3c60a7d2177dcaa06d9"}
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"UnitsmlAscii","shape":"parsanol-tree/v2","binding_version":1,"entries":{"expression":{"root":"expression","grammar":{"atoms":[{"Entity":{"atom":591}},{"Entity":{"atom":588}},{"Entity":{"atom":585}},{"Entity":{"atom":583}},{"Str":{"pattern":"sqrt"}},{"Entity":{"atom":6}},{"Str":{"pattern":"("}},{"Entity":{"atom":580}},{"Named":{"name":"implicit_extended","atom":1}},{"Entity":{"atom":18}},{"Entity":{"atom":17}},{"Re":{"pattern":"[\\x09]"}},{"Re":{"pattern":"[\\x0a]"}},{"Re":{"pattern":"[\\x0b]"}},{"Re":{"pattern":"[\\x0c]"}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[ ]"}},{"Alternative":{"atoms":[11,12,13,14,15,16]}},{"Repetition":{"atom":10,"min":1,"max":null,"tag":"Repetition"}},{"Repetition":{"atom":9,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":576}},{"Named":{"name":"sequence","atom":20}},{"Repetition":{"atom":21,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,19,22]}},{"Entity":{"atom":573}},{"Named":{"name":"first_set","atom":2}},{"Entity":{"atom":18}},{"Named":{"name":"extender","atom":26}},{"Entity":{"atom":549}},{"Entity":{"atom":546}},{"Entity":{"atom":38}},{"Entity":{"atom":34}},{"Str":{"pattern":"//"}},{"Str":{"pattern":"/"}},{"Alternative":{"atoms":[32,33]}},{"Entity":{"atom":36}},{"Str":{"pattern":"*"}},{"Alternative":{"atoms":[31,35]}},{"Named":{"name":"extender","atom":37}},{"Entity":{"atom":18}},{"Repetition":{"atom":39,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":544}},{"Named":{"name":"implicit_extended","atom":24}},{"Entity":{"atom":18}},{"Repetition":{"atom":43,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":46,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":541}},{"Named":{"name":"sequence","atom":48}},{"Sequence":{"atoms":[42,44,45,47,49]}},{"Entity":{"atom":539}},{"Entity":{"atom":6}},{"Entity":{"atom":18}},{"Repetition":{"atom":53,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":537}},{"Entity":{"atom":529}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":57}},{"Entity":{"atom":18}},{"Repetition":{"atom":59,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":523}},{"Entity":{"atom":68}},{"Named":{"name":"int_exp","atom":55}},{"Entity":{"atom":18}},{"Repetition":{"atom":64,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":67}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[52,54,63,65,66]}},{"Entity":{"atom":522}},{"Entity":{"atom":18}},{"Repetition":{"atom":70,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":73,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":519}},{"Named":{"name":"sequence","atom":75}},{"Sequence":{"atoms":[51,71,72,74,76]}},{"Entity":{"atom":489}},{"Repetition":{"atom":29,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[3,79]}},{"Str":{"pattern":"1"}},{"Named":{"name":"unit","atom":81}},{"Entity":{"atom":85}},{"Named":{"name":"sequence","atom":41}},{"Sequence":{"atoms":[30,40,84]}},{"Repetition":{"atom":83,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[82,86]}},{"Entity":{"atom":405}},{"Entity":{"atom":364}},{"Str":{"pattern":"ton-force (2000 lb)"}},{"Str":{"pattern":"ton_refrigeration"}},{"Str":{"pattern":"dprime_Hg_32degF"}},{"Str":{"pattern":"dprime_Hg_60degF"}},{"Str":{"pattern":"fl oz (US label)"}},{"Str":{"pattern":"a_sidereal_year"}},{"Str":{"pattern":"a_tropical_year"}},{"Str":{"pattern":"aW (Cardelli)"}},{"Str":{"pattern":"ftH_2O_39degF"}},{"Str":{"pattern":"inH_2O_39degF"}},{"Str":{"pattern":"inH_2O_60degF"}},{"Str":{"pattern":"liq pint (US)"}},{"Str":{"pattern":"oz (US label)"}},{"Str":{"pattern":"pica_computer"}},{"Str":{"pattern":"rad_radiation"}},{"Str":{"pattern":"cmH_2O_4degC"}},{"Str":{"pattern":"ft_US_survey"}},{"Str":{"pattern":"h-bar_atomic"}},{"Str":{"pattern":"in_US_survey"}},{"Str":{"pattern":"lambda-bar_C"}},{"Str":{"pattern":"mi_US_survey"}},{"Str":{"pattern":"min_sidereal"}},{"Str":{"pattern":"pica_printer"}},{"Str":{"pattern":"yd_US_survey"}},{"Str":{"pattern":"dry pt (US)"}},{"Str":{"pattern":"dry qt (US)"}},{"Str":{"pattern":"gi_imperial"}},{"Str":{"pattern":"hp_electric"}},{"Str":{"pattern":"inHg_32degF"}},{"Str":{"pattern":"inHg_60degF"}},{"Str":{"pattern":"liq qt (US)"}},{"Str":{"pattern":"pt_computer"}},{"Str":{"pattern":"statcoulomb"}},{"Str":{"pattern":"\"Hg_32degF"}},{"Str":{"pattern":"\"Hg_60degF"}},{"Str":{"pattern":"Btu_39degF"}},{"Str":{"pattern":"Btu_59degF"}},{"Str":{"pattern":"Btu_60degF"}},{"Str":{"pattern":"cmHg_0degC"}},{"Str":{"pattern":"d_sidereal"}},{"Str":{"pattern":"dwt (troy)"}},{"Str":{"pattern":"fl oz (UK)"}},{"Str":{"pattern":"fl oz (US)"}},{"Str":{"pattern":"h-bar_eV_s"}},{"Str":{"pattern":"h_sidereal"}},{"Str":{"pattern":"m_e_atomic"}},{"Str":{"pattern":"pt_printer"}},{"Str":{"pattern":"rh_percent"}},{"Str":{"pattern":"s_sidereal"}},{"Str":{"pattern":"tbsp_label"}},{"Str":{"pattern":"cup_label"}},{"Str":{"pattern":"dprime_Hg"}},{"Str":{"pattern":"dprime_in"}},{"Str":{"pattern":"dr (avdp)"}},{"Str":{"pattern":"hp_boiler"}},{"Str":{"pattern":"hp_metric"}},{"Str":{"pattern":"prime_min"}},{"Str":{"pattern":"scr (ap.)"}},{"Str":{"pattern":"ton_short"}},{"Str":{"pattern":"tsp_label"}},{"Str":{"pattern":"Btu_mean"}},{"Str":{"pattern":"E_erlang"}},{"Str":{"pattern":"bbl (US)"}},{"Str":{"pattern":"cwt (UK)"}},{"Str":{"pattern":"cwt (US)"}},{"Str":{"pattern":"dprime_s"}},{"Str":{"pattern":"gal (UK)"}},{"Str":{"pattern":"gal (US)"}},{"Str":{"pattern":"hp_water"}},{"Str":{"pattern":"mil_nato"}},{"Str":{"pattern":"prime_Hg"}},{"Str":{"pattern":"prime_ft"}},{"Str":{"pattern":"statwatt"}},{"Str":{"pattern":"thm (EC)"}},{"Str":{"pattern":"thm (US)"}},{"Str":{"pattern":"ton_long"}},{"Str":{"pattern":"Lambert"}},{"Str":{"pattern":"bu (US)"}},{"Str":{"pattern":"lb_troy"}},{"Str":{"pattern":"oz_troy"}},{"Str":{"pattern":"pt (UK)"}},{"Str":{"pattern":"qt (UK)"}},{"Str":{"pattern":"statmho"}},{"Str":{"pattern":"statohm"}},{"Str":{"pattern":"ton_TNT"}},{"Str":{"pattern":"Btu_th"}},{"Str":{"pattern":"a_year"}},{"Str":{"pattern":"byte_B"}},{"Str":{"pattern":"cal_IT"}},{"Str":{"pattern":"cal_th"}},{"Str":{"pattern":"cmH_2O"}},{"Str":{"pattern":"dprime"}},{"Str":{"pattern":"ftH_2O"}},{"Str":{"pattern":"inH_2O"}},{"Str":{"pattern":"kayser"}},{"Str":{"pattern":"micron"}},{"Str":{"pattern":"mmH_2O"}},{"Str":{"pattern":"statWb"}},{"Str":{"pattern":"'_min"}},{"Str":{"pattern":"Aring"}},{"Str":{"pattern":"Darcy"}},{"Str":{"pattern":"abohm"}},{"Str":{"pattern":"barye"}},{"Str":{"pattern":"bel_B"}},{"Str":{"pattern":"dB_mW"}},{"Str":{"pattern":"darcy"}},{"Str":{"pattern":"fermi"}},{"Str":{"pattern":"fl dr"}},{"Str":{"pattern":"gamma"}},{"Str":{"pattern":"h-bar"}},{"Str":{"pattern":"hp_UK"}},{"Str":{"pattern":"lbmol"}},{"Str":{"pattern":"minim"}},{"Str":{"pattern":"prime"}},{"Str":{"pattern":"shake"}},{"Str":{"pattern":"statA"}},{"Str":{"pattern":"statF"}},{"Str":{"pattern":"statH"}},{"Str":{"pattern":"statT"}},{"Str":{"pattern":"statV"}},{"Str":{"pattern":"\"_in"}},{"Str":{"pattern":"'_ft"}},{"Str":{"pattern":"Hart"}},{"Str":{"pattern":"Torr"}},{"Str":{"pattern":"barn"}},{"Str":{"pattern":"cmHg"}},{"Str":{"pattern":"cmil"}},{"Str":{"pattern":"degC"}},{"Str":{"pattern":"degF"}},{"Str":{"pattern":"degK"}},{"Str":{"pattern":"degR"}},{"Str":{"pattern":"fath"}},{"Str":{"pattern":"ft.L"}},{"Str":{"pattern":"ft.c"}},{"Str":{"pattern":"ftHg"}},{"Str":{"pattern":"inHg"}},{"Str":{"pattern":"l.h."}},{"Str":{"pattern":"l.m."}},{"Str":{"pattern":"l.s."}},{"Str":{"pattern":"l.w."}},{"Str":{"pattern":"l.y."}},{"Str":{"pattern":"mmHg"}},{"Str":{"pattern":"slug"}},{"Str":{"pattern":"tbsp"}},{"Str":{"pattern":"thou"}},{"Str":{"pattern":"\"Hg"}},{"Str":{"pattern":"\"_s"}},{"Str":{"pattern":"'Hg"}},{"Str":{"pattern":"Btu"}},{"Str":{"pattern":"E_h"}},{"Str":{"pattern":"Gal"}},{"Str":{"pattern":"Ohm"}},{"Str":{"pattern":"a_0"}},{"Str":{"pattern":"abA"}},{"Str":{"pattern":"abC"}},{"Str":{"pattern":"abF"}},{"Str":{"pattern":"abH"}},{"Str":{"pattern":"abS"}},{"Str":{"pattern":"abV"}},{"Str":{"pattern":"atm"}},{"Str":{"pattern":"bar"}},{"Str":{"pattern":"bit"}},{"Str":{"pattern":"c_0"}},{"Str":{"pattern":"cal"}},{"Str":{"pattern":"cup"}},{"Str":{"pattern":"dBm"}},{"Str":{"pattern":"dec"}},{"Str":{"pattern":"deg"}},{"Str":{"pattern":"den"}},{"Str":{"pattern":"dyn"}},{"Str":{"pattern":"erg"}},{"Str":{"pattern":"fur"}},{"Str":{"pattern":"gon"}},{"Str":{"pattern":"gpm"}},{"Str":{"pattern":"kat"}},{"Str":{"pattern":"kip"}},{"Str":{"pattern":"lbf"}},{"Str":{"pattern":"lnk"}},{"Str":{"pattern":"m_e"}},{"Str":{"pattern":"mil"}},{"Str":{"pattern":"min"}},{"Str":{"pattern":"mol"}},{"Str":{"pattern":"mpg"}},{"Str":{"pattern":"oct"}},{"Str":{"pattern":"pdl"}},{"Str":{"pattern":"ppm"}},{"Str":{"pattern":"psi"}},{"Str":{"pattern":"rad"}},{"Str":{"pattern":"rem"}},{"Str":{"pattern":"rhe"}},{"Str":{"pattern":"tex"}},{"Str":{"pattern":"tsp"}},{"Str":{"pattern":"var"}},{"Str":{"pattern":"Bd"}},{"Str":{"pattern":"Bi"}},{"Str":{"pattern":"Bq"}},{"Str":{"pattern":"Ci"}},{"Str":{"pattern":"Da"}},{"Str":{"pattern":"Gi"}},{"Str":{"pattern":"Gs"}},{"Str":{"pattern":"Gy"}},{"Str":{"pattern":"Hz"}},{"Str":{"pattern":"Mx"}},{"Str":{"pattern":"Np"}},{"Str":{"pattern":"Oe"}},{"Str":{"pattern":"Pa"}},{"Str":{"pattern":"Sh"}},{"Str":{"pattern":"St"}},{"Str":{"pattern":"Sv"}},{"Str":{"pattern":"Wb"}},{"Str":{"pattern":"ac"}},{"Str":{"pattern":"as"}},{"Str":{"pattern":"at"}},{"Str":{"pattern":"cd"}},{"Str":{"pattern":"ch"}},{"Str":{"pattern":"ct"}},{"Str":{"pattern":"dr"}},{"Str":{"pattern":"eV"}},{"Str":{"pattern":"ft"}},{"Str":{"pattern":"gf"}},{"Str":{"pattern":"gi"}},{"Str":{"pattern":"gr"}},{"Str":{"pattern":"ha"}},{"Str":{"pattern":"hp"}},{"Str":{"pattern":"in"}},{"Str":{"pattern":"kn"}},{"Str":{"pattern":"kp"}},{"Str":{"pattern":"lb"}},{"Str":{"pattern":"lm"}},{"Str":{"pattern":"lx"}},{"Str":{"pattern":"mi"}},{"Str":{"pattern":"oz"}},{"Str":{"pattern":"pH"}},{"Str":{"pattern":"pc"}},{"Str":{"pattern":"ph"}},{"Str":{"pattern":"pk"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"rh"}},{"Str":{"pattern":"sb"}},{"Str":{"pattern":"sr"}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"ua"}},{"Str":{"pattern":"yd"}},{"Str":{"pattern":"\""}},{"Str":{"pattern":"'"}},{"Str":{"pattern":"A"}},{"Str":{"pattern":"C"}},{"Str":{"pattern":"D"}},{"Str":{"pattern":"F"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"H"}},{"Str":{"pattern":"J"}},{"Str":{"pattern":"K"}},{"Str":{"pattern":"L"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"N"}},{"Str":{"pattern":"P"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"S"}},{"Str":{"pattern":"T"}},{"Str":{"pattern":"V"}},{"Str":{"pattern":"W"}},{"Str":{"pattern":"a"}},{"Str":{"pattern":"c"}},{"Str":{"pattern":"d"}},{"Str":{"pattern":"e"}},{"Str":{"pattern":"g"}},{"Str":{"pattern":"h"}},{"Str":{"pattern":"l"}},{"Str":{"pattern":"m"}},{"Str":{"pattern":"s"}},{"Str":{"pattern":"t"}},{"Str":{"pattern":"u"}},{"Alternative":{"atoms":[90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362]}},{"Named":{"name":"unit","atom":363}},{"Entity":{"atom":403}},{"Str":{"pattern":"^"}},{"Entity":{"atom":401}},{"Entity":{"atom":384}},{"Str":{"pattern":"-"}},{"Repetition":{"atom":369,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":372}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":371,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[370,373]}},{"Entity":{"atom":34}},{"Str":{"pattern":"-"}},{"Repetition":{"atom":376,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":372}},{"Repetition":{"atom":378,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[377,379]}},{"Sequence":{"atoms":[375,380]}},{"Repetition":{"atom":381,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[374,382]}},{"Named":{"name":"integer","atom":383}},{"Entity":{"atom":6}},{"Entity":{"atom":398}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":387}},{"Entity":{"atom":393}},{"Named":{"name":"int_exp","atom":386}},{"Entity":{"atom":67}},{"Sequence":{"atoms":[385,390,391]}},{"Alternative":{"atoms":[368,392]}},{"Entity":{"atom":67}},{"Named":{"name":"close_paren","atom":394}},{"Sequence":{"atoms":[388,389,395]}},{"Entity":{"atom":393}},{"Alternative":{"atoms":[396,397]}},{"Named":{"name":"int_exp","atom":386}},{"Sequence":{"atoms":[385,399,391]}},{"Alternative":{"atoms":[368,400]}},{"Named":{"name":"power_numerator","atom":367}},{"Sequence":{"atoms":[366,402]}},{"Repetition":{"atom":365,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[89,404]}},{"Entity":{"atom":85}},{"Sequence":{"atoms":[88,406]}},{"Entity":{"atom":405}},{"Entity":{"atom":418}},{"Re":{"pattern":"[\\x00-\\u{10ffff}]"}},{"Lookahead":{"atom":410,"positive":false}},{"Entity":{"atom":38}},{"Entity":{"atom":6}},{"Entity":{"atom":67}},{"Entity":{"atom":18}},{"Alternative":{"atoms":[412,413,414,415]}},{"Lookahead":{"atom":416,"positive":true}},{"Alternative":{"atoms":[411,417]}},{"Sequence":{"atoms":[408,409]}},{"Entity":{"atom":431}},{"Str":{"pattern":"Ei"}},{"Str":{"pattern":"Gi"}},{"Str":{"pattern":"Ki"}},{"Str":{"pattern":"Mi"}},{"Str":{"pattern":"Pi"}},{"Str":{"pattern":"Ti"}},{"Str":{"pattern":"Yi"}},{"Str":{"pattern":"Zi"}},{"Str":{"pattern":"da"}},{"Alternative":{"atoms":[421,422,423,424,425,426,427,428,429]}},{"Named":{"name":"prefix","atom":430}},{"Entity":{"atom":405}},{"Entity":{"atom":85}},{"Sequence":{"atoms":[420,432,433]}},{"Entity":{"atom":431}},{"Entity":{"atom":405}},{"Sequence":{"atoms":[435,436]}},{"Entity":{"atom":464}},{"Str":{"pattern":"1"}},{"Str":{"pattern":"E"}},{"Str":{"pattern":"G"}},{"Str":{"pattern":"M"}},{"Str":{"pattern":"P"}},{"Str":{"pattern":"Q"}},{"Str":{"pattern":"R"}},{"Str":{"pattern":"T"}},{"Str":{"pattern":"Y"}},{"Str":{"pattern":"Z"}},{"Str":{"pattern":"a"}},{"Str":{"pattern":"c"}},{"Str":{"pattern":"d"}},{"Str":{"pattern":"f"}},{"Str":{"pattern":"h"}},{"Str":{"pattern":"k"}},{"Str":{"pattern":"m"}},{"Str":{"pattern":"n"}},{"Str":{"pattern":"p"}},{"Str":{"pattern":"q"}},{"Str":{"pattern":"r"}},{"Str":{"pattern":"u"}},{"Str":{"pattern":"y"}},{"Str":{"pattern":"z"}},{"Alternative":{"atoms":[439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462]}},{"Named":{"name":"prefix","atom":463}},{"Entity":{"atom":405}},{"Entity":{"atom":85}},{"Sequence":{"atoms":[438,465,466]}},{"Entity":{"atom":464}},{"Entity":{"atom":405}},{"Sequence":{"atoms":[468,469]}},{"Entity":{"atom":484}},{"Str":{"pattern":"kcal_IT"}},{"Str":{"pattern":"kcal_th"}},{"Str":{"pattern":"mbar"}},{"Str":{"pattern":"cSt"}},{"Str":{"pattern":"kgf"}},{"Str":{"pattern":"uin"}},{"Str":{"pattern":"cP"}},{"Str":{"pattern":"dB"}},{"Str":{"pattern":"kg"}},{"Str":{"pattern":"mL"}},{"Str":{"pattern":"ml"}},{"Alternative":{"atoms":[472,473,474,475,476,477,478,479,480,481,482]}},{"Named":{"name":"unit","atom":483}},{"Entity":{"atom":403}},{"Repetition":{"atom":485,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":418}},{"Sequence":{"atoms":[471,486,487]}},{"Alternative":{"atoms":[80,87,407,419,434,437,467,470,488]}},{"Entity":{"atom":18}},{"Repetition":{"atom":490,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":493,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":516}},{"Named":{"name":"sequence","atom":495}},{"Sequence":{"atoms":[78,491,492,494,496]}},{"Entity":{"atom":68}},{"Entity":{"atom":512}},{"Named":{"name":"sequence","atom":499}},{"Repetition":{"atom":500,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[498,501]}},{"Entity":{"atom":489}},{"Entity":{"atom":508}},{"Named":{"name":"sequence","atom":504}},{"Repetition":{"atom":505,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[503,506]}},{"Alternative":{"atoms":[23,50,77,497,502,507]}},{"Named":{"name":"sequence","atom":504}},{"Repetition":{"atom":509,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[503,510]}},{"Alternative":{"atoms":[23,50,77,497,502,511]}},{"Named":{"name":"sequence","atom":499}},{"Repetition":{"atom":513,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[498,514]}},{"Alternative":{"atoms":[23,50,77,497,515,511]}},{"Named":{"name":"sequence","atom":495}},{"Sequence":{"atoms":[78,491,492,494,517]}},{"Alternative":{"atoms":[23,50,77,518,515,511]}},{"Named":{"name":"sequence","atom":75}},{"Sequence":{"atoms":[51,71,72,74,520]}},{"Alternative":{"atoms":[23,50,521,518,515,511]}},{"Alternative":{"atoms":[62,69]}},{"Named":{"name":"int_exp","atom":61}},{"Entity":{"atom":18}},{"Repetition":{"atom":525,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":67}},{"Named":{"name":"close_paren","atom":527}},{"Sequence":{"atoms":[58,60,524,526,528]}},{"Named":{"name":"int_exp","atom":56}},{"Entity":{"atom":522}},{"Entity":{"atom":85}},{"Alternative":{"atoms":[531,532]}},{"Repetition":{"atom":533,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[530,534]}},{"Entity":{"atom":522}},{"Alternative":{"atoms":[535,536]}},{"Named":{"name":"int_exp","atom":55}},{"Sequence":{"atoms":[52,54,538,65,66]}},{"Sequence":{"atoms":[51,71,72,74,520]}},{"Alternative":{"atoms":[23,50,540,518,515,511]}},{"Named":{"name":"sequence","atom":48}},{"Sequence":{"atoms":[42,44,45,47,542]}},{"Alternative":{"atoms":[23,543,540,518,515,511]}},{"Named":{"name":"sequence","atom":41}},{"Sequence":{"atoms":[30,40,545]}},{"Repetition":{"atom":29,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[3,547]}},{"Alternative":{"atoms":[548,87,407,419,434,437,467,470,488]}},{"Named":{"name":"second_set","atom":28}},{"Sequence":{"atoms":[25,27,550]}},{"Entity":{"atom":539}},{"Named":{"name":"first_int_exp_set","atom":552}},{"Entity":{"atom":18}},{"Repetition":{"atom":554,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":539}},{"Named":{"name":"second_int_exp_set","atom":556}},{"Sequence":{"atoms":[553,555,557]}},{"Entity":{"atom":549}},{"Named":{"name":"first_set","atom":559}},{"Entity":{"atom":18}},{"Repetition":{"atom":561,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":539}},{"Named":{"name":"second_int_exp_set","atom":563}},{"Sequence":{"atoms":[560,562,564]}},{"Entity":{"atom":539}},{"Named":{"name":"first_int_exp_set","atom":566}},{"Entity":{"atom":18}},{"Repetition":{"atom":568,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":549}},{"Named":{"name":"second_set","atom":570}},{"Sequence":{"atoms":[567,569,571]}},{"Alternative":{"atoms":[551,558,565,572]}},{"Named":{"name":"implicit_extended","atom":24}},{"Sequence":{"atoms":[574,44,45,47,542]}},{"Alternative":{"atoms":[23,575,540,518,515,511]}},{"Named":{"name":"sequence","atom":20}},{"Repetition":{"atom":577,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,19,578]}},{"Alternative":{"atoms":[579,575,540,518,515,511]}},{"Named":{"name":"sqrt","atom":7}},{"Entity":{"atom":67}},{"Sequence":{"atoms":[4,5,581,582]}},{"Sequence":{"atoms":[3,547]}},{"Alternative":{"atoms":[584,87,407,419,434,437,467,470,488]}},{"Named":{"name":"first_set","atom":2}},{"Sequence":{"atoms":[586,27,550]}},{"Alternative":{"atoms":[587,558,565,572]}},{"Named":{"name":"implicit_extended","atom":1}},{"Sequence":{"atoms":[589,19,578]}},{"Alternative":{"atoms":[590,575,540,518,515,511]}},{"Entity":{"atom":718}},{"Entity":{"atom":715}},{"Entity":{"atom":713}},{"Str":{"pattern":"sqrt"}},{"Entity":{"atom":6}},{"Entity":{"atom":710}},{"Named":{"name":"first_set","atom":593}},{"Entity":{"atom":18}},{"Named":{"name":"extender","atom":599}},{"Entity":{"atom":707}},{"Entity":{"atom":616}},{"Entity":{"atom":613}},{"Str":{"pattern":"dim_Theta"}},{"Str":{"pattern":"dim_phi"}},{"Str":{"pattern":"dim_I"}},{"Str":{"pattern":"dim_J"}},{"Str":{"pattern":"dim_L"}},{"Str":{"pattern":"dim_M"}},{"Str":{"pattern":"dim_N"}},{"Str":{"pattern":"dim_T"}},{"Alternative":{"atoms":[604,605,606,607,608,609,610,611]}},{"Named":{"name":"dimension","atom":612}},{"Entity":{"atom":403}},{"Repetition":{"atom":614,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[603,615]}},{"Alternative":{"atoms":[594,602]}},{"Entity":{"atom":705}},{"Entity":{"atom":18}},{"Repetition":{"atom":619,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":622,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":703}},{"Named":{"name":"second_set","atom":601}},{"Entity":{"atom":700}},{"Repetition":{"atom":626,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[598,600,625,627]}},{"Entity":{"atom":631}},{"Repetition":{"atom":618,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[617,630]}},{"Named":{"name":"first_set","atom":629}},{"Entity":{"atom":18}},{"Repetition":{"atom":633,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":697}},{"Entity":{"atom":6}},{"Entity":{"atom":695}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":638}},{"Entity":{"atom":681}},{"Named":{"name":"second_int_exp_set","atom":635}},{"Entity":{"atom":678}},{"Repetition":{"atom":642,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[632,634,641,643]}},{"Entity":{"atom":652}},{"Named":{"name":"int_exp","atom":637}},{"Entity":{"atom":67}},{"Entity":{"atom":650}},{"Named":{"name":"sequence","atom":624}},{"Sequence":{"atoms":[620,621,623,649]}},{"Repetition":{"atom":648,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[636,646,647,651]}},{"Named":{"name":"first_int_exp_set","atom":645}},{"Entity":{"atom":18}},{"Repetition":{"atom":654,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":631}},{"Named":{"name":"second_set","atom":656}},{"Entity":{"atom":675}},{"Repetition":{"atom":658,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[653,655,657,659]}},{"Entity":{"atom":652}},{"Named":{"name":"first_int_exp_set","atom":661}},{"Entity":{"atom":18}},{"Repetition":{"atom":663,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":652}},{"Named":{"name":"second_int_exp_set","atom":665}},{"Entity":{"atom":672}},{"Repetition":{"atom":667,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[662,664,666,668]}},{"Entity":{"atom":652}},{"Entity":{"atom":631}},{"Alternative":{"atoms":[628,644,660,669,670,671]}},{"Repetition":{"atom":667,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[662,664,666,673]}},{"Alternative":{"atoms":[628,644,660,674,670,671]}},{"Repetition":{"atom":658,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[653,655,657,676]}},{"Alternative":{"atoms":[628,644,677,674,670,671]}},{"Repetition":{"atom":642,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[632,634,641,679]}},{"Alternative":{"atoms":[628,680,677,674,670,671]}},{"Named":{"name":"int_exp","atom":640}},{"Entity":{"atom":67}},{"Named":{"name":"close_paren","atom":683}},{"Sequence":{"atoms":[639,682,684]}},{"Named":{"name":"int_exp","atom":685}},{"Entity":{"atom":18}},{"Repetition":{"atom":687,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":681}},{"Entity":{"atom":650}},{"Alternative":{"atoms":[689,690]}},{"Named":{"name":"sequence","atom":691}},{"Sequence":{"atoms":[686,688,692]}},{"Entity":{"atom":681}},{"Alternative":{"atoms":[693,694]}},{"Named":{"name":"int_exp","atom":637}},{"Sequence":{"atoms":[636,696,647,651]}},{"Named":{"name":"second_int_exp_set","atom":635}},{"Sequence":{"atoms":[632,634,698,679]}},{"Alternative":{"atoms":[628,699,677,674,670,671]}},{"Repetition":{"atom":626,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[598,600,625,701]}},{"Alternative":{"atoms":[702,699,677,674,670,671]}},{"Named":{"name":"sequence","atom":624}},{"Sequence":{"atoms":[620,621,623,704]}},{"Repetition":{"atom":618,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[617,706]}},{"Named":{"name":"second_set","atom":601}},{"Sequence":{"atoms":[598,600,708,701]}},{"Alternative":{"atoms":[709,699,677,674,670,671]}},{"Named":{"name":"sqrt","atom":597}},{"Entity":{"atom":67}},{"Sequence":{"atoms":[595,596,711,712]}},{"Alternative":{"atoms":[594,602]}},{"Sequence":{"atoms":[714,706]}},{"Named":{"name":"first_set","atom":593}},{"Sequence":{"atoms":[716,600,708,701]}},{"Alternative":{"atoms":[717,699,677,674,670,671]}},{"Entity":{"atom":464}},{"Entity":{"atom":721}},{"Str":{"pattern":"-"}},{"Named":{"name":"hyphen","atom":720}},{"Sequence":{"atoms":[719,722]}},{"Entity":{"atom":431}},{"Entity":{"atom":721}},{"Named":{"name":"hyphen","atom":725}},{"Sequence":{"atoms":[724,726]}},{"Alternative":{"atoms":[0,592,723,727]}}],"root":728},"bindings":[]}},"preprocess":{},"tables":{"units":{"file":"units.yaml","rows":[{"name":"ton-force (2000 lb)"},{"name":"ton_refrigeration"},{"name":"dprime_Hg_32degF"},{"name":"dprime_Hg_60degF"},{"name":"fl oz (US label)"},{"name":"a_sidereal_year"},{"name":"a_tropical_year"},{"name":"aW (Cardelli)"},{"name":"ftH_2O_39degF"},{"name":"inH_2O_39degF"},{"name":"inH_2O_60degF"},{"name":"liq pint (US)"},{"name":"oz (US label)"},{"name":"pica_computer"},{"name":"rad_radiation"},{"name":"cmH_2O_4degC"},{"name":"ft_US_survey"},{"name":"h-bar_atomic"},{"name":"in_US_survey"},{"name":"lambda-bar_C"},{"name":"mi_US_survey"},{"name":"min_sidereal"},{"name":"pica_printer"},{"name":"yd_US_survey"},{"name":"dry pt (US)"},{"name":"dry qt (US)"},{"name":"gi_imperial"},{"name":"hp_electric"},{"name":"inHg_32degF"},{"name":"inHg_60degF"},{"name":"liq qt (US)"},{"name":"pt_computer"},{"name":"statcoulomb"},{"name":"\"Hg_32degF"},{"name":"\"Hg_60degF"},{"name":"Btu_39degF"},{"name":"Btu_59degF"},{"name":"Btu_60degF"},{"name":"cmHg_0degC"},{"name":"d_sidereal"},{"name":"dwt (troy)"},{"name":"fl oz (UK)"},{"name":"fl oz (US)"},{"name":"h-bar_eV_s"},{"name":"h_sidereal"},{"name":"m_e_atomic"},{"name":"pt_printer"},{"name":"rh_percent"},{"name":"s_sidereal"},{"name":"tbsp_label"},{"name":"cup_label"},{"name":"dprime_Hg"},{"name":"dprime_in"},{"name":"dr (avdp)"},{"name":"hp_boiler"},{"name":"hp_metric"},{"name":"prime_min"},{"name":"scr (ap.)"},{"name":"ton_short"},{"name":"tsp_label"},{"name":"Btu_mean"},{"name":"E_erlang"},{"name":"bbl (US)"},{"name":"cwt (UK)"},{"name":"cwt (US)"},{"name":"dprime_s"},{"name":"gal (UK)"},{"name":"gal (US)"},{"name":"hp_water"},{"name":"mil_nato"},{"name":"prime_Hg"},{"name":"prime_ft"},{"name":"statwatt"},{"name":"thm (EC)"},{"name":"thm (US)"},{"name":"ton_long"},{"name":"Lambert"},{"name":"bu (US)"},{"name":"lb_troy"},{"name":"oz_troy"},{"name":"pt (UK)"},{"name":"qt (UK)"},{"name":"statmho"},{"name":"statohm"},{"name":"ton_TNT"},{"name":"Btu_th"},{"name":"a_year"},{"name":"byte_B"},{"name":"cal_IT"},{"name":"cal_th"},{"name":"cmH_2O"},{"name":"dprime"},{"name":"ftH_2O"},{"name":"inH_2O"},{"name":"kayser"},{"name":"micron"},{"name":"mmH_2O"},{"name":"statWb"},{"name":"'_min"},{"name":"Aring"},{"name":"Darcy"},{"name":"abohm"},{"name":"barye"},{"name":"bel_B"},{"name":"dB_mW"},{"name":"darcy"},{"name":"fermi"},{"name":"fl dr"},{"name":"gamma"},{"name":"h-bar"},{"name":"hp_UK"},{"name":"lbmol"},{"name":"minim"},{"name":"prime"},{"name":"shake"},{"name":"statA"},{"name":"statF"},{"name":"statH"},{"name":"statT"},{"name":"statV"},{"name":"\"_in"},{"name":"'_ft"},{"name":"Hart"},{"name":"Torr"},{"name":"barn"},{"name":"cmHg"},{"name":"cmil"},{"name":"degC"},{"name":"degF"},{"name":"degK"},{"name":"degR"},{"name":"fath"},{"name":"ft.L"},{"name":"ft.c"},{"name":"ftHg"},{"name":"inHg"},{"name":"l.h."},{"name":"l.m."},{"name":"l.s."},{"name":"l.w."},{"name":"l.y."},{"name":"mmHg"},{"name":"slug"},{"name":"tbsp"},{"name":"thou"},{"name":"\"Hg"},{"name":"\"_s"},{"name":"'Hg"},{"name":"Btu"},{"name":"E_h"},{"name":"Gal"},{"name":"Ohm"},{"name":"a_0"},{"name":"abA"},{"name":"abC"},{"name":"abF"},{"name":"abH"},{"name":"abS"},{"name":"abV"},{"name":"atm"},{"name":"bar"},{"name":"bit"},{"name":"c_0"},{"name":"cal"},{"name":"cup"},{"name":"dBm"},{"name":"dec"},{"name":"deg"},{"name":"den"},{"name":"dyn"},{"name":"erg"},{"name":"fur"},{"name":"gon"},{"name":"gpm"},{"name":"kat"},{"name":"kip"},{"name":"lbf"},{"name":"lnk"},{"name":"m_e"},{"name":"mil"},{"name":"min"},{"name":"mol"},{"name":"mpg"},{"name":"oct"},{"name":"pdl"},{"name":"ppm"},{"name":"psi"},{"name":"rad"},{"name":"rem"},{"name":"rhe"},{"name":"tex"},{"name":"tsp"},{"name":"var"},{"name":"Bd"},{"name":"Bi"},{"name":"Bq"},{"name":"Ci"},{"name":"Da"},{"name":"Gi"},{"name":"Gs"},{"name":"Gy"},{"name":"Hz"},{"name":"Mx"},{"name":"Np"},{"name":"Oe"},{"name":"Pa"},{"name":"Sh"},{"name":"St"},{"name":"Sv"},{"name":"Wb"},{"name":"ac"},{"name":"as"},{"name":"at"},{"name":"cd"},{"name":"ch"},{"name":"ct"},{"name":"dr"},{"name":"eV"},{"name":"ft"},{"name":"gf"},{"name":"gi"},{"name":"gr"},{"name":"ha"},{"name":"hp"},{"name":"in"},{"name":"kn"},{"name":"kp"},{"name":"lb"},{"name":"lm"},{"name":"lx"},{"name":"mi"},{"name":"oz"},{"name":"pH"},{"name":"pc"},{"name":"ph"},{"name":"pk"},{"name":"rd"},{"name":"rh"},{"name":"sb"},{"name":"sr"},{"name":"st"},{"name":"ua"},{"name":"yd"},{"name":"\""},{"name":"'"},{"name":"A"},{"name":"C"},{"name":"D"},{"name":"F"},{"name":"G"},{"name":"H"},{"name":"J"},{"name":"K"},{"name":"L"},{"name":"M"},{"name":"N"},{"name":"P"},{"name":"R"},{"name":"S"},{"name":"T"},{"name":"V"},{"name":"W"},{"name":"a"},{"name":"c"},{"name":"d"},{"name":"e"},{"name":"g"},{"name":"h"},{"name":"l"},{"name":"m"},{"name":"s"},{"name":"t"},{"name":"u"}]},"dimensions":{"file":"dimensions.yaml","rows":[{"name":"dim_Theta"},{"name":"dim_phi"},{"name":"dim_I"},{"name":"dim_J"},{"name":"dim_L"},{"name":"dim_M"},{"name":"dim_N"},{"name":"dim_T"}]},"prefixes_double":{"file":"prefixes_double.yaml","rows":[{"name":"Ei"},{"name":"Gi"},{"name":"Ki"},{"name":"Mi"},{"name":"Pi"},{"name":"Ti"},{"name":"Yi"},{"name":"Zi"},{"name":"da"}]},"prefixes_single":{"file":"prefixes_single.yaml","rows":[{"name":"1"},{"name":"E"},{"name":"G"},{"name":"M"},{"name":"P"},{"name":"Q"},{"name":"R"},{"name":"T"},{"name":"Y"},{"name":"Z"},{"name":"a"},{"name":"c"},{"name":"d"},{"name":"f"},{"name":"h"},{"name":"k"},{"name":"m"},{"name":"n"},{"name":"p"},{"name":"q"},{"name":"r"},{"name":"u"},{"name":"y"},{"name":"z"}]},"prefixed_units":{"file":"prefixed_units.yaml","rows":[{"name":"kcal_IT"},{"name":"kcal_th"},{"name":"mbar"},{"name":"cSt"},{"name":"kgf"},{"name":"uin"},{"name":"cP"},{"name":"dB"},{"name":"kg"},{"name":"mL"},{"name":"ml"}]}},"lint":{"order_warnings":["rule forward_slashes: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule end_guard: branches 1 and 2 are order-dependent (first set not statically known)","rule slashed_number_named_int_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 2 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 2 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 3 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 4 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 5 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 6 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 6 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 6 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 7 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 7 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units: branches 8 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule wrapper_prefixes_units_value: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule named_int_exp_prefixes_units: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule implicit_extended: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule implicit_extended: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 1 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule prefixes_units_int_exp: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_named_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 1 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule dimension_rules_int_exp: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule expression: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"expression","render":{},"derive":{},"tests":[{"entry":"expression","kind":"accept","input":"mm*s^-2","expect":{}},{"entry":"expression","kind":"accept","input":"sqrt(Hz)","expect":{}},{"entry":"expression","kind":"accept","input":"K/(kg*m)","expect":{}},{"entry":"expression","kind":"accept","input":"p-","expect":{}},{"entry":"expression","kind":"accept","input":"(m)(s)","expect":{}},{"entry":"expression","kind":"accept","input":"dB","expect":{}},{"entry":"expression","kind":"accept","input":"dB^2","expect":{}},{"entry":"expression","kind":"accept","input":"mbar*s^-2","expect":{}},{"entry":"expression","kind":"accept","input":"kgf","expect":{}},{"entry":"expression","kind":"accept","input":"sqrt(sqrt(m))","expect":{}},{"entry":"expression","kind":"reject","input":"que?","expect":{}},{"entry":"expression","kind":"reject","input":"m2","expect":{}},{"entry":"expression","kind":"reject","input":"dim_Ldim_M","expect":{}},{"entry":"expression","kind":"reject","input":"mm*","expect":{}},{"entry":"expression","kind":"reject","input":"m*s/","expect":{}},{"entry":"expression","kind":"reject","input":"sqrt(m)^2","expect":{}}],"docs":{},"source":"# UnitsML AsciiUnits expression grammar.\n#\n# 1:1 transcription of unitsml-ruby lib/unitsml/parse.rb +\n# lib/unitsml/intermediate_exp_rules.rb (Parslet), rule for rule, in the\n# same alternative order — PEG ordered choice makes order decisive, and the\n# quirks (trailing-extender acceptance, guard fall-through to prefixed\n# units, no power after fenced/sqrt forms) are load-bearing.\n#\n# Terminal tables are generated from UnitsDB via scripts/gen_tables.rb and\n# embedded in the artifact at compile time.\n#\n# Capture names (unit, prefix, dimension, integer, power_numerator, extender,\n# sqrt, int_exp, sequence, first_set, second_set, open_paren, close_paren)\n# mirror the Parslet .as() names so consumers can map them 1:1.\n\ngrammar UnitsmlAscii version \"0.1.0\" edition 2 {\n\n ws = %x09 / %x0A / %x0B / %x0C / %x0D / %x20\n spaces = 1*ws\n lparen = \"(\"\n rparen = \")\"\n hyphen = \"-\"\n star = \"*\"\n digit = %x30-39\n forward_slashes = \"//\" / \"/\"\n extender = (forward_slashes / star) as extender\n # The signed run is one authored capture: edition 2 drops anonymous\n # literals from the tree, so the \"-\" sign would vanish and the digits\n # would name per-iteration — the capture keeps the exact v1 slice\n # (value \"-2\", \"1/2\", offset..length) the tree readers scalarize.\n slashed_number = (([\"-\"] 1*digit) [forward_slashes ([\"-\"] 1*digit)]) as integer\n end_guard = !ANY / &(extender / lparen / rparen / spaces)\n\n unit = alt from_table \"units\" column \"name\" as unit\n prefixed_units = alt from_table \"prefixed_units\" column \"name\" as unit\n single_letter_prefixes = alt from_table \"prefixes_single\" column \"name\" as prefix\n double_letter_prefixes = alt from_table \"prefixes_double\" column \"name\" as prefix\n dimensions = alt from_table \"dimensions\" column \"name\" as dimension\n\n power = \"^\" slashed_number_int_exp as power_numerator\n slashed_number_int_exp = slashed_number / (lparen slashed_number_named_int_exp as int_exp rparen)\n slashed_number_named_int_exp = (lparen as open_paren slashed_number_int_exp rparen as close_paren) / slashed_number_int_exp\n unit_and_power = unit [power]\n sqrt_sequence = \"sqrt\" lparen prefixes_units_int_exp as sqrt rparen\n sqrt_dimensions = \"sqrt\" lparen dimension_rules_int_exp as sqrt rparen\n extended_prefixed_units = extender [spaces] prefixes_units_int_exp as sequence\n powered_dimensions = dimensions [power]\n\n prefixes_units = (sqrt_sequence [extended_prefixed_units]) / (\"1\" as unit [extended_prefixed_units]) / (unit_and_power extended_prefixed_units) / (unit_and_power end_guard) / (double_letter_prefixes unit_and_power extended_prefixed_units) / (double_letter_prefixes unit_and_power) / (single_letter_prefixes unit_and_power extended_prefixed_units) / (single_letter_prefixes unit_and_power) / (prefixed_units [power] end_guard)\n\n wrapper_prefixes_units_value = int_exp_prefixes_units / prefixes_units_int_exp\n int_exp_prefixes_units = lparen [spaces] named_int_exp_prefixes_units as int_exp [spaces] rparen\n prefixes_units_named_int_exp = (lparen as open_paren [spaces] wrapper_prefixes_units_value as int_exp [spaces] rparen as close_paren)\n named_int_exp_prefixes_units = (prefixes_units_named_int_exp as int_exp [(prefixes_units_int_exp / extended_prefixed_units)]) / prefixes_units_int_exp\n\n implicit_extended = (prefixes_units as first_set spaces as extender prefixes_units as second_set) / (int_exp_prefixes_units as first_int_exp_set [spaces] int_exp_prefixes_units as second_int_exp_set) / (prefixes_units as first_set [spaces] int_exp_prefixes_units as second_int_exp_set) / (int_exp_prefixes_units as first_int_exp_set [spaces] prefixes_units as second_set)\n\n prefixes_units_int_exp = (implicit_extended as implicit_extended [spaces] [prefixes_units_int_exp as sequence]) / (implicit_extended as implicit_extended [spaces] extender [spaces] prefixes_units_int_exp as sequence) / (int_exp_prefixes_units [spaces] extender [spaces] prefixes_units_int_exp as sequence) / (prefixes_units [spaces] extender [spaces] prefixes_units_int_exp as sequence) / (int_exp_prefixes_units [prefixes_units_int_exp as sequence]) / (prefixes_units [prefixes_units_int_exp as sequence])\n\n dimension_rules = (sqrt_dimensions / powered_dimensions) [extended_dimension_rules]\n extended_dimension_rules = [spaces] extender [spaces] dimension_rules_int_exp as sequence\n int_exp_dimension_rules = lparen dimension_rules_named_exp as int_exp rparen [extended_dimension_rules]\n dimension_rules_named_exp = ((lparen as open_paren dimension_rules_int_exp as int_exp rparen as close_paren) as int_exp [spaces] (dimension_rules_int_exp / extended_dimension_rules) as sequence) / dimension_rules_int_exp\n\n dimension_rules_int_exp = (dimension_rules as first_set spaces as extender dimension_rules as second_set [dimension_rules_int_exp]) / (dimension_rules as first_set [spaces] int_exp_dimension_rules as second_int_exp_set [dimension_rules_int_exp]) / (int_exp_dimension_rules as first_int_exp_set [spaces] dimension_rules as second_set [dimension_rules_int_exp]) / (int_exp_dimension_rules as first_int_exp_set [spaces] int_exp_dimension_rules as second_int_exp_set [dimension_rules_int_exp]) / int_exp_dimension_rules / dimension_rules\n\n expression = prefixes_units_int_exp / dimension_rules_int_exp / (single_letter_prefixes hyphen) / (double_letter_prefixes hyphen)\n\n entry expression: expression\n\n test expression {\n accept \"mm*s^-2\"\n accept \"sqrt(Hz)\"\n accept \"K/(kg*m)\"\n accept \"p-\"\n accept \"(m)(s)\"\n accept \"dB\"\n accept \"dB^2\"\n accept \"mbar*s^-2\"\n accept \"kgf\"\n accept \"sqrt(sqrt(m))\"\n reject \"que?\"\n reject \"m2\"\n reject \"dim_Ldim_M\"\n reject \"mm*\"\n reject \"m*s/\"\n reject \"sqrt(m)^2\"\n }\n}\n","source_hash":"7702a1bd52072d5d860e8176b50b5bebb218c1fda864592bb7313419e94506e3","unicode_tables":"onigmo (Ruby 4.0.1)","compiler_version":"1.5.8","edition":2,"semantics_hash":"sha256:4934ae2e2e40251a1c8c30c923a57a7e0e70e765ca63c17af13e1ec32eb1904c","checksum":"sha256:3a5d423ea975d46e9ab4b98a652e9276849f540226466dbacdd5001b2f6a5016","validated":{"lint_errors":0,"lint_warnings":56,"tests_total":16,"tests_failures":0,"self_test":true},"byte_checksum":"sha256:b2f159fe1592e822215c1836f28cf2b78fc57c205199fcc292479c3d2c097977"}
|
data/corpora/unitsml/corpus.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"grammar": "unitsml",
|
|
3
|
-
"artifact_checksum": "sha256:
|
|
3
|
+
"artifact_checksum": "sha256:3a5d423ea975d46e9ab4b98a652e9276849f540226466dbacdd5001b2f6a5016",
|
|
4
4
|
"cases": [
|
|
5
5
|
{
|
|
6
6
|
"input": "m",
|
|
@@ -553,6 +553,13 @@
|
|
|
553
553
|
"length": 1,
|
|
554
554
|
"line": 1,
|
|
555
555
|
"column": 1
|
|
556
|
+
},
|
|
557
|
+
"hyphen": {
|
|
558
|
+
"value": "-",
|
|
559
|
+
"offset": 1,
|
|
560
|
+
"length": 1,
|
|
561
|
+
"line": 1,
|
|
562
|
+
"column": 2
|
|
556
563
|
}
|
|
557
564
|
}
|
|
558
565
|
},
|
|
@@ -566,6 +573,13 @@
|
|
|
566
573
|
"length": 1,
|
|
567
574
|
"line": 1,
|
|
568
575
|
"column": 1
|
|
576
|
+
},
|
|
577
|
+
"hyphen": {
|
|
578
|
+
"value": "-",
|
|
579
|
+
"offset": 1,
|
|
580
|
+
"length": 1,
|
|
581
|
+
"line": 1,
|
|
582
|
+
"column": 2
|
|
569
583
|
}
|
|
570
584
|
}
|
|
571
585
|
},
|
|
@@ -1513,6 +1527,13 @@
|
|
|
1513
1527
|
"length": 1,
|
|
1514
1528
|
"line": 1,
|
|
1515
1529
|
"column": 1
|
|
1530
|
+
},
|
|
1531
|
+
"hyphen": {
|
|
1532
|
+
"value": "-",
|
|
1533
|
+
"offset": 1,
|
|
1534
|
+
"length": 1,
|
|
1535
|
+
"line": 1,
|
|
1536
|
+
"column": 2
|
|
1516
1537
|
}
|
|
1517
1538
|
}
|
|
1518
1539
|
},
|
|
@@ -1526,6 +1547,13 @@
|
|
|
1526
1547
|
"length": 2,
|
|
1527
1548
|
"line": 1,
|
|
1528
1549
|
"column": 1
|
|
1550
|
+
},
|
|
1551
|
+
"hyphen": {
|
|
1552
|
+
"value": "-",
|
|
1553
|
+
"offset": 2,
|
|
1554
|
+
"length": 1,
|
|
1555
|
+
"line": 1,
|
|
1556
|
+
"column": 3
|
|
1529
1557
|
}
|
|
1530
1558
|
}
|
|
1531
1559
|
},
|
|
@@ -1539,6 +1567,13 @@
|
|
|
1539
1567
|
"length": 1,
|
|
1540
1568
|
"line": 1,
|
|
1541
1569
|
"column": 1
|
|
1570
|
+
},
|
|
1571
|
+
"hyphen": {
|
|
1572
|
+
"value": "-",
|
|
1573
|
+
"offset": 1,
|
|
1574
|
+
"length": 1,
|
|
1575
|
+
"line": 1,
|
|
1576
|
+
"column": 2
|
|
1542
1577
|
}
|
|
1543
1578
|
}
|
|
1544
1579
|
},
|
data/grammars/unitsml.parg
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# sqrt, int_exp, sequence, first_set, second_set, open_paren, close_paren)
|
|
14
14
|
# mirror the Parslet .as() names so consumers can map them 1:1.
|
|
15
15
|
|
|
16
|
-
grammar UnitsmlAscii version "0.1.0" {
|
|
16
|
+
grammar UnitsmlAscii version "0.1.0" edition 2 {
|
|
17
17
|
|
|
18
18
|
ws = %x09 / %x0A / %x0B / %x0C / %x0D / %x20
|
|
19
19
|
spaces = 1*ws
|
|
@@ -24,8 +24,11 @@ grammar UnitsmlAscii version "0.1.0" {
|
|
|
24
24
|
digit = %x30-39
|
|
25
25
|
forward_slashes = "//" / "/"
|
|
26
26
|
extender = (forward_slashes / star) as extender
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
# The signed run is one authored capture: edition 2 drops anonymous
|
|
28
|
+
# literals from the tree, so the "-" sign would vanish and the digits
|
|
29
|
+
# would name per-iteration — the capture keeps the exact v1 slice
|
|
30
|
+
# (value "-2", "1/2", offset..length) the tree readers scalarize.
|
|
31
|
+
slashed_number = ((["-"] 1*digit) [forward_slashes (["-"] 1*digit)]) as integer
|
|
29
32
|
end_guard = !ANY / &(extender / lparen / rparen / spaces)
|
|
30
33
|
|
|
31
34
|
unit = alt from_table "units" column "name" as unit
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# GENERATED by scripts/generate_model.rb from the static capture shapes
|
|
4
|
+
# of artifacts/unitsml.json -- do not edit. 8 classes; Document
|
|
5
|
+
# is in lib/asciiunits/model.rb.
|
|
6
|
+
module Asciiunits
|
|
7
|
+
module Model
|
|
8
|
+
# The text of a capture: a parsanol slice as the tree serializes it.
|
|
9
|
+
# +offset+ and +length+ count characters; +line+ and +column+ are
|
|
10
|
+
# 1-based.
|
|
11
|
+
class Slice < Lutaml::Model::Serializable
|
|
12
|
+
attribute :value, :string
|
|
13
|
+
attribute :offset, :integer
|
|
14
|
+
attribute :length, :integer
|
|
15
|
+
attribute :line, :integer
|
|
16
|
+
attribute :column, :integer
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# The tree and the captures +int_exp+, +sequence+, +sqrt+.
|
|
20
|
+
class Expression < Lutaml::Model::Serializable
|
|
21
|
+
attribute :close_paren, "Asciiunits::Model::Slice"
|
|
22
|
+
attribute :dimension, "Asciiunits::Model::Slice"
|
|
23
|
+
attribute :extender, "Asciiunits::Model::Slice"
|
|
24
|
+
attribute :first_int_exp_set, "Asciiunits::Model::FirstIntExpSet"
|
|
25
|
+
attribute :first_set, "Asciiunits::Model::FirstSet"
|
|
26
|
+
attribute :hyphen, "Asciiunits::Model::Slice"
|
|
27
|
+
attribute :implicit_extended, "Asciiunits::Model::ImplicitExtended"
|
|
28
|
+
attribute :int_exp, "Asciiunits::Model::Expression"
|
|
29
|
+
attribute :integer, "Asciiunits::Model::Slice"
|
|
30
|
+
attribute :open_paren, "Asciiunits::Model::Slice"
|
|
31
|
+
attribute :power_numerator, "Asciiunits::Model::PowerNumerator"
|
|
32
|
+
attribute :prefix, "Asciiunits::Model::Slice"
|
|
33
|
+
attribute :second_int_exp_set, "Asciiunits::Model::SecondIntExpSet"
|
|
34
|
+
attribute :second_set, "Asciiunits::Model::SecondSet"
|
|
35
|
+
attribute :sequence, "Asciiunits::Model::Expression"
|
|
36
|
+
attribute :sqrt, "Asciiunits::Model::Expression"
|
|
37
|
+
attribute :unit, "Asciiunits::Model::Slice"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Capture +first_int_exp_set+.
|
|
41
|
+
class FirstIntExpSet < Lutaml::Model::Serializable
|
|
42
|
+
attribute :extender, "Asciiunits::Model::Slice"
|
|
43
|
+
attribute :int_exp, "Asciiunits::Model::Expression"
|
|
44
|
+
attribute :sequence, "Asciiunits::Model::Expression"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Capture +first_set+.
|
|
48
|
+
class FirstSet < Lutaml::Model::Serializable
|
|
49
|
+
attribute :dimension, "Asciiunits::Model::Slice"
|
|
50
|
+
attribute :extender, "Asciiunits::Model::Slice"
|
|
51
|
+
attribute :power_numerator, "Asciiunits::Model::PowerNumerator"
|
|
52
|
+
attribute :prefix, "Asciiunits::Model::Slice"
|
|
53
|
+
attribute :sequence, "Asciiunits::Model::Expression"
|
|
54
|
+
attribute :sqrt, "Asciiunits::Model::Expression"
|
|
55
|
+
attribute :unit, "Asciiunits::Model::Slice"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Capture +implicit_extended+.
|
|
59
|
+
class ImplicitExtended < Lutaml::Model::Serializable
|
|
60
|
+
attribute :extender, "Asciiunits::Model::Slice"
|
|
61
|
+
attribute :first_int_exp_set, "Asciiunits::Model::FirstIntExpSet"
|
|
62
|
+
attribute :first_set, "Asciiunits::Model::FirstSet"
|
|
63
|
+
attribute :second_int_exp_set, "Asciiunits::Model::SecondIntExpSet"
|
|
64
|
+
attribute :second_set, "Asciiunits::Model::SecondSet"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Capture +power_numerator+.
|
|
68
|
+
class PowerNumerator < Lutaml::Model::Serializable
|
|
69
|
+
attribute :int_exp, "Asciiunits::Model::Expression"
|
|
70
|
+
attribute :integer, "Asciiunits::Model::Slice"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Capture +second_int_exp_set+.
|
|
74
|
+
class SecondIntExpSet < Lutaml::Model::Serializable
|
|
75
|
+
attribute :extender, "Asciiunits::Model::Slice"
|
|
76
|
+
attribute :int_exp, "Asciiunits::Model::Expression"
|
|
77
|
+
attribute :sequence, "Asciiunits::Model::Expression"
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Capture +second_set+.
|
|
81
|
+
class SecondSet < Lutaml::Model::Serializable
|
|
82
|
+
attribute :dimension, "Asciiunits::Model::Slice"
|
|
83
|
+
attribute :extender, "Asciiunits::Model::Slice"
|
|
84
|
+
attribute :power_numerator, "Asciiunits::Model::PowerNumerator"
|
|
85
|
+
attribute :prefix, "Asciiunits::Model::Slice"
|
|
86
|
+
attribute :sequence, "Asciiunits::Model::Expression"
|
|
87
|
+
attribute :sqrt, "Asciiunits::Model::Expression"
|
|
88
|
+
attribute :unit, "Asciiunits::Model::Slice"
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Asciiunits
|
|
6
|
+
# The typed AsciiUnits model Asciiunits.parse_model returns, declared with
|
|
7
|
+
# LutaML Model. The node classes are generated from the artifact's capture
|
|
8
|
+
# shapes (scripts/generate_model.rb -> lib/asciiunits/model/nodes.rb);
|
|
9
|
+
# Document is below. Every node holds exactly the parsanol tree it was
|
|
10
|
+
# built from: a capture the model does not declare raises instead of
|
|
11
|
+
# being dropped.
|
|
12
|
+
module Model
|
|
13
|
+
# A tree key the model does not declare, or a value of another kind.
|
|
14
|
+
class UndeclaredCapture < StandardError; end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
require_relative "model/nodes"
|
|
19
|
+
|
|
20
|
+
module Asciiunits
|
|
21
|
+
module Model
|
|
22
|
+
# The result of one parse: the expression tree.
|
|
23
|
+
class Document < Lutaml::Model::Serializable
|
|
24
|
+
attribute :expression, "Asciiunits::Model::Expression"
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
module_function
|
|
28
|
+
|
|
29
|
+
# Every model class, in name order.
|
|
30
|
+
def classes
|
|
31
|
+
constants.sort.map { |c| const_get(c) }
|
|
32
|
+
.select { |k| k.is_a?(Class) && k < Lutaml::Model::Serializable }
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Builds the Document of a parsanol tree (Artifact#parse output).
|
|
36
|
+
def from_tree(tree)
|
|
37
|
+
Document.new(expression: node(Expression, tree))
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def node(klass, tree)
|
|
41
|
+
unless tree.is_a?(Hash)
|
|
42
|
+
raise UndeclaredCapture, "#{klass.name} expects a hash, not #{tree.inspect[0, 80]}"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
values = tree.each_with_object({}) do |(key, value), out|
|
|
46
|
+
next if value.nil?
|
|
47
|
+
|
|
48
|
+
attribute = klass.attributes[key.to_sym]
|
|
49
|
+
raise UndeclaredCapture, "#{klass.name} declares no capture #{key}" unless attribute
|
|
50
|
+
|
|
51
|
+
out[key.to_sym] = attribute.type == Slice ? slice(key, value) : node(attribute.type, value)
|
|
52
|
+
end
|
|
53
|
+
klass.new(**values)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def slice(key, value)
|
|
57
|
+
unless value.respond_to?(:line_and_column)
|
|
58
|
+
raise UndeclaredCapture, "capture #{key} expects a slice, not #{value.inspect[0, 80]}"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
line, column = value.line_and_column
|
|
62
|
+
Slice.new(value: value.to_s, offset: value.offset, length: value.length, line: line, column: column)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private_class_method :node, :slice
|
|
66
|
+
end
|
|
67
|
+
end
|
data/lib/asciiunits/version.rb
CHANGED
data/lib/asciiunits.rb
CHANGED
|
@@ -8,6 +8,7 @@ module Asciiunits
|
|
|
8
8
|
TABLES_DIR = File.join(REPO_ROOT, "tables")
|
|
9
9
|
GRAMMAR_PATH = File.join(REPO_ROOT, "grammars/unitsml.parg")
|
|
10
10
|
CORPUS_PATH = File.join(REPO_ROOT, "corpora/unitsml/corpus.json")
|
|
11
|
+
MODEL_PATH = File.join(REPO_ROOT, "model/asciiunits.lml.json")
|
|
11
12
|
|
|
12
13
|
module_function
|
|
13
14
|
|
|
@@ -18,4 +19,13 @@ module Asciiunits
|
|
|
18
19
|
require "parsanol"
|
|
19
20
|
Parsanol::PARG::Artifact.load(ARTIFACT_PATH, tables_dir: TABLES_DIR)
|
|
20
21
|
end
|
|
22
|
+
|
|
23
|
+
# Parses +input+ with the artifact's "expression" entry and returns the
|
|
24
|
+
# typed model (Asciiunits::Model::Document). Raises what Artifact#parse
|
|
25
|
+
# raises on rejected input. Loads lutaml-model on first use; the
|
|
26
|
+
# artifact is loaded once unless one is passed.
|
|
27
|
+
def parse_model(input, artifact: (@artifact ||= load_artifact))
|
|
28
|
+
require_relative "asciiunits/model"
|
|
29
|
+
Model.from_tree(artifact.parse("expression", input))
|
|
30
|
+
end
|
|
21
31
|
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Written by scripts/verify_lml.rb: the LML checksum of every model
|
|
2
|
+
# document, then the sha256 of the documents file.
|
|
3
|
+
Asciiunits::Model::Document sha256:7a41cc0c1d121a01cd0963ce37b52223826d28e9a50897694d4a9b95fa7df188
|
|
4
|
+
Asciiunits::Model::Expression sha256:bbf22caba1a7f385729d9bea54fbb3ea939e1ee49204177e3d437d4360d0c5d5
|
|
5
|
+
Asciiunits::Model::FirstIntExpSet sha256:3df4bf92ee2e51e73a343656dbb775f198f3657fbe818675f14fcfb3b0c76f57
|
|
6
|
+
Asciiunits::Model::FirstSet sha256:6ab948659e6bc47334b4500ced27637ec0195d538be82a21c7a2b6191e276de0
|
|
7
|
+
Asciiunits::Model::ImplicitExtended sha256:1b83733b6ee387e871565f41b67cfe961bf075a3cd07dc64ba9c0aa9d44ce550
|
|
8
|
+
Asciiunits::Model::PowerNumerator sha256:364ff98992473b36d9f903c0eee55363954c3d63aca5ef51f5a95f03e840beb1
|
|
9
|
+
Asciiunits::Model::SecondIntExpSet sha256:72557eb0d00ef2b92acc18206c15498361dbef0c5aba7b84c7739cbd4a257bf1
|
|
10
|
+
Asciiunits::Model::SecondSet sha256:acfc6a948f91917e068e448d0460a693aadf0b91909efe8531d1da64799d31a1
|
|
11
|
+
Asciiunits::Model::Slice sha256:3b911f1422aae36cf03aa62e9e3a9323cd7cbbf2277b9dcda3c1197658b3f139
|
|
12
|
+
model/asciiunits.lml.json sha256:8e1380b379542c8597c91925c024ec6fbcccf14470e90615999e86a241aaf0cd
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "asciiunits-lml/1",
|
|
3
|
+
"root": "Asciiunits::Model::Document",
|
|
4
|
+
"models": [
|
|
5
|
+
{
|
|
6
|
+
"lml": 1,
|
|
7
|
+
"model": "Asciiunits::Model::Document",
|
|
8
|
+
"attributes": [
|
|
9
|
+
{
|
|
10
|
+
"name": "expression",
|
|
11
|
+
"type": "Asciiunits::Model::Expression"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"mappings": {}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"lml": 1,
|
|
18
|
+
"model": "Asciiunits::Model::Expression",
|
|
19
|
+
"attributes": [
|
|
20
|
+
{
|
|
21
|
+
"name": "close_paren",
|
|
22
|
+
"type": "Asciiunits::Model::Slice"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "dimension",
|
|
26
|
+
"type": "Asciiunits::Model::Slice"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "extender",
|
|
30
|
+
"type": "Asciiunits::Model::Slice"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "first_int_exp_set",
|
|
34
|
+
"type": "Asciiunits::Model::FirstIntExpSet"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "first_set",
|
|
38
|
+
"type": "Asciiunits::Model::FirstSet"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "hyphen",
|
|
42
|
+
"type": "Asciiunits::Model::Slice"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "implicit_extended",
|
|
46
|
+
"type": "Asciiunits::Model::ImplicitExtended"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"name": "int_exp",
|
|
50
|
+
"type": "Asciiunits::Model::Expression"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "integer",
|
|
54
|
+
"type": "Asciiunits::Model::Slice"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "open_paren",
|
|
58
|
+
"type": "Asciiunits::Model::Slice"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "power_numerator",
|
|
62
|
+
"type": "Asciiunits::Model::PowerNumerator"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "prefix",
|
|
66
|
+
"type": "Asciiunits::Model::Slice"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "second_int_exp_set",
|
|
70
|
+
"type": "Asciiunits::Model::SecondIntExpSet"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "second_set",
|
|
74
|
+
"type": "Asciiunits::Model::SecondSet"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "sequence",
|
|
78
|
+
"type": "Asciiunits::Model::Expression"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "sqrt",
|
|
82
|
+
"type": "Asciiunits::Model::Expression"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "unit",
|
|
86
|
+
"type": "Asciiunits::Model::Slice"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"mappings": {}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"lml": 1,
|
|
93
|
+
"model": "Asciiunits::Model::FirstIntExpSet",
|
|
94
|
+
"attributes": [
|
|
95
|
+
{
|
|
96
|
+
"name": "extender",
|
|
97
|
+
"type": "Asciiunits::Model::Slice"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"name": "int_exp",
|
|
101
|
+
"type": "Asciiunits::Model::Expression"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "sequence",
|
|
105
|
+
"type": "Asciiunits::Model::Expression"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"mappings": {}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"lml": 1,
|
|
112
|
+
"model": "Asciiunits::Model::FirstSet",
|
|
113
|
+
"attributes": [
|
|
114
|
+
{
|
|
115
|
+
"name": "dimension",
|
|
116
|
+
"type": "Asciiunits::Model::Slice"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "extender",
|
|
120
|
+
"type": "Asciiunits::Model::Slice"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "power_numerator",
|
|
124
|
+
"type": "Asciiunits::Model::PowerNumerator"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "prefix",
|
|
128
|
+
"type": "Asciiunits::Model::Slice"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "sequence",
|
|
132
|
+
"type": "Asciiunits::Model::Expression"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "sqrt",
|
|
136
|
+
"type": "Asciiunits::Model::Expression"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "unit",
|
|
140
|
+
"type": "Asciiunits::Model::Slice"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
"mappings": {}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"lml": 1,
|
|
147
|
+
"model": "Asciiunits::Model::ImplicitExtended",
|
|
148
|
+
"attributes": [
|
|
149
|
+
{
|
|
150
|
+
"name": "extender",
|
|
151
|
+
"type": "Asciiunits::Model::Slice"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "first_int_exp_set",
|
|
155
|
+
"type": "Asciiunits::Model::FirstIntExpSet"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "first_set",
|
|
159
|
+
"type": "Asciiunits::Model::FirstSet"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "second_int_exp_set",
|
|
163
|
+
"type": "Asciiunits::Model::SecondIntExpSet"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "second_set",
|
|
167
|
+
"type": "Asciiunits::Model::SecondSet"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"mappings": {}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"lml": 1,
|
|
174
|
+
"model": "Asciiunits::Model::PowerNumerator",
|
|
175
|
+
"attributes": [
|
|
176
|
+
{
|
|
177
|
+
"name": "int_exp",
|
|
178
|
+
"type": "Asciiunits::Model::Expression"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "integer",
|
|
182
|
+
"type": "Asciiunits::Model::Slice"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"mappings": {}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"lml": 1,
|
|
189
|
+
"model": "Asciiunits::Model::SecondIntExpSet",
|
|
190
|
+
"attributes": [
|
|
191
|
+
{
|
|
192
|
+
"name": "extender",
|
|
193
|
+
"type": "Asciiunits::Model::Slice"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "int_exp",
|
|
197
|
+
"type": "Asciiunits::Model::Expression"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "sequence",
|
|
201
|
+
"type": "Asciiunits::Model::Expression"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"mappings": {}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"lml": 1,
|
|
208
|
+
"model": "Asciiunits::Model::SecondSet",
|
|
209
|
+
"attributes": [
|
|
210
|
+
{
|
|
211
|
+
"name": "dimension",
|
|
212
|
+
"type": "Asciiunits::Model::Slice"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "extender",
|
|
216
|
+
"type": "Asciiunits::Model::Slice"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "power_numerator",
|
|
220
|
+
"type": "Asciiunits::Model::PowerNumerator"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "prefix",
|
|
224
|
+
"type": "Asciiunits::Model::Slice"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "sequence",
|
|
228
|
+
"type": "Asciiunits::Model::Expression"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "sqrt",
|
|
232
|
+
"type": "Asciiunits::Model::Expression"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "unit",
|
|
236
|
+
"type": "Asciiunits::Model::Slice"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"mappings": {}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"lml": 1,
|
|
243
|
+
"model": "Asciiunits::Model::Slice",
|
|
244
|
+
"attributes": [
|
|
245
|
+
{
|
|
246
|
+
"name": "value",
|
|
247
|
+
"type": "string"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "offset",
|
|
251
|
+
"type": "integer"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"name": "length",
|
|
255
|
+
"type": "integer"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "line",
|
|
259
|
+
"type": "integer"
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"name": "column",
|
|
263
|
+
"type": "integer"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"mappings": {}
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
metadata
CHANGED
|
@@ -1,35 +1,49 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: asciiunits
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parsanol
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: 1.3.108
|
|
20
|
-
- - "<"
|
|
17
|
+
- - "~>"
|
|
21
18
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 1.
|
|
19
|
+
version: 1.5.0
|
|
23
20
|
type: :runtime
|
|
24
21
|
prerelease: false
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 1.5.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: lutaml-model
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0.8'
|
|
27
34
|
- - ">="
|
|
28
35
|
- !ruby/object:Gem::Version
|
|
29
|
-
version:
|
|
30
|
-
|
|
36
|
+
version: 0.8.162
|
|
37
|
+
type: :runtime
|
|
38
|
+
prerelease: false
|
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - "~>"
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: '0.8'
|
|
44
|
+
- - ">="
|
|
31
45
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
46
|
+
version: 0.8.162
|
|
33
47
|
description: 'Checksummed parsanol PARG artifact, terminal tables and oracle-frozen
|
|
34
48
|
conformance corpus for the unitsml(...) expression syntax of UnitsML. Runtime-agnostic:
|
|
35
49
|
load the artifact with any Parsanol runtime (Ruby, Rust, wasm).'
|
|
@@ -48,7 +62,11 @@ files:
|
|
|
48
62
|
- corpora/unitsml/inputs.txt
|
|
49
63
|
- grammars/unitsml.parg
|
|
50
64
|
- lib/asciiunits.rb
|
|
65
|
+
- lib/asciiunits/model.rb
|
|
66
|
+
- lib/asciiunits/model/nodes.rb
|
|
51
67
|
- lib/asciiunits/version.rb
|
|
68
|
+
- model/asciiunits.lml.checksums.txt
|
|
69
|
+
- model/asciiunits.lml.json
|
|
52
70
|
- suites/unitsml.pgtest
|
|
53
71
|
- tables/dimensions.yaml
|
|
54
72
|
- tables/prefixed_units.yaml
|