Introduced ligatures priorities

pull/1048/head
Nikita Prokopov 2020-05-16 04:22:24 +02:00
rodzic cf2979c97b
commit 06a7b3994d
4 zmienionych plików z 42 dodań i 18 usunięć

Wyświetl plik

@ -4,7 +4,10 @@ All notable changes to this project will be documented in this file.
#### 4.0 (May 10, 2020) #### 4.0 (May 10, 2020)
- Arbitrary-long hyphen arrows #346 - Arbitrary-long combinative hyphen-based arrows #346 #494 #713 #826 #968 #983 #1029
- Arbitrary-long combinative equal-based arrows #229 #234 #346 #494 #698 #826 #919 #931 #946 #948 #968 #1016 #1018 #1022
- Arbitrary-long underscores #120 #269 #346 #494
- Arbitrary-long numbersign sequences #1014
- Fixed descender in U+040F `Џ` - Fixed descender in U+040F `Џ`
- Undid #995 and properly fixed U+04CB `Ӌ`, U+04CC`ӌ` #1001 and U+0449 `щ` #1007 - Undid #995 and properly fixed U+04CB `Ӌ`, U+04CC`ӌ` #1001 and U+0449 `щ` #1007

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -32,15 +32,27 @@
" " (str/join " " (drop 1 liga)) " " (str/join " " (drop 1 liga))
";\n")))) ";\n"))))
;; #346 We need << <<< >> >>> || ||| substituted before -- --- == ===
;; so that `ignore [less greater bar] hyphen hyphen` would not trigger (def priorities
(def priority? {;; <|>
#{["less" "less"] ["less" "bar" "greater"] 0
["less" "less" "less"]
["greater" "greater"] ;; |||> ||> |> <| <|| <|||
["greater" "greater" "greater"] ["bar" "bar" "bar" "greater"] 1
["bar" "bar"] ["bar" "bar" "greater"] 1
["bar" "bar" "bar"]}) ["bar" "greater"] 1
["less" "bar" "bar" "bar"] 1
["less" "bar" "bar"] 1
["less" "bar"] 1
;; #346 We need << <<< >> >>> || ||| substituted before -- --- == ===
;; so that `ignore [less greater bar] hyphen hyphen` would not trigger
["less" "less"] 2
["less" "less" "less"] 2
["greater" "greater"] 2
["greater" "greater" "greater"] 2
["bar" "bar"] 2
["bar" "bar" "bar"] 2})
(def ignores (def ignores
@ -106,11 +118,13 @@
["less" "less" "less"] ["less" "less" "less"]
" ignore sub less' less less [asterisk plus dollar];\n" " ignore sub less' less less [asterisk plus dollar];\n"
;; #948 [==[ ]==]
;; #968 [== ==] ;; #968 [== ==]
["equal" "equal"] ["equal" "equal"]
(str " ignore sub bracketleft equal' equal;\n" (str " ignore sub bracketleft equal' equal;\n"
" ignore sub equal' equal bracketright;\n") " ignore sub equal' equal bracketright;\n")
;; #948 [===[ ]===]
;; #968 [=== ===] ;; #968 [=== ===]
["equal" "equal" "equal"] ["equal" "equal" "equal"]
(str " ignore sub bracketleft equal' equal equal;\n" (str " ignore sub bracketleft equal' equal equal;\n"
@ -268,12 +282,16 @@
(defn compare-ligas [l1 l2] (defn compare-ligas [l1 l2]
(cond (let [p1 (priorities l1 Long/MAX_VALUE)
(and (priority? l1) (not (priority? l2))) -1 p2 (priorities l2 Long/MAX_VALUE)
(and (not (priority? l1)) (priority? l2)) 1 pc (compare p1 p2)
(> (count l1) (count l2)) -1 c1 (count l1)
(< (count l1) (count l2)) 1 c2 (count l2)
:else (compare l1 l2))) cc (compare c1 c2)]
(cond
(not= 0 pc) pc ;; lower priority first
(not= 0 cc) (- cc) ;; longer first
:else (compare l1 l2)))) ;; alphabetical
(defn replace-calt [font ligas] (defn replace-calt [font ligas]

Wyświetl plik

@ -320,7 +320,7 @@ _| |_ _||_ __| ___| |__ |___
# Sanity check # Sanity check
- -- --- |> <| ||> <|| <!-- -~ .- ~- - -- --- |> <| ||> <|| |||> <||| <!-- -~ .- ~-
= == === .= ..= := ::= != !== ?= #= ^= = == === .= ..= := ::= != !== ?= #= ^=
<= <=< <=> <=| <= <=< <=> <=|