Adjust serif shapes for lowercase italic Yeri glyphs with corner body shape (#2151).
This commit is contained in:
parent
92e85b86d3
commit
384a6fb10e
6 changed files with 248 additions and 187 deletions
|
@ -1 +1,2 @@
|
|||
* Fix application of `APLF` for several [Uiua](https://www.uiua.org/) operators.
|
||||
* Adjust serif shapes for lowercase italic Yeri glyphs with corner body shape (#2151).
|
||||
|
|
|
@ -515,25 +515,23 @@ glyph-block CommonShapes : begin
|
|||
return : HookShape before after false args
|
||||
|
||||
glyph-block-export hookstart
|
||||
define [hookstart] : begin
|
||||
postulate
|
||||
y
|
||||
tight
|
||||
sw -- Stroke
|
||||
swItalicAdj -- sw
|
||||
noAdjTerminalY -- false
|
||||
turnSlope -- nothing
|
||||
define flex-params [hookstart] : begin
|
||||
local-parameter : y
|
||||
local-parameter : tight
|
||||
local-parameter : sw -- Stroke
|
||||
local-parameter : swItalicAdj -- sw
|
||||
local-parameter : noAdjTerminalY -- false
|
||||
local-parameter : turnSlope -- nothing
|
||||
return : Interpolator hookStartBlender : object y tight sw swItalicAdj noAdjTerminalY turnSlope
|
||||
|
||||
glyph-block-export hookend
|
||||
define [hookend] : begin
|
||||
postulate
|
||||
y
|
||||
tight
|
||||
sw -- Stroke
|
||||
swItalicAdj -- sw
|
||||
noAdjTerminalY -- false
|
||||
turnSlope -- nothing
|
||||
define flex-params [hookend] : begin
|
||||
local-parameter : y
|
||||
local-parameter : tight
|
||||
local-parameter : sw -- Stroke
|
||||
local-parameter : swItalicAdj -- sw
|
||||
local-parameter : noAdjTerminalY -- false
|
||||
local-parameter : turnSlope -- nothing
|
||||
return : Interpolator hookEndBlender : object y tight sw swItalicAdj noAdjTerminalY turnSlope
|
||||
|
||||
glyph-block-export Ungizmo
|
||||
|
|
|
@ -13,8 +13,16 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
|
||||
define DefaultBarPos 0.55
|
||||
|
||||
glyph-block-export CyrlYeriUprightShape
|
||||
define [CyrlYeriUprightShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||
define Yeri : namespace
|
||||
define flex-params [CornerCommon] : glyph-proc
|
||||
local-parameter : top
|
||||
local-parameter : left -- SB
|
||||
local-parameter : right -- RightSB
|
||||
local-parameter : stroke -- Stroke
|
||||
local-parameter : jut -- Jut
|
||||
local-parameter : pBar -- DefaultBarPos
|
||||
local-parameter : yStart -- top
|
||||
|
||||
local bowl : top * pBar + HalfStroke
|
||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||
|
@ -36,12 +44,39 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
curl (left + Stroke * 0.2) bowl [heading Leftward]
|
||||
VBar.l left 0 yStart stroke
|
||||
|
||||
export : define flex-params [UprightShape] : glyph-proc
|
||||
local-parameter : top
|
||||
local-parameter : left -- SB
|
||||
local-parameter : right -- RightSB
|
||||
local-parameter : stroke -- Stroke
|
||||
local-parameter : jut -- Jut
|
||||
local-parameter : pBar -- DefaultBarPos
|
||||
local-parameter : yStart -- top
|
||||
|
||||
include : CornerCommon.apply null $-flex-arguments
|
||||
if SLAB : begin
|
||||
include : tagged 'serifYeriLB' : HSerif.lb left 0 (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||
include : tagged 'serifYeriLT' : HSerif.mt (left + [HSwToV : 0.5 * stroke]) top jut stroke
|
||||
|
||||
glyph-block-export CyrlYeriRoundShape
|
||||
define [CyrlYeriRoundShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||
export : define flex-params [ItalicShape] : glyph-proc
|
||||
local-parameter : top
|
||||
local-parameter : left -- SB
|
||||
local-parameter : right -- RightSB
|
||||
local-parameter : stroke -- Stroke
|
||||
local-parameter : jut -- Jut
|
||||
local-parameter : pBar -- DefaultBarPos
|
||||
local-parameter : yStart -- top
|
||||
|
||||
include : CornerCommon.apply null $-flex-arguments
|
||||
if SLAB : begin
|
||||
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||
|
||||
export : define flex-params [AutoItalicShape] : begin
|
||||
if para.isItalic
|
||||
: then : ItalicShape.apply null $-flex-arguments
|
||||
: else : UprightShape.apply null $-flex-arguments
|
||||
|
||||
export : define flex-params [RoundShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||
local bowl : top * pBar + HalfStroke
|
||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||
|
@ -65,8 +100,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
if SLAB : begin
|
||||
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||
|
||||
glyph-block-export CyrlYeriCursiveShape
|
||||
define [CyrlYeriCursiveShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||
export : define flex-params [CursiveShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||
local bowl : top * pBar + HalfStroke
|
||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||
|
@ -91,7 +125,8 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
if SLAB : begin
|
||||
include : tagged 'serifYeriLT' : HSerif.lt left top (jut - [HSwToV : 0.5 * stroke]) stroke
|
||||
|
||||
define [RevCyrYeriShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
||||
define RevYeri : namespace
|
||||
export : define flex-params [Shape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
||||
local bowl : top * pBar + HalfStroke
|
||||
local turnRadius : bowl * 0.45
|
||||
local turnbottom : mix 0 bowl (ArchDepthB / (ArchDepthA + ArchDepthB))
|
||||
|
@ -112,7 +147,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
include : tagged 'serifYeriRT'
|
||||
HSerif.mt (right - [HSwToV : 0.5 * stroke]) top jut stroke
|
||||
|
||||
define [RevCyrYeriRoundShape] : with-params [top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||
export : define flex-params [RoundShape top [left SB] [right RightSB] [stroke Stroke] [jut Jut] [pBar DefaultBarPos] [yStart top]] : glyph-proc
|
||||
local bowl : top * pBar + HalfStroke
|
||||
local turnRadius : BowlXDepth bowl 0 left right stroke
|
||||
local ada : ArchDepthAOf ArchDepth (right - left + SB * 2)
|
||||
|
@ -133,7 +168,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
flat ([mix left right 0.5] - CorrectionOMidX * stroke) bowl
|
||||
curl (right - Stroke * 0.2) bowl [heading Rightward]
|
||||
|
||||
define [CyrBackYerShape] : with-params [Yeri top left right [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
||||
define flex-params [CyrBackYerShape Yeri top left right [stroke Stroke] [jut Jut] [pBar DefaultBarPos]] : glyph-proc
|
||||
local xLeftBarLeftEdge : Math.max (right - (RightSB - SB)) : if SLAB
|
||||
[mix left right 0.35] - [HSwToV : 0.50 * stroke]
|
||||
[mix left right 0.20] - [HSwToV : 0.25 * stroke]
|
||||
|
@ -151,7 +186,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
include : VSerif.dl xTopBarLeftEnd top VJut
|
||||
Math.min (VJutStroke * stroke / Stroke) (0.625 * (xLeftBarLeftEdge - xTopBarLeftEnd))
|
||||
|
||||
define [CyrNeutralYerShape] : with-params [Yeri top left right [stroke Stroke] [jut Jut]] : glyph-proc
|
||||
define flex-params [CyrNeutralYerShape Yeri top left right [stroke Stroke] [jut Jut]] : glyph-proc
|
||||
local xLeftBarLeftEdge : Math.max (right - (RightSB - SB)) : if SLAB
|
||||
[mix left right 0.35] - [HSwToV : 0.50 * stroke]
|
||||
[mix left right 0.20] - [HSwToV : 0.25 * stroke]
|
||||
|
@ -190,13 +225,15 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
RightwardTailedBar df.rightSB 0 top sw
|
||||
VBar.r df.rightSB 0 top sw
|
||||
|
||||
local useFullSerifs : Yeri === Yeri.UprightShape || Yeri === Yeri.AutoItalicShape && !para.isItalic
|
||||
|
||||
if SLAB : begin
|
||||
include : tagged 'serifRT' : if (Yeri !== CyrlYeriUprightShape)
|
||||
then : glyph-proc
|
||||
else : HSerif.mt (df.rightSB - [HSwToV : 0.5 * sw]) top jut sw
|
||||
if (!fTail) : include : tagged 'serifRB' : if (Yeri !== CyrlYeriUprightShape)
|
||||
then : HSerif.rb df.rightSB 0 (jut - [HSwToV : 0.5 * sw]) sw
|
||||
else : HSerif.mb (df.rightSB - [HSwToV : 0.5 * sw]) 0 jut sw
|
||||
include : tagged 'serifRT' : if useFullSerifs
|
||||
then : HSerif.mt (df.rightSB - [HSwToV : 0.5 * sw]) top jut sw
|
||||
else : glyph-proc
|
||||
if (!fTail) : include : tagged 'serifRB' : if useFullSerifs
|
||||
then : HSerif.mb (df.rightSB - [HSwToV : 0.5 * sw]) 0 jut sw
|
||||
else : HSerif.rb df.rightSB 0 (jut - [HSwToV : 0.5 * sw]) sw
|
||||
|
||||
define [ZhuangToneSixShape Yeri top] : glyph-proc
|
||||
local xLeft : [mix SB RightSB 0.20] - [HSwToV : 0.125 * Stroke]
|
||||
|
@ -208,17 +245,17 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
|
||||
glyph-block-export YeriConfig
|
||||
define YeriConfig : object
|
||||
corner { CyrlYeriUprightShape }
|
||||
round { CyrlYeriRoundShape }
|
||||
cursive { CyrlYeriCursiveShape }
|
||||
corner { Yeri.UprightShape Yeri.AutoItalicShape }
|
||||
round { Yeri.RoundShape Yeri.RoundShape }
|
||||
cursive { Yeri.CursiveShape Yeri.CursiveShape }
|
||||
|
||||
define YeryConfig : object
|
||||
corner { CyrlYeriUprightShape false }
|
||||
round { CyrlYeriRoundShape false }
|
||||
cursive { CyrlYeriCursiveShape false }
|
||||
cornerTailed { CyrlYeriUprightShape true }
|
||||
roundTailed { CyrlYeriRoundShape true }
|
||||
cursiveTailed { CyrlYeriCursiveShape true }
|
||||
corner { Yeri.UprightShape Yeri.AutoItalicShape false }
|
||||
round { Yeri.RoundShape Yeri.RoundShape false }
|
||||
cursive { Yeri.CursiveShape Yeri.CursiveShape false }
|
||||
cornerTailed { Yeri.UprightShape Yeri.AutoItalicShape true }
|
||||
roundTailed { Yeri.RoundShape Yeri.RoundShape true }
|
||||
cursiveTailed { Yeri.CursiveShape Yeri.CursiveShape true }
|
||||
|
||||
define [YeriOverlayBar df top] : begin
|
||||
local stroke : AdviceStroke2 2 3 top
|
||||
|
@ -227,69 +264,69 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
bot -- top * DefaultBarPos + stroke / 2
|
||||
top -- top - [if SLAB Stroke 0]
|
||||
|
||||
foreach { suffix { Yeri } } [Object.entries YeriConfig] : do
|
||||
foreach { suffix { Uc Lc } } [Object.entries YeriConfig] : do
|
||||
create-glyph "cyrl/Yeri.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame 1
|
||||
include : df.markSet.capital
|
||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) CAP
|
||||
include : Uc (left -- df.leftSB) (right -- df.rightSB) CAP
|
||||
create-glyph "cyrl/yeri.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame 1
|
||||
include : df.markSet.e
|
||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) XH
|
||||
include : Lc (left -- df.leftSB) (right -- df.rightSB) XH
|
||||
create-glyph "cyrl/YeriBar.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame 1
|
||||
include : df.markSet.capital
|
||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) CAP
|
||||
include : Uc (left -- df.leftSB) (right -- df.rightSB) CAP
|
||||
include : YeriOverlayBar df CAP
|
||||
create-glyph "cyrl/yeriBar.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame 1
|
||||
include : df.markSet.e
|
||||
include : Yeri (left -- df.leftSB) (right -- df.rightSB) XH
|
||||
include : Lc (left -- df.leftSB) (right -- df.rightSB) XH
|
||||
include : YeriOverlayBar df XH
|
||||
create-glyph "cyrl/Yer.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||
include : df.markSet.capital
|
||||
include : CyrBackYerShape Yeri CAP (left -- df.leftSB) (right -- df.rightSB)
|
||||
include : CyrBackYerShape Uc CAP (left -- df.leftSB) (right -- df.rightSB)
|
||||
create-glyph "cyrl/yer.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||
include : df.markSet.e
|
||||
include : CyrBackYerShape Yeri XH (left -- df.leftSB) (right -- df.rightSB)
|
||||
include : CyrBackYerShape Lc XH (left -- df.leftSB) (right -- df.rightSB)
|
||||
create-glyph "cyrl/yerTall.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||
include : df.markSet.b
|
||||
include : CyrBackYerShape Yeri Ascender (left -- df.leftSB) (right -- df.rightSB) (pBar -- DefaultBarPos * XH / Ascender)
|
||||
include : CyrBackYerShape Lc Ascender (left -- df.leftSB) (right -- df.rightSB) (pBar -- DefaultBarPos * XH / Ascender)
|
||||
create-glyph "cyrl/YerNeutral.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||
include : df.markSet.capital
|
||||
include : CyrNeutralYerShape Yeri CAP (left -- df.leftSB) (right -- df.rightSB)
|
||||
include : CyrNeutralYerShape Uc CAP (left -- df.leftSB) (right -- df.rightSB)
|
||||
create-glyph "cyrl/yerNeutral.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 0.5]
|
||||
include : df.markSet.e
|
||||
include : CyrNeutralYerShape Yeri XH (left -- df.leftSB) (right -- df.rightSB)
|
||||
include : CyrNeutralYerShape Lc XH (left -- df.leftSB) (right -- df.rightSB)
|
||||
create-glyph "ZhuangToneSix.\(suffix)" : glyph-proc
|
||||
include : MarkSet.capital
|
||||
include : ZhuangToneSixShape Yeri CAP
|
||||
include : ZhuangToneSixShape Uc CAP
|
||||
create-glyph "zhuangToneSix.\(suffix)" : glyph-proc
|
||||
include : MarkSet.e
|
||||
include : ZhuangToneSixShape Yeri XH
|
||||
include : ZhuangToneSixShape Lc XH
|
||||
|
||||
foreach { suffix { Yeri fTail } } [Object.entries YeryConfig] : do
|
||||
foreach { suffix { Uc Lc fTail } } [Object.entries YeryConfig] : do
|
||||
create-glyph "cyrl/Yery.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||
include : df.markSet.capital
|
||||
include : CyrYeryShape Yeri df CAP false fTail
|
||||
include : CyrYeryShape Uc df CAP false fTail
|
||||
create-glyph "cyrl/yery.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||
include : df.markSet.e
|
||||
include : CyrYeryShape Yeri df XH false fTail
|
||||
include : CyrYeryShape Lc df XH false fTail
|
||||
create-glyph "cyrl/YeryBack.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||
include : df.markSet.capital
|
||||
include : CyrYeryShape Yeri df CAP true fTail
|
||||
include : CyrYeryShape Uc df CAP true fTail
|
||||
create-glyph "cyrl/yeryBack.\(suffix)" : glyph-proc
|
||||
local df : include : DivFrame [mix 1 para.diversityM 1.5] 3
|
||||
include : df.markSet.e
|
||||
include : CyrYeryShape Yeri df XH true fTail
|
||||
include : CyrYeryShape Lc df XH true fTail
|
||||
|
||||
select-variant 'cyrl/Yer' 0x42A
|
||||
select-variant 'cyrl/yer' 0x44A
|
||||
|
@ -313,7 +350,7 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
|
||||
create-glyph 'cyrl/Be' 0x411 : glyph-proc
|
||||
include : MarkSet.capital
|
||||
include : CyrlYeriUprightShape CAP
|
||||
include : Yeri.UprightShape CAP
|
||||
include : HBar.m SB [mix SB RightSB 0.9] (CAP - HalfStroke)
|
||||
if SLAB : begin
|
||||
include : VSerif.dr [mix SB RightSB 0.9] CAP VJut
|
||||
|
@ -322,21 +359,21 @@ glyph-block Letter-Cyrillic-Yeri : begin
|
|||
|
||||
create-glyph 'latn/De' 0x18B : glyph-proc
|
||||
include : MarkSet.capital
|
||||
include : RevCyrYeriShape CAP
|
||||
include : RevYeri.Shape CAP
|
||||
include : HBar.t [mix RightSB SB 0.9] (RightSB + O) CAP
|
||||
if SLAB : begin
|
||||
include : VSerif.dl [mix RightSB SB 0.9] CAP VJut
|
||||
|
||||
create-glyph 'cyrl/DeKomi' 0x500 : glyph-proc
|
||||
include : MarkSet.capital
|
||||
include : RevCyrYeriShape CAP
|
||||
include : RevYeri.Shape CAP
|
||||
|
||||
create-glyph 'cyrl/DjeKomi' 0x502 : glyph-proc
|
||||
local df : include : DivFrame para.diversityM 3
|
||||
include : df.markSet.capital
|
||||
|
||||
local xm : df.middle + [HSwToV : 0.5 * df.mvs]
|
||||
include : RevCyrYeriRoundShape CAP df.leftSB xm df.mvs
|
||||
include : RevYeri.RoundShape CAP df.leftSB xm df.mvs
|
||||
include : UpwardHookShape
|
||||
left -- df.middle - [HSwToV : 0.5 * df.mvs]
|
||||
right -- df.rightSB
|
||||
|
|
|
@ -763,17 +763,16 @@ glyph-block Letter-Shared-Shapes : begin
|
|||
return : new CSerifFrame this.top this.bot l1 r1 this.swRef this.swSerif this.div (r - l + 1)
|
||||
|
||||
glyph-block-export SerifFrame
|
||||
define [SerifFrame] : begin
|
||||
postulate
|
||||
top
|
||||
bot
|
||||
left
|
||||
right
|
||||
swRef -- Stroke
|
||||
swSerif -- swRef
|
||||
div -- 1
|
||||
hSplit -- 2
|
||||
fForceSymmetric -- false
|
||||
define flex-params [SerifFrame] : begin
|
||||
local-parameter : top
|
||||
local-parameter : bot
|
||||
local-parameter : left
|
||||
local-parameter : right
|
||||
local-parameter : swRef -- Stroke
|
||||
local-parameter : swSerif -- swRef
|
||||
local-parameter : div -- 1
|
||||
local-parameter : hSplit -- 2
|
||||
local-parameter : fForceSymmetric -- false
|
||||
return : new CSerifFrame top bot left right swRef swSerif div hSplit fForceSymmetric
|
||||
|
||||
define SerifFrame.fromDf : function [] : with-params [df top bot [swSerif df.mvs]] : begin
|
||||
|
|
|
@ -20,16 +20,15 @@ define-macro Just : begin
|
|||
|
||||
return m
|
||||
|
||||
define-macro postulate : syntax-rules
|
||||
`[postulate @::$pairs] : begin
|
||||
local ta : env.newt
|
||||
define-macro $$InitFlexParameters$$ : syntax-rules
|
||||
`[$$InitFlexParameters$$ @::$pairs] : begin
|
||||
local tb : env.newt
|
||||
local t : env.newt
|
||||
|
||||
local ps `[begin
|
||||
[local @ta : {}.slice.call arguments 0]
|
||||
[local $-flex-arguments : {}.slice.call arguments 0]
|
||||
[local @tb {}]
|
||||
[for [local @t 0] (@t < @ta.length) [inc @t] : if [not : @ta.(@t) <@ $NamedParameterPair$] : @tb.push @ta.(@t)]
|
||||
[for [local @t 0] (@t < $-flex-arguments.length) [inc @t] : if [not : $-flex-arguments.(@t) <@ $NamedParameterPair$] : @tb.push $-flex-arguments.(@t)]
|
||||
]
|
||||
|
||||
local declarations `[begin]
|
||||
|
@ -40,8 +39,6 @@ define-macro postulate : syntax-rules
|
|||
local j 0
|
||||
foreach $pf [items-of $pairs] : begin
|
||||
local name
|
||||
local pf : formOf $pf
|
||||
|
||||
match [formOf $pf]
|
||||
pf [atom pf] : begin
|
||||
declarations.push `[local @pf]
|
||||
|
@ -59,25 +56,54 @@ define-macro postulate : syntax-rules
|
|||
declarations.push `[local @decl]
|
||||
indexAssigns.push `[set @decl : fallback @decl (@tb).(@{".quote" j}) @dflt]
|
||||
set name decl
|
||||
{".operatorPiece" decl '--' dflt} : begin
|
||||
{".operatorPiece" :: items} : match [opSegToRegular items [scopeOf $pf]]
|
||||
`(@decl -- @dflt) : begin
|
||||
declarations.push `[local @decl]
|
||||
indexAssigns.push `[set @decl : fallback @decl (@tb).(@{".quote" j}) @dflt]
|
||||
set name decl
|
||||
true : throw : new Error "Invalid postulation syntax"
|
||||
____ : throw : new Error "Invalid postulation syntax"
|
||||
____ : throw : new Error "Invalid postulation syntax"
|
||||
|
||||
namedAssigns.push `[if (@t && @t <@ $NamedParameterPair$ && @t.left == @{".quote" name})
|
||||
[set @name @t.right]]
|
||||
inc j
|
||||
|
||||
ps.push declarations
|
||||
ps.push `[foreach [@t : items-of @ta] @namedAssigns]
|
||||
ps.push `[foreach [@t : items-of $-flex-arguments] @namedAssigns]
|
||||
ps.push indexAssigns
|
||||
ps.push tearDowns
|
||||
|
||||
return : dirty ps
|
||||
|
||||
# TODO: replace this with the new [with-params]
|
||||
define-macro with-params : syntax-rules
|
||||
`[with-params @_pairs @body] : dirty `[begin [postulate @::[formOf _pairs]] @[formOf body]]
|
||||
`[with-params @_pairs @body] : dirty `[begin
|
||||
[$$InitFlexParameters$$ @::[formOf _pairs]]
|
||||
@[formOf body]
|
||||
]
|
||||
|
||||
define-macro flex-params : syntax-rules
|
||||
`[flex-params @_lam] : begin
|
||||
local lam : formOf _lam
|
||||
local lamArgs lam.1
|
||||
local {lamBodyLeader :: lamBodyStatements} lam.2
|
||||
|
||||
local finalStatements {}
|
||||
|
||||
foreach stmt [items-of lamBodyStatements] : begin
|
||||
if ([Array.isArray stmt] && stmt.0 == 'local-parameter')
|
||||
: then : begin
|
||||
lamArgs.push stmt.1
|
||||
: else : begin
|
||||
finalStatements.push stmt
|
||||
|
||||
return : dirty {'.lambda'
|
||||
{}
|
||||
`[begin
|
||||
[$$InitFlexParameters$$ @::lamArgs]
|
||||
@{lamBodyLeader :: finalStatements}
|
||||
]
|
||||
}
|
||||
|
||||
### Necessary macros
|
||||
# A glyph construction is a function which "modifies" a glyph.
|
||||
|
|
|
@ -1171,7 +1171,7 @@ const CompiledJs = file.make(
|
|||
p => p,
|
||||
async (target, out) => {
|
||||
const ptl = replaceExt(".ptl", out.full);
|
||||
if (/\/glyphs\//.test(out.full)) await target.need(MARCOS);
|
||||
await target.need(MARCOS);
|
||||
await target.need(sfu(ptl));
|
||||
echo.action(echo.hl.command("Compile Script"), ptl);
|
||||
await silently.run(PATEL_C, "--strict", "--esm", ptl, "-o", out.full);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue