File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 73
73
# and fixes some more edge cases not present in the official examples.
74
74
#
75
75
# Changes made:
76
- # - to fix "100/{cells}" issue, we moved FACTOR from component to the simple_unit rule
77
- # - to fix "(8.h){shift}" issue, we moved "(" term ")" from component to the annotatable rule
76
+ # - To fix "100/{cells}" issue, we moved FACTOR from component to the simple_unit rule
77
+ # - To fix "(8.h){shift}" issue, we moved "(" term ")" from component to the annotatable rule
78
78
# - Don't allow "0" as EXPONENT or FACTOR, see https://github.com/ucum-org/ucum/issues/121
79
-
79
+ # - Don't allow curly braces {} inside of annotation STRING (ascii 123 and 125). Without this
80
+ # or escaping rules the end of annotation STRING is ambiguous.
81
+ # - Move term from component rule to annotatable rule. Add maint_term and component to
82
+ # annotatable rule. These changes solve various annotation issues with the original
83
+ # grammar (e.g. "100{pc}", "(/m){ann}", "{ann1}{ann2}").
80
84
# - Distinguish short prefixes (1 char) form long ones to handle parsing of "dar" as deci-are
81
85
# instead of deca-r which does not exist.
82
86
Original file line number Diff line number Diff line change 22
22
"x3" : "(/s)" , # bracketed unary divide
23
23
"x4" : "(/s2{sunit_s2}.(10{factor}.m{sunit_m}){term}){mterm}" , # annotations everywhere
24
24
"x5" : "dar" , # ambiguous prefix-unit combo: deci-are vs. deka-r (unit "r" does not exist)
25
- "x6" : "{}/m" ,
26
- "x7" : "{}" ,
25
+ "x6" : "{}/m" , # operator between annotation and unit
26
+ "x7" : "{}" , # annotation only
27
27
"x8" : "{/ann1/2.g}/m" , # operators in annotation
28
+ "x9" : "{ann1}/{ann2}" , # annotations only with operator
28
29
}
29
30
)
30
31
You can’t perform that action at this time.
0 commit comments