Skip to content

Commit

Permalink
adding a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera committed Sep 28, 2024
1 parent ad4331e commit f409eec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mathics/core/pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ class BasePattern(ABC):

expr: BaseElement

# this attribute allows for a faster match algorithm based on sameq
# this attribute allows for a faster match algorithm based on sameq.
# Probably we should split ExpressionPattern into two different classes,
# one for literal patterns and the other for "Regular" ExpressionPatterns.
isliteral: bool = False

# TODO: In WMA, when a BasePattern is created, the attributes
Expand Down Expand Up @@ -459,6 +461,7 @@ def match(
"""Try to match the pattern against an Expression"""
evaluation.check_stopped()
if self.isliteral:
print(self.expr, "is literal")
if expression.sameQ(self.expr):
# yield vars, None
yield_func(vars_dict, None)
Expand Down

0 comments on commit f409eec

Please sign in to comment.