Nikolaus Waxweiler
d584daa8fd
Blacken code
2022-12-13 11:26:36 +00:00
Khaled Hosny
d2167235e0
[voltLib] Accept DO_NOT_TOUCH_CMAP keyword
...
Corresponds to the “Do not overwrite camp table” option in VOLT.
2020-06-08 03:19:06 +02:00
Khaled Hosny
2956772c62
[voltLib] Plain dict is good now
2020-06-04 14:08:20 +02:00
Khaled Hosny
3c4f5a75bf
[voltLib] Unescape new line in lookup comments
2020-06-04 14:08:20 +02:00
Khaled Hosny
18886da333
[voltLib] Use NamedTuple for pos
...
Using a plain tuple here is ugly, it should have been another ast class,
using NamedTuple to not break backward compatibility. Needed for next
commit.
2020-06-04 14:08:20 +02:00
Khaled Hosny
91cb76554d
[voltLib] Handle ALL and NONE in PROCESS_MARKS
...
Both were treated as group names, as NONE was not checked at all and
code for ALL was never reached.
2019-09-25 13:03:52 +02:00
Nikolaus Waxweiler
01328213c7
Remove __future__ imports
2019-08-09 12:20:13 +01:00
Khaled Hosny
e082abf627
[voltLib] Allow passing file-like object to Parser
2019-04-04 18:50:36 +02:00
Khaled Hosny
cedf79b505
[voltLib] Return a tuple from parse_coverage_()
...
This is a followup to commit 94633e9f46975c356ec3a2d21ed30768c2fa0cd5,
where I mistakenly made it return an Enum but parse_coverage_() it not
used only for ENUMs and in many (most?) places returning an Enum is
wrong as you have a list of separate items that has to rmain separate.
2019-02-02 01:13:14 +02:00
Khaled Hosny
cd553debc3
[voltLib] Accept COMPONENT glyph type
2019-01-24 13:55:53 +02:00
Khaled Hosny
b6ec12bad0
[voltLib] Distinguish different PROCESS_MARKS
...
PROCESS_MARKS followed by a group name is used for markAttachmentType
lookup flag, while followed by MARK_GLYPH_SET is used for
useMarkFilteringSet. The code parsed both correctly but did not
distinguish between the two in the generated AST as it should since they
compile to different lookup flags.
2019-01-23 10:18:44 +02:00
Khaled Hosny
4236772ec1
[voltLib] glyphSet() should return tuple
...
We need to maintain the glyph order and keep any duplicates.
2019-01-22 09:42:22 +02:00
Khaled Hosny
94633e9f46
[voltLib] Fix parsing glyph groups
...
* Fix ast.GroupDefinition.glyphSet() by using ast.GlyphName,
ast.GroupName and ast.Range in Parser.parse_coverage_(), and making it return
ast.Enum.
* Add ast.Enum.__len_() to fix the calculation of max_src and max_dest
in Parser.parse_substitution_(). I’m not sure I understand the logic
of this many to many check, will double check later.
* Update the test suite to reflect this. Had to add ast.Enum.__eq__() to
make it less painful, and __hash__() as otherwise ast.Enum wouldn’t be
used as a key in dicts (not sure this is a goo idea either, will
double check later).
2019-01-22 09:42:22 +02:00
Khaled Hosny
e529832362
[voltLib] Don’t try to read past END
...
The parser was still trying to read the next token even when the current
token was END, but I think it should just stop reading here. When
reading from TSIV table there can be null bytes at the end when would
cause an exception in the lexer.
2019-01-16 23:04:14 +02:00
Khaled Hosny
ca716e0925
[voltLib] Fix check for duplicate anchors
...
When checking for duplicate anchors, the component number should be
taken into account since the same anchors can be used for different
components i.e. over ligatures.
2019-01-16 15:31:05 +02:00
Cosimo Lupo
1fb1529a18
[voltLib.ast] same as feaLib, location=None by default
2018-02-27 19:00:08 +00:00
moyogo
b97476885b
[voltLib] parser: glyphs OrderedSymbolTable is case sensitive
2016-09-15 09:17:11 +01:00
moyogo
fbd90ec94b
[voltLib] parser: don’t use feaLib.parse
2016-09-15 07:09:01 +01:00
moyogo
76d8084d77
[voltLib] use OrderedDict for mapping
2016-09-14 17:25:26 +01:00
moyogo
31a1aa8c7a
[voltLib] use tuple for coverage and in mapping
2016-09-14 17:25:26 +01:00
moyogo
2f71f7c9ad
[voltLib] remove unsused SymbolTable.expand() and remove commented calls
2016-09-14 17:25:26 +01:00
moyogo
bc63725beb
[voltLib] Add GlyphName, Enum, GroupName, Range to ast. Add resolve_group and glyph_range to Parser
2016-09-14 17:25:25 +01:00
moyogo
f91020c2f4
[voltLib] add OrderedSymbolTable, needed for Parser.glyphs_ and ranges
2016-09-14 17:25:25 +01:00
moyogo
e729fd9b54
[voltLib] parse ReverseChainingSingle substitution
2016-09-14 17:25:25 +01:00
moyogo
e93f7384a5
[voltLib] parse substitution as single, multiple or ligature sub
2016-09-14 17:25:25 +01:00
moyogo
c564b31f47
[voltLib] test for duplicate lang tag
2016-09-14 17:25:25 +01:00
moyogo
da80ce9cd1
[voltLib] test for duplicate script tag
2016-09-14 17:25:25 +01:00
moyogo
23106f71ec
[voltLib] lookup name must start with letter
2016-09-14 17:25:25 +01:00
moyogo
1dbb08a296
[voltLib] parse substitution single to multiple and multiple to single, change single to single.
2016-09-14 17:25:24 +01:00
moyogo
1b1b52500c
[voltLib] handle duplicate or case insensitive duplicate names
2016-09-14 17:25:24 +01:00
moyogo
80a4cc6d72
[voltLib] change how adjust_single is parsed
2016-09-14 17:25:24 +01:00
moyogo
eb3a2cccd9
[voltLib] parse process_base and process_marks differently for LookupDefinition
2016-09-14 17:25:24 +01:00
moyogo
6caba42cc2
[voltLib] 'adjust_pair' instead of just 'adjust'
2016-09-14 17:25:24 +01:00
moyogo
a561fc797b
[voltLib] handle empty sub or pos
2016-09-14 17:25:23 +01:00
moyogo
296de366d5
[voltLib] fix parsing device tables, add parse_adjust_by_
2016-09-14 17:25:23 +01:00
moyogo
8d193ddc53
[voltLib] formatting
2016-09-14 17:25:23 +01:00
moyogo
b70ef7accd
[voltLib] parse REVERSAL for reverse chaining context singl substitution
2016-09-14 17:25:23 +01:00
moyogo
319b4cc227
[voltLib] range definition uses TO
2016-09-14 17:25:23 +01:00
moyogo
bf167e6b3b
[voltLib] adjust comment
2016-09-14 17:25:23 +01:00
moyogo
0c8afe0df6
[voltLib] Comment out code expanding resolved_group in expand()
2016-09-14 17:25:22 +01:00
moyogo
2cb543d89a
[voltLib] Comment out group code from 91be69c
2016-09-14 17:25:22 +01:00
moyogo
33417d7e19
[voltLib] Move code from parse_position_() to parse_attach_(), parse_attach_cursive_(), parse_adjust_pair_(), parse_adjust_single_()
2016-09-14 17:25:22 +01:00
moyogo
b0069bbde5
[voltLib] some groups may not be defined yet; should check that group exists after all groups are defined
2016-09-14 17:25:21 +01:00
moyogo
fd8149c08d
[voltLib] parser.py: comment out unused variables
2016-09-14 17:25:21 +01:00
moyogo
21fff17f8c
[voltLib] unicode_values may be invalid
2016-09-14 17:25:21 +01:00
moyogo
021e377482
[voltLib] Add attach cursive and adjust single to parser
2016-09-14 17:25:21 +01:00
moyogo
d47b818774
[voltLib] COMPONENTS doesn't have to be preceded by LIGATURE
2016-09-14 17:25:21 +01:00
moyogo
19c55a2d05
[voltLib] Add expand() for groups
2016-09-14 17:25:21 +01:00
moyogo
e06cd2385e
[voltLib] use dict PARSE_FUNCS and getattr instead of series of if/elif
2016-09-14 17:25:21 +01:00
moyogo
cdfd1a11c3
[voltLib] add Parser.anchors
2016-09-14 17:25:20 +01:00