17 def TERMINAL(pattern): |
17 def TERMINAL(pattern): |
18 """ |
18 """ |
19 Function to mark a pattern as the final one to search for. |
19 Function to mark a pattern as the final one to search for. |
20 |
20 |
21 @param pattern pattern to be marked |
21 @param pattern pattern to be marked |
22 @type str |
22 @type str |
23 @return marked pattern |
23 @return marked pattern |
24 @rtype str |
24 @rtype str |
25 """ |
25 """ |
26 return "__TERMINAL__:{0}".format(pattern) |
26 return "__TERMINAL__:{0}".format(pattern) |
27 |
27 |
28 |
28 |
29 # Cache the results of re.compile for performance reasons |
29 # Cache the results of re.compile for performance reasons |