TextMateLexerState (@NotNull SyntaxNodeDescriptor syntaxNodeDescriptor, @NotNull StringWithId string, int byteOffset, int gosOffset, boolean matchBeginOfString, @NotNull TextMateWeigh.Priority priority, @NotNull TextMateScope currentScope) { CharSequence match = syntaxNodeDescriptor.getStringAttribute(Constants.StringKey.MATCH); if (match != null) { RegexFacade regex = regex(match.toString()); MatchData matchData = regex.match(string, byteOffset, gosOffset, matchBeginOfString, ourCheckCancelledCallback); return new TextMateLexerState(syntaxNodeDescriptor, matchData, priority, byteOffset, string); } CharSequence begin = syntaxNodeDescriptor.getStringAttribute(Constants.StringKey.BEGIN); if (begin != null) { RegexFacade regex = regex(begin.toString()); MatchData matchData = regex.match(string, byteOffset, gosOffset, matchBeginOfString, ourCheckCancelledCallback); return new TextMateLexerState(syntaxNodeDescriptor, matchData, priority, byteOffset, string); } if (syntaxNodeDescriptor.getStringAttribute(Constants.StringKey.END) != null) { return TextMateLexerState.notMatched(syntaxNodeDescriptor); } return matchFirstUncached(syntaxNodeDescriptor, string, byteOffset, gosOffset, matchBeginOfString, priority, currentScope); }