Skip to content

Commit

Permalink
Add a named lookup to disjoin_equals_sign
Browse files Browse the repository at this point in the history
  • Loading branch information
dscorbett committed Jul 22, 2023
1 parent 78b20d4 commit f061759
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sources/phases/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,11 @@ def disjoin_equals_sign(
classes['all'].append(root_parent_edge)
zwnj = Schema(None, Space(0, margins=True), 0, Type.NON_JOINING, side_bearing=0)
add_rule(lookup, Rule([equals_sign], [zwnj, equals_sign]))
for tree in _make_trees('joiner', None, MAX_TREE_DEPTH, top_widths=range(0, equals_sign.max_tree_width() + 1)):
add_rule(lookup, Rule([equals_sign, *filter(None, tree)], [root_parent_edge], [], [zwnj, root_parent_edge]))
if trees := _make_trees('joiner', None, MAX_TREE_DEPTH, top_widths=range(0, equals_sign.max_tree_width() + 1)):
named_lookups['prepend_zwnj'] = Lookup(None, None)
add_rule(named_lookups['prepend_zwnj'], Rule([root_parent_edge], [zwnj, root_parent_edge]))
for tree in trees:
add_rule(lookup, Rule([equals_sign, *filter(None, tree)], [root_parent_edge], [], lookups=['prepend_zwnj']))
return [lookup]


Expand Down

0 comments on commit f061759

Please sign in to comment.