+
    f7i! c                   s0   ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
Ht ^ RItRt. RNRNR	NR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*NR+NR,NR-NR.NR/NR0NR1NR2NR3NR4NR5NR6NR7NR8NR9NR:NR;NR<NR=NR>NR?NR@NRANRBNRCNRDNRENRFNRGNRHNtRI t]! . RJNRKNRLNRMNRNNRONRPNRQNRRNRSNRTNRUNRVNRWNRXNRYNRZNR[NR\NR]NR^NR_NR`NRaNRbNRcNRdNReNRfNRgNRhNRiNRjNRkNRlNRmNRnNRoNRpNRqNRrNRsNRtNRuNRvNRwNRxNRyNRzNR{NR|NR}N4      tR~ t ! R R]4      t ! R R@]4      t ! R R%]4      t ! R R	]4      t ! R R]4      t ! R R
]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t  ! R R]4      t! ! R R]4      t" ! R RE]4      t# ! R R]4      t$ ! R R]4      t% ! R R]4      t& ! R R]4      t' ! R R]4      t( ! R R]4      t) ! R R]4      t* ! R R]4      t+ ! R R]4      t, ! R R]4      t- ! R R"]4      t. ! R R']4      t/ ! R R*]4      t0 ! R R+]4      t1 ! R R,]4      t2 ! R R-]4      t3 ! R R.]4      t4 ! R R(]4      t5 ! R R/]4      t6 ! R R0]4      t7 ! R R1]4      t8 ! R R2]4      t9 ! R R3]4      t: ! R R4]4      t; ! R R5]4      t< ! R R6]4      t= ! R R7]4      t> ! R R:]4      t? ! R R;]4      t@ ! R R>]4      tA ! R R<]4      tB ! R R=]4      tC ! R RD]4      tD ! R RF]4      tE ! R RG]4      tFR tG ! R R8]4      tH ! R R&]H4      tI ! R RC]H4      tJ ! R R?]4      tK ! R R]H4      tL ! R R ]4      tM ! R R]4      tN ! R R9]4      tO ! R R)]4      tP ! R RH]4      tQ ! R RB]4      tR ! R R#]4      tS ! R R$]4      tT ! R RA]4      tU ! R R]4      tV ! R R!]4      tW ! R R]4      tXR# )    N)FeatureLibError)FeatureLibLocation)getEncoding)byteordtobytes)OrderedDictElementFeatureFileComment	GlyphName
GlyphClassGlyphClassNameMarkClassNameAnonymousBlockBlockFeatureBlockNestedBlockLookupBlockGlyphClassDefinitionGlyphClassDefStatement	MarkClassMarkClassDefinitionAlternateSubstStatementAnchorAnchorDefinitionAttachStatementAxisValueLocationStatementBaseAxisCVParametersNameStatementChainContextPosStatementChainContextSubstStatementCharacterStatementConditionsetStatementCursivePosStatementElidedFallbackNameElidedFallbackNameID
ExpressionFeatureNameStatementFeatureReferenceStatementFontRevisionStatement	HheaFieldIgnorePosStatementIgnoreSubstStatementIncludeStatementLanguageStatementLanguageSystemStatementLigatureCaretByIndexStatementLigatureCaretByPosStatementLigatureSubstStatementLookupFlagStatementLookupReferenceStatementMarkBasePosStatementMarkLigPosStatementMarkMarkPosStatementMultipleSubstStatement
NameRecordOS2FieldPairPosStatement ReverseChainSingleSubstStatementScriptStatementSinglePosStatementSingleSubstStatementSizeParameters	StatementSTATAxisValueStatementSTATDesignAxisStatementSTATNameStatementSubtableStatement
TableBlockValueRecordValueRecordDefinition	VheaFieldc                 sL    V f   R# RRP                  R V  4       4      ,          # )Nz<device NULL>z<device %s>, c              3   s4   "   T F  pR V,          x  K  	  R# 5i)z%d %dN ).0Zt   & ;/usr/lib64/python3.14/site-packages/fontTools/feaLib/ast.py	<genexpr>Z!deviceToString.<locals>.<genexpr>U   s     (Ef1fs   )join)device   &rM   deviceToStringrR   Q   s$    ~tyy(Ef(EEEE    anchorZ	anchordefZanonZ	anonymousZbyZcontourZcursiverP   Zenum	enumerateZexcludedfltZexclude_dfltZfeatureZfromZignoreZignorebaseglyphsZignoreligaturesZignoremarksZincludeZincludedfltZinclude_dfltlanguageZlanguagesystemlookupZ
lookupflagmarkZmarkattachmenttypeZ	markclassZnameidZnullZ
parametersposZpositionrequiredZrighttoleftZ
reversesubZrsubscriptZsubZ
substituteZsubtableZtableZusemarkfilteringsetZuseextensionZvaluerecorddefbaseZgdefZheadZhheanameZvheaZvmtxc                 s:   \        V R 4      '       d   V P                  4       # \        V \        4      '       dA   \	        V 4      ^8X  d1   \        V ^ ,          4      R,           \        V ^,          4      ,           # V P                  4       \        9   d
   RV ,           # V # )asFeaz - Z\)hasattrr^   
isinstancetuplelenlowerfea_keywords)grQ   rM   r^   r^      sn    q'wwy	Au		#a&A+QqT{U"U1Q4[00	
l	"axrS   c                   sD   a  ] tR t^t o RtRR ltR tR	R ltR tRt	V t
R# )
r   z8A base class representing "something" in a feature file.Nc                s`    V'       d    \        V\        4      '       g
   \        V!  pWn        R # N)r`   r   locationselfrg      &&rM   __init__ZElement.__init__   s!    Jx1CDD)84H rS   c                    R # rf   rJ   ri   builderrj   rM   buildZElement.build   s    rS   c                s    \         h)zReturns this element as a string of feature code. For block-type
elements (such as :class:`FeatureBlock`), the `indent` string is
added to the start of each line in the output.)ZNotImplementedErrorri   indentrj   rM   r^   ZElement.asFea   s
     "!rS   c                s"    V P                  4       # rf   r^   ri   rQ   rM   __str__ZElement.__str__   s    zz|rS   rg   rf    )__name__
__module____qualname____firstlineno____doc__rk   ro   r^   rt   __static_attributes____classdictcell____classdict__   @rM   r   r      s!     B!" rS   c                   s    ] tR t^tRtR# )r@   rJ   Nrx   ry   rz   r{   r}   rJ   rS   rM   r@   r@          rS   c                   s    ] tR t^tRtR# )r%   rJ   Nr   rJ   rS   rM   r%   r%      r   rS   c                   sD   a a ] tR t^t oRtRV 3R lltRR ltRtVtV ;t	# )r	   zA comment in a feature file.c                :   < \         \        V `  V4       Wn        R # rf   )superr	   rk   text)ri   r   rg   	__class__   &&&rM   rk   ZComment.__init__   s    gt%h/	rS   c                s    V P                   # rf   r   rp   rj   rM   r^   ZComment.asFea   s    yyrS   r   rf   rv   
rx   ry   rz   r{   r|   rk   r^   r}   r~   __classcell__r   r      @@rM   r	   r	      s     &
 rS   c                   s>   a  ] tR t^t o RtRR ltR tRR ltRtV t	R# )		NullGlyphz5The NULL glyph, used in glyph deletion substitutions.Nc                0    \         P                  W4       R # rf   )r%   rk   rh   rj   rM   rk   ZNullGlyph.__init__   s    D+rS   c                s    R# )BThe glyphs in this class as a tuple of :class:`GlyphName` objects.rJ   rJ   rs   rQ   rM   glyphSetZNullGlyph.glyphSet   s    	rS   c                rl   )NULLrJ   rp   rj   rM   r^   ZNullGlyph.asFea   s    rS   rJ   rf   rv   
rx   ry   rz   r{   r|   rk   r   r^   r}   r~   r   r   rM   r   r      s     ?, rS   r   c                   s>   a  ] tR t^t o RtRR ltR tRR ltRtV t	R# )	r
   z)A single glyph name, such as ``cedilla``.Nc                <    \         P                  W4       Wn        R # rf   )r%   rk   glyph)ri   r   rg      &&&rM   rk   ZGlyphName.__init__   s    D+
rS   c                s    V P                   3# r   r   rs   rQ   rM   r   ZGlyphName.glyphSet   s    

}rS   c                ,    \        V P                  4      # rf   )r^   r   rp   rj   rM   r^   ZGlyphName.asFea   s    TZZ  rS   r   rf   rv   r   r   r   rM   r
   r
      s     3
! !rS   c                   s\   a  ] tR t^t o RtRR ltR tRR ltR tR t	R t
R	 tR
 tRtV tR# )r   z1A glyph class, such as ``[acute cedilla grave]``.Nc                sf    \         P                  W4       Ve   TM. V n        . V n        ^ V n        R # rf   )r%   rk   glyphsoriginalcurr)ri   r   rg   r   rM   rk   ZGlyphClass.__init__   s,    D+ & 2f	rS   c                r   r   )ra   r   rs   rQ   rM   r   ZGlyphClass.glyphSet   s    T[[!!rS   c                s   \        V P                  4      '       d   V P                  \        V P                  4      8  dM   V P                  P	                  V P                  V P                  R  4       \        V P                  4      V n        RRP                  \        \        V P                  4      4      ,           R,           # RRP                  \        \        V P                  4      4      ,           R,           # )NZ[ Z])rb   r   r   r   extendrO   mapr^   rp   rj   rM   r^   ZGlyphClass.asFea   s    t}}yy3t{{++$$T[[%=>,	#eT]]";<<sBB#eT[["9::S@@rS   c                <    V P                   P                  V4       R# )z6Add a list of :class:`GlyphName` objects to the class.N)r   r   )ri   r   rj   rM   r   ZGlyphClass.extend   s    6"rS   c                r   )z4Add a single :class:`GlyphName` object to the class.N)r   append)ri   r   rj   rM   r   ZGlyphClass.append  s    5!rS   c                sT   V P                   \        V P                  4      8  d3   V P                  P	                  V P                  V P                   R 4       V P                  P                  W34       V P                  P	                  V4       \        V P                  4      V n         R# )zAdd a range (e.g. ``A-Z``) to the class. ``start`` and ``end``
are either :class:`GlyphName` objects or strings representing the
start and end glyphs in the class, and ``glyphs`` is the full list of
:class:`GlyphName` objects in the range.N)r   rb   r   r   r   r   ri   Zstartendr      &&&&rM   	add_rangeZGlyphClass.add_range  sp    
 99s4;;''MM  TYY[!9:e\*6"$	rS   c                s   V P                   \        V P                  4      8  d3   V P                  P	                  V P                  V P                   R 4       V P                  P                  RP                  V4      RP                  V4      34       V P                  P	                  V4       \        V P                  4      V n         R# )zAdd a range to the class by glyph ID. ``start`` and ``end`` are the
initial and final IDs, and ``glyphs`` is the full list of
:class:`GlyphName` objects in the range.Nz\{})r   rb   r   r   r   r   formatr   r   rM   add_cid_rangeZGlyphClass.add_cid_range  s     99s4;;''MM  TYY[!9:fmmE2FMM#4FGH6"$	rS   c                sn   V P                   \        V P                  4      8  d3   V P                  P	                  V P                  V P                   R 4       V P                  P                  V4       V P                  P	                  VP                  4       4       \        V P                  4      V n         R# )zFAdd glyphs from the given :class:`GlyphClassName` object to the
class.N)r   rb   r   r   r   r   r   )ri   Zgcrj   rM   	add_classZGlyphClass.add_class  st     99s4;;''MM  TYY[!9:R 2;;=)$	rS   )r   r   r   NNrv   )rx   ry   rz   r{   r|   rk   r   r^   r   r   r   r   r   r}   r~   r   r   rM   r   r      s6     ;"A#"	%%% %rS   c                   >   a  ] tR tRt o RtRR ltR tR	R ltRtV t	R# )
r   i$  zuA glyph class name, such as ``@FRENCH_MARKS``. This must be instantiated
with a :class:`GlyphClassDefinition` object.Nc                r   rf   )r%   rk   
glyphclass)ri   r   rg   r   rM   rk   ZGlyphClassName.__init__(  s    D+$rS   c                H    \        V P                  P                  4       4      # r   )ra   r   r   rs   rQ   rM   r   ZGlyphClassName.glyphSet-  s    T__--/00rS   c                <    R V P                   P                  ,           # @)r   r]   rp   rj   rM   r^   ZGlyphClassName.asFea1  s    T__))))rS   )r   rf   rv   r   r   r   rM   r   r   $  s     4%
1* *rS   c                   r   )
r   i5  zA mark class name, such as ``@FRENCH_MARKS`` defined with ``markClass``.
This must be instantiated with a :class:`MarkClass` object.Nc                r   rf   )r%   rk   	markClass)ri   r   rg   r   rM   rk   ZMarkClassName.__init__9  s    D+"rS   c                6    V P                   P                  4       # r   )r   r   rs   rQ   rM   r   ZMarkClassName.glyphSet>  s    ~~&&((rS   c                r   r   )r   r]   rp   rj   rM   r^   ZMarkClassName.asFeaB  s    T^^((((rS   )r   rf   rv   r   r   r   rM   r   r   5  s     C#
)) )rS   c                   8   a  ] tR tRt o RtRR ltRR ltRtV tR# )	r   iF  zAn anonymous data block.Nc                H    \         P                  W4       Wn        W n        R # rf   )r@   rk   tagcontent)ri   r   r   rg   r   rM   rk   ZAnonymousBlock.__init__I  s    4*rS   c                s    R P                  V P                  4      pW P                  ,          pVRP                  V P                  4      ,          pV# )zanon {} {{
z}} {};

)r   r   r   ri   rq   res   && rM   r^   ZAnonymousBlock.asFeaN  s@    ##DHH-|||""488,,
rS   )r   r   rf   rv   	rx   ry   rz   r{   r|   rk   r^   r}   r~   r   r   rM   r   r   F  s     "
 rS   c                   r   )
r   iU  z,A block of statements: feature, lookup, etc.Nc                s>    \         P                  W4       . V n        R # rf   )r@   rk   
statementsrh   rj   rM   rk   ZBlock.__init__X  s    4*rS   c                sN    V P                    F  pVP                  V4       K  	  R# )zWhen handed a 'builder' object of comparable interface to
:class:`fontTools.feaLib.builder`, walks the statements in this
block, calling the builder callbacks.N)r   ro   )ri   rn   sr   rM   ro   ZBlock.build\  s     AGGG !rS   c           
     s    V\         ,          pTR V,           P                  V P                   Uu. uF  q"P                  VR7      NK  	  up4      ,           R ,           # u upi )
rq   )SHIFTrO   r   r^   )ri   rq   r   r   rM   r^   ZBlock.asFeac  sR    %f}""DOO#TOqGG6G$:O#TUV	
#Ts   A
)r   rf   rv   
rx   ry   rz   r{   r|   rk   ro   r^   r}   r~   r   r   rM   r   r   U  s     6
 
rS   c                   4   a  ] tR tRt o RtR tRR ltRtV tR# )r   il  zlThe top-level element of the syntax tree, containing the whole feature
file in its ``statements`` attribute.c                sB    \         P                  V R R7       / V n        R # )Nru   )r   rk   markClassesrs   rQ   rM   rk   ZFeatureFile.__init__p  s    td+rS   c                sN   a R P                  V3R lV P                   4       4      # )r   c              3   sF   <"   T F  qP                  SR 7      x  K  	  R# 5i)r   Nrr   )rK   r   rq      & rM   rN   Z$FeatureFile.asFea.<locals>.<genexpr>u  s     IA//s   !)rO   r   rp   s   &frM   r^   ZFeatureFile.asFeat  s    yyIIIIrS   )r   Nrv   r   r   r   rM   r   r   l  s     -J JrS   c                   r   )
r   ix  zA named feature block.Nc                L    \         P                  W4       WuV n        V n        R # rf   r   rk   r]   use_extensionri   r]   r   rg   r   rM   rk   ZFeatureBlock.__init__{      t&(,%	4%rS   c                sl   VP                  V P                  V P                  V P                  4       VP                  p/ Vn        \
        P                  W4       VP                  P                  4        F&  w  r4VP                  V. 4      P                  V4       K(  	  W!n        VP                  4        R# )Call the ``start_feature`` callback on the builder object, visit
all the statements in this feature, and then call ``end_feature``.N)start_featurerg   r]   r   	features_r   ro   items
setdefaultr   end_feature)ri   rn   featureskeyvalue   &&   rM   ro   ZFeatureBlock.build  s     	dmmTYY8J8JK $$D"!++113JCR(//6 4$rS   c                s4   VR V P                   P                  4       ,          ,           pV P                  '       d
   VR,          pVR,          pV\        P	                  WR7      ,          pW!RV P                   P                  4       ,          ,           ,          pV# )zfeature %s useExtension {
r   } %s;
)r]   stripr   r   r^   r   r   rM   r^   ZFeatureBlock.asFea  sr    }tyy'888?"Cuu{{4{//	DIIOO$5555
rS   r]   r   FNrv   r   r   r   rM   r   r   x  s      < rS   c                   r   )
r   i  zUA block inside another block, for example when found inside a
``cvParameters`` block.Nc                r   rf   )r   rk   r   
block_name)ri   r   r   rg   r   rM   rk   ZNestedBlock.__init__  s    t&$rS   c                s    \         P                  W4       V P                  R 8X  d   VP                  V P                  4       R# R# )ParamUILabelNameIDN)r   ro   r   Zadd_to_cv_num_named_paramsr   rm   rj   rM   ro   ZNestedBlock.build  s2    D"??22..txx8 3rS   c                s    R P                  WP                  4      pV\        P                  WR7      ,          pVRP                  V4      ,          pV# )z{}{} {{
r   z{}}};
)r   r   r   r^   r   r   rM   r^   ZNestedBlock.asFea  sE      9u{{4{//y''
rS   )r   r   rf   rv   r   r   r   rM   r   r     s     %
9
 rS   c                   r   )
r   i  z*A named lookup, containing ``statements``.Nc                r   rf   r   r   r   rM   rk   ZLookupBlock.__init__  r   rS   c                s    VP                  V P                  V P                  V P                  4       \        P                  W4       VP                  4        R # rf   )Zstart_lookup_blockrg   r]   r   r   ro   Zend_lookup_blockrm   rj   rM   ro   ZLookupBlock.build  s:    ""4==$))T=O=OPD"  "rS   c                s   R P                  V P                  4      pV P                  '       d
   VR,          pVR,          pV\        P	                  WR7      ,          pVRP                  WP                  4      ,          pV# )z
lookup {} r   r   r   z	{}}} {};
)r   r]   r   r   r^   r   r   rM   r^   ZLookupBlock.asFea  sh    !!$)),?"Cuu{{4{//|""69955
rS   r   r   rv   r   r   r   rM   r   r     s     4<#
 rS   c                   sD   a a ] tR tRt oRtRR ltRV 3R lltRtVtV ;t	# )rE   i  zA ``table ... { }`` block.c                r   rf   )r   rk   r]   )ri   r]   rg   r   rM   rk   ZTableBlock.__init__  s    t&	rS   c                s   < R P                  V P                  P                  4       4      pV\        \        V `  VR7      ,          pVRP                  V P                  P                  4       4      ,          pV# )ztable {} {{
r   z}} {};
)r   r]   r   r   rE   r^   )ri   rq   r   r   s   && rM   r^   ZTableBlock.asFea  s\    $$TYY__%67uZ,F,;;z  !233
rS   )r]   rf   rv   r   r   r   rM   rE   rE     s     $ rS   c                   r   )
r   i  z!Example: ``@UPPERCASE = [A-Z];``.Nc                r   rf   )r@   rk   r]   r   )ri   r]   r   rg   r   rM   rk   ZGlyphClassDefinition.__init__  s    4*	rS   c                r   r   )ra   r   r   rs   rQ   rM   r   ZGlyphClassDefinition.glyphSet  s    T[[))+,,rS   c                s    R V P                   ,           R,           V P                  P                  4       ,           R,           # )r   z = ;)r]   r   r^   rp   rj   rM   r^   ZGlyphClassDefinition.asFea  s,    TYY&):):)<<sBBrS   )r   r]   rf   rv   r   r   r   rM   r   r     s     +
-C CrS   c                   r   )
r   i  zExample: ``GlyphClassDef @UPPERCASE, [B], [C], [D];``. The parameters
must be either :class:`GlyphClass` or :class:`GlyphClassName` objects, or
``None``.Nc                d    \         P                  W4       WuV n        V n        W0n        W@n        R # rf   )r@   rk   
baseGlyphs
markGlyphsligatureGlyphscomponentGlyphs)ri   r   r   r   r   rg      &&&&&&rM   rk   ZGlyphClassDefStatement.__init__  s,     	4*,6(,.rS   c                s   V P                   '       d   V P                   P                  4       M	\        4       pV P                  '       d   V P                  P                  4       M	\        4       pV P                  '       d   V P                  P                  4       M	\        4       pV P
                  '       d   V P
                  P                  4       M	\        4       pVP                  V P                  W#WE4       R# )z3Calls the builder's ``add_glyphClassDef`` callback.N)r   r   ra   r   r   r   Zadd_glyphClassDefrg   )ri   rn   r\   ZligarX   Zcomp   &&    rM   ro   ZGlyphClassDefStatement.build  s    -1___t'')%'151D1D1Dt""++-%'-1___t'')%'262F2F2Ft##,,.EG!!$--THrS   c                s   R P                  V P                  '       d   V P                  P                  4       MRV P                  '       d   V P                  P                  4       MRV P                  '       d   V P                  P                  4       MRV P
                  '       d   V P
                  P                  4       4      # R4      # )zGlyphClassDef {}, {}, {}, {};rw   )r   r   r^   r   r   r   rp   rj   rM   r^   ZGlyphClassDefStatement.asFea  s    .55'+DOO!!#B+/+>+>+>D%%'B'+DOO!!#B,0,@,@,@D  &&(	
 	
 GI	
 	
rS   )r   r   r   r   rf   rv   r   r   r   rM   r   r     s     /I
 
rS   c                   s@   a  ] tR tRt o RtR tR tR tR	R ltRt	V t
R# )
r   i  a  One `or more` ``markClass`` statements for the same mark class.

While glyph classes can be defined only once, the feature file format
allows expanding mark classes with multiple definitions, each using
different glyphs and anchors. The following are two ``MarkClassDefinitions``
for the same ``MarkClass``::

    markClass [acute grave] <anchor 350 800> @FRENCH_ACCENTS;
    markClass [cedilla] <anchor 350 -200> @FRENCH_ACCENTS;

The ``MarkClass`` object is therefore just a container for a list of
:class:`MarkClassDefinition` statements.
c                s>    Wn         . V n        \        4       V n        R # rf   )r]   definitionsr   r   )ri   r]   rj   rM   rk   ZMarkClass.__init__  s    	!mrS   c                s\   V P                   P                  \        P                  ! V4      4       VP	                  4        Fh  pW P
                  9   dH   V P
                  V,          P                  pVf   RpMRV 2p\        RV: RV: 2VP                  4      hWP
                  V&   Kj  	  R# )z@Add a :class:`MarkClassDefinition` statement to this mark class.Nrw   z at zGlyph z already defined)r   r   weakrefZproxyr   r   rg   r   )ri   Z
definitionr   ZotherLocr   r   rM   addDefinitionZMarkClass.addDefinition  s     	j 9:((*E#;;u-66#C 
+C%493?ATAT  ",KK +rS   c                r   r   )ra   r   Zkeysrs   rQ   rM   r   ZMarkClass.glyphSet"  s    T[[%%'((rS   c                sJ    R P                  R V P                   4       4      pV# )r   c              3   @   "   T F  qP                  4       x  K  	  R # 5irf   rr   )rK   ZdrL   rM   rN   Z"MarkClass.asFea.<locals>.<genexpr>'  s     <+;a		+;   )rO   r   r   r   rM   r^   ZMarkClass.asFea&  s!    ii<4+;+;<<
rS   )r   r   r]   Nrv   )rx   ry   rz   r{   r|   rk   r   r   r^   r}   r~   r   r   rM   r   r     s#     $
, ) rS   c                   r   )
r   i+  a  A single ``markClass`` statement. The ``markClass`` should be a
:class:`MarkClass` object, the ``anchor`` an :class:`Anchor` object,
and the ``glyphs`` parameter should be a `glyph-containing object`_ .

Example:

    .. code:: python

        mc = MarkClass("FRENCH_ACCENTS")
        mc.addDefinition( MarkClassDefinition(mc, Anchor(350, 800),
            GlyphClass([ GlyphName("acute"), GlyphName("grave") ])
        ) )
        mc.addDefinition( MarkClassDefinition(mc, Anchor(350, -200),
            GlyphClass([ GlyphName("cedilla") ])
        ) )

        mc.asFea()
        # markClass [acute grave] <anchor 350 800> @FRENCH_ACCENTS;
        # markClass [cedilla] <anchor 350 -200> @FRENCH_ACCENTS;

Nc                sZ    \         P                  W4       WVuV n        V n        V n        R # rf   )r@   rk   r   rT   r   )ri   r   rT   r   rg      &&&&&rM   rk   ZMarkClassDefinition.__init__B  s&    4* 4=f0T[rS   c                r   r   )r   r   rs   rQ   rM   r   ZMarkClassDefinition.glyphSetH  s    {{##%%rS   c                s    R P                  V P                  P                  4       V P                  P                  4       V P                  P
                  4      # )zmarkClass {} {} @{};)r   r   r^   rT   r   r]   rp   rj   rM   r^   ZMarkClassDefinition.asFeaL  s@    %,,KK!2!2!4dnn6I6I
 	
rS   )rT   r   r   rf   rv   r   r   r   rM   r   r   +  s     ,M&
 
rS   c                   r   )
r   iR  zA ``sub ... from ...`` statement.

``glyph`` and ``replacement`` should be `glyph-containing objects`_.
``prefix`` and ``suffix`` should be lists of `glyph-containing objects`_.Nc                f    \         P                  W4       WVuV n        V n        V n        W@n        R # rf   )r@   rk   prefixr   suffixreplacement)ri   r   r   r   r   rg   r   rM   rk   Z AlternateSubstStatement.__init__X  s*    4*06v,TZ&rS   c                s   V P                   P                  4       p\        V4      ^ ,          pV P                   Uu. uF  q3P                  4       NK  	  ppV P                   Uu. uF  qUP                  4       NK  	  ppV P
                  P                  4       pVP                  V P                  WBWg4       R# u upi u upi )z5Calls the builder's ``add_alternate_subst`` callback.N)r   r   listr   r   r   Zadd_alternate_substrg   )ri   rn   r   pr   r   r   r      &&      rM   ro   ZAlternateSubstStatement.build]  s    

##%UA(,41**,4(,41**,4&&//1##DMM6&V 54s   B6#B;c                s   R p\        V P                  4      '       g   \        V P                  4      '       d   \        V P                  4      '       d8   VRP                  \	        \
        V P                  4      4      R,           ,          pV\        V P                  4      R,           ,          p\        V P                  4      '       d8   VRRP                  \	        \
        V P                  4      4      ,           ,          pMV\        V P                  4      ,          pVR,          pV\        V P                  4      ,          pVR,          pV# )sub r   'z from r   )rb   r   r   rO   r   r^   r   r   r   r   rM   r^   ZAlternateSubstStatement.asFeag  s    t{{s4;;//4;;sxxE4;; 783>>5$s**C4;;sSXXc%&=>>>5$$CxuT%%&&s

rS   )r   r   r   r   rf   rv   r   r   r   rM   r   r   R  s      Q
'
W rS   c                   r   )	r   iw  zAn ``Anchor`` element, used inside a ``pos`` rule.

If a ``name`` is given, this will be used in preference to the coordinates.
Other values should be integer.
Nc                s    \         P                  W4       W0n        WVuV n        V n        V n        WVuV n        V n        R # rf   )r%   rk   r]   xycontourpointxDeviceTableyDeviceTable)ri   r   r   r]   r   r   r   rg      &&&&&&&&rM   rk   ZAnchor.__init__~  s<     	D+	,-,))/;,4,rS   c                s   V P                   e   RP                  V P                   4      # RP                  V P                  V P                  4      pV P                  '       d#   VRP                  V P                  4      ,          pV P
                  '       g   V P                  '       dK   VR,          pV\        V P
                  4      ,          pVR,          pV\        V P                  4      ,          pVR,          pV# )Nz<anchor {}>z<anchor {} {} contourpoint {}r   >)r]   r   r   r   r   r   r   rR   r   r   rM   r^   ZAnchor.asFea  s    99  ''		22$$TVVTVV4%,,T->->??C 1 1 13JC>$"3"344C3JC>$"3"344Cs

rS   )r   r]   r   r   r   r   )NNNNNrv   r   r   r   rM   r   r   w  s     J rS   c                   r   )	r   i  zCA named anchor definition. (2.e.viii). ``name`` should be a string.Nc                sj    \         P                  W4       WW43w  V n        V n        V n        V n        R # rf   )r@   rk   r]   r   r   r   )ri   r]   r   r   r   rg   r   rM   rk   ZAnchorDefinition.__init__  s,    4*7;7O4	46464#4rS   c                s    R P                  V P                  V P                  4      pV P                  '       d#   VRP                  V P                  4      ,          pVRP                  V P                  4      ,          pV# )zanchorDef {} {}r   z {};)r   r   r   r   r]   r   r   rM   r^   ZAnchorDefinition.asFea  s`    &&tvvtvv6%,,T->->??Cv}}TYY''
rS   )r   r]   r   r   r   rv   r   r   r   rM   r   r     s     MP rS   c                   r   )
r   i  z&A ``GDEF`` table ``Attach`` statement.Nc                r   rf   )r@   rk   r   contourPoints)ri   r   r   rg   r   rM   rk   ZAttachStatement.__init__  s    4**rS   c                s    V P                   P                  4       pVP                  V P                  W P                  4       R# )z3Calls the builder's ``add_attach_points`` callback.N)r   r   Zadd_attach_pointsrg   r   ri   rn   r   r   rM   ro   ZAttachStatement.build  s.    %%'!!$--9K9KLrS   c                    R P                  V P                  P                  4       RP                  R V P                   4       4      4      # )zAttach {} {};r   c              3   8   "   T F  p\        V4      x  K  	  R # 5irf   str)rK   crL   rM   rN   Z(AttachStatement.asFea.<locals>.<genexpr>  s     )M:LQ#a&&:L   )r   r   r^   rO   r   rp   rj   rM   r^   ZAttachStatement.asFea  s<    %%KK)M$:L:L)M!M
 	
rS   )r   r   rf   rv   r   r   r   rM   r   r     s     0+
M

 
rS   c                   r   )
r   i  a  A chained contextual positioning statement.

``prefix``, ``glyphs``, and ``suffix`` should be lists of
`glyph-containing objects`_ .

``lookups`` should be a list of elements representing what lookups
to apply at each glyph position. Each element should be a
:class:`LookupBlock` to apply a single chaining lookup at the given
position, a list of :class:`LookupBlock`\ s to apply multiple
lookups, or ``None`` to apply no lookup. The length of the outer
list should equal the length of ``glyphs``; the inner lists can be
of variable length.Nc                   \         P                  W4       WVuV n        V n        V n        \        V4      V n        \        V4       F  w  rgV'       g   K   \        V4       K  	  R #   \         d    T.T P                  T&    K?  i ; irf   
r@   rk   r   r   r   r   lookupsrU   ZiterZ	TypeErrorri   r   r   r   r  rg   irW      &&&&&&  rM   rk   Z!ChainContextPosStatement.__init__  q    4*06-T[$+G}"7+IAv/L , ! /'-hDLLO/   A''BBc                b   V P                    Uu. uF  q"P                  4       NK  	  ppV P                   Uu. uF  qDP                  4       NK  	  ppV P                   Uu. uF  qfP                  4       NK  	  ppVP	                  V P
                  W5WpP                  4       R# u upi u upi u upi )z7Calls the builder's ``add_chain_context_pos`` callback.N)r   r   r   r   add_chain_context_posrg   r  ri   rn   r   r   re   r   r   r   r   rM   ro   ZChainContextPosStatement.build  s~    (,41**,4(,41**,4(,41**,4%%MM66<<	
 544   B"B'B,c                   R p\        V P                  4      '       gI   \        V P                  4      '       g.   \        V P                   Uu. uF  q3RJNK  	  up4      '       EdS   \        V P                  4      '       d1   VRP                  R V P                   4       4      R,           ,          p\        V P                  4       F  w  rEW%P                  4       R,           ,          pV P                  V,          '       d5   V P                  V,           F  pVRVP                  ,           ,          pK  	  V\        V P                  4      ^,
          8  g   K  VR,          pK  	  \        V P                  4      '       d8   VRRP                  \        \        V P                  4      4      ,           ,          pM0VRP                  \        \        V P                  4      4      ,          pVR,          pV# u upi )pos Nr   c              3   r   rf   rr   rK   re   rL   rM   rN   Z1ChainContextPosStatement.asFea.<locals>.<genexpr>       ?;a		;r   r    lookup r   rb   r   r   anyr  rO   rU   r   r^   r]   r   ri   rq   r   r   r  re   Zlu   &&     rM   r^   ZChainContextPosStatement.asFea  V   4;;4<<8<aTM<8994;;sxx?4;;??#EE!$++.wwy3&<<??"ll1oozBGG33 .s4;;'!++3JC / 4;;sSXXc%&=>>>388Ct{{344Cs

! 9   G3r   r  r   r   rf   rv   r   r   r   rM   r   r          	/
 rS   c                   r   )
r   i  a  A chained contextual substitution statement.

``prefix``, ``glyphs``, and ``suffix`` should be lists of
`glyph-containing objects`_ .

``lookups`` should be a list of elements representing what lookups
to apply at each glyph position. Each element should be a
:class:`LookupBlock` to apply a single chaining lookup at the given
position, a list of :class:`LookupBlock`\ s to apply multiple
lookups, or ``None`` to apply no lookup. The length of the outer
list should equal the length of ``glyphs``; the inner lists can be
of variable length.Nc                r  rf   r  r  r  rM   rk   Z#ChainContextSubstStatement.__init__  r  r  c                r	  )z9Calls the builder's ``add_chain_context_subst`` callback.N)r   r   r   r   add_chain_context_substrg   r  r  r   rM   ro   Z ChainContextSubstStatement.build  s~    (,41**,4(,41**,4(,41**,4''MM66<<	
 544r  c                r  )r   Nr   c              3   r   rf   rr   r  rL   rM   rN   Z3ChainContextSubstStatement.asFea.<locals>.<genexpr>"  r  r   r   r  r   r  r  r  rM   r^   Z ChainContextSubstStatement.asFea  r  r  r  rf   rv   r   r   r   rM   r   r     r  rS   c                   r   )
r"   i2  zjA cursive positioning statement. Entry and exit anchors can either
be :class:`Anchor` objects or ``None``.Nc                sX    \         P                  W4       Wn        W#uV n        V n        R # rf   )r@   rk   r   entryAnchor
exitAnchor)ri   r   r  r  rg   r   rM   rk   ZCursivePosStatement.__init__6  s$    4*$,7)$/rS   c                s    VP                  V P                  V P                  P                  4       V P                  V P
                  4       R# )z8Calls the builder object's ``add_cursive_pos`` callback.N)Zadd_cursive_posrg   r   r   r  r  rm   rj   rM   ro   ZCursivePosStatement.build;  s4    MM4??335t7G7G	
rS   c                s   V P                   '       d   V P                   P                  4       MR pV P                  '       d   V P                  P                  4       MR pRP                  V P                  P                  4       W#4      # )<anchor NULL>zpos cursive {} {} {};)r  r^   r  r   r   )ri   rq   ZentryZexit   &&  rM   r^   ZCursivePosStatement.asFeaA  s_    ,0,<,<,<  &&(/*.///t$$&&--doo.C.C.EuSSrS   )r  r  r   rf   rv   r   r   r   rM   r"   r"   2  s!     /D

T TrS   c                   r   )
r'   iG  zExample: ``feature salt;``Nc                L    \         P                  W4       W!uV n        V n        R # rf   )r@   rk   rg   featureName)ri   r   rg   r   rM   rk   Z"FeatureReferenceStatement.__init__J  s    4*+3't'rS   c                R    VP                  V P                  V P                  4       R# )z>Calls the builder object's ``add_feature_reference`` callback.N)Zadd_feature_referencerg   r   rm   rj   rM   ro   ZFeatureReferenceStatement.buildN  s    %%dmmT5E5EFrS   c                8    R P                  V P                  4      # )zfeature {};)r   r   rp   rj   rM   r^   ZFeatureReferenceStatement.asFeaR  s    ##D$4$455rS   )r   rg   rf   rv   r   r   r   rM   r'   r'   G  s     $BG6 6rS   c                   r   )
r*   iV  zAn ``ignore pos`` statement, containing `one or more` contexts to ignore.

``chainContexts`` should be a list of ``(prefix, glyphs, suffix)`` tuples,
with each of ``prefix``, ``glyphs`` and ``suffix`` being
`glyph-containing objects`_ .Nc                r   rf   r@   rk   chainContextsri   r$  rg   r   rM   rk   ZIgnorePosStatement.__init__]      4**rS   c                @   V P                    F~  w  r#pV Uu. uF  qUP                  4       NK  	  ppV Uu. uF  qfP                  4       NK  	  ppV Uu. uF  qwP                  4       NK  	  ppVP                  V P                  W#V. 4       K  	  R# u upi u upi u upi )zSCalls the builder object's ``add_chain_context_pos`` callback on each
rule context.N)r$  r   r
  rg   ri   rn   r   r   r   r   re   r   r   rM   ro   ZIgnorePosStatement.builda  s     '+&8&8"FF,23FqjjlFF3,23FqjjlFF3,23FqjjlFF3))$--QST	 '9333   BBBc           	     s^   . pV P                    F  w  r4pR p\        V4      '       g   \        V4      '       d   \        V4      '       d.   VRP                  \        \        V4      4      R,           ,          pVRP                  R V 4       4      ,          p\        V4      '       d.   VRRP                  \        \        V4      4      ,           ,          pM&VRP                  \        \        V4      4      ,          pVP                  V4       K  	  RRP                  V4      ,           R,           # )rw   r   c              3   N   "   T F  qP                  4       R ,           x  K  	  R# 5ir   Nrr   r  rL   rM   rN   Z+IgnorePosStatement.asFea.<locals>.<genexpr>q  s     @A	C   #%zignore pos rI   r   r$  rb   rO   r   r^   r   ri   rq   Zcontextsr   r   r   r   r  rM   r^   ZIgnorePosStatement.asFeaj  s    &*&8&8"FFC6{{c&kkv;;388Cv$67#==Csxx@@@@v;;3#eV*<!===CsxxE6 233OOC  '9 tyy22S88rS   r$  rf   rv   r   r   r   rM   r*   r*   V  s     %+U9 9rS   c                   r   )
r+   iz  zAn ``ignore sub`` statement, containing `one or more` contexts to ignore.

``chainContexts`` should be a list of ``(prefix, glyphs, suffix)`` tuples,
with each of ``prefix``, ``glyphs`` and ``suffix`` being
`glyph-containing objects`_ .Nc                r   rf   r#  r%  r   rM   rk   ZIgnoreSubstStatement.__init__  r&  rS   c                r'  )zUCalls the builder object's ``add_chain_context_subst`` callback on
each rule context.N)r$  r   r  rg   r(  r   rM   ro   ZIgnoreSubstStatement.build  s     '+&8&8"FF,23FqjjlFF3,23FqjjlFF3,23FqjjlFF3++DMM66SUV	 '9333r)  c           	     s   . pV P                    F  w  r4pR p\        V4      '       d.   VRP                  \        \        V4      4      R,           ,          pVRP                  R V 4       4      ,          p\        V4      '       d.   VRRP                  \        \        V4      4      ,           ,          pVP                  V4       K  	  RRP                  V4      ,           R,           # )rw   r   c              3   r*  r+  rr   r  rL   rM   rN   Z-IgnoreSubstStatement.asFea.<locals>.<genexpr>  s     <VGGIOOVr,  zignore sub rI   r   r-  r.  r  rM   r^   ZIgnoreSubstStatement.asFea  s    &*&8&8"FFC6{{sxxE6 23c99388<V<<<C6{{sSXXc%&8999OOC  '9 tyy22S88rS   r/  rf   rv   r   r   r   rM   r+   r+   z  s     %+W
9 
9rS   c                   sJ   a a ] tR tRt oRtRV 3R lltR tRR ltRtVt	V ;t
# )	r,   i  zAn ``include()`` statement.c                r   rf   )r   r,   rk   filename)ri   r0  rg   r   r   rM   rk   ZIncludeStatement.__init__  s    .x8 rS   c                s.    \        R V P                  4      h)zqBuilding an include statement is not implemented yet. Instead, use Parser(..., followIncludes=True) for building.)r   rg   rs   rQ   rM   ro   ZIncludeStatement.build  s    JMM
 	
rS   c                s6    VR V P                   ,          ,           # )zinclude(%s);r0  rp   rj   rM   r^   ZIncludeStatement.asFea  s    666rS   r1  rf   rv   )rx   ry   rz   r{   r|   rk   ro   r^   r}   r~   r   r   r   rM   r,   r,     s     %!
7 7rS   c                   r   )
r-   i  z*A ``language`` statement within a feature.Nc                T    \         P                  W4       Wn        W n        W0n        R # rf   )r@   rk   rV   include_defaultrZ   )ri   rV   r3  rZ   rg   r   rM   rk   ZLanguageStatement.__init__  s     4* . rS   c                s    VP                  V P                  V P                  V P                  V P                  R7       R# )z4Call the builder object's ``set_language`` callback.)rg   rV   r3  rZ   N)Zset_languagerg   rV   r3  rZ   rm   rj   rM   ro   ZLanguageStatement.build  s3    ]]]] 00]]	 	 	
rS   c                s    R P                  V P                  P                  4       4      pV P                  '       g
   VR,          pV P                  '       d
   VR,          pVR,          pV# )zlanguage {}z exclude_dfltz	 requiredr   )r   rV   r   r3  rZ   r   r   rM   r^   ZLanguageStatement.asFea  sV    ""4==#6#6#89###?"C===;Cs

rS   )r3  rV   rZ   )TFNrv   r   r   r   rM   r-   r-     s     4!
 rS   c                   r   )
r.   i  z)A top-level ``languagesystem`` statement.Nc                r   rf   )r@   rk   r[   rV   )ri   r[   rV   rg   r   rM   rk   Z LanguageSystemStatement.__init__  s    4*&,"T]rS   c                sh    VP                  V P                  V P                  V P                  4       R# )z<Calls the builder object's ``add_language_system`` callback.N)Zadd_language_systemrg   r[   rV   rm   rj   rM   ro   ZLanguageSystemStatement.build  s     ##DMM4;;NrS   c                sj    R P                  V P                  V P                  P                  4       4      # )zlanguagesystem {} {};)r   r[   rV   r   rp   rj   rM   r^   ZLanguageSystemStatement.asFea  s&    &--dkk4==;N;N;PQQrS   )rV   r[   rf   rv   r   r   r   rM   r.   r.     s     38OR RrS   c                   r   )
r(   i  zA ``head`` table ``FontRevision`` statement. ``revision`` should be a
number, and will be formatted to three significant decimal places.Nc                r   rf   )r@   rk   revision)ri   r4  rg   r   rM   rk   ZFontRevisionStatement.__init__  s    4* rS   c                R    VP                  V P                  V P                  4       R # rf   )Zset_font_revisionrg   r4  rm   rj   rM   ro   ZFontRevisionStatement.build  s    !!$--?rS   c                r"  )zFontRevision {:.3f};)r   r4  rp   rj   rM   r^   ZFontRevisionStatement.asFea  s    %,,T]];;rS   )r4  rf   rv   r   r   r   rM   r(   r(     s      J!@< <rS   c                   r   )
r/   i  zA ``GDEF`` table ``LigatureCaretByIndex`` statement. ``glyphs`` should be
a `glyph-containing object`_, and ``carets`` should be a list of integers.Nc                r   rf   r@   rk   r   caretsri   r   r7  rg   r   rM   rk   Z&LigatureCaretByIndexStatement.__init__      4*$* T[rS   c                    V P                   P                  4       pVP                  V P                  V\	        V P
                  4      4       R# )zBCalls the builder object's ``add_ligatureCaretByIndex_`` callback.N)r   r   Zadd_ligatureCaretByIndex_rg   setr7  r   r   rM   ro   Z#LigatureCaretByIndexStatement.build  s3    %%'))$--T[[AQRrS   c                r   )zLigatureCaretByIndex {} {};r   c              3   r   rf   r   rK   r   rL   rM   rN   Z6LigatureCaretByIndexStatement.asFea.<locals>.<genexpr>       )F+Q#a&&+r   r   r   r^   rO   r7  rp   rj   rM   r^   Z#LigatureCaretByIndexStatement.asFea  s:    ,33KK)F$++)F!F
 	
rS   r7  r   rf   rv   r   r   r   rM   r/   r/     s      R4S

 
rS   c                   r   )
r0   i  zA ``GDEF`` table ``LigatureCaretByPos`` statement. ``glyphs`` should be
a `glyph-containing object`_, and ``carets`` should be a list of integers.Nc                r   rf   r6  r8  r   rM   rk   Z$LigatureCaretByPosStatement.__init__   r9  rS   c                r:  )z@Calls the builder object's ``add_ligatureCaretByPos_`` callback.N)r   r   Zadd_ligatureCaretByPos_rg   r;  r7  r   r   rM   ro   Z!LigatureCaretByPosStatement.build  s3    %%'''vs4;;?OPrS   c                r   )zLigatureCaretByPos {} {};r   c              3   r   rf   r   r<  rL   rM   rN   Z4LigatureCaretByPosStatement.asFea.<locals>.<genexpr>  r=  r   r>  rp   rj   rM   r^   Z!LigatureCaretByPosStatement.asFea	  s:    *11KK)F$++)F!F
 	
rS   r?  rf   rv   r   r   r   rM   r0   r0     s      R4Q

 
rS   c                   r   )
r1   i  a?  A chained contextual substitution statement.

``prefix``, ``glyphs``, and ``suffix`` should be lists of
`glyph-containing objects`_; ``replacement`` should be a single
`glyph-containing object`_.

If ``forceChain`` is True, this is expressed as a chaining rule
(e.g. ``sub f' i' by f_i``) even when no context is given.Nc                sv    \         P                  W4       WVuV n        V n        V n        WEuV n        V n        R # rf   )r@   rk   r   r   r   r   
forceChain)ri   r   r   r   r   r@  rg      &&&&&&&rM   rk   ZLigatureSubstStatement.__init__  s3    4*17-T[$+,7)$/rS   c                sx   V P                    Uu. uF  q"P                  4       NK  	  ppV P                   Uu. uF  qDP                  4       NK  	  ppV P                   Uu. uF  qfP                  4       NK  	  ppVP	                  V P
                  W5WpP                  V P                  4       R # u upi u upi u upi rf   )r   r   r   r   Zadd_ligature_substrg   r   r@  r  r   rM   ro   ZLigatureSubstStatement.build  s    (,41**,4(,41**,4(,41**,4""MM663C3CT__	
 544s   B-B2B7c                s   R p\        V P                  4      '       g.   \        V P                  4      '       g   V P                  '       d   \        V P                  4      '       d1   VRP	                  R V P                   4       4      R,           ,          pVRP	                  R V P
                   4       4      ,          p\        V P                  4      '       d1   VRRP	                  R V P                   4       4      ,           ,          pM)VRP	                  R V P
                   4       4      ,          pVR,          pV\        V P                  4      ,          pVR,          pV# )r   r   c              3   r   rf   rr   r  rL   rM   rN   /LigatureSubstStatement.asFea.<locals>.<genexpr>*  r  r   c              3   r*  r+  rr   r  rL   rM   rN   rB  +  s     A[GGIOO[r,  c              3   r   rf   rr   r  rL   rM   rN   rB  -  s     %EAggiir   c              3   r   rf   rr   r  rL   rM   rN   rB  /  s     ;{!GGII{r    by r   )rb   r   r   r@  rO   r   r^   r   r   r   rM   r^   ZLigatureSubstStatement.asFea&  s    t{{s4;;//4???4;;sxx?4;;??#EE388AT[[AAAC4;;sSXX%E%EEEE388;t{{;;;CvuT%%&&s

rS   )r@  r   r   r   r   rf   rv   r   r   r   rM   r1   r1     s      BD

 rS   c                   r   )
r2   i6  zA ``lookupflag`` statement. The ``value`` should be an integer value
representing the flags in use, but not including the ``markAttachment``
class and ``markFilteringSet`` values, which must be specified as
glyph-containing objects.Nc                r2  rf   )r@   rk   r   markAttachmentmarkFilteringSet)ri   r   rD  rE  rg   r   rM   rk   ZLookupFlagStatement.__init__<  s#     	4*
, 0rS   c                s    RpV P                   e   V P                   P                  4       pRpV P                  e   V P                  P                  4       pVP                  V P                  V P
                  W#4       R# )z8Calls the builder object's ``set_lookup_flag`` callback.N)rD  r   rE  Zset_lookup_flagrg   r   )ri   rn   Z
markAttachZ
markFilterr  rM   ro   ZLookupFlagStatement.buildD  sf    
*,,557J
  ,..779Jtzz:RrS   c                s&   . p. ROp^p\        \        V4      4       F;  pV P                  V,          ^ 8w  d   VP                  W5,          4       V^,          pK=  	  V P                  e9   VP                  RP                  V P                  P                  4       4      4       V P                  e9   VP                  RP                  V P                  P                  4       4      4       V'       g   R.pRP                  RP                  V4      4      # )RightToLeftzMarkAttachmentType {}zUseMarkFilteringSet {}Z0zlookupflag {};r   )rF  ZIgnoreBaseGlyphsZIgnoreLigaturesZIgnoreMarks)	rangerb   r   r   rD  r   r^   rE  rO   )ri   rq   r   flagsr   r  r   rM   r^   ZLookupFlagStatement.asFeaN  s    Us5z"AzzD A%

58$19D # *JJ.55d6I6I6O6O6QRS  ,JJ/66t7L7L7R7R7TUV%C&&sxx}55rS   )rD  rE  r   )r    NNNrv   r   r   r   rM   r2   r2   6  s     !
1S6 6rS   c                   r   )
r3   i_  zRepresents a ``lookup ...;`` statement to include a lookup in a feature.

The ``lookup`` should be a :class:`LookupBlock` object.Nc                r  rf   )r@   rk   rg   rW   )ri   rW   rg   r   rM   rk   Z!LookupReferenceStatement.__init__d  s    4*&."t{rS   c                sP    VP                  V P                  P                  4       R# )z8Calls the builder object's ``add_lookup_call`` callback.N)Zadd_lookup_callrW   r]   rm   rj   rM   ro   ZLookupReferenceStatement.buildh  s     0 01rS   c                sL    R P                  V P                  P                  4      # )z
lookup {};)r   rW   r]   rp   rj   rM   r^   ZLookupReferenceStatement.asFeal  s    ""4;;#3#344rS   )rg   rW   rf   rv   r   r   r   rM   r3   r3   _  s     ?825 5rS   c                   r   )
r4   ip  zA mark-to-base positioning rule. The ``base`` should be a
`glyph-containing object`_. The ``marks`` should be a list of
(:class:`Anchor`, :class:`MarkClass`) tuples.Nc                r   rf   )r@   rk   r\   marks)ri   r\   rI  rg   r   rM   rk   ZMarkBasePosStatement.__init__u  s    4* $	4:rS   c                    VP                  V P                  V P                  P                  4       V P                  4       R# )z:Calls the builder object's ``add_mark_base_pos`` callback.N)Zadd_mark_base_posrg   r\   r   rI  rm   rj   rM   ro   ZMarkBasePosStatement.buildy  s)    !!$--1C1C1EtzzRrS   c                (   R P                  V P                  P                  4       4      pV P                   FO  w  r4VRV,           \        ,           RP                  VP                  4       VP
                  4      ,           ,          pKQ  	  VR,          pV# )zpos base {}r   {} mark @{}r   )r   r\   r^   rI  r   r]   ri   rq   r   amr   rM   r^   ZMarkBasePosStatement.asFea}  sj    ""499??#45JJDA4&=5(=+?+?	166+RRRC s

rS   )r\   rI  rf   rv   r   r   r   rM   r4   r4   p  s     5,S rS   c                   r   )
r5   i  a  A mark-to-ligature positioning rule. The ``ligatures`` must be a
`glyph-containing object`_. The ``marks`` should be a list of lists: each
element in the top-level list represents a component glyph, and is made
up of a list of (:class:`Anchor`, :class:`MarkClass`) tuples representing
mark attachment points for that position.

Example::

    m1 = MarkClass("TOP_MARKS")
    m2 = MarkClass("BOTTOM_MARKS")
    # ... add definitions to mark classes...

    glyph = GlyphName("lam_meem_jeem")
    marks = [
        [ (Anchor(625,1800), m1) ], # Attachments on 1st component (lam)
        [ (Anchor(376,-378), m2) ], # Attachments on 2nd component (meem)
        [ ]                         # No attachments on the jeem
    ]
    mlp = MarkLigPosStatement(glyph, marks)

    mlp.asFea()
    # pos ligature lam_meem_jeem <anchor 625 1800> mark @TOP_MARKS
    # ligComponent <anchor 376 -378> mark @BOTTOM_MARKS;

Nc                r   rf   )r@   rk   	ligaturesrI  )ri   rP  rI  rg   r   rM   rk   ZMarkLigPosStatement.__init__      4*%."
rS   c                rJ  )z9Calls the builder object's ``add_mark_lig_pos`` callback.N)Zadd_mark_lig_posrg   rP  r   rI  rm   rj   rM   ro   ZMarkLigPosStatement.build  s)      0G0G0I4::VrS   c                sD   R P                  V P                  P                  4       4      p. pV P                   F  pRpVe   \	        V4      '       g$   RV,           \
        ^,          ,           R,           pM\V FV  w  rgVRV,           \
        ^,          ,           RP                  VP                  4       VP                  4      ,           ,          pKX  	  VP                  V4       K  	  VRV,           \
        ,           R,           P                  V4      ,          pVR,          pV# )zpos ligature {}rw   r   r  rL  ZligComponentr   )	r   rP  r^   rI  rb   r   r]   r   rO   )ri   rq   r   ZligsZlZtemprN  rO  r   rM   r^   ZMarkLigPosStatement.asFea  s    &&t~~';';'=>ADyAf}uqy0?BDA !!)$ (..qwwy!&&ABD  KK  	v%6<<TBBs

rS   )rP  rI  rf   rv   r   r   r   rM   r5   r5     s     46W rS   c                   r   )
r6   i  zA mark-to-mark positioning rule. The ``baseMarks`` must be a
`glyph-containing object`_. The ``marks`` should be a list of
(:class:`Anchor`, :class:`MarkClass`) tuples.Nc                r   rf   )r@   rk   	baseMarksrI  )ri   rR  rI  rg   r   rM   rk   ZMarkMarkPosStatement.__init__  rQ  rS   c                rJ  )z:Calls the builder object's ``add_mark_mark_pos`` callback.N)Zadd_mark_mark_posrg   rR  r   rI  rm   rj   rM   ro   ZMarkMarkPosStatement.build  s)    !!$--1H1H1JDJJWrS   c                rK  )zpos mark {}r   rL  r   )r   rR  r^   rI  r   r]   rM  r   rM   r^   ZMarkMarkPosStatement.asFea  sl    ""4>>#7#7#9:JJDA4&=5(=+?+?	166+RRRC s

rS   )rR  rI  rf   rv   r   r   r   rM   r6   r6     s     56X rS   c                   r   )
r7   i  ay  A multiple substitution statement.

Args:
    prefix: a list of `glyph-containing objects`_.
    glyph: a single glyph-containing object.
    suffix: a list of glyph-containing objects.
    replacement: a list of glyph-containing objects.
    forceChain: If true, the statement is expressed as a chaining rule
        (e.g. ``sub f' i' by f_i``) even when no context is given.
Nc                sr    \         P                  W4       WVuV n        V n        V n        W@n        WPn        R # rf   )r@   rk   r   r   r   r   r@  )ri   r   r   r   r   r@  rg   rA  rM   rk   ZMultipleSubstStatement.__init__  s1     	4*/5f,TZ&$rS   c           	     sZ   V P                    Uu. uF  q"P                  4       NK  	  ppV P                   Uu. uF  qDP                  4       NK  	  pp\        V P                  R4      '       d   V P                  P                  4       pMV P                  .p\        V4      p. pV P                   Fb  p	\        V	R4      '       d   V	P                  4       p
MV	.p
\        V
4      ^8X  d   \        V
4      V8w  d	   W,          p
VP                  V
4       Kd  	  \        \        V!  4      p\        4       p\        V4       Fb  w  rW9  g   K  VP                  V4       TP                  V P                  TTTT;'       d    W,          ;'       g    RV P                  4       Kd  	  R# u upi u upi )z;Calls the builder object's ``add_multiple_subst`` callback.r   NrJ   )r   r   r   r_   r   rb   r   r   r   zipr;  rU   ZaddZadd_multiple_substrg   r@  )ri   rn   r   r   r   r   	originalsZcountreplacesZrreplaceZseen_originalsr  r   s   &&            rM   ro   ZMultipleSubstStatement.build  sM   (,41**,4(,41**,44::z**

++-III!!Aq*%%**,#7|q S\U%:!/OOG$ " X'$Y/KA-""8,**MM,,22OO 0' 54s
   F#F(c                s   R p\        V P                  4      '       g.   \        V P                  4      '       g   V P                  '       d   \        V P                  4      '       d8   VRP	                  \        \        V P                  4      4      R,           ,          pV\        V P                  4      R,           ,          p\        V P                  4      '       d8   VRRP	                  \        \        V P                  4      4      ,           ,          pMV\        V P                  4      ,          pV P                  ;'       g    \        4       .pVR,          pVRP	                  \        \        V4      4      ,          pVR,          pV# )r   r   r   rC  r   )
rb   r   r   r@  rO   r   r^   r   r   r   )ri   rq   r   r   r  rM   r^   ZMultipleSubstStatement.asFea  s   t{{s4;;//4???4;;sxxE4;; 783>>5$s**C4;;sSXXc%&=>>>5$$C&&779;-vsxxE;/00s

rS   )r@  r   r   r   r   r   rv   r   r   r   rM   r7   r7     s     	%B rS   c                   r   )
r:   i  a  A pair positioning statement.

``glyphs1`` and ``glyphs2`` should be `glyph-containing objects`_.
``valuerecord1`` should be a :class:`ValueRecord` object;
``valuerecord2`` should be either a :class:`ValueRecord` object or ``None``.
If ``enumerated`` is true, then this is expressed as an
`enumerated pair <https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#6.b.ii>`_.
Nc                st    \         P                  W4       WPn        WuV n        V n        W4uV n        V n        R # rf   )r@   rk   
enumeratedglyphs1valuerecord1glyphs2valuerecord2)ri   rX  rY  rZ  r[  rW  rg   rA  rM   rk   ZPairPosStatement.__init__"  s5     	4*$*1'd'*1'd'rS   c                s~   V P                   '       d   V P                  P                  4       V P                  P                  4       .pRp\        P
                  ! V!   F8  w  rERpVP                  V P                  W@P                  WPP                  4       K:  	  V'       g   \        RV P                  4      hR# \        V P                  \        4      ;'       d    \        V P                  \        4      pV'       d^   VP                  V P                  V P                  P                  V P                  V P                  P                  V P                  4       R# VP                  V P                  V P                  P                  4       V P                  V P                  P                  4       V P                  4       R# )a  Calls a callback on the builder object:

* If the rule is enumerated, calls ``add_specific_pair_pos`` on each
  combination of first and second glyphs.
* If the glyphs are both single :class:`GlyphName` objects, calls
  ``add_specific_pair_pos``.
* Else, calls ``add_class_pair_pos``.
FTz%Empty glyph class in positioning ruleN)rW  rX  r   rZ  	itertoolsZproductZadd_specific_pair_posrg   rY  r[  r   r`   r
   r   Zadd_class_pair_pos)ri   rn   re   Z	seen_pairZglyph1Zglyph2Zis_specificr  rM   ro   ZPairPosStatement.build0  sP    ???&&($,,*?*?*ABAI"+"3"3Q"7 	--MM6+<+<fFWFW #8
 %;T]]   y9 
 
jLL)?
 ))""!!""!! &&%%'!!%%'!!rS   c                s   V P                   '       d   R MRpV P                  '       d~   VRP                  V P                  P	                  4       V P
                  P	                  4       V P                  P	                  4       V P                  P	                  4       4      ,          pV# VRP                  V P                  P	                  4       V P                  P	                  4       V P
                  P	                  4       4      ,          pV# )zenum rw   zpos {} {} {} {};zpos {} {} {};)rW  r[  r   rX  r^   rY  rZ  r   r   rM   r^   ZPairPosStatement.asFea[  s    gb%,,""$!!'')""$!!'')	 C 
 ?))""$dll&8&8&:D<M<M<S<S<U C 
rS   )rW  rX  rZ  rY  r[  r   rv   r   r   r   rM   r:   r:     s      @)V rS   c                   r   )
r;   ik  a<  A reverse chaining substitution statement. You don't see those every day.

Note the unusual argument order: ``suffix`` comes `before` ``glyphs``.
``old_prefix``, ``old_suffix``, ``glyphs`` and ``replacements`` should be
lists of `glyph-containing objects`_. ``glyphs`` and ``replacements`` should
be one-item lists.
Nc                r   rf   )r@   rk   
old_prefix
old_suffixr   replacements)ri   r]  r^  r   r_  rg   r   rM   rk   Z)ReverseChainSingleSubstStatement.__init__t  s)    4*+5((rS   c                s   V P                    Uu. uF  q"P                  4       NK  	  ppV P                   Uu. uF  qDP                  4       NK  	  ppV P                  ^ ,          P                  4       pV P                  ^ ,          P                  4       p\        V4      ^8X  d   V\        V4      ,          pVP                  V P                  W5\        \        Wg4      4      4       R# u upi u upi )r    N)
r]  r   r^  r   r_  rb   Zadd_reverse_chain_single_substrg   dictrS  ri   rn   r   r   r   r   rT  rU  r   rM   ro   Z&ReverseChainSingleSubstStatement.buildz  s    (,81**,8(,81**,8KKN++-	$$Q'002x=A#i.0H..MM64I0H+I	
 98s
   C&C+c                s   R p\        V P                  4      '       g   \        V P                  4      '       d   \        V P                  4      '       d1   VRP                  R V P                   4       4      R,           ,          pVRP                  R V P                   4       4      ,          p\        V P                  4      '       d1   VRRP                  R V P                   4       4      ,           ,          pM0VRP                  \        \        V P                  4      4      ,          pVRP                  RP                  R V P                   4       4      4      ,          pV# )zrsub r   c              3   r   rf   rr   r  rL   rM   rN   9ReverseChainSingleSubstStatement.asFea.<locals>.<genexpr>  s     B/Qa/r   c              3   F   "   T F  p\        V4      R ,           x  K  	  R# 5ir+  rr   r  rL   rM   rN   rb         @KqE!HsNNK   !c              3   r   rf   rr   r  rL   rM   rN   rb    s     %H1eAhhr    by {};c              3   r   rf   rr   r  rL   rM   rN   rb         (M;Laq;Lr   )	rb   r]  r^  rO   r   r   r^   r   r_  r   r   rM   r^   Z&ReverseChainSingleSubstStatement.asFea  s    t3t#7#74??##sxxB$//BBSHH388@DKK@@@C4??##sSXX%H%HHHH388Ct{{344Cy(M4;L;L(M MNN
rS   )r   r]  r^  r_  rf   rv   r   r   r   rM   r;   r;   k  s     )	
 rS   c                   r   )
r>   i  a  A single substitution statement.

Note the unusual argument order: ``prefix`` and suffix come `after`
the replacement ``glyphs``. ``prefix``, ``suffix``, ``glyphs`` and
``replace`` should be lists of `glyph-containing objects`_. ``glyphs`` and
``replace`` should be one-item lists.
Nc                sp    \         P                  W4       W4uV n        V n        WPn        Wn        W n        R # rf   )r@   rk   r   r   r@  r   r_  )ri   r   rV  r   r   r@  rg   rA  rM   rk   ZSingleSubstStatement.__init__  s.    4*#) T[$#rS   c                s   V P                    Uu. uF  q"P                  4       NK  	  ppV P                   Uu. uF  qDP                  4       NK  	  ppV P                  ^ ,          P                  4       pV P                  ^ ,          P                  4       p\        V4      ^8X  d   V\        V4      ,          pVP                  V P                  VV\        \        Wg4      4      V P                  4       R# u upi u upi )z9Calls the builder object's ``add_single_subst`` callback.N)r   r   r   r   r_  rb   Zadd_single_substrg   r   rS  r@  ra  r   rM   ro   ZSingleSubstStatement.build  s    (,41**,4(,41**,4KKN++-	$$Q'002x=A#i.0H  MMI01OO	
 54s
   C2C7c                s   R p\        V P                  4      '       g.   \        V P                  4      '       g   V P                  '       d   \        V P                  4      '       d1   VRP	                  R V P                   4       4      R,           ,          pVRP	                  R V P
                   4       4      ,          p\        V P                  4      '       d1   VRRP	                  R V P                   4       4      ,           ,          pM)VRP	                  R V P
                   4       4      ,          pVRP                  RP	                  R V P                   4       4      4      ,          pV# )r   r   c              3   r   rf   rr   r  rL   rM   rN   -SingleSubstStatement.asFea.<locals>.<genexpr>  s     >+Qa+r   c              3   rc  r+  rr   r  rL   rM   rN   rh    rd  re  c              3   r   rf   rr   r  rL   rM   rN   rh    s     %D1eAhhr   c              3   r   rf   rr   r  rL   rM   rN   rh    s     :kE!HHkr   rf  c              3   r   rf   rr   r  rL   rM   rN   rh    rg  r   )rb   r   r   r@  rO   r   r   r_  r   r   rM   r^   ZSingleSubstStatement.asFea  s    t{{s4;;//4???4;;sxx>$++>>DD388@DKK@@@C4;;sSXX%D%DDDD388:dkk:::Cy(M4;L;L(M MNN
rS   )r@  r   r   r_  r   rf   rv   r   r   r   rM   r>   r>     s     $
  rS   c                   r   )
r<   i  zA ``script`` statement.Nc                r   rf   )r@   rk   r[   )ri   r[   rg   r   rM   rk   ZScriptStatement.__init__  s    4*rS   c                r!  )z,Calls the builder's ``set_script`` callback.N)Z
set_scriptrg   r[   rm   rj   rM   ro   ZScriptStatement.build  s    4==$++6rS   c                sT    R P                  V P                  P                  4       4      # )z
script {};)r   r[   r   rp   rj   rM   r^   ZScriptStatement.asFea  s     ""4;;#4#4#677rS   )r[   rf   rv   r   r   r   rM   r<   r<     s     !78 8rS   c                   r   )
r=   i  zA single position statement. ``prefix`` and ``suffix`` should be
lists of `glyph-containing objects`_.

``pos`` should be a one-element list containing a (`glyph-containing object`_,
:class:`ValueRecord`) tuple.Nc                r   rf   )r@   rk   rY   r   r   r@  )ri   rY   r   r   r@  rg   r   rM   rk   ZSinglePosStatement.__init__  s)    4*-0&*$+t{$rS   c                sr   V P                    Uu. uF  q"P                  4       NK  	  ppV P                   Uu. uF  qDP                  4       NK  	  ppV P                   UUu. uF  w  rgVP                  4       V3NK  	  pppVP	                  V P
                  W5WP                  4       R# u upi u upi u uppi )z7Calls the builder object's ``add_single_pos`` callback.N)r   r   r   rY   Zadd_single_posrg   r@  )	ri   rn   r   r   r   r   re   r   rY   	   &&       rM   ro   ZSinglePosStatement.build  s    (,41**,4(,41**,459XX>X

e$X>t}}fc??S 54>s   B)B. B3c           
     s   R p\        V P                  4      '       g/   \        V P                  4      '       g   V P                  '       Ed   \        V P                  4      '       d8   VRP	                  \        \        V P                  4      4      R,           ,          pTRP	                  V P                   Uu. uFL  p\        V^ ,          4      R,           V^,          e   RV^,          P                  4       ,           MR,           NKN  	  up4      ,          p\        V P                  4      '       d8   VRRP	                  \        \        V P                  4      4      ,           ,          pMrTRP	                  V P                   Uu. uFE  p\        V^ ,          4      R,           V^,          e   V^,          P                  4       MR,           NKG  	  up4      ,          pVR,          pV# u upi u upi )r  r   r   rw   r   )rb   r   r   r@  rO   r   r^   rY   )ri   rq   r   r   r  rM   r^   ZSinglePosStatement.asFea  s   t{{s4;;//4???4;;sxxE4;; 783>>388
 "XX	 & !A$K/0t/?adjjl*RI I &	 C 4;;sSXXc%&=>>>388 "XX% !A$K#%19I1rRR% C 	s

#s   8AG'
AG,
)r@  rY   r   r   rf   rv   r   r   r   rM   r=   r=     s     $%
T rS   c                   r   )
rD   i  zRepresents a subtable break.Nc                r   rf   )r@   rk   rh   rj   rM   rk   ZSubtableStatement.__init__   s    4*rS   c                s<    VP                  V P                  4       R# )z<Calls the builder objects's ``add_subtable_break`` callback.N)Zadd_subtable_breakrg   rm   rj   rM   ro   ZSubtableStatement.build  s    ""4==1rS   c                rl   )z	subtable;rJ   rp   rj   rM   r^   ZSubtableStatement.asFea  s    rS   rJ   rf   rv   r   r   r   rM   rD   rD     s     &+2 rS   c                   sT   a  ] tR tRt o RtRR ltR tR tR tRR lt	R	 t
]
tR
tV tR# )rF   i  zRepresents a value record.Nc                s    \         P                  W
4       WuV n        V n        W4uV n        V n        WVuV n        V n        WxuV n        V n	        Wn
        R # rf   )r%   rk   
xPlacement
yPlacementxAdvanceyAdvance
xPlaDevice
yPlaDevice
xAdvDevice
yAdvDevicevertical)ri   rj  rk  rl  rm  rn  ro  rp  rq  rr  rg   s   &&&&&&&&&&&rM   rk   ZValueRecord.__init__  sO     	D+,6((0$t},6(,6( rS   c                s~   V P                   VP                   8H  ;'       d    V P                  VP                  8H  ;'       d}    V P                  VP                  8H  ;'       d\    V P                  VP                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P
                  VP
                  8H  # rf   )rj  rk  rl  rm  rn  rp  ri   Zotherrj   rM   __eq__ZValueRecord.__eq__"  s    OOu/// 4 45#3#334 4/4 4 /4 4 5#3#33	4 4
 5#3#33	
rS   c                s.    V P                  V4      '       * # rf   )rt  rs  rj   rM   __ne__ZValueRecord.__ne__,  s    ;;u%%%rS   c                s   \        V P                  4      \        V P                  4      ,          \        V P                  4      ,          \        V P                  4      ,          \        V P
                  4      ,          \        V P                  4      ,          \        V P                  4      ,          \        V P                  4      ,          # rf   )	Zhashrj  rk  rl  rm  rn  ro  rp  rq  rs   rQ   rM   __hash__ZValueRecord.__hash__/  s    !4??#$4==!" 4==!" 4??#	$
 4??#$ 4??#$ 4??#$		
rS   c                s   V '       g   R # V P                   V P                  r2V P                  V P                  rTV P                  V P
                  rvV P                  V P                  rV P                  p
Vf3   Vf/   Vf   V
'       d   \        V4      # Vf   V
'       g   \        V4      # T;'       g    ^ pT;'       g    ^ pT;'       g    ^ pT;'       g    ^ pVf    Vf   Vf   V	f   RV: RV: RV: RV: R2	# RV: RV: RV: RV: R\        V4      : R\        V4      : R\        V4      : R\        V	4      : R2# )z<NULL>Z<r   r   )rj  rk  rl  rm  rn  ro  rp  rq  rr  r   rR   )ri   rq   r   r   rl  rm  rn  ro  rp  rq  rr  s   &&         rM   r^   ZValueRecord.asFea;  s   1!]]DMM(!%$//J!%$//J== 9H8}$!(8}$ FFFF==q==q """&'Hh?? :&:&:&:&	
 		
rS   c                sx   a  \         ;QJ d    V 3R  lR 4       F  '       g   K   R# 	  R# ! V 3R  lR 4       4      # )c              3   s@   <"   T F  p\        SV4      R Jx  K  	  R # 5irf   )Zgetattr)rK   Zvri   r   rM   rN   Z'ValueRecord.__bool__.<locals>.<genexpr>h  s(      
	 D!D(	s   TF)rj  rk  rl  rm  rn  ro  rp  rq  )r  rs   s   frM   __bool__ZValueRecord.__bool__g  sB    s 
	
ss 	
s 	
s 
	
 
 	
rS   )	rr  rp  rl  rn  rj  rq  rm  ro  rk  )
NNNNNNNNFNrv   )rx   ry   rz   r{   r|   rk   rt  ru  rv  r^   rw  Z__nonzero__r}   r~   r   r   rM   rF   rF     s.     $!(
&

*
X
 KrS   c                   r   )	rG   iy  z+Represents a named value record definition.Nc                r   rf   )r@   rk   r]   r   )ri   r]   r   rg   r   rM   rk   ZValueRecordDefinition.__init__|  s    4*	
rS   c                sj    R P                  V P                  P                  4       V P                  4      # )zvalueRecordDef {} {};)r   r   r^   r]   rp   rj   rM   r^   ZValueRecordDefinition.asFea  s&    &--djj.>.>.@$))LLrS   )r]   r   rf   rv   r   r   r   rM   rG   rG   y  s     5
M MrS   c                 s    V ^8X  d   V^8X  d
   VR8X  d   R# V ^8X  d   V^ 8X  d
   V^ 8X  d   R# RP                  WV4      # )i   i	  rw   Z1{} {} {}r   )ZpidZeidZlidr   rM   simplify_name_attributesrz    sA    
axC1H	cQh3!8  3//rS   c                   r   )
r8   i  zRepresents a name record. (`Section 9.e. <https://adobe-type-tools.github.io/afdko/OpenTypeFeatureFileSpecification.html#9.e>`_)Nc                sl    \         P                  W4       Wn        W n        W0n        W@n        WPn        R # rf   )r@   rk   nameID
platformID	platEncIDlangIDstring)ri   r{  r|  r}  r~  r  rg   rA  rM   rk   ZNameRecord.__init__  s)    4*$"rS   c                s    VP                  V P                  V P                  V P                  V P                  V P
                  V P                  4       R# )z8Calls the builder object's ``add_name_record`` callback.N)Zadd_name_recordrg   r{  r|  r}  r~  r  rm   rj   rM   ro   ZNameRecord.build  s:    MMKKOONNKKKK	
rS   c                s   R  p\        V P                  V P                  V P                  4      pVf   \	        RV P
                  4      h\        V P                  VR7      pVR8X  dq   RP                  \        ^ \        V4      ^4       Uu. uF?  pV! \        WE,          4      R,          \        WE^,           ,          4      ,           R4      NKA  	  up4      pM0RP                  V Uu. uF  qr! \        V4      R4      NK  	  up4      p\        V P                  V P                  V P                  4      pVR8w  d
   VR,          pR	P                  V P                  W4      # u upi u upi )
c                 sR    V ^ 8  d   V ^~8:  d   V R9  d   \        V 4      # W,          # )i    )i"   i\   )Zchr)r   Zescape_patternrj   rM   escapeZ NameRecord.asFea.<locals>.escape  s(    DyQ$Y1L+@1v%))rS   zUnsupported encoding)encodingZ	utf_16_berw   i   z\%04xz\%02xr   znameid {} {}"{}";)r   r|  r}  r~  r   rg   r   r  rO   rG  rb   r   rz  r   r{  )	ri   rq   r  r  r   r  Zescaped_stringZbplatri  rM   r^   ZNameRecord.asFea  s#   	* tL!"8$--HHDKK(3{"WW #1c!fa00 714=3.q51BBHM0N  WWA%NAqfWQZ&BA%NON'U2:CKD"))$++tLL &Os   
AE&E#)r~  r{  r}  r|  r  rf   rv   r   r   r   rM   r8   r8     s!      K	
M MrS   c                   r   )r&   i  z4Represents a ``sizemenuname`` or ``name`` statement.c                sf    \         P                  W4       VP                  V P                  4       R# )z8Calls the builder object's ``add_featureName`` callback.N)r8   ro   Zadd_featureNamer{  rm   rj   rM   ro   ZFeatureNameStatement.build  s"    ',rS   c                s    V P                   R 8X  d   RpMRp\        V P                  V P                  V P                  4      pVR8w  d
   VR,          pRP                  W#V P                  4      # )ZsizeZsizemenunamer]   rw   r   z
{} {}"{}";)r{  rz  r|  r}  r~  r   r  )ri   rq   r   r  r  rM   r^   ZFeatureNameStatement.asFea  sY    ;;&  CC'U2:CKD""3dkk::rS   rJ   Nrv   )	rx   ry   rz   r{   r|   ro   r^   r}   r~   r   r   rM   r&   r&     s     >-
; ;rS   c                   s.   a  ] tR tRt o RtRR ltRtV tR# )rC   i  z+Represents a STAT table ``name`` statement.c                    \        V P                  V P                  V P                  4      pVR 8w  d
   VR,          pRP	                  W P
                  4      # rw   r   zname {}"{}";rz  r|  r}  r~  r   r  ri   rq   r  r   rM   r^   ZSTATNameStatement.asFea  A    'U2:CKD$$T;;77rS   rJ   Nrv   )rx   ry   rz   r{   r|   r^   r}   r~   r   r   rM   rC   rC     s     58 8rS   c                   r   )
r?   i  zA ``parameters`` statement.Nc                s`    \         P                  W4       Wn        W n        W0n        W@n        R # rf   )r@   rk   
DesignSizeSubfamilyID
RangeStartRangeEnd)ri   r  r  r  r  rg   r   rM   rk   ZSizeParameters.__init__  s%    4*$&$ rS   c                s    VP                  V P                  V P                  V P                  V P                  V P
                  4       R# )z<Calls the builder object's ``set_size_parameters`` callback.N)Zset_size_parametersrg   r  r  r  r  rm   rj   rM   ro   ZSizeParameters.build  s5    ##MMOOOOMM	
rS   c                s>   R P                  V P                  V P                  4      pV P                  ^ 8w  g   V P                  ^ 8w  dN   VRP                  \        V P                  ^
,          4      \        V P                  ^
,          4      4      ,          pVR,           # )zparameters {:.1f} {}z {} {}r   )r   r  r  r  r  Zintr   r   rM   r^   ZSizeParameters.asFea  sq    $++DOOT=M=MN??a4==A#58??3t';#<c$--RTBT>UVVCSyrS   )r  r  r  r  rf   rv   r   r   r   rM   r?   r?     s     %!
 rS   c                   r   )
r   i  z;Represent a name statement inside a ``cvParameters`` block.Nc           
     sD    \         P                  WW#WEVR 7       W`n        R# )ru   N)r8   rk   r   )ri   r{  r|  r}  r~  r  r   rg   r   rM   rk   Z"CVParametersNameStatement.__init__  s'     	*( 	 	
 %rS   c                s>   RpV P                   R8X  d6   RP                  VP                  P                  V P                  ^ 4      4      pVP                  V P                  4       V P                  V P                   V,           3V n        \        P                  W4       R# )z9Calls the builder object's ``add_cv_parameter`` callback.rw   r   z_{}N)r   r   Zcv_num_named_params_Zgetr{  Zadd_cv_parameterr8   ro   )ri   rn   Zitemr   rM   ro   ZCVParametersNameStatement.build  sr    ??22<< < < @ @a PQD  -{{DOOd$:;'rS   c                r  r  r  r  r   rM   r^   ZCVParametersNameStatement.asFea  r  rS   )r   r{  rf   rv   r   r   r   rM   r   r     s     E%(8 8rS   c                   r   )
r    i  a  
Statement used in cvParameters blocks of Character Variant features (cvXX).
The Unicode value may be written with either decimal or hexadecimal
notation. The value must be preceded by '0x' if it is a hexadecimal value.
The largest Unicode value allowed is 0xFFFFFF.
Nc                r   rf   )r@   rk   	characterr   )ri   r  r   rg   r   rM   rk   ZCharacterStatement.__init__  s    4*"rS   c                r!  )z9Calls the builder object's ``add_cv_character`` callback.N)Zadd_cv_characterr  r   rm   rj   rM   ro   ZCharacterStatement.build  s      :rS   c                r"  )zCharacter {:#x};)r   r  rp   rj   rM   r^   ZCharacterStatement.asFea#  s    !((88rS   )r  r   rf   rv   r   r   r   rM   r    r      s     
;9 9rS   c                   r   )
r   i'  zAn axis definition, being either a ``VertAxis.BaseTagList/BaseScriptList``
pair or a ``HorizAxis.BaseTagList/BaseScriptList`` pair.Nc                sb    \         P                  W4       Wn        W n        W0n        . V n        R # rf   )r@   rk   basesscriptsrr  minmax)ri   r  r  rr  r  rg   r   rM   rk   ZBaseAxis.__init__+  s&    4*
 rS   c                s~    VP                  V P                  V P                  V P                  V P                  4       R# )z6Calls the builder object's ``set_base_axis`` callback.N)Zset_base_axisr  r  rr  r  rm   rj   rM   ro   ZBaseAxis.build2  s&    djj$,,t{{SrS   c                s4   V P                   '       d   R MRpV P                   Uu. uFH  pRP                  V^ ,          V^,          RP                  \	        \
        V^,          4      4      4      NKJ  	  ppV P                   Uu. uF3  pRP                  W#^ ,          V^,          V^,          V^,          4      NK5  	  ppRP                  VRP                  V P                  4      WRP                  V4      4      RP                  V4      ,           # u upi u upi )ZVertZHorizrx  r   z
{}Axis.MinMax {} {} {}, {};z2{}Axis.BaseTagList {};
{}{}Axis.BaseScriptList {};rI   r   )rr  r  r   rO   r   r   r  r  )ri   rq   Z	directionrN  r  Zminmaxesr   rM   r^   ZBaseAxis.asFea6  s    "mmmF	 \\
! adAaD#((3sAaD>*BC! 	 
 [[
  ,229dAaD!A$PQRSPTU  	 
 EKKsxx

+V		'@R
IIh  	 

s   AD9D)r  r  r  rr  r   rv   r   r   r   rM   r   r   '  s      @T   rS   c                   r   )
r9   iE  zAn entry in the ``OS/2`` table. Most ``values`` should be numbers or
strings, apart from when the key is ``UnicodeRange``, ``CodePageRange``
or ``Panose``, in which case it should be an array of integers.Nc                r   rf   r@   rk   r   r   ri   r   r   rg   r   rM   rk   ZOS2Field.__init__J      4*
rS   c                r!  )z6Calls the builder object's ``add_os2_field`` callback.N)Zadd_os2_fieldr   r   rm   rj   rM   ro   ZOS2Field.buildO  s    dhh

3rS   c                s   R  pRpR	p\        V Uu. uF  qUP                  4       V\        .3NK  	  up4      pTP                  V Uu. uF  qUP                  4       WR.3NK  	  up4       RV.VR&   RR .VR&   V P                  V9   dQ   RP                  W`P                  ,          ^ ,          W`P                  ,          ^,          ! V P                  4      4      # R# u upi u upi )
c                 s@    R P                  \        \        V 4      4      # )r   )rO   r   r   )r   rQ   rM   
intarr2strZ"OS2Field.asFea.<locals>.intarr2strT  s    88CQK((rS   ZPanoseZpanoseZVendorc                 s$    R P                  V 4      # )z"{}"ry  )r   rQ   rM   Z<lambda>Z OS2Field.asFea.<locals>.<lambda>i  s    &--2BrS   Zvendor{} {};rw   )ZFSTypeZTypoAscenderZTypoDescenderZTypoLineGapZ	winAscentZ
winDescentZXHeightZ	CapHeightZWeightClassZ
WidthClassZLowerOpSizeZUpperOpSize)ZUnicodeRangeZCodePageRange)r`  rc   r   Zupdater   r   r   )ri   rq   r  ZnumbersZrangesr   keywordsr  rM   r^   ZOS2Field.asFeaS  s    	)
 3@1'')aX.@AvFv!'')a_5vFG&
3&(BC88x??"1%x'9!'<TZZ'H   AFs    CC r   r   rf   rv   r   r   r   rM   r9   r9   E  s     G
4 rS   c                   r   )
r)   iq  zAn entry in the ``hhea`` table.Nc                r   rf   r  r  r   rM   rk   ZHheaField.__init__t  r  rS   c                r!  )z7Calls the builder object's ``add_hhea_field`` callback.N)Zadd_hhea_fieldr   r   rm   rj   rM   ro   ZHheaField.buildy      txx4rS   c                    Rp\        V Uu. uF  q3P                  4       V3NK  	  up4      pRP                  W@P                  ,          V P                  4      # u upi )CaretOffsetr  )r  ZAscenderZ	DescenderZLineGapr`  rc   r   r   r   ri   rq   Zfieldsr   r  r   rM   r^   ZHheaField.asFea}  sI    D8A'')Q89x14::>> 9   Ar  rf   rv   r   r   r   rM   r)   r)   q       )
5? ?rS   c                   r   )
rH   i  zAn entry in the ``vhea`` table.Nc                r   rf   r  r  r   rM   rk   ZVheaField.__init__  r  rS   c                r!  )z7Calls the builder object's ``add_vhea_field`` callback.N)Zadd_vhea_fieldr   r   rm   rj   rM   ro   ZVheaField.build  r  rS   c                r  )VertTypoAscenderr  )r  ZVertTypoDescenderZVertTypoLineGapr  r  r   rM   r^   ZVheaField.asFea  sI    M8A'')Q89x14::>> 9r  r  rf   rv   r   r   r   rM   rH   rH     r  rS   c                   r   )
rB   i  zA STAT table Design Axis

Args:
    tag (str): a 4 letter axis tag
    axisOrder (int): an int
    names (list): a list of :class:`STATNameStatement` objects
Nc                s`    \         P                  W4       Wn        W n        W0n        W@n        R # rf   )r@   rk   r   	axisOrdernamesrg   )ri   r   r  r  rg   r   rM   rk   Z STATDesignAxisStatement.__init__  s$    4*"
 rS   c                <    VP                  W P                  4       R # rf   )ZaddDesignAxisrg   rm   rj   rM   ro   ZSTATDesignAxisStatement.build  s    dMM2rS   c           
     s   V\         ,          pR V P                   RV P                   R2pTRV,           P                  V P                   Uu. uF  q3P                  VR7      NK  	  up4      R,           ,          pVR,          pV# u upi )zDesignAxis r   z { 
r   r   };)r   r   r  rO   r  r^   ri   rq   r   r   r  rM   r^   ZSTATDesignAxisStatement.asFea  sw    %DHH:Qt~~&6f=v##TZZ$PZWWFW%;Z$PQTXXXt
 %Qs   B
)r  rg   r  r   rf   rv   r   r   r   rM   rB   rB     s     !3 rS   c                   r   )
r#   i  z]STAT table ElidedFallbackName

Args:
    names: a list of :class:`STATNameStatement` objects
Nc                H    \         P                  W4       Wn        W n        R # rf   )r@   rk   r  rg   )ri   r  rg   r   rM   rk   ZElidedFallbackName.__init__      4*
 rS   c                r5  rf   )setElidedFallbackNamer  rg   rm   rj   rM   ro   ZElidedFallbackName.build      %%djj$--@rS   c           
     s    V\         ,          pR pTRV,           P                  V P                   Uu. uF  q3P                  VR7      NK  	  up4      R,           ,          pVR,          pV# u upi )zElidedFallbackName { 
r   r   r  )r   rO   r  r^   r  r  rM   r^   ZElidedFallbackName.asFea  s_    %'v##TZZ$PZWWFW%;Z$PQTXXXt
 %Qs   A*
)rg   r  rf   rv   r   r   r   rM   r#   r#     s     !
A rS   c                   r   )
r$   i  zdSTAT table ElidedFallbackNameID

Args:
    value: an int pointing to an existing name table name ID
Nc                r  rf   )r@   rk   r   rg   )ri   r   rg   r   rM   rk   ZElidedFallbackNameID.__init__  r  rS   c                r5  rf   )r  r   rg   rm   rj   rM   ro   ZElidedFallbackNameID.build  r  rS   c                s"    R V P                    R2# )zElidedFallbackNameID r   )r   rp   rj   rM   r^   ZElidedFallbackNameID.asFea  s    &tzzl!44rS   )rg   r   rf   rv   r   r   r   rM   r$   r$     s     !
A5 5rS   c                   r   )
rA   i  zA STAT table Axis Value Record

Args:
    names (list): a list of :class:`STATNameStatement` objects
    locations (list): a list of :class:`AxisValueLocationStatement` objects
    flags (int): an int
Nc                r2  rf   )r@   rk   r  	locationsrH  )ri   r  r  rH  rg   r   rM   rk   ZSTATAxisValueStatement.__init__  s    4*
"
rS   c                r  rf   )ZaddAxisValueRecordrg   rm   rj   rM   ro   ZSTATAxisValueStatement.build  s    ""47rS   c                s   R pV P                    F  pW#P                  4       ,          pK  	  V P                   F"  pW$P                  4       ,          pVR,          pK$  	  V P                  '       dx   RR.p. p^p\	        \        V4      4       F;  pV P                  V,          ^ 8w  d   VP                  WX,          4       V^,          pK=  	  VRRP                  V4       R2,          pVR,          pV# )zAxisValue {
r   ZOlderSiblingFontAttributeZElidableAxisValueNamezflag r   ;
r  )r  r^   r  rH  rG  rb   r   rO   )	ri   rq   r   rg   Z
nameRecordrH  ZflagStringsr   r  ri  rM   r^   ZSTATAxisValueStatement.asFea  s    H>>##C ' **J##%%C4KC % :::02IJEKD3u:&::$)&&ux0qy ' U388K0155Ct
rS   )rH  r  r  rf   rv   r   r   r   rM   rA   rA     s     8 rS   c                   r   )	r   i  z|
A STAT table Axis Value Location

Args:
    tag (str): a 4 letter axis tag
    values (list): a list of ints and/or floats
Nc                r   rf   )r@   rk   r   values)ri   r   r  rg   r   rM   rk   Z#AxisValueLocationStatement.__init__  s    4*rS   c                s    VR V P                    R2,          pVRP                  R V P                   4       4       R2,          pV# )z	location r   c              3   r   rf   r   )rK   r  rL   rM   rN   Z3AxisValueLocationStatement.asFea.<locals>.<genexpr>  s     7;a3q66;r   r  )r   rO   r  )ri   r   rj   rM   r^   Z AxisValueLocationStatement.asFea  sC    488*A&&#((74;;778<<
rS   )r   r  rf   rv   r   r   r   rM   r   r     s     
 rS   c                   r   )
r!   i  z
A variable layout conditionset

Args:
    name (str): the name of this conditionset
    conditions (dict): a dictionary mapping axis tags to a
        tuple of (min,max) userspace coordinates.
Nc                r   rf   )r@   rk   r]   
conditions)ri   r]   r  rg   r   rM   rk   ZConditionsetStatement.__init__   s    4*	$rS   c                sh    VP                  V P                  V P                  V P                  4       R # rf   )Zadd_conditionsetrg   r]   r  rm   rj   rM   ro   ZConditionsetStatement.build%  s       		4??KrS   c           	     s(   WR V P                    R2,           R,           ,          pV P                  P                  4        F+  w  pw  rEW\        ,           V RV RV R2,           ,          pK-  	  WR,           RV P                    R2,           ,          pV# )zconditionset r   r   r  Z})r]   r  r   r   )ri   r   rq   r   ZminvalueZmaxvalues   &&&   rM   r^   ZConditionsetStatement.asFea(  s    -		{!44u<<)-)>)>)@%C%(E>se1XJaz$EEEC *A|$))C000
rS   )r  r]   rf   )rw   rw   r   r   r   rM   r!   r!     s     %
L rS   c                   r   )
VariationBlocki0  zCA variation feature block, applicable in a given set of conditions.Nc                s\    \         P                  W4       VVVuV n        V n        V n        R # rf   )r   rk   r]   conditionsetr   )ri   r]   r  r   rg   r   rM   rk   ZVariationBlock.__init__3  s*    t& 	9	4$d&8rS   c                sn   VP                  V P                  V P                  V P                  4       V P                  R8w  d?   V P                  VP
                  9  d$   \        RV P                   2V P                  4      hVP                  p/ Vn        \        P                  W4       VP                  P                  4        FX  w  r4VP                  P                  V/ 4      P                  V P                  . 4      pVP                  V4       W29  g   KT  . W#&   KZ  	  W!n        VP                  4        R# )r   r   z,variation block used undefined conditionset N)r   rg   r]   r   r  Zconditionsets_r   r   r   ro   r   Zfeature_variations_r   r   r   )ri   rn   r   r   r   r   r   rM   ro   ZVariationBlock.build;  s    	dmmTYY8J8JK'!!)?)??!>t?P?P>QR  $$D"!++113JC//::3CNN!!2E LL" " 4 %rS   c                sf   VR V P                   P                  4       ,          ,           pW P                  R,           ,          pV P                  '       d
   VR,          pVR,          pV\        P                  WR7      ,          pW!RV P                   P                  4       ,          ,           ,          pV# )zvariation %s r   r   r   r   r   )r]   r   r  r   r   r^   r   r   rM   r^   ZVariationBlock.asFeaW  s    ):::  3&&?"Cuu{{4{//	DIIOO$5555
rS   )r  r]   r   r   rv   r   r   r   rM   r  r  0  s     M
8 rS   r  z    )Yr   ZfontTools.feaLib.errorr   ZfontTools.feaLib.locationr   ZfontTools.misc.encodingToolsr   ZfontTools.misc.textToolsr   r   Zcollectionsr   r\  r   Z__all__rR   r;  rd   r^   Zobjectr   r@   r%   r	   r   r
   r   r   r   r   r   r   r   r   r   rE   r   r   r   r   r   r   r   r   r   r   r"   r'   r*   r+   r,   r-   r.   r(   r/   r0   r1   r2   r3   r4   r5   r6   r7   r:   r;   r>   r<   r=   rD   rF   rG   rz  r8   r&   rC   r?   r   r    r   r9   r)   rH   rB   r#   r$   rA   r   r!   r  rJ   rS   rM   <module>r     s    2 8 4 5 # CCC C 	C
 C C C C C C C C C C C  !C" #C$ %C& 'C( )C* !+C, -C.  /C0 1C2 !3C4 5C6 7C8 9C: ;C< =C> ?C@ ACB  CCD ECF GCH ICJ KCL MCN OCP QCR $SCT "UCV WCX YCZ [C\ ]C^ _C` aCb cCd eCf gCh iCj 'kCl mCn oCp qCr sCt uCv wCx yCz {C| }C~ C@ ACB CCD ECLF 555 	5 		5
 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5  	!5" 	#5$ 	%5& 	'5( 	)5* 	+5, 	-5. 	/50 	152 	354 	556 	758 	95: 	;5< 	=5> 	?5@ 	A5B 	C5D 	E5F 	G5H 	I5J 	K5L 	M5N 	O5P 	Q5R 	S5T 	U5V 	W5X 	Y5Z 	[5\ 	]5^ 	_5` 	a5b 	c5d 	e5f 	g5h 	i57tf ,	 		 		g 	
 !
 ! ;% ;%|*Z *")J )"Y 
I 
.	J% 	J5 >% *% , C9 C 
Y 
<* *Z$
) $
N"i "J"Z "Jy 
i 
&7y 7t7 7tT) T*6	 6!9 !9H99 9B7y 7&	 :Ri R<I <
I 
&
) 
&$Y $N&6) &6R5y 5"9 *5) 5p9 *CY CLPy Pf%y %P+9 +\8i 8* *Z	 k* k\	MI 	M0.M .Mb;: ;&8
 8Y 68
 869 9* y  <)y )X?	 ?$?	 ?$i 6 .59 5&%Y %P (I 4/U /rS   