asciiunits 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5f42ac5df216807eac500724d605a1288a2b6d61b5583bf5f060fe39788a9d35
4
+ data.tar.gz: 24bd2316696f0e66288c500bd5a48ed29b9793d535be150544408619705a9365
5
+ SHA512:
6
+ metadata.gz: efcd68d4b005b6622869d0c8b0efb201e6c7e32040c66929bd57682eccb68ad54c30a90510055f9d05f75ab7c479ae77216763e0a5fb188fe453b5de73683f2a
7
+ data.tar.gz: 5da5721afed80ff5ac0ff911a86f7fefd7f470abe1c6e4d14e46b9ffc12e30166aa534e22fcd6f132582c16c0f6a9504d3494eb04f129e47d26bdf24aec9e6b1
data/LICENSE.md ADDED
@@ -0,0 +1,53 @@
1
+ Licenses & Copyright
2
+ ====================
3
+
4
+ This license file adheres to the formatting guidelines of
5
+ [readable-licenses](https://github.com/nevir/readable-licenses).
6
+
7
+
8
+ CalConnect MIT License
9
+ ----------------------
10
+
11
+ Copyright 2020-2025, CalConnect
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
14
+ this software and associated documentation files (the “Software”), to deal in
15
+ the Software without restriction, including without limitation the rights to
16
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
17
+ the Software, and to permit persons to whom the Software is furnished to do so,
18
+ subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
25
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
26
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
27
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
28
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
+
30
+
31
+ NIST Public Domain Notice (SPDX: NIST-PD)
32
+ -----------------------------------------
33
+
34
+ This software was developed by employees of the National Institute of Standards
35
+ and Technology (NIST), and others.
36
+
37
+ This software has been contributed to the public domain.
38
+
39
+ Pursuant to title 15 Untied States Code Section 105, works of NIST employees are
40
+ not subject to copyright protection in the United States and are considered to
41
+ be in the public domain.
42
+
43
+ As a result, a formal license is not needed to use this software.
44
+
45
+ This software is provided "AS IS."
46
+
47
+ NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
48
+ WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
49
+ PARTICULAR PURPOSE, NON-INFRINGEMENT AND DATA ACCURACY.
50
+
51
+ NIST does not warrant or make any representations regarding the use of the
52
+ software or the results thereof, including but not limited to the correctness,
53
+ accuracy, reliability or usefulness of this software.
data/README.adoc ADDED
@@ -0,0 +1,135 @@
1
+ = asciiunits
2
+
3
+ PARG grammar, checksummed artifact and conformance corpus for the
4
+ `unitsml(...)` expression content of https://github.com/unitsml/unitsml-ruby[UnitsML]
5
+ (the AsciiUnits unit-expression syntax).
6
+
7
+ This repository ships **no runtime code**. It ships the contract:
8
+
9
+ * `grammars/unitsml.parg` — the grammar source
10
+ * `artifacts/unitsml.json` — the compiled artifact (`parsanol-tree/v2`, checksummed)
11
+ * `tables/` — the terminal vocabularies (embedded in the artifact at compile
12
+ time; loaded from disk at parse time, see below)
13
+ * `corpora/unitsml/` — conformance corpus, oracle-frozen against the
14
+ unitsml-ruby Parslet parser
15
+
16
+ Runtime repositories (Ruby, Rust, TypeScript) load the artifact via their
17
+ Parsanol runtime and map parse trees to their own object models. In Ruby:
18
+
19
+ [source,ruby]
20
+ ----
21
+ require "parsanol"
22
+ artifact = Parsanol::PARG::Artifact.load("artifacts/unitsml.json", tables_dir: "tables")
23
+ artifact.parse("expression", "mm*s^-2")
24
+ ----
25
+
26
+ The `tables_dir` must point at this repository's `tables/` — the artifact
27
+ records the tables in its manifest and resolves them at load time, so a
28
+ runtime should vendor (or install) this checkout as a unit.
29
+
30
+ == What the grammar covers
31
+
32
+ Exactly the expression syntax `Unitsml::Parse` accepts — transcribed rule
33
+ for rule, in the same alternative order (PEG ordered choice makes order
34
+ load-bearing):
35
+
36
+ * unit tokens from UnitsDB (`m`, `Hz`, `cal_th`, `ton-force (2000 lb)`, …),
37
+ prefixed units (`mm`, `mmol`), the literal `1`
38
+ * exponents: `^2`, `^-2`, `^(1/2)` — a single power per unit, no chained powers
39
+ * multiplication/division: `*`, `/`, `//`, implicit multiplication by
40
+ whitespace (`m s`), and direct fence/sqrt adjacency (`(m)(s)`, `sqrt(m)s`)
41
+ * `sqrt(…)` — including `sqrt(sqrt(m))`
42
+ * fencing `(…)` — powers do not attach to fenced or sqrt forms (`(cm)^3` is rejected)
43
+ * prefix-only forms at top level (`k-`)
44
+ * dimension expressions (`dim_L*dim_M^2`) with the same operators
45
+ * `k-`-style forms, `mm*`-style trailing extenders, and every other quirk of
46
+ the original — the oracle corpus pins them
47
+
48
+ == Artifact tree contract
49
+
50
+ The artifact carries a single entry `expression`. Captures mirror the
51
+ Parslet `.as()` names of the original (values are slices: `value` + `offset`
52
+ + `length`):
53
+
54
+ [cols="1,3"]
55
+ |===
56
+ |Capture |Meaning
57
+
58
+ |`unit`, `prefix`, `dimension`
59
+ |Terminal token
60
+
61
+ |`integer`
62
+ |Number text (optional leading `-`, optional `/number` part), under `slashed_number`
63
+
64
+ |`power_numerator`
65
+ |Exponent subtree (`integer` or nested `int_exp`)
66
+
67
+ |`extender`
68
+ |Operator: `*`, `/`, `//` — or the whitespace text for implicit multiplication
69
+
70
+ |`sqrt`
71
+ |`sqrt(…)` subtree
72
+
73
+ |`int_exp`
74
+ |Fenced `(…)` subtree
75
+
76
+ |`sequence`
77
+ |The right-recursive continuation of a chain
78
+
79
+ |`first_set` / `second_set` / `first_int_exp_set` / `second_int_exp_set`
80
+ |The two operands of an implicit multiplication (under `implicit_extended`)
81
+
82
+ |`open_paren` / `close_paren`
83
+ |Fence characters captured by the named int-exp rules
84
+ |===
85
+
86
+ Post-parse semantics (sqrt → 0.5 powers, `/` and `//` inverting exponents)
87
+ belong to the runtime adapter, not the grammar — the grammar records
88
+ structure only, exactly as the Parslet original does.
89
+
90
+ == Installation
91
+
92
+ The gem ships the artifact, tables, grammar source and conformance corpus:
93
+
94
+ [source,sh]
95
+ ----
96
+ gem install asciiunits
97
+ ----
98
+
99
+ [source,ruby]
100
+ ----
101
+ require "asciiunits"
102
+
103
+ artifact = Asciiunits.load_artifact
104
+ artifact.parse("expression", "mm*s^-2")
105
+ ----
106
+
107
+ == Rebuilding
108
+
109
+ The `unitsml` gem (build-time only) supplies the terminal selection and the
110
+ Parslet oracle; `parsanol` compiles:
111
+
112
+ [source,sh]
113
+ ----
114
+ bundle install
115
+ rake tables:gen # regenerate terminal tables from the unitsml gem
116
+ rake oracle:regen # re-baseline accept/reject against the parslet parser
117
+ rake artifact:compile # compile with determinism check + checksums manifest
118
+ rake contracts:regen # replay artifact over the corpus, enforce parity
119
+ rake ci # everything green before committing
120
+ ----
121
+
122
+ A data change in UnitsDB (new unit symbols, renamed prefixes) means:
123
+ `rake tables:gen && rake artifact:compile && rake contracts:regen`, review
124
+ the corpus diff, commit. Consumers pick the change up by updating their
125
+ vendored artifact.
126
+
127
+ == Verification status
128
+
129
+ * Oracle: unitsml 0.6.9 Parslet parser, frozen in
130
+ `corpora/unitsml/expected-kinds.json`
131
+ * Corpus: 124 inputs (70 accept / 54 reject), kind parity green
132
+ * Differential probe at authoring time: 572 generated inputs, 0
133
+ accept/reject disagreements against the oracle
134
+ * Engines: native (Rust) and `mode: :ruby` trees verified identical
135
+ * Compile: byte-identical across recompiles (`rake artifact:compile`)
@@ -0,0 +1,12 @@
1
+ # Written by scripts/compile.rb. Envelope checksum is Parsanol's own;
2
+ # the sha256 lines are of the files' bytes.
3
+ artifact_checksum sha256:b1497bdaff9a9bdf5bd92e7a0354200a8dfa54f91c9cdf3c254537e95ed883cf
4
+ compiler_version 1.3.108
5
+ source_hash sha256:3fb5a2ab7d214410c5659cdef1c0b1251eb99c7d57496610f43b4fb23b5cd020
6
+ artifacts/unitsml.json sha256:9fed873d0f6013874add843fb0bf727a2c70a0c4186606853f171c1df80464d0
7
+ grammars/unitsml.parg sha256:3fb5a2ab7d214410c5659cdef1c0b1251eb99c7d57496610f43b4fb23b5cd020
8
+ tables/dimensions.yaml sha256:62715c12c96d0dcd0c640850e3e922e5708d5871a959b251dc714a7cd8c86836
9
+ tables/prefixes_double.yaml sha256:523d8f9ffc270654e58fc131088777e2b5fb6afb0021da7d9a07c411eba27aee
10
+ tables/prefixes_single.yaml sha256:227768a4b5e44360ced802df8a32621428a9071e97746a256a385a5c892ef8c6
11
+ tables/units.yaml sha256:e8bbe1e4bfd9ddc1bd7ac9419568c4c28b3eb5196aff55dba73d4190024bb65c
12
+ entries expression
@@ -0,0 +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":574}},{"Entity":{"atom":571}},{"Entity":{"atom":568}},{"Entity":{"atom":566}},{"Str":{"pattern":"sqrt"}},{"Entity":{"atom":6}},{"Str":{"pattern":"("}},{"Entity":{"atom":563}},{"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":559}},{"Named":{"name":"sequence","atom":20}},{"Repetition":{"atom":21,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,19,22]}},{"Entity":{"atom":556}},{"Named":{"name":"first_set","atom":2}},{"Entity":{"atom":18}},{"Named":{"name":"extender","atom":26}},{"Entity":{"atom":532}},{"Entity":{"atom":529}},{"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":527}},{"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":523}},{"Named":{"name":"sequence","atom":48}},{"Repetition":{"atom":49,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[42,44,45,47,50]}},{"Entity":{"atom":521}},{"Entity":{"atom":6}},{"Entity":{"atom":18}},{"Repetition":{"atom":54,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":519}},{"Entity":{"atom":511}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":58}},{"Entity":{"atom":18}},{"Repetition":{"atom":60,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":505}},{"Entity":{"atom":69}},{"Named":{"name":"int_exp","atom":56}},{"Entity":{"atom":18}},{"Repetition":{"atom":65,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":68}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[53,55,64,66,67]}},{"Entity":{"atom":504}},{"Entity":{"atom":18}},{"Repetition":{"atom":71,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":74,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":500}},{"Named":{"name":"sequence","atom":76}},{"Repetition":{"atom":77,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[52,72,73,75,78]}},{"Entity":{"atom":468}},{"Repetition":{"atom":29,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[3,81]}},{"Str":{"pattern":"1"}},{"Named":{"name":"unit","atom":83}},{"Entity":{"atom":87}},{"Named":{"name":"sequence","atom":41}},{"Sequence":{"atoms":[30,40,86]}},{"Repetition":{"atom":85,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[84,88]}},{"Entity":{"atom":402}},{"Entity":{"atom":366}},{"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":[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,363,364]}},{"Named":{"name":"unit","atom":365}},{"Entity":{"atom":400}},{"Str":{"pattern":"^"}},{"Entity":{"atom":398}},{"Entity":{"atom":383}},{"Entity":{"atom":377}},{"Str":{"pattern":"-"}},{"Repetition":{"atom":372,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":375}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":374,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[373,376]}},{"Entity":{"atom":34}},{"Entity":{"atom":377}},{"Sequence":{"atoms":[378,379]}},{"Repetition":{"atom":380,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[371,381]}},{"Named":{"name":"integer","atom":382}},{"Entity":{"atom":6}},{"Entity":{"atom":395}},{"Entity":{"atom":6}},{"Entity":{"atom":391}},{"Named":{"name":"int_exp","atom":385}},{"Entity":{"atom":68}},{"Sequence":{"atoms":[384,388,389]}},{"Alternative":{"atoms":[370,390]}},{"Entity":{"atom":68}},{"Sequence":{"atoms":[386,387,392]}},{"Entity":{"atom":391}},{"Alternative":{"atoms":[393,394]}},{"Named":{"name":"int_exp","atom":385}},{"Sequence":{"atoms":[384,396,389]}},{"Alternative":{"atoms":[370,397]}},{"Named":{"name":"power_numerator","atom":369}},{"Sequence":{"atoms":[368,399]}},{"Repetition":{"atom":367,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[91,401]}},{"Entity":{"atom":87}},{"Sequence":{"atoms":[90,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":68}},{"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":87}},{"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":87}},{"Sequence":{"atoms":[435,462,463]}},{"Entity":{"atom":461}},{"Entity":{"atom":402}},{"Sequence":{"atoms":[465,466]}},{"Alternative":{"atoms":[82,89,404,416,431,434,464,467]}},{"Entity":{"atom":18}},{"Repetition":{"atom":469,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":472,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":496}},{"Named":{"name":"sequence","atom":474}},{"Repetition":{"atom":475,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[80,470,471,473,476]}},{"Entity":{"atom":69}},{"Entity":{"atom":492}},{"Named":{"name":"sequence","atom":479}},{"Repetition":{"atom":480,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[478,481]}},{"Entity":{"atom":468}},{"Entity":{"atom":488}},{"Named":{"name":"sequence","atom":484}},{"Repetition":{"atom":485,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[483,486]}},{"Alternative":{"atoms":[23,51,79,477,482,487]}},{"Named":{"name":"sequence","atom":484}},{"Repetition":{"atom":489,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[483,490]}},{"Alternative":{"atoms":[23,51,79,477,482,491]}},{"Named":{"name":"sequence","atom":479}},{"Repetition":{"atom":493,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[478,494]}},{"Alternative":{"atoms":[23,51,79,477,495,491]}},{"Named":{"name":"sequence","atom":474}},{"Repetition":{"atom":497,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[80,470,471,473,498]}},{"Alternative":{"atoms":[23,51,79,499,495,491]}},{"Named":{"name":"sequence","atom":76}},{"Repetition":{"atom":501,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[52,72,73,75,502]}},{"Alternative":{"atoms":[23,51,503,499,495,491]}},{"Alternative":{"atoms":[63,70]}},{"Named":{"name":"int_exp","atom":62}},{"Entity":{"atom":18}},{"Repetition":{"atom":507,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":68}},{"Named":{"name":"close_paren","atom":509}},{"Sequence":{"atoms":[59,61,506,508,510]}},{"Named":{"name":"int_exp","atom":57}},{"Entity":{"atom":504}},{"Entity":{"atom":87}},{"Alternative":{"atoms":[513,514]}},{"Repetition":{"atom":515,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[512,516]}},{"Entity":{"atom":504}},{"Alternative":{"atoms":[517,518]}},{"Named":{"name":"int_exp","atom":56}},{"Sequence":{"atoms":[53,55,520,66,67]}},{"Sequence":{"atoms":[52,72,73,75,502]}},{"Alternative":{"atoms":[23,51,522,499,495,491]}},{"Named":{"name":"sequence","atom":48}},{"Repetition":{"atom":524,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[42,44,45,47,525]}},{"Alternative":{"atoms":[23,526,522,499,495,491]}},{"Named":{"name":"sequence","atom":41}},{"Sequence":{"atoms":[30,40,528]}},{"Repetition":{"atom":29,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[3,530]}},{"Alternative":{"atoms":[531,89,404,416,431,434,464,467]}},{"Named":{"name":"second_set","atom":28}},{"Sequence":{"atoms":[25,27,533]}},{"Entity":{"atom":521}},{"Named":{"name":"first_int_exp_set","atom":535}},{"Entity":{"atom":18}},{"Repetition":{"atom":537,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":521}},{"Named":{"name":"second_int_exp_set","atom":539}},{"Sequence":{"atoms":[536,538,540]}},{"Entity":{"atom":532}},{"Named":{"name":"first_set","atom":542}},{"Entity":{"atom":18}},{"Repetition":{"atom":544,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":521}},{"Named":{"name":"second_int_exp_set","atom":546}},{"Sequence":{"atoms":[543,545,547]}},{"Entity":{"atom":521}},{"Named":{"name":"first_int_exp_set","atom":549}},{"Entity":{"atom":18}},{"Repetition":{"atom":551,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":532}},{"Named":{"name":"second_set","atom":553}},{"Sequence":{"atoms":[550,552,554]}},{"Alternative":{"atoms":[534,541,548,555]}},{"Named":{"name":"implicit_extended","atom":24}},{"Sequence":{"atoms":[557,44,45,47,525]}},{"Alternative":{"atoms":[23,558,522,499,495,491]}},{"Named":{"name":"sequence","atom":20}},{"Repetition":{"atom":560,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,19,561]}},{"Alternative":{"atoms":[562,558,522,499,495,491]}},{"Named":{"name":"sqrt","atom":7}},{"Entity":{"atom":68}},{"Sequence":{"atoms":[4,5,564,565]}},{"Sequence":{"atoms":[3,530]}},{"Alternative":{"atoms":[567,89,404,416,431,434,464,467]}},{"Named":{"name":"first_set","atom":2}},{"Sequence":{"atoms":[569,27,533]}},{"Alternative":{"atoms":[570,541,548,555]}},{"Named":{"name":"implicit_extended","atom":1}},{"Sequence":{"atoms":[572,19,561]}},{"Alternative":{"atoms":[573,558,522,499,495,491]}},{"Entity":{"atom":701}},{"Entity":{"atom":698}},{"Entity":{"atom":696}},{"Str":{"pattern":"sqrt"}},{"Entity":{"atom":6}},{"Entity":{"atom":693}},{"Named":{"name":"first_set","atom":576}},{"Entity":{"atom":18}},{"Named":{"name":"extender","atom":582}},{"Entity":{"atom":690}},{"Entity":{"atom":599}},{"Entity":{"atom":596}},{"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":[587,588,589,590,591,592,593,594]}},{"Named":{"name":"dimension","atom":595}},{"Entity":{"atom":400}},{"Repetition":{"atom":597,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[586,598]}},{"Alternative":{"atoms":[577,585]}},{"Entity":{"atom":688}},{"Entity":{"atom":18}},{"Repetition":{"atom":602,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":38}},{"Entity":{"atom":18}},{"Repetition":{"atom":605,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":686}},{"Named":{"name":"second_set","atom":584}},{"Entity":{"atom":683}},{"Repetition":{"atom":609,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[581,583,608,610]}},{"Entity":{"atom":614}},{"Repetition":{"atom":601,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[600,613]}},{"Named":{"name":"first_set","atom":612}},{"Entity":{"atom":18}},{"Repetition":{"atom":616,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":680}},{"Entity":{"atom":6}},{"Entity":{"atom":678}},{"Entity":{"atom":6}},{"Named":{"name":"open_paren","atom":621}},{"Entity":{"atom":664}},{"Named":{"name":"second_int_exp_set","atom":618}},{"Entity":{"atom":661}},{"Repetition":{"atom":625,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[615,617,624,626]}},{"Entity":{"atom":635}},{"Named":{"name":"int_exp","atom":620}},{"Entity":{"atom":68}},{"Entity":{"atom":633}},{"Named":{"name":"sequence","atom":607}},{"Sequence":{"atoms":[603,604,606,632]}},{"Repetition":{"atom":631,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[619,629,630,634]}},{"Named":{"name":"first_int_exp_set","atom":628}},{"Entity":{"atom":18}},{"Repetition":{"atom":637,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":614}},{"Named":{"name":"second_set","atom":639}},{"Entity":{"atom":658}},{"Repetition":{"atom":641,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[636,638,640,642]}},{"Entity":{"atom":635}},{"Named":{"name":"first_int_exp_set","atom":644}},{"Entity":{"atom":18}},{"Repetition":{"atom":646,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":635}},{"Named":{"name":"second_int_exp_set","atom":648}},{"Entity":{"atom":655}},{"Repetition":{"atom":650,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[645,647,649,651]}},{"Entity":{"atom":635}},{"Entity":{"atom":614}},{"Alternative":{"atoms":[611,627,643,652,653,654]}},{"Repetition":{"atom":650,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[645,647,649,656]}},{"Alternative":{"atoms":[611,627,643,657,653,654]}},{"Repetition":{"atom":641,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[636,638,640,659]}},{"Alternative":{"atoms":[611,627,660,657,653,654]}},{"Repetition":{"atom":625,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[615,617,624,662]}},{"Alternative":{"atoms":[611,663,660,657,653,654]}},{"Named":{"name":"int_exp","atom":623}},{"Entity":{"atom":68}},{"Named":{"name":"close_paren","atom":666}},{"Sequence":{"atoms":[622,665,667]}},{"Named":{"name":"int_exp","atom":668}},{"Entity":{"atom":18}},{"Repetition":{"atom":670,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":664}},{"Entity":{"atom":633}},{"Alternative":{"atoms":[672,673]}},{"Named":{"name":"sequence","atom":674}},{"Sequence":{"atoms":[669,671,675]}},{"Entity":{"atom":664}},{"Alternative":{"atoms":[676,677]}},{"Named":{"name":"int_exp","atom":620}},{"Sequence":{"atoms":[619,679,630,634]}},{"Named":{"name":"second_int_exp_set","atom":618}},{"Sequence":{"atoms":[615,617,681,662]}},{"Alternative":{"atoms":[611,682,660,657,653,654]}},{"Repetition":{"atom":609,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[581,583,608,684]}},{"Alternative":{"atoms":[685,682,660,657,653,654]}},{"Named":{"name":"sequence","atom":607}},{"Sequence":{"atoms":[603,604,606,687]}},{"Repetition":{"atom":601,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[600,689]}},{"Named":{"name":"second_set","atom":584}},{"Sequence":{"atoms":[581,583,691,684]}},{"Alternative":{"atoms":[692,682,660,657,653,654]}},{"Named":{"name":"sqrt","atom":580}},{"Entity":{"atom":68}},{"Sequence":{"atoms":[578,579,694,695]}},{"Alternative":{"atoms":[577,585]}},{"Sequence":{"atoms":[697,689]}},{"Named":{"name":"first_set","atom":576}},{"Sequence":{"atoms":[699,583,691,684]}},{"Alternative":{"atoms":[700,682,660,657,653,654]}},{"Entity":{"atom":461}},{"Entity":{"atom":704}},{"Str":{"pattern":"-"}},{"Sequence":{"atoms":[702,703]}},{"Entity":{"atom":428}},{"Entity":{"atom":704}},{"Sequence":{"atoms":[706,707]}},{"Alternative":{"atoms":[0,575,705,708]}}],"root":709},"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"}]}},"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 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 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 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 7 and 8 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":"mm*","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":{}}],"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 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 slashed_number_int_exp rparen) / 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)\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 \"mm*\"\n accept \"sqrt(sqrt(m))\"\n reject \"que?\"\n reject \"m2\"\n reject \"dim_Ldim_M\"\n }\n}\n","source_hash":"3fb5a2ab7d214410c5659cdef1c0b1251eb99c7d57496610f43b4fb23b5cd020","compiler_version":"1.3.108","checksum":"sha256:b1497bdaff9a9bdf5bd92e7a0354200a8dfa54f91c9cdf3c254537e95ed883cf"}