69 Public method to create the highlighting rules. |
69 Public method to create the highlighting rules. |
70 |
70 |
71 @param rules set of highlighting rules (list of tuples of rule |
71 @param rules set of highlighting rules (list of tuples of rule |
72 pattern (string) and highlighting format (QTextCharFormat)) |
72 pattern (string) and highlighting format (QTextCharFormat)) |
73 """ |
73 """ |
74 for idx, ruleFormat in enumerate(rules): |
74 for ruleFormat in rules: |
75 rule, formats = ruleFormat |
75 rule, formats = ruleFormat |
76 terminal = rule.startswith(TERMINAL('')) |
76 terminal = rule.startswith(TERMINAL('')) |
77 if terminal: |
77 if terminal: |
78 rule = rule[len(TERMINAL('')):] |
78 rule = rule[len(TERMINAL('')):] |
79 try: |
79 try: |