summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2019-09-07 22:54:46 +0300
committerRasmus Andersson <rasmus@notion.se>2019-09-07 22:54:53 +0300
commitd8d4e0c26a82d5632b3833a27b372ff0a6d32d27 (patch)
tree4db08d985db5edf7e518f111fed1b2c19509a5b2
parent8215408fe0ec88720af3de48de9aa7f8e2c440c0 (diff)
downloadinter-d8d4e0c26a82d5632b3833a27b372ff0a6d32d27.tar.xz
improvements to calt, primarily reducing substitutions
closes #193
-rw-r--r--docs/lab/index.html22
-rw-r--r--src/features/calt.fea55
2 files changed, 54 insertions, 23 deletions
diff --git a/docs/lab/index.html b/docs/lab/index.html
index 0d5792601..ae5bb3a47 100644
--- a/docs/lab/index.html
+++ b/docs/lab/index.html
@@ -144,7 +144,7 @@ Dedicated "onefraction" with denominators:
\u215F\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089
Arbitrary fractions with frac feature:
-1/2 1/4 3/4 5/6 7/8 1/8 5/8 3/8
+1/2 1/4 3/4 5/6 7/8 1/8 5/8 3/8 18/29 16/5
0/0 451/980 000/000 0000000000/0000000000
Arbitrary fractions of "onefraction" with frac feature:
@@ -231,8 +231,8 @@ Note on combining-marks compatibility:
samples.set('Feature: calt', `
-(m) (M) (6) [m] [M] [6] {m} {M} {6}
-m@n M@N
+(m). (M). (6). [m]. [M]. [6]. {m}. {M}. {6}.
+m@n. M@N
3×5 3 × 5 ×9 8×
3−5 3 − 5 −5 8− 3+5 +5 3+
3÷5 3 ÷ 5 ÷5 8÷ 3±5 ±5 8±
@@ -283,7 +283,7 @@ left side cascades up to 5 characters:
@@@@@@M@@@@@@
++++++M++++++
-x[x] [X] x lc x lc followed by .case C .case
+x[x]. [X] x lc x lc followed by .case C .case
(Xx) lc uc uc lc
[Zzz] lc uc lc lc lc
(XX)
@@ -294,6 +294,20 @@ x[x] [X] x lc x lc followed by .case C .case
()M
X(_) .case around underscore next to uc
(_) lc otherwise
+
+Foo::Bar() foo::bar() Foo
+foo::bar( ) Foo
+foo::bar()Foo
+foo::bar( )Foo
+FOO::bar This is (a)Thing
+:: dog :: Kitten
+:: dog ::: Kitten
+::Kitten
+::8::
+:8
+X() X()
+x- X
+x -- X
`)
diff --git a/src/features/calt.fea b/src/features/calt.fea
index 6181ce894..fc2d46170 100644
--- a/src/features/calt.fea
+++ b/src/features/calt.fea
@@ -158,32 +158,50 @@ sub [colon colon.case] @DASH parenright' by parenright.case;
# ignore subs adjacent to lower case
#
# x[]X
-ignore sub @LC @CASE_DELIM_L @CASE_DELIM_L @UC;
-ignore sub @LC @CASE_DELIM_L @UC;
-ignore sub @LC @CASE_DELIM_L @Whitespace @UC;
-ignore sub @LC @CASE_DELIM_L @Whitespace @Whitespace @UC;
+ignore sub @LC @CASE_DELIM_L @CASE_DELIM_L @UC; # x[]X
+ignore sub @LC @CASE_DELIM_L @UC; # x[X
+ignore sub @LC @CASE_DELIM_L @Whitespace @UC; # x[ X
+ignore sub @LC @CASE_DELIM_L @Whitespace @Whitespace @UC; # x[ X
+ignore sub @LC @CASE_DELIM_L @CASE_DELIM_L @Whitespace @UC; # x[] X
+ignore sub @LC @CASE_DELIM_L @CASE_DELIM_L @Whitespace @Whitespace @UC; # x[] X
#
-# short runs of uc-lc, e.g "(Xx)", "[Zzz]"
-ignore sub @CASE_DELIM_L @UC @LC @CASE_DELIM_L;
-ignore sub @CASE_DELIM_L @UC @All @LC @CASE_DELIM_L;
-ignore sub @CASE_DELIM_L @LC @UC @CASE_DELIM_L;
-ignore sub @CASE_DELIM_L @LC @All @UC @CASE_DELIM_L;
+# short runs of uc-lc, e.g "(Xx)", "[xxX]"
+ignore sub @CASE_DELIM_L @UC @LC @CASE_DELIM_L; # (Xx)
+ignore sub @CASE_DELIM_L @UC @All @LC @CASE_DELIM_L; # (X.x)
+ignore sub @CASE_DELIM_L @LC @UC @CASE_DELIM_L; # (xX)
+ignore sub @CASE_DELIM_L @LC @All @UC @CASE_DELIM_L; # (x.X)
#
# e.g. "x-"
-# TODO: figure out how to ignore "x--A"
-ignore sub @LC @CASE_L;
+ignore sub @LC @CASE_L'; # x-
+ignore sub @LC [@CASE_L @Whitespace] @CASE_L'; # x--, x -
+ignore sub @LC [@CASE_L @Whitespace] [@CASE_L @Whitespace] @CASE_L'; # x---, x --, x -, x- -
+ignore sub @LC
+ [@CASE_L @Whitespace]
+ [@CASE_L @Whitespace]
+ [@CASE_L @Whitespace]
+ @CASE_L'; # x----, x ---, x --, x -, x- --, x- -, x-- -
+ignore sub @LC
+ [@CASE_L @Whitespace]
+ [@CASE_L @Whitespace]
+ [@CASE_L @Whitespace]
+ [@CASE_L @Whitespace]
+ @CASE_L'; # x----- ...
#
-# e.g. "-x", "--x", "---x", "----x", "-----x"
-ignore sub @CASE_L @LC;
-ignore sub @CASE_L @CASE_L @LC;
-ignore sub @CASE_L @CASE_L @CASE_L @LC;
-ignore sub @CASE_L @CASE_L @CASE_L @CASE_L @LC;
-ignore sub @CASE_L @CASE_L @CASE_L @CASE_L @CASE_L @LC;
+# e.g. "x- "
+ignore sub @LC @CASE_L' @Whitespace; # "x- "
+ignore sub @LC @CASE_L' @Whitespace @Whitespace; # "x- "
+#
+# e.g. "-x"
+ignore sub @CASE_L @LC; # -x
+ignore sub @CASE_L @CASE_L @LC; # --x
+ignore sub @CASE_L @CASE_L @CASE_L @LC; # ---x
+ignore sub @CASE_L @CASE_L @CASE_L @CASE_L @LC; # ----x
+ignore sub @CASE_L @CASE_L @CASE_L @CASE_L @CASE_L @LC; # -----x
+
#
# pairs with space, e.g. "( ) M" since we don't support subbing
# all on the left side.
ignore sub @CASE_DELIM_L @Whitespace @CASE_DELIM_L @Whitespace [ @UC @CASE_R ];
-ignore sub @CASE_DELIM_L @CASE_DELIM_L @Whitespace [ @UC @CASE_R ];
#
# e.g. "A-", "A -", "A -"
sub [ @UC @CASE_R ] @CASE_L' by @CASE_R;
@@ -218,7 +236,6 @@ sub @CASE_L' @CASE_L @Whitespace @Whitespace [ @CASE_R @UC ] by @CASE_R;
sub @CASE_L' @CASE_L @CASE_L @Whitespace @Whitespace [ @CASE_R @UC ] by @CASE_R;
sub @CASE_L' @CASE_L @CASE_L @CASE_L @Whitespace @Whitespace [ @CASE_R @UC ] by @CASE_R;
sub @CASE_L' @CASE_L @CASE_L @CASE_L @CASE_L @Whitespace @Whitespace [ @CASE_R @UC ] by @CASE_R;
-sub @CASE_L' @Whitespace @Whitespace @Whitespace [ @UC @CASE_R ] by @CASE_R; # e.g. "- A"
# X(_)
@Punctuation = [