From d9eab2645da17e18670d09bdb7a0ffdc0ef18dd1 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 11 Aug 2016 18:30:29 +0200 Subject: [PATCH] regexp: fix boundaries --- .../lang/regexp/psi/impl/RegExpBoundaryImpl.java | 11 +++++------ RegExpSupport/testData/RETest.xml | 4 ++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBoundaryImpl.java b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBoundaryImpl.java index 28b807def2ea..efc697665ddc 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBoundaryImpl.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/psi/impl/RegExpBoundaryImpl.java @@ -37,21 +37,20 @@ public class RegExpBoundaryImpl extends RegExpElementImpl implements RegExpBound } else if (type == RegExpTT.DOLLAR) { return Type.LINE_END; } else { - assert type == RegExpTT.BOUNDARY : type; final String s = getUnescapedText(); if (s.equals("\\b")) { return Type.WORD; } else if (s.equals("\\b{g}")) { return Type.UNICODE_EXTENDED_GRAPHEME; - } else if (s.equals("\\B))")) { + } else if (s.equals("\\B")) { return Type.NON_WORD; - } else if (s.equals("\\A))")) { + } else if (s.equals("\\A")) { return Type.BEGIN; - } else if (s.equals("\\Z))")) { + } else if (s.equals("\\Z")) { return Type.END_NO_LINE_TERM; - } else if (s.equals("\\z))")) { + } else if (s.equals("\\z")) { return Type.END; - } else if (s.equals("\\G))")) { + } else if (s.equals("\\G")) { return Type.PREVIOUS_MATCH; } } diff --git a/RegExpSupport/testData/RETest.xml b/RegExpSupport/testData/RETest.xml index 8478e1cd36dc..e09a6e1f5ed5 100644 --- a/RegExpSupport/testData/RETest.xml +++ b/RegExpSupport/testData/RETest.xml @@ -8,6 +8,10 @@ \;]]> OK + + \b \b{g} \B \A \z \Z \G + OK +