diff --git a/.idea/jsonSchemas.xml b/.idea/jsonSchemas.xml
new file mode 100644
index 000000000000..1054caf9abd1
--- /dev/null
+++ b/.idea/jsonSchemas.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
diff --git a/intellij.idea.community.main.iml b/intellij.idea.community.main.iml
index 9299d7232455..8286f3653609 100644
--- a/intellij.idea.community.main.iml
+++ b/intellij.idea.community.main.iml
@@ -126,5 +126,6 @@
+
-
\ No newline at end of file
+
diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties
index 9af14d50b80a..c52438fed73a 100644
--- a/platform/util/resources/misc/registry.properties
+++ b/platform/util/resources/misc/registry.properties
@@ -1091,6 +1091,10 @@ editor.xcode.like.scrollbar.description=Enables auto-hideable Xcode-like editor
editor.config.stop.at.project.root=true
editor.config.stop.at.project.root.description=Stops searching for .editorconfig at project root (requires project reopening)
+editor.config.breadcrumbs.support=false
+editor.config.breadcrumbs.support.description=Enables breadcrumbs for .editorconfig files
+editor.config.csharp.support=false
+editor.config.csharp.support.description=Enables completion for .editorconfig options from Roslyn and R#
editor.bold.underline.height=2
editor.bold.underline.height.description=Underline height for EffectType.BOLD_LINE_UNDERSCORE
diff --git a/plugins/editorconfig/.gitignore b/plugins/editorconfig/.gitignore
new file mode 100644
index 000000000000..80ebbda689f8
--- /dev/null
+++ b/plugins/editorconfig/.gitignore
@@ -0,0 +1,3 @@
+# lexer generation utils
+jflex-*.jar
+idea-flex.skeleton
diff --git a/plugins/editorconfig/LICENSE.txt b/plugins/editorconfig/LICENSE.txt
index fff944099438..eb2381a83e17 100644
--- a/plugins/editorconfig/LICENSE.txt
+++ b/plugins/editorconfig/LICENSE.txt
@@ -1,6 +1,7 @@
The MIT License (MIT)
Copyright (c) 2013 Kevin Bell
+Copyright (c) 2014-2018 JetBrains
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
+THE SOFTWARE.
diff --git a/plugins/editorconfig/gen/org/editorconfig/language/lexer/_EditorConfigLexer.java b/plugins/editorconfig/gen/org/editorconfig/language/lexer/_EditorConfigLexer.java
new file mode 100644
index 000000000000..7e76a76cf8c9
--- /dev/null
+++ b/plugins/editorconfig/gen/org/editorconfig/language/lexer/_EditorConfigLexer.java
@@ -0,0 +1,660 @@
+// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+
+/* The following code was generated by JFlex 1.7.0 tweaked for IntelliJ platform */
+
+package org.editorconfig.language.lexer;
+
+import com.intellij.lexer.FlexLexer;
+import com.intellij.psi.tree.IElementType;
+import kotlin.NotImplementedError;
+
+import java.io.IOException;
+import java.io.Reader;
+
+import static com.intellij.psi.TokenType.BAD_CHARACTER;
+import static com.intellij.psi.TokenType.WHITE_SPACE;
+import static org.editorconfig.language.psi.EditorConfigElementTypes.*;
+
+
+/**
+ * This class is a scanner generated by
+ * JFlex 1.7.0
+ * from the specification file _EditorConfigLexer.flex
+ */
+public class _EditorConfigLexer implements FlexLexer {
+
+ /**
+ * This character denotes the end of file
+ */
+ public static final int YYEOF = -1;
+
+ /** initial size of the lookahead buffer */
+ private static final int ZZ_BUFFERSIZE = 16384;
+
+ /** lexical states */
+ public static final int YYINITIAL = 0;
+ public static final int YYHEADER = 2;
+ public static final int YYCHARCLASS = 4;
+
+ /**
+ * ZZ_LEXSTATE[l] is the state in the DFA for the lexical state l
+ * ZZ_LEXSTATE[l+1] is the state in the DFA for the lexical state l
+ * at the beginning of a line
+ * l is of the form l = 2*k, k a non negative integer
+ */
+ private static final int ZZ_LEXSTATE[] = {
+ 0, 0, 1, 1, 2, 2
+ };
+
+ /**
+ * Translates characters to character classes
+ * Chosen bits are [7, 7, 7]
+ * Total runtime size is 1928 bytes
+ */
+ public static int ZZ_CMAP(int ch) {
+ return ZZ_CMAP_A[(ZZ_CMAP_Y[ZZ_CMAP_Z[ch >> 14] | ((ch >> 7) & 0x7f)] << 7) | (ch&0x7f)];
+ }
+
+ /* The ZZ_CMAP_Z table has 68 entries */
+ static final char ZZ_CMAP_Z[] = zzUnpackCMap(
+ "\1\0\103\200");
+
+ /* The ZZ_CMAP_Y table has 256 entries */
+ static final char ZZ_CMAP_Y[] = zzUnpackCMap(
+ "\1\0\1\1\53\2\1\3\22\2\1\4\37\2\1\3\237\2");
+
+ /* The ZZ_CMAP_A table has 640 entries */
+ static final char ZZ_CMAP_A[] = zzUnpackCMap(
+ "\11\0\1\1\1\3\2\5\1\4\22\0\1\1\1\14\1\0\1\2\6\0\1\16\1\0\1\13\1\0\1\10\13" +
+ "\0\1\11\1\2\1\0\1\12\1\0\1\17\33\0\1\20\1\7\1\15\35\0\1\21\1\0\1\6\7\0\1\5"+
+ "\32\0\1\1\337\0\1\1\177\0\13\1\35\0\2\5\5\0\1\1\57\0\1\1\40\0");
+
+ /**
+ * Translates DFA states to action switch labels.
+ */
+ private static final int[] ZZ_ACTION = zzUnpackAction();
+
+ private static final String ZZ_ACTION_PACKED_0 =
+ "\3\0\1\1\1\2\1\3\1\4\1\5\1\6\1\7" +
+ "\1\10\1\11\1\12\1\13\2\14\1\15\1\16\1\17" +
+ "\1\20\1\21\1\22\1\14\1\23\1\24\1\0\1\12"+
+ "\1\25\1\22";
+
+ private static int[] zzUnpackAction() {
+ int[] result = new int[29];
+ int offset = 0;
+ offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
+ return result;
+ }
+
+ private static int zzUnpackAction(String packed, int offset, int[] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int count = packed.charAt(i++);
+ int value = packed.charAt(i++);
+ do {
+ result[j++] = value;
+ }
+ while (--count > 0);
+ }
+ return j;
+ }
+
+
+ /**
+ * Translates a state to a row index in the transition table
+ */
+ private static final int[] ZZ_ROWMAP = zzUnpackRowMap();
+
+ private static final String ZZ_ROWMAP_PACKED_0 =
+ "\0\0\0\22\0\44\0\66\0\110\0\132\0\154\0\154" +
+ "\0\154\0\154\0\154\0\154\0\176\0\154\0\220\0\154" +
+ "\0\154\0\242\0\154\0\154\0\154\0\154\0\264\0\154"+
+ "\0\154\0\220\0\306\0\154\0\330";
+
+ private static int[] zzUnpackRowMap() {
+ int[] result = new int[29];
+ int offset = 0;
+ offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
+ return result;
+ }
+
+ private static int zzUnpackRowMap(String packed, int offset, int[] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int high = packed.charAt(i++) << 16;
+ result[j++] = high | packed.charAt(i++);
+ }
+ return j;
+ }
+
+ /**
+ * The transition table of the DFA
+ */
+ private static final int[] ZZ_TRANS = zzUnpackTrans();
+
+ private static final String ZZ_TRANS_PACKED_0 =
+ "\1\4\1\5\1\6\3\5\2\4\1\7\1\10\1\11" +
+ "\1\12\1\4\1\13\2\4\1\14\1\4\1\15\1\5" +
+ "\1\6\3\5\1\16\1\17\1\15\1\20\1\11\1\12" +
+ "\1\20\1\21\1\22\1\23\1\24\1\25\1\26\1\5" +
+ "\1\6\3\5\1\20\1\27\1\26\1\20\1\11\1\12" +
+ "\1\30\1\31\4\20\1\4\5\0\2\4\4\0\1\4" +
+ "\1\0\2\4\1\0\1\4\1\0\1\5\1\0\3\5" +
+ "\14\0\3\6\3\0\14\6\22\0\1\15\6\0\1\32" +
+ "\1\15\11\0\4\15\1\33\15\15\16\0\1\34\3\0" +
+ "\4\26\1\35\15\26\1\15\2\0\1\15\3\0\1\32"+
+ "\1\15\14\0\1\26\16\0";
+
+ private static int[] zzUnpackTrans() {
+ int[] result = new int[234];
+ int offset = 0;
+ offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result);
+ return result;
+ }
+
+ private static int zzUnpackTrans(String packed, int offset, int[] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int count = packed.charAt(i++);
+ int value = packed.charAt(i++);
+ value--;
+ do {
+ result[j++] = value;
+ }
+ while (--count > 0);
+ }
+ return j;
+ }
+
+
+ /* error codes */
+ private static final int ZZ_UNKNOWN_ERROR = 0;
+ private static final int ZZ_NO_MATCH = 1;
+ private static final int ZZ_PUSHBACK_2BIG = 2;
+
+ /* error messages for the codes above */
+ private static final String[] ZZ_ERROR_MSG = {
+ "Unknown internal scanner error",
+ "Error: could not match input",
+ "Error: pushback value was too large"
+ };
+
+ /**
+ * ZZ_ATTRIBUTE[aState] contains the attributes of state aState
+ */
+ private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
+
+ private static final String ZZ_ATTRIBUTE_PACKED_0 =
+ "\3\0\3\1\6\11\1\1\1\11\1\1\2\11\1\1"+
+ "\4\11\1\1\2\11\1\0\1\1\1\11\1\1";
+
+ private static int[] zzUnpackAttribute() {
+ int[] result = new int[29];
+ int offset = 0;
+ offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
+ return result;
+ }
+
+ private static int zzUnpackAttribute(String packed, int offset, int[] result) {
+ int i = 0; /* index in packed string */
+ int j = offset; /* index in unpacked array */
+ int l = packed.length();
+ while (i < l) {
+ int count = packed.charAt(i++);
+ int value = packed.charAt(i++);
+ do {
+ result[j++] = value;
+ }
+ while (--count > 0);
+ }
+ return j;
+ }
+
+ /** the input device */
+ private Reader zzReader;
+
+ /** the current state of the DFA */
+ private int zzState;
+
+ /** the current lexical state */
+ private int zzLexicalState = YYINITIAL;
+
+ /** this buffer contains the current text to be matched and is
+ the source of the yytext() string */
+ private CharSequence zzBuffer = "";
+
+ /** the textposition at the last accepting state */
+ private int zzMarkedPos;
+
+ /** the current text position in the buffer */
+ private int zzCurrentPos;
+
+ /** startRead marks the beginning of the yytext() string in the buffer */
+ private int zzStartRead;
+
+ /** endRead marks the last character in the buffer, that has been read
+ from input */
+ private int zzEndRead;
+
+ /**
+ * zzAtBOL == true <=> the scanner is currently at the beginning of a line
+ */
+ private boolean zzAtBOL = true;
+
+ /** zzAtEOF == true <=> the scanner is at the EOF */
+ private boolean zzAtEOF;
+
+ /** denotes if the user-EOF-code has already been executed */
+ private boolean zzEOFDone;
+
+ /* user code: */
+ private int myPreviousState = YYINITIAL;
+
+ public _EditorConfigLexer() {
+ this(null);
+ }
+
+ private static String sanitizeInput(String input) {
+ throw new NotImplementedError();
+ }
+
+
+ /**
+ * Creates a new scanner
+ *
+ * @param in the java.io.Reader to read input from.
+ */
+ public _EditorConfigLexer(Reader in) {
+ this.zzReader = in;
+ }
+
+
+ /**
+ * Unpacks the compressed character translation table.
+ *
+ * @param packed the packed character translation table
+ * @return the unpacked character translation table
+ */
+ private static char[] zzUnpackCMap(String packed) {
+ int size = 0;
+ for (int i = 0, length = packed.length(); i < length; i += 2) {
+ size += packed.charAt(i);
+ }
+ char[] map = new char[size];
+ int i = 0; /* index in packed string */
+ int j = 0; /* index in unpacked array */
+ while (i < packed.length()) {
+ int count = packed.charAt(i++);
+ char value = packed.charAt(i++);
+ do {
+ map[j++] = value;
+ }
+ while (--count > 0);
+ }
+ return map;
+ }
+
+ @Override
+ public final int getTokenStart() {
+ return zzStartRead;
+ }
+
+ @Override
+ public final int getTokenEnd() {
+ return getTokenStart() + yylength();
+ }
+
+ @Override
+ public void reset(CharSequence buffer, int start, int end, int initialState) {
+ zzBuffer = buffer;
+ zzCurrentPos = zzMarkedPos = zzStartRead = start;
+ zzAtEOF = false;
+ zzAtBOL = true;
+ zzEndRead = end;
+ yybegin(initialState);
+ }
+
+ /**
+ * Refills the input buffer.
+ *
+ * @return false, iff there was new input.
+ *
+ * @exception IOException if any I/O-Error occurs
+ */
+ private boolean zzRefill() {
+ return true;
+ }
+
+
+ /**
+ * Returns the current lexical state.
+ */
+ @Override
+ public final int yystate() {
+ return zzLexicalState;
+ }
+
+
+ /**
+ * Enters a new lexical state
+ *
+ * @param newState the new lexical state
+ */
+ @Override
+ public final void yybegin(int newState) {
+ zzLexicalState = newState;
+ }
+
+
+ /**
+ * Returns the text matched by the current regular expression.
+ */
+ public final CharSequence yytext() {
+ return zzBuffer.subSequence(zzStartRead, zzMarkedPos);
+ }
+
+
+ /**
+ * Returns the character at position pos from the
+ * matched text.
+ *
+ * It is equivalent to yytext().charAt(pos), but faster
+ *
+ * @param pos the position of the character to fetch.
+ * A value from 0 to yylength()-1.
+ *
+ * @return the character at position pos
+ */
+ public final char yycharat(int pos) {
+ return zzBuffer.charAt(zzStartRead+pos);
+ }
+
+
+ /**
+ * Returns the length of the matched text region.
+ */
+ public final int yylength() {
+ return zzMarkedPos - zzStartRead;
+ }
+
+
+ /**
+ * Reports an error that occured while scanning.
+ *
+ * In a wellformed scanner (no or only correct usage of
+ * yypushback(int) and a match-all fallback rule) this method
+ * will only be called with things that "Can't Possibly Happen".
+ * If this method is called, something is seriously wrong
+ * (e.g. a JFlex bug producing a faulty scanner etc.).
+ *
+ * Usual syntax/scanner level error handling should be done
+ * in error fallback rules.
+ *
+ * @param errorCode the code of the errormessage to display
+ */
+ private void zzScanError(int errorCode) {
+ String message;
+ try {
+ message = ZZ_ERROR_MSG[errorCode];
+ }
+ catch (ArrayIndexOutOfBoundsException e) {
+ message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
+ }
+
+ throw new Error(message);
+ }
+
+
+ /**
+ * Pushes the specified amount of characters back into the input stream.
+ *
+ * They will be read again by then next call of the scanning method
+ *
+ * @param number the number of characters to be read again.
+ * This number must not be greater than yylength()!
+ */
+ public void yypushback(int number) {
+ if (number > yylength() )
+ zzScanError(ZZ_PUSHBACK_2BIG);
+
+ zzMarkedPos -= number;
+ }
+
+
+ /**
+ * Resumes scanning until the next regular expression is matched,
+ * the end of input is encountered or an I/O-Error occurs.
+ *
+ * @return the next token
+ * @exception IOException if any I/O-Error occurs
+ */
+ @Override
+ public IElementType advance() throws IOException {
+ int zzInput;
+ int zzAction;
+
+ // cached fields:
+ int zzCurrentPosL;
+ int zzMarkedPosL;
+ int zzEndReadL = zzEndRead;
+ CharSequence zzBufferL = zzBuffer;
+
+ int[] zzTransL = ZZ_TRANS;
+ int[] zzRowMapL = ZZ_ROWMAP;
+ int[] zzAttrL = ZZ_ATTRIBUTE;
+
+ while (true) {
+ zzMarkedPosL = zzMarkedPos;
+
+ zzAction = -1;
+
+ zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
+
+ zzState = ZZ_LEXSTATE[zzLexicalState];
+
+ // set up zzAction for empty match case:
+ int zzAttributes = zzAttrL[zzState];
+ if ((zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ }
+
+
+ zzForAction: {
+ while (true) {
+
+ if (zzCurrentPosL < zzEndReadL) {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ else if (zzAtEOF) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ // store back cached positions
+ zzCurrentPos = zzCurrentPosL;
+ zzMarkedPos = zzMarkedPosL;
+ boolean eof = zzRefill();
+ // get translated positions and possibly new buffer
+ zzCurrentPosL = zzCurrentPos;
+ zzMarkedPosL = zzMarkedPos;
+ zzBufferL = zzBuffer;
+ zzEndReadL = zzEndRead;
+ if (eof) {
+ zzInput = YYEOF;
+ break zzForAction;
+ }
+ else {
+ zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/);
+ zzCurrentPosL += Character.charCount(zzInput);
+ }
+ }
+ int zzNext = zzTransL[zzRowMapL[zzState] + ZZ_CMAP(zzInput) ];
+ if (zzNext == -1) break zzForAction;
+ zzState = zzNext;
+
+ zzAttributes = zzAttrL[zzState];
+ if ((zzAttributes & 1) == 1 ) {
+ zzAction = zzState;
+ zzMarkedPosL = zzCurrentPosL;
+ if ((zzAttributes & 8) == 8) break zzForAction;
+ }
+
+ }
+ }
+
+ // store back cached position
+ zzMarkedPos = zzMarkedPosL;
+
+ if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
+ zzAtEOF = true;
+ return null;
+ }
+ else {
+ switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) {
+ case 1: {
+ return IDENTIFIER;
+ }
+ // fall through
+ case 22:
+ break;
+ case 2: {
+ return WHITE_SPACE;
+ }
+ // fall through
+ case 23:
+ break;
+ case 3: {
+ return LINE_COMMENT;
+ }
+ // fall through
+ case 24:
+ break;
+ case 4: {
+ return DOT;
+ }
+ // fall through
+ case 25:
+ break;
+ case 5: {
+ return COLON;
+ }
+ // fall through
+ case 26:
+ break;
+ case 6: {
+ yybegin(YYINITIAL);
+ return SEPARATOR;
+ }
+ // fall through
+ case 27:
+ break;
+ case 7: {
+ return COMMA;
+ }
+ // fall through
+ case 28:
+ break;
+ case 8: {
+ return R_BRACKET;
+ }
+ // fall through
+ case 29:
+ break;
+ case 9: {
+ yybegin(YYHEADER);
+ return L_BRACKET;
+ }
+ // fall through
+ case 30:
+ break;
+ case 10: {
+ return PATTERN_IDENTIFIER;
+ }
+ // fall through
+ case 31:
+ break;
+ case 11: {
+ return R_CURLY;
+ }
+ // fall through
+ case 32:
+ break;
+ case 12: {
+ return BAD_CHARACTER;
+ }
+ // fall through
+ case 33:
+ break;
+ case 13: {
+ yybegin(YYINITIAL);
+ return R_BRACKET;
+ }
+ // fall through
+ case 34:
+ break;
+ case 14: {
+ return ASTERISK;
+ }
+ // fall through
+ case 35:
+ break;
+ case 15: {
+ return QUESTION;
+ }
+ // fall through
+ case 36:
+ break;
+ case 16: {
+ yybegin(YYCHARCLASS);
+ return L_BRACKET;
+ }
+ // fall through
+ case 37:
+ break;
+ case 17: {
+ return L_CURLY;
+ }
+ // fall through
+ case 38:
+ break;
+ case 18: {
+ return CHARCLASS_LETTER;
+ }
+ // fall through
+ case 39:
+ break;
+ case 19: {
+ return EXCLAMATION;
+ }
+ // fall through
+ case 40:
+ break;
+ case 20: {
+ yybegin(YYHEADER);
+ return R_BRACKET;
+ }
+ // fall through
+ case 41:
+ break;
+ case 21: {
+ return DOUBLE_ASTERISK;
+ }
+ // fall through
+ case 42: break;
+ default:
+ zzScanError(ZZ_NO_MATCH);
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/plugins/editorconfig/gen/org/editorconfig/language/parser/EditorConfigParser.java b/plugins/editorconfig/gen/org/editorconfig/language/parser/EditorConfigParser.java
new file mode 100644
index 000000000000..8e7414beb3b4
--- /dev/null
+++ b/plugins/editorconfig/gen/org/editorconfig/language/parser/EditorConfigParser.java
@@ -0,0 +1,859 @@
+// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+
+// This is a generated file. Not intended for manual editing.
+package org.editorconfig.language.parser;
+
+import com.intellij.lang.ASTNode;
+import com.intellij.lang.LightPsiParser;
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.PsiBuilder.Marker;
+import com.intellij.lang.PsiParser;
+import com.intellij.psi.tree.IElementType;
+
+import static org.editorconfig.language.parser.EditorConfigParserUtil.*;
+import static org.editorconfig.language.psi.EditorConfigElementTypes.*;
+
+@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"})
+public class EditorConfigParser implements PsiParser, LightPsiParser {
+
+ @Override
+ public ASTNode parse(IElementType t, PsiBuilder b) {
+ parseLight(t, b);
+ return b.getTreeBuilt();
+ }
+
+ @Override
+ public void parseLight(IElementType t, PsiBuilder b) {
+ boolean r;
+ b = adapt_builder_(t, b, this, null);
+ Marker m = enter_section_(b, 0, _COLLAPSE_, null);
+ if (t == ASTERISK_PATTERN) {
+ r = asterisk_pattern(b, 0);
+ }
+ else if (t == CHAR_CLASS) {
+ r = char_class(b, 0);
+ }
+ else if (t == CHAR_CLASS_EXCLAMATION) {
+ r = char_class_exclamation(b, 0);
+ }
+ else if (t == CHAR_CLASS_LETTER) {
+ r = char_class_letter(b, 0);
+ }
+ else if (t == DOUBLE_ASTERISK_PATTERN) {
+ r = double_asterisk_pattern(b, 0);
+ }
+ else if (t == FLAT_OPTION_KEY) {
+ r = flat_option_key(b, 0);
+ }
+ else if (t == FLAT_PATTERN) {
+ r = flat_pattern(b, 0);
+ }
+ else if (t == HEADER) {
+ r = header(b, 0);
+ }
+ else if (t == OPTION) {
+ r = option(b, 0);
+ }
+ else if (t == OPTION_VALUE_IDENTIFIER) {
+ r = option_value_identifier(b, 0);
+ }
+ else if (t == OPTION_VALUE_LIST) {
+ r = option_value_list(b, 0);
+ }
+ else if (t == OPTION_VALUE_PAIR) {
+ r = option_value_pair(b, 0);
+ }
+ else if (t == PATTERN) {
+ r = pattern(b, 0);
+ }
+ else if (t == PATTERN_ENUMERATION) {
+ r = pattern_enumeration(b, 0);
+ }
+ else if (t == QUALIFIED_KEY_PART) {
+ r = qualified_key_part(b, 0);
+ }
+ else if (t == QUALIFIED_OPTION_KEY) {
+ r = qualified_option_key(b, 0);
+ }
+ else if (t == QUESTION_PATTERN) {
+ r = question_pattern(b, 0);
+ }
+ else if (t == ROOT_DECLARATION) {
+ r = root_declaration(b, 0);
+ }
+ else if (t == ROOT_DECLARATION_KEY) {
+ r = root_declaration_key(b, 0);
+ }
+ else if (t == ROOT_DECLARATION_VALUE) {
+ r = root_declaration_value(b, 0);
+ }
+ else if (t == SECTION) {
+ r = section(b, 0);
+ }
+ else {
+ r = parse_root_(t, b, 0);
+ }
+ exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);
+ }
+
+ protected boolean parse_root_(IElementType t, PsiBuilder b, int l) {
+ return editorConfigFile(b, l + 1);
+ }
+
+ /* ********************************************************** */
+ // ASTERISK
+ public static boolean asterisk_pattern(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "asterisk_pattern")) return false;
+ if (!nextTokenIs(b, ASTERISK)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, ASTERISK);
+ exit_section_(b, m, ASTERISK_PATTERN, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // L_BRACKET char_class_exclamation? char_class_letter+ R_BRACKET
+ public static boolean char_class(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "char_class")) return false;
+ if (!nextTokenIs(b, L_BRACKET)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, L_BRACKET);
+ r = r && char_class_1(b, l + 1);
+ r = r && char_class_2(b, l + 1);
+ r = r && consumeToken(b, R_BRACKET);
+ exit_section_(b, m, CHAR_CLASS, r);
+ return r;
+ }
+
+ // char_class_exclamation?
+ private static boolean char_class_1(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "char_class_1")) return false;
+ char_class_exclamation(b, l + 1);
+ return true;
+ }
+
+ // char_class_letter+
+ private static boolean char_class_2(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "char_class_2")) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = char_class_letter(b, l + 1);
+ while (r) {
+ int c = current_position_(b);
+ if (!char_class_letter(b, l + 1)) break;
+ if (!empty_element_parsed_guard_(b, "char_class_2", c)) break;
+ }
+ exit_section_(b, m, null, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // EXCLAMATION
+ public static boolean char_class_exclamation(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "char_class_exclamation")) return false;
+ if (!nextTokenIs(b, EXCLAMATION)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, EXCLAMATION);
+ exit_section_(b, m, CHAR_CLASS_EXCLAMATION, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // CHARCLASS_LETTER
+ public static boolean char_class_letter(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "char_class_letter")) return false;
+ if (!nextTokenIs(b, CHARCLASS_LETTER)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, CHARCLASS_LETTER);
+ exit_section_(b, m, CHAR_CLASS_LETTER, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // DOUBLE_ASTERISK
+ public static boolean double_asterisk_pattern(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "double_asterisk_pattern")) return false;
+ if (!nextTokenIs(b, DOUBLE_ASTERISK)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, DOUBLE_ASTERISK);
+ exit_section_(b, m, DOUBLE_ASTERISK_PATTERN, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // root_declaration* section_wrap*
+ static boolean editorConfigFile(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "editorConfigFile")) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = editorConfigFile_0(b, l + 1);
+ r = r && editorConfigFile_1(b, l + 1);
+ exit_section_(b, m, null, r);
+ return r;
+ }
+
+ // root_declaration*
+ private static boolean editorConfigFile_0(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "editorConfigFile_0")) return false;
+ while (true) {
+ int c = current_position_(b);
+ if (!root_declaration(b, l + 1)) break;
+ if (!empty_element_parsed_guard_(b, "editorConfigFile_0", c)) break;
+ }
+ return true;
+ }
+
+ // section_wrap*
+ private static boolean editorConfigFile_1(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "editorConfigFile_1")) return false;
+ while (true) {
+ int c = current_position_(b);
+ if (!section_wrap(b, l + 1)) break;
+ if (!empty_element_parsed_guard_(b, "editorConfigFile_1", c)) break;
+ }
+ return true;
+ }
+
+ /* ********************************************************** */
+ // IDENTIFIER
+ public static boolean flat_option_key(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "flat_option_key")) return false;
+ if (!nextTokenIs(b, IDENTIFIER)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, IDENTIFIER);
+ exit_section_(b, m, FLAT_OPTION_KEY, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // PATTERN_IDENTIFIER
+ public static boolean flat_pattern(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "flat_pattern")) return false;
+ if (!nextTokenIs(b, PATTERN_IDENTIFIER)) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = consumeToken(b, PATTERN_IDENTIFIER);
+ exit_section_(b, m, FLAT_PATTERN, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // L_BRACKET (pattern | pattern_enumeration)* R_BRACKET
+ public static boolean header(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "header")) return false;
+ boolean r, p;
+ Marker m = enter_section_(b, l, _NONE_, HEADER, "");
+ r = consumeToken(b, L_BRACKET);
+ p = r; // pin = 1
+ r = r && report_error_(b, header_1(b, l + 1));
+ r = p && consumeToken(b, R_BRACKET) && r;
+ exit_section_(b, l, m, r, p, not_next_entry_parser_);
+ return r || p;
+ }
+
+ // (pattern | pattern_enumeration)*
+ private static boolean header_1(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "header_1")) return false;
+ while (true) {
+ int c = current_position_(b);
+ if (!header_1_0(b, l + 1)) break;
+ if (!empty_element_parsed_guard_(b, "header_1", c)) break;
+ }
+ return true;
+ }
+
+ // pattern | pattern_enumeration
+ private static boolean header_1_0(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "header_1_0")) return false;
+ boolean r;
+ r = pattern(b, l + 1);
+ if (!r) r = pattern_enumeration(b, l + 1);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // !header
+ static boolean not_header(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "not_header")) return false;
+ boolean r;
+ Marker m = enter_section_(b, l, _NOT_);
+ r = !header(b, l + 1);
+ exit_section_(b, l, m, r, false, null);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // !(header | option | root_declaration)
+ static boolean not_next_entry(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "not_next_entry")) return false;
+ boolean r;
+ Marker m = enter_section_(b, l, _NOT_);
+ r = !not_next_entry_0(b, l + 1);
+ exit_section_(b, l, m, r, false, null);
+ return r;
+ }
+
+ // header | option | root_declaration
+ private static boolean not_next_entry_0(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "not_next_entry_0")) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = header(b, l + 1);
+ if (!r) r = option(b, l + 1);
+ if (!r) r = root_declaration(b, l + 1);
+ exit_section_(b, m, null, r);
+ return r;
+ }
+
+ /* ********************************************************** */
+ // option_key (SEPARATOR option_value?)?
+ public static boolean option(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "option")) return false;
+ boolean r, p;
+ Marker m = enter_section_(b, l, _NONE_, OPTION, "