Files
Iosevka/otl/gsub-ligation.ptl
T
2020-03-19 21:45:36 -07:00

744 lines
26 KiB
Plaintext

import [add-common-feature add-feature ChainRuleBuilder] from "./table-util"
define-operator "~>" 880 'right' : syntax-rules
`(@l ~> @r) `{.left @l .right @r}
define [lsx s] : lambda [t] : t.map : lambda [x] "\(x).lig.\(s)"
define [csx s] : lambda [t] : t.map : lambda [x] "\(x).\(s)"
define [just s] : lambda [t] : t.map : lambda [x] s
define preserved null
define advance : lambda [t] : t.map : lambda [x] x
export : define [buildLigations sink plm glyphs] : foreach [ {featureName mappedFeature} : pairs-of plm] : do
define chain-rule : ChainRuleBuilder sink
define arrowStick {'hyphen' 'equal'}
define [stick style] : {'hyphen' 'equal'} ~> [lsx style]
define [stickClass style] : [lsx style] {'hyphen' 'equal'}
define less {'less'}
define hyphen {'hyphen'}
define equal {'equal'}
define exclam {'exclam'}
define greater {'greater'}
define anyWave {'asciitilde' 'asciitilde.low' 'asciitilde.high'}
define anyBar {'bar' 'slash' 'backslash'}
define slash {'slash'}
define backslash {'backslash'}
define bar {'bar'}
define regexLookAround [less.concat hyphen equal exclam greater anyBar]
define [waveClass cl] : [just ('wave.' + cl)] anyWave
define alphabetRaw {
'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm'
'n' 'o' 'p' 'q' 'r' 's' 't' 'u' 'v' 'w' 'x' 'y' 'z'
'A' 'B' 'C' 'D' 'E' 'F' 'G' 'H' 'I' 'J' 'K' 'L' 'M'
'N' 'O' 'P' 'Q' 'R' 'S' 'T' 'U' 'V' 'W' 'X' 'Y' 'Z'
'zero.lnum' 'zero.onum' 'one.lnum' 'one.onum'
'two.lnum' 'two.onum' 'three.lnum' 'three.onum'
'four.lnum' 'four.onum' 'five.lnum' 'five.onum'
'six.lnum' 'six.onum' 'seven.lnum' 'seven.onum'
'eight.lnum' 'eight.onum' 'nine.lnum' 'nine.onum'
}
define [acops] {'less' 'greater' 'hyphen' 'equal' 'plus'}
define [acskip] {
'slash' 'bar' 'at' 'ampersand' 'percent'
'numbersign' 'numbersign.upright' 'numbersign.slanted'
}
define [asterisk_center] ({'asterisk' 'asterisk.high' 'asterisk.low' 'asterisk.hexhigh' 'asterisk.hexlow'} ~> {'asterisk.dfltlow' 'asterisk.low' 'asterisk.low' 'asterisk.hexlow' 'asterisk.hexlow'})
define [colon_center] ({'colon' 'colon.mid'} ~> {'colon.mid' 'colon.mid'})
define [caret_center] ({'asciicaret' 'asciicaret.high' 'asciicaret.low'} ~> {'asciicaret.low' 'asciicaret.low' 'asciicaret.low'})
define [tilde_center] ({'asciitilde' 'asciitilde.high' 'asciitilde.low'} ~> {'asciitilde.low' 'asciitilde.low' 'asciitilde.low'})
define [period_center] ({'period'} ~> {'period.center'})
define [no_period_center] ({'period.center'} ~> {'period'})
local alphabet : do
local g {}
foreach [gid : items-of alphabetRaw] : begin
g.push gid
if (glyphs.(gid) && glyphs.(gid).featureSelector) : begin
foreach [{k v} : pairs-of glyphs.(gid).featureSelector] : begin
g.push v
* g
local ligationLookupName : 'lig_' + featureName + '-' + mappedFeature
define [hasLG ln] : [mappedFeature.indexOf ln] >= 0
define [only ln f g] : lambda [left] : begin
if [not : hasLG ln]
: then : begin
if g
: then : piecewise
(g <@ Function) : g left
true : return g
: else : return null
: else : piecewise
(f <@ Function) : f left
true : return f
define feature : add-common-feature sink : add-feature sink featureName
local lastLookupName null
local [dedup ln0 obj] : begin
local h : JSON.stringify obj
foreach [{name lookup} : pairs-of sink.lookups] : begin
local h1 : JSON.stringify lookup
if (h == h1) : return name
return ln0
local [includeLookup obj] : begin
local ln : dedup (ligationLookupName + feature.lookups.length) obj
if [not sink.lookups.(ln)] : set sink.lookups.(ln) obj
feature.lookups.push ln
if lastLookupName : sink.lookupDep.push {lastLookupName ln}
set lastLookupName ln
do "Operator centering" : if [hasLG "center-ops"] : begin
define centerizeGroups : { asterisk_center caret_center tilde_center colon_center [if [hasLG 'dotoper'] period_center nothing]}.filter (x => x)
define [centerize-standard g] : includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule [g] [g] [acskip] [acskip] [acops] # ::+
chain-rule [g] [g] [acskip] [acops] # ::+
chain-rule [g] [g] [acops] # ::+
chain-rule [g] [acskip] [acskip] [acops] # :+
chain-rule [g] [acskip] [acops] # :+
chain-rule [g] [acops] # :+
chain-rule [acops] [acskip] [acskip] [g] # +:
chain-rule [acops] [acskip] [g] # +:
chain-rule [acops] [g] # +:
define [centerize-cross g1 g2] : includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule [g1] [g1] [g2] # ::*
chain-rule [g1] [g2] # :*
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule # (*
{'parenLeft'} ~> preserved
{'asterisk'} ~> [only 'brst' {'asterisk.dfltlow'}]
chain-rule # *)
{'asterisk'} ~> [only 'brst' {'asterisk.dfltlow'}]
{'parenRight'} ~> preserved
# Smiley :)
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule # (:
{'parenLeft' 'bracketLeft' 'braceLeft'} ~> preserved
colon_center
chain-rule # :)
colon_center
{'parenRight' 'bracketRight' 'braceRight'} ~> preserved
# Operator centering
foreach [g : items-of centerizeGroups] : begin
centerize-standard g
# foreach [g2 : items-of centerizeGroups] : if (g != g2) : centerize-cross g g2
# Operator centering : Trailing
local centerizeL : centerizeGroups.map : x => [x].left.0
local centerizeR : centerizeGroups.map : lambda [x] : begin
local left [x].left
local right [x].right
while (right <@ Function) : set right [right left]
return : if right (right.0 || left.0) (left.0)
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule centerizeR [acskip] [acskip] (centerizeL ~> centerizeR)
chain-rule centerizeR [acskip] (centerizeL ~> centerizeR)
chain-rule centerizeR (centerizeL ~> centerizeR)
includeLookup
.type 'gsub_reverse'
.subtables : list
object
match {centerizeL [acskip] [acskip] centerizeR}
to centerizeR
inputIndex 0
object
match {centerizeL [acskip] centerizeR}
to centerizeR
inputIndex 0
object
match {centerizeL centerizeR}
to centerizeR
inputIndex 0
# Operator centering : Avoid "letter-point" being centered
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule alphabet [no_period_center]
chain-rule [no_period_center] alphabet
do "Colon chains" : includeLookup
.type 'gsub_chaining'
.subtables : list
# Colon chains
chain-rule
{'colon.dright' 'colon.dmid'} ~> preserved
{'colon'} ~> [only 'colons' {'colon.dmid'}]
{'colon'} ~> preserved
chain-rule
{'colon.dright' 'colon.dmid'} ~> preserved
{'colon'} ~> [only 'colons' {'colon.dleft'}]
chain-rule
{'colon'} ~> [only 'colons' {'colon.dright'}]
{'colon'} ~> preserved
do "Plus chains" : begin
includeLookup
.type 'gsub_chaining'
.subtables : list
# +++++++++
chain-rule
{'plus.lig.cr' 'plus.lig.jr'} ~> preserved
{'plus'} ~> [only 'plusplus' : lsx 'jr']
chain-rule
{'plus'} ~> [only 'plusplus' : lsx 'lc']
{'plus'} ~> [only 'plusplus' : lsx 'cc']
{'plus'} ~> [only 'plusplus' : lsx 'cc']
{'plus'} ~> [only 'plusplus' : lsx 'cr']
chain-rule
{'plus'} ~> [only 'plusplus' : lsx 'lc']
{'plus'} ~> [only 'plusplus' : lsx 'cc']
{'plus'} ~> [only 'plusplus' : lsx 'cr']
chain-rule
{'plus'} ~> [only 'plusplus' : lsx 'lc']
{'plus'} ~> [only 'plusplus' : lsx 'cr']
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule # +++
{'plus.lig.lc'} ~> [only 'plusplus' {'plus.lig.lc.s'}]
{'plus.lig.cc'} ~> preserved
{'plus.lig.cr'} ~> [only 'plusplus' {'plus.lig.cr.s'}]
chain-rule # ++
{'plus.lig.lc'} ~> [only 'plusplus' {'plus.lig.lc.s'}]
{'plus.lig.cr'} ~> [only 'plusplus' {'plus.lig.cr.s'}]
do "triangles" : begin
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule # <|
less ~> [only 'trig' : lsx 'trig']
{'bar'} ~> [only 'trig' : lsx 'trig']
chain-rule # |>
{'bar'} ~> [only 'trig' : lsx 'trig']
greater ~> [only 'trig' : lsx 'trig']
chain-rule # |>
[[lsx 'trig'] {'bar'}] ~> preserved
greater ~> [only 'trig' : lsx 'trig']
chain-rule # <||||
[[lsx 'trig'] {'bar'}] ~> preserved
{'bar'} ~> [only 'trig' : lsx 'trig']
includeLookup
.type 'gsub_reverse'
.subtables : list
object # ||||>
match {{'bar'} [[lsx 'trig'] {'bar'}]}
to [[lsx 'trig'] {'bar'}]
inputIndex 0
do "Arrows"
includeLookup
.type 'gsub_chaining'
.subtables : list
# Disable regular expression lookaheads
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule # <====>
less ~> [only 'arrow' : lsx 'dblhead']
equal ~> [only 'arrow' : lsx 'sc']
equal ~> [only 'arrow' : lsx 'cc']
equal ~> [only 'arrow' : lsx 'cc']
equal ~> [only 'arrow' : lsx 'cs']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # <---->
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lc']
hyphen ~> [only 'arrow' : lsx 'cc']
hyphen ~> [only 'arrow' : lsx 'cc']
hyphen ~> [only 'arrow' : lsx 'cr']
greater ~> preserved
chain-rule # <===>
less ~> [only 'arrow' : lsx 'dblhead']
equal ~> [only 'arrow' : lsx 'sc']
equal ~> [only 'arrow' : lsx 'cc']
equal ~> [only 'arrow' : lsx 'cs']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # <--->
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lc']
hyphen ~> [only 'arrow' : lsx 'cc']
hyphen ~> [only 'arrow' : lsx 'cr']
greater ~> preserved
chain-rule # <==>
less ~> [only 'arrow' : lsx 'dblhead']
equal ~> [only 'arrow' : lsx 'sc']
equal ~> [only 'arrow' : lsx 'cs']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # <-->
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lc']
hyphen ~> [only 'arrow' : lsx 'cr']
greater ~> preserved
chain-rule # <=>
less ~> [only 'arrow' : lsx 'dblhead']
equal ~> [only 'arrow' : lsx 'ss']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # <->
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lr']
greater ~> preserved
chain-rule # <~>
less ~> preserved
anyWave ~> [only 'arrow' : just 'wave.lr']
greater ~> preserved
chain-rule # <--<
less ~> preserved
hyphen ~> [only 'arrow2' : lsx 'lc']
hyphen ~> [only 'arrow2' : lsx 'cj']
less ~> preserved
chain-rule # <==<
less ~> [only 'arrow2' : lsx 'dblhead']
equal ~> [only 'arrow2' : lsx 'sc']
equal ~> [only 'arrow2' : lsx 'cj']
less ~> [only 'arrow2' : lsx 'hole']
chain-rule # <-<
less ~> preserved
hyphen ~> [only 'arrow2' : lsx 'lj']
less ~> preserved
chain-rule # <=<
less ~> [only 'arrow2' : lsx 'dblhead']
equal ~> [only 'arrow2' : lsx 'sj']
less ~> [only 'arrow2' : lsx 'hole']
chain-rule # <===
less ~> [only 'arrow' : lsx 'dblhead']
equal ~> [only 'arrow' : lsx 'sc']
equal ~> [only 'arrow' : lsx 'cc']
equal ~> [only 'arrow' : lsx 'cf']
chain-rule # <---
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lc']
hyphen ~> [only 'arrow' : lsx 'cc']
hyphen ~> [only 'arrow' : lsx 'cf']
chain-rule # <=|
less ~> [only 'arrow' : lsx 'dblhead']
equal ~> [only 'arrow' : lsx 'sj']
anyBar ~> preserved
chain-rule # <-|
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lj']
anyBar ~> preserved
chain-rule # <==
less ~> [only 'arrow' : lsx 'dblhead']
equal ~> [only 'arrow' : lsx 'sc']
equal ~> [only 'arrow' : lsx 'cf']
chain-rule # <--
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lc']
hyphen ~> [only 'arrow' : lsx 'cf']
chain-rule # <<=
less ~> [only 'arrow' : lsx 'shift0']
less ~> [only 'arrow' : lsx 'dblhead.shift1']
equal ~> [only 'arrow' : lsx 's1f']
chain-rule # <<-
less ~> [only 'arrow' : lsx 'shift0']
less ~> [only 'arrow' : lsx 'shift1']
hyphen ~> [only 'arrow' : lsx 'l1f']
chain-rule # <-
less ~> preserved
hyphen ~> [only 'arrow' : lsx 'lf']
chain-rule # <~
less ~> preserved
anyWave ~> [only 'arrow' : just 'wave.lf']
chain-rule # <=
less ~> preserved
equal ~> [only 'arrowZALE' : lsx 'sf']
chain-rule # <!---
less ~> preserved
exclam ~> [only 'html-comment' : lsx 'htmlcommentstart']
hyphen ~> [only 'html-comment' : lsx 'lxc']
hyphen ~> [only 'html-comment' : lsx 'cc']
hyphen ~> [only 'html-comment' : lsx 'cf']
chain-rule # <!--
less ~> preserved
exclam ~> [only 'html-comment' : lsx 'htmlcommentstart']
hyphen ~> [only 'html-comment' : lsx 'lxc']
hyphen ~> [only 'html-comment' : lsx 'cf']
chain-rule # >>-
greater ~> preserved
greater ~> [only 'arrow2' : lsx 'shiftN1']
hyphen ~> [only 'arrow2' : lsx 'j1f']
chain-rule # >>=
greater ~> preserved
greater ~> [only 'arrow2' : lsx 'shiftN1.hole']
equal ~> [only 'arrow2' : lsx 'j1f']
chain-rule # >-->
greater ~> preserved
hyphen ~> [only 'arrow2' : lsx 'jc']
hyphen ~> [only 'arrow2' : lsx 'cr']
greater ~> preserved
chain-rule # >==>
greater ~> [only 'arrow2' : lsx 'hole']
equal ~> [only 'arrow2' : lsx 'jc']
equal ~> [only 'arrow2' : lsx 'cs']
greater ~> [only 'arrow2' : lsx 'dblhead']
chain-rule # >->
greater ~> preserved
hyphen ~> [only 'arrow2' : lsx 'jr']
greater ~> preserved
chain-rule # >=>
greater ~> [only 'arrow2' : lsx 'hole']
equal ~> [only 'arrow2' : lsx 'js']
greater ~> [only 'arrow2' : lsx 'dblhead']
chain-rule # >-
greater ~> preserved
hyphen ~> [only 'arrow2' : lsx 'jf']
chain-rule # ===>
equal ~> [only 'arrow': lsx 'fc']
equal ~> [only 'arrow': lsx 'cc']
equal ~> [only 'arrow': lsx 'cs']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # --->
hyphen ~> [only 'arrow': lsx 'fc']
hyphen ~> [only 'arrow': lsx 'cc']
hyphen ~> [only 'arrow': lsx 'cr']
greater ~> preserved
chain-rule # ==>
equal ~> [only 'arrow': lsx 'fc']
equal ~> [only 'arrow': lsx 'cs']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # -->
hyphen ~> [only 'arrow': lsx 'fc']
hyphen ~> [only 'arrow': lsx 'cr']
greater ~> preserved
chain-rule # |=>
anyBar ~> preserved
equal ~> [only 'arrow': lsx 'js']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # |->
anyBar ~> preserved
hyphen ~> [only 'arrow': lsx 'jr']
greater ~> preserved
chain-rule # =>=
equal ~> [only 'arrow2' : lsx 'fs']
greater ~> [only 'arrow2' : lsx 'dblhead']
equal ~> [only 'arrow2' : lsx 'jf']
chain-rule # ->-
hyphen ~> [only 'arrow2' : lsx 'fr']
greater ~> preserved
hyphen ~> [only 'arrow2' : lsx 'jf']
chain-rule # =>>
equal ~> [only 'arrow' : lsx 'fs1']
greater ~> [only 'arrow' : lsx 'dblhead.shift1']
greater ~> [only 'arrow' : lsx 'shift0']
chain-rule # ->>
hyphen ~> [only 'arrow' : lsx 'fr1']
greater ~> [only 'arrow' : lsx 'shift1']
greater ~> [only 'arrow' : lsx 'shift0']
chain-rule # =>
equal ~> [only 'arrow' : lsx 'fs']
greater ~> [only 'arrow' : lsx 'dblhead']
chain-rule # ->
hyphen ~> [only 'arrow' : lsx 'fr']
greater ~> preserved
chain-rule # ~>
anyWave ~> [only 'arrow' : just 'wave.fr']
greater ~> preserved
chain-rule # =<=
equal ~> [only 'arrow2' : lsx 'fj']
less ~> [only 'arrow2' : lsx 'dblhead']
equal ~> [only 'arrow2' : lsx 'sf']
chain-rule # -<-
hyphen ~> [only 'arrow2' : lsx 'fj']
less ~> preserved
hyphen ~> [only 'arrow2' : lsx 'lf']
chain-rule # -<<
hyphen ~> [only 'arrow2' : lsx 'fj1']
less ~> [only 'arrow2' : lsx 'shiftN1']
less ~> preserved
chain-rule # =<<
equal ~> [only 'arrow2' : lsx 'fj1']
less ~> [only 'arrow2' : lsx 'shiftN1.hole']
less ~> preserved
chain-rule # =<
equal ~> [only 'arrow2' : lsx 'fj']
less ~> [only 'arrow2' : lsx 'hole']
chain-rule # -<
hyphen ~> [only 'arrow2' : lsx 'fj']
less ~> preserved
chain-rule # >=
greater ~> [only 'arrowZAGE' : lsx 'hole']
equal ~> [only 'arrowZAGE' : lsx 'jf']
# <<, >>, <<<, >>>
includeLookup
.type 'gsub_chaining'
.subtables : list
# Disable regular expression lookaheads
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule # <<<
less ~> [only 'llgg' : lsx 'shiftN0h']
less ~> preserved
less ~> [only 'llgg' : lsx 'shift0h']
chain-rule # >>>
greater ~> [only 'llgg' : lsx 'shift0h']
greater ~> preserved
greater ~> [only 'llgg' : lsx 'shiftN0h']
chain-rule # <<
less ~> [only 'llgg' : lsx 'shiftN0h']
less ~> [only 'llgg' : lsx 'shift0h']
chain-rule # >>
greater ~> [only 'llgg' : lsx 'shift0h']
greater ~> [only 'llgg' : lsx 'shiftN0h']
# Cancel alternates of < and > shapes if there are more after them
local lAll {"less" "less.lig.shift0h" "less.lig.shiftN0h"}
local lNeut {"less" "less" "less"}
local gAll {"greater" "greater.lig.shift0h" "greater.lig.shiftN0h"}
local gNeut {"greater" "greater" "greater"}
local lgAll : lAll.concat gAll
local lgNeut : lNeut.concat gNeut
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule
lgAll ~> [only 'llgg' lgNeut]
lgAll ~> [only 'llgg' lgNeut]
lgAll ~> [only 'llgg' lgNeut]
lgAll ~> preserved
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule
lgAll ~> preserved
lgAll ~> preserved
lgAll ~> preserved
lgAll ~> [only 'llgg' lgNeut]
includeLookup # Cleanup mixes
.type 'gsub_chaining'
.subtables : list
chain-rule
lAll ~> [only 'llgg' lNeut]
lAll ~> [only 'llgg' lNeut]
gAll ~> [only 'llgg' gNeut]
chain-rule
gAll ~> [only 'llgg' gNeut]
gAll ~> [only 'llgg' gNeut]
lAll ~> [only 'llgg' lNeut]
chain-rule
lAll ~> [only 'llgg' lNeut]
gAll ~> [only 'llgg' gNeut]
gAll ~> [only 'llgg' gNeut]
chain-rule
gAll ~> [only 'llgg' gNeut]
lAll ~> [only 'llgg' lNeut]
lAll ~> [only 'llgg' lNeut]
# Extended arrow sticks
# --------------------->
includeLookup
.type 'gsub_reverse'
.subtables : list
object
match {{'hyphen' 'equal'} [stickClass 'fr']}
to [stickClass 'fz']
inputIndex 0
object
match {{'hyphen' 'equal'} [stickClass 'fc']}
to [stickClass 'fz']
inputIndex 0
object
match {{'hyphen' 'equal'} [stickClass 'fz']}
to [stickClass 'fz']
inputIndex 0
object
match {anyWave {'wave.fr' 'wave.fz'}}
to [waveClass 'fz']
inputIndex 0
# <--------------------, <------------------->
includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule ([stickClass 'cf'] ~> [stickClass 'cc']) ([stickClass 'fc'] ~> [stickClass 'cc'])
chain-rule ([stickClass 'zf'] ~> [stickClass 'zc']) ([stickClass 'fr'] ~> [stickClass 'cr'])
chain-rule ([stickClass 'zf'] ~> [stickClass 'zc']) ([stickClass 'fc'] ~> [stickClass 'cc'])
chain-rule ([stickClass 'lf'] ~> [stickClass 'lc']) ([stickClass 'fz'] ~> [stickClass 'cz'])
chain-rule ([stickClass 'cf'] ~> [stickClass 'cc']) ([stickClass 'fz'] ~> [stickClass 'cz'])
chain-rule ([stickClass 'zf'] ~> [stickClass 'zc']) ([stickClass 'fz'] ~> [stickClass 'cz'])
chain-rule [stickClass 'lf'] [stick 'zf']
chain-rule [stickClass 'cf'] [stick 'zf']
chain-rule [stickClass 'zf'] [stick 'zf']
chain-rule ({'wave.lf' 'wave.zf'} ~> preserved) (anyWave ~> [just 'wave.zf'])
chain-rule ({'wave.lf'} ~> {'wave.lz'}) ({'wave.fr' 'wave.fz'} ~> preserved)
# /\ and \/
do "logical" : includeLookup
.type 'gsub_chaining'
.subtables : list
chain-rule
slash ~> [only 'logic' : csx 'left']
backslash ~> [only 'logic' : csx 'right']
chain-rule
backslash ~> [only 'logic' : csx 'left']
slash ~> [only 'logic' : csx 'right']
chain-rule
bar ~> preserved
hyphen ~> [only 'logic' : lsx 'jf']
chain-rule
hyphen ~> [only 'logic' : lsx 'fj']
bar ~> preserved
# == and !=, and other related
do "equals" : includeLookup
.type 'gsub_chaining'
.subtables : list
# Disable regular expression lookaheads
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'equal.cf' 'equal.jf'} ~> preserved
equal ~> [only 'eqeq' {'equal.jf'}]
chain-rule
exclam ~> [only 'exeq' {'equal.fc.neg4'}]
equal ~> [only 'exeq' {'equal.cc'}]
equal ~> [only 'exeq' {'equal.cc'}]
equal ~> [only 'exeq' {'equal.cf'}]
chain-rule
equal ~> [only 'eqeq' {'equal.fc'}]
equal ~> [only 'eqeq' {'equal.cc'}]
equal ~> [only 'eqeq' {'equal.cc'}]
equal ~> [only 'eqeq' {'equal.cf'}]
chain-rule
exclam ~> [only 'exeqeq' {'ident.fc.neg3'} : only 'exeq' {'equal.fc.neg3'}]
equal ~> [only 'exeqeq' {'ident.cc'} : only 'exeq' {'equal.cc'}]
equal ~> [only 'exeqeq' {'ident.cf'} : only 'exeq' {'equal.cf'}]
chain-rule
equal ~> [only 'eqexeq' {'ident.fc.neg3'}]
exclam ~> [only 'eqexeq' {'ident.cc'}]
equal ~> [only 'eqexeq' {'ident.cf'}]
chain-rule
equal ~> [only 'eqslasheq' {'ident.fc.neg3'} : only 'slasheq' {'equal.fc.neg3'}]
slash ~> [only 'eqslasheq' {'ident.cc'} : only 'slasheq' {'equal.cc'}]
equal ~> [only 'eqslasheq' {'ident.cf'} : only 'slasheq' {'equal.cf'}]
chain-rule
equal ~> [only 'eqeqeq' {'ident.fc'} : only 'eqeq' {'equal.fc'}]
equal ~> [only 'eqeqeq' {'ident.cc'} : only 'eqeq' {'equal.cc'}]
equal ~> [only 'eqeqeq' {'ident.cf'} : only 'eqeq' {'equal.cf'}]
chain-rule
exclam ~> [only 'exeq' {'equal.fc.neg'}]
equal ~> [only 'exeq' {'equal.cf'}]
chain-rule
anyWave ~> [only 'tildeeq' : just 'equal.fc.neg']
equal ~> [only 'tildeeq' {'equal.cf'}]
chain-rule
slash ~> [only 'slasheq' {'equal.fc.neg'}]
equal ~> [only 'slasheq' {'equal.cf'}]
chain-rule
less ~> [only 'ltgt-diamond' [lsx 'diamond'] : only 'ltgt-ne' [just 'equal.fc.neg']]
greater ~> [only 'ltgt-diamond' [lsx 'diamond'] : only 'ltgt-ne' [just 'equal.cf']]
chain-rule
equal ~> [only 'eqeq' {'equal.fc'}]
equal ~> [only 'eqeq' {'equal.cf'}]
# <= and >=
do "inequals" : includeLookup
.type 'gsub_chaining'
.subtables : list
# Disable regular expression lookaheads
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
{'parenLeft'} ~> preserved
{'question'} ~> preserved
regexLookAround ~> advance
regexLookAround ~> advance
chain-rule
[acops] ~> preserved
{'less' 'greater'} ~> advance
equal ~> advance
chain-rule
{'less' 'greater'} ~> advance
equal ~> advance
[acops] ~> preserved
chain-rule
{'less'} ~> [only 'ineq' {'less.lig2'}]
equal ~> [only 'ineq' {'eq.at-lteq.lig2'}]
chain-rule
{'greater'} ~> [only 'ineq' {'greater.lig2'}]
equal ~> [only 'ineq' {'eq.at-gteq.lig2'}]