From 0ff6027cf3d162ac459af132422260889c181995 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 10 Jan 2012 17:46:22 +0100 Subject: [PATCH] linear custom file type keyword parser --- .../intellij/ide/highlighter/custom/tokens/KeywordParser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/highlighter/custom/tokens/KeywordParser.java b/platform/lang-impl/src/com/intellij/ide/highlighter/custom/tokens/KeywordParser.java index ea7f8bda6f6a..cb985a0b962d 100644 --- a/platform/lang-impl/src/com/intellij/ide/highlighter/custom/tokens/KeywordParser.java +++ b/platform/lang-impl/src/com/intellij/ide/highlighter/custom/tokens/KeywordParser.java @@ -49,7 +49,7 @@ public class KeywordParser extends TokenParser { } Pattern pattern = null; try { - pattern = Pattern.compile("(" + regex + ")($|[\\W].*)", (ignoreCase ? Pattern.CASE_INSENSITIVE : 0) | Pattern.DOTALL); + pattern = Pattern.compile("(" + regex + ")($|[\\W])", (ignoreCase ? Pattern.CASE_INSENSITIVE : 0) | Pattern.DOTALL); } catch (PatternSyntaxException e) { LOG.error(e); @@ -75,7 +75,7 @@ public class KeywordParser extends TokenParser { } Matcher matcher = myPattern.matcher(myBuffer.subSequence(position, myBuffer.length())); - if (!matcher.matches()) { + if (!matcher.lookingAt()) { return false; }