I'm creating the ST language editor. I'd like to highlight operators (ex. + - * and so on).
When I add the rules to my Code scanner class it works but only when operators are separate by white space from the other words.
ie. 5 + 6 <- here operator highlights
5+6 <- here it doesn't
I think that probably I must add the rule to my PartitionScanner class. I did it like in code below but it doesn't work. Even text editor doesn't open and I get errors.
Is there any other way to add rule to PartitionScanner class which would operate only on words given?
List rules= new ArrayList();
rules.add(new MultiLineRule("(*$VMASM", "*)", kod_vmasm, (char) 0, true ));
rules.add(new MultiLineRule("(*$", "*)", dyrektywa, (char) 0, true ));
rules.add(new MultiLineRule("(*@", "*)", dyrektywa_weryfikacji, (char) 0, true ));
rules.add(new MultiLineRule("(*#", "*)", procedura_specjalna, (char) 0, true ));
rules.add(new MultiLineRule("(*", "*)", comment, (char) 0, true ));
WordRule wordRule = new WordRule(new STWordDetector(), kod_vmasm);
for (int i =0; i < STOperators.length; i++)
wordRule.addWord(STOperators[i], procedura_specjalna);
rules.add(wordRule);
IPredicateRule[] result= new IPredicateRule[rules.size()];
rules.toArray(result);
setPredicateRules(result);