Commit 037b973b authored by Jay Herron's avatar Jay Herron

Fix so that keywords don't get matched by function calls.

parent e2676155
package org.jayherron.trioeditor.editors;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.text.rules.*;
import org.eclipse.jface.text.rules.ICharacterScanner;
import org.eclipse.jface.text.rules.IToken;
import org.eclipse.jface.text.rules.IWordDetector;
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.text.rules.WordRule;
/**
......@@ -61,14 +61,15 @@ public class KeywordRule extends WordRule {
}
/**
* This overridden function requires that the previous character is not a letter, digit, or underscore
* This overridden function requires that the previous character is not an allowed tag character(letter,
* digit, or underscore) or a '.', indicating a function call.
*
*/
@Override
public IToken evaluate(ICharacterScanner scanner) {
scanner.unread();
int p = scanner.read();
if(!Character.isLetterOrDigit(p) && p != '_'){
if(!Character.isLetterOrDigit(p) && p != '_' && p != '.'){
return super.evaluate(scanner);
}
return Token.UNDEFINED;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment