Corrected a couple of missing tools and features
This commit is contained in:
parent
8e97317b57
commit
6654dcbb84
|
|
@ -315,7 +315,7 @@ class TableSeparatorToken(FinalSemanticType):
|
||||||
|
|
||||||
|
|
||||||
class TableCellSizeToken(FinalSemanticType):
|
class TableCellSizeToken(FinalSemanticType):
|
||||||
label = ":cell_size"
|
label = "table:cell_size"
|
||||||
|
|
||||||
|
|
||||||
class OptionalToken(SemanticType):
|
class OptionalToken(SemanticType):
|
||||||
|
|
|
||||||
|
|
@ -187,19 +187,24 @@ def compare(me, other):
|
||||||
import rich
|
import rich
|
||||||
from bootstraparse.modules import syntax, context_mngr
|
from bootstraparse.modules import syntax, context_mngr
|
||||||
|
|
||||||
|
rich.print(f"Comparing in : {me} and {other}")
|
||||||
|
if type(me) != type(other):
|
||||||
|
rich.print(f"Type: {type(me)} != {type(other)}")
|
||||||
|
return False
|
||||||
for e, f in zip(me, other):
|
for e, f in zip(me, other):
|
||||||
if isinstance(e, context_mngr.BaseContainer) or isinstance(e, syntax.SemanticType):
|
if isinstance(e, context_mngr.BaseContainer) or isinstance(e, syntax.SemanticType):
|
||||||
compare(e, f)
|
if not compare(e, f):
|
||||||
|
return False
|
||||||
elif e != f:
|
elif e != f:
|
||||||
rich.print(f'elt:{e} != {f}')
|
rich.print(f'[{me}/{other}:elt]:{e} != {f}')
|
||||||
return False
|
return False
|
||||||
if hasattr(me, "optionals"):
|
if hasattr(me, "optionals") or hasattr(other, "optionals"):
|
||||||
if me.optionals != other.optionals:
|
if me.optionals != other.optionals:
|
||||||
rich.print(f'opt:{me.optionals} != {other.optionals}')
|
rich.print(f'[{me.label}:opt]]:{me.optionals} != {other.optionals}')
|
||||||
return False
|
return False
|
||||||
if hasattr(me, "others"):
|
if hasattr(me, "others") or hasattr(other, "others"):
|
||||||
if me.others != other.others:
|
if me.others != other.others:
|
||||||
rich.print(f'oth:{me.others} != {other.others}')
|
rich.print(f'[{me.label}:oth]:{me.others} != {other.others}')
|
||||||
return False
|
return False
|
||||||
rich.print("No differences found")
|
rich.print("No differences found")
|
||||||
return True
|
return True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue