Skip to content

Commit

Permalink
Updated max search depth handling
Browse files Browse the repository at this point in the history
  • Loading branch information
keiffster committed Mar 13, 2017
1 parent b37de63 commit 615d317
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 78 deletions.
9 changes: 8 additions & 1 deletion src/programy/parser/pattern/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,16 @@ def to_string(self):

class MatchContext(object):

def __init__(self):
MAX_SEARCH_DEPTH = 10000

def __init__(self, max_search_depth=MAX_SEARCH_DEPTH):
self._matched_nodes = []
self._template_node = None
self._max_search_depth = max_search_depth

@property
def max_search_depth(self):
return self._max_search_depth

def add_match(self, match):
self._matched_nodes.append(match)
Expand Down
Loading

0 comments on commit 615d317

Please sign in to comment.