void (PsiBuilder builder) { final PsiBuilder.Marker marker = builder.mark(); builder.advanceLexer(); if (builder.getTokenType() == RegExpTT.CATEGORY_SHORT_HAND) { if (!myCapabilities.contains(RegExpCapability.UNICODE_CATEGORY_SHORTHAND)) { builder.error(RegExpBundle.message("parse.error.category.shorthand.not.allowed.in.this.regular.expression.dialect")); } builder.advanceLexer(); } else { if (builder.getTokenType() == RegExpTT.CHARACTER && isLetter(builder.getTokenText())) { builder.error(myCapabilities.contains(RegExpCapability.UNICODE_CATEGORY_SHORTHAND) ? RegExpBundle.message("parse.error.illegal.category.shorthand") : RegExpBundle.message("parse.error.opening.brace.expected")); builder.advanceLexer(); } else if (checkMatches(builder, RegExpTT.LBRACE, myCapabilities.contains(RegExpCapability.UNICODE_CATEGORY_SHORTHAND) ? RegExpBundle.message("parse.error.opening.brace.or.category.shorthand.expected") : RegExpBundle.message("parse.error.opening.brace.expected"))) { if (builder.getTokenType() == RegExpTT.CARET) { if (!myCapabilities.contains(RegExpCapability.CARET_NEGATED_PROPERTIES)) { builder.error(RegExpBundle.message("parse.error.negating.a.property.not.allowed.in.this.regular.expression.dialect")); } builder.advanceLexer(); } if (builder.getTokenType() == RegExpTT.NAME) { builder.advanceLexer(); //name if (myCapabilities.contains(RegExpCapability.PROPERTY_VALUES) && builder.getTokenType() == RegExpTT.EQ) { builder.advanceLexer(); //eq checkMatches(builder, RegExpTT.NAME, RegExpBundle.message("parse.error.property.value.expected")); } checkMatches(builder, RegExpTT.RBRACE, RegExpBundle.message("parse.error.unclosed.property")); } else { if (builder.getTokenType() == RegExpTT.RBRACE) { builder.error(RegExpBundle.message("parse.error.empty.property")); builder.advanceLexer(); } else { builder.error(RegExpBundle.message("parse.error.property.name.expected")); } while (PROPERTY_TOKENS.contains(builder.getTokenType())) { builder.advanceLexer(); } } } } marker.done(RegExpElementTypes.PROPERTY); }