60 Public method to create the highlighting rules. |
60 Public method to create the highlighting rules. |
61 |
61 |
62 @param rules set of highlighting rules (list of tuples of rule |
62 @param rules set of highlighting rules (list of tuples of rule |
63 pattern (string) and highlighting format (QTextCharFormat)) |
63 pattern (string) and highlighting format (QTextCharFormat)) |
64 """ |
64 """ |
65 for idx, ruleFormat in enumerate(rules): |
65 for _idx, ruleFormat in enumerate(rules): |
66 rule, formats = ruleFormat |
66 rule, formats = ruleFormat |
67 terminal = rule.startswith(TERMINAL('')) |
67 terminal = rule.startswith(TERMINAL('')) |
68 if terminal: |
68 if terminal: |
69 rule = rule[len(TERMINAL('')):] |
69 rule = rule[len(TERMINAL('')):] |
70 try: |
70 try: |