diff --git a/.gitignore b/.gitignore index d289cd33..5cb9b353 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,9 @@ -/idea-flex.skeleton +idea-flex.skeleton target/ .idea/ idea/ *~ +JFlex*.jar +out/ +project/project/ +jflex-1.7.0-SNAPSHOT.jar diff --git a/JFlex.jar b/JFlex.jar deleted file mode 100644 index e83294a7..00000000 Binary files a/JFlex.jar and /dev/null differ diff --git a/build.sbt b/build.sbt index 40641c33..a419580a 100644 --- a/build.sbt +++ b/build.sbt @@ -1,9 +1,10 @@ lazy val commonSettings = Seq( - version := "0.91", + version := "1.0.0-beta", scalaVersion := "2.11.8" ) -val scalaTest = "org.scalatest" % "scalatest_2.11" % "2.2.6" % "test" +val guava = "com.google.guava" % "guava" % "19.0" +val scalaTest = "org.scalatest" % "scalatest_2.11" % "3.0.0" % "test" val sprayJson = "io.spray" %% "spray-json" % "1.3.2" lazy val intellijHaskell = (project in file(".")). @@ -11,12 +12,13 @@ lazy val intellijHaskell = (project in file(".")). settings(commonSettings: _*). settings( name := "IntelliJ Haskell", - javacOptions in Global ++= Seq("-source", "1.6", "-target", "1.6"), - scalacOptions in Global += "-target:jvm-1.6", + javacOptions in Global ++= Seq("-source", "1.8", "-target", "1.8"), + scalacOptions in Global += "-target:jvm-1.8", + libraryDependencies += guava, libraryDependencies += scalaTest, libraryDependencies += sprayJson, unmanagedSourceDirectories in Compile += baseDirectory.value / "gen", unmanagedJars in Compile += baseDirectory.value / "idea" ) -ideaBuild in ThisBuild := "145.597.3" +ideaBuild in ThisBuild := "162.1447.26" \ No newline at end of file diff --git a/gen/intellij/haskell/parser/HaskellParser.java b/gen/intellij/haskell/parser/HaskellParser.java index 3507bd3a..29a87e81 100644 --- a/gen/intellij/haskell/parser/HaskellParser.java +++ b/gen/intellij/haskell/parser/HaskellParser.java @@ -1,15 +1,15 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.parser; +import com.intellij.lang.ASTNode; +import com.intellij.lang.LightPsiParser; import com.intellij.lang.PsiBuilder; import com.intellij.lang.PsiBuilder.Marker; -import static intellij.haskell.psi.HaskellTypes.*; -import static intellij.haskell.psi.HaskellParserUtil.*; -import com.intellij.psi.tree.IElementType; -import com.intellij.lang.ASTNode; -import com.intellij.psi.tree.TokenSet; import com.intellij.lang.PsiParser; -import com.intellij.lang.LightPsiParser; +import com.intellij.psi.tree.IElementType; + +import static intellij.haskell.psi.HaskellParserUtil.*; +import static intellij.haskell.psi.HaskellTypes.*; @SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"}) public class HaskellParser implements PsiParser, LightPsiParser { @@ -44,11 +44,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_COMMENTS) { r = comments(b, 0); } - else if (t == HS_CON_ID) { - r = con_id(b, 0); + else if (t == HS_CON) { + r = con(b, 0); } - else if (t == HS_CON_SYM) { - r = con_sym(b, 0); + else if (t == HS_CONID) { + r = conid(b, 0); + } + else if (t == HS_CONOP) { + r = conop(b, 0); } else if (t == HS_CONSTANT_FOLDED_PRAGMA) { r = constant_folded_pragma(b, 0); @@ -65,6 +68,9 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_CONSTR_4) { r = constr4(b, 0); } + else if (t == HS_CONSYM) { + r = consym(b, 0); + } else if (t == HS_CONTEXT) { r = context(b, 0); } @@ -110,21 +116,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_FILE_HEADER_PRAGMA) { r = file_header_pragma(b, 0); } - else if (t == HS_FIRST_LINE_EXPRESSION) { - r = first_line_expression(b, 0); - } - else if (t == HS_FIXITY) { - r = fixity(b, 0); - } else if (t == HS_FIXITY_DECLARATION) { r = fixity_declaration(b, 0); } else if (t == HS_FOREIGN_DECLARATION) { r = foreign_declaration(b, 0); } - else if (t == HS_GCON_SYM) { - r = gcon_sym(b, 0); - } else if (t == HS_GENERAL_PRAGMA_CONTENT) { r = general_pragma_content(b, 0); } @@ -140,6 +137,9 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_IMPORT_DECLARATION) { r = import_declaration(b, 0); } + else if (t == HS_IMPORT_DECLARATIONS) { + r = import_declarations(b, 0); + } else if (t == HS_IMPORT_EMPTY_SPEC) { r = import_empty_spec(b, 0); } @@ -155,8 +155,8 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_IMPORT_IDS_SPEC) { r = import_ids_spec(b, 0); } - else if (t == HS_IMPORT_MODULE) { - r = import_module(b, 0); + else if (t == HS_IMPORT_PACKAGE_NAME) { + r = import_package_name(b, 0); } else if (t == HS_IMPORT_QUALIFIED) { r = import_qualified(b, 0); @@ -191,26 +191,17 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_LANGUAGE_PRAGMA) { r = language_pragma(b, 0); } - else if (t == HS_LAST_LINE_EXPRESSION) { - r = last_line_expression(b, 0); - } - else if (t == HS_LINE_EXPRESSION) { - r = line_expression(b, 0); - } else if (t == HS_LINE_PRAGMA) { r = line_pragma(b, 0); } else if (t == HS_LIST_TYPE) { r = list_type(b, 0); } - else if (t == HS_LITERAL) { - r = literal(b, 0); - } else if (t == HS_MINIMAL_PRAGMA) { r = minimal_pragma(b, 0); } - else if (t == HS_MOD_ID) { - r = mod_id(b, 0); + else if (t == HS_MODID) { + r = modid(b, 0); } else if (t == HS_MODULE_BODY) { r = module_body(b, 0); @@ -233,11 +224,8 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_NOUNPACK_PRAGMA) { r = nounpack_pragma(b, 0); } - else if (t == HS_OP) { - r = op(b, 0); - } - else if (t == HS_OPS) { - r = ops(b, 0); + else if (t == HS_OPTIONS_GHC_OPTION) { + r = options_ghc_option(b, 0); } else if (t == HS_OPTIONS_GHC_PRAGMA) { r = options_ghc_pragma(b, 0); @@ -248,20 +236,32 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_OVERLAP_PRAGMA) { r = overlap_pragma(b, 0); } - else if (t == HS_QCON) { - r = qcon(b, 0); + else if (t == HS_Q_CON) { + r = q_con(b, 0); } - else if (t == HS_QCON_ID) { - r = qcon_id(b, 0); + else if (t == HS_Q_CON_QUALIFIER) { + r = q_con_qualifier(b, 0); } - else if (t == HS_QCON_ID_QUALIFIER) { - r = qcon_id_qualifier(b, 0); + else if (t == HS_Q_CON_QUALIFIER_1) { + r = q_con_qualifier1(b, 0); } - else if (t == HS_QCON_OP) { - r = qcon_op(b, 0); + else if (t == HS_Q_CON_QUALIFIER_2) { + r = q_con_qualifier2(b, 0); } - else if (t == HS_QCON_SYM) { - r = qcon_sym(b, 0); + else if (t == HS_Q_CON_QUALIFIER_3) { + r = q_con_qualifier3(b, 0); + } + else if (t == HS_Q_CON_QUALIFIER_4) { + r = q_con_qualifier4(b, 0); + } + else if (t == HS_Q_NAME) { + r = q_name(b, 0); + } + else if (t == HS_Q_NAMES) { + r = q_names(b, 0); + } + else if (t == HS_Q_VAR_CON) { + r = q_var_con(b, 0); } else if (t == HS_QQ_EXPRESSION) { r = qq_expression(b, 0); @@ -272,36 +272,21 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_QUASI_QUOTE) { r = quasi_quote(b, 0); } - else if (t == HS_QVAR) { - r = qvar(b, 0); - } - else if (t == HS_QVAR_ID) { - r = qvar_id(b, 0); - } - else if (t == HS_QVAR_OP) { - r = qvar_op(b, 0); - } - else if (t == HS_QVAR_SYM) { - r = qvar_sym(b, 0); - } else if (t == HS_RULES_PRAGMA) { r = rules_pragma(b, 0); } + else if (t == HS_SCC_PRAGMA) { + r = scc_pragma(b, 0); + } else if (t == HS_SCONTEXT) { r = scontext(b, 0); } else if (t == HS_SIMPLECLASS) { r = simpleclass(b, 0); } - else if (t == HS_SIMPLECLASS_TILDE_PART) { - r = simpleclass_tilde_part(b, 0); - } else if (t == HS_SIMPLETYPE) { r = simpletype(b, 0); } - else if (t == HS_SNL) { - r = snl(b, 0); - } else if (t == HS_SOURCE_PRAGMA) { r = source_pragma(b, 0); } @@ -326,12 +311,6 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_TYPE_FAMILY_TYPE) { r = type_family_type(b, 0); } - else if (t == HS_TYPE_FAMILY_TYPE_1) { - r = type_family_type1(b, 0); - } - else if (t == HS_TYPE_FAMILY_TYPE_2) { - r = type_family_type2(b, 0); - } else if (t == HS_TYPE_INSTANCE_DECLARATION) { r = type_instance_declaration(b, 0); } @@ -344,14 +323,20 @@ public class HaskellParser implements PsiParser, LightPsiParser { else if (t == HS_UNPACK_PRAGMA) { r = unpack_pragma(b, 0); } - else if (t == HS_VAR_ID) { - r = var_id(b, 0); + else if (t == HS_VAR) { + r = var(b, 0); } - else if (t == HS_VAR_SYM) { - r = var_sym(b, 0); + else if (t == HS_VAR_CON) { + r = var_con(b, 0); } - else if (t == HS_VARS) { - r = vars(b, 0); + else if (t == HS_VARID) { + r = varid(b, 0); + } + else if (t == HS_VAROP) { + r = varop(b, 0); + } + else if (t == HS_VARSYM) { + r = varsym(b, 0); } else { r = parse_root_(t, b, 0); @@ -380,12 +365,11 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // "forall" (qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT | // forall - // LEFT_PAREN qvar TILDE qvar RIGHT_PAREN (DOUBLE_RIGHT_ARROW ttype)? | - // LEFT_PAREN osnl var_sym? osnl ttype (osnl COMMA osnl ttype)+ osnl var_sym? osnl RIGHT_PAREN | // var_sym? is optional # - // QUOTE? LEFT_BRACKET osnl ttype osnl RIGHT_BRACKET | - // LEFT_PAREN osnl ttype+ osnl RIGHT_PAREN | - // gtycon | qvar + // "forall" (q_name | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT | + // LEFT_PAREN onls ttype+ onls RIGHT_PAREN | + // LEFT_PAREN onls ttype (onls COMMA onls ttype)+ onls q_name? onls RIGHT_PAREN | // q_name? is optional # + // QUOTE? LEFT_BRACKET onls ttype? onls RIGHT_BRACKET | + // q_name | LEFT_PAREN type_signature? RIGHT_PAREN static boolean atype(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "atype")) return false; boolean r; @@ -394,14 +378,13 @@ public class HaskellParser implements PsiParser, LightPsiParser { if (!r) r = atype_1(b, l + 1); if (!r) r = atype_2(b, l + 1); if (!r) r = atype_3(b, l + 1); - if (!r) r = atype_4(b, l + 1); - if (!r) r = gtycon(b, l + 1); - if (!r) r = qvar(b, l + 1); + if (!r) r = q_name(b, l + 1); + if (!r) r = atype_5(b, l + 1); exit_section_(b, m, null, r); return r; } - // "forall" (qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT + // "forall" (q_name | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT private static boolean atype_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "atype_0")) return false; boolean r; @@ -413,7 +396,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ + // (q_name | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ private static boolean atype_0_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "atype_0_1")) return false; boolean r; @@ -429,12 +412,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN + // q_name | ttype | LEFT_PAREN type_signature RIGHT_PAREN private static boolean atype_0_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "atype_0_1_0")) return false; boolean r; Marker m = enter_section_(b); - r = qvar(b, l + 1); + r = q_name(b, l + 1); if (!r) r = ttype(b, l + 1); if (!r) r = atype_0_1_0_2(b, l + 1); exit_section_(b, m, null, r); @@ -453,111 +436,99 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // LEFT_PAREN qvar TILDE qvar RIGHT_PAREN (DOUBLE_RIGHT_ARROW ttype)? + // LEFT_PAREN onls ttype+ onls RIGHT_PAREN private static boolean atype_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "atype_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_TILDE); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - r = r && atype_1_5(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (DOUBLE_RIGHT_ARROW ttype)? - private static boolean atype_1_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_1_5")) return false; - atype_1_5_0(b, l + 1); - return true; - } - - // DOUBLE_RIGHT_ARROW ttype - private static boolean atype_1_5_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_1_5_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN osnl var_sym? osnl ttype (osnl COMMA osnl ttype)+ osnl var_sym? osnl RIGHT_PAREN - private static boolean atype_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && atype_2_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - r = r && atype_2_5(b, l + 1); - r = r && osnl(b, l + 1); - r = r && atype_2_7(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && atype_1_2(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // var_sym? - private static boolean atype_2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2_2")) return false; - var_sym(b, l + 1); - return true; - } - - // (osnl COMMA osnl ttype)+ - private static boolean atype_2_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2_5")) return false; + // ttype+ + private static boolean atype_1_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_1_2")) return false; boolean r; Marker m = enter_section_(b); - r = atype_2_5_0(b, l + 1); + r = ttype(b, l + 1); int c = current_position_(b); while (r) { - if (!atype_2_5_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "atype_2_5", c)) break; + if (!ttype(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "atype_1_2", c)) break; c = current_position_(b); } exit_section_(b, m, null, r); return r; } - // osnl COMMA osnl ttype - private static boolean atype_2_5_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2_5_0")) return false; + // LEFT_PAREN onls ttype (onls COMMA onls ttype)+ onls q_name? onls RIGHT_PAREN + private static boolean atype_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_2")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = consumeToken(b, HS_LEFT_PAREN); + r = r && onls(b, l + 1); + r = r && ttype(b, l + 1); + r = r && atype_2_3(b, l + 1); + r = r && onls(b, l + 1); + r = r && atype_2_5(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_RIGHT_PAREN); + exit_section_(b, m, null, r); + return r; + } + + // (onls COMMA onls ttype)+ + private static boolean atype_2_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_2_3")) return false; + boolean r; + Marker m = enter_section_(b); + r = atype_2_3_0(b, l + 1); + int c = current_position_(b); + while (r) { + if (!atype_2_3_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "atype_2_3", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // onls COMMA onls ttype + private static boolean atype_2_3_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_2_3_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } - // var_sym? - private static boolean atype_2_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2_7")) return false; - var_sym(b, l + 1); + // q_name? + private static boolean atype_2_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_2_5")) return false; + q_name(b, l + 1); return true; } - // QUOTE? LEFT_BRACKET osnl ttype osnl RIGHT_BRACKET + // QUOTE? LEFT_BRACKET onls ttype? onls RIGHT_BRACKET private static boolean atype_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "atype_3")) return false; boolean r; Marker m = enter_section_(b); r = atype_3_0(b, l + 1); r = r && consumeToken(b, HS_LEFT_BRACKET); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && atype_3_3(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_BRACKET); exit_section_(b, m, null, r); return r; @@ -570,48 +541,57 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // LEFT_PAREN osnl ttype+ osnl RIGHT_PAREN - private static boolean atype_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_4")) return false; + // ttype? + private static boolean atype_3_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_3_3")) return false; + ttype(b, l + 1); + return true; + } + + // LEFT_PAREN type_signature? RIGHT_PAREN + private static boolean atype_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_5")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && atype_4_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && atype_5_1(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // ttype+ - private static boolean atype_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_4_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = ttype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!ttype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "atype_4_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; + // type_signature? + private static boolean atype_5_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "atype_5_1")) return false; + type_signature(b, l + 1); + return true; } /* ********************************************************** */ - // import_declarations top_declarations + // import_declarations top_declarations NEWLINE* static boolean body(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "body")) return false; boolean r; Marker m = enter_section_(b); r = import_declarations(b, l + 1); r = r && top_declarations(b, l + 1); + r = r && body_2(b, l + 1); exit_section_(b, m, null, r); return r; } + // NEWLINE* + private static boolean body_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "body_2")) return false; + int c = current_position_(b); + while (true) { + if (!consumeToken(b, HS_NEWLINE)) break; + if (!empty_element_parsed_guard_(b, "body_2", c)) break; + c = current_position_(b); + } + return true; + } + /* ********************************************************** */ // atype+ static boolean btype(PsiBuilder b, int l) { @@ -643,7 +623,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // (cdecl | expression) (osnl (cdecl | expression))* + // (cdecl | expression) (onls (cdecl | expression))* static boolean cdecls(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "cdecls")) return false; boolean r; @@ -665,7 +645,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (osnl (cdecl | expression))* + // (onls (cdecl | expression))* private static boolean cdecls_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "cdecls_1")) return false; int c = current_position_(b); @@ -677,12 +657,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // osnl (cdecl | expression) + // onls (cdecl | expression) private static boolean cdecls_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "cdecls_1_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && cdecls_1_0_1(b, l + 1); exit_section_(b, m, null, r); return r; @@ -735,10 +715,9 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // CLASS osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl - // (qvar | LEFT_PAREN type_signature RIGHT_PAREN)* - // (osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)*)? osnl WHERE? osnl cdecls? | - // CLASS osnl context osnl DOUBLE_RIGHT_ARROW osnl qcon osnl qvar osnl WHERE? osnl cdecls? + // CLASS onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name+ onls (q_name | LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN)* + // (onls VERTICAL_BAR onls ttype (onls COMMA onls ttype)*)? onls WHERE? onls cdecls? | + // CLASS onls scontext onls DOUBLE_RIGHT_ARROW onls q_name+ onls WHERE? onls cdecls? public static boolean class_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration")) return false; if (!nextTokenIs(b, HS_CLASS)) return false; @@ -750,49 +729,64 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // CLASS osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl - // (qvar | LEFT_PAREN type_signature RIGHT_PAREN)* - // (osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)*)? osnl WHERE? osnl cdecls? + // CLASS onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name+ onls (q_name | LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN)* + // (onls VERTICAL_BAR onls ttype (onls COMMA onls ttype)*)? onls WHERE? onls cdecls? private static boolean class_declaration_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_CLASS); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && class_declaration_0_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && class_declaration_0_4(b, l + 1); + r = r && onls(b, l + 1); r = r && class_declaration_0_6(b, l + 1); r = r && class_declaration_0_7(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && class_declaration_0_9(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && class_declaration_0_11(b, l + 1); exit_section_(b, m, null, r); return r; } - // (scontext osnl DOUBLE_RIGHT_ARROW)? + // (scontext onls DOUBLE_RIGHT_ARROW)? private static boolean class_declaration_0_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_2")) return false; class_declaration_0_2_0(b, l + 1); return true; } - // scontext osnl DOUBLE_RIGHT_ARROW + // scontext onls DOUBLE_RIGHT_ARROW private static boolean class_declaration_0_2_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_2_0")) return false; boolean r; Marker m = enter_section_(b); r = scontext(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } - // (qvar | LEFT_PAREN type_signature RIGHT_PAREN)* + // q_name+ + private static boolean class_declaration_0_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_0_4")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "class_declaration_0_4", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // (q_name | LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN)* private static boolean class_declaration_0_6(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_6")) return false; int c = current_position_(b); @@ -804,51 +798,77 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // qvar | LEFT_PAREN type_signature RIGHT_PAREN + // q_name | LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN private static boolean class_declaration_0_6_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_6_0")) return false; boolean r; Marker m = enter_section_(b); - r = qvar(b, l + 1); + r = q_name(b, l + 1); if (!r) r = class_declaration_0_6_0_1(b, l + 1); exit_section_(b, m, null, r); return r; } - // LEFT_PAREN type_signature RIGHT_PAREN + // LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN private static boolean class_declaration_0_6_0_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_6_0_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && type_signature(b, l + 1); + r = r && ttype(b, l + 1); + r = r && class_declaration_0_6_0_1_2(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // (osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)*)? + // (onls COMMA onls ttype)* + private static boolean class_declaration_0_6_0_1_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_0_6_0_1_2")) return false; + int c = current_position_(b); + while (true) { + if (!class_declaration_0_6_0_1_2_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "class_declaration_0_6_0_1_2", c)) break; + c = current_position_(b); + } + return true; + } + + // onls COMMA onls ttype + private static boolean class_declaration_0_6_0_1_2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_0_6_0_1_2_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = onls(b, l + 1); + r = r && consumeToken(b, HS_COMMA); + r = r && onls(b, l + 1); + r = r && ttype(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // (onls VERTICAL_BAR onls ttype (onls COMMA onls ttype)*)? private static boolean class_declaration_0_7(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_7")) return false; class_declaration_0_7_0(b, l + 1); return true; } - // osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)* + // onls VERTICAL_BAR onls ttype (onls COMMA onls ttype)* private static boolean class_declaration_0_7_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_7_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_VERTICAL_BAR); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); r = r && class_declaration_0_7_0_4(b, l + 1); exit_section_(b, m, null, r); return r; } - // (osnl COMMA osnl ttype)* + // (onls COMMA onls ttype)* private static boolean class_declaration_0_7_0_4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_7_0_4")) return false; int c = current_position_(b); @@ -860,14 +880,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // osnl COMMA osnl ttype + // onls COMMA onls ttype private static boolean class_declaration_0_7_0_4_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_0_7_0_4_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; @@ -887,46 +907,61 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // CLASS osnl context osnl DOUBLE_RIGHT_ARROW osnl qcon osnl qvar osnl WHERE? osnl cdecls? + // CLASS onls scontext onls DOUBLE_RIGHT_ARROW onls q_name+ onls WHERE? onls cdecls? private static boolean class_declaration_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "class_declaration_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_CLASS); - r = r && osnl(b, l + 1); - r = r && context(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && scontext(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qvar(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && class_declaration_1_6(b, l + 1); + r = r && onls(b, l + 1); + r = r && class_declaration_1_8(b, l + 1); + r = r && onls(b, l + 1); r = r && class_declaration_1_10(b, l + 1); - r = r && osnl(b, l + 1); - r = r && class_declaration_1_12(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // q_name+ + private static boolean class_declaration_1_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_1_6")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "class_declaration_1_6", c)) break; + c = current_position_(b); + } exit_section_(b, m, null, r); return r; } // WHERE? - private static boolean class_declaration_1_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_1_10")) return false; + private static boolean class_declaration_1_8(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_1_8")) return false; consumeToken(b, HS_WHERE); return true; } // cdecls? - private static boolean class_declaration_1_12(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_1_12")) return false; + private static boolean class_declaration_1_10(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "class_declaration_1_10")) return false; cdecls(b, l + 1); return true; } /* ********************************************************** */ - // qcon qvar+ | - // qcon LEFT_PAREN qvar atype+ RIGHT_PAREN | - // qcon LEFT_PAREN qcon qvar RIGHT_PAREN + // q_name COLON_COLON q_name | + // q_name+ | + // q_name LEFT_PAREN q_name atype+ RIGHT_PAREN | + // q_name LEFT_PAREN q_name+ RIGHT_PAREN q_name* public static boolean clazz(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "clazz")) return false; boolean r; @@ -934,91 +969,121 @@ public class HaskellParser implements PsiParser, LightPsiParser { r = clazz_0(b, l + 1); if (!r) r = clazz_1(b, l + 1); if (!r) r = clazz_2(b, l + 1); + if (!r) r = clazz_3(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // qcon qvar+ + // q_name COLON_COLON q_name private static boolean clazz_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "clazz_0")) return false; boolean r; Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && clazz_0_1(b, l + 1); + r = q_name(b, l + 1); + r = r && consumeToken(b, HS_COLON_COLON); + r = r && q_name(b, l + 1); exit_section_(b, m, null, r); return r; } - // qvar+ - private static boolean clazz_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_0_1")) return false; + // q_name+ + private static boolean clazz_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "clazz_1")) return false; boolean r; Marker m = enter_section_(b); - r = qvar(b, l + 1); + r = q_name(b, l + 1); int c = current_position_(b); while (r) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "clazz_0_1", c)) break; + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "clazz_1", c)) break; c = current_position_(b); } exit_section_(b, m, null, r); return r; } - // qcon LEFT_PAREN qvar atype+ RIGHT_PAREN - private static boolean clazz_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_1")) return false; + // q_name LEFT_PAREN q_name atype+ RIGHT_PAREN + private static boolean clazz_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "clazz_2")) return false; boolean r; Marker m = enter_section_(b); - r = qcon(b, l + 1); + r = q_name(b, l + 1); r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && qvar(b, l + 1); - r = r && clazz_1_3(b, l + 1); + r = r && q_name(b, l + 1); + r = r && clazz_2_3(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } // atype+ - private static boolean clazz_1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_1_3")) return false; + private static boolean clazz_2_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "clazz_2_3")) return false; boolean r; Marker m = enter_section_(b); r = atype(b, l + 1); int c = current_position_(b); while (r) { if (!atype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "clazz_1_3", c)) break; + if (!empty_element_parsed_guard_(b, "clazz_2_3", c)) break; c = current_position_(b); } exit_section_(b, m, null, r); return r; } - // qcon LEFT_PAREN qcon qvar RIGHT_PAREN - private static boolean clazz_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_2")) return false; + // q_name LEFT_PAREN q_name+ RIGHT_PAREN q_name* + private static boolean clazz_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "clazz_3")) return false; boolean r; Marker m = enter_section_(b); - r = qcon(b, l + 1); + r = q_name(b, l + 1); r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && qcon(b, l + 1); - r = r && qvar(b, l + 1); + r = r && clazz_3_2(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); + r = r && clazz_3_4(b, l + 1); exit_section_(b, m, null, r); return r; } + // q_name+ + private static boolean clazz_3_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "clazz_3_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "clazz_3_2", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // q_name* + private static boolean clazz_3_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "clazz_3_4")) return false; + int c = current_position_(b); + while (true) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "clazz_3_4", c)) break; + c = current_position_(b); + } + return true; + } + /* ********************************************************** */ - // qvar | qcon | qcon_op | qvar_op + // var | con | conop | varop public static boolean cname(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "cname")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_CNAME, ""); - r = qvar(b, l + 1); - if (!r) r = qcon(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - if (!r) r = qvar_op(b, l + 1); + r = var(b, l + 1); + if (!r) r = con(b, l + 1); + if (!r) r = conop(b, l + 1); + if (!r) r = varop(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } @@ -1038,70 +1103,64 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // CONID_ID | LEFT_BRACKET var_id? RIGHT_BRACKET | LEFT_PAREN COMMA* RIGHT_PAREN - public static boolean con_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id")) return false; + // conid | LEFT_PAREN consym RIGHT_PAREN + public static boolean con(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "con")) return false; + if (!nextTokenIs(b, "", HS_CON_ID, HS_LEFT_PAREN)) return false; boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CON_ID, ""); - r = consumeToken(b, HS_CONID_ID); - if (!r) r = con_id_1(b, l + 1); - if (!r) r = con_id_2(b, l + 1); + Marker m = enter_section_(b, l, _NONE_, HS_CON, ""); + r = conid(b, l + 1); + if (!r) r = con_1(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // LEFT_BRACKET var_id? RIGHT_BRACKET - private static boolean con_id_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_BRACKET); - r = r && con_id_1_1(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_BRACKET); - exit_section_(b, m, null, r); - return r; - } - - // var_id? - private static boolean con_id_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_1_1")) return false; - var_id(b, l + 1); - return true; - } - - // LEFT_PAREN COMMA* RIGHT_PAREN - private static boolean con_id_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_2")) return false; + // LEFT_PAREN consym RIGHT_PAREN + private static boolean con_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "con_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && con_id_2_1(b, l + 1); + r = r && consym(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // COMMA* - private static boolean con_id_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_2_1")) return false; - int c = current_position_(b); - while (true) { - if (!consumeToken(b, HS_COMMA)) break; - if (!empty_element_parsed_guard_(b, "con_id_2_1", c)) break; - c = current_position_(b); - } - return true; + /* ********************************************************** */ + // CON_ID + public static boolean conid(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "conid")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_CON_ID); + exit_section_(b, m, HS_CONID, r); + return r; } /* ********************************************************** */ - // CONSYM_ID - public static boolean con_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_sym")) return false; - if (!nextTokenIs(b, HS_CONSYM_ID)) return false; + // consym | BACKQUOTE conid BACKQUOTE + public static boolean conop(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "conop")) return false; + if (!nextTokenIs(b, "", HS_BACKQUOTE, HS_CONSYM_ID)) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, HS_CONOP, ""); + r = consym(b, l + 1); + if (!r) r = conop_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // BACKQUOTE conid BACKQUOTE + private static boolean conop_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "conop_1")) return false; boolean r; Marker m = enter_section_(b); - r = consumeToken(b, HS_CONSYM_ID); - exit_section_(b, m, HS_CON_SYM, r); + r = consumeToken(b, HS_BACKQUOTE); + r = r && conid(b, l + 1); + r = r && consumeToken(b, HS_BACKQUOTE); + exit_section_(b, m, null, r); return r; } @@ -1138,13 +1197,13 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // unpack_nounpack_pragma? qcon onl unpack_nounpack_pragma? onl LEFT_BRACE onl (onl fielddecl (onl COMMA? onl fielddecl)*)? onl RIGHT_BRACE + // unpack_nounpack_pragma? q_name onl unpack_nounpack_pragma? onl LEFT_BRACE onl (onl fielddecl (onl COMMA? onl fielddecl)*)? onl RIGHT_BRACE public static boolean constr1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constr1")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_1, ""); r = constr1_0(b, l + 1); - r = r && qcon(b, l + 1); + r = r && q_name(b, l + 1); r = r && onl(b, l + 1); r = r && constr1_3(b, l + 1); r = r && onl(b, l + 1); @@ -1223,18 +1282,15 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // unpack_nounpack_pragma? sub_constr2 osnl unpack_nounpack_pragma? qcon_op osnl sub_constr2 + // unpack_nounpack_pragma? q_name onls (unpack_nounpack_pragma? onls atype onls)* public static boolean constr2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constr2")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_2, ""); r = constr2_0(b, l + 1); - r = r && sub_constr2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && q_name(b, l + 1); + r = r && onls(b, l + 1); r = r && constr2_3(b, l + 1); - r = r && qcon_op(b, l + 1); - r = r && osnl(b, l + 1); - r = r && sub_constr2(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } @@ -1246,23 +1302,53 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // unpack_nounpack_pragma? + // (unpack_nounpack_pragma? onls atype onls)* private static boolean constr2_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constr2_3")) return false; + int c = current_position_(b); + while (true) { + if (!constr2_3_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "constr2_3", c)) break; + c = current_position_(b); + } + return true; + } + + // unpack_nounpack_pragma? onls atype onls + private static boolean constr2_3_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constr2_3_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = constr2_3_0_0(b, l + 1); + r = r && onls(b, l + 1); + r = r && atype(b, l + 1); + r = r && onls(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // unpack_nounpack_pragma? + private static boolean constr2_3_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constr2_3_0_0")) return false; unpack_nounpack_pragma(b, l + 1); return true; } /* ********************************************************** */ - // unpack_nounpack_pragma? qcon osnl (unpack_nounpack_pragma? qvar_op? osnl atype osnl)* + // unpack_nounpack_pragma? sub_constr2 onls unpack_nounpack_pragma? q_name onls unpack_nounpack_pragma? onls sub_constr2 public static boolean constr3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constr3")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_3, ""); r = constr3_0(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); + r = r && sub_constr2(b, l + 1); + r = r && onls(b, l + 1); r = r && constr3_3(b, l + 1); + r = r && q_name(b, l + 1); + r = r && onls(b, l + 1); + r = r && constr3_6(b, l + 1); + r = r && onls(b, l + 1); + r = r && sub_constr2(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } @@ -1274,57 +1360,30 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // (unpack_nounpack_pragma? qvar_op? osnl atype osnl)* + // unpack_nounpack_pragma? private static boolean constr3_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constr3_3")) return false; - int c = current_position_(b); - while (true) { - if (!constr3_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "constr3_3", c)) break; - c = current_position_(b); - } - return true; - } - - // unpack_nounpack_pragma? qvar_op? osnl atype osnl - private static boolean constr3_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = constr3_3_0_0(b, l + 1); - r = r && constr3_3_0_1(b, l + 1); - r = r && osnl(b, l + 1); - r = r && atype(b, l + 1); - r = r && osnl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // unpack_nounpack_pragma? - private static boolean constr3_3_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_3_0_0")) return false; unpack_nounpack_pragma(b, l + 1); return true; } - // qvar_op? - private static boolean constr3_3_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_3_0_1")) return false; - qvar_op(b, l + 1); + // unpack_nounpack_pragma? + private static boolean constr3_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constr3_6")) return false; + unpack_nounpack_pragma(b, l + 1); return true; } /* ********************************************************** */ - // unpack_nounpack_pragma? qvar gcon_sym unpack_nounpack_pragma? qcon + // unpack_nounpack_pragma? q_name+ unpack_nounpack_pragma? q_name public static boolean constr4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constr4")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_4, ""); r = constr4_0(b, l + 1); - r = r && qvar(b, l + 1); - r = r && gcon_sym(b, l + 1); - r = r && constr4_3(b, l + 1); - r = r && qcon(b, l + 1); + r = r && constr4_1(b, l + 1); + r = r && constr4_2(b, l + 1); + r = r && q_name(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } @@ -1336,15 +1395,31 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } + // q_name+ + private static boolean constr4_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constr4_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "constr4_1", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + // unpack_nounpack_pragma? - private static boolean constr4_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr4_3")) return false; + private static boolean constr4_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "constr4_2")) return false; unpack_nounpack_pragma(b, l + 1); return true; } /* ********************************************************** */ - // constr (osnl VERTICAL_BAR osnl constr)* + // constr (onls VERTICAL_BAR onls constr)* static boolean constrs(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constrs")) return false; boolean r; @@ -1355,7 +1430,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (osnl VERTICAL_BAR osnl constr)* + // (onls VERTICAL_BAR onls constr)* private static boolean constrs_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constrs_1")) return false; int c = current_position_(b); @@ -1367,21 +1442,33 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // osnl VERTICAL_BAR osnl constr + // onls VERTICAL_BAR onls constr private static boolean constrs_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "constrs_1_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_VERTICAL_BAR); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && constr(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // LEFT_PAREN osnl (clazz (osnl COMMA osnl clazz)*)? osnl RIGHT_PAREN | + // CONSYM_ID + public static boolean consym(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "consym")) return false; + if (!nextTokenIs(b, HS_CONSYM_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_CONSYM_ID); + exit_section_(b, m, HS_CONSYM, r); + return r; + } + + /* ********************************************************** */ + // LEFT_PAREN onls clazz (onls COMMA onls clazz)* onls RIGHT_PAREN | // clazz public static boolean context(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "context")) return false; @@ -1393,58 +1480,41 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // LEFT_PAREN osnl (clazz (osnl COMMA osnl clazz)*)? osnl RIGHT_PAREN + // LEFT_PAREN onls clazz (onls COMMA onls clazz)* onls RIGHT_PAREN private static boolean context_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "context_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && context_0_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && clazz(b, l + 1); + r = r && context_0_3(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // (clazz (osnl COMMA osnl clazz)*)? - private static boolean context_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2")) return false; - context_0_2_0(b, l + 1); - return true; - } - - // clazz (osnl COMMA osnl clazz)* - private static boolean context_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = clazz(b, l + 1); - r = r && context_0_2_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl COMMA osnl clazz)* - private static boolean context_0_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2_0_1")) return false; + // (onls COMMA onls clazz)* + private static boolean context_0_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "context_0_3")) return false; int c = current_position_(b); while (true) { - if (!context_0_2_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "context_0_2_0_1", c)) break; + if (!context_0_3_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "context_0_3", c)) break; c = current_position_(b); } return true; } - // osnl COMMA osnl clazz - private static boolean context_0_2_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2_0_1_0")) return false; + // onls COMMA onls clazz + private static boolean context_0_3_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "context_0_3_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && clazz(b, l + 1); exit_section_(b, m, null, r); return r; @@ -1469,11 +1539,10 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // DATA osnl simpletype osnl (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ osnl qvar* osnl data_declaration_deriving? | - // DATA osnl (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ osnl simpletype osnl qvar* osnl data_declaration_deriving? | - // DATA osnl ctype_pragma? osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl constrs osnl data_declaration_deriving? | - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl WHERE osnl cdecls osnl data_declaration_deriving? | - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype+ osnl (EQUAL osnl expression | EQUAL osnl simpletype+)? osnl data_declaration_deriving? + // DATA onls ctype_pragma? onls INSTANCE? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls q_name* onls EQUAL + // onls (scontext onls DOUBLE_RIGHT_ARROW)? onls constrs onls data_declaration_deriving? | + // DATA onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls q_name* onls data_declaration_deriving? | + // DATA onls INSTANCE? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls q_name* onls (WHERE | EQUAL) onls cdecls onls data_declaration_deriving? public static boolean data_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration")) return false; if (!nextTokenIs(b, HS_DATA)) return false; @@ -1482,203 +1551,302 @@ public class HaskellParser implements PsiParser, LightPsiParser { r = data_declaration_0(b, l + 1); if (!r) r = data_declaration_1(b, l + 1); if (!r) r = data_declaration_2(b, l + 1); - if (!r) r = data_declaration_3(b, l + 1); - if (!r) r = data_declaration_4(b, l + 1); exit_section_(b, m, HS_DATA_DECLARATION, r); return r; } - // DATA osnl simpletype osnl (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ osnl qvar* osnl data_declaration_deriving? + // DATA onls ctype_pragma? onls INSTANCE? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls q_name* onls EQUAL + // onls (scontext onls DOUBLE_RIGHT_ARROW)? onls constrs onls data_declaration_deriving? private static boolean data_declaration_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && data_declaration_0_2(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_0_4(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_0_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_0_8(b, l + 1); + r = r && onls(b, l + 1); + r = r && simpletype(b, l + 1); + r = r && onls(b, l + 1); + r = r && data_declaration_0_10(b, l + 1); + r = r && onls(b, l + 1); + r = r && data_declaration_0_12(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_EQUAL); + r = r && onls(b, l + 1); + r = r && data_declaration_0_16(b, l + 1); + r = r && onls(b, l + 1); + r = r && constrs(b, l + 1); + r = r && onls(b, l + 1); + r = r && data_declaration_0_20(b, l + 1); exit_section_(b, m, null, r); return r; } - // (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ + // ctype_pragma? + private static boolean data_declaration_0_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_2")) return false; + ctype_pragma(b, l + 1); + return true; + } + + // INSTANCE? private static boolean data_declaration_0_4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_0_4")) return false; + consumeToken(b, HS_INSTANCE); + return true; + } + + // (context onls DOUBLE_RIGHT_ARROW)? + private static boolean data_declaration_0_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_6")) return false; + data_declaration_0_6_0(b, l + 1); + return true; + } + + // context onls DOUBLE_RIGHT_ARROW + private static boolean data_declaration_0_6_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_6_0")) return false; boolean r; Marker m = enter_section_(b); - r = data_declaration_0_4_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!data_declaration_0_4_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_0_4", c)) break; - c = current_position_(b); - } + r = context(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } - // LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN - private static boolean data_declaration_0_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_0_4_0")) return false; + // (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* + private static boolean data_declaration_0_10(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_10")) return false; + int c = current_position_(b); + while (true) { + if (!data_declaration_0_10_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "data_declaration_0_10", c)) break; + c = current_position_(b); + } + return true; + } + + // LEFT_PAREN onls kind_signature onls RIGHT_PAREN + private static boolean data_declaration_0_10_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_10_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && kind_signature(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // qvar* - private static boolean data_declaration_0_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_0_6")) return false; + // q_name* + private static boolean data_declaration_0_12(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_12")) return false; int c = current_position_(b); while (true) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_0_6", c)) break; + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "data_declaration_0_12", c)) break; c = current_position_(b); } return true; } + // (scontext onls DOUBLE_RIGHT_ARROW)? + private static boolean data_declaration_0_16(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_16")) return false; + data_declaration_0_16_0(b, l + 1); + return true; + } + + // scontext onls DOUBLE_RIGHT_ARROW + private static boolean data_declaration_0_16_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_16_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = scontext(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); + exit_section_(b, m, null, r); + return r; + } + // data_declaration_deriving? - private static boolean data_declaration_0_8(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_0_8")) return false; + private static boolean data_declaration_0_20(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_0_20")) return false; data_declaration_deriving(b, l + 1); return true; } - // DATA osnl (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ osnl simpletype osnl qvar* osnl data_declaration_deriving? + // DATA onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls q_name* onls data_declaration_deriving? private static boolean data_declaration_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_1_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_1_6(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_1_8(b, l + 1); + r = r && onls(b, l + 1); + r = r && data_declaration_1_10(b, l + 1); exit_section_(b, m, null, r); return r; } - // (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ + // (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* private static boolean data_declaration_1_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_1_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = data_declaration_1_2_0(b, l + 1); int c = current_position_(b); - while (r) { + while (true) { if (!data_declaration_1_2_0(b, l + 1)) break; if (!empty_element_parsed_guard_(b, "data_declaration_1_2", c)) break; c = current_position_(b); } - exit_section_(b, m, null, r); - return r; + return true; } - // LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN + // LEFT_PAREN onls kind_signature onls RIGHT_PAREN private static boolean data_declaration_1_2_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_1_2_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && kind_signature(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // qvar* + // (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* private static boolean data_declaration_1_6(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_1_6")) return false; int c = current_position_(b); while (true) { - if (!qvar(b, l + 1)) break; + if (!data_declaration_1_6_0(b, l + 1)) break; if (!empty_element_parsed_guard_(b, "data_declaration_1_6", c)) break; c = current_position_(b); } return true; } - // data_declaration_deriving? + // LEFT_PAREN onls kind_signature onls RIGHT_PAREN + private static boolean data_declaration_1_6_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_1_6_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_LEFT_PAREN); + r = r && onls(b, l + 1); + r = r && kind_signature(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_RIGHT_PAREN); + exit_section_(b, m, null, r); + return r; + } + + // q_name* private static boolean data_declaration_1_8(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_1_8")) return false; + int c = current_position_(b); + while (true) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "data_declaration_1_8", c)) break; + c = current_position_(b); + } + return true; + } + + // data_declaration_deriving? + private static boolean data_declaration_1_10(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_1_10")) return false; data_declaration_deriving(b, l + 1); return true; } - // DATA osnl ctype_pragma? osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl constrs osnl data_declaration_deriving? + // DATA onls INSTANCE? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls q_name* onls (WHERE | EQUAL) onls cdecls onls data_declaration_deriving? private static boolean data_declaration_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_2")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_2_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_2_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_2_6(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && constrs(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && data_declaration_2_8(b, l + 1); + r = r && onls(b, l + 1); + r = r && data_declaration_2_10(b, l + 1); + r = r && onls(b, l + 1); + r = r && cdecls(b, l + 1); + r = r && onls(b, l + 1); r = r && data_declaration_2_14(b, l + 1); exit_section_(b, m, null, r); return r; } - // ctype_pragma? + // INSTANCE? private static boolean data_declaration_2_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_2_2")) return false; - ctype_pragma(b, l + 1); - return true; - } - - // INSTANCE? - private static boolean data_declaration_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2_4")) return false; consumeToken(b, HS_INSTANCE); return true; } - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean data_declaration_2_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2_6")) return false; - data_declaration_2_6_0(b, l + 1); + // (context onls DOUBLE_RIGHT_ARROW)? + private static boolean data_declaration_2_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_2_4")) return false; + data_declaration_2_4_0(b, l + 1); return true; } - // context osnl DOUBLE_RIGHT_ARROW - private static boolean data_declaration_2_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2_6_0")) return false; + // context onls DOUBLE_RIGHT_ARROW + private static boolean data_declaration_2_4_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_2_4_0")) return false; boolean r; Marker m = enter_section_(b); r = context(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } + // q_name* + private static boolean data_declaration_2_8(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_2_8")) return false; + int c = current_position_(b); + while (true) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "data_declaration_2_8", c)) break; + c = current_position_(b); + } + return true; + } + + // WHERE | EQUAL + private static boolean data_declaration_2_10(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "data_declaration_2_10")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_WHERE); + if (!r) r = consumeToken(b, HS_EQUAL); + exit_section_(b, m, null, r); + return r; + } + // data_declaration_deriving? private static boolean data_declaration_2_14(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_2_14")) return false; @@ -1686,190 +1854,8 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl WHERE osnl cdecls osnl data_declaration_deriving? - private static boolean data_declaration_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_WHERE); - r = r && osnl(b, l + 1); - r = r && cdecls(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_12(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // INSTANCE? - private static boolean data_declaration_3_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_2")) return false; - consumeToken(b, HS_INSTANCE); - return true; - } - - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean data_declaration_3_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_4")) return false; - data_declaration_3_4_0(b, l + 1); - return true; - } - - // context osnl DOUBLE_RIGHT_ARROW - private static boolean data_declaration_3_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = context(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // data_declaration_deriving? - private static boolean data_declaration_3_12(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_12")) return false; - data_declaration_deriving(b, l + 1); - return true; - } - - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype+ osnl (EQUAL osnl expression | EQUAL osnl simpletype+)? osnl data_declaration_deriving? - private static boolean data_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); - r = r && data_declaration_4_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_4_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_4_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_4_8(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_4_10(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // INSTANCE? - private static boolean data_declaration_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_2")) return false; - consumeToken(b, HS_INSTANCE); - return true; - } - - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean data_declaration_4_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_4")) return false; - data_declaration_4_4_0(b, l + 1); - return true; - } - - // context osnl DOUBLE_RIGHT_ARROW - private static boolean data_declaration_4_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = context(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // simpletype+ - private static boolean data_declaration_4_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_6")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!simpletype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_4_6", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // (EQUAL osnl expression | EQUAL osnl simpletype+)? - private static boolean data_declaration_4_8(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_8")) return false; - data_declaration_4_8_0(b, l + 1); - return true; - } - - // EQUAL osnl expression | EQUAL osnl simpletype+ - private static boolean data_declaration_4_8_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_8_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = data_declaration_4_8_0_0(b, l + 1); - if (!r) r = data_declaration_4_8_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // EQUAL osnl expression - private static boolean data_declaration_4_8_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_8_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // EQUAL osnl simpletype+ - private static boolean data_declaration_4_8_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_8_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && data_declaration_4_8_0_1_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // simpletype+ - private static boolean data_declaration_4_8_0_1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_8_0_1_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!simpletype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_4_8_0_1_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // data_declaration_deriving? - private static boolean data_declaration_4_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_4_10")) return false; - data_declaration_deriving(b, l + 1); - return true; - } - /* ********************************************************** */ - // (DERIVING ttype osnl | DERIVING LEFT_PAREN ttype (osnl COMMA osnl ttype)* RIGHT_PAREN osnl)+ + // (DERIVING ttype onls | DERIVING LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN onls)+ public static boolean data_declaration_deriving(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_deriving")) return false; if (!nextTokenIs(b, HS_DERIVING)) return false; @@ -1886,7 +1872,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // DERIVING ttype osnl | DERIVING LEFT_PAREN ttype (osnl COMMA osnl ttype)* RIGHT_PAREN osnl + // DERIVING ttype onls | DERIVING LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN onls private static boolean data_declaration_deriving_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_deriving_0")) return false; boolean r; @@ -1897,19 +1883,19 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // DERIVING ttype osnl + // DERIVING ttype onls private static boolean data_declaration_deriving_0_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_deriving_0_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_DERIVING); r = r && ttype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); exit_section_(b, m, null, r); return r; } - // DERIVING LEFT_PAREN ttype (osnl COMMA osnl ttype)* RIGHT_PAREN osnl + // DERIVING LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN onls private static boolean data_declaration_deriving_0_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_deriving_0_1")) return false; boolean r; @@ -1918,12 +1904,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { r = r && ttype(b, l + 1); r = r && data_declaration_deriving_0_1_3(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); exit_section_(b, m, null, r); return r; } - // (osnl COMMA osnl ttype)* + // (onls COMMA onls ttype)* private static boolean data_declaration_deriving_0_1_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_deriving_0_1_3")) return false; int c = current_position_(b); @@ -1935,28 +1921,28 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // osnl COMMA osnl ttype + // onls COMMA onls ttype private static boolean data_declaration_deriving_0_1_3_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "data_declaration_deriving_0_1_3_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // DEFAULT osnl (LEFT_PAREN (ttype (COMMA ttype)*)? RIGHT_PAREN | type_signature) + // DEFAULT onls (LEFT_PAREN (ttype (COMMA ttype)*)? RIGHT_PAREN | type_signature) public static boolean default_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "default_declaration")) return false; if (!nextTokenIs(b, HS_DEFAULT)) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_DEFAULT); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && default_declaration_2(b, l + 1); exit_section_(b, m, HS_DEFAULT_DECLARATION, r); return r; @@ -2054,7 +2040,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // DERIVING INSTANCE (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst + // DERIVING INSTANCE (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst public static boolean deriving_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "deriving_declaration")) return false; if (!nextTokenIs(b, HS_DERIVING)) return false; @@ -2062,47 +2048,47 @@ public class HaskellParser implements PsiParser, LightPsiParser { Marker m = enter_section_(b); r = consumeTokens(b, 0, HS_DERIVING, HS_INSTANCE); r = r && deriving_declaration_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && q_name(b, l + 1); + r = r && onls(b, l + 1); r = r && inst(b, l + 1); exit_section_(b, m, HS_DERIVING_DECLARATION, r); return r; } - // (scontext osnl DOUBLE_RIGHT_ARROW)? + // (scontext onls DOUBLE_RIGHT_ARROW)? private static boolean deriving_declaration_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "deriving_declaration_2")) return false; deriving_declaration_2_0(b, l + 1); return true; } - // scontext osnl DOUBLE_RIGHT_ARROW + // scontext onls DOUBLE_RIGHT_ARROW private static boolean deriving_declaration_2_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "deriving_declaration_2_0")) return false; boolean r; Marker m = enter_section_(b); r = scontext(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // LEFT_PAREN VARSYM_ID RIGHT_PAREN + // LEFT_PAREN DOT_DOT RIGHT_PAREN public static boolean dot_dot_parens(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "dot_dot_parens")) return false; if (!nextTokenIs(b, HS_LEFT_PAREN)) return false; boolean r; Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_LEFT_PAREN, HS_VARSYM_ID, HS_RIGHT_PAREN); + r = consumeTokens(b, 0, HS_LEFT_PAREN, HS_DOT_DOT, HS_RIGHT_PAREN); exit_section_(b, m, HS_DOT_DOT_PARENS, r); return r; } /* ********************************************************** */ - // PRAGMA_START CONID_ID? PRAGMA_END? NEWLINE? + // PRAGMA_START q_name? PRAGMA_END? NEWLINE? public static boolean dummy_pragma(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "dummy_pragma")) return false; if (!nextTokenIs(b, HS_PRAGMA_START)) return false; @@ -2116,10 +2102,10 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // CONID_ID? + // q_name? private static boolean dummy_pragma_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "dummy_pragma_1")) return false; - consumeToken(b, HS_CONID_ID); + q_name(b, l + 1); return true; } @@ -2138,128 +2124,114 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // export1 | export2 | export3 + // export3 | export1 | export2 | export4 public static boolean export(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "export")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_EXPORT, ""); - r = export1(b, l + 1); + r = export3(b, l + 1); + if (!r) r = export1(b, l + 1); if (!r) r = export2(b, l + 1); - if (!r) r = export3(b, l + 1); + if (!r) r = export4(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } /* ********************************************************** */ - // TYPE? onl (qvar | qvar_op) + // cname dot_dot_parens static boolean export1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "export1")) return false; boolean r; Marker m = enter_section_(b); - r = export1_0(b, l + 1); - r = r && onl(b, l + 1); - r = r && export1_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE? - private static boolean export1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export1_0")) return false; - consumeToken(b, HS_TYPE); - return true; - } - - // qvar | qvar_op - private static boolean export1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export1_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - if (!r) r = qvar_op(b, l + 1); + r = cname(b, l + 1); + r = r && dot_dot_parens(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // qcon onl (dot_dot_parens | LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN)? + // TYPE? onl cname static boolean export2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "export2")) return false; boolean r; Marker m = enter_section_(b); - r = qcon(b, l + 1); + r = export2_0(b, l + 1); r = r && onl(b, l + 1); - r = r && export2_2(b, l + 1); + r = r && cname(b, l + 1); exit_section_(b, m, null, r); return r; } - // (dot_dot_parens | LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN)? - private static boolean export2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2")) return false; - export2_2_0(b, l + 1); + // TYPE? + private static boolean export2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export2_0")) return false; + consumeToken(b, HS_TYPE); return true; } - // dot_dot_parens | LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN - private static boolean export2_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0")) return false; + /* ********************************************************** */ + // (q_con | conid) onl LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN + static boolean export3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export3")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; boolean r; Marker m = enter_section_(b); - r = dot_dot_parens(b, l + 1); - if (!r) r = export2_2_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN - private static boolean export2_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); + r = export3_0(b, l + 1); r = r && onl(b, l + 1); - r = r && export2_2_0_1_2(b, l + 1); + r = r && consumeToken(b, HS_LEFT_PAREN); + r = r && onl(b, l + 1); + r = r && export3_4(b, l + 1); r = r && onl(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } + // q_con | conid + private static boolean export3_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export3_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_con(b, l + 1); + if (!r) r = conid(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + // (cname onl (onl COMMA onl cname)*)? - private static boolean export2_2_0_1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2")) return false; - export2_2_0_1_2_0(b, l + 1); + private static boolean export3_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export3_4")) return false; + export3_4_0(b, l + 1); return true; } // cname onl (onl COMMA onl cname)* - private static boolean export2_2_0_1_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2_0")) return false; + private static boolean export3_4_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export3_4_0")) return false; boolean r; Marker m = enter_section_(b); r = cname(b, l + 1); r = r && onl(b, l + 1); - r = r && export2_2_0_1_2_0_2(b, l + 1); + r = r && export3_4_0_2(b, l + 1); exit_section_(b, m, null, r); return r; } // (onl COMMA onl cname)* - private static boolean export2_2_0_1_2_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2_0_2")) return false; + private static boolean export3_4_0_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export3_4_0_2")) return false; int c = current_position_(b); while (true) { - if (!export2_2_0_1_2_0_2_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "export2_2_0_1_2_0_2", c)) break; + if (!export3_4_0_2_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "export3_4_0_2", c)) break; c = current_position_(b); } return true; } // onl COMMA onl cname - private static boolean export2_2_0_1_2_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2_0_2_0")) return false; + private static boolean export3_4_0_2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export3_4_0_2_0")) return false; boolean r; Marker m = enter_section_(b); r = onl(b, l + 1); @@ -2271,63 +2243,67 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // MODULE mod_id - static boolean export3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export3")) return false; + // MODULE modid + static boolean export4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "export4")) return false; if (!nextTokenIs(b, HS_MODULE)) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_MODULE); - r = r && mod_id(b, l + 1); + r = r && modid(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // LEFT_PAREN onl export? (onl COMMA? onl export onl)* onl COMMA? onl RIGHT_PAREN + // LEFT_PAREN onl export (onl COMMA? onl export onl)* onl COMMA? onl RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN public static boolean exports(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "exports")) return false; if (!nextTokenIs(b, HS_LEFT_PAREN)) return false; boolean r; Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && onl(b, l + 1); - r = r && exports_2(b, l + 1); - r = r && exports_3(b, l + 1); - r = r && onl(b, l + 1); - r = r && exports_5(b, l + 1); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); + r = exports_0(b, l + 1); + if (!r) r = parseTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_PAREN); exit_section_(b, m, HS_EXPORTS, r); return r; } - // export? - private static boolean exports_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_2")) return false; - export(b, l + 1); - return true; + // LEFT_PAREN onl export (onl COMMA? onl export onl)* onl COMMA? onl RIGHT_PAREN + private static boolean exports_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "exports_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_LEFT_PAREN); + r = r && onl(b, l + 1); + r = r && export(b, l + 1); + r = r && exports_0_3(b, l + 1); + r = r && onl(b, l + 1); + r = r && exports_0_5(b, l + 1); + r = r && onl(b, l + 1); + r = r && consumeToken(b, HS_RIGHT_PAREN); + exit_section_(b, m, null, r); + return r; } // (onl COMMA? onl export onl)* - private static boolean exports_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_3")) return false; + private static boolean exports_0_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "exports_0_3")) return false; int c = current_position_(b); while (true) { - if (!exports_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "exports_3", c)) break; + if (!exports_0_3_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "exports_0_3", c)) break; c = current_position_(b); } return true; } // onl COMMA? onl export onl - private static boolean exports_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_3_0")) return false; + private static boolean exports_0_3_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "exports_0_3_0")) return false; boolean r; Marker m = enter_section_(b); r = onl(b, l + 1); - r = r && exports_3_0_1(b, l + 1); + r = r && exports_0_3_0_1(b, l + 1); r = r && onl(b, l + 1); r = r && export(b, l + 1); r = r && onl(b, l + 1); @@ -2336,21 +2312,21 @@ public class HaskellParser implements PsiParser, LightPsiParser { } // COMMA? - private static boolean exports_3_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_3_0_1")) return false; + private static boolean exports_0_3_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "exports_0_3_0_1")) return false; consumeToken(b, HS_COMMA); return true; } // COMMA? - private static boolean exports_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_5")) return false; + private static boolean exports_0_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "exports_0_5")) return false; consumeToken(b, HS_COMMA); return true; } /* ********************************************************** */ - // first_line_expression (line_expression)* last_line_expression | last_line_expression + // line_expression+ last_line_expression | last_line_expression public static boolean expression(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "expression")) return false; boolean r; @@ -2361,60 +2337,53 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // first_line_expression (line_expression)* last_line_expression + // line_expression+ last_line_expression private static boolean expression_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "expression_0")) return false; boolean r; Marker m = enter_section_(b); - r = first_line_expression(b, l + 1); - r = r && expression_0_1(b, l + 1); + r = expression_0_0(b, l + 1); r = r && last_line_expression(b, l + 1); exit_section_(b, m, null, r); return r; } - // (line_expression)* - private static boolean expression_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "expression_0_1")) return false; - int c = current_position_(b); - while (true) { - if (!expression_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "expression_0_1", c)) break; - c = current_position_(b); - } - return true; - } - - // (line_expression) - private static boolean expression_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "expression_0_1_0")) return false; + // line_expression+ + private static boolean expression_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "expression_0_0")) return false; boolean r; Marker m = enter_section_(b); r = line_expression(b, l + 1); + int c = current_position_(b); + while (r) { + if (!line_expression(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "expression_0_0", c)) break; + c = current_position_(b); + } exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // vars (COLON_COLON unpack_nounpack_pragma? (ttype | qvar_op atype))? + // q_names (COLON_COLON unpack_nounpack_pragma? (ttype | q_name atype))? public static boolean fielddecl(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "fielddecl")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_FIELDDECL, ""); - r = vars(b, l + 1); + r = q_names(b, l + 1); r = r && fielddecl_1(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // (COLON_COLON unpack_nounpack_pragma? (ttype | qvar_op atype))? + // (COLON_COLON unpack_nounpack_pragma? (ttype | q_name atype))? private static boolean fielddecl_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "fielddecl_1")) return false; fielddecl_1_0(b, l + 1); return true; } - // COLON_COLON unpack_nounpack_pragma? (ttype | qvar_op atype) + // COLON_COLON unpack_nounpack_pragma? (ttype | q_name atype) private static boolean fielddecl_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "fielddecl_1_0")) return false; boolean r; @@ -2433,7 +2402,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // ttype | qvar_op atype + // ttype | q_name atype private static boolean fielddecl_1_0_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "fielddecl_1_0_2")) return false; boolean r; @@ -2444,12 +2413,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // qvar_op atype + // q_name atype private static boolean fielddecl_1_0_2_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "fielddecl_1_0_2_1")) return false; boolean r; Marker m = enter_section_(b); - r = qvar_op(b, l + 1); + r = q_name(b, l + 1); r = r && atype(b, l + 1); exit_section_(b, m, null, r); return r; @@ -2502,55 +2471,27 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // general_id+ snl - public static boolean first_line_expression(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "first_line_expression")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_FIRST_LINE_EXPRESSION, ""); - r = first_line_expression_0(b, l + 1); - r = r && snl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // general_id+ - private static boolean first_line_expression_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "first_line_expression_0")) return false; + // INFIXL | INFIXR | INFIX + static boolean fixity(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "fixity")) return false; boolean r; Marker m = enter_section_(b); - r = general_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "first_line_expression_0", c)) break; - c = current_position_(b); - } + r = consumeToken(b, HS_INFIXL); + if (!r) r = consumeToken(b, HS_INFIXR); + if (!r) r = consumeToken(b, HS_INFIX); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // INFIXL | INFIXR | INFIX - public static boolean fixity(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fixity")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_FIXITY, ""); - r = consumeToken(b, HS_INFIXL); - if (!r) r = consumeToken(b, HS_INFIXR); - if (!r) r = consumeToken(b, HS_INFIX); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // fixity (DECIMAL)? ops + // fixity (DECIMAL)? q_names public static boolean fixity_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "fixity_declaration")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_FIXITY_DECLARATION, ""); r = fixity(b, l + 1); r = r && fixity_declaration_1(b, l + 1); - r = r && ops(b, l + 1); + r = r && q_names(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } @@ -2563,14 +2504,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // (FOREIGN_IMPORT | FOREIGN_EXPORT) osnl expression + // (FOREIGN_IMPORT | FOREIGN_EXPORT) onls expression public static boolean foreign_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "foreign_declaration")) return false; if (!nextTokenIs(b, "", HS_FOREIGN_EXPORT, HS_FOREIGN_IMPORT)) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_FOREIGN_DECLARATION, ""); r = foreign_declaration_0(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && expression(b, l + 1); exit_section_(b, l, m, r, false, null); return r; @@ -2588,31 +2529,15 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // con_sym | qcon_sym - public static boolean gcon_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gcon_sym")) return false; - if (!nextTokenIs(b, "", HS_CONID_ID, HS_CONSYM_ID)) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_GCON_SYM, ""); - r = con_sym(b, l + 1); - if (!r) r = qcon_sym(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // qvar_op | qcon_op | qvar | qcon | LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | + // q_name | LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | // COLON_COLON | DOUBLE_RIGHT_ARROW | RIGHT_ARROW | IN | CASE | OF | LET | // SEMICOLON | LEFT_ARROW | LEFT_BRACKET | RIGHT_BRACKET | literal | LEFT_BRACE | RIGHT_BRACE | - // COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | fixity | DOT + // COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | fixity | DOT_DOT | scc_pragma static boolean general_id(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "general_id")) return false; boolean r; Marker m = enter_section_(b); - r = qvar_op(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - if (!r) r = qvar(b, l + 1); - if (!r) r = qcon(b, l + 1); + r = q_name(b, l + 1); if (!r) r = consumeToken(b, HS_LEFT_PAREN); if (!r) r = consumeToken(b, HS_RIGHT_PAREN); if (!r) r = consumeToken(b, HS_FLOAT); @@ -2641,41 +2566,84 @@ public class HaskellParser implements PsiParser, LightPsiParser { if (!r) r = consumeToken(b, HS_QUOTE); if (!r) r = consumeToken(b, HS_BACKQUOTE); if (!r) r = fixity(b, l + 1); - if (!r) r = consumeToken(b, HS_DOT); + if (!r) r = consumeToken(b, HS_DOT_DOT); + if (!r) r = scc_pragma(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // (general_id | NEWLINE | MODULE | INSTANCE)* + // (CON_ID | VAR_ID | CONSYM_ID | VARSYM_ID | DOT | + // LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | + // COLON_COLON | DOUBLE_RIGHT_ARROW | RIGHT_ARROW | IN | CASE | OF | LET | + // SEMICOLON | LEFT_ARROW | LEFT_BRACKET | RIGHT_BRACKET | literal | LEFT_BRACE | RIGHT_BRACE | + // COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | DOT_DOT | MODULE | INSTANCE | NEWLINE)+ public static boolean general_pragma_content(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "general_pragma_content")) return false; + boolean r; Marker m = enter_section_(b, l, _NONE_, HS_GENERAL_PRAGMA_CONTENT, ""); + r = general_pragma_content_0(b, l + 1); int c = current_position_(b); - while (true) { + while (r) { if (!general_pragma_content_0(b, l + 1)) break; if (!empty_element_parsed_guard_(b, "general_pragma_content", c)) break; c = current_position_(b); } - exit_section_(b, l, m, true, false, null); - return true; + exit_section_(b, l, m, r, false, null); + return r; } - // general_id | NEWLINE | MODULE | INSTANCE + // CON_ID | VAR_ID | CONSYM_ID | VARSYM_ID | DOT | + // LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | + // COLON_COLON | DOUBLE_RIGHT_ARROW | RIGHT_ARROW | IN | CASE | OF | LET | + // SEMICOLON | LEFT_ARROW | LEFT_BRACKET | RIGHT_BRACKET | literal | LEFT_BRACE | RIGHT_BRACE | + // COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | DOT_DOT | MODULE | INSTANCE | NEWLINE private static boolean general_pragma_content_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "general_pragma_content_0")) return false; boolean r; Marker m = enter_section_(b); - r = general_id(b, l + 1); - if (!r) r = consumeToken(b, HS_NEWLINE); + r = consumeToken(b, HS_CON_ID); + if (!r) r = consumeToken(b, HS_VAR_ID); + if (!r) r = consumeToken(b, HS_CONSYM_ID); + if (!r) r = consumeToken(b, HS_VARSYM_ID); + if (!r) r = consumeToken(b, HS_DOT); + if (!r) r = consumeToken(b, HS_LEFT_PAREN); + if (!r) r = consumeToken(b, HS_RIGHT_PAREN); + if (!r) r = consumeToken(b, HS_FLOAT); + if (!r) r = consumeToken(b, HS_DO); + if (!r) r = consumeToken(b, HS_WHERE); + if (!r) r = consumeToken(b, HS_IF); + if (!r) r = consumeToken(b, HS_THEN); + if (!r) r = consumeToken(b, HS_ELSE); + if (!r) r = consumeToken(b, HS_COLON_COLON); + if (!r) r = consumeToken(b, HS_DOUBLE_RIGHT_ARROW); + if (!r) r = consumeToken(b, HS_RIGHT_ARROW); + if (!r) r = consumeToken(b, HS_IN); + if (!r) r = consumeToken(b, HS_CASE); + if (!r) r = consumeToken(b, HS_OF); + if (!r) r = consumeToken(b, HS_LET); + if (!r) r = consumeToken(b, HS_SEMICOLON); + if (!r) r = consumeToken(b, HS_LEFT_ARROW); + if (!r) r = consumeToken(b, HS_LEFT_BRACKET); + if (!r) r = consumeToken(b, HS_RIGHT_BRACKET); + if (!r) r = literal(b, l + 1); + if (!r) r = consumeToken(b, HS_LEFT_BRACE); + if (!r) r = consumeToken(b, HS_RIGHT_BRACE); + if (!r) r = consumeToken(b, HS_COMMA); + if (!r) r = consumeToken(b, HS_UNDERSCORE); + if (!r) r = symbol_reserved_op(b, l + 1); + if (!r) r = consumeToken(b, HS_QUOTE); + if (!r) r = consumeToken(b, HS_BACKQUOTE); + if (!r) r = consumeToken(b, HS_DOT_DOT); if (!r) r = consumeToken(b, HS_MODULE); if (!r) r = consumeToken(b, HS_INSTANCE); + if (!r) r = consumeToken(b, HS_NEWLINE); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // QUOTE? qcon | LEFT_PAREN RIGHT_ARROW RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN | QUOTE? LEFT_BRACKET RIGHT_BRACKET |LEFT_PAREN COMMA (COMMA)* RIGHT_PAREN + // QUOTE? q_name | LEFT_PAREN RIGHT_ARROW RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN | QUOTE? LEFT_BRACKET RIGHT_BRACKET | LEFT_PAREN COMMA (COMMA)* RIGHT_PAREN public static boolean gtycon(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "gtycon")) return false; boolean r; @@ -2689,13 +2657,13 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // QUOTE? qcon + // QUOTE? q_name private static boolean gtycon_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "gtycon_0")) return false; boolean r; Marker m = enter_section_(b); r = gtycon_0_0(b, l + 1); - r = r && qcon(b, l + 1); + r = r && q_name(b, l + 1); exit_section_(b, m, null, r); return r; } @@ -2750,7 +2718,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // PRAGMA_START onl "OPTIONS_HADDOCK" general_pragma_content PRAGMA_END NEWLINE? + // PRAGMA_START onl "OPTIONS_HADDOCK" onl (VARSYM_ID | VAR_ID)+ onl (COMMA onl (VARSYM_ID | VAR_ID)+)* onl PRAGMA_END NEWLINE? public static boolean haddock_pragma(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "haddock_pragma")) return false; if (!nextTokenIs(b, HS_PRAGMA_START)) return false; @@ -2759,16 +2727,98 @@ public class HaskellParser implements PsiParser, LightPsiParser { r = consumeToken(b, HS_PRAGMA_START); r = r && onl(b, l + 1); r = r && consumeToken(b, "OPTIONS_HADDOCK"); - r = r && general_pragma_content(b, l + 1); + r = r && onl(b, l + 1); + r = r && haddock_pragma_4(b, l + 1); + r = r && onl(b, l + 1); + r = r && haddock_pragma_6(b, l + 1); + r = r && onl(b, l + 1); r = r && consumeToken(b, HS_PRAGMA_END); - r = r && haddock_pragma_5(b, l + 1); + r = r && haddock_pragma_9(b, l + 1); exit_section_(b, m, HS_HADDOCK_PRAGMA, r); return r; } + // (VARSYM_ID | VAR_ID)+ + private static boolean haddock_pragma_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "haddock_pragma_4")) return false; + boolean r; + Marker m = enter_section_(b); + r = haddock_pragma_4_0(b, l + 1); + int c = current_position_(b); + while (r) { + if (!haddock_pragma_4_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "haddock_pragma_4", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // VARSYM_ID | VAR_ID + private static boolean haddock_pragma_4_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "haddock_pragma_4_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_VARSYM_ID); + if (!r) r = consumeToken(b, HS_VAR_ID); + exit_section_(b, m, null, r); + return r; + } + + // (COMMA onl (VARSYM_ID | VAR_ID)+)* + private static boolean haddock_pragma_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "haddock_pragma_6")) return false; + int c = current_position_(b); + while (true) { + if (!haddock_pragma_6_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "haddock_pragma_6", c)) break; + c = current_position_(b); + } + return true; + } + + // COMMA onl (VARSYM_ID | VAR_ID)+ + private static boolean haddock_pragma_6_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "haddock_pragma_6_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_COMMA); + r = r && onl(b, l + 1); + r = r && haddock_pragma_6_0_2(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // (VARSYM_ID | VAR_ID)+ + private static boolean haddock_pragma_6_0_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "haddock_pragma_6_0_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = haddock_pragma_6_0_2_0(b, l + 1); + int c = current_position_(b); + while (r) { + if (!haddock_pragma_6_0_2_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "haddock_pragma_6_0_2", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // VARSYM_ID | VAR_ID + private static boolean haddock_pragma_6_0_2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "haddock_pragma_6_0_2_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_VARSYM_ID); + if (!r) r = consumeToken(b, HS_VAR_ID); + exit_section_(b, m, null, r); + return r; + } + // NEWLINE? - private static boolean haddock_pragma_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "haddock_pragma_5")) return false; + private static boolean haddock_pragma_9(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "haddock_pragma_9")) return false; consumeToken(b, HS_NEWLINE); return true; } @@ -2785,7 +2835,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // (idecl | expression) (osnl (idecl | expression))* + // (idecl | expression) (onls (idecl | expression))* static boolean idecls(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "idecls")) return false; boolean r; @@ -2807,7 +2857,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (osnl (idecl | expression))* + // (onls (idecl | expression))* private static boolean idecls_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "idecls_1")) return false; int c = current_position_(b); @@ -2819,12 +2869,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // osnl (idecl | expression) + // onls (idecl | expression) private static boolean idecls_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "idecls_1_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && idecls_1_0_1(b, l + 1); exit_section_(b, m, null, r); return r; @@ -2842,26 +2892,28 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // IMPORT osnl source_pragma? osnl import_qualified? osnl import_module? osnl import_qualified_as? osnl import_spec? onl + // IMPORT onls source_pragma? import_package_name? onls import_qualified? onls modid onls import_qualified_as? onls import_spec? NEWLINE? public static boolean import_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_declaration")) return false; if (!nextTokenIs(b, HS_IMPORT)) return false; - boolean r; - Marker m = enter_section_(b); + boolean r, p; + Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_DECLARATION, null); r = consumeToken(b, HS_IMPORT); - r = r && osnl(b, l + 1); - r = r && import_declaration_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_declaration_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_declaration_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_declaration_8(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_declaration_10(b, l + 1); - r = r && onl(b, l + 1); - exit_section_(b, m, HS_IMPORT_DECLARATION, r); - return r; + p = r; // pin = 1 + r = r && report_error_(b, onls(b, l + 1)); + r = p && report_error_(b, import_declaration_2(b, l + 1)) && r; + r = p && report_error_(b, import_declaration_3(b, l + 1)) && r; + r = p && report_error_(b, onls(b, l + 1)) && r; + r = p && report_error_(b, import_declaration_5(b, l + 1)) && r; + r = p && report_error_(b, onls(b, l + 1)) && r; + r = p && report_error_(b, modid(b, l + 1)) && r; + r = p && report_error_(b, onls(b, l + 1)) && r; + r = p && report_error_(b, import_declaration_9(b, l + 1)) && r; + r = p && report_error_(b, onls(b, l + 1)) && r; + r = p && report_error_(b, import_declaration_11(b, l + 1)) && r; + r = p && import_declaration_12(b, l + 1) && r; + exit_section_(b, l, m, r, p, null); + return r || p; } // source_pragma? @@ -2871,44 +2923,53 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } + // import_package_name? + private static boolean import_declaration_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_declaration_3")) return false; + import_package_name(b, l + 1); + return true; + } + // import_qualified? - private static boolean import_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_4")) return false; + private static boolean import_declaration_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_declaration_5")) return false; import_qualified(b, l + 1); return true; } - // import_module? - private static boolean import_declaration_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_6")) return false; - import_module(b, l + 1); - return true; - } - // import_qualified_as? - private static boolean import_declaration_8(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_8")) return false; + private static boolean import_declaration_9(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_declaration_9")) return false; import_qualified_as(b, l + 1); return true; } // import_spec? - private static boolean import_declaration_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_10")) return false; + private static boolean import_declaration_11(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_declaration_11")) return false; import_spec(b, l + 1); return true; } + // NEWLINE? + private static boolean import_declaration_12(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_declaration_12")) return false; + consumeToken(b, HS_NEWLINE); + return true; + } + /* ********************************************************** */ // ((import_declaration | cfiles_pragma) onl)* - static boolean import_declarations(PsiBuilder b, int l) { + public static boolean import_declarations(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_declarations")) return false; + Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_DECLARATIONS, ""); int c = current_position_(b); while (true) { if (!import_declarations_0(b, l + 1)) break; if (!empty_element_parsed_guard_(b, "import_declarations", c)) break; c = current_position_(b); } + exit_section_(b, l, m, true, false, null); return true; } @@ -2947,55 +3008,57 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // "hiding" + // VAR_ID public static boolean import_hiding(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_hiding")) return false; + if (!nextTokenIs(b, HS_VAR_ID)) return false; boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_HIDING, ""); - r = consumeToken(b, "hiding"); - exit_section_(b, l, m, r, false, null); + Marker m = enter_section_(b); + r = consumeToken(b, HS_VAR_ID); + exit_section_(b, m, HS_IMPORT_HIDING, r); return r; } /* ********************************************************** */ - // import_hiding osnl LEFT_PAREN osnl (import_id osnl (osnl COMMA osnl import_id)* osnl (COMMA)?)? osnl RIGHT_PAREN + // import_hiding onls LEFT_PAREN onls (import_id onls (onls COMMA onls import_id)* onls (COMMA)?)? onls RIGHT_PAREN public static boolean import_hiding_spec(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_hiding_spec")) return false; + if (!nextTokenIs(b, HS_VAR_ID)) return false; boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_HIDING_SPEC, ""); + Marker m = enter_section_(b); r = import_hiding(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && import_hiding_spec_4(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, l, m, r, false, null); + exit_section_(b, m, HS_IMPORT_HIDING_SPEC, r); return r; } - // (import_id osnl (osnl COMMA osnl import_id)* osnl (COMMA)?)? + // (import_id onls (onls COMMA onls import_id)* onls (COMMA)?)? private static boolean import_hiding_spec_4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_hiding_spec_4")) return false; import_hiding_spec_4_0(b, l + 1); return true; } - // import_id osnl (osnl COMMA osnl import_id)* osnl (COMMA)? + // import_id onls (onls COMMA onls import_id)* onls (COMMA)? private static boolean import_hiding_spec_4_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_hiding_spec_4_0")) return false; boolean r; Marker m = enter_section_(b); r = import_id(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && import_hiding_spec_4_0_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && import_hiding_spec_4_0_4(b, l + 1); exit_section_(b, m, null, r); return r; } - // (osnl COMMA osnl import_id)* + // (onls COMMA onls import_id)* private static boolean import_hiding_spec_4_0_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_hiding_spec_4_0_2")) return false; int c = current_position_(b); @@ -3007,14 +3070,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // osnl COMMA osnl import_id + // onls COMMA onls import_id private static boolean import_hiding_spec_4_0_2_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_hiding_spec_4_0_2_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && import_id(b, l + 1); exit_section_(b, m, null, r); return r; @@ -3028,7 +3091,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // TYPE? (LEFT_PAREN DOT RIGHT_PAREN | qcon osnl LEFT_PAREN osnl cname osnl (COMMA osnl cname osnl)* osnl RIGHT_PAREN | qvar | qcon dot_dot_parens?) + // TYPE? (cname onls dot_dot_parens | cname (LEFT_PAREN onls cname onls (COMMA onls cname onls)* onls RIGHT_PAREN) | cname) public static boolean import_id(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_id")) return false; boolean r; @@ -3046,100 +3109,102 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // LEFT_PAREN DOT RIGHT_PAREN | qcon osnl LEFT_PAREN osnl cname osnl (COMMA osnl cname osnl)* osnl RIGHT_PAREN | qvar | qcon dot_dot_parens? + // cname onls dot_dot_parens | cname (LEFT_PAREN onls cname onls (COMMA onls cname onls)* onls RIGHT_PAREN) | cname private static boolean import_id_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_id_1")) return false; boolean r; Marker m = enter_section_(b); - r = parseTokens(b, 0, HS_LEFT_PAREN, HS_DOT, HS_RIGHT_PAREN); + r = import_id_1_0(b, l + 1); if (!r) r = import_id_1_1(b, l + 1); - if (!r) r = qvar(b, l + 1); - if (!r) r = import_id_1_3(b, l + 1); + if (!r) r = cname(b, l + 1); exit_section_(b, m, null, r); return r; } - // qcon osnl LEFT_PAREN osnl cname osnl (COMMA osnl cname osnl)* osnl RIGHT_PAREN + // cname onls dot_dot_parens + private static boolean import_id_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_id_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = cname(b, l + 1); + r = r && onls(b, l + 1); + r = r && dot_dot_parens(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // cname (LEFT_PAREN onls cname onls (COMMA onls cname onls)* onls RIGHT_PAREN) private static boolean import_id_1_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_id_1_1")) return false; boolean r; Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = cname(b, l + 1); + r = r && import_id_1_1_1(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // LEFT_PAREN onls cname onls (COMMA onls cname onls)* onls RIGHT_PAREN + private static boolean import_id_1_1_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_id_1_1_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_LEFT_PAREN); + r = r && onls(b, l + 1); r = r && cname(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_id_1_1_6(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && import_id_1_1_1_4(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // (COMMA osnl cname osnl)* - private static boolean import_id_1_1_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_1_6")) return false; + // (COMMA onls cname onls)* + private static boolean import_id_1_1_1_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_id_1_1_1_4")) return false; int c = current_position_(b); while (true) { - if (!import_id_1_1_6_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "import_id_1_1_6", c)) break; + if (!import_id_1_1_1_4_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "import_id_1_1_1_4", c)) break; c = current_position_(b); } return true; } - // COMMA osnl cname osnl - private static boolean import_id_1_1_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_1_6_0")) return false; + // COMMA onls cname onls + private static boolean import_id_1_1_1_4_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_id_1_1_1_4_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && cname(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); exit_section_(b, m, null, r); return r; } - // qcon dot_dot_parens? - private static boolean import_id_1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && import_id_1_3_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // dot_dot_parens? - private static boolean import_id_1_3_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_3_1")) return false; - dot_dot_parens(b, l + 1); - return true; - } - /* ********************************************************** */ - // LEFT_PAREN osnl import_id (osnl COMMA osnl import_id)* osnl (COMMA)? osnl RIGHT_PAREN + // LEFT_PAREN onls import_id (onls COMMA? onls import_id)* onls (COMMA)? onls RIGHT_PAREN public static boolean import_ids_spec(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_ids_spec")) return false; if (!nextTokenIs(b, HS_LEFT_PAREN)) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && import_id(b, l + 1); r = r && import_ids_spec_3(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && import_ids_spec_5(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, HS_IMPORT_IDS_SPEC, r); return r; } - // (osnl COMMA osnl import_id)* + // (onls COMMA? onls import_id)* private static boolean import_ids_spec_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_ids_spec_3")) return false; int c = current_position_(b); @@ -3151,19 +3216,26 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // osnl COMMA osnl import_id + // onls COMMA? onls import_id private static boolean import_ids_spec_3_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_ids_spec_3_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = onls(b, l + 1); + r = r && import_ids_spec_3_0_1(b, l + 1); + r = r && onls(b, l + 1); r = r && import_id(b, l + 1); exit_section_(b, m, null, r); return r; } + // COMMA? + private static boolean import_ids_spec_3_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_ids_spec_3_0_1")) return false; + consumeToken(b, HS_COMMA); + return true; + } + // (COMMA)? private static boolean import_ids_spec_5(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_ids_spec_5")) return false; @@ -3172,55 +3244,49 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // mod_id - public static boolean import_module(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_module")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; + // STRING_LITERAL + public static boolean import_package_name(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "import_package_name")) return false; + if (!nextTokenIs(b, HS_STRING_LITERAL)) return false; boolean r; Marker m = enter_section_(b); - r = mod_id(b, l + 1); - exit_section_(b, m, HS_IMPORT_MODULE, r); + r = consumeToken(b, HS_STRING_LITERAL); + exit_section_(b, m, HS_IMPORT_PACKAGE_NAME, r); return r; } /* ********************************************************** */ - // var_id + // VAR_ID public static boolean import_qualified(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_qualified")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; + if (!nextTokenIs(b, HS_VAR_ID)) return false; boolean r; Marker m = enter_section_(b); - r = var_id(b, l + 1); + r = consumeToken(b, HS_VAR_ID); exit_section_(b, m, HS_IMPORT_QUALIFIED, r); return r; } /* ********************************************************** */ - // var_id qualifier? + // VAR_ID qualifier public static boolean import_qualified_as(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_qualified_as")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; + if (!nextTokenIs(b, HS_VAR_ID)) return false; boolean r; Marker m = enter_section_(b); - r = var_id(b, l + 1); - r = r && import_qualified_as_1(b, l + 1); + r = consumeToken(b, HS_VAR_ID); + r = r && qualifier(b, l + 1); exit_section_(b, m, HS_IMPORT_QUALIFIED_AS, r); return r; } - // qualifier? - private static boolean import_qualified_as_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_qualified_as_1")) return false; - qualifier(b, l + 1); - return true; - } - /* ********************************************************** */ // import_ids_spec | // import_hiding_spec | // import_empty_spec public static boolean import_spec(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "import_spec")) return false; + if (!nextTokenIs(b, "", HS_LEFT_PAREN, HS_VAR_ID)) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_SPEC, ""); r = import_ids_spec(b, l + 1); @@ -3298,14 +3364,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // qvar gtycon | - // gtycon? instvar* (LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN)+ instvar* | + // q_name gtycon | + // gtycon? instvar* (LEFT_PAREN onls gtycon (instvar)* onls RIGHT_PAREN)+ instvar* | // gtycon+ instvar* | - // qvar instvar* | - // (LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN)+ instvar* | - // QUOTE? (LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET)+ instvar* | - // (LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN)+ instvar* | - // (LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN)+ instvar* | + // q_name instvar* | + // (LEFT_PAREN onls instvar (onls COMMA onls instvar)+ onls RIGHT_PAREN)+ instvar* | + // QUOTE? (LEFT_BRACKET onls instvar onls RIGHT_BRACKET)+ instvar* | + // (LEFT_PAREN onls instvar+ onls RIGHT_PAREN)+ instvar* | + // (LEFT_PAREN onls instvar+ (RIGHT_ARROW onls instvar* onls)* onls RIGHT_PAREN)+ instvar* | // ttype public static boolean inst(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst")) return false; @@ -3324,18 +3390,18 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // qvar gtycon + // q_name gtycon private static boolean inst_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_0")) return false; boolean r; Marker m = enter_section_(b); - r = qvar(b, l + 1); + r = q_name(b, l + 1); r = r && gtycon(b, l + 1); exit_section_(b, m, null, r); return r; } - // gtycon? instvar* (LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN)+ instvar* + // gtycon? instvar* (LEFT_PAREN onls gtycon (instvar)* onls RIGHT_PAREN)+ instvar* private static boolean inst_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_1")) return false; boolean r; @@ -3367,7 +3433,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // (LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN)+ + // (LEFT_PAREN onls gtycon (instvar)* onls RIGHT_PAREN)+ private static boolean inst_1_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_1_2")) return false; boolean r; @@ -3383,16 +3449,16 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN + // LEFT_PAREN onls gtycon (instvar)* onls RIGHT_PAREN private static boolean inst_1_2_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_1_2_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && gtycon(b, l + 1); r = r && inst_1_2_0_3(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; @@ -3471,12 +3537,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // qvar instvar* + // q_name instvar* private static boolean inst_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_3")) return false; boolean r; Marker m = enter_section_(b); - r = qvar(b, l + 1); + r = q_name(b, l + 1); r = r && inst_3_1(b, l + 1); exit_section_(b, m, null, r); return r; @@ -3494,7 +3560,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // (LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN)+ instvar* + // (LEFT_PAREN onls instvar (onls COMMA onls instvar)+ onls RIGHT_PAREN)+ instvar* private static boolean inst_4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_4")) return false; boolean r; @@ -3505,7 +3571,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN)+ + // (LEFT_PAREN onls instvar (onls COMMA onls instvar)+ onls RIGHT_PAREN)+ private static boolean inst_4_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_4_0")) return false; boolean r; @@ -3521,22 +3587,22 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN + // LEFT_PAREN onls instvar (onls COMMA onls instvar)+ onls RIGHT_PAREN private static boolean inst_4_0_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_4_0_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instvar(b, l + 1); r = r && inst_4_0_0_3(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // (osnl COMMA osnl instvar)+ + // (onls COMMA onls instvar)+ private static boolean inst_4_0_0_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_4_0_0_3")) return false; boolean r; @@ -3552,14 +3618,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // osnl COMMA osnl instvar + // onls COMMA onls instvar private static boolean inst_4_0_0_3_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_4_0_0_3_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instvar(b, l + 1); exit_section_(b, m, null, r); return r; @@ -3577,7 +3643,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // QUOTE? (LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET)+ instvar* + // QUOTE? (LEFT_BRACKET onls instvar onls RIGHT_BRACKET)+ instvar* private static boolean inst_5(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_5")) return false; boolean r; @@ -3596,7 +3662,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // (LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET)+ + // (LEFT_BRACKET onls instvar onls RIGHT_BRACKET)+ private static boolean inst_5_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_5_1")) return false; boolean r; @@ -3612,15 +3678,15 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET + // LEFT_BRACKET onls instvar onls RIGHT_BRACKET private static boolean inst_5_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_5_1_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_BRACKET); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instvar(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_BRACKET); exit_section_(b, m, null, r); return r; @@ -3638,7 +3704,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // (LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN)+ instvar* + // (LEFT_PAREN onls instvar+ onls RIGHT_PAREN)+ instvar* private static boolean inst_6(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_6")) return false; boolean r; @@ -3649,7 +3715,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN)+ + // (LEFT_PAREN onls instvar+ onls RIGHT_PAREN)+ private static boolean inst_6_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_6_0")) return false; boolean r; @@ -3665,15 +3731,15 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN + // LEFT_PAREN onls instvar+ onls RIGHT_PAREN private static boolean inst_6_0_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_6_0_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && inst_6_0_0_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; @@ -3707,7 +3773,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // (LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN)+ instvar* + // (LEFT_PAREN onls instvar+ (RIGHT_ARROW onls instvar* onls)* onls RIGHT_PAREN)+ instvar* private static boolean inst_7(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_7")) return false; boolean r; @@ -3718,7 +3784,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN)+ + // (LEFT_PAREN onls instvar+ (RIGHT_ARROW onls instvar* onls)* onls RIGHT_PAREN)+ private static boolean inst_7_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_7_0")) return false; boolean r; @@ -3734,16 +3800,16 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN + // LEFT_PAREN onls instvar+ (RIGHT_ARROW onls instvar* onls)* onls RIGHT_PAREN private static boolean inst_7_0_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_7_0_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && inst_7_0_0_2(b, l + 1); r = r && inst_7_0_0_3(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; @@ -3765,7 +3831,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (RIGHT_ARROW osnl instvar* osnl)* + // (RIGHT_ARROW onls instvar* onls)* private static boolean inst_7_0_0_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_7_0_0_3")) return false; int c = current_position_(b); @@ -3777,15 +3843,15 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // RIGHT_ARROW osnl instvar* osnl + // RIGHT_ARROW onls instvar* onls private static boolean inst_7_0_0_3_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "inst_7_0_0_3_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_RIGHT_ARROW); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && inst_7_0_0_3_0_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); exit_section_(b, m, null, r); return r; } @@ -3815,8 +3881,8 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // INSTANCE osnl (overlap_pragma | "OVERLAPPABLE_" | "OVERLAPPING_")? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst osnl WHERE osnl idecls - // | INSTANCE osnl overlap_pragma? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst + // INSTANCE onls (overlap_pragma | "OVERLAPPABLE_" | "OVERLAPPING_")? onls (var_con+ DOT)? onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst onls WHERE onls idecls | + // INSTANCE onls overlap_pragma? onls (q_name+ DOT)? onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst public static boolean instance_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration")) return false; if (!nextTokenIs(b, HS_INSTANCE)) return false; @@ -3828,25 +3894,25 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // INSTANCE osnl (overlap_pragma | "OVERLAPPABLE_" | "OVERLAPPING_")? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst osnl WHERE osnl idecls + // INSTANCE onls (overlap_pragma | "OVERLAPPABLE_" | "OVERLAPPING_")? onls (var_con+ DOT)? onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst onls WHERE onls idecls private static boolean instance_declaration_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_INSTANCE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instance_declaration_0_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instance_declaration_0_4(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instance_declaration_0_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && q_name(b, l + 1); + r = r && onls(b, l + 1); r = r && inst(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_WHERE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && idecls(b, l + 1); exit_section_(b, m, null, r); return r; @@ -3871,14 +3937,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (var_id+ DOT)? + // (var_con+ DOT)? private static boolean instance_declaration_0_4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_0_4")) return false; instance_declaration_0_4_0(b, l + 1); return true; } - // var_id+ DOT + // var_con+ DOT private static boolean instance_declaration_0_4_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_0_4_0")) return false; boolean r; @@ -3889,15 +3955,15 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // var_id+ + // var_con+ private static boolean instance_declaration_0_4_0_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_0_4_0_0")) return false; boolean r; Marker m = enter_section_(b); - r = var_id(b, l + 1); + r = var_con(b, l + 1); int c = current_position_(b); while (r) { - if (!var_id(b, l + 1)) break; + if (!var_con(b, l + 1)) break; if (!empty_element_parsed_guard_(b, "instance_declaration_0_4_0_0", c)) break; c = current_position_(b); } @@ -3905,40 +3971,40 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (scontext osnl DOUBLE_RIGHT_ARROW)? + // (scontext onls DOUBLE_RIGHT_ARROW)? private static boolean instance_declaration_0_6(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_0_6")) return false; instance_declaration_0_6_0(b, l + 1); return true; } - // scontext osnl DOUBLE_RIGHT_ARROW + // scontext onls DOUBLE_RIGHT_ARROW private static boolean instance_declaration_0_6_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_0_6_0")) return false; boolean r; Marker m = enter_section_(b); r = scontext(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } - // INSTANCE osnl overlap_pragma? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst + // INSTANCE onls overlap_pragma? onls (q_name+ DOT)? onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst private static boolean instance_declaration_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_INSTANCE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instance_declaration_1_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instance_declaration_1_4(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && instance_declaration_1_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && q_name(b, l + 1); + r = r && onls(b, l + 1); r = r && inst(b, l + 1); exit_section_(b, m, null, r); return r; @@ -3951,14 +4017,14 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // (var_id+ DOT)? + // (q_name+ DOT)? private static boolean instance_declaration_1_4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_1_4")) return false; instance_declaration_1_4_0(b, l + 1); return true; } - // var_id+ DOT + // q_name+ DOT private static boolean instance_declaration_1_4_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_1_4_0")) return false; boolean r; @@ -3969,15 +4035,15 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // var_id+ + // q_name+ private static boolean instance_declaration_1_4_0_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_1_4_0_0")) return false; boolean r; Marker m = enter_section_(b); - r = var_id(b, l + 1); + r = q_name(b, l + 1); int c = current_position_(b); while (r) { - if (!var_id(b, l + 1)) break; + if (!q_name(b, l + 1)) break; if (!empty_element_parsed_guard_(b, "instance_declaration_1_4_0_0", c)) break; c = current_position_(b); } @@ -3985,109 +4051,110 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (scontext osnl DOUBLE_RIGHT_ARROW)? + // (scontext onls DOUBLE_RIGHT_ARROW)? private static boolean instance_declaration_1_6(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_1_6")) return false; instance_declaration_1_6_0(b, l + 1); return true; } - // scontext osnl DOUBLE_RIGHT_ARROW + // scontext onls DOUBLE_RIGHT_ARROW private static boolean instance_declaration_1_6_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instance_declaration_1_6_0")) return false; boolean r; Marker m = enter_section_(b); r = scontext(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // qcon | qvar | gcon_sym | LEFT_BRACKET qvar RIGHT_BRACKET | LEFT_PAREN qvar? (gcon_sym | qcon) qvar? RIGHT_PAREN | - // LEFT_PAREN RIGHT_PAREN + // q_name | LEFT_BRACKET q_name+ RIGHT_BRACKET | LEFT_PAREN q_name+ RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN public static boolean instvar(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "instvar")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_INSTVAR, ""); - r = qcon(b, l + 1); - if (!r) r = qvar(b, l + 1); - if (!r) r = gcon_sym(b, l + 1); - if (!r) r = instvar_3(b, l + 1); - if (!r) r = instvar_4(b, l + 1); + r = q_name(b, l + 1); + if (!r) r = instvar_1(b, l + 1); + if (!r) r = instvar_2(b, l + 1); if (!r) r = parseTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_PAREN); exit_section_(b, l, m, r, false, null); return r; } - // LEFT_BRACKET qvar RIGHT_BRACKET - private static boolean instvar_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_3")) return false; + // LEFT_BRACKET q_name+ RIGHT_BRACKET + private static boolean instvar_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "instvar_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_BRACKET); - r = r && qvar(b, l + 1); + r = r && instvar_1_1(b, l + 1); r = r && consumeToken(b, HS_RIGHT_BRACKET); exit_section_(b, m, null, r); return r; } - // LEFT_PAREN qvar? (gcon_sym | qcon) qvar? RIGHT_PAREN - private static boolean instvar_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4")) return false; + // q_name+ + private static boolean instvar_1_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "instvar_1_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "instvar_1_1", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // LEFT_PAREN q_name+ RIGHT_PAREN + private static boolean instvar_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "instvar_2")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && instvar_4_1(b, l + 1); - r = r && instvar_4_2(b, l + 1); - r = r && instvar_4_3(b, l + 1); + r = r && instvar_2_1(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // qvar? - private static boolean instvar_4_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4_1")) return false; - qvar(b, l + 1); - return true; - } - - // gcon_sym | qcon - private static boolean instvar_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4_2")) return false; + // q_name+ + private static boolean instvar_2_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "instvar_2_1")) return false; boolean r; Marker m = enter_section_(b); - r = gcon_sym(b, l + 1); - if (!r) r = qcon(b, l + 1); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "instvar_2_1", c)) break; + c = current_position_(b); + } exit_section_(b, m, null, r); return r; } - // qvar? - private static boolean instvar_4_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4_3")) return false; - qvar(b, l + 1); - return true; - } - /* ********************************************************** */ - // var_id COLON_COLON ttype + // q_name COLON_COLON ttype public static boolean kind_signature(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "kind_signature")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; boolean r; - Marker m = enter_section_(b); - r = var_id(b, l + 1); + Marker m = enter_section_(b, l, _NONE_, HS_KIND_SIGNATURE, ""); + r = q_name(b, l + 1); r = r && consumeToken(b, HS_COLON_COLON); r = r && ttype(b, l + 1); - exit_section_(b, m, HS_KIND_SIGNATURE, r); + exit_section_(b, l, m, r, false, null); return r; } /* ********************************************************** */ - // PRAGMA_START onl "LANGUAGE" onl qcon (onl COMMA onl qcon?)* onl PRAGMA_END NEWLINE? + // PRAGMA_START onl "LANGUAGE" onl q_name (onl COMMA onl q_name?)* onl PRAGMA_END NEWLINE? public static boolean language_pragma(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "language_pragma")) return false; if (!nextTokenIs(b, HS_PRAGMA_START)) return false; @@ -4097,7 +4164,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { r = r && onl(b, l + 1); r = r && consumeToken(b, "LANGUAGE"); r = r && onl(b, l + 1); - r = r && qcon(b, l + 1); + r = r && q_name(b, l + 1); r = r && language_pragma_5(b, l + 1); r = r && onl(b, l + 1); r = r && consumeToken(b, HS_PRAGMA_END); @@ -4106,7 +4173,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (onl COMMA onl qcon?)* + // (onl COMMA onl q_name?)* private static boolean language_pragma_5(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "language_pragma_5")) return false; int c = current_position_(b); @@ -4118,7 +4185,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // onl COMMA onl qcon? + // onl COMMA onl q_name? private static boolean language_pragma_5_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "language_pragma_5_0")) return false; boolean r; @@ -4131,10 +4198,10 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // qcon? + // q_name? private static boolean language_pragma_5_0_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "language_pragma_5_0_3")) return false; - qcon(b, l + 1); + q_name(b, l + 1); return true; } @@ -4146,27 +4213,16 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // general_id+ osnl - public static boolean last_line_expression(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "last_line_expression")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_LAST_LINE_EXPRESSION, ""); - r = last_line_expression_0(b, l + 1); - r = r && osnl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - // general_id+ - private static boolean last_line_expression_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "last_line_expression_0")) return false; + static boolean last_line_expression(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "last_line_expression")) return false; boolean r; Marker m = enter_section_(b); r = general_id(b, l + 1); int c = current_position_(b); while (r) { if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "last_line_expression_0", c)) break; + if (!empty_element_parsed_guard_(b, "last_line_expression", c)) break; c = current_position_(b); } exit_section_(b, m, null, r); @@ -4174,40 +4230,27 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // NEWLINE* general_id+ snl - public static boolean line_expression(PsiBuilder b, int l) { + // general_id+ nls + static boolean line_expression(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "line_expression")) return false; boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_LINE_EXPRESSION, ""); + Marker m = enter_section_(b); r = line_expression_0(b, l + 1); - r = r && line_expression_1(b, l + 1); - r = r && snl(b, l + 1); - exit_section_(b, l, m, r, false, null); + r = r && nls(b, l + 1); + exit_section_(b, m, null, r); return r; } - // NEWLINE* + // general_id+ private static boolean line_expression_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "line_expression_0")) return false; - int c = current_position_(b); - while (true) { - if (!consumeToken(b, HS_NEWLINE)) break; - if (!empty_element_parsed_guard_(b, "line_expression_0", c)) break; - c = current_position_(b); - } - return true; - } - - // general_id+ - private static boolean line_expression_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "line_expression_1")) return false; boolean r; Marker m = enter_section_(b); r = general_id(b, l + 1); int c = current_position_(b); while (r) { if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "line_expression_1", c)) break; + if (!empty_element_parsed_guard_(b, "line_expression_0", c)) break; c = current_position_(b); } exit_section_(b, m, null, r); @@ -4231,7 +4274,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // LEFT_BRACKET (COLON_COLON | VARSYM_ID) RIGHT_BRACKET + // LEFT_BRACKET (COLON_COLON | q_name) RIGHT_BRACKET public static boolean list_type(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "list_type")) return false; if (!nextTokenIs(b, HS_LEFT_BRACKET)) return false; @@ -4244,30 +4287,30 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // COLON_COLON | VARSYM_ID + // COLON_COLON | q_name private static boolean list_type_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "list_type_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_COLON_COLON); - if (!r) r = consumeToken(b, HS_VARSYM_ID); + if (!r) r = q_name(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ // DECIMAL | HEXADECIMAL | OCTAL | FLOAT | CHARACTER_LITERAL | STRING_LITERAL - public static boolean literal(PsiBuilder b, int l) { + static boolean literal(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "literal")) return false; boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_LITERAL, ""); + Marker m = enter_section_(b); r = consumeToken(b, HS_DECIMAL); if (!r) r = consumeToken(b, HS_HEXADECIMAL); if (!r) r = consumeToken(b, HS_OCTAL); if (!r) r = consumeToken(b, HS_FLOAT); if (!r) r = consumeToken(b, HS_CHARACTER_LITERAL); if (!r) r = consumeToken(b, HS_STRING_LITERAL); - exit_section_(b, l, m, r, false, null); + exit_section_(b, m, null, r); return r; } @@ -4290,115 +4333,95 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // (CONID_ID DOT)+ CONID_ID | CONID_ID - public static boolean mod_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = mod_id_0(b, l + 1); - if (!r) r = consumeToken(b, HS_CONID_ID); - exit_section_(b, m, HS_MOD_ID, r); - return r; + // (CON_ID DOT)* CON_ID + public static boolean modid(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "modid")) return false; + boolean r, p; + Marker m = enter_section_(b, l, _NONE_, HS_MODID, ""); + r = modid_0(b, l + 1); + p = r; // pin = 1 + r = r && consumeToken(b, HS_CON_ID); + exit_section_(b, l, m, r, p, modid_recover_rule_parser_); + return r || p; } - // (CONID_ID DOT)+ CONID_ID - private static boolean mod_id_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = mod_id_0_0(b, l + 1); - r = r && consumeToken(b, HS_CONID_ID); - exit_section_(b, m, null, r); - return r; - } - - // (CONID_ID DOT)+ - private static boolean mod_id_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = mod_id_0_0_0(b, l + 1); + // (CON_ID DOT)* + private static boolean modid_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "modid_0")) return false; int c = current_position_(b); - while (r) { - if (!mod_id_0_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "mod_id_0_0", c)) break; + while (true) { + if (!modid_0_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "modid_0", c)) break; c = current_position_(b); } - exit_section_(b, m, null, r); - return r; + return true; } - // CONID_ID DOT - private static boolean mod_id_0_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id_0_0_0")) return false; + // CON_ID DOT + private static boolean modid_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "modid_0_0")) return false; boolean r; Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_CONID_ID, HS_DOT); + r = consumeTokens(b, 0, HS_CON_ID, HS_DOT); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // module_declaration+ onl body | body + // DOT + static boolean modid_recover_rule(PsiBuilder b, int l) { + return consumeToken(b, HS_DOT); + } + + /* ********************************************************** */ + // module_declaration onl body | onl body public static boolean module_body(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "module_body")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_MODULE_BODY, ""); r = module_body_0(b, l + 1); - if (!r) r = body(b, l + 1); + if (!r) r = module_body_1(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // module_declaration+ onl body + // module_declaration onl body private static boolean module_body_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "module_body_0")) return false; boolean r; Marker m = enter_section_(b); - r = module_body_0_0(b, l + 1); + r = module_declaration(b, l + 1); r = r && onl(b, l + 1); r = r && body(b, l + 1); exit_section_(b, m, null, r); return r; } - // module_declaration+ - private static boolean module_body_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_body_0_0")) return false; + // onl body + private static boolean module_body_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "module_body_1")) return false; boolean r; Marker m = enter_section_(b); - r = module_declaration(b, l + 1); - int c = current_position_(b); - while (r) { - if (!module_declaration(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "module_body_0_0", c)) break; - c = current_position_(b); - } + r = onl(b, l + 1); + r = r && body(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // MODULE mod_id onl deprecated_warn_pragma? onl WHERE? onl (onl exports)? onl WHERE? onl expression? onl + // MODULE modid onl deprecated_warn_pragma? onl (exports onl)? WHERE public static boolean module_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "module_declaration")) return false; if (!nextTokenIs(b, HS_MODULE)) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_MODULE); - r = r && mod_id(b, l + 1); + r = r && modid(b, l + 1); r = r && onl(b, l + 1); r = r && module_declaration_3(b, l + 1); r = r && onl(b, l + 1); r = r && module_declaration_5(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_declaration_7(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_declaration_9(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_declaration_11(b, l + 1); - r = r && onl(b, l + 1); + r = r && consumeToken(b, HS_WHERE); exit_section_(b, m, HS_MODULE_DECLARATION, r); return r; } @@ -4410,47 +4433,26 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - // WHERE? + // (exports onl)? private static boolean module_declaration_5(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "module_declaration_5")) return false; - consumeToken(b, HS_WHERE); + module_declaration_5_0(b, l + 1); return true; } - // (onl exports)? - private static boolean module_declaration_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_7")) return false; - module_declaration_7_0(b, l + 1); - return true; - } - - // onl exports - private static boolean module_declaration_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_7_0")) return false; + // exports onl + private static boolean module_declaration_5_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "module_declaration_5_0")) return false; boolean r; Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && exports(b, l + 1); + r = exports(b, l + 1); + r = r && onl(b, l + 1); exit_section_(b, m, null, r); return r; } - // WHERE? - private static boolean module_declaration_9(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_9")) return false; - consumeToken(b, HS_WHERE); - return true; - } - - // expression? - private static boolean module_declaration_11(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_11")) return false; - expression(b, l + 1); - return true; - } - /* ********************************************************** */ - // qcon atype | newconstr_fielddecl + // q_name atype | newconstr_fielddecl public static boolean newconstr(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "newconstr")) return false; boolean r; @@ -4461,33 +4463,33 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // qcon atype + // q_name atype private static boolean newconstr_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "newconstr_0")) return false; boolean r; Marker m = enter_section_(b); - r = qcon(b, l + 1); + r = q_name(b, l + 1); r = r && atype(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // qcon osnl LEFT_BRACE? osnl qvar osnl COLON_COLON osnl ttype osnl RIGHT_BRACE? + // q_name onls LEFT_BRACE? onls q_name onls COLON_COLON onls ttype onls RIGHT_BRACE? public static boolean newconstr_fielddecl(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "newconstr_fielddecl")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_NEWCONSTR_FIELDDECL, ""); - r = qcon(b, l + 1); - r = r && osnl(b, l + 1); + r = q_name(b, l + 1); + r = r && onls(b, l + 1); r = r && newconstr_fielddecl_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qvar(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && q_name(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && newconstr_fielddecl_10(b, l + 1); exit_section_(b, l, m, r, false, null); return r; @@ -4508,74 +4510,137 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // NEWTYPE osnl ctype_pragma? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl newconstr osnl (DERIVING osnl ttype)? + // NEWTYPE onls INSTANCE? onls ctype_pragma? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls EQUAL onls newconstr onls (DERIVING onls ttype)? public static boolean newtype_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "newtype_declaration")) return false; if (!nextTokenIs(b, HS_NEWTYPE)) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_NEWTYPE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && newtype_declaration_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && newtype_declaration_4(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && newtype_declaration_6(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && newconstr(b, l + 1); - r = r && osnl(b, l + 1); - r = r && newtype_declaration_12(b, l + 1); + r = r && onls(b, l + 1); + r = r && newtype_declaration_14(b, l + 1); exit_section_(b, m, HS_NEWTYPE_DECLARATION, r); return r; } - // ctype_pragma? + // INSTANCE? private static boolean newtype_declaration_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "newtype_declaration_2")) return false; + consumeToken(b, HS_INSTANCE); + return true; + } + + // ctype_pragma? + private static boolean newtype_declaration_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "newtype_declaration_4")) return false; ctype_pragma(b, l + 1); return true; } - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean newtype_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_4")) return false; - newtype_declaration_4_0(b, l + 1); + // (context onls DOUBLE_RIGHT_ARROW)? + private static boolean newtype_declaration_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "newtype_declaration_6")) return false; + newtype_declaration_6_0(b, l + 1); return true; } - // context osnl DOUBLE_RIGHT_ARROW - private static boolean newtype_declaration_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_4_0")) return false; + // context onls DOUBLE_RIGHT_ARROW + private static boolean newtype_declaration_6_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "newtype_declaration_6_0")) return false; boolean r; Marker m = enter_section_(b); r = context(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } - // (DERIVING osnl ttype)? - private static boolean newtype_declaration_12(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_12")) return false; - newtype_declaration_12_0(b, l + 1); + // (DERIVING onls ttype)? + private static boolean newtype_declaration_14(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "newtype_declaration_14")) return false; + newtype_declaration_14_0(b, l + 1); return true; } - // DERIVING osnl ttype - private static boolean newtype_declaration_12_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_12_0")) return false; + // DERIVING onls ttype + private static boolean newtype_declaration_14_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "newtype_declaration_14_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_DERIVING); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } + /* ********************************************************** */ + // LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE + static boolean nls(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "nls")) return false; + boolean r; + Marker m = enter_section_(b); + r = nls_0(b, l + 1); + r = r && nls_1(b, l + 1); + r = r && nls_2(b, l + 1); + r = r && nls_3(b, l + 1); + r = r && nls_4(b, l + 1); + r = r && consumeToken(b, HS_NEWLINE); + exit_section_(b, m, null, r); + return r; + } + + // LEFT_BRACE? + private static boolean nls_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "nls_0")) return false; + consumeToken(b, HS_LEFT_BRACE); + return true; + } + + // RIGHT_BRACE? + private static boolean nls_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "nls_1")) return false; + consumeToken(b, HS_RIGHT_BRACE); + return true; + } + + // SEMICOLON? + private static boolean nls_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "nls_2")) return false; + consumeToken(b, HS_SEMICOLON); + return true; + } + + // BACKSLASH? + private static boolean nls_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "nls_3")) return false; + consumeToken(b, HS_BACKSLASH); + return true; + } + + // &<> + private static boolean nls_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "nls_4")) return false; + boolean r; + Marker m = enter_section_(b, l, _AND_); + r = containsSpaces(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + /* ********************************************************** */ // PRAGMA_START onl ("NOINLINE" | "NOTINLINE") general_id+ PRAGMA_END public static boolean noinline_pragma(PsiBuilder b, int l) { @@ -4649,54 +4714,209 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // qvar_op | qcon_op - public static boolean op(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "op")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_OP, ""); - r = qvar_op(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // op (COMMA op)* - public static boolean ops(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ops")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_OPS, ""); - r = op(b, l + 1); - r = r && ops_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // (COMMA op)* - private static boolean ops_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ops_1")) return false; + // (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)* + static boolean onls(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "onls")) return false; int c = current_position_(b); while (true) { - if (!ops_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "ops_1", c)) break; + if (!onls_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "onls", c)) break; c = current_position_(b); } return true; } - // COMMA op - private static boolean ops_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ops_1_0")) return false; + // LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE + private static boolean onls_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "onls_0")) return false; boolean r; Marker m = enter_section_(b); - r = consumeToken(b, HS_COMMA); - r = r && op(b, l + 1); + r = onls_0_0(b, l + 1); + r = r && onls_0_1(b, l + 1); + r = r && onls_0_2(b, l + 1); + r = r && onls_0_3(b, l + 1); + r = r && onls_0_4(b, l + 1); + r = r && consumeToken(b, HS_NEWLINE); + exit_section_(b, m, null, r); + return r; + } + + // LEFT_BRACE? + private static boolean onls_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "onls_0_0")) return false; + consumeToken(b, HS_LEFT_BRACE); + return true; + } + + // RIGHT_BRACE? + private static boolean onls_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "onls_0_1")) return false; + consumeToken(b, HS_RIGHT_BRACE); + return true; + } + + // SEMICOLON? + private static boolean onls_0_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "onls_0_2")) return false; + consumeToken(b, HS_SEMICOLON); + return true; + } + + // BACKSLASH? + private static boolean onls_0_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "onls_0_3")) return false; + consumeToken(b, HS_BACKSLASH); + return true; + } + + // &<> + private static boolean onls_0_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "onls_0_4")) return false; + boolean r; + Marker m = enter_section_(b, l, _AND_); + r = containsSpaces(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + /* ********************************************************** */ + // (VAR_ID ("-" (VAR_ID | TYPE))* | ("-" (VAR_ID | TYPE))+ | "-" CON_ID) (EQUAL literal)? + public static boolean options_ghc_option(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, HS_OPTIONS_GHC_OPTION, ""); + r = options_ghc_option_0(b, l + 1); + r = r && options_ghc_option_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // VAR_ID ("-" (VAR_ID | TYPE))* | ("-" (VAR_ID | TYPE))+ | "-" CON_ID + private static boolean options_ghc_option_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = options_ghc_option_0_0(b, l + 1); + if (!r) r = options_ghc_option_0_1(b, l + 1); + if (!r) r = options_ghc_option_0_2(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // VAR_ID ("-" (VAR_ID | TYPE))* + private static boolean options_ghc_option_0_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_VAR_ID); + r = r && options_ghc_option_0_0_1(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // ("-" (VAR_ID | TYPE))* + private static boolean options_ghc_option_0_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_0_1")) return false; + int c = current_position_(b); + while (true) { + if (!options_ghc_option_0_0_1_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "options_ghc_option_0_0_1", c)) break; + c = current_position_(b); + } + return true; + } + + // "-" (VAR_ID | TYPE) + private static boolean options_ghc_option_0_0_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_0_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, "-"); + r = r && options_ghc_option_0_0_1_0_1(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // VAR_ID | TYPE + private static boolean options_ghc_option_0_0_1_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_0_1_0_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_VAR_ID); + if (!r) r = consumeToken(b, HS_TYPE); + exit_section_(b, m, null, r); + return r; + } + + // ("-" (VAR_ID | TYPE))+ + private static boolean options_ghc_option_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = options_ghc_option_0_1_0(b, l + 1); + int c = current_position_(b); + while (r) { + if (!options_ghc_option_0_1_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "options_ghc_option_0_1", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // "-" (VAR_ID | TYPE) + private static boolean options_ghc_option_0_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, "-"); + r = r && options_ghc_option_0_1_0_1(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // VAR_ID | TYPE + private static boolean options_ghc_option_0_1_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_1_0_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_VAR_ID); + if (!r) r = consumeToken(b, HS_TYPE); + exit_section_(b, m, null, r); + return r; + } + + // "-" CON_ID + private static boolean options_ghc_option_0_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_0_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, "-"); + r = r && consumeToken(b, HS_CON_ID); + exit_section_(b, m, null, r); + return r; + } + + // (EQUAL literal)? + private static boolean options_ghc_option_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_1")) return false; + options_ghc_option_1_0(b, l + 1); + return true; + } + + // EQUAL literal + private static boolean options_ghc_option_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_option_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_EQUAL); + r = r && literal(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // PRAGMA_START onl ("OPTIONS_GHC" | "OPTIONS") general_pragma_content PRAGMA_END NEWLINE? + // PRAGMA_START onl ("OPTIONS_GHC" | "OPTIONS") onl options_ghc_option+ onl PRAGMA_END NEWLINE? public static boolean options_ghc_pragma(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "options_ghc_pragma")) return false; if (!nextTokenIs(b, HS_PRAGMA_START)) return false; @@ -4705,9 +4925,11 @@ public class HaskellParser implements PsiParser, LightPsiParser { r = consumeToken(b, HS_PRAGMA_START); r = r && onl(b, l + 1); r = r && options_ghc_pragma_2(b, l + 1); - r = r && general_pragma_content(b, l + 1); + r = r && onl(b, l + 1); + r = r && options_ghc_pragma_4(b, l + 1); + r = r && onl(b, l + 1); r = r && consumeToken(b, HS_PRAGMA_END); - r = r && options_ghc_pragma_5(b, l + 1); + r = r && options_ghc_pragma_7(b, l + 1); exit_section_(b, m, HS_OPTIONS_GHC_PRAGMA, r); return r; } @@ -4723,79 +4945,29 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // NEWLINE? - private static boolean options_ghc_pragma_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "options_ghc_pragma_5")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)* - static boolean osnl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl")) return false; - int c = current_position_(b); - while (true) { - if (!osnl_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "osnl", c)) break; - c = current_position_(b); - } - return true; - } - - // LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE - private static boolean osnl_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0")) return false; + // options_ghc_option+ + private static boolean options_ghc_pragma_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_pragma_4")) return false; boolean r; Marker m = enter_section_(b); - r = osnl_0_0(b, l + 1); - r = r && osnl_0_1(b, l + 1); - r = r && osnl_0_2(b, l + 1); - r = r && osnl_0_3(b, l + 1); - r = r && osnl_0_4(b, l + 1); - r = r && consumeToken(b, HS_NEWLINE); + r = options_ghc_option(b, l + 1); + int c = current_position_(b); + while (r) { + if (!options_ghc_option(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "options_ghc_pragma_4", c)) break; + c = current_position_(b); + } exit_section_(b, m, null, r); return r; } - // LEFT_BRACE? - private static boolean osnl_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_0")) return false; - consumeToken(b, HS_LEFT_BRACE); + // NEWLINE? + private static boolean options_ghc_pragma_7(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "options_ghc_pragma_7")) return false; + consumeToken(b, HS_NEWLINE); return true; } - // RIGHT_BRACE? - private static boolean osnl_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_1")) return false; - consumeToken(b, HS_RIGHT_BRACE); - return true; - } - - // SEMICOLON? - private static boolean osnl_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_2")) return false; - consumeToken(b, HS_SEMICOLON); - return true; - } - - // BACKSLASH? - private static boolean osnl_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_3")) return false; - consumeToken(b, HS_BACKSLASH); - return true; - } - - // &<> - private static boolean osnl_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_4")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = containsSpaces(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - /* ********************************************************** */ // ann_pragma | deprecated_warn_pragma | noinline_pragma | inlinable_pragma | line_pragma | rules_pragma | // specialize_pragma | inline_pragma | minimal_pragma | overlap_pragma | constant_folded_pragma | dummy_pragma @@ -4878,136 +5050,285 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // qcon_id | LEFT_PAREN gcon_sym RIGHT_PAREN | con_id | LEFT_PAREN con_sym RIGHT_PAREN - public static boolean qcon(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon")) return false; + // q_con_qualifier4 DOT conid | q_con_qualifier3 DOT conid | q_con_qualifier2 DOT conid | q_con_qualifier1 DOT conid + public static boolean q_con(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QCON, ""); - r = qcon_id(b, l + 1); - if (!r) r = qcon_1(b, l + 1); - if (!r) r = con_id(b, l + 1); - if (!r) r = qcon_3(b, l + 1); + Marker m = enter_section_(b); + r = q_con_0(b, l + 1); + if (!r) r = q_con_1(b, l + 1); + if (!r) r = q_con_2(b, l + 1); + if (!r) r = q_con_3(b, l + 1); + exit_section_(b, m, HS_Q_CON, r); + return r; + } + + // q_con_qualifier4 DOT conid + private static boolean q_con_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_con_qualifier4(b, l + 1); + r = r && consumeToken(b, HS_DOT); + r = r && conid(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // q_con_qualifier3 DOT conid + private static boolean q_con_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_con_qualifier3(b, l + 1); + r = r && consumeToken(b, HS_DOT); + r = r && conid(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // q_con_qualifier2 DOT conid + private static boolean q_con_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_con_qualifier2(b, l + 1); + r = r && consumeToken(b, HS_DOT); + r = r && conid(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // q_con_qualifier1 DOT conid + private static boolean q_con_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_3")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_con_qualifier1(b, l + 1); + r = r && consumeToken(b, HS_DOT); + r = r && conid(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // q_con_qualifier4 | q_con_qualifier3 | q_con_qualifier2 | q_con_qualifier1 + public static boolean q_con_qualifier(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_qualifier")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = q_con_qualifier4(b, l + 1); + if (!r) r = q_con_qualifier3(b, l + 1); + if (!r) r = q_con_qualifier2(b, l + 1); + if (!r) r = q_con_qualifier1(b, l + 1); + exit_section_(b, m, HS_Q_CON_QUALIFIER, r); + return r; + } + + /* ********************************************************** */ + // CON_ID + public static boolean q_con_qualifier1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_qualifier1")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_CON_ID); + exit_section_(b, m, HS_Q_CON_QUALIFIER_1, r); + return r; + } + + /* ********************************************************** */ + // CON_ID DOT CON_ID + public static boolean q_con_qualifier2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_qualifier2")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeTokens(b, 0, HS_CON_ID, HS_DOT, HS_CON_ID); + exit_section_(b, m, HS_Q_CON_QUALIFIER_2, r); + return r; + } + + /* ********************************************************** */ + // CON_ID DOT CON_ID DOT CON_ID + public static boolean q_con_qualifier3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_qualifier3")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeTokens(b, 0, HS_CON_ID, HS_DOT, HS_CON_ID, HS_DOT, HS_CON_ID); + exit_section_(b, m, HS_Q_CON_QUALIFIER_3, r); + return r; + } + + /* ********************************************************** */ + // CON_ID DOT CON_ID DOT CON_ID DOT CON_ID + public static boolean q_con_qualifier4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_con_qualifier4")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeTokens(b, 0, HS_CON_ID, HS_DOT, HS_CON_ID, HS_DOT, HS_CON_ID, HS_DOT, HS_CON_ID); + exit_section_(b, m, HS_Q_CON_QUALIFIER_4, r); + return r; + } + + /* ********************************************************** */ + // q_var_con | var_con | LEFT_PAREN q_var_con RIGHT_PAREN | LEFT_PAREN var_con RIGHT_PAREN | BACKQUOTE q_var_con BACKQUOTE | BACKQUOTE var_con BACKQUOTE + public static boolean q_name(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_name")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, HS_Q_NAME, ""); + r = q_var_con(b, l + 1); + if (!r) r = var_con(b, l + 1); + if (!r) r = q_name_2(b, l + 1); + if (!r) r = q_name_3(b, l + 1); + if (!r) r = q_name_4(b, l + 1); + if (!r) r = q_name_5(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // LEFT_PAREN gcon_sym RIGHT_PAREN - private static boolean qcon_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_1")) return false; + // LEFT_PAREN q_var_con RIGHT_PAREN + private static boolean q_name_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_name_2")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && gcon_sym(b, l + 1); + r = r && q_var_con(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // LEFT_PAREN con_sym RIGHT_PAREN - private static boolean qcon_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_3")) return false; + // LEFT_PAREN var_con RIGHT_PAREN + private static boolean q_name_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_name_3")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); - r = r && con_sym(b, l + 1); + r = r && var_con(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - /* ********************************************************** */ - // qcon_id_qualifier con_id - public static boolean qcon_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_id")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; + // BACKQUOTE q_var_con BACKQUOTE + private static boolean q_name_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_name_4")) return false; boolean r; Marker m = enter_section_(b); - r = qcon_id_qualifier(b, l + 1); - r = r && con_id(b, l + 1); - exit_section_(b, m, HS_QCON_ID, r); + r = consumeToken(b, HS_BACKQUOTE); + r = r && q_var_con(b, l + 1); + r = r && consumeToken(b, HS_BACKQUOTE); + exit_section_(b, m, null, r); + return r; + } + + // BACKQUOTE var_con BACKQUOTE + private static boolean q_name_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_name_5")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_BACKQUOTE); + r = r && var_con(b, l + 1); + r = r && consumeToken(b, HS_BACKQUOTE); + exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // (CONID_ID DOT)+ - public static boolean qcon_id_qualifier(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_id_qualifier")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; + // q_name (COMMA q_name)* + public static boolean q_names(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_names")) return false; boolean r; - Marker m = enter_section_(b); - r = qcon_id_qualifier_0(b, l + 1); + Marker m = enter_section_(b, l, _NONE_, HS_Q_NAMES, ""); + r = q_name(b, l + 1); + r = r && q_names_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // (COMMA q_name)* + private static boolean q_names_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_names_1")) return false; int c = current_position_(b); - while (r) { - if (!qcon_id_qualifier_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "qcon_id_qualifier", c)) break; + while (true) { + if (!q_names_1_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "q_names_1", c)) break; c = current_position_(b); } - exit_section_(b, m, HS_QCON_ID_QUALIFIER, r); - return r; + return true; } - // CONID_ID DOT - private static boolean qcon_id_qualifier_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_id_qualifier_0")) return false; + // COMMA q_name + private static boolean q_names_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_names_1_0")) return false; boolean r; Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_CONID_ID, HS_DOT); + r = consumeToken(b, HS_COMMA); + r = r && q_name(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // gcon_sym | BACKQUOTE qcon_id BACKQUOTE | con_sym | BACKQUOTE con_id BACKQUOTE - public static boolean qcon_op(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_op")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QCON_OP, ""); - r = gcon_sym(b, l + 1); - if (!r) r = qcon_op_1(b, l + 1); - if (!r) r = con_sym(b, l + 1); - if (!r) r = qcon_op_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // BACKQUOTE qcon_id BACKQUOTE - private static boolean qcon_op_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_op_1")) return false; + // qualifier DOT (varid | consym | DOT? varsym) | q_con + public static boolean q_var_con(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_var_con")) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; boolean r; Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && qcon_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); + r = q_var_con_0(b, l + 1); + if (!r) r = q_con(b, l + 1); + exit_section_(b, m, HS_Q_VAR_CON, r); return r; } - // BACKQUOTE con_id BACKQUOTE - private static boolean qcon_op_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_op_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && con_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qualifier DOT con_sym - public static boolean qcon_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_sym")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; + // qualifier DOT (varid | consym | DOT? varsym) + private static boolean q_var_con_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_var_con_0")) return false; boolean r; Marker m = enter_section_(b); r = qualifier(b, l + 1); r = r && consumeToken(b, HS_DOT); - r = r && con_sym(b, l + 1); - exit_section_(b, m, HS_QCON_SYM, r); + r = r && q_var_con_0_2(b, l + 1); + exit_section_(b, m, null, r); return r; } + // varid | consym | DOT? varsym + private static boolean q_var_con_0_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_var_con_0_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = varid(b, l + 1); + if (!r) r = consym(b, l + 1); + if (!r) r = q_var_con_0_2_2(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // DOT? varsym + private static boolean q_var_con_0_2_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_var_con_0_2_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_var_con_0_2_2_0(b, l + 1); + r = r && varsym(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // DOT? + private static boolean q_var_con_0_2_2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "q_var_con_0_2_2_0")) return false; + consumeToken(b, HS_DOT); + return true; + } + /* ********************************************************** */ // general_id+ NEWLINE? quasi_quote public static boolean qq_expression(PsiBuilder b, int l) { @@ -5045,51 +5366,36 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // (CONID_ID DOT)+ CONID_ID | CONID_ID + // CON_ID (DOT CON_ID)* public static boolean qualifier(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "qualifier")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; + if (!nextTokenIs(b, HS_CON_ID)) return false; boolean r; Marker m = enter_section_(b); - r = qualifier_0(b, l + 1); - if (!r) r = consumeToken(b, HS_CONID_ID); + r = consumeToken(b, HS_CON_ID); + r = r && qualifier_1(b, l + 1); exit_section_(b, m, HS_QUALIFIER, r); return r; } - // (CONID_ID DOT)+ CONID_ID - private static boolean qualifier_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qualifier_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier_0_0(b, l + 1); - r = r && consumeToken(b, HS_CONID_ID); - exit_section_(b, m, null, r); - return r; - } - - // (CONID_ID DOT)+ - private static boolean qualifier_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qualifier_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier_0_0_0(b, l + 1); + // (DOT CON_ID)* + private static boolean qualifier_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "qualifier_1")) return false; int c = current_position_(b); - while (r) { - if (!qualifier_0_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "qualifier_0_0", c)) break; + while (true) { + if (!qualifier_1_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "qualifier_1", c)) break; c = current_position_(b); } - exit_section_(b, m, null, r); - return r; + return true; } - // CONID_ID DOT - private static boolean qualifier_0_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qualifier_0_0_0")) return false; + // DOT CON_ID + private static boolean qualifier_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "qualifier_1_0")) return false; boolean r; Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_CONID_ID, HS_DOT); + r = consumeTokens(b, 0, HS_DOT, HS_CON_ID); exit_section_(b, m, null, r); return r; } @@ -5253,110 +5559,6 @@ public class HaskellParser implements PsiParser, LightPsiParser { return true; } - /* ********************************************************** */ - // qvar_id | LEFT_PAREN qvar_sym RIGHT_PAREN | var_id | LEFT_PAREN var_sym RIGHT_PAREN - public static boolean qvar(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QVAR, ""); - r = qvar_id(b, l + 1); - if (!r) r = qvar_1(b, l + 1); - if (!r) r = var_id(b, l + 1); - if (!r) r = qvar_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_PAREN qvar_sym RIGHT_PAREN - private static boolean qvar_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && qvar_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN var_sym RIGHT_PAREN - private static boolean qvar_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && var_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qualifier DOT var_id - public static boolean qvar_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_id")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier(b, l + 1); - r = r && consumeToken(b, HS_DOT); - r = r && var_id(b, l + 1); - exit_section_(b, m, HS_QVAR_ID, r); - return r; - } - - /* ********************************************************** */ - // qvar_sym | BACKQUOTE qvar_id BACKQUOTE | var_sym | BACKQUOTE var_id BACKQUOTE - public static boolean qvar_op(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_op")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QVAR_OP, ""); - r = qvar_sym(b, l + 1); - if (!r) r = qvar_op_1(b, l + 1); - if (!r) r = var_sym(b, l + 1); - if (!r) r = qvar_op_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // BACKQUOTE qvar_id BACKQUOTE - private static boolean qvar_op_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_op_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && qvar_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); - return r; - } - - // BACKQUOTE var_id BACKQUOTE - private static boolean qvar_op_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_op_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && var_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qualifier DOT var_sym - public static boolean qvar_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_sym")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier(b, l + 1); - r = r && consumeToken(b, HS_DOT); - r = r && var_sym(b, l + 1); - exit_section_(b, m, HS_QVAR_SYM, r); - return r; - } - /* ********************************************************** */ // PRAGMA_START onl "RULES" general_pragma_content PRAGMA_END public static boolean rules_pragma(PsiBuilder b, int l) { @@ -5374,219 +5576,158 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // simpleclass? osnl LEFT_PAREN osnl simpleclass (osnl COMMA osnl simpleclass)* osnl RIGHT_PAREN | - // simpleclass + // PRAGMA_START onl "SCC" onl general_pragma_content onl PRAGMA_END + public static boolean scc_pragma(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "scc_pragma")) return false; + if (!nextTokenIs(b, HS_PRAGMA_START)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_PRAGMA_START); + r = r && onl(b, l + 1); + r = r && consumeToken(b, "SCC"); + r = r && onl(b, l + 1); + r = r && general_pragma_content(b, l + 1); + r = r && onl(b, l + 1); + r = r && consumeToken(b, HS_PRAGMA_END); + exit_section_(b, m, HS_SCC_PRAGMA, r); + return r; + } + + /* ********************************************************** */ + // simpleclass | simpleclass onls LEFT_PAREN onls simpleclass (onls COMMA onls simpleclass)* onls RIGHT_PAREN public static boolean scontext(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "scontext")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_SCONTEXT, ""); - r = scontext_0(b, l + 1); - if (!r) r = simpleclass(b, l + 1); + r = simpleclass(b, l + 1); + if (!r) r = scontext_1(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // simpleclass? osnl LEFT_PAREN osnl simpleclass (osnl COMMA osnl simpleclass)* osnl RIGHT_PAREN - private static boolean scontext_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0")) return false; + // simpleclass onls LEFT_PAREN onls simpleclass (onls COMMA onls simpleclass)* onls RIGHT_PAREN + private static boolean scontext_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "scontext_1")) return false; boolean r; Marker m = enter_section_(b); - r = scontext_0_0(b, l + 1); - r = r && osnl(b, l + 1); + r = simpleclass(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpleclass(b, l + 1); - r = r && scontext_0_5(b, l + 1); - r = r && osnl(b, l + 1); + r = r && scontext_1_5(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; } - // simpleclass? - private static boolean scontext_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0_0")) return false; - simpleclass(b, l + 1); - return true; - } - - // (osnl COMMA osnl simpleclass)* - private static boolean scontext_0_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0_5")) return false; + // (onls COMMA onls simpleclass)* + private static boolean scontext_1_5(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "scontext_1_5")) return false; int c = current_position_(b); while (true) { - if (!scontext_0_5_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "scontext_0_5", c)) break; + if (!scontext_1_5_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "scontext_1_5", c)) break; c = current_position_(b); } return true; } - // osnl COMMA osnl simpleclass - private static boolean scontext_0_5_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0_5_0")) return false; + // onls COMMA onls simpleclass + private static boolean scontext_1_5_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "scontext_1_5_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpleclass(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // simpleclass_tilde_part TILDE simpleclass_tilde_part | - // LEFT_PAREN simpleclass_tilde_part TILDE simpleclass_tilde_part RIGHT_PAREN | - // qcon+ LEFT_PAREN (qvar | qcon_op | qcon)+ RIGHT_PAREN qvar* | - // qcon+ qvar+ | - // atype + // ttype | q_name+ LEFT_PAREN q_name+ RIGHT_PAREN q_name* | q_name+ public static boolean simpleclass(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "simpleclass")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_SIMPLECLASS, ""); - r = simpleclass_0(b, l + 1); + r = ttype(b, l + 1); if (!r) r = simpleclass_1(b, l + 1); if (!r) r = simpleclass_2(b, l + 1); - if (!r) r = simpleclass_3(b, l + 1); - if (!r) r = atype(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // simpleclass_tilde_part TILDE simpleclass_tilde_part - private static boolean simpleclass_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_tilde_part(b, l + 1); - r = r && consumeToken(b, HS_TILDE); - r = r && simpleclass_tilde_part(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN simpleclass_tilde_part TILDE simpleclass_tilde_part RIGHT_PAREN + // q_name+ LEFT_PAREN q_name+ RIGHT_PAREN q_name* private static boolean simpleclass_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "simpleclass_1")) return false; boolean r; Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && simpleclass_tilde_part(b, l + 1); - r = r && consumeToken(b, HS_TILDE); - r = r && simpleclass_tilde_part(b, l + 1); + r = simpleclass_1_0(b, l + 1); + r = r && consumeToken(b, HS_LEFT_PAREN); + r = r && simpleclass_1_2(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); + r = r && simpleclass_1_4(b, l + 1); exit_section_(b, m, null, r); return r; } - // qcon+ LEFT_PAREN (qvar | qcon_op | qcon)+ RIGHT_PAREN qvar* + // q_name+ + private static boolean simpleclass_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpleclass_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpleclass_1_0", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // q_name+ + private static boolean simpleclass_1_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpleclass_1_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + int c = current_position_(b); + while (r) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpleclass_1_2", c)) break; + c = current_position_(b); + } + exit_section_(b, m, null, r); + return r; + } + + // q_name* + private static boolean simpleclass_1_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpleclass_1_4")) return false; + int c = current_position_(b); + while (true) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpleclass_1_4", c)) break; + c = current_position_(b); + } + return true; + } + + // q_name+ private static boolean simpleclass_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "simpleclass_2")) return false; boolean r; Marker m = enter_section_(b); - r = simpleclass_2_0(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && simpleclass_2_2(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - r = r && simpleclass_2_4(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qcon+ - private static boolean simpleclass_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); + r = q_name(b, l + 1); int c = current_position_(b); while (r) { - if (!qcon(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_2_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // (qvar | qcon_op | qcon)+ - private static boolean simpleclass_2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_2_2_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!simpleclass_2_2_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_2_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qvar | qcon_op | qcon - private static boolean simpleclass_2_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - if (!r) r = qcon(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar* - private static boolean simpleclass_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_4")) return false; - int c = current_position_(b); - while (true) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_2_4", c)) break; - c = current_position_(b); - } - return true; - } - - // qcon+ qvar+ - private static boolean simpleclass_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_3_0(b, l + 1); - r = r && simpleclass_3_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qcon+ - private static boolean simpleclass_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qcon(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_3_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qvar+ - private static boolean simpleclass_3_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_3_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_3_1", c)) break; + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpleclass_2", c)) break; c = current_position_(b); } exit_section_(b, m, null, r); @@ -5594,282 +5735,130 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // QUOTE? ((qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? qvar+ | qcon qvar*) - public static boolean simpleclass_tilde_part(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SIMPLECLASS_TILDE_PART, ""); - r = simpleclass_tilde_part_0(b, l + 1); - r = r && simpleclass_tilde_part_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // QUOTE? - private static boolean simpleclass_tilde_part_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_0")) return false; - consumeToken(b, HS_QUOTE); - return true; - } - - // (qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? qvar+ | qcon qvar* - private static boolean simpleclass_tilde_part_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_tilde_part_1_0(b, l + 1); - if (!r) r = simpleclass_tilde_part_1_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? qvar+ - private static boolean simpleclass_tilde_part_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_tilde_part_1_0_0(b, l + 1); - r = r && simpleclass_tilde_part_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? - private static boolean simpleclass_tilde_part_1_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0_0")) return false; - simpleclass_tilde_part_1_0_0_0(b, l + 1); - return true; - } - - // qcon LEFT_PAREN qcon qvar RIGHT_PAREN - private static boolean simpleclass_tilde_part_1_0_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && qcon(b, l + 1); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // qvar+ - private static boolean simpleclass_tilde_part_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_tilde_part_1_0_1", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qcon qvar* - private static boolean simpleclass_tilde_part_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && simpleclass_tilde_part_1_1_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar* - private static boolean simpleclass_tilde_part_1_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_1_1")) return false; - int c = current_position_(b); - while (true) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_tilde_part_1_1_1", c)) break; - c = current_position_(b); - } - return true; - } - - /* ********************************************************** */ - // qcon_op var_id* | - // qcon var_id* | - // ttype | - // var_id* osnl (LEFT_PAREN qvar_op RIGHT_PAREN | LEFT_PAREN gcon_sym RIGHT_PAREN) osnl var_id* | - // qcon osnl var_id* osnl (LEFT_PAREN type_signature RIGHT_PAREN)+ osnl var_id* + // ttype | (q_name | LEFT_PAREN RIGHT_PAREN)+ | + // q_name* onls LEFT_PAREN q_name RIGHT_PAREN onls q_name* | + // q_name onls q_name* onls (LEFT_PAREN type_signature RIGHT_PAREN)+ onls q_name* | + // q_name | LEFT_PAREN RIGHT_PAREN | LEFT_BRACKET RIGHT_BRACKET q_name* public static boolean simpletype(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "simpletype")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, HS_SIMPLETYPE, ""); - r = simpletype_0(b, l + 1); + r = ttype(b, l + 1); if (!r) r = simpletype_1(b, l + 1); - if (!r) r = ttype(b, l + 1); + if (!r) r = simpletype_2(b, l + 1); if (!r) r = simpletype_3(b, l + 1); - if (!r) r = simpletype_4(b, l + 1); + if (!r) r = q_name(b, l + 1); + if (!r) r = parseTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_PAREN); + if (!r) r = simpletype_6(b, l + 1); exit_section_(b, l, m, r, false, null); return r; } - // qcon_op var_id* - private static boolean simpletype_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon_op(b, l + 1); - r = r && simpletype_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_0_1")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_0_1", c)) break; - c = current_position_(b); - } - return true; - } - - // qcon var_id* + // (q_name | LEFT_PAREN RIGHT_PAREN)+ private static boolean simpletype_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "simpletype_1")) return false; boolean r; Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && simpletype_1_1(b, l + 1); + r = simpletype_1_0(b, l + 1); + int c = current_position_(b); + while (r) { + if (!simpletype_1_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpletype_1", c)) break; + c = current_position_(b); + } exit_section_(b, m, null, r); return r; } - // var_id* - private static boolean simpletype_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_1_1")) return false; + // q_name | LEFT_PAREN RIGHT_PAREN + private static boolean simpletype_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_1_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = q_name(b, l + 1); + if (!r) r = parseTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_PAREN); + exit_section_(b, m, null, r); + return r; + } + + // q_name* onls LEFT_PAREN q_name RIGHT_PAREN onls q_name* + private static boolean simpletype_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_2")) return false; + boolean r; + Marker m = enter_section_(b); + r = simpletype_2_0(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_LEFT_PAREN); + r = r && q_name(b, l + 1); + r = r && consumeToken(b, HS_RIGHT_PAREN); + r = r && onls(b, l + 1); + r = r && simpletype_2_6(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + + // q_name* + private static boolean simpletype_2_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_2_0")) return false; int c = current_position_(b); while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_1_1", c)) break; + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpletype_2_0", c)) break; c = current_position_(b); } return true; } - // var_id* osnl (LEFT_PAREN qvar_op RIGHT_PAREN | LEFT_PAREN gcon_sym RIGHT_PAREN) osnl var_id* + // q_name* + private static boolean simpletype_2_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_2_6")) return false; + int c = current_position_(b); + while (true) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpletype_2_6", c)) break; + c = current_position_(b); + } + return true; + } + + // q_name onls q_name* onls (LEFT_PAREN type_signature RIGHT_PAREN)+ onls q_name* private static boolean simpletype_3(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "simpletype_3")) return false; boolean r; Marker m = enter_section_(b); - r = simpletype_3_0(b, l + 1); - r = r && osnl(b, l + 1); + r = q_name(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype_3_2(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype_3_4(b, l + 1); + r = r && onls(b, l + 1); + r = r && simpletype_3_6(b, l + 1); exit_section_(b, m, null, r); return r; } - // var_id* - private static boolean simpletype_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_3_0")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_3_0", c)) break; - c = current_position_(b); - } - return true; - } - - // LEFT_PAREN qvar_op RIGHT_PAREN | LEFT_PAREN gcon_sym RIGHT_PAREN + // q_name* private static boolean simpletype_3_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "simpletype_3_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype_3_2_0(b, l + 1); - if (!r) r = simpletype_3_2_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN qvar_op RIGHT_PAREN - private static boolean simpletype_3_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_3_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && qvar_op(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN gcon_sym RIGHT_PAREN - private static boolean simpletype_3_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_3_2_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && gcon_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_3_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_3_4")) return false; int c = current_position_(b); while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_3_4", c)) break; - c = current_position_(b); - } - return true; - } - - // qcon osnl var_id* osnl (LEFT_PAREN type_signature RIGHT_PAREN)+ osnl var_id* - private static boolean simpletype_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_4_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_4_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_4_6(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_2")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_4_2", c)) break; + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpletype_3_2", c)) break; c = current_position_(b); } return true; } // (LEFT_PAREN type_signature RIGHT_PAREN)+ - private static boolean simpletype_4_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_4")) return false; + private static boolean simpletype_3_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_3_4")) return false; boolean r; Marker m = enter_section_(b); - r = simpletype_4_4_0(b, l + 1); + r = simpletype_3_4_0(b, l + 1); int c = current_position_(b); while (r) { - if (!simpletype_4_4_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_4_4", c)) break; + if (!simpletype_3_4_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpletype_3_4", c)) break; c = current_position_(b); } exit_section_(b, m, null, r); @@ -5877,8 +5866,8 @@ public class HaskellParser implements PsiParser, LightPsiParser { } // LEFT_PAREN type_signature RIGHT_PAREN - private static boolean simpletype_4_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_4_0")) return false; + private static boolean simpletype_3_4_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_3_4_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_LEFT_PAREN); @@ -5888,88 +5877,41 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // var_id* - private static boolean simpletype_4_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_6")) return false; + // q_name* + private static boolean simpletype_3_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_3_6")) return false; int c = current_position_(b); while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_4_6", c)) break; + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpletype_3_6", c)) break; c = current_position_(b); } return true; } - /* ********************************************************** */ - // (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)+ - public static boolean snl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SNL, ""); - r = snl_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!snl_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "snl", c)) break; - c = current_position_(b); - } - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE - private static boolean snl_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0")) return false; + // LEFT_BRACKET RIGHT_BRACKET q_name* + private static boolean simpletype_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_6")) return false; boolean r; Marker m = enter_section_(b); - r = snl_0_0(b, l + 1); - r = r && snl_0_1(b, l + 1); - r = r && snl_0_2(b, l + 1); - r = r && snl_0_3(b, l + 1); - r = r && snl_0_4(b, l + 1); - r = r && consumeToken(b, HS_NEWLINE); + r = consumeTokens(b, 0, HS_LEFT_BRACKET, HS_RIGHT_BRACKET); + r = r && simpletype_6_2(b, l + 1); exit_section_(b, m, null, r); return r; } - // LEFT_BRACE? - private static boolean snl_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_0")) return false; - consumeToken(b, HS_LEFT_BRACE); + // q_name* + private static boolean simpletype_6_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "simpletype_6_2")) return false; + int c = current_position_(b); + while (true) { + if (!q_name(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "simpletype_6_2", c)) break; + c = current_position_(b); + } return true; } - // RIGHT_BRACE? - private static boolean snl_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_1")) return false; - consumeToken(b, HS_RIGHT_BRACE); - return true; - } - - // SEMICOLON? - private static boolean snl_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_2")) return false; - consumeToken(b, HS_SEMICOLON); - return true; - } - - // BACKSLASH? - private static boolean snl_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_3")) return false; - consumeToken(b, HS_BACKSLASH); - return true; - } - - // &<> - private static boolean snl_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_4")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = containsSpaces(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - /* ********************************************************** */ // PRAGMA_START onl "SOURCE" onl PRAGMA_END public static boolean source_pragma(PsiBuilder b, int l) { @@ -6014,7 +5956,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // btype | qvar_op atype + // btype | q_name atype public static boolean sub_constr2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "sub_constr2")) return false; boolean r; @@ -6025,19 +5967,19 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // qvar_op atype + // q_name atype private static boolean sub_constr2_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "sub_constr2_1")) return false; boolean r; Marker m = enter_section_(b); - r = qvar_op(b, l + 1); + r = q_name(b, l + 1); r = r && atype(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // AT | BACKSLASH | VERTICAL_BAR | TILDE | EQUAL | COLON + // AT | BACKSLASH | VERTICAL_BAR | TILDE | EQUAL static boolean symbol_reserved_op(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "symbol_reserved_op")) return false; boolean r; @@ -6047,7 +5989,6 @@ public class HaskellParser implements PsiParser, LightPsiParser { if (!r) r = consumeToken(b, HS_VERTICAL_BAR); if (!r) r = consumeToken(b, HS_TILDE); if (!r) r = consumeToken(b, HS_EQUAL); - if (!r) r = consumeToken(b, HS_COLON); exit_section_(b, m, null, r); return r; } @@ -6106,7 +6047,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // btype (osnl RIGHT_ARROW osnl ttype)? | list_type var_id* + // btype (onls RIGHT_ARROW onls ttype)? | list_type q_name* public static boolean ttype(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "ttype")) return false; boolean r; @@ -6117,7 +6058,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // btype (osnl RIGHT_ARROW osnl ttype)? + // btype (onls RIGHT_ARROW onls ttype)? private static boolean ttype_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "ttype_0")) return false; boolean r; @@ -6128,27 +6069,27 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (osnl RIGHT_ARROW osnl ttype)? + // (onls RIGHT_ARROW onls ttype)? private static boolean ttype_0_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "ttype_0_1")) return false; ttype_0_1_0(b, l + 1); return true; } - // osnl RIGHT_ARROW osnl ttype + // onls RIGHT_ARROW onls ttype private static boolean ttype_0_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "ttype_0_1_0")) return false; boolean r; Marker m = enter_section_(b); - r = osnl(b, l + 1); + r = onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_ARROW); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } - // list_type var_id* + // list_type q_name* private static boolean ttype_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "ttype_1")) return false; boolean r; @@ -6159,12 +6100,12 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // var_id* + // q_name* private static boolean ttype_1_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "ttype_1_1")) return false; int c = current_position_(b); while (true) { - if (!var_id(b, l + 1)) break; + if (!q_name(b, l + 1)) break; if (!empty_element_parsed_guard_(b, "ttype_1_1", c)) break; c = current_position_(b); } @@ -6172,12 +6113,11 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // TYPE osnl simpletype osnl COLON_COLON osnl ttype | - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl ttype (DOUBLE_RIGHT_ARROW ttype)? | - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl type_signature (DOUBLE_RIGHT_ARROW ttype)? | - // TYPE osnl simpletype osnl EQUAL osnl expression | - // TYPE osnl simpletype osnl LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN EQUAL osnl ttype | - // TYPE osnl simpletype + // TYPE onls simpletype onls COLON_COLON onls ttype | + // TYPE onls simpletype onls (EQUAL | WHERE) onls (ttype | type_signature) (DOUBLE_RIGHT_ARROW ttype)? | + // TYPE onls simpletype onls EQUAL onls expression | + // TYPE onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls EQUAL onls ttype | + // TYPE onls simpletype public static boolean type_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_declaration")) return false; if (!nextTokenIs(b, HS_TYPE)) return false; @@ -6188,39 +6128,38 @@ public class HaskellParser implements PsiParser, LightPsiParser { if (!r) r = type_declaration_2(b, l + 1); if (!r) r = type_declaration_3(b, l + 1); if (!r) r = type_declaration_4(b, l + 1); - if (!r) r = type_declaration_5(b, l + 1); exit_section_(b, m, HS_TYPE_DECLARATION, r); return r; } - // TYPE osnl simpletype osnl COLON_COLON osnl ttype + // TYPE onls simpletype onls COLON_COLON onls ttype private static boolean type_declaration_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_declaration_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl ttype (DOUBLE_RIGHT_ARROW ttype)? + // TYPE onls simpletype onls (EQUAL | WHERE) onls (ttype | type_signature) (DOUBLE_RIGHT_ARROW ttype)? private static boolean type_declaration_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_declaration_1")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && type_declaration_1_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); + r = r && onls(b, l + 1); + r = r && type_declaration_1_6(b, l + 1); r = r && type_declaration_1_7(b, l + 1); exit_section_(b, m, null, r); return r; @@ -6237,6 +6176,17 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } + // ttype | type_signature + private static boolean type_declaration_1_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_declaration_1_6")) return false; + boolean r; + Marker m = enter_section_(b); + r = ttype(b, l + 1); + if (!r) r = type_signature(b, l + 1); + exit_section_(b, m, null, r); + return r; + } + // (DOUBLE_RIGHT_ARROW ttype)? private static boolean type_declaration_1_7(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_declaration_1_7")) return false; @@ -6255,113 +6205,91 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl type_signature (DOUBLE_RIGHT_ARROW ttype)? + // TYPE onls simpletype onls EQUAL onls expression private static boolean type_declaration_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_declaration_2")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_declaration_2_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_signature(b, l + 1); - r = r && type_declaration_2_7(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // EQUAL | WHERE - private static boolean type_declaration_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_2_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_EQUAL); - if (!r) r = consumeToken(b, HS_WHERE); - exit_section_(b, m, null, r); - return r; - } - - // (DOUBLE_RIGHT_ARROW ttype)? - private static boolean type_declaration_2_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_2_7")) return false; - type_declaration_2_7_0(b, l + 1); - return true; - } - - // DOUBLE_RIGHT_ARROW ttype - private static boolean type_declaration_2_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_2_7_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE osnl simpletype osnl EQUAL osnl expression - private static boolean type_declaration_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && expression(b, l + 1); exit_section_(b, m, null, r); return r; } - // TYPE osnl simpletype osnl LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN EQUAL osnl ttype - private static boolean type_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_4")) return false; + // TYPE onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls EQUAL onls ttype + private static boolean type_declaration_3(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_declaration_3")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && kind_signature(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeTokens(b, 0, HS_RIGHT_PAREN, HS_EQUAL); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && type_declaration_3_4(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_EQUAL); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } - // TYPE osnl simpletype - private static boolean type_declaration_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_5")) return false; + // (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* + private static boolean type_declaration_3_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_declaration_3_4")) return false; + int c = current_position_(b); + while (true) { + if (!type_declaration_3_4_0(b, l + 1)) break; + if (!empty_element_parsed_guard_(b, "type_declaration_3_4", c)) break; + c = current_position_(b); + } + return true; + } + + // LEFT_PAREN onls kind_signature onls RIGHT_PAREN + private static boolean type_declaration_3_4_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_declaration_3_4_0")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_LEFT_PAREN); + r = r && onls(b, l + 1); + r = r && kind_signature(b, l + 1); + r = r && onls(b, l + 1); + r = r && consumeToken(b, HS_RIGHT_PAREN); + exit_section_(b, m, null, r); + return r; + } + + // TYPE onls simpletype + private static boolean type_declaration_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_declaration_4")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && simpletype(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // TYPE_FAMILY osnl type_family_type osnl WHERE? osnl expression? + // TYPE_FAMILY onls type_family_type onls WHERE? onls expression? public static boolean type_family_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_family_declaration")) return false; if (!nextTokenIs(b, HS_TYPE_FAMILY)) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_TYPE_FAMILY); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && type_family_type(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && type_family_declaration_4(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && type_family_declaration_6(b, l + 1); exit_section_(b, m, HS_TYPE_FAMILY_DECLARATION, r); return r; @@ -6382,7 +6310,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // (type_family_type1 | type_family_type2 | LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN?)+ (COLON_COLON osnl ttype)? + // (q_name | LEFT_PAREN? q_names COLON_COLON? onls (context DOUBLE_RIGHT_ARROW)? onls ttype? RIGHT_PAREN?)+ (COLON_COLON onls ttype)? public static boolean type_family_type(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_family_type")) return false; boolean r; @@ -6393,7 +6321,7 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // (type_family_type1 | type_family_type2 | LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN?)+ + // (q_name | LEFT_PAREN? q_names COLON_COLON? onls (context DOUBLE_RIGHT_ARROW)? onls ttype? RIGHT_PAREN?)+ private static boolean type_family_type_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_family_type_0")) return false; boolean r; @@ -6409,59 +6337,58 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // type_family_type1 | type_family_type2 | LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN? + // q_name | LEFT_PAREN? q_names COLON_COLON? onls (context DOUBLE_RIGHT_ARROW)? onls ttype? RIGHT_PAREN? private static boolean type_family_type_0_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_family_type_0_0")) return false; boolean r; Marker m = enter_section_(b); - r = type_family_type1(b, l + 1); - if (!r) r = type_family_type2(b, l + 1); - if (!r) r = type_family_type_0_0_2(b, l + 1); + r = q_name(b, l + 1); + if (!r) r = type_family_type_0_0_1(b, l + 1); exit_section_(b, m, null, r); return r; } - // LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN? - private static boolean type_family_type_0_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2")) return false; + // LEFT_PAREN? q_names COLON_COLON? onls (context DOUBLE_RIGHT_ARROW)? onls ttype? RIGHT_PAREN? + private static boolean type_family_type_0_0_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_family_type_0_0_1")) return false; boolean r; Marker m = enter_section_(b); - r = type_family_type_0_0_2_0(b, l + 1); - r = r && vars(b, l + 1); - r = r && type_family_type_0_0_2_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_family_type_0_0_2_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_family_type_0_0_2_6(b, l + 1); - r = r && type_family_type_0_0_2_7(b, l + 1); + r = type_family_type_0_0_1_0(b, l + 1); + r = r && q_names(b, l + 1); + r = r && type_family_type_0_0_1_2(b, l + 1); + r = r && onls(b, l + 1); + r = r && type_family_type_0_0_1_4(b, l + 1); + r = r && onls(b, l + 1); + r = r && type_family_type_0_0_1_6(b, l + 1); + r = r && type_family_type_0_0_1_7(b, l + 1); exit_section_(b, m, null, r); return r; } // LEFT_PAREN? - private static boolean type_family_type_0_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_0")) return false; + private static boolean type_family_type_0_0_1_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_family_type_0_0_1_0")) return false; consumeToken(b, HS_LEFT_PAREN); return true; } // COLON_COLON? - private static boolean type_family_type_0_0_2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_2")) return false; + private static boolean type_family_type_0_0_1_2(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_family_type_0_0_1_2")) return false; consumeToken(b, HS_COLON_COLON); return true; } // (context DOUBLE_RIGHT_ARROW)? - private static boolean type_family_type_0_0_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_4")) return false; - type_family_type_0_0_2_4_0(b, l + 1); + private static boolean type_family_type_0_0_1_4(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_family_type_0_0_1_4")) return false; + type_family_type_0_0_1_4_0(b, l + 1); return true; } // context DOUBLE_RIGHT_ARROW - private static boolean type_family_type_0_0_2_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_4_0")) return false; + private static boolean type_family_type_0_0_1_4_0(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_family_type_0_0_1_4_0")) return false; boolean r; Marker m = enter_section_(b); r = context(b, l + 1); @@ -6471,77 +6398,55 @@ public class HaskellParser implements PsiParser, LightPsiParser { } // ttype? - private static boolean type_family_type_0_0_2_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_6")) return false; + private static boolean type_family_type_0_0_1_6(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_family_type_0_0_1_6")) return false; ttype(b, l + 1); return true; } // RIGHT_PAREN? - private static boolean type_family_type_0_0_2_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_7")) return false; + private static boolean type_family_type_0_0_1_7(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "type_family_type_0_0_1_7")) return false; consumeToken(b, HS_RIGHT_PAREN); return true; } - // (COLON_COLON osnl ttype)? + // (COLON_COLON onls ttype)? private static boolean type_family_type_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_family_type_1")) return false; type_family_type_1_0(b, l + 1); return true; } - // COLON_COLON osnl ttype + // COLON_COLON onls ttype private static boolean type_family_type_1_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_family_type_1_0")) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // qcon - public static boolean type_family_type1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type1")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_TYPE_FAMILY_TYPE_1, ""); - r = qcon(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // qvar_op - public static boolean type_family_type2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type2")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_TYPE_FAMILY_TYPE_2, ""); - r = qvar_op(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // TYPE_INSTANCE osnl expression + // TYPE_INSTANCE onls expression public static boolean type_instance_declaration(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_instance_declaration")) return false; if (!nextTokenIs(b, HS_TYPE_INSTANCE)) return false; boolean r; Marker m = enter_section_(b); r = consumeToken(b, HS_TYPE_INSTANCE); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && expression(b, l + 1); exit_section_(b, m, HS_TYPE_INSTANCE_DECLARATION, r); return r; } /* ********************************************************** */ - // vars osnl COLON_COLON osnl ((ttype | context) DOUBLE_RIGHT_ARROW)? osnl ttype | - // var_id osnl LEFT_PAREN osnl vars osnl COMMA osnl scontext osnl DOUBLE_RIGHT_ARROW osnl ttype osnl RIGHT_PAREN + // q_names onls COLON_COLON onls (context DOUBLE_RIGHT_ARROW)? onls ttype | + // q_names onls LEFT_PAREN onls q_names onls COMMA onls scontext onls DOUBLE_RIGHT_ARROW onls ttype onls RIGHT_PAREN public static boolean type_signature(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_signature")) return false; boolean r; @@ -6552,70 +6457,59 @@ public class HaskellParser implements PsiParser, LightPsiParser { return r; } - // vars osnl COLON_COLON osnl ((ttype | context) DOUBLE_RIGHT_ARROW)? osnl ttype + // q_names onls COLON_COLON onls (context DOUBLE_RIGHT_ARROW)? onls ttype private static boolean type_signature_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_signature_0")) return false; boolean r; Marker m = enter_section_(b); - r = vars(b, l + 1); - r = r && osnl(b, l + 1); + r = q_names(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && type_signature_0_4(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); exit_section_(b, m, null, r); return r; } - // ((ttype | context) DOUBLE_RIGHT_ARROW)? + // (context DOUBLE_RIGHT_ARROW)? private static boolean type_signature_0_4(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_signature_0_4")) return false; type_signature_0_4_0(b, l + 1); return true; } - // (ttype | context) DOUBLE_RIGHT_ARROW + // context DOUBLE_RIGHT_ARROW private static boolean type_signature_0_4_0(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_signature_0_4_0")) return false; boolean r; Marker m = enter_section_(b); - r = type_signature_0_4_0_0(b, l + 1); + r = context(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); exit_section_(b, m, null, r); return r; } - // ttype | context - private static boolean type_signature_0_4_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature_0_4_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = ttype(b, l + 1); - if (!r) r = context(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id osnl LEFT_PAREN osnl vars osnl COMMA osnl scontext osnl DOUBLE_RIGHT_ARROW osnl ttype osnl RIGHT_PAREN + // q_names onls LEFT_PAREN onls q_names onls COMMA onls scontext onls DOUBLE_RIGHT_ARROW onls ttype onls RIGHT_PAREN private static boolean type_signature_1(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "type_signature_1")) return false; boolean r; Marker m = enter_section_(b); - r = var_id(b, l + 1); - r = r && osnl(b, l + 1); + r = q_names(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && vars(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); + r = r && q_names(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && scontext(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && ttype(b, l + 1); - r = r && osnl(b, l + 1); + r = r && onls(b, l + 1); r = r && consumeToken(b, HS_RIGHT_PAREN); exit_section_(b, m, null, r); return r; @@ -6651,63 +6545,98 @@ public class HaskellParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // VARID_ID - public static boolean var_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "var_id")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; + // varid | LEFT_PAREN varsym RIGHT_PAREN + public static boolean var(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "var")) return false; + if (!nextTokenIs(b, "", HS_LEFT_PAREN, HS_VAR_ID)) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, HS_VAR, ""); + r = varid(b, l + 1); + if (!r) r = var_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // LEFT_PAREN varsym RIGHT_PAREN + private static boolean var_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "var_1")) return false; boolean r; Marker m = enter_section_(b); - r = consumeToken(b, HS_VARID_ID); - exit_section_(b, m, HS_VAR_ID, r); + r = consumeToken(b, HS_LEFT_PAREN); + r = r && varsym(b, l + 1); + r = r && consumeToken(b, HS_RIGHT_PAREN); + exit_section_(b, m, null, r); return r; } /* ********************************************************** */ - // VARSYM_ID | TILDE | DOT - public static boolean var_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "var_sym")) return false; + // varid | consym | varsym | conid + public static boolean var_con(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "var_con")) return false; boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_VAR_SYM, ""); + Marker m = enter_section_(b, l, _NONE_, HS_VAR_CON, ""); + r = varid(b, l + 1); + if (!r) r = consym(b, l + 1); + if (!r) r = varsym(b, l + 1); + if (!r) r = conid(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + /* ********************************************************** */ + // VAR_ID + public static boolean varid(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "varid")) return false; + if (!nextTokenIs(b, HS_VAR_ID)) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_VAR_ID); + exit_section_(b, m, HS_VARID, r); + return r; + } + + /* ********************************************************** */ + // varsym | BACKQUOTE varid BACKQUOTE + public static boolean varop(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "varop")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, HS_VAROP, ""); + r = varsym(b, l + 1); + if (!r) r = varop_1(b, l + 1); + exit_section_(b, l, m, r, false, null); + return r; + } + + // BACKQUOTE varid BACKQUOTE + private static boolean varop_1(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "varop_1")) return false; + boolean r; + Marker m = enter_section_(b); + r = consumeToken(b, HS_BACKQUOTE); + r = r && varid(b, l + 1); + r = r && consumeToken(b, HS_BACKQUOTE); + exit_section_(b, m, null, r); + return r; + } + + /* ********************************************************** */ + // VARSYM_ID | TILDE | DOT VARSYM_ID | DOT CONSYM_ID | DOT + public static boolean varsym(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "varsym")) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, HS_VARSYM, ""); r = consumeToken(b, HS_VARSYM_ID); if (!r) r = consumeToken(b, HS_TILDE); + if (!r) r = parseTokens(b, 0, HS_DOT, HS_VARSYM_ID); + if (!r) r = parseTokens(b, 0, HS_DOT, HS_CONSYM_ID); if (!r) r = consumeToken(b, HS_DOT); exit_section_(b, l, m, r, false, null); return r; } - /* ********************************************************** */ - // qvar (COMMA qvar)* - public static boolean vars(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "vars")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_VARS, ""); - r = qvar(b, l + 1); - r = r && vars_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // (COMMA qvar)* - private static boolean vars_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "vars_1")) return false; - int c = current_position_(b); - while (true) { - if (!vars_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "vars_1", c)) break; - c = current_position_(b); + final static Parser modid_recover_rule_parser_ = new Parser() { + public boolean parse(PsiBuilder b, int l) { + return modid_recover_rule(b, l + 1); } - return true; - } - - // COMMA qvar - private static boolean vars_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "vars_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_COMMA); - r = r && qvar(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - + }; } diff --git a/gen/intellij/haskell/psi/HaskellClassDeclaration.java b/gen/intellij/haskell/psi/HaskellClassDeclaration.java index 4edb95d5..0cbcf79f 100644 --- a/gen/intellij/haskell/psi/HaskellClassDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellClassDeclaration.java @@ -1,28 +1,24 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public interface HaskellClassDeclaration extends HaskellDeclarationElement { @NotNull List getCdeclList(); - @Nullable - HaskellContext getContext(); - @NotNull List getExpressionList(); @NotNull - HaskellQcon getQcon(); - - @NotNull - List getQvarList(); + List getQNameList(); @Nullable HaskellScontext getScontext(); @@ -30,13 +26,12 @@ public interface HaskellClassDeclaration extends HaskellDeclarationElement { @NotNull List getTtypeList(); - @NotNull - List getTypeSignatureList(); - String getName(); ItemPresentation getPresentation(); Seq getIdentifierElements(); + Option getModuleName(); + } diff --git a/gen/intellij/haskell/psi/HaskellClazz.java b/gen/intellij/haskell/psi/HaskellClazz.java index d654a2af..1bf3d64a 100644 --- a/gen/intellij/haskell/psi/HaskellClazz.java +++ b/gen/intellij/haskell/psi/HaskellClazz.java @@ -1,20 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellClazz extends HaskellCompositeElement { @NotNull - List getGtyconList(); - - @NotNull - List getQconList(); - - @NotNull - List getQvarList(); + List getQNameList(); @NotNull List getTtypeList(); @@ -22,7 +16,4 @@ public interface HaskellClazz extends HaskellCompositeElement { @NotNull List getTypeSignatureList(); - @NotNull - List getVarSymList(); - } diff --git a/gen/intellij/haskell/psi/HaskellCname.java b/gen/intellij/haskell/psi/HaskellCname.java index 35d10a2d..64067e14 100644 --- a/gen/intellij/haskell/psi/HaskellCname.java +++ b/gen/intellij/haskell/psi/HaskellCname.java @@ -1,22 +1,29 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.Nullable; +import scala.Option; -public interface HaskellCname extends HaskellCompositeElement { +public interface HaskellCname extends HaskellQualifiedNameElement { @Nullable - HaskellQcon getQcon(); + HaskellCon getCon(); @Nullable - HaskellQconOp getQconOp(); + HaskellConop getConop(); @Nullable - HaskellQvar getQvar(); + HaskellVar getVar(); @Nullable - HaskellQvarOp getQvarOp(); + HaskellVarop getVarop(); + + String getName(); + + HaskellNamedElement getIdentifierElement(); + + Option getQualifierName(); + + String getNameWithoutParens(); } diff --git a/gen/intellij/haskell/psi/HaskellCon.java b/gen/intellij/haskell/psi/HaskellCon.java new file mode 100644 index 00000000..69de86e3 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellCon.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; + +public interface HaskellCon extends HaskellCNameElement { + + @Nullable + HaskellConid getConid(); + + @Nullable + HaskellConsym getConsym(); + + String getName(); + +} diff --git a/gen/intellij/haskell/psi/HaskellConId.java b/gen/intellij/haskell/psi/HaskellConId.java deleted file mode 100644 index 045cf5eb..00000000 --- a/gen/intellij/haskell/psi/HaskellConId.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import com.intellij.navigation.ItemPresentation; -import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; - -public interface HaskellConId extends HaskellNamedElement { - - @Nullable - HaskellVarId getVarId(); - - String getName(); - - PsiElement setName(String newName); - - HaskellNamedElement getNameIdentifier(); - - PsiReference getReference(); - - ItemPresentation getPresentation(); - - SearchScope getUseScope(); - -} diff --git a/gen/intellij/haskell/psi/HaskellModId.java b/gen/intellij/haskell/psi/HaskellConid.java similarity index 67% rename from gen/intellij/haskell/psi/HaskellModId.java rename to gen/intellij/haskell/psi/HaskellConid.java index 4b2a6e6b..6c07e66d 100644 --- a/gen/intellij/haskell/psi/HaskellModId.java +++ b/gen/intellij/haskell/psi/HaskellConid.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; -public interface HaskellModId extends HaskellNamedElement { +public interface HaskellConid extends HaskellNamedElement { String getName(); @@ -20,6 +17,4 @@ public interface HaskellModId extends HaskellNamedElement { ItemPresentation getPresentation(); - SearchScope getUseScope(); - } diff --git a/gen/intellij/haskell/psi/HaskellConop.java b/gen/intellij/haskell/psi/HaskellConop.java new file mode 100644 index 00000000..90725ba1 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellConop.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; + +public interface HaskellConop extends HaskellCNameElement { + + @Nullable + HaskellConid getConid(); + + @Nullable + HaskellConsym getConsym(); + + String getName(); + +} diff --git a/gen/intellij/haskell/psi/HaskellConstr1.java b/gen/intellij/haskell/psi/HaskellConstr1.java index 9e84cb6c..21205e01 100644 --- a/gen/intellij/haskell/psi/HaskellConstr1.java +++ b/gen/intellij/haskell/psi/HaskellConstr1.java @@ -1,9 +1,9 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellConstr1 extends HaskellCompositeElement { @@ -11,7 +11,7 @@ public interface HaskellConstr1 extends HaskellCompositeElement { List getFielddeclList(); @NotNull - HaskellQcon getQcon(); + HaskellQName getQName(); @NotNull List getUnpackNounpackPragmaList(); diff --git a/gen/intellij/haskell/psi/HaskellConstr2.java b/gen/intellij/haskell/psi/HaskellConstr2.java index 32118bff..660a1a2a 100644 --- a/gen/intellij/haskell/psi/HaskellConstr2.java +++ b/gen/intellij/haskell/psi/HaskellConstr2.java @@ -1,17 +1,20 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellConstr2 extends HaskellCompositeElement { @NotNull - HaskellQconOp getQconOp(); + List getQNameList(); @NotNull - List getSubConstr2List(); + List getTtypeList(); + + @NotNull + List getTypeSignatureList(); @NotNull List getUnpackNounpackPragmaList(); diff --git a/gen/intellij/haskell/psi/HaskellConstr3.java b/gen/intellij/haskell/psi/HaskellConstr3.java index 92cfcf68..f7cc551f 100644 --- a/gen/intellij/haskell/psi/HaskellConstr3.java +++ b/gen/intellij/haskell/psi/HaskellConstr3.java @@ -1,34 +1,19 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellConstr3 extends HaskellCompositeElement { @NotNull - List getGtyconList(); + HaskellQName getQName(); @NotNull - HaskellQcon getQcon(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); + List getSubConstr2List(); @NotNull List getUnpackNounpackPragmaList(); - @NotNull - List getVarSymList(); - } diff --git a/gen/intellij/haskell/psi/HaskellConstr4.java b/gen/intellij/haskell/psi/HaskellConstr4.java index 26d17afb..44537386 100644 --- a/gen/intellij/haskell/psi/HaskellConstr4.java +++ b/gen/intellij/haskell/psi/HaskellConstr4.java @@ -1,20 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellConstr4 extends HaskellCompositeElement { @NotNull - HaskellGconSym getGconSym(); - - @NotNull - HaskellQcon getQcon(); - - @NotNull - HaskellQvar getQvar(); + List getQNameList(); @NotNull List getUnpackNounpackPragmaList(); diff --git a/gen/intellij/haskell/psi/HaskellVarId.java b/gen/intellij/haskell/psi/HaskellConsym.java similarity index 67% rename from gen/intellij/haskell/psi/HaskellVarId.java rename to gen/intellij/haskell/psi/HaskellConsym.java index b0fe97f2..eafdc7e4 100644 --- a/gen/intellij/haskell/psi/HaskellVarId.java +++ b/gen/intellij/haskell/psi/HaskellConsym.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; -public interface HaskellVarId extends HaskellNamedElement { +public interface HaskellConsym extends HaskellNamedElement { String getName(); @@ -20,6 +17,4 @@ public interface HaskellVarId extends HaskellNamedElement { ItemPresentation getPresentation(); - SearchScope getUseScope(); - } diff --git a/gen/intellij/haskell/psi/HaskellDataDeclaration.java b/gen/intellij/haskell/psi/HaskellDataDeclaration.java index c5fe9122..6e2f082c 100644 --- a/gen/intellij/haskell/psi/HaskellDataDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellDataDeclaration.java @@ -1,12 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public interface HaskellDataDeclaration extends HaskellDataConstructorDeclarationElement { @NotNull @@ -40,10 +42,13 @@ public interface HaskellDataDeclaration extends HaskellDataConstructorDeclaratio List getKindSignatureList(); @NotNull - List getQvarList(); + List getQNameList(); + + @Nullable + HaskellScontext getScontext(); @NotNull - List getSimpletypeList(); + HaskellSimpletype getSimpletype(); String getName(); @@ -51,7 +56,7 @@ public interface HaskellDataDeclaration extends HaskellDataConstructorDeclaratio Seq getIdentifierElements(); - String getModuleName(); + Option getModuleName(); HaskellNamedElement getDataTypeConstructor(); diff --git a/gen/intellij/haskell/psi/HaskellDefaultDeclaration.java b/gen/intellij/haskell/psi/HaskellDefaultDeclaration.java index 95ac5642..a9f55bd2 100644 --- a/gen/intellij/haskell/psi/HaskellDefaultDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellDefaultDeclaration.java @@ -1,12 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public interface HaskellDefaultDeclaration extends HaskellDeclarationElement { @NotNull @@ -21,6 +23,6 @@ public interface HaskellDefaultDeclaration extends HaskellDeclarationElement { Seq getIdentifierElements(); - String getModuleName(); + Option getModuleName(); } diff --git a/gen/intellij/haskell/psi/HaskellDerivingDeclaration.java b/gen/intellij/haskell/psi/HaskellDerivingDeclaration.java index 8312cbd6..b74ef5c9 100644 --- a/gen/intellij/haskell/psi/HaskellDerivingDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellDerivingDeclaration.java @@ -1,10 +1,10 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public interface HaskellDerivingDeclaration extends HaskellDeclarationElement { @@ -13,7 +13,7 @@ public interface HaskellDerivingDeclaration extends HaskellDeclarationElement { HaskellInst getInst(); @NotNull - HaskellQcon getQcon(); + HaskellQName getQName(); @Nullable HaskellScontext getScontext(); @@ -24,4 +24,6 @@ public interface HaskellDerivingDeclaration extends HaskellDeclarationElement { Seq getIdentifierElements(); + Option getModuleName(); + } diff --git a/gen/intellij/haskell/psi/HaskellDummyPragma.java b/gen/intellij/haskell/psi/HaskellDummyPragma.java index b232d18b..28a95d6f 100644 --- a/gen/intellij/haskell/psi/HaskellDummyPragma.java +++ b/gen/intellij/haskell/psi/HaskellDummyPragma.java @@ -1,10 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.Nullable; public interface HaskellDummyPragma extends HaskellCompositeElement { + @Nullable + HaskellQName getQName(); + } diff --git a/gen/intellij/haskell/psi/HaskellExport.java b/gen/intellij/haskell/psi/HaskellExport.java index ace98ca7..75d0207f 100644 --- a/gen/intellij/haskell/psi/HaskellExport.java +++ b/gen/intellij/haskell/psi/HaskellExport.java @@ -1,28 +1,26 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellExport extends HaskellCompositeElement { @NotNull List getCnameList(); + @Nullable + HaskellConid getConid(); + @Nullable HaskellDotDotParens getDotDotParens(); @Nullable - HaskellModId getModId(); + HaskellModid getModid(); @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQvar getQvar(); - - @Nullable - HaskellQvarOp getQvarOp(); + HaskellQCon getQCon(); } diff --git a/gen/intellij/haskell/psi/HaskellExpression.java b/gen/intellij/haskell/psi/HaskellExpression.java index a2e1027d..47ef0c3b 100644 --- a/gen/intellij/haskell/psi/HaskellExpression.java +++ b/gen/intellij/haskell/psi/HaskellExpression.java @@ -1,19 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellExpression extends HaskellCompositeElement { - @Nullable - HaskellFirstLineExpression getFirstLineExpression(); + @NotNull + List getQNameList(); @NotNull - HaskellLastLineExpression getLastLineExpression(); - - @NotNull - List getLineExpressionList(); + List getSccPragmaList(); } diff --git a/gen/intellij/haskell/psi/HaskellFielddecl.java b/gen/intellij/haskell/psi/HaskellFielddecl.java index 48a16f3a..dd386b7c 100644 --- a/gen/intellij/haskell/psi/HaskellFielddecl.java +++ b/gen/intellij/haskell/psi/HaskellFielddecl.java @@ -1,20 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellFielddecl extends HaskellCompositeElement { - @Nullable - HaskellGtycon getGtycon(); + @NotNull + List getQNameList(); @NotNull - List getQvarList(); - - @Nullable - HaskellQvarOp getQvarOp(); + HaskellQNames getQNames(); @NotNull List getTtypeList(); @@ -25,10 +23,4 @@ public interface HaskellFielddecl extends HaskellCompositeElement { @Nullable HaskellUnpackNounpackPragma getUnpackNounpackPragma(); - @NotNull - List getVarSymList(); - - @NotNull - HaskellVars getVars(); - } diff --git a/gen/intellij/haskell/psi/HaskellFirstLineExpression.java b/gen/intellij/haskell/psi/HaskellFirstLineExpression.java deleted file mode 100644 index 7eeb1fb3..00000000 --- a/gen/intellij/haskell/psi/HaskellFirstLineExpression.java +++ /dev/null @@ -1,31 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellFirstLineExpression extends HaskellLineExpressionElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - - @NotNull - HaskellSnl getSnl(); - -} diff --git a/gen/intellij/haskell/psi/HaskellFixity.java b/gen/intellij/haskell/psi/HaskellFixity.java deleted file mode 100644 index ac105681..00000000 --- a/gen/intellij/haskell/psi/HaskellFixity.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellFixity extends HaskellCompositeElement { - -} diff --git a/gen/intellij/haskell/psi/HaskellFixityDeclaration.java b/gen/intellij/haskell/psi/HaskellFixityDeclaration.java index 85809c91..aa456976 100644 --- a/gen/intellij/haskell/psi/HaskellFixityDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellFixityDeclaration.java @@ -1,16 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.NotNull; public interface HaskellFixityDeclaration extends HaskellCompositeElement { @NotNull - HaskellFixity getFixity(); - - @NotNull - HaskellOps getOps(); + HaskellQNames getQNames(); } diff --git a/gen/intellij/haskell/psi/HaskellForeignDeclaration.java b/gen/intellij/haskell/psi/HaskellForeignDeclaration.java index eff0ce89..56c819d6 100644 --- a/gen/intellij/haskell/psi/HaskellForeignDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellForeignDeclaration.java @@ -1,10 +1,9 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import scala.Option; import scala.collection.Seq; public interface HaskellForeignDeclaration extends HaskellDeclarationElement { @@ -18,6 +17,6 @@ public interface HaskellForeignDeclaration extends HaskellDeclarationElement { Seq getIdentifierElements(); - String getModuleName(); + Option getModuleName(); } diff --git a/gen/intellij/haskell/psi/HaskellGconSym.java b/gen/intellij/haskell/psi/HaskellGconSym.java deleted file mode 100644 index 493cf431..00000000 --- a/gen/intellij/haskell/psi/HaskellGconSym.java +++ /dev/null @@ -1,20 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellGconSym extends HaskellCompositeElement { - - @Nullable - HaskellConSym getConSym(); - - @Nullable - HaskellQconSym getQconSym(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - -} diff --git a/gen/intellij/haskell/psi/HaskellGeneralPragmaContent.java b/gen/intellij/haskell/psi/HaskellGeneralPragmaContent.java index 13be0b2b..c01d8016 100644 --- a/gen/intellij/haskell/psi/HaskellGeneralPragmaContent.java +++ b/gen/intellij/haskell/psi/HaskellGeneralPragmaContent.java @@ -1,28 +1,6 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - public interface HaskellGeneralPragmaContent extends HaskellCompositeElement { - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - } diff --git a/gen/intellij/haskell/psi/HaskellGtycon.java b/gen/intellij/haskell/psi/HaskellGtycon.java index 95eff81a..86e5bc45 100644 --- a/gen/intellij/haskell/psi/HaskellGtycon.java +++ b/gen/intellij/haskell/psi/HaskellGtycon.java @@ -1,13 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.Nullable; public interface HaskellGtycon extends HaskellCompositeElement { @Nullable - HaskellQcon getQcon(); + HaskellQName getQName(); } diff --git a/gen/intellij/haskell/psi/HaskellHaddockPragma.java b/gen/intellij/haskell/psi/HaskellHaddockPragma.java index 29709747..9f02c431 100644 --- a/gen/intellij/haskell/psi/HaskellHaddockPragma.java +++ b/gen/intellij/haskell/psi/HaskellHaddockPragma.java @@ -1,13 +1,6 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - public interface HaskellHaddockPragma extends HaskellCompositeElement { - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - } diff --git a/gen/intellij/haskell/psi/HaskellImportDeclaration.java b/gen/intellij/haskell/psi/HaskellImportDeclaration.java index dcfb4752..1bcdb1bf 100644 --- a/gen/intellij/haskell/psi/HaskellImportDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellImportDeclaration.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.Nullable; +import scala.Option; public interface HaskellImportDeclaration extends HaskellCompositeElement { @Nullable - HaskellImportModule getImportModule(); + HaskellImportPackageName getImportPackageName(); @Nullable HaskellImportQualified getImportQualified(); @@ -19,9 +18,12 @@ public interface HaskellImportDeclaration extends HaskellCompositeElement { @Nullable HaskellImportSpec getImportSpec(); + @Nullable + HaskellModid getModid(); + @Nullable HaskellSourcePragma getSourcePragma(); - String getModuleName(); + Option getModuleName(); } diff --git a/gen/intellij/haskell/psi/HaskellImportDeclarations.java b/gen/intellij/haskell/psi/HaskellImportDeclarations.java new file mode 100644 index 00000000..04f6f7fb --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellImportDeclarations.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public interface HaskellImportDeclarations extends HaskellCompositeElement { + + @NotNull + List getCfilesPragmaList(); + + @NotNull + List getImportDeclarationList(); + +} diff --git a/gen/intellij/haskell/psi/HaskellImportId.java b/gen/intellij/haskell/psi/HaskellImportId.java index 9a67e01d..ab1d48f9 100644 --- a/gen/intellij/haskell/psi/HaskellImportId.java +++ b/gen/intellij/haskell/psi/HaskellImportId.java @@ -1,9 +1,10 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellImportId extends HaskellCompositeElement { @@ -13,10 +14,4 @@ public interface HaskellImportId extends HaskellCompositeElement { @Nullable HaskellDotDotParens getDotDotParens(); - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQvar getQvar(); - } diff --git a/gen/intellij/haskell/psi/HaskellImportModule.java b/gen/intellij/haskell/psi/HaskellImportModule.java deleted file mode 100644 index 9b233ef0..00000000 --- a/gen/intellij/haskell/psi/HaskellImportModule.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportModule extends HaskellCompositeElement { - - @NotNull - HaskellModId getModId(); - -} diff --git a/gen/intellij/haskell/psi/HaskellImportPackageName.java b/gen/intellij/haskell/psi/HaskellImportPackageName.java new file mode 100644 index 00000000..b27cd6bc --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellImportPackageName.java @@ -0,0 +1,6 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +public interface HaskellImportPackageName extends HaskellCompositeElement { + +} diff --git a/gen/intellij/haskell/psi/HaskellImportQualified.java b/gen/intellij/haskell/psi/HaskellImportQualified.java index 43c70784..99ee7f35 100644 --- a/gen/intellij/haskell/psi/HaskellImportQualified.java +++ b/gen/intellij/haskell/psi/HaskellImportQualified.java @@ -1,13 +1,6 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - public interface HaskellImportQualified extends HaskellCompositeElement { - @NotNull - HaskellVarId getVarId(); - } diff --git a/gen/intellij/haskell/psi/HaskellImportQualifiedAs.java b/gen/intellij/haskell/psi/HaskellImportQualifiedAs.java index b9761776..a491986d 100644 --- a/gen/intellij/haskell/psi/HaskellImportQualifiedAs.java +++ b/gen/intellij/haskell/psi/HaskellImportQualifiedAs.java @@ -1,16 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.NotNull; public interface HaskellImportQualifiedAs extends HaskellCompositeElement { - @Nullable + @NotNull HaskellQualifier getQualifier(); - @NotNull - HaskellVarId getVarId(); - } diff --git a/gen/intellij/haskell/psi/HaskellInst.java b/gen/intellij/haskell/psi/HaskellInst.java index 5597fb02..c1693481 100644 --- a/gen/intellij/haskell/psi/HaskellInst.java +++ b/gen/intellij/haskell/psi/HaskellInst.java @@ -1,9 +1,10 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellInst extends HaskellCompositeElement { @@ -14,7 +15,7 @@ public interface HaskellInst extends HaskellCompositeElement { List getInstvarList(); @Nullable - HaskellQvar getQvar(); + HaskellQName getQName(); @Nullable HaskellTtype getTtype(); diff --git a/gen/intellij/haskell/psi/HaskellInstanceDeclaration.java b/gen/intellij/haskell/psi/HaskellInstanceDeclaration.java index db701815..1137a645 100644 --- a/gen/intellij/haskell/psi/HaskellInstanceDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellInstanceDeclaration.java @@ -1,12 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public interface HaskellInstanceDeclaration extends HaskellDeclarationElement { @NotNull @@ -22,13 +24,13 @@ public interface HaskellInstanceDeclaration extends HaskellDeclarationElement { HaskellOverlapPragma getOverlapPragma(); @NotNull - HaskellQcon getQcon(); + List getQNameList(); @Nullable HaskellScontext getScontext(); @NotNull - List getVarIdList(); + List getVarConList(); String getName(); @@ -36,4 +38,6 @@ public interface HaskellInstanceDeclaration extends HaskellDeclarationElement { Seq getIdentifierElements(); + Option getModuleName(); + } diff --git a/gen/intellij/haskell/psi/HaskellInstvar.java b/gen/intellij/haskell/psi/HaskellInstvar.java index 0201a823..899a3f79 100644 --- a/gen/intellij/haskell/psi/HaskellInstvar.java +++ b/gen/intellij/haskell/psi/HaskellInstvar.java @@ -1,19 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.Nullable; public interface HaskellInstvar extends HaskellCompositeElement { @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQvar getQvar(); + HaskellQName getQName(); } diff --git a/gen/intellij/haskell/psi/HaskellKindSignature.java b/gen/intellij/haskell/psi/HaskellKindSignature.java index c59cf222..aca63866 100644 --- a/gen/intellij/haskell/psi/HaskellKindSignature.java +++ b/gen/intellij/haskell/psi/HaskellKindSignature.java @@ -1,16 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.NotNull; public interface HaskellKindSignature extends HaskellCompositeElement { @NotNull - HaskellTtype getTtype(); + HaskellQName getQName(); @NotNull - HaskellVarId getVarId(); + HaskellTtype getTtype(); } diff --git a/gen/intellij/haskell/psi/HaskellLanguagePragma.java b/gen/intellij/haskell/psi/HaskellLanguagePragma.java index f65c11ec..cbef8a3b 100644 --- a/gen/intellij/haskell/psi/HaskellLanguagePragma.java +++ b/gen/intellij/haskell/psi/HaskellLanguagePragma.java @@ -1,13 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellLanguagePragma extends HaskellCompositeElement { @NotNull - List getQconList(); + List getQNameList(); } diff --git a/gen/intellij/haskell/psi/HaskellLastLineExpression.java b/gen/intellij/haskell/psi/HaskellLastLineExpression.java deleted file mode 100644 index c3819031..00000000 --- a/gen/intellij/haskell/psi/HaskellLastLineExpression.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLastLineExpression extends HaskellLineExpressionElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - -} diff --git a/gen/intellij/haskell/psi/HaskellLineExpression.java b/gen/intellij/haskell/psi/HaskellLineExpression.java deleted file mode 100644 index 9930b05f..00000000 --- a/gen/intellij/haskell/psi/HaskellLineExpression.java +++ /dev/null @@ -1,31 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLineExpression extends HaskellLineExpressionElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - - @NotNull - HaskellSnl getSnl(); - -} diff --git a/gen/intellij/haskell/psi/HaskellListType.java b/gen/intellij/haskell/psi/HaskellListType.java index f9ae4136..e6b00127 100644 --- a/gen/intellij/haskell/psi/HaskellListType.java +++ b/gen/intellij/haskell/psi/HaskellListType.java @@ -1,10 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.Nullable; public interface HaskellListType extends HaskellCompositeElement { + @Nullable + HaskellQName getQName(); + } diff --git a/gen/intellij/haskell/psi/HaskellLiteral.java b/gen/intellij/haskell/psi/HaskellLiteral.java deleted file mode 100644 index 8e47b11d..00000000 --- a/gen/intellij/haskell/psi/HaskellLiteral.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLiteral extends HaskellCompositeElement { - -} diff --git a/gen/intellij/haskell/psi/HaskellVarSym.java b/gen/intellij/haskell/psi/HaskellModid.java similarity index 67% rename from gen/intellij/haskell/psi/HaskellVarSym.java rename to gen/intellij/haskell/psi/HaskellModid.java index 3b660190..b459a46a 100644 --- a/gen/intellij/haskell/psi/HaskellVarSym.java +++ b/gen/intellij/haskell/psi/HaskellModid.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; -public interface HaskellVarSym extends HaskellNamedElement { +public interface HaskellModid extends HaskellNamedElement { String getName(); @@ -20,6 +17,4 @@ public interface HaskellVarSym extends HaskellNamedElement { ItemPresentation getPresentation(); - SearchScope getUseScope(); - } diff --git a/gen/intellij/haskell/psi/HaskellModuleBody.java b/gen/intellij/haskell/psi/HaskellModuleBody.java index 99c57748..8a07e852 100644 --- a/gen/intellij/haskell/psi/HaskellModuleBody.java +++ b/gen/intellij/haskell/psi/HaskellModuleBody.java @@ -1,20 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellModuleBody extends HaskellCompositeElement { @NotNull - List getCfilesPragmaList(); + HaskellImportDeclarations getImportDeclarations(); - @NotNull - List getImportDeclarationList(); - - @NotNull - List getModuleDeclarationList(); + @Nullable + HaskellModuleDeclaration getModuleDeclaration(); @NotNull List getTopDeclarationList(); diff --git a/gen/intellij/haskell/psi/HaskellModuleDeclaration.java b/gen/intellij/haskell/psi/HaskellModuleDeclaration.java index 5782b1e3..fe1e211f 100644 --- a/gen/intellij/haskell/psi/HaskellModuleDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellModuleDeclaration.java @@ -1,10 +1,10 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public interface HaskellModuleDeclaration extends HaskellDeclarationElement { @@ -15,11 +15,8 @@ public interface HaskellModuleDeclaration extends HaskellDeclarationElement { @Nullable HaskellExports getExports(); - @Nullable - HaskellExpression getExpression(); - @NotNull - HaskellModId getModId(); + HaskellModid getModid(); String getName(); @@ -27,6 +24,6 @@ public interface HaskellModuleDeclaration extends HaskellDeclarationElement { Seq getIdentifierElements(); - String getModuleName(); + Option getModuleName(); } diff --git a/gen/intellij/haskell/psi/HaskellNewconstr.java b/gen/intellij/haskell/psi/HaskellNewconstr.java index 5aad90c4..e6adfcbd 100644 --- a/gen/intellij/haskell/psi/HaskellNewconstr.java +++ b/gen/intellij/haskell/psi/HaskellNewconstr.java @@ -1,23 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellNewconstr extends HaskellCompositeElement { - @Nullable - HaskellGtycon getGtycon(); - @Nullable HaskellNewconstrFielddecl getNewconstrFielddecl(); - @Nullable - HaskellQcon getQcon(); - @NotNull - List getQvarList(); + List getQNameList(); @NotNull List getTtypeList(); @@ -25,7 +20,4 @@ public interface HaskellNewconstr extends HaskellCompositeElement { @NotNull List getTypeSignatureList(); - @NotNull - List getVarSymList(); - } diff --git a/gen/intellij/haskell/psi/HaskellNewconstrFielddecl.java b/gen/intellij/haskell/psi/HaskellNewconstrFielddecl.java index 2b0869f1..2a60f3c0 100644 --- a/gen/intellij/haskell/psi/HaskellNewconstrFielddecl.java +++ b/gen/intellij/haskell/psi/HaskellNewconstrFielddecl.java @@ -1,17 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellNewconstrFielddecl extends HaskellCompositeElement { @NotNull - HaskellQcon getQcon(); - - @NotNull - HaskellQvar getQvar(); + List getQNameList(); @NotNull HaskellTtype getTtype(); diff --git a/gen/intellij/haskell/psi/HaskellNewtypeDeclaration.java b/gen/intellij/haskell/psi/HaskellNewtypeDeclaration.java index c612c578..7c4a170e 100644 --- a/gen/intellij/haskell/psi/HaskellNewtypeDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellNewtypeDeclaration.java @@ -1,10 +1,10 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public interface HaskellNewtypeDeclaration extends HaskellDataConstructorDeclarationElement { @@ -30,7 +30,7 @@ public interface HaskellNewtypeDeclaration extends HaskellDataConstructorDeclara Seq getIdentifierElements(); - String getModuleName(); + Option getModuleName(); HaskellNamedElement getDataTypeConstructor(); diff --git a/gen/intellij/haskell/psi/HaskellNoinlinePragma.java b/gen/intellij/haskell/psi/HaskellNoinlinePragma.java index 5fedc943..33b3ea2f 100644 --- a/gen/intellij/haskell/psi/HaskellNoinlinePragma.java +++ b/gen/intellij/haskell/psi/HaskellNoinlinePragma.java @@ -1,28 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellNoinlinePragma extends HaskellCompositeElement { @NotNull - List getFixityList(); + List getQNameList(); @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); + List getSccPragmaList(); } diff --git a/gen/intellij/haskell/psi/HaskellOp.java b/gen/intellij/haskell/psi/HaskellOp.java deleted file mode 100644 index bb7b7210..00000000 --- a/gen/intellij/haskell/psi/HaskellOp.java +++ /dev/null @@ -1,20 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellOp extends HaskellCompositeElement { - - @Nullable - HaskellQconOp getQconOp(); - - @Nullable - HaskellQvarOp getQvarOp(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - -} diff --git a/gen/intellij/haskell/psi/HaskellOps.java b/gen/intellij/haskell/psi/HaskellOps.java deleted file mode 100644 index 4e83c45d..00000000 --- a/gen/intellij/haskell/psi/HaskellOps.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellOps extends HaskellCompositeElement { - - @NotNull - List getOpList(); - -} diff --git a/gen/intellij/haskell/psi/HaskellOptionsGhcOption.java b/gen/intellij/haskell/psi/HaskellOptionsGhcOption.java new file mode 100644 index 00000000..742a48d8 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellOptionsGhcOption.java @@ -0,0 +1,6 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +public interface HaskellOptionsGhcOption extends HaskellCompositeElement { + +} diff --git a/gen/intellij/haskell/psi/HaskellOptionsGhcPragma.java b/gen/intellij/haskell/psi/HaskellOptionsGhcPragma.java index 4f9361cc..e1a69674 100644 --- a/gen/intellij/haskell/psi/HaskellOptionsGhcPragma.java +++ b/gen/intellij/haskell/psi/HaskellOptionsGhcPragma.java @@ -1,13 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellOptionsGhcPragma extends HaskellCompositeElement { @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); + List getOptionsGhcOptionList(); } diff --git a/gen/intellij/haskell/psi/HaskellQCon.java b/gen/intellij/haskell/psi/HaskellQCon.java new file mode 100644 index 00000000..772df6e9 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQCon.java @@ -0,0 +1,24 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public interface HaskellQCon extends HaskellCompositeElement { + + @NotNull + HaskellConid getConid(); + + @Nullable + HaskellQConQualifier1 getQConQualifier1(); + + @Nullable + HaskellQConQualifier2 getQConQualifier2(); + + @Nullable + HaskellQConQualifier3 getQConQualifier3(); + + @Nullable + HaskellQConQualifier4 getQConQualifier4(); + +} diff --git a/gen/intellij/haskell/psi/HaskellQConQualifier.java b/gen/intellij/haskell/psi/HaskellQConQualifier.java new file mode 100644 index 00000000..225c9be9 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQConQualifier.java @@ -0,0 +1,20 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; + +public interface HaskellQConQualifier extends HaskellCompositeElement { + + @Nullable + HaskellQConQualifier1 getQConQualifier1(); + + @Nullable + HaskellQConQualifier2 getQConQualifier2(); + + @Nullable + HaskellQConQualifier3 getQConQualifier3(); + + @Nullable + HaskellQConQualifier4 getQConQualifier4(); + +} diff --git a/gen/intellij/haskell/psi/HaskellConSym.java b/gen/intellij/haskell/psi/HaskellQConQualifier1.java similarity index 67% rename from gen/intellij/haskell/psi/HaskellConSym.java rename to gen/intellij/haskell/psi/HaskellQConQualifier1.java index 4fe2bb07..d437db26 100644 --- a/gen/intellij/haskell/psi/HaskellConSym.java +++ b/gen/intellij/haskell/psi/HaskellQConQualifier1.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; -public interface HaskellConSym extends HaskellNamedElement { +public interface HaskellQConQualifier1 extends HaskellQualifierElement { String getName(); @@ -20,6 +17,4 @@ public interface HaskellConSym extends HaskellNamedElement { ItemPresentation getPresentation(); - SearchScope getUseScope(); - } diff --git a/gen/intellij/haskell/psi/HaskellQConQualifier2.java b/gen/intellij/haskell/psi/HaskellQConQualifier2.java new file mode 100644 index 00000000..87414494 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQConQualifier2.java @@ -0,0 +1,20 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiReference; + +public interface HaskellQConQualifier2 extends HaskellQualifierElement { + + String getName(); + + PsiElement setName(String newName); + + HaskellNamedElement getNameIdentifier(); + + PsiReference getReference(); + + ItemPresentation getPresentation(); + +} diff --git a/gen/intellij/haskell/psi/HaskellQConQualifier3.java b/gen/intellij/haskell/psi/HaskellQConQualifier3.java new file mode 100644 index 00000000..285b0969 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQConQualifier3.java @@ -0,0 +1,20 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiReference; + +public interface HaskellQConQualifier3 extends HaskellQualifierElement { + + String getName(); + + PsiElement setName(String newName); + + HaskellNamedElement getNameIdentifier(); + + PsiReference getReference(); + + ItemPresentation getPresentation(); + +} diff --git a/gen/intellij/haskell/psi/HaskellQConQualifier4.java b/gen/intellij/haskell/psi/HaskellQConQualifier4.java new file mode 100644 index 00000000..6f4023cd --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQConQualifier4.java @@ -0,0 +1,20 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiReference; + +public interface HaskellQConQualifier4 extends HaskellQualifierElement { + + String getName(); + + PsiElement setName(String newName); + + HaskellNamedElement getNameIdentifier(); + + PsiReference getReference(); + + ItemPresentation getPresentation(); + +} diff --git a/gen/intellij/haskell/psi/HaskellQName.java b/gen/intellij/haskell/psi/HaskellQName.java new file mode 100644 index 00000000..9e3b7209 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQName.java @@ -0,0 +1,23 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; +import scala.Option; + +public interface HaskellQName extends HaskellQualifiedNameElement { + + @Nullable + HaskellQVarCon getQVarCon(); + + @Nullable + HaskellVarCon getVarCon(); + + String getName(); + + HaskellNamedElement getIdentifierElement(); + + Option getQualifierName(); + + String getNameWithoutParens(); + +} diff --git a/gen/intellij/haskell/psi/HaskellQNames.java b/gen/intellij/haskell/psi/HaskellQNames.java new file mode 100644 index 00000000..7f9ab84e --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQNames.java @@ -0,0 +1,13 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public interface HaskellQNames extends HaskellCompositeElement { + + @NotNull + List getQNameList(); + +} diff --git a/gen/intellij/haskell/psi/HaskellQVarCon.java b/gen/intellij/haskell/psi/HaskellQVarCon.java new file mode 100644 index 00000000..e45777f2 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellQVarCon.java @@ -0,0 +1,27 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; + +public interface HaskellQVarCon extends HaskellCompositeElement { + + @Nullable + HaskellConsym getConsym(); + + @Nullable + HaskellQCon getQCon(); + + @Nullable + HaskellQualifier getQualifier(); + + @Nullable + HaskellVarid getVarid(); + + @Nullable + HaskellVarsym getVarsym(); + + String getName(); + + HaskellNamedElement getIdentifierElement(); + +} diff --git a/gen/intellij/haskell/psi/HaskellQcon.java b/gen/intellij/haskell/psi/HaskellQcon.java deleted file mode 100644 index 74257c60..00000000 --- a/gen/intellij/haskell/psi/HaskellQcon.java +++ /dev/null @@ -1,29 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import scala.Option; - -public interface HaskellQcon extends HaskellQVarConOpElement { - - @Nullable - HaskellConId getConId(); - - @Nullable - HaskellConSym getConSym(); - - @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellQconId getQconId(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - - Option getQualifier(); - -} diff --git a/gen/intellij/haskell/psi/HaskellQconId.java b/gen/intellij/haskell/psi/HaskellQconId.java deleted file mode 100644 index eae5d69f..00000000 --- a/gen/intellij/haskell/psi/HaskellQconId.java +++ /dev/null @@ -1,20 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQconId extends HaskellCompositeElement { - - @NotNull - HaskellConId getConId(); - - @NotNull - HaskellQconIdQualifier getQconIdQualifier(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - -} diff --git a/gen/intellij/haskell/psi/HaskellQconIdQualifier.java b/gen/intellij/haskell/psi/HaskellQconIdQualifier.java deleted file mode 100644 index ce6afff2..00000000 --- a/gen/intellij/haskell/psi/HaskellQconIdQualifier.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQconIdQualifier extends HaskellCompositeElement { - -} diff --git a/gen/intellij/haskell/psi/HaskellQconOp.java b/gen/intellij/haskell/psi/HaskellQconOp.java deleted file mode 100644 index f3dc24fb..00000000 --- a/gen/intellij/haskell/psi/HaskellQconOp.java +++ /dev/null @@ -1,29 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import scala.Option; - -public interface HaskellQconOp extends HaskellQVarConOpElement { - - @Nullable - HaskellConId getConId(); - - @Nullable - HaskellConSym getConSym(); - - @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellQconId getQconId(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - - Option getQualifier(); - -} diff --git a/gen/intellij/haskell/psi/HaskellQconSym.java b/gen/intellij/haskell/psi/HaskellQconSym.java deleted file mode 100644 index 49362c45..00000000 --- a/gen/intellij/haskell/psi/HaskellQconSym.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQconSym extends HaskellCompositeElement { - - @NotNull - HaskellConSym getConSym(); - - @NotNull - HaskellQualifier getQualifier(); - -} diff --git a/gen/intellij/haskell/psi/HaskellQqExpression.java b/gen/intellij/haskell/psi/HaskellQqExpression.java index 88f51b2e..44bd37c9 100644 --- a/gen/intellij/haskell/psi/HaskellQqExpression.java +++ b/gen/intellij/haskell/psi/HaskellQqExpression.java @@ -1,31 +1,19 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellQqExpression extends HaskellCompositeElement { @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); + List getQNameList(); @NotNull HaskellQuasiQuote getQuasiQuote(); @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); + List getSccPragmaList(); } diff --git a/gen/intellij/haskell/psi/HaskellQualifier.java b/gen/intellij/haskell/psi/HaskellQualifier.java index 7a5fb5cb..124a15fa 100644 --- a/gen/intellij/haskell/psi/HaskellQualifier.java +++ b/gen/intellij/haskell/psi/HaskellQualifier.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; -public interface HaskellQualifier extends HaskellNamedElement { +public interface HaskellQualifier extends HaskellQualifierElement { String getName(); @@ -20,6 +17,4 @@ public interface HaskellQualifier extends HaskellNamedElement { ItemPresentation getPresentation(); - SearchScope getUseScope(); - } diff --git a/gen/intellij/haskell/psi/HaskellQvar.java b/gen/intellij/haskell/psi/HaskellQvar.java deleted file mode 100644 index e0335bb9..00000000 --- a/gen/intellij/haskell/psi/HaskellQvar.java +++ /dev/null @@ -1,29 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import scala.Option; - -public interface HaskellQvar extends HaskellQVarConOpElement { - - @Nullable - HaskellQvarId getQvarId(); - - @Nullable - HaskellQvarSym getQvarSym(); - - @Nullable - HaskellVarId getVarId(); - - @Nullable - HaskellVarSym getVarSym(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - - Option getQualifier(); - -} diff --git a/gen/intellij/haskell/psi/HaskellQvarId.java b/gen/intellij/haskell/psi/HaskellQvarId.java deleted file mode 100644 index 9760260f..00000000 --- a/gen/intellij/haskell/psi/HaskellQvarId.java +++ /dev/null @@ -1,20 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQvarId extends HaskellCompositeElement { - - @NotNull - HaskellQualifier getQualifier(); - - @NotNull - HaskellVarId getVarId(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - -} diff --git a/gen/intellij/haskell/psi/HaskellQvarOp.java b/gen/intellij/haskell/psi/HaskellQvarOp.java deleted file mode 100644 index e83d5445..00000000 --- a/gen/intellij/haskell/psi/HaskellQvarOp.java +++ /dev/null @@ -1,29 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; -import scala.Option; - -public interface HaskellQvarOp extends HaskellQVarConOpElement { - - @Nullable - HaskellQvarId getQvarId(); - - @Nullable - HaskellQvarSym getQvarSym(); - - @Nullable - HaskellVarId getVarId(); - - @Nullable - HaskellVarSym getVarSym(); - - String getName(); - - HaskellNamedElement getIdentifierElement(); - - Option getQualifier(); - -} diff --git a/gen/intellij/haskell/psi/HaskellQvarSym.java b/gen/intellij/haskell/psi/HaskellQvarSym.java deleted file mode 100644 index a0010edd..00000000 --- a/gen/intellij/haskell/psi/HaskellQvarSym.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQvarSym extends HaskellCompositeElement { - - @NotNull - HaskellQualifier getQualifier(); - - @NotNull - HaskellVarSym getVarSym(); - -} diff --git a/intellij/haskell/psi/HaskellAnnPragma.java b/gen/intellij/haskell/psi/HaskellSccPragma.java similarity index 51% rename from intellij/haskell/psi/HaskellAnnPragma.java rename to gen/intellij/haskell/psi/HaskellSccPragma.java index 13678f4b..274b4bd3 100644 --- a/intellij/haskell/psi/HaskellAnnPragma.java +++ b/gen/intellij/haskell/psi/HaskellSccPragma.java @@ -1,11 +1,9 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.NotNull; -public interface HaskellAnnPragma extends HaskellCompositeElement { +public interface HaskellSccPragma extends HaskellCompositeElement { @NotNull HaskellGeneralPragmaContent getGeneralPragmaContent(); diff --git a/gen/intellij/haskell/psi/HaskellSimpleclass.java b/gen/intellij/haskell/psi/HaskellSimpleclass.java index 3fd74e1d..a85bde5d 100644 --- a/gen/intellij/haskell/psi/HaskellSimpleclass.java +++ b/gen/intellij/haskell/psi/HaskellSimpleclass.java @@ -1,34 +1,17 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellSimpleclass extends HaskellCompositeElement { + @NotNull + List getQNameList(); + @Nullable - HaskellGtycon getGtycon(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getSimpleclassTildePartList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - - @NotNull - List getVarSymList(); + HaskellTtype getTtype(); } diff --git a/gen/intellij/haskell/psi/HaskellSimpleclassTildePart.java b/gen/intellij/haskell/psi/HaskellSimpleclassTildePart.java deleted file mode 100644 index 13e9844b..00000000 --- a/gen/intellij/haskell/psi/HaskellSimpleclassTildePart.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSimpleclassTildePart extends HaskellCompositeElement { - - @NotNull - List getQconList(); - - @NotNull - List getQvarList(); - -} diff --git a/gen/intellij/haskell/psi/HaskellSimpletype.java b/gen/intellij/haskell/psi/HaskellSimpletype.java index 77b5ab5f..d39c6fff 100644 --- a/gen/intellij/haskell/psi/HaskellSimpletype.java +++ b/gen/intellij/haskell/psi/HaskellSimpletype.java @@ -1,24 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import scala.collection.Seq; +import java.util.List; + public interface HaskellSimpletype extends HaskellCompositeElement { - @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQconOp getQconOp(); - - @Nullable - HaskellQvarOp getQvarOp(); + @NotNull + List getQNameList(); @Nullable HaskellTtype getTtype(); @@ -26,9 +18,6 @@ public interface HaskellSimpletype extends HaskellCompositeElement { @NotNull List getTypeSignatureList(); - @NotNull - List getVarIdList(); - Seq getIdentifierElements(); } diff --git a/gen/intellij/haskell/psi/HaskellSnl.java b/gen/intellij/haskell/psi/HaskellSnl.java deleted file mode 100644 index 1396d6a2..00000000 --- a/gen/intellij/haskell/psi/HaskellSnl.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSnl extends HaskellCompositeElement { - -} diff --git a/gen/intellij/haskell/psi/HaskellSubConstr2.java b/gen/intellij/haskell/psi/HaskellSubConstr2.java index 72443b08..92243d30 100644 --- a/gen/intellij/haskell/psi/HaskellSubConstr2.java +++ b/gen/intellij/haskell/psi/HaskellSubConstr2.java @@ -1,20 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellSubConstr2 extends HaskellCompositeElement { @NotNull - List getGtyconList(); - - @NotNull - List getQvarList(); - - @Nullable - HaskellQvarOp getQvarOp(); + List getQNameList(); @NotNull List getTtypeList(); @@ -22,7 +16,4 @@ public interface HaskellSubConstr2 extends HaskellCompositeElement { @NotNull List getTypeSignatureList(); - @NotNull - List getVarSymList(); - } diff --git a/gen/intellij/haskell/psi/HaskellTtype.java b/gen/intellij/haskell/psi/HaskellTtype.java index df9864c7..bbf8e67c 100644 --- a/gen/intellij/haskell/psi/HaskellTtype.java +++ b/gen/intellij/haskell/psi/HaskellTtype.java @@ -1,20 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellTtype extends HaskellCompositeElement { - @NotNull - List getGtyconList(); - @Nullable HaskellListType getListType(); @NotNull - List getQvarList(); + List getQNameList(); @NotNull List getTtypeList(); @@ -22,10 +20,4 @@ public interface HaskellTtype extends HaskellCompositeElement { @NotNull List getTypeSignatureList(); - @NotNull - List getVarIdList(); - - @NotNull - List getVarSymList(); - } diff --git a/gen/intellij/haskell/psi/HaskellTypeDeclaration.java b/gen/intellij/haskell/psi/HaskellTypeDeclaration.java index afc82f92..d135c14d 100644 --- a/gen/intellij/haskell/psi/HaskellTypeDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellTypeDeclaration.java @@ -1,19 +1,21 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public interface HaskellTypeDeclaration extends HaskellDeclarationElement { @Nullable HaskellExpression getExpression(); - @Nullable - HaskellKindSignature getKindSignature(); + @NotNull + List getKindSignatureList(); @NotNull HaskellSimpletype getSimpletype(); @@ -30,4 +32,6 @@ public interface HaskellTypeDeclaration extends HaskellDeclarationElement { Seq getIdentifierElements(); + Option getModuleName(); + } diff --git a/gen/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java b/gen/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java index a482b50c..8d0868cb 100644 --- a/gen/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java @@ -1,10 +1,10 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public interface HaskellTypeFamilyDeclaration extends HaskellDeclarationElement { @@ -21,4 +21,6 @@ public interface HaskellTypeFamilyDeclaration extends HaskellDeclarationElement Seq getIdentifierElements(); + Option getModuleName(); + } diff --git a/gen/intellij/haskell/psi/HaskellTypeFamilyType.java b/gen/intellij/haskell/psi/HaskellTypeFamilyType.java index 39fb52af..f6120f15 100644 --- a/gen/intellij/haskell/psi/HaskellTypeFamilyType.java +++ b/gen/intellij/haskell/psi/HaskellTypeFamilyType.java @@ -1,25 +1,22 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; +import org.jetbrains.annotations.NotNull; + import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; public interface HaskellTypeFamilyType extends HaskellCompositeElement { @NotNull List getContextList(); + @NotNull + List getQNameList(); + + @NotNull + List getQNamesList(); + @NotNull List getTtypeList(); - @NotNull - List getTypeFamilyType1List(); - - @NotNull - List getTypeFamilyType2List(); - - @NotNull - List getVarsList(); - } diff --git a/gen/intellij/haskell/psi/HaskellTypeFamilyType1.java b/gen/intellij/haskell/psi/HaskellTypeFamilyType1.java deleted file mode 100644 index ab3074bc..00000000 --- a/gen/intellij/haskell/psi/HaskellTypeFamilyType1.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeFamilyType1 extends HaskellCompositeElement { - - @NotNull - HaskellQcon getQcon(); - -} diff --git a/gen/intellij/haskell/psi/HaskellTypeFamilyType2.java b/gen/intellij/haskell/psi/HaskellTypeFamilyType2.java deleted file mode 100644 index 74c26b40..00000000 --- a/gen/intellij/haskell/psi/HaskellTypeFamilyType2.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeFamilyType2 extends HaskellCompositeElement { - - @NotNull - HaskellQvarOp getQvarOp(); - -} diff --git a/gen/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java b/gen/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java index 80d3cd42..06fac942 100644 --- a/gen/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java +++ b/gen/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java @@ -1,10 +1,9 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import scala.Option; import scala.collection.Seq; public interface HaskellTypeInstanceDeclaration extends HaskellDeclarationElement { @@ -18,4 +17,6 @@ public interface HaskellTypeInstanceDeclaration extends HaskellDeclarationElemen Seq getIdentifierElements(); + Option getModuleName(); + } diff --git a/gen/intellij/haskell/psi/HaskellTypeSignature.java b/gen/intellij/haskell/psi/HaskellTypeSignature.java index a0bb60ce..cae8a0b9 100644 --- a/gen/intellij/haskell/psi/HaskellTypeSignature.java +++ b/gen/intellij/haskell/psi/HaskellTypeSignature.java @@ -1,28 +1,27 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public interface HaskellTypeSignature extends HaskellDeclarationElement { @Nullable HaskellContext getContext(); + @NotNull + List getQNamesList(); + @Nullable HaskellScontext getScontext(); @NotNull - List getTtypeList(); - - @Nullable - HaskellVarId getVarId(); - - @NotNull - HaskellVars getVars(); + HaskellTtype getTtype(); String getName(); @@ -30,4 +29,6 @@ public interface HaskellTypeSignature extends HaskellDeclarationElement { Seq getIdentifierElements(); + Option getModuleName(); + } diff --git a/gen/intellij/haskell/psi/HaskellTypes.java b/gen/intellij/haskell/psi/HaskellTypes.java index afc4b706..8dda590d 100644 --- a/gen/intellij/haskell/psi/HaskellTypes.java +++ b/gen/intellij/haskell/psi/HaskellTypes.java @@ -1,9 +1,9 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import com.intellij.psi.tree.IElementType; -import com.intellij.psi.PsiElement; import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElement; +import com.intellij.psi.tree.IElementType; import intellij.haskell.psi.impl.*; public interface HaskellTypes { @@ -15,14 +15,16 @@ public interface HaskellTypes { IElementType HS_CLAZZ = new HaskellCompositeElementType("HS_CLAZZ"); IElementType HS_CNAME = new HaskellCompositeElementType("HS_CNAME"); IElementType HS_COMMENTS = new HaskellCompositeElementType("HS_COMMENTS"); + IElementType HS_CON = new HaskellCompositeElementType("HS_CON"); + IElementType HS_CONID = new HaskellCompositeElementType("HS_CONID"); + IElementType HS_CONOP = new HaskellCompositeElementType("HS_CONOP"); IElementType HS_CONSTANT_FOLDED_PRAGMA = new HaskellCompositeElementType("HS_CONSTANT_FOLDED_PRAGMA"); IElementType HS_CONSTR_1 = new HaskellCompositeElementType("HS_CONSTR_1"); IElementType HS_CONSTR_2 = new HaskellCompositeElementType("HS_CONSTR_2"); IElementType HS_CONSTR_3 = new HaskellCompositeElementType("HS_CONSTR_3"); IElementType HS_CONSTR_4 = new HaskellCompositeElementType("HS_CONSTR_4"); + IElementType HS_CONSYM = new HaskellCompositeElementType("HS_CONSYM"); IElementType HS_CONTEXT = new HaskellCompositeElementType("HS_CONTEXT"); - IElementType HS_CON_ID = new HaskellCompositeElementType("HS_CON_ID"); - IElementType HS_CON_SYM = new HaskellCompositeElementType("HS_CON_SYM"); IElementType HS_CTYPE_PRAGMA = new HaskellCompositeElementType("HS_CTYPE_PRAGMA"); IElementType HS_DATA_DECLARATION = new HaskellCompositeElementType("HS_DATA_DECLARATION"); IElementType HS_DATA_DECLARATION_DERIVING = new HaskellCompositeElementType("HS_DATA_DECLARATION_DERIVING"); @@ -37,22 +39,20 @@ public interface HaskellTypes { IElementType HS_FIELDDECL = new HaskellCompositeElementType("HS_FIELDDECL"); IElementType HS_FILE_HEADER = new HaskellCompositeElementType("HS_FILE_HEADER"); IElementType HS_FILE_HEADER_PRAGMA = new HaskellCompositeElementType("HS_FILE_HEADER_PRAGMA"); - IElementType HS_FIRST_LINE_EXPRESSION = new HaskellCompositeElementType("HS_FIRST_LINE_EXPRESSION"); - IElementType HS_FIXITY = new HaskellCompositeElementType("HS_FIXITY"); IElementType HS_FIXITY_DECLARATION = new HaskellCompositeElementType("HS_FIXITY_DECLARATION"); IElementType HS_FOREIGN_DECLARATION = new HaskellCompositeElementType("HS_FOREIGN_DECLARATION"); - IElementType HS_GCON_SYM = new HaskellCompositeElementType("HS_GCON_SYM"); IElementType HS_GENERAL_PRAGMA_CONTENT = new HaskellCompositeElementType("HS_GENERAL_PRAGMA_CONTENT"); IElementType HS_GTYCON = new HaskellCompositeElementType("HS_GTYCON"); IElementType HS_HADDOCK_PRAGMA = new HaskellCompositeElementType("HS_HADDOCK_PRAGMA"); IElementType HS_IDECL = new HaskellCompositeElementType("HS_IDECL"); IElementType HS_IMPORT_DECLARATION = new HaskellCompositeElementType("HS_IMPORT_DECLARATION"); + IElementType HS_IMPORT_DECLARATIONS = new HaskellCompositeElementType("HS_IMPORT_DECLARATIONS"); IElementType HS_IMPORT_EMPTY_SPEC = new HaskellCompositeElementType("HS_IMPORT_EMPTY_SPEC"); IElementType HS_IMPORT_HIDING = new HaskellCompositeElementType("HS_IMPORT_HIDING"); IElementType HS_IMPORT_HIDING_SPEC = new HaskellCompositeElementType("HS_IMPORT_HIDING_SPEC"); IElementType HS_IMPORT_ID = new HaskellCompositeElementType("HS_IMPORT_ID"); IElementType HS_IMPORT_IDS_SPEC = new HaskellCompositeElementType("HS_IMPORT_IDS_SPEC"); - IElementType HS_IMPORT_MODULE = new HaskellCompositeElementType("HS_IMPORT_MODULE"); + IElementType HS_IMPORT_PACKAGE_NAME = new HaskellCompositeElementType("HS_IMPORT_PACKAGE_NAME"); IElementType HS_IMPORT_QUALIFIED = new HaskellCompositeElementType("HS_IMPORT_QUALIFIED"); IElementType HS_IMPORT_QUALIFIED_AS = new HaskellCompositeElementType("HS_IMPORT_QUALIFIED_AS"); IElementType HS_IMPORT_SPEC = new HaskellCompositeElementType("HS_IMPORT_SPEC"); @@ -64,43 +64,38 @@ public interface HaskellTypes { IElementType HS_INSTVAR = new HaskellCompositeElementType("HS_INSTVAR"); IElementType HS_KIND_SIGNATURE = new HaskellCompositeElementType("HS_KIND_SIGNATURE"); IElementType HS_LANGUAGE_PRAGMA = new HaskellCompositeElementType("HS_LANGUAGE_PRAGMA"); - IElementType HS_LAST_LINE_EXPRESSION = new HaskellCompositeElementType("HS_LAST_LINE_EXPRESSION"); - IElementType HS_LINE_EXPRESSION = new HaskellCompositeElementType("HS_LINE_EXPRESSION"); IElementType HS_LINE_PRAGMA = new HaskellCompositeElementType("HS_LINE_PRAGMA"); IElementType HS_LIST_TYPE = new HaskellCompositeElementType("HS_LIST_TYPE"); - IElementType HS_LITERAL = new HaskellCompositeElementType("HS_LITERAL"); IElementType HS_MINIMAL_PRAGMA = new HaskellCompositeElementType("HS_MINIMAL_PRAGMA"); + IElementType HS_MODID = new HaskellCompositeElementType("HS_MODID"); IElementType HS_MODULE_BODY = new HaskellCompositeElementType("HS_MODULE_BODY"); IElementType HS_MODULE_DECLARATION = new HaskellCompositeElementType("HS_MODULE_DECLARATION"); - IElementType HS_MOD_ID = new HaskellCompositeElementType("HS_MOD_ID"); IElementType HS_NEWCONSTR = new HaskellCompositeElementType("HS_NEWCONSTR"); IElementType HS_NEWCONSTR_FIELDDECL = new HaskellCompositeElementType("HS_NEWCONSTR_FIELDDECL"); IElementType HS_NEWTYPE_DECLARATION = new HaskellCompositeElementType("HS_NEWTYPE_DECLARATION"); IElementType HS_NOINLINE_PRAGMA = new HaskellCompositeElementType("HS_NOINLINE_PRAGMA"); IElementType HS_NOUNPACK_PRAGMA = new HaskellCompositeElementType("HS_NOUNPACK_PRAGMA"); - IElementType HS_OP = new HaskellCompositeElementType("HS_OP"); - IElementType HS_OPS = new HaskellCompositeElementType("HS_OPS"); + IElementType HS_OPTIONS_GHC_OPTION = new HaskellCompositeElementType("HS_OPTIONS_GHC_OPTION"); IElementType HS_OPTIONS_GHC_PRAGMA = new HaskellCompositeElementType("HS_OPTIONS_GHC_PRAGMA"); IElementType HS_OTHER_PRAGMA = new HaskellCompositeElementType("HS_OTHER_PRAGMA"); IElementType HS_OVERLAP_PRAGMA = new HaskellCompositeElementType("HS_OVERLAP_PRAGMA"); - IElementType HS_QCON = new HaskellCompositeElementType("HS_QCON"); - IElementType HS_QCON_ID = new HaskellCompositeElementType("HS_QCON_ID"); - IElementType HS_QCON_ID_QUALIFIER = new HaskellCompositeElementType("HS_QCON_ID_QUALIFIER"); - IElementType HS_QCON_OP = new HaskellCompositeElementType("HS_QCON_OP"); - IElementType HS_QCON_SYM = new HaskellCompositeElementType("HS_QCON_SYM"); IElementType HS_QQ_EXPRESSION = new HaskellCompositeElementType("HS_QQ_EXPRESSION"); IElementType HS_QUALIFIER = new HaskellCompositeElementType("HS_QUALIFIER"); IElementType HS_QUASI_QUOTE = new HaskellCompositeElementType("HS_QUASI_QUOTE"); - IElementType HS_QVAR = new HaskellCompositeElementType("HS_QVAR"); - IElementType HS_QVAR_ID = new HaskellCompositeElementType("HS_QVAR_ID"); - IElementType HS_QVAR_OP = new HaskellCompositeElementType("HS_QVAR_OP"); - IElementType HS_QVAR_SYM = new HaskellCompositeElementType("HS_QVAR_SYM"); + IElementType HS_Q_CON = new HaskellCompositeElementType("HS_Q_CON"); + IElementType HS_Q_CON_QUALIFIER = new HaskellCompositeElementType("HS_Q_CON_QUALIFIER"); + IElementType HS_Q_CON_QUALIFIER_1 = new HaskellCompositeElementType("HS_Q_CON_QUALIFIER_1"); + IElementType HS_Q_CON_QUALIFIER_2 = new HaskellCompositeElementType("HS_Q_CON_QUALIFIER_2"); + IElementType HS_Q_CON_QUALIFIER_3 = new HaskellCompositeElementType("HS_Q_CON_QUALIFIER_3"); + IElementType HS_Q_CON_QUALIFIER_4 = new HaskellCompositeElementType("HS_Q_CON_QUALIFIER_4"); + IElementType HS_Q_NAME = new HaskellCompositeElementType("HS_Q_NAME"); + IElementType HS_Q_NAMES = new HaskellCompositeElementType("HS_Q_NAMES"); + IElementType HS_Q_VAR_CON = new HaskellCompositeElementType("HS_Q_VAR_CON"); IElementType HS_RULES_PRAGMA = new HaskellCompositeElementType("HS_RULES_PRAGMA"); + IElementType HS_SCC_PRAGMA = new HaskellCompositeElementType("HS_SCC_PRAGMA"); IElementType HS_SCONTEXT = new HaskellCompositeElementType("HS_SCONTEXT"); IElementType HS_SIMPLECLASS = new HaskellCompositeElementType("HS_SIMPLECLASS"); - IElementType HS_SIMPLECLASS_TILDE_PART = new HaskellCompositeElementType("HS_SIMPLECLASS_TILDE_PART"); IElementType HS_SIMPLETYPE = new HaskellCompositeElementType("HS_SIMPLETYPE"); - IElementType HS_SNL = new HaskellCompositeElementType("HS_SNL"); IElementType HS_SOURCE_PRAGMA = new HaskellCompositeElementType("HS_SOURCE_PRAGMA"); IElementType HS_SPECIALIZE_PRAGMA = new HaskellCompositeElementType("HS_SPECIALIZE_PRAGMA"); IElementType HS_SUB_CONSTR_2 = new HaskellCompositeElementType("HS_SUB_CONSTR_2"); @@ -109,15 +104,15 @@ public interface HaskellTypes { IElementType HS_TYPE_DECLARATION = new HaskellCompositeElementType("HS_TYPE_DECLARATION"); IElementType HS_TYPE_FAMILY_DECLARATION = new HaskellCompositeElementType("HS_TYPE_FAMILY_DECLARATION"); IElementType HS_TYPE_FAMILY_TYPE = new HaskellCompositeElementType("HS_TYPE_FAMILY_TYPE"); - IElementType HS_TYPE_FAMILY_TYPE_1 = new HaskellCompositeElementType("HS_TYPE_FAMILY_TYPE_1"); - IElementType HS_TYPE_FAMILY_TYPE_2 = new HaskellCompositeElementType("HS_TYPE_FAMILY_TYPE_2"); IElementType HS_TYPE_INSTANCE_DECLARATION = new HaskellCompositeElementType("HS_TYPE_INSTANCE_DECLARATION"); IElementType HS_TYPE_SIGNATURE = new HaskellCompositeElementType("HS_TYPE_SIGNATURE"); IElementType HS_UNPACK_NOUNPACK_PRAGMA = new HaskellCompositeElementType("HS_UNPACK_NOUNPACK_PRAGMA"); IElementType HS_UNPACK_PRAGMA = new HaskellCompositeElementType("HS_UNPACK_PRAGMA"); - IElementType HS_VARS = new HaskellCompositeElementType("HS_VARS"); - IElementType HS_VAR_ID = new HaskellCompositeElementType("HS_VAR_ID"); - IElementType HS_VAR_SYM = new HaskellCompositeElementType("HS_VAR_SYM"); + IElementType HS_VAR = new HaskellCompositeElementType("HS_VAR"); + IElementType HS_VARID = new HaskellCompositeElementType("HS_VARID"); + IElementType HS_VAROP = new HaskellCompositeElementType("HS_VAROP"); + IElementType HS_VARSYM = new HaskellCompositeElementType("HS_VARSYM"); + IElementType HS_VAR_CON = new HaskellCompositeElementType("HS_VAR_CON"); IElementType HS_AT = new HaskellTokenType("AT"); IElementType HS_BACKQUOTE = new HaskellTokenType("BACKQUOTE"); @@ -125,18 +120,18 @@ public interface HaskellTypes { IElementType HS_CASE = new HaskellTokenType("CASE"); IElementType HS_CHARACTER_LITERAL = new HaskellTokenType("CHARACTER_LITERAL"); IElementType HS_CLASS = new HaskellTokenType("CLASS"); - IElementType HS_COLON = new HaskellTokenType("COLON"); IElementType HS_COLON_COLON = new HaskellTokenType("COLON_COLON"); IElementType HS_COMMA = new HaskellTokenType("COMMA"); IElementType HS_COMMENT = new HaskellTokenType("COMMENT"); - IElementType HS_CONID_ID = new HaskellTokenType("CONID_ID"); IElementType HS_CONSYM_ID = new HaskellTokenType("CONSYM_ID"); + IElementType HS_CON_ID = new HaskellTokenType("CON_ID"); IElementType HS_DATA = new HaskellTokenType("DATA"); IElementType HS_DECIMAL = new HaskellTokenType("DECIMAL"); IElementType HS_DEFAULT = new HaskellTokenType("DEFAULT"); IElementType HS_DERIVING = new HaskellTokenType("DERIVING"); IElementType HS_DO = new HaskellTokenType("DO"); IElementType HS_DOT = new HaskellTokenType("DOT"); + IElementType HS_DOT_DOT = new HaskellTokenType("DOT_DOT"); IElementType HS_DOUBLE_RIGHT_ARROW = new HaskellTokenType("DOUBLE_RIGHT_ARROW"); IElementType HS_ELSE = new HaskellTokenType("ELSE"); IElementType HS_EQUAL = new HaskellTokenType("EQUAL"); @@ -186,8 +181,8 @@ public interface HaskellTypes { IElementType HS_TYPE_FAMILY = new HaskellTokenType("TYPE_FAMILY"); IElementType HS_TYPE_INSTANCE = new HaskellTokenType("TYPE_INSTANCE"); IElementType HS_UNDERSCORE = new HaskellTokenType("UNDERSCORE"); - IElementType HS_VARID_ID = new HaskellTokenType("VARID_ID"); IElementType HS_VARSYM_ID = new HaskellTokenType("VARSYM_ID"); + IElementType HS_VAR_ID = new HaskellTokenType("VAR_ID"); IElementType HS_VERTICAL_BAR = new HaskellTokenType("VERTICAL_BAR"); IElementType HS_WHERE = new HaskellTokenType("WHERE"); @@ -215,6 +210,15 @@ public interface HaskellTypes { else if (type == HS_COMMENTS) { return new HaskellCommentsImpl(node); } + else if (type == HS_CON) { + return new HaskellConImpl(node); + } + else if (type == HS_CONID) { + return new HaskellConidImpl(node); + } + else if (type == HS_CONOP) { + return new HaskellConopImpl(node); + } else if (type == HS_CONSTANT_FOLDED_PRAGMA) { return new HaskellConstantFoldedPragmaImpl(node); } @@ -230,15 +234,12 @@ public interface HaskellTypes { else if (type == HS_CONSTR_4) { return new HaskellConstr4Impl(node); } + else if (type == HS_CONSYM) { + return new HaskellConsymImpl(node); + } else if (type == HS_CONTEXT) { return new HaskellContextImpl(node); } - else if (type == HS_CON_ID) { - return new HaskellConIdImpl(node); - } - else if (type == HS_CON_SYM) { - return new HaskellConSymImpl(node); - } else if (type == HS_CTYPE_PRAGMA) { return new HaskellCtypePragmaImpl(node); } @@ -281,21 +282,12 @@ public interface HaskellTypes { else if (type == HS_FILE_HEADER_PRAGMA) { return new HaskellFileHeaderPragmaImpl(node); } - else if (type == HS_FIRST_LINE_EXPRESSION) { - return new HaskellFirstLineExpressionImpl(node); - } - else if (type == HS_FIXITY) { - return new HaskellFixityImpl(node); - } else if (type == HS_FIXITY_DECLARATION) { return new HaskellFixityDeclarationImpl(node); } else if (type == HS_FOREIGN_DECLARATION) { return new HaskellForeignDeclarationImpl(node); } - else if (type == HS_GCON_SYM) { - return new HaskellGconSymImpl(node); - } else if (type == HS_GENERAL_PRAGMA_CONTENT) { return new HaskellGeneralPragmaContentImpl(node); } @@ -311,6 +303,9 @@ public interface HaskellTypes { else if (type == HS_IMPORT_DECLARATION) { return new HaskellImportDeclarationImpl(node); } + else if (type == HS_IMPORT_DECLARATIONS) { + return new HaskellImportDeclarationsImpl(node); + } else if (type == HS_IMPORT_EMPTY_SPEC) { return new HaskellImportEmptySpecImpl(node); } @@ -326,8 +321,8 @@ public interface HaskellTypes { else if (type == HS_IMPORT_IDS_SPEC) { return new HaskellImportIdsSpecImpl(node); } - else if (type == HS_IMPORT_MODULE) { - return new HaskellImportModuleImpl(node); + else if (type == HS_IMPORT_PACKAGE_NAME) { + return new HaskellImportPackageNameImpl(node); } else if (type == HS_IMPORT_QUALIFIED) { return new HaskellImportQualifiedImpl(node); @@ -362,33 +357,24 @@ public interface HaskellTypes { else if (type == HS_LANGUAGE_PRAGMA) { return new HaskellLanguagePragmaImpl(node); } - else if (type == HS_LAST_LINE_EXPRESSION) { - return new HaskellLastLineExpressionImpl(node); - } - else if (type == HS_LINE_EXPRESSION) { - return new HaskellLineExpressionImpl(node); - } else if (type == HS_LINE_PRAGMA) { return new HaskellLinePragmaImpl(node); } else if (type == HS_LIST_TYPE) { return new HaskellListTypeImpl(node); } - else if (type == HS_LITERAL) { - return new HaskellLiteralImpl(node); - } else if (type == HS_MINIMAL_PRAGMA) { return new HaskellMinimalPragmaImpl(node); } + else if (type == HS_MODID) { + return new HaskellModidImpl(node); + } else if (type == HS_MODULE_BODY) { return new HaskellModuleBodyImpl(node); } else if (type == HS_MODULE_DECLARATION) { return new HaskellModuleDeclarationImpl(node); } - else if (type == HS_MOD_ID) { - return new HaskellModIdImpl(node); - } else if (type == HS_NEWCONSTR) { return new HaskellNewconstrImpl(node); } @@ -404,11 +390,8 @@ public interface HaskellTypes { else if (type == HS_NOUNPACK_PRAGMA) { return new HaskellNounpackPragmaImpl(node); } - else if (type == HS_OP) { - return new HaskellOpImpl(node); - } - else if (type == HS_OPS) { - return new HaskellOpsImpl(node); + else if (type == HS_OPTIONS_GHC_OPTION) { + return new HaskellOptionsGhcOptionImpl(node); } else if (type == HS_OPTIONS_GHC_PRAGMA) { return new HaskellOptionsGhcPragmaImpl(node); @@ -419,21 +402,6 @@ public interface HaskellTypes { else if (type == HS_OVERLAP_PRAGMA) { return new HaskellOverlapPragmaImpl(node); } - else if (type == HS_QCON) { - return new HaskellQconImpl(node); - } - else if (type == HS_QCON_ID) { - return new HaskellQconIdImpl(node); - } - else if (type == HS_QCON_ID_QUALIFIER) { - return new HaskellQconIdQualifierImpl(node); - } - else if (type == HS_QCON_OP) { - return new HaskellQconOpImpl(node); - } - else if (type == HS_QCON_SYM) { - return new HaskellQconSymImpl(node); - } else if (type == HS_QQ_EXPRESSION) { return new HaskellQqExpressionImpl(node); } @@ -443,36 +411,48 @@ public interface HaskellTypes { else if (type == HS_QUASI_QUOTE) { return new HaskellQuasiQuoteImpl(node); } - else if (type == HS_QVAR) { - return new HaskellQvarImpl(node); + else if (type == HS_Q_CON) { + return new HaskellQConImpl(node); } - else if (type == HS_QVAR_ID) { - return new HaskellQvarIdImpl(node); + else if (type == HS_Q_CON_QUALIFIER) { + return new HaskellQConQualifierImpl(node); } - else if (type == HS_QVAR_OP) { - return new HaskellQvarOpImpl(node); + else if (type == HS_Q_CON_QUALIFIER_1) { + return new HaskellQConQualifier1Impl(node); } - else if (type == HS_QVAR_SYM) { - return new HaskellQvarSymImpl(node); + else if (type == HS_Q_CON_QUALIFIER_2) { + return new HaskellQConQualifier2Impl(node); + } + else if (type == HS_Q_CON_QUALIFIER_3) { + return new HaskellQConQualifier3Impl(node); + } + else if (type == HS_Q_CON_QUALIFIER_4) { + return new HaskellQConQualifier4Impl(node); + } + else if (type == HS_Q_NAME) { + return new HaskellQNameImpl(node); + } + else if (type == HS_Q_NAMES) { + return new HaskellQNamesImpl(node); + } + else if (type == HS_Q_VAR_CON) { + return new HaskellQVarConImpl(node); } else if (type == HS_RULES_PRAGMA) { return new HaskellRulesPragmaImpl(node); } + else if (type == HS_SCC_PRAGMA) { + return new HaskellSccPragmaImpl(node); + } else if (type == HS_SCONTEXT) { return new HaskellScontextImpl(node); } else if (type == HS_SIMPLECLASS) { return new HaskellSimpleclassImpl(node); } - else if (type == HS_SIMPLECLASS_TILDE_PART) { - return new HaskellSimpleclassTildePartImpl(node); - } else if (type == HS_SIMPLETYPE) { return new HaskellSimpletypeImpl(node); } - else if (type == HS_SNL) { - return new HaskellSnlImpl(node); - } else if (type == HS_SOURCE_PRAGMA) { return new HaskellSourcePragmaImpl(node); } @@ -497,12 +477,6 @@ public interface HaskellTypes { else if (type == HS_TYPE_FAMILY_TYPE) { return new HaskellTypeFamilyTypeImpl(node); } - else if (type == HS_TYPE_FAMILY_TYPE_1) { - return new HaskellTypeFamilyType1Impl(node); - } - else if (type == HS_TYPE_FAMILY_TYPE_2) { - return new HaskellTypeFamilyType2Impl(node); - } else if (type == HS_TYPE_INSTANCE_DECLARATION) { return new HaskellTypeInstanceDeclarationImpl(node); } @@ -515,14 +489,20 @@ public interface HaskellTypes { else if (type == HS_UNPACK_PRAGMA) { return new HaskellUnpackPragmaImpl(node); } - else if (type == HS_VARS) { - return new HaskellVarsImpl(node); + else if (type == HS_VAR) { + return new HaskellVarImpl(node); } - else if (type == HS_VAR_ID) { - return new HaskellVarIdImpl(node); + else if (type == HS_VARID) { + return new HaskellVaridImpl(node); } - else if (type == HS_VAR_SYM) { - return new HaskellVarSymImpl(node); + else if (type == HS_VAROP) { + return new HaskellVaropImpl(node); + } + else if (type == HS_VARSYM) { + return new HaskellVarsymImpl(node); + } + else if (type == HS_VAR_CON) { + return new HaskellVarConImpl(node); } throw new AssertionError("Unknown element type: " + type); } diff --git a/gen/intellij/haskell/psi/HaskellVar.java b/gen/intellij/haskell/psi/HaskellVar.java new file mode 100644 index 00000000..e7075d6c --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellVar.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; + +public interface HaskellVar extends HaskellCNameElement { + + @Nullable + HaskellVarid getVarid(); + + @Nullable + HaskellVarsym getVarsym(); + + String getName(); + +} diff --git a/gen/intellij/haskell/psi/HaskellVarCon.java b/gen/intellij/haskell/psi/HaskellVarCon.java new file mode 100644 index 00000000..06949407 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellVarCon.java @@ -0,0 +1,24 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; + +public interface HaskellVarCon extends HaskellCompositeElement { + + @Nullable + HaskellConid getConid(); + + @Nullable + HaskellConsym getConsym(); + + @Nullable + HaskellVarid getVarid(); + + @Nullable + HaskellVarsym getVarsym(); + + String getName(); + + HaskellNamedElement getIdentifierElement(); + +} diff --git a/gen/intellij/haskell/psi/HaskellVarid.java b/gen/intellij/haskell/psi/HaskellVarid.java new file mode 100644 index 00000000..db28187c --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellVarid.java @@ -0,0 +1,20 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiReference; + +public interface HaskellVarid extends HaskellNamedElement { + + String getName(); + + PsiElement setName(String newName); + + HaskellNamedElement getNameIdentifier(); + + PsiReference getReference(); + + ItemPresentation getPresentation(); + +} diff --git a/gen/intellij/haskell/psi/HaskellVarop.java b/gen/intellij/haskell/psi/HaskellVarop.java new file mode 100644 index 00000000..4369189e --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellVarop.java @@ -0,0 +1,16 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import org.jetbrains.annotations.Nullable; + +public interface HaskellVarop extends HaskellCNameElement { + + @Nullable + HaskellVarid getVarid(); + + @Nullable + HaskellVarsym getVarsym(); + + String getName(); + +} diff --git a/gen/intellij/haskell/psi/HaskellVars.java b/gen/intellij/haskell/psi/HaskellVars.java deleted file mode 100644 index b02f1d6a..00000000 --- a/gen/intellij/haskell/psi/HaskellVars.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellVars extends HaskellCompositeElement { - - @NotNull - List getQvarList(); - -} diff --git a/gen/intellij/haskell/psi/HaskellVarsym.java b/gen/intellij/haskell/psi/HaskellVarsym.java new file mode 100644 index 00000000..46df1636 --- /dev/null +++ b/gen/intellij/haskell/psi/HaskellVarsym.java @@ -0,0 +1,20 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi; + +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiReference; + +public interface HaskellVarsym extends HaskellNamedElement { + + String getName(); + + PsiElement setName(String newName); + + HaskellNamedElement getNameIdentifier(); + + PsiReference getReference(); + + ItemPresentation getPresentation(); + +} diff --git a/gen/intellij/haskell/psi/HaskellVisitor.java b/gen/intellij/haskell/psi/HaskellVisitor.java index 17f273ba..f5311181 100644 --- a/gen/intellij/haskell/psi/HaskellVisitor.java +++ b/gen/intellij/haskell/psi/HaskellVisitor.java @@ -1,8 +1,8 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi; -import org.jetbrains.annotations.*; import com.intellij.psi.PsiElementVisitor; +import org.jetbrains.annotations.NotNull; public class HaskellVisitor extends PsiElementVisitor { @@ -27,19 +27,23 @@ public class HaskellVisitor extends PsiElementVisitor { } public void visitCname(@NotNull HaskellCname o) { - visitCompositeElement(o); + visitQualifiedNameElement(o); } public void visitComments(@NotNull HaskellComments o) { visitCompositeElement(o); } - public void visitConId(@NotNull HaskellConId o) { + public void visitCon(@NotNull HaskellCon o) { + visitCNameElement(o); + } + + public void visitConid(@NotNull HaskellConid o) { visitNamedElement(o); } - public void visitConSym(@NotNull HaskellConSym o) { - visitNamedElement(o); + public void visitConop(@NotNull HaskellConop o) { + visitCNameElement(o); } public void visitConstantFoldedPragma(@NotNull HaskellConstantFoldedPragma o) { @@ -62,6 +66,10 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } + public void visitConsym(@NotNull HaskellConsym o) { + visitNamedElement(o); + } + public void visitContext(@NotNull HaskellContext o) { visitCompositeElement(o); } @@ -122,14 +130,6 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitFirstLineExpression(@NotNull HaskellFirstLineExpression o) { - visitLineExpressionElement(o); - } - - public void visitFixity(@NotNull HaskellFixity o) { - visitCompositeElement(o); - } - public void visitFixityDeclaration(@NotNull HaskellFixityDeclaration o) { visitCompositeElement(o); } @@ -138,10 +138,6 @@ public class HaskellVisitor extends PsiElementVisitor { visitDeclarationElement(o); } - public void visitGconSym(@NotNull HaskellGconSym o) { - visitCompositeElement(o); - } - public void visitGeneralPragmaContent(@NotNull HaskellGeneralPragmaContent o) { visitCompositeElement(o); } @@ -162,6 +158,10 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } + public void visitImportDeclarations(@NotNull HaskellImportDeclarations o) { + visitCompositeElement(o); + } + public void visitImportEmptySpec(@NotNull HaskellImportEmptySpec o) { visitCompositeElement(o); } @@ -182,7 +182,7 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitImportModule(@NotNull HaskellImportModule o) { + public void visitImportPackageName(@NotNull HaskellImportPackageName o) { visitCompositeElement(o); } @@ -230,14 +230,6 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitLastLineExpression(@NotNull HaskellLastLineExpression o) { - visitLineExpressionElement(o); - } - - public void visitLineExpression(@NotNull HaskellLineExpression o) { - visitLineExpressionElement(o); - } - public void visitLinePragma(@NotNull HaskellLinePragma o) { visitCompositeElement(o); } @@ -246,15 +238,11 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitLiteral(@NotNull HaskellLiteral o) { - visitCompositeElement(o); - } - public void visitMinimalPragma(@NotNull HaskellMinimalPragma o) { visitCompositeElement(o); } - public void visitModId(@NotNull HaskellModId o) { + public void visitModid(@NotNull HaskellModid o) { visitNamedElement(o); } @@ -286,11 +274,7 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitOp(@NotNull HaskellOp o) { - visitCompositeElement(o); - } - - public void visitOps(@NotNull HaskellOps o) { + public void visitOptionsGhcOption(@NotNull HaskellOptionsGhcOption o) { visitCompositeElement(o); } @@ -306,23 +290,39 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitQcon(@NotNull HaskellQcon o) { - visitQVarConOpElement(o); - } - - public void visitQconId(@NotNull HaskellQconId o) { + public void visitQCon(@NotNull HaskellQCon o) { visitCompositeElement(o); } - public void visitQconIdQualifier(@NotNull HaskellQconIdQualifier o) { + public void visitQConQualifier(@NotNull HaskellQConQualifier o) { visitCompositeElement(o); } - public void visitQconOp(@NotNull HaskellQconOp o) { - visitQVarConOpElement(o); + public void visitQConQualifier1(@NotNull HaskellQConQualifier1 o) { + visitQualifierElement(o); } - public void visitQconSym(@NotNull HaskellQconSym o) { + public void visitQConQualifier2(@NotNull HaskellQConQualifier2 o) { + visitQualifierElement(o); + } + + public void visitQConQualifier3(@NotNull HaskellQConQualifier3 o) { + visitQualifierElement(o); + } + + public void visitQConQualifier4(@NotNull HaskellQConQualifier4 o) { + visitQualifierElement(o); + } + + public void visitQName(@NotNull HaskellQName o) { + visitQualifiedNameElement(o); + } + + public void visitQNames(@NotNull HaskellQNames o) { + visitCompositeElement(o); + } + + public void visitQVarCon(@NotNull HaskellQVarCon o) { visitCompositeElement(o); } @@ -331,33 +331,21 @@ public class HaskellVisitor extends PsiElementVisitor { } public void visitQualifier(@NotNull HaskellQualifier o) { - visitNamedElement(o); + visitQualifierElement(o); } public void visitQuasiQuote(@NotNull HaskellQuasiQuote o) { visitCompositeElement(o); } - public void visitQvar(@NotNull HaskellQvar o) { - visitQVarConOpElement(o); - } - - public void visitQvarId(@NotNull HaskellQvarId o) { - visitCompositeElement(o); - } - - public void visitQvarOp(@NotNull HaskellQvarOp o) { - visitQVarConOpElement(o); - } - - public void visitQvarSym(@NotNull HaskellQvarSym o) { - visitCompositeElement(o); - } - public void visitRulesPragma(@NotNull HaskellRulesPragma o) { visitCompositeElement(o); } + public void visitSccPragma(@NotNull HaskellSccPragma o) { + visitCompositeElement(o); + } + public void visitScontext(@NotNull HaskellScontext o) { visitCompositeElement(o); } @@ -366,18 +354,10 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitSimpleclassTildePart(@NotNull HaskellSimpleclassTildePart o) { - visitCompositeElement(o); - } - public void visitSimpletype(@NotNull HaskellSimpletype o) { visitCompositeElement(o); } - public void visitSnl(@NotNull HaskellSnl o) { - visitCompositeElement(o); - } - public void visitSourcePragma(@NotNull HaskellSourcePragma o) { visitCompositeElement(o); } @@ -410,14 +390,6 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitTypeFamilyType1(@NotNull HaskellTypeFamilyType1 o) { - visitCompositeElement(o); - } - - public void visitTypeFamilyType2(@NotNull HaskellTypeFamilyType2 o) { - visitCompositeElement(o); - } - public void visitTypeInstanceDeclaration(@NotNull HaskellTypeInstanceDeclaration o) { visitDeclarationElement(o); } @@ -434,15 +406,27 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitVarId(@NotNull HaskellVarId o) { + public void visitVar(@NotNull HaskellVar o) { + visitCNameElement(o); + } + + public void visitVarCon(@NotNull HaskellVarCon o) { + visitCompositeElement(o); + } + + public void visitVarid(@NotNull HaskellVarid o) { visitNamedElement(o); } - public void visitVarSym(@NotNull HaskellVarSym o) { + public void visitVarop(@NotNull HaskellVarop o) { + visitCNameElement(o); + } + + public void visitVarsym(@NotNull HaskellVarsym o) { visitNamedElement(o); } - public void visitVars(@NotNull HaskellVars o) { + public void visitCNameElement(@NotNull HaskellCNameElement o) { visitCompositeElement(o); } @@ -454,15 +438,15 @@ public class HaskellVisitor extends PsiElementVisitor { visitCompositeElement(o); } - public void visitLineExpressionElement(@NotNull HaskellLineExpressionElement o) { - visitCompositeElement(o); - } - public void visitNamedElement(@NotNull HaskellNamedElement o) { visitCompositeElement(o); } - public void visitQVarConOpElement(@NotNull HaskellQVarConOpElement o) { + public void visitQualifiedNameElement(@NotNull HaskellQualifiedNameElement o) { + visitCompositeElement(o); + } + + public void visitQualifierElement(@NotNull HaskellQualifierElement o) { visitCompositeElement(o); } diff --git a/gen/intellij/haskell/psi/impl/HaskellClassDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellClassDeclarationImpl.java index 2db5607e..2508fe1d 100644 --- a/gen/intellij/haskell/psi/impl/HaskellClassDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellClassDeclarationImpl.java @@ -1,17 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public class HaskellClassDeclarationImpl extends HaskellCompositeElementImpl implements HaskellClassDeclaration { public HaskellClassDeclarationImpl(ASTNode node) { @@ -33,12 +34,6 @@ public class HaskellClassDeclarationImpl extends HaskellCompositeElementImpl imp return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCdecl.class); } - @Override - @Nullable - public HaskellContext getContext() { - return findChildByClass(HaskellContext.class); - } - @Override @NotNull public List getExpressionList() { @@ -47,14 +42,8 @@ public class HaskellClassDeclarationImpl extends HaskellCompositeElementImpl imp @Override @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -69,12 +58,6 @@ public class HaskellClassDeclarationImpl extends HaskellCompositeElementImpl imp return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); } - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - public String getName() { return HaskellPsiImplUtil.getName(this); } @@ -87,4 +70,8 @@ public class HaskellClassDeclarationImpl extends HaskellCompositeElementImpl imp return HaskellPsiImplUtil.getIdentifierElements(this); } + public Option getModuleName() { + return HaskellPsiImplUtil.getModuleName(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellClazzImpl.java b/gen/intellij/haskell/psi/impl/HaskellClazzImpl.java index 7698ffcf..fccd9a52 100644 --- a/gen/intellij/haskell/psi/impl/HaskellClazzImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellClazzImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellClazzImpl extends HaskellCompositeElementImpl implements HaskellClazz { @@ -27,20 +26,8 @@ public class HaskellClazzImpl extends HaskellCompositeElementImpl implements Has @Override @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -55,10 +42,4 @@ public class HaskellClazzImpl extends HaskellCompositeElementImpl implements Has return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); } - @Override - @NotNull - public List getVarSymList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarSym.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellCnameImpl.java b/gen/intellij/haskell/psi/impl/HaskellCnameImpl.java index 0553e7ac..a0942ecd 100644 --- a/gen/intellij/haskell/psi/impl/HaskellCnameImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellCnameImpl.java @@ -1,14 +1,12 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; public class HaskellCnameImpl extends HaskellCompositeElementImpl implements HaskellCname { @@ -27,26 +25,42 @@ public class HaskellCnameImpl extends HaskellCompositeElementImpl implements Has @Override @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); + public HaskellCon getCon() { + return findChildByClass(HaskellCon.class); } @Override @Nullable - public HaskellQconOp getQconOp() { - return findChildByClass(HaskellQconOp.class); + public HaskellConop getConop() { + return findChildByClass(HaskellConop.class); } @Override @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); + public HaskellVar getVar() { + return findChildByClass(HaskellVar.class); } @Override @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); + public HaskellVarop getVarop() { + return findChildByClass(HaskellVarop.class); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + + public HaskellNamedElement getIdentifierElement() { + return HaskellPsiImplUtil.getIdentifierElement(this); + } + + public Option getQualifierName() { + return HaskellPsiImplUtil.getQualifierName(this); + } + + public String getNameWithoutParens() { + return HaskellPsiImplUtil.getNameWithoutParens(this); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellConIdImpl.java b/gen/intellij/haskell/psi/impl/HaskellConIdImpl.java deleted file mode 100644 index f130387f..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellConIdImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; - -public class HaskellConIdImpl extends HaskellNamedElementImpl implements HaskellConId { - - public HaskellConIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellVarId getVarId() { - return findChildByClass(HaskellVarId.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public PsiElement setName(String newName) { - return HaskellPsiImplUtil.setName(this, newName); - } - - public HaskellNamedElement getNameIdentifier() { - return HaskellPsiImplUtil.getNameIdentifier(this); - } - - public PsiReference getReference() { - return HaskellPsiImplUtil.getReference(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellConImpl.java b/gen/intellij/haskell/psi/impl/HaskellConImpl.java new file mode 100644 index 00000000..23a9957f --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellConImpl.java @@ -0,0 +1,44 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.HaskellCon; +import intellij.haskell.psi.HaskellConid; +import intellij.haskell.psi.HaskellConsym; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class HaskellConImpl extends HaskellCNameElementImpl implements HaskellCon { + + public HaskellConImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitCon(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + @Override + @Nullable + public HaskellConid getConid() { + return findChildByClass(HaskellConid.class); + } + + @Override + @Nullable + public HaskellConsym getConsym() { + return findChildByClass(HaskellConsym.class); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + +} diff --git a/intellij/haskell/psi/impl/HaskellVarIdImpl.java b/gen/intellij/haskell/psi/impl/HaskellConidImpl.java similarity index 68% rename from intellij/haskell/psi/impl/HaskellVarIdImpl.java rename to gen/intellij/haskell/psi/impl/HaskellConidImpl.java index 9b93c7a3..6a9b7a64 100644 --- a/intellij/haskell/psi/impl/HaskellVarIdImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellConidImpl.java @@ -1,26 +1,24 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; +import intellij.haskell.psi.HaskellConid; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellVarIdImpl extends HaskellNamedElementImpl implements HaskellVarId { +public class HaskellConidImpl extends HaskellNamedElementImpl implements HaskellConid { - public HaskellVarIdImpl(ASTNode node) { + public HaskellConidImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitVarId(this); + visitor.visitConid(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -48,8 +46,4 @@ public class HaskellVarIdImpl extends HaskellNamedElementImpl implements Haskell return HaskellPsiImplUtil.getPresentation(this); } - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellConopImpl.java b/gen/intellij/haskell/psi/impl/HaskellConopImpl.java new file mode 100644 index 00000000..24b0f1e8 --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellConopImpl.java @@ -0,0 +1,44 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.HaskellConid; +import intellij.haskell.psi.HaskellConop; +import intellij.haskell.psi.HaskellConsym; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class HaskellConopImpl extends HaskellCNameElementImpl implements HaskellConop { + + public HaskellConopImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitConop(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + @Override + @Nullable + public HaskellConid getConid() { + return findChildByClass(HaskellConid.class); + } + + @Override + @Nullable + public HaskellConsym getConsym() { + return findChildByClass(HaskellConsym.class); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellConstr1Impl.java b/gen/intellij/haskell/psi/impl/HaskellConstr1Impl.java index 21a01523..e461691c 100644 --- a/gen/intellij/haskell/psi/impl/HaskellConstr1Impl.java +++ b/gen/intellij/haskell/psi/impl/HaskellConstr1Impl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellConstr1Impl extends HaskellCompositeElementImpl implements HaskellConstr1 { @@ -33,8 +32,8 @@ public class HaskellConstr1Impl extends HaskellCompositeElementImpl implements H @Override @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); + public HaskellQName getQName() { + return findNotNullChildByClass(HaskellQName.class); } @Override diff --git a/gen/intellij/haskell/psi/impl/HaskellConstr2Impl.java b/gen/intellij/haskell/psi/impl/HaskellConstr2Impl.java index 58458dde..b3d7c72a 100644 --- a/gen/intellij/haskell/psi/impl/HaskellConstr2Impl.java +++ b/gen/intellij/haskell/psi/impl/HaskellConstr2Impl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellConstr2Impl extends HaskellCompositeElementImpl implements HaskellConstr2 { @@ -27,14 +26,20 @@ public class HaskellConstr2Impl extends HaskellCompositeElementImpl implements H @Override @NotNull - public HaskellQconOp getQconOp() { - return findNotNullChildByClass(HaskellQconOp.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @NotNull - public List getSubConstr2List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSubConstr2.class); + public List getTtypeList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); + } + + @Override + @NotNull + public List getTypeSignatureList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); } @Override diff --git a/gen/intellij/haskell/psi/impl/HaskellConstr3Impl.java b/gen/intellij/haskell/psi/impl/HaskellConstr3Impl.java index 81f260ff..0256e7db 100644 --- a/gen/intellij/haskell/psi/impl/HaskellConstr3Impl.java +++ b/gen/intellij/haskell/psi/impl/HaskellConstr3Impl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellConstr3Impl extends HaskellCompositeElementImpl implements HaskellConstr3 { @@ -27,38 +26,14 @@ public class HaskellConstr3Impl extends HaskellCompositeElementImpl implements H @Override @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); + public HaskellQName getQName() { + return findNotNullChildByClass(HaskellQName.class); } @Override @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); + public List getSubConstr2List() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSubConstr2.class); } @Override @@ -67,10 +42,4 @@ public class HaskellConstr3Impl extends HaskellCompositeElementImpl implements H return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellUnpackNounpackPragma.class); } - @Override - @NotNull - public List getVarSymList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarSym.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellConstr4Impl.java b/gen/intellij/haskell/psi/impl/HaskellConstr4Impl.java index 3eba959a..c039def5 100644 --- a/gen/intellij/haskell/psi/impl/HaskellConstr4Impl.java +++ b/gen/intellij/haskell/psi/impl/HaskellConstr4Impl.java @@ -1,14 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellConstr4; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellUnpackNounpackPragma; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellConstr4Impl extends HaskellCompositeElementImpl implements HaskellConstr4 { @@ -27,20 +29,8 @@ public class HaskellConstr4Impl extends HaskellCompositeElementImpl implements H @Override @NotNull - public HaskellGconSym getGconSym() { - return findNotNullChildByClass(HaskellGconSym.class); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public HaskellQvar getQvar() { - return findNotNullChildByClass(HaskellQvar.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override diff --git a/gen/intellij/haskell/psi/impl/HaskellVarIdImpl.java b/gen/intellij/haskell/psi/impl/HaskellConsymImpl.java similarity index 68% rename from gen/intellij/haskell/psi/impl/HaskellVarIdImpl.java rename to gen/intellij/haskell/psi/impl/HaskellConsymImpl.java index 9b93c7a3..48509f17 100644 --- a/gen/intellij/haskell/psi/impl/HaskellVarIdImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellConsymImpl.java @@ -1,26 +1,24 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; +import intellij.haskell.psi.HaskellConsym; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellVarIdImpl extends HaskellNamedElementImpl implements HaskellVarId { +public class HaskellConsymImpl extends HaskellNamedElementImpl implements HaskellConsym { - public HaskellVarIdImpl(ASTNode node) { + public HaskellConsymImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitVarId(this); + visitor.visitConsym(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -48,8 +46,4 @@ public class HaskellVarIdImpl extends HaskellNamedElementImpl implements Haskell return HaskellPsiImplUtil.getPresentation(this); } - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellDataDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellDataDeclarationImpl.java index 3fae5371..1d258a36 100644 --- a/gen/intellij/haskell/psi/impl/HaskellDataDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellDataDeclarationImpl.java @@ -1,17 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public class HaskellDataDeclarationImpl extends HaskellCompositeElementImpl implements HaskellDataDeclaration { public HaskellDataDeclarationImpl(ASTNode node) { @@ -89,14 +90,20 @@ public class HaskellDataDeclarationImpl extends HaskellCompositeElementImpl impl @Override @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); + } + + @Override + @Nullable + public HaskellScontext getScontext() { + return findChildByClass(HaskellScontext.class); } @Override @NotNull - public List getSimpletypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSimpletype.class); + public HaskellSimpletype getSimpletype() { + return findNotNullChildByClass(HaskellSimpletype.class); } public String getName() { @@ -111,7 +118,7 @@ public class HaskellDataDeclarationImpl extends HaskellCompositeElementImpl impl return HaskellPsiImplUtil.getIdentifierElements(this); } - public String getModuleName() { + public Option getModuleName() { return HaskellPsiImplUtil.getModuleName(this); } diff --git a/gen/intellij/haskell/psi/impl/HaskellDefaultDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellDefaultDeclarationImpl.java index 7e4b279b..ec6fe6cb 100644 --- a/gen/intellij/haskell/psi/impl/HaskellDefaultDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellDefaultDeclarationImpl.java @@ -1,17 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public class HaskellDefaultDeclarationImpl extends HaskellCompositeElementImpl implements HaskellDefaultDeclaration { public HaskellDefaultDeclarationImpl(ASTNode node) { @@ -51,7 +52,7 @@ public class HaskellDefaultDeclarationImpl extends HaskellCompositeElementImpl i return HaskellPsiImplUtil.getIdentifierElements(this); } - public String getModuleName() { + public Option getModuleName() { return HaskellPsiImplUtil.getModuleName(this); } diff --git a/gen/intellij/haskell/psi/impl/HaskellDerivingDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellDerivingDeclarationImpl.java index c9322883..8cb0acae 100644 --- a/gen/intellij/haskell/psi/impl/HaskellDerivingDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellDerivingDeclarationImpl.java @@ -1,15 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public class HaskellDerivingDeclarationImpl extends HaskellCompositeElementImpl implements HaskellDerivingDeclaration { @@ -35,8 +33,8 @@ public class HaskellDerivingDeclarationImpl extends HaskellCompositeElementImpl @Override @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); + public HaskellQName getQName() { + return findNotNullChildByClass(HaskellQName.class); } @Override @@ -57,4 +55,8 @@ public class HaskellDerivingDeclarationImpl extends HaskellCompositeElementImpl return HaskellPsiImplUtil.getIdentifierElements(this); } + public Option getModuleName() { + return HaskellPsiImplUtil.getModuleName(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellDummyPragmaImpl.java b/gen/intellij/haskell/psi/impl/HaskellDummyPragmaImpl.java index bee3e2c8..cde8ca15 100644 --- a/gen/intellij/haskell/psi/impl/HaskellDummyPragmaImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellDummyPragmaImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellDummyPragma; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class HaskellDummyPragmaImpl extends HaskellCompositeElementImpl implements HaskellDummyPragma { @@ -25,4 +24,10 @@ public class HaskellDummyPragmaImpl extends HaskellCompositeElementImpl implemen else super.accept(visitor); } + @Override + @Nullable + public HaskellQName getQName() { + return findChildByClass(HaskellQName.class); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellExportImpl.java b/gen/intellij/haskell/psi/impl/HaskellExportImpl.java index 37664452..129608bd 100644 --- a/gen/intellij/haskell/psi/impl/HaskellExportImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellExportImpl.java @@ -1,14 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellExportImpl extends HaskellCompositeElementImpl implements HaskellExport { @@ -31,6 +31,12 @@ public class HaskellExportImpl extends HaskellCompositeElementImpl implements Ha return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCname.class); } + @Override + @Nullable + public HaskellConid getConid() { + return findChildByClass(HaskellConid.class); + } + @Override @Nullable public HaskellDotDotParens getDotDotParens() { @@ -39,26 +45,14 @@ public class HaskellExportImpl extends HaskellCompositeElementImpl implements Ha @Override @Nullable - public HaskellModId getModId() { - return findChildByClass(HaskellModId.class); + public HaskellModid getModid() { + return findChildByClass(HaskellModid.class); } @Override @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); + public HaskellQCon getQCon() { + return findChildByClass(HaskellQCon.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellExpressionImpl.java b/gen/intellij/haskell/psi/impl/HaskellExpressionImpl.java index 9766328a..6c9f4a69 100644 --- a/gen/intellij/haskell/psi/impl/HaskellExpressionImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellExpressionImpl.java @@ -1,14 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellExpression; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellSccPragma; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellExpressionImpl extends HaskellCompositeElementImpl implements HaskellExpression { @@ -26,21 +28,15 @@ public class HaskellExpressionImpl extends HaskellCompositeElementImpl implement } @Override - @Nullable - public HaskellFirstLineExpression getFirstLineExpression() { - return findChildByClass(HaskellFirstLineExpression.class); + @NotNull + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @NotNull - public HaskellLastLineExpression getLastLineExpression() { - return findNotNullChildByClass(HaskellLastLineExpression.class); - } - - @Override - @NotNull - public List getLineExpressionList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLineExpression.class); + public List getSccPragmaList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSccPragma.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellFielddeclImpl.java b/gen/intellij/haskell/psi/impl/HaskellFielddeclImpl.java index 3fb08ee2..7ea1abeb 100644 --- a/gen/intellij/haskell/psi/impl/HaskellFielddeclImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellFielddeclImpl.java @@ -1,14 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellFielddeclImpl extends HaskellCompositeElementImpl implements HaskellFielddecl { @@ -26,21 +26,15 @@ public class HaskellFielddeclImpl extends HaskellCompositeElementImpl implements } @Override - @Nullable - public HaskellGtycon getGtycon() { - return findChildByClass(HaskellGtycon.class); + @NotNull + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); + public HaskellQNames getQNames() { + return findNotNullChildByClass(HaskellQNames.class); } @Override @@ -61,16 +55,4 @@ public class HaskellFielddeclImpl extends HaskellCompositeElementImpl implements return findChildByClass(HaskellUnpackNounpackPragma.class); } - @Override - @NotNull - public List getVarSymList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarSym.class); - } - - @Override - @NotNull - public HaskellVars getVars() { - return findNotNullChildByClass(HaskellVars.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellFirstLineExpressionImpl.java b/gen/intellij/haskell/psi/impl/HaskellFirstLineExpressionImpl.java deleted file mode 100644 index ba5f31ed..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellFirstLineExpressionImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellFirstLineExpressionImpl extends HaskellLineExpressionElementImpl implements HaskellFirstLineExpression { - - public HaskellFirstLineExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitFirstLineExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - - @Override - @NotNull - public HaskellSnl getSnl() { - return findNotNullChildByClass(HaskellSnl.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellFixityDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellFixityDeclarationImpl.java index ea834901..51720351 100644 --- a/gen/intellij/haskell/psi/impl/HaskellFixityDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellFixityDeclarationImpl.java @@ -1,14 +1,12 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellFixityDeclaration; +import intellij.haskell.psi.HaskellQNames; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; public class HaskellFixityDeclarationImpl extends HaskellCompositeElementImpl implements HaskellFixityDeclaration { @@ -27,14 +25,8 @@ public class HaskellFixityDeclarationImpl extends HaskellCompositeElementImpl im @Override @NotNull - public HaskellFixity getFixity() { - return findNotNullChildByClass(HaskellFixity.class); - } - - @Override - @NotNull - public HaskellOps getOps() { - return findNotNullChildByClass(HaskellOps.class); + public HaskellQNames getQNames() { + return findNotNullChildByClass(HaskellQNames.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellFixityImpl.java b/gen/intellij/haskell/psi/impl/HaskellFixityImpl.java deleted file mode 100644 index 4b95c4a8..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellFixityImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellFixityImpl extends HaskellCompositeElementImpl implements HaskellFixity { - - public HaskellFixityImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitFixity(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellForeignDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellForeignDeclarationImpl.java index eec14dfd..dd105fdf 100644 --- a/gen/intellij/haskell/psi/impl/HaskellForeignDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellForeignDeclarationImpl.java @@ -1,15 +1,15 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.HaskellExpression; +import intellij.haskell.psi.HaskellForeignDeclaration; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import scala.Option; import scala.collection.Seq; public class HaskellForeignDeclarationImpl extends HaskellCompositeElementImpl implements HaskellForeignDeclaration { @@ -45,7 +45,7 @@ public class HaskellForeignDeclarationImpl extends HaskellCompositeElementImpl i return HaskellPsiImplUtil.getIdentifierElements(this); } - public String getModuleName() { + public Option getModuleName() { return HaskellPsiImplUtil.getModuleName(this); } diff --git a/gen/intellij/haskell/psi/impl/HaskellGconSymImpl.java b/gen/intellij/haskell/psi/impl/HaskellGconSymImpl.java deleted file mode 100644 index 7a86dd2c..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellGconSymImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellGconSymImpl extends HaskellCompositeElementImpl implements HaskellGconSym { - - public HaskellGconSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitGconSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellConSym getConSym() { - return findChildByClass(HaskellConSym.class); - } - - @Override - @Nullable - public HaskellQconSym getQconSym() { - return findChildByClass(HaskellQconSym.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java b/gen/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java index 8788014f..d587884d 100644 --- a/gen/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellGeneralPragmaContent; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; public class HaskellGeneralPragmaContentImpl extends HaskellCompositeElementImpl implements HaskellGeneralPragmaContent { @@ -25,40 +22,4 @@ public class HaskellGeneralPragmaContentImpl extends HaskellCompositeElementImpl else super.accept(visitor); } - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellGtyconImpl.java b/gen/intellij/haskell/psi/impl/HaskellGtyconImpl.java index c76e170b..baee5683 100644 --- a/gen/intellij/haskell/psi/impl/HaskellGtyconImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellGtyconImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellGtycon; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class HaskellGtyconImpl extends HaskellCompositeElementImpl implements HaskellGtycon { @@ -27,8 +26,8 @@ public class HaskellGtyconImpl extends HaskellCompositeElementImpl implements Ha @Override @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); + public HaskellQName getQName() { + return findChildByClass(HaskellQName.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellHaddockPragmaImpl.java b/gen/intellij/haskell/psi/impl/HaskellHaddockPragmaImpl.java index 3289e033..c8a5fe24 100644 --- a/gen/intellij/haskell/psi/impl/HaskellHaddockPragmaImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellHaddockPragmaImpl.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellHaddockPragma; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; public class HaskellHaddockPragmaImpl extends HaskellCompositeElementImpl implements HaskellHaddockPragma { @@ -25,10 +22,4 @@ public class HaskellHaddockPragmaImpl extends HaskellCompositeElementImpl implem else super.accept(visitor); } - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellImportDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellImportDeclarationImpl.java index 202cfb21..8adc0910 100644 --- a/gen/intellij/haskell/psi/impl/HaskellImportDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellImportDeclarationImpl.java @@ -1,14 +1,12 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; public class HaskellImportDeclarationImpl extends HaskellCompositeElementImpl implements HaskellImportDeclaration { @@ -27,8 +25,8 @@ public class HaskellImportDeclarationImpl extends HaskellCompositeElementImpl im @Override @Nullable - public HaskellImportModule getImportModule() { - return findChildByClass(HaskellImportModule.class); + public HaskellImportPackageName getImportPackageName() { + return findChildByClass(HaskellImportPackageName.class); } @Override @@ -49,13 +47,19 @@ public class HaskellImportDeclarationImpl extends HaskellCompositeElementImpl im return findChildByClass(HaskellImportSpec.class); } + @Override + @Nullable + public HaskellModid getModid() { + return findChildByClass(HaskellModid.class); + } + @Override @Nullable public HaskellSourcePragma getSourcePragma() { return findChildByClass(HaskellSourcePragma.class); } - public String getModuleName() { + public Option getModuleName() { return HaskellPsiImplUtil.getModuleName(this); } diff --git a/intellij/haskell/psi/impl/HaskellModuleBodyImpl.java b/gen/intellij/haskell/psi/impl/HaskellImportDeclarationsImpl.java similarity index 55% rename from intellij/haskell/psi/impl/HaskellModuleBodyImpl.java rename to gen/intellij/haskell/psi/impl/HaskellImportDeclarationsImpl.java index 7c4b9e01..12a4ae71 100644 --- a/intellij/haskell/psi/impl/HaskellModuleBodyImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellImportDeclarationsImpl.java @@ -1,23 +1,25 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellCfilesPragma; +import intellij.haskell.psi.HaskellImportDeclaration; +import intellij.haskell.psi.HaskellImportDeclarations; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellModuleBodyImpl extends HaskellCompositeElementImpl implements HaskellModuleBody { +import java.util.List; - public HaskellModuleBodyImpl(ASTNode node) { +public class HaskellImportDeclarationsImpl extends HaskellCompositeElementImpl implements HaskellImportDeclarations { + + public HaskellImportDeclarationsImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitModuleBody(this); + visitor.visitImportDeclarations(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -37,16 +39,4 @@ public class HaskellModuleBodyImpl extends HaskellCompositeElementImpl implement return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellImportDeclaration.class); } - @Override - @NotNull - public List getModuleDeclarationList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellModuleDeclaration.class); - } - - @Override - @NotNull - public List getTopDeclarationList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTopDeclaration.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellImportIdImpl.java b/gen/intellij/haskell/psi/impl/HaskellImportIdImpl.java index 244e2a16..a2a383cc 100644 --- a/gen/intellij/haskell/psi/impl/HaskellImportIdImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellImportIdImpl.java @@ -1,14 +1,17 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellCname; +import intellij.haskell.psi.HaskellDotDotParens; +import intellij.haskell.psi.HaskellImportId; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellImportIdImpl extends HaskellCompositeElementImpl implements HaskellImportId { @@ -37,16 +40,4 @@ public class HaskellImportIdImpl extends HaskellCompositeElementImpl implements return findChildByClass(HaskellDotDotParens.class); } - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellImportModuleImpl.java b/gen/intellij/haskell/psi/impl/HaskellImportModuleImpl.java deleted file mode 100644 index 916c2424..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellImportModuleImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportModuleImpl extends HaskellCompositeElementImpl implements HaskellImportModule { - - public HaskellImportModuleImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportModule(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellModId getModId() { - return findNotNullChildByClass(HaskellModId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellSnlImpl.java b/gen/intellij/haskell/psi/impl/HaskellImportPackageNameImpl.java similarity index 53% rename from intellij/haskell/psi/impl/HaskellSnlImpl.java rename to gen/intellij/haskell/psi/impl/HaskellImportPackageNameImpl.java index 093cb088..b06b4655 100644 --- a/intellij/haskell/psi/impl/HaskellSnlImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellImportPackageNameImpl.java @@ -1,23 +1,20 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellImportPackageName; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellSnlImpl extends HaskellCompositeElementImpl implements HaskellSnl { +public class HaskellImportPackageNameImpl extends HaskellCompositeElementImpl implements HaskellImportPackageName { - public HaskellSnlImpl(ASTNode node) { + public HaskellImportPackageNameImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSnl(this); + visitor.visitImportPackageName(this); } public void accept(@NotNull PsiElementVisitor visitor) { diff --git a/gen/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java b/gen/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java index bb9ab2d8..566a4c10 100644 --- a/gen/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java @@ -1,14 +1,12 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellImportQualifiedAs; +import intellij.haskell.psi.HaskellQualifier; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; public class HaskellImportQualifiedAsImpl extends HaskellCompositeElementImpl implements HaskellImportQualifiedAs { @@ -25,16 +23,10 @@ public class HaskellImportQualifiedAsImpl extends HaskellCompositeElementImpl im else super.accept(visitor); } - @Override - @Nullable - public HaskellQualifier getQualifier() { - return findChildByClass(HaskellQualifier.class); - } - @Override @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); + public HaskellQualifier getQualifier() { + return findNotNullChildByClass(HaskellQualifier.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java b/gen/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java index d598b166..5d94098a 100644 --- a/gen/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java @@ -1,14 +1,11 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellImportQualified; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; public class HaskellImportQualifiedImpl extends HaskellCompositeElementImpl implements HaskellImportQualified { @@ -25,10 +22,4 @@ public class HaskellImportQualifiedImpl extends HaskellCompositeElementImpl impl else super.accept(visitor); } - @Override - @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellInstImpl.java b/gen/intellij/haskell/psi/impl/HaskellInstImpl.java index dac533a3..a1c8810a 100644 --- a/gen/intellij/haskell/psi/impl/HaskellInstImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellInstImpl.java @@ -1,14 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellInstImpl extends HaskellCompositeElementImpl implements HaskellInst { @@ -39,8 +39,8 @@ public class HaskellInstImpl extends HaskellCompositeElementImpl implements Hask @Override @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); + public HaskellQName getQName() { + return findChildByClass(HaskellQName.class); } @Override diff --git a/gen/intellij/haskell/psi/impl/HaskellInstanceDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellInstanceDeclarationImpl.java index fe2bafe6..3d6949c9 100644 --- a/gen/intellij/haskell/psi/impl/HaskellInstanceDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellInstanceDeclarationImpl.java @@ -1,17 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public class HaskellInstanceDeclarationImpl extends HaskellCompositeElementImpl implements HaskellInstanceDeclaration { public HaskellInstanceDeclarationImpl(ASTNode node) { @@ -53,8 +54,8 @@ public class HaskellInstanceDeclarationImpl extends HaskellCompositeElementImpl @Override @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -65,8 +66,8 @@ public class HaskellInstanceDeclarationImpl extends HaskellCompositeElementImpl @Override @NotNull - public List getVarIdList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarId.class); + public List getVarConList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarCon.class); } public String getName() { @@ -81,4 +82,8 @@ public class HaskellInstanceDeclarationImpl extends HaskellCompositeElementImpl return HaskellPsiImplUtil.getIdentifierElements(this); } + public Option getModuleName() { + return HaskellPsiImplUtil.getModuleName(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellInstvarImpl.java b/gen/intellij/haskell/psi/impl/HaskellInstvarImpl.java index ee450b9b..af168d5c 100644 --- a/gen/intellij/haskell/psi/impl/HaskellInstvarImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellInstvarImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellInstvar; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class HaskellInstvarImpl extends HaskellCompositeElementImpl implements HaskellInstvar { @@ -27,20 +26,8 @@ public class HaskellInstvarImpl extends HaskellCompositeElementImpl implements H @Override @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); + public HaskellQName getQName() { + return findChildByClass(HaskellQName.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java b/gen/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java index bdca0419..f8c3e850 100644 --- a/gen/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellKindSignature; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellTtype; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; public class HaskellKindSignatureImpl extends HaskellCompositeElementImpl implements HaskellKindSignature { @@ -27,14 +26,14 @@ public class HaskellKindSignatureImpl extends HaskellCompositeElementImpl implem @Override @NotNull - public HaskellTtype getTtype() { - return findNotNullChildByClass(HaskellTtype.class); + public HaskellQName getQName() { + return findNotNullChildByClass(HaskellQName.class); } @Override @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); + public HaskellTtype getTtype() { + return findNotNullChildByClass(HaskellTtype.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellLanguagePragmaImpl.java b/gen/intellij/haskell/psi/impl/HaskellLanguagePragmaImpl.java index 2cd5b207..437e823e 100644 --- a/gen/intellij/haskell/psi/impl/HaskellLanguagePragmaImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellLanguagePragmaImpl.java @@ -1,14 +1,15 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellLanguagePragma; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellLanguagePragmaImpl extends HaskellCompositeElementImpl implements HaskellLanguagePragma { @@ -27,8 +28,8 @@ public class HaskellLanguagePragmaImpl extends HaskellCompositeElementImpl imple @Override @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellLastLineExpressionImpl.java b/gen/intellij/haskell/psi/impl/HaskellLastLineExpressionImpl.java deleted file mode 100644 index d06158d8..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellLastLineExpressionImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLastLineExpressionImpl extends HaskellLineExpressionElementImpl implements HaskellLastLineExpression { - - public HaskellLastLineExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLastLineExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellLineExpressionImpl.java b/gen/intellij/haskell/psi/impl/HaskellLineExpressionImpl.java deleted file mode 100644 index 5caef2d5..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellLineExpressionImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLineExpressionImpl extends HaskellLineExpressionElementImpl implements HaskellLineExpression { - - public HaskellLineExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLineExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - - @Override - @NotNull - public HaskellSnl getSnl() { - return findNotNullChildByClass(HaskellSnl.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellListTypeImpl.java b/gen/intellij/haskell/psi/impl/HaskellListTypeImpl.java index 87935e6a..8bd5d1b5 100644 --- a/gen/intellij/haskell/psi/impl/HaskellListTypeImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellListTypeImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellListType; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class HaskellListTypeImpl extends HaskellCompositeElementImpl implements HaskellListType { @@ -25,4 +24,10 @@ public class HaskellListTypeImpl extends HaskellCompositeElementImpl implements else super.accept(visitor); } + @Override + @Nullable + public HaskellQName getQName() { + return findChildByClass(HaskellQName.class); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellLiteralImpl.java b/gen/intellij/haskell/psi/impl/HaskellLiteralImpl.java deleted file mode 100644 index 38c8d4be..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellLiteralImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLiteralImpl extends HaskellCompositeElementImpl implements HaskellLiteral { - - public HaskellLiteralImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLiteral(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellModIdImpl.java b/gen/intellij/haskell/psi/impl/HaskellModidImpl.java similarity index 68% rename from gen/intellij/haskell/psi/impl/HaskellModIdImpl.java rename to gen/intellij/haskell/psi/impl/HaskellModidImpl.java index e88d3b3b..416057dc 100644 --- a/gen/intellij/haskell/psi/impl/HaskellModIdImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellModidImpl.java @@ -1,26 +1,24 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; +import intellij.haskell.psi.HaskellModid; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellModIdImpl extends HaskellNamedElementImpl implements HaskellModId { +public class HaskellModidImpl extends HaskellNamedElementImpl implements HaskellModid { - public HaskellModIdImpl(ASTNode node) { + public HaskellModidImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitModId(this); + visitor.visitModid(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -48,8 +46,4 @@ public class HaskellModIdImpl extends HaskellNamedElementImpl implements Haskell return HaskellPsiImplUtil.getPresentation(this); } - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellModuleBodyImpl.java b/gen/intellij/haskell/psi/impl/HaskellModuleBodyImpl.java index 7c4b9e01..77ab1cee 100644 --- a/gen/intellij/haskell/psi/impl/HaskellModuleBodyImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellModuleBodyImpl.java @@ -1,14 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellModuleBodyImpl extends HaskellCompositeElementImpl implements HaskellModuleBody { @@ -27,20 +27,14 @@ public class HaskellModuleBodyImpl extends HaskellCompositeElementImpl implement @Override @NotNull - public List getCfilesPragmaList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCfilesPragma.class); + public HaskellImportDeclarations getImportDeclarations() { + return findNotNullChildByClass(HaskellImportDeclarations.class); } @Override - @NotNull - public List getImportDeclarationList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellImportDeclaration.class); - } - - @Override - @NotNull - public List getModuleDeclarationList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellModuleDeclaration.class); + @Nullable + public HaskellModuleDeclaration getModuleDeclaration() { + return findChildByClass(HaskellModuleDeclaration.class); } @Override diff --git a/gen/intellij/haskell/psi/impl/HaskellModuleDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellModuleDeclarationImpl.java index a79bd5f4..8581496b 100644 --- a/gen/intellij/haskell/psi/impl/HaskellModuleDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellModuleDeclarationImpl.java @@ -1,15 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public class HaskellModuleDeclarationImpl extends HaskellCompositeElementImpl implements HaskellModuleDeclaration { @@ -39,16 +37,10 @@ public class HaskellModuleDeclarationImpl extends HaskellCompositeElementImpl im return findChildByClass(HaskellExports.class); } - @Override - @Nullable - public HaskellExpression getExpression() { - return findChildByClass(HaskellExpression.class); - } - @Override @NotNull - public HaskellModId getModId() { - return findNotNullChildByClass(HaskellModId.class); + public HaskellModid getModid() { + return findNotNullChildByClass(HaskellModid.class); } public String getName() { @@ -63,7 +55,7 @@ public class HaskellModuleDeclarationImpl extends HaskellCompositeElementImpl im return HaskellPsiImplUtil.getIdentifierElements(this); } - public String getModuleName() { + public Option getModuleName() { return HaskellPsiImplUtil.getModuleName(this); } diff --git a/gen/intellij/haskell/psi/impl/HaskellNewconstrFielddeclImpl.java b/gen/intellij/haskell/psi/impl/HaskellNewconstrFielddeclImpl.java index 9943b2ac..4887aabc 100644 --- a/gen/intellij/haskell/psi/impl/HaskellNewconstrFielddeclImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellNewconstrFielddeclImpl.java @@ -1,14 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellNewconstrFielddecl; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellTtype; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellNewconstrFielddeclImpl extends HaskellCompositeElementImpl implements HaskellNewconstrFielddecl { @@ -27,14 +29,8 @@ public class HaskellNewconstrFielddeclImpl extends HaskellCompositeElementImpl i @Override @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public HaskellQvar getQvar() { - return findNotNullChildByClass(HaskellQvar.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override diff --git a/gen/intellij/haskell/psi/impl/HaskellNewconstrImpl.java b/gen/intellij/haskell/psi/impl/HaskellNewconstrImpl.java index c394ede3..12b12960 100644 --- a/gen/intellij/haskell/psi/impl/HaskellNewconstrImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellNewconstrImpl.java @@ -1,14 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellNewconstrImpl extends HaskellCompositeElementImpl implements HaskellNewconstr { @@ -25,28 +25,16 @@ public class HaskellNewconstrImpl extends HaskellCompositeElementImpl implements else super.accept(visitor); } - @Override - @Nullable - public HaskellGtycon getGtycon() { - return findChildByClass(HaskellGtycon.class); - } - @Override @Nullable public HaskellNewconstrFielddecl getNewconstrFielddecl() { return findChildByClass(HaskellNewconstrFielddecl.class); } - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - @Override @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -61,10 +49,4 @@ public class HaskellNewconstrImpl extends HaskellCompositeElementImpl implements return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); } - @Override - @NotNull - public List getVarSymList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarSym.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellNewtypeDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellNewtypeDeclarationImpl.java index 6b63cb6a..0d34dec0 100644 --- a/gen/intellij/haskell/psi/impl/HaskellNewtypeDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellNewtypeDeclarationImpl.java @@ -1,15 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public class HaskellNewtypeDeclarationImpl extends HaskellCompositeElementImpl implements HaskellNewtypeDeclaration { @@ -69,7 +67,7 @@ public class HaskellNewtypeDeclarationImpl extends HaskellCompositeElementImpl i return HaskellPsiImplUtil.getIdentifierElements(this); } - public String getModuleName() { + public Option getModuleName() { return HaskellPsiImplUtil.getModuleName(this); } diff --git a/gen/intellij/haskell/psi/impl/HaskellNoinlinePragmaImpl.java b/gen/intellij/haskell/psi/impl/HaskellNoinlinePragmaImpl.java index d1af40e2..30d87250 100644 --- a/gen/intellij/haskell/psi/impl/HaskellNoinlinePragmaImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellNoinlinePragmaImpl.java @@ -1,14 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellNoinlinePragma; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellSccPragma; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellNoinlinePragmaImpl extends HaskellCompositeElementImpl implements HaskellNoinlinePragma { @@ -27,38 +29,14 @@ public class HaskellNoinlinePragmaImpl extends HaskellCompositeElementImpl imple @Override @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); + public List getSccPragmaList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSccPragma.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellOpsImpl.java b/gen/intellij/haskell/psi/impl/HaskellOpsImpl.java deleted file mode 100644 index d55e6903..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellOpsImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellOpsImpl extends HaskellCompositeElementImpl implements HaskellOps { - - public HaskellOpsImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitOps(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellOp.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellSnlImpl.java b/gen/intellij/haskell/psi/impl/HaskellOptionsGhcOptionImpl.java similarity index 53% rename from gen/intellij/haskell/psi/impl/HaskellSnlImpl.java rename to gen/intellij/haskell/psi/impl/HaskellOptionsGhcOptionImpl.java index 093cb088..fc2ec070 100644 --- a/gen/intellij/haskell/psi/impl/HaskellSnlImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellOptionsGhcOptionImpl.java @@ -1,23 +1,20 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellOptionsGhcOption; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellSnlImpl extends HaskellCompositeElementImpl implements HaskellSnl { +public class HaskellOptionsGhcOptionImpl extends HaskellCompositeElementImpl implements HaskellOptionsGhcOption { - public HaskellSnlImpl(ASTNode node) { + public HaskellOptionsGhcOptionImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSnl(this); + visitor.visitOptionsGhcOption(this); } public void accept(@NotNull PsiElementVisitor visitor) { diff --git a/gen/intellij/haskell/psi/impl/HaskellOptionsGhcPragmaImpl.java b/gen/intellij/haskell/psi/impl/HaskellOptionsGhcPragmaImpl.java index 2094ccea..72b87c1f 100644 --- a/gen/intellij/haskell/psi/impl/HaskellOptionsGhcPragmaImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellOptionsGhcPragmaImpl.java @@ -1,14 +1,15 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellOptionsGhcOption; +import intellij.haskell.psi.HaskellOptionsGhcPragma; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellOptionsGhcPragmaImpl extends HaskellCompositeElementImpl implements HaskellOptionsGhcPragma { @@ -27,8 +28,8 @@ public class HaskellOptionsGhcPragmaImpl extends HaskellCompositeElementImpl imp @Override @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); + public List getOptionsGhcOptionList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellOptionsGhcOption.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellQConImpl.java b/gen/intellij/haskell/psi/impl/HaskellQConImpl.java new file mode 100644 index 00000000..121c040f --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellQConImpl.java @@ -0,0 +1,55 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class HaskellQConImpl extends HaskellCompositeElementImpl implements HaskellQCon { + + public HaskellQConImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitQCon(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + @Override + @NotNull + public HaskellConid getConid() { + return findNotNullChildByClass(HaskellConid.class); + } + + @Override + @Nullable + public HaskellQConQualifier1 getQConQualifier1() { + return findChildByClass(HaskellQConQualifier1.class); + } + + @Override + @Nullable + public HaskellQConQualifier2 getQConQualifier2() { + return findChildByClass(HaskellQConQualifier2.class); + } + + @Override + @Nullable + public HaskellQConQualifier3 getQConQualifier3() { + return findChildByClass(HaskellQConQualifier3.class); + } + + @Override + @Nullable + public HaskellQConQualifier4 getQConQualifier4() { + return findChildByClass(HaskellQConQualifier4.class); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellConSymImpl.java b/gen/intellij/haskell/psi/impl/HaskellQConQualifier1Impl.java similarity index 68% rename from gen/intellij/haskell/psi/impl/HaskellConSymImpl.java rename to gen/intellij/haskell/psi/impl/HaskellQConQualifier1Impl.java index 208e3e57..e85d8f7b 100644 --- a/gen/intellij/haskell/psi/impl/HaskellConSymImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellQConQualifier1Impl.java @@ -1,26 +1,24 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellQConQualifier1; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellConSymImpl extends HaskellNamedElementImpl implements HaskellConSym { +public class HaskellQConQualifier1Impl extends HaskellQualifierElementImpl implements HaskellQConQualifier1 { - public HaskellConSymImpl(ASTNode node) { + public HaskellQConQualifier1Impl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConSym(this); + visitor.visitQConQualifier1(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -48,8 +46,4 @@ public class HaskellConSymImpl extends HaskellNamedElementImpl implements Haskel return HaskellPsiImplUtil.getPresentation(this); } - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellQConQualifier2Impl.java b/gen/intellij/haskell/psi/impl/HaskellQConQualifier2Impl.java new file mode 100644 index 00000000..05db5786 --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellQConQualifier2Impl.java @@ -0,0 +1,49 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.PsiReference; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellQConQualifier2; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +public class HaskellQConQualifier2Impl extends HaskellQualifierElementImpl implements HaskellQConQualifier2 { + + public HaskellQConQualifier2Impl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitQConQualifier2(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + + public PsiElement setName(String newName) { + return HaskellPsiImplUtil.setName(this, newName); + } + + public HaskellNamedElement getNameIdentifier() { + return HaskellPsiImplUtil.getNameIdentifier(this); + } + + public PsiReference getReference() { + return HaskellPsiImplUtil.getReference(this); + } + + public ItemPresentation getPresentation() { + return HaskellPsiImplUtil.getPresentation(this); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellQConQualifier3Impl.java b/gen/intellij/haskell/psi/impl/HaskellQConQualifier3Impl.java new file mode 100644 index 00000000..60f2e1d8 --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellQConQualifier3Impl.java @@ -0,0 +1,49 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.PsiReference; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellQConQualifier3; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +public class HaskellQConQualifier3Impl extends HaskellQualifierElementImpl implements HaskellQConQualifier3 { + + public HaskellQConQualifier3Impl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitQConQualifier3(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + + public PsiElement setName(String newName) { + return HaskellPsiImplUtil.setName(this, newName); + } + + public HaskellNamedElement getNameIdentifier() { + return HaskellPsiImplUtil.getNameIdentifier(this); + } + + public PsiReference getReference() { + return HaskellPsiImplUtil.getReference(this); + } + + public ItemPresentation getPresentation() { + return HaskellPsiImplUtil.getPresentation(this); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellQConQualifier4Impl.java b/gen/intellij/haskell/psi/impl/HaskellQConQualifier4Impl.java new file mode 100644 index 00000000..650c1be6 --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellQConQualifier4Impl.java @@ -0,0 +1,49 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.PsiReference; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellQConQualifier4; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +public class HaskellQConQualifier4Impl extends HaskellQualifierElementImpl implements HaskellQConQualifier4 { + + public HaskellQConQualifier4Impl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitQConQualifier4(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + + public PsiElement setName(String newName) { + return HaskellPsiImplUtil.setName(this, newName); + } + + public HaskellNamedElement getNameIdentifier() { + return HaskellPsiImplUtil.getNameIdentifier(this); + } + + public PsiReference getReference() { + return HaskellPsiImplUtil.getReference(this); + } + + public ItemPresentation getPresentation() { + return HaskellPsiImplUtil.getPresentation(this); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellQConQualifierImpl.java b/gen/intellij/haskell/psi/impl/HaskellQConQualifierImpl.java new file mode 100644 index 00000000..7ff6bb95 --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellQConQualifierImpl.java @@ -0,0 +1,49 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class HaskellQConQualifierImpl extends HaskellCompositeElementImpl implements HaskellQConQualifier { + + public HaskellQConQualifierImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitQConQualifier(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + @Override + @Nullable + public HaskellQConQualifier1 getQConQualifier1() { + return findChildByClass(HaskellQConQualifier1.class); + } + + @Override + @Nullable + public HaskellQConQualifier2 getQConQualifier2() { + return findChildByClass(HaskellQConQualifier2.class); + } + + @Override + @Nullable + public HaskellQConQualifier3 getQConQualifier3() { + return findChildByClass(HaskellQConQualifier3.class); + } + + @Override + @Nullable + public HaskellQConQualifier4 getQConQualifier4() { + return findChildByClass(HaskellQConQualifier4.class); + } + +} diff --git a/intellij/haskell/psi/impl/HaskellOpImpl.java b/gen/intellij/haskell/psi/impl/HaskellQNameImpl.java similarity index 52% rename from intellij/haskell/psi/impl/HaskellOpImpl.java rename to gen/intellij/haskell/psi/impl/HaskellQNameImpl.java index 9f8c4391..71262021 100644 --- a/intellij/haskell/psi/impl/HaskellOpImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellQNameImpl.java @@ -1,23 +1,21 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; -public class HaskellOpImpl extends HaskellCompositeElementImpl implements HaskellOp { +public class HaskellQNameImpl extends HaskellCompositeElementImpl implements HaskellQName { - public HaskellOpImpl(ASTNode node) { + public HaskellQNameImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitOp(this); + visitor.visitQName(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -27,14 +25,14 @@ public class HaskellOpImpl extends HaskellCompositeElementImpl implements Haskel @Override @Nullable - public HaskellQconOp getQconOp() { - return findChildByClass(HaskellQconOp.class); + public HaskellQVarCon getQVarCon() { + return findChildByClass(HaskellQVarCon.class); } @Override @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); + public HaskellVarCon getVarCon() { + return findChildByClass(HaskellVarCon.class); } public String getName() { @@ -45,4 +43,12 @@ public class HaskellOpImpl extends HaskellCompositeElementImpl implements Haskel return HaskellPsiImplUtil.getIdentifierElement(this); } + public Option getQualifierName() { + return HaskellPsiImplUtil.getQualifierName(this); + } + + public String getNameWithoutParens() { + return HaskellPsiImplUtil.getNameWithoutParens(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyType1Impl.java b/gen/intellij/haskell/psi/impl/HaskellQNamesImpl.java similarity index 53% rename from gen/intellij/haskell/psi/impl/HaskellTypeFamilyType1Impl.java rename to gen/intellij/haskell/psi/impl/HaskellQNamesImpl.java index f7af1a0f..1e385d48 100644 --- a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyType1Impl.java +++ b/gen/intellij/haskell/psi/impl/HaskellQNamesImpl.java @@ -1,23 +1,24 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellQNames; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellTypeFamilyType1Impl extends HaskellCompositeElementImpl implements HaskellTypeFamilyType1 { +import java.util.List; - public HaskellTypeFamilyType1Impl(ASTNode node) { +public class HaskellQNamesImpl extends HaskellCompositeElementImpl implements HaskellQNames { + + public HaskellQNamesImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeFamilyType1(this); + visitor.visitQNames(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -27,8 +28,8 @@ public class HaskellTypeFamilyType1Impl extends HaskellCompositeElementImpl impl @Override @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellQconOpImpl.java b/gen/intellij/haskell/psi/impl/HaskellQVarConImpl.java similarity index 51% rename from gen/intellij/haskell/psi/impl/HaskellQconOpImpl.java rename to gen/intellij/haskell/psi/impl/HaskellQVarConImpl.java index bd883a90..f9cfd405 100644 --- a/gen/intellij/haskell/psi/impl/HaskellQconOpImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellQVarConImpl.java @@ -1,24 +1,20 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; -import scala.Option; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; -public class HaskellQconOpImpl extends HaskellCompositeElementImpl implements HaskellQconOp { +public class HaskellQVarConImpl extends HaskellCompositeElementImpl implements HaskellQVarCon { - public HaskellQconOpImpl(ASTNode node) { + public HaskellQVarConImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconOp(this); + visitor.visitQVarCon(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -28,26 +24,32 @@ public class HaskellQconOpImpl extends HaskellCompositeElementImpl implements Ha @Override @Nullable - public HaskellConId getConId() { - return findChildByClass(HaskellConId.class); + public HaskellConsym getConsym() { + return findChildByClass(HaskellConsym.class); } @Override @Nullable - public HaskellConSym getConSym() { - return findChildByClass(HaskellConSym.class); + public HaskellQCon getQCon() { + return findChildByClass(HaskellQCon.class); } @Override @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); + public HaskellQualifier getQualifier() { + return findChildByClass(HaskellQualifier.class); } @Override @Nullable - public HaskellQconId getQconId() { - return findChildByClass(HaskellQconId.class); + public HaskellVarid getVarid() { + return findChildByClass(HaskellVarid.class); + } + + @Override + @Nullable + public HaskellVarsym getVarsym() { + return findChildByClass(HaskellVarsym.class); } public String getName() { @@ -58,8 +60,4 @@ public class HaskellQconOpImpl extends HaskellCompositeElementImpl implements Ha return HaskellPsiImplUtil.getIdentifierElement(this); } - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellQconIdImpl.java b/gen/intellij/haskell/psi/impl/HaskellQconIdImpl.java deleted file mode 100644 index 1bd05944..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQconIdImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQconIdImpl extends HaskellCompositeElementImpl implements HaskellQconId { - - public HaskellQconIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellConId getConId() { - return findNotNullChildByClass(HaskellConId.class); - } - - @Override - @NotNull - public HaskellQconIdQualifier getQconIdQualifier() { - return findNotNullChildByClass(HaskellQconIdQualifier.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellQconIdQualifierImpl.java b/gen/intellij/haskell/psi/impl/HaskellQconIdQualifierImpl.java deleted file mode 100644 index 17cfc528..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQconIdQualifierImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQconIdQualifierImpl extends HaskellCompositeElementImpl implements HaskellQconIdQualifier { - - public HaskellQconIdQualifierImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconIdQualifier(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellQconImpl.java b/gen/intellij/haskell/psi/impl/HaskellQconImpl.java deleted file mode 100644 index 947f1d3e..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQconImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.Option; - -public class HaskellQconImpl extends HaskellCompositeElementImpl implements HaskellQcon { - - public HaskellQconImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQcon(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellConId getConId() { - return findChildByClass(HaskellConId.class); - } - - @Override - @Nullable - public HaskellConSym getConSym() { - return findChildByClass(HaskellConSym.class); - } - - @Override - @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); - } - - @Override - @Nullable - public HaskellQconId getQconId() { - return findChildByClass(HaskellQconId.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellQconSymImpl.java b/gen/intellij/haskell/psi/impl/HaskellQconSymImpl.java deleted file mode 100644 index 92dda776..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQconSymImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQconSymImpl extends HaskellCompositeElementImpl implements HaskellQconSym { - - public HaskellQconSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellConSym getConSym() { - return findNotNullChildByClass(HaskellConSym.class); - } - - @Override - @NotNull - public HaskellQualifier getQualifier() { - return findNotNullChildByClass(HaskellQualifier.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellQqExpressionImpl.java b/gen/intellij/haskell/psi/impl/HaskellQqExpressionImpl.java index ffee384e..2a8f44a4 100644 --- a/gen/intellij/haskell/psi/impl/HaskellQqExpressionImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellQqExpressionImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellQqExpressionImpl extends HaskellCompositeElementImpl implements HaskellQqExpression { @@ -27,26 +26,8 @@ public class HaskellQqExpressionImpl extends HaskellCompositeElementImpl impleme @Override @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -57,14 +38,8 @@ public class HaskellQqExpressionImpl extends HaskellCompositeElementImpl impleme @Override @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); + public List getSccPragmaList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSccPragma.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellQualifierImpl.java b/gen/intellij/haskell/psi/impl/HaskellQualifierImpl.java index 17278474..38337547 100644 --- a/gen/intellij/haskell/psi/impl/HaskellQualifierImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellQualifierImpl.java @@ -1,19 +1,17 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellQualifier; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellQualifierImpl extends HaskellNamedElementImpl implements HaskellQualifier { +public class HaskellQualifierImpl extends HaskellQualifierElementImpl implements HaskellQualifier { public HaskellQualifierImpl(ASTNode node) { super(node); @@ -48,8 +46,4 @@ public class HaskellQualifierImpl extends HaskellNamedElementImpl implements Has return HaskellPsiImplUtil.getPresentation(this); } - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellQvarIdImpl.java b/gen/intellij/haskell/psi/impl/HaskellQvarIdImpl.java deleted file mode 100644 index 1963409a..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQvarIdImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQvarIdImpl extends HaskellCompositeElementImpl implements HaskellQvarId { - - public HaskellQvarIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvarId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQualifier getQualifier() { - return findNotNullChildByClass(HaskellQualifier.class); - } - - @Override - @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellQvarImpl.java b/gen/intellij/haskell/psi/impl/HaskellQvarImpl.java deleted file mode 100644 index 70ec8320..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQvarImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.Option; - -public class HaskellQvarImpl extends HaskellCompositeElementImpl implements HaskellQvar { - - public HaskellQvarImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvar(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellQvarId getQvarId() { - return findChildByClass(HaskellQvarId.class); - } - - @Override - @Nullable - public HaskellQvarSym getQvarSym() { - return findChildByClass(HaskellQvarSym.class); - } - - @Override - @Nullable - public HaskellVarId getVarId() { - return findChildByClass(HaskellVarId.class); - } - - @Override - @Nullable - public HaskellVarSym getVarSym() { - return findChildByClass(HaskellVarSym.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellQvarOpImpl.java b/gen/intellij/haskell/psi/impl/HaskellQvarOpImpl.java deleted file mode 100644 index 93bba330..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQvarOpImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.Option; - -public class HaskellQvarOpImpl extends HaskellCompositeElementImpl implements HaskellQvarOp { - - public HaskellQvarOpImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvarOp(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellQvarId getQvarId() { - return findChildByClass(HaskellQvarId.class); - } - - @Override - @Nullable - public HaskellQvarSym getQvarSym() { - return findChildByClass(HaskellQvarSym.class); - } - - @Override - @Nullable - public HaskellVarId getVarId() { - return findChildByClass(HaskellVarId.class); - } - - @Override - @Nullable - public HaskellVarSym getVarSym() { - return findChildByClass(HaskellVarSym.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellQvarSymImpl.java b/gen/intellij/haskell/psi/impl/HaskellQvarSymImpl.java deleted file mode 100644 index aaa10453..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellQvarSymImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQvarSymImpl extends HaskellCompositeElementImpl implements HaskellQvarSym { - - public HaskellQvarSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvarSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQualifier getQualifier() { - return findNotNullChildByClass(HaskellQualifier.class); - } - - @Override - @NotNull - public HaskellVarSym getVarSym() { - return findNotNullChildByClass(HaskellVarSym.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellAnnPragmaImpl.java b/gen/intellij/haskell/psi/impl/HaskellSccPragmaImpl.java similarity index 59% rename from intellij/haskell/psi/impl/HaskellAnnPragmaImpl.java rename to gen/intellij/haskell/psi/impl/HaskellSccPragmaImpl.java index 93b0bf3c..4dd26cd8 100644 --- a/intellij/haskell/psi/impl/HaskellAnnPragmaImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellSccPragmaImpl.java @@ -1,23 +1,21 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellGeneralPragmaContent; +import intellij.haskell.psi.HaskellSccPragma; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; -public class HaskellAnnPragmaImpl extends HaskellCompositeElementImpl implements HaskellAnnPragma { +public class HaskellSccPragmaImpl extends HaskellCompositeElementImpl implements HaskellSccPragma { - public HaskellAnnPragmaImpl(ASTNode node) { + public HaskellSccPragmaImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitAnnPragma(this); + visitor.visitSccPragma(this); } public void accept(@NotNull PsiElementVisitor visitor) { diff --git a/gen/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java b/gen/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java index 41f9a49c..85248e66 100644 --- a/gen/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java @@ -1,14 +1,17 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; +import intellij.haskell.psi.HaskellQName; +import intellij.haskell.psi.HaskellSimpleclass; +import intellij.haskell.psi.HaskellTtype; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellSimpleclassImpl extends HaskellCompositeElementImpl implements HaskellSimpleclass { @@ -25,52 +28,16 @@ public class HaskellSimpleclassImpl extends HaskellCompositeElementImpl implemen else super.accept(visitor); } + @Override + @NotNull + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); + } + @Override @Nullable - public HaskellGtycon getGtycon() { - return findChildByClass(HaskellGtycon.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getSimpleclassTildePartList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSimpleclassTildePart.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - - @Override - @NotNull - public List getVarSymList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarSym.class); + public HaskellTtype getTtype() { + return findChildByClass(HaskellTtype.class); } } diff --git a/gen/intellij/haskell/psi/impl/HaskellSimpleclassTildePartImpl.java b/gen/intellij/haskell/psi/impl/HaskellSimpleclassTildePartImpl.java deleted file mode 100644 index 98b092be..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellSimpleclassTildePartImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellSimpleclassTildePartImpl extends HaskellCompositeElementImpl implements HaskellSimpleclassTildePart { - - public HaskellSimpleclassTildePartImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSimpleclassTildePart(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellSimpletypeImpl.java b/gen/intellij/haskell/psi/impl/HaskellSimpletypeImpl.java index a6759c07..1b421476 100644 --- a/gen/intellij/haskell/psi/impl/HaskellSimpletypeImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellSimpletypeImpl.java @@ -1,16 +1,16 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import scala.collection.Seq; +import java.util.List; + public class HaskellSimpletypeImpl extends HaskellCompositeElementImpl implements HaskellSimpletype { public HaskellSimpletypeImpl(ASTNode node) { @@ -27,27 +27,9 @@ public class HaskellSimpletypeImpl extends HaskellCompositeElementImpl implement } @Override - @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQconOp getQconOp() { - return findChildByClass(HaskellQconOp.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); + @NotNull + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -62,12 +44,6 @@ public class HaskellSimpletypeImpl extends HaskellCompositeElementImpl implement return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); } - @Override - @NotNull - public List getVarIdList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarId.class); - } - public Seq getIdentifierElements() { return HaskellPsiImplUtil.getIdentifierElements(this); } diff --git a/gen/intellij/haskell/psi/impl/HaskellSubConstr2Impl.java b/gen/intellij/haskell/psi/impl/HaskellSubConstr2Impl.java index d6d7eca4..a110c4a5 100644 --- a/gen/intellij/haskell/psi/impl/HaskellSubConstr2Impl.java +++ b/gen/intellij/haskell/psi/impl/HaskellSubConstr2Impl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellSubConstr2Impl extends HaskellCompositeElementImpl implements HaskellSubConstr2 { @@ -27,20 +26,8 @@ public class HaskellSubConstr2Impl extends HaskellCompositeElementImpl implement @Override @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -55,10 +42,4 @@ public class HaskellSubConstr2Impl extends HaskellCompositeElementImpl implement return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); } - @Override - @NotNull - public List getVarSymList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarSym.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellTtypeImpl.java b/gen/intellij/haskell/psi/impl/HaskellTtypeImpl.java index 56107cb2..151eb47f 100644 --- a/gen/intellij/haskell/psi/impl/HaskellTtypeImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellTtypeImpl.java @@ -1,14 +1,14 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; public class HaskellTtypeImpl extends HaskellCompositeElementImpl implements HaskellTtype { @@ -25,12 +25,6 @@ public class HaskellTtypeImpl extends HaskellCompositeElementImpl implements Has else super.accept(visitor); } - @Override - @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); - } - @Override @Nullable public HaskellListType getListType() { @@ -39,8 +33,8 @@ public class HaskellTtypeImpl extends HaskellCompositeElementImpl implements Has @Override @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); } @Override @@ -55,16 +49,4 @@ public class HaskellTtypeImpl extends HaskellCompositeElementImpl implements Has return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); } - @Override - @NotNull - public List getVarIdList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarId.class); - } - - @Override - @NotNull - public List getVarSymList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarSym.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellTypeDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellTypeDeclarationImpl.java index 201ab090..8491bb1b 100644 --- a/gen/intellij/haskell/psi/impl/HaskellTypeDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellTypeDeclarationImpl.java @@ -1,17 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public class HaskellTypeDeclarationImpl extends HaskellCompositeElementImpl implements HaskellTypeDeclaration { public HaskellTypeDeclarationImpl(ASTNode node) { @@ -34,9 +35,9 @@ public class HaskellTypeDeclarationImpl extends HaskellCompositeElementImpl impl } @Override - @Nullable - public HaskellKindSignature getKindSignature() { - return findChildByClass(HaskellKindSignature.class); + @NotNull + public List getKindSignatureList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellKindSignature.class); } @Override @@ -69,4 +70,8 @@ public class HaskellTypeDeclarationImpl extends HaskellCompositeElementImpl impl return HaskellPsiImplUtil.getIdentifierElements(this); } + public Option getModuleName() { + return HaskellPsiImplUtil.getModuleName(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellTypeFamilyDeclarationImpl.java index dce1bb47..6f991633 100644 --- a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellTypeFamilyDeclarationImpl.java @@ -1,15 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; public class HaskellTypeFamilyDeclarationImpl extends HaskellCompositeElementImpl implements HaskellTypeFamilyDeclaration { @@ -51,4 +49,8 @@ public class HaskellTypeFamilyDeclarationImpl extends HaskellCompositeElementImp return HaskellPsiImplUtil.getIdentifierElements(this); } + public Option getModuleName() { + return HaskellPsiImplUtil.getModuleName(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyType2Impl.java b/gen/intellij/haskell/psi/impl/HaskellTypeFamilyType2Impl.java deleted file mode 100644 index 736f9ae2..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyType2Impl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellTypeFamilyType2Impl extends HaskellCompositeElementImpl implements HaskellTypeFamilyType2 { - - public HaskellTypeFamilyType2Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeFamilyType2(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQvarOp getQvarOp() { - return findNotNullChildByClass(HaskellQvarOp.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyTypeImpl.java b/gen/intellij/haskell/psi/impl/HaskellTypeFamilyTypeImpl.java index 0202e898..ca789c2a 100644 --- a/gen/intellij/haskell/psi/impl/HaskellTypeFamilyTypeImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellTypeFamilyTypeImpl.java @@ -1,14 +1,13 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; + +import java.util.List; public class HaskellTypeFamilyTypeImpl extends HaskellCompositeElementImpl implements HaskellTypeFamilyType { @@ -31,28 +30,22 @@ public class HaskellTypeFamilyTypeImpl extends HaskellCompositeElementImpl imple return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellContext.class); } + @Override + @NotNull + public List getQNameList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQName.class); + } + + @Override + @NotNull + public List getQNamesList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQNames.class); + } + @Override @NotNull public List getTtypeList() { return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); } - @Override - @NotNull - public List getTypeFamilyType1List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeFamilyType1.class); - } - - @Override - @NotNull - public List getTypeFamilyType2List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeFamilyType2.class); - } - - @Override - @NotNull - public List getVarsList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVars.class); - } - } diff --git a/gen/intellij/haskell/psi/impl/HaskellTypeInstanceDeclarationImpl.java b/gen/intellij/haskell/psi/impl/HaskellTypeInstanceDeclarationImpl.java index 587ff58b..613ba113 100644 --- a/gen/intellij/haskell/psi/impl/HaskellTypeInstanceDeclarationImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellTypeInstanceDeclarationImpl.java @@ -1,15 +1,15 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.HaskellExpression; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellTypeInstanceDeclaration; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import scala.Option; import scala.collection.Seq; public class HaskellTypeInstanceDeclarationImpl extends HaskellCompositeElementImpl implements HaskellTypeInstanceDeclaration { @@ -45,4 +45,8 @@ public class HaskellTypeInstanceDeclarationImpl extends HaskellCompositeElementI return HaskellPsiImplUtil.getIdentifierElements(this); } + public Option getModuleName() { + return HaskellPsiImplUtil.getModuleName(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellTypeSignatureImpl.java b/gen/intellij/haskell/psi/impl/HaskellTypeSignatureImpl.java index 51e8123d..9dfc6eb6 100644 --- a/gen/intellij/haskell/psi/impl/HaskellTypeSignatureImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellTypeSignatureImpl.java @@ -1,17 +1,18 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; +import com.intellij.navigation.ItemPresentation; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import scala.Option; import scala.collection.Seq; +import java.util.List; + public class HaskellTypeSignatureImpl extends HaskellCompositeElementImpl implements HaskellTypeSignature { public HaskellTypeSignatureImpl(ASTNode node) { @@ -33,6 +34,12 @@ public class HaskellTypeSignatureImpl extends HaskellCompositeElementImpl implem return findChildByClass(HaskellContext.class); } + @Override + @NotNull + public List getQNamesList() { + return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQNames.class); + } + @Override @Nullable public HaskellScontext getScontext() { @@ -41,20 +48,8 @@ public class HaskellTypeSignatureImpl extends HaskellCompositeElementImpl implem @Override @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @Nullable - public HaskellVarId getVarId() { - return findChildByClass(HaskellVarId.class); - } - - @Override - @NotNull - public HaskellVars getVars() { - return findNotNullChildByClass(HaskellVars.class); + public HaskellTtype getTtype() { + return findNotNullChildByClass(HaskellTtype.class); } public String getName() { @@ -69,4 +64,8 @@ public class HaskellTypeSignatureImpl extends HaskellCompositeElementImpl implem return HaskellPsiImplUtil.getIdentifierElements(this); } + public Option getModuleName() { + return HaskellPsiImplUtil.getModuleName(this); + } + } diff --git a/gen/intellij/haskell/psi/impl/HaskellOpImpl.java b/gen/intellij/haskell/psi/impl/HaskellVarConImpl.java similarity index 52% rename from gen/intellij/haskell/psi/impl/HaskellOpImpl.java rename to gen/intellij/haskell/psi/impl/HaskellVarConImpl.java index 9f8c4391..c5e63da3 100644 --- a/gen/intellij/haskell/psi/impl/HaskellOpImpl.java +++ b/gen/intellij/haskell/psi/impl/HaskellVarConImpl.java @@ -1,23 +1,20 @@ // This is a generated file. Not intended for manual editing. package intellij.haskell.psi.impl; -import java.util.List; -import org.jetbrains.annotations.*; import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; import intellij.haskell.psi.*; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; -public class HaskellOpImpl extends HaskellCompositeElementImpl implements HaskellOp { +public class HaskellVarConImpl extends HaskellCompositeElementImpl implements HaskellVarCon { - public HaskellOpImpl(ASTNode node) { + public HaskellVarConImpl(ASTNode node) { super(node); } public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitOp(this); + visitor.visitVarCon(this); } public void accept(@NotNull PsiElementVisitor visitor) { @@ -27,14 +24,26 @@ public class HaskellOpImpl extends HaskellCompositeElementImpl implements Haskel @Override @Nullable - public HaskellQconOp getQconOp() { - return findChildByClass(HaskellQconOp.class); + public HaskellConid getConid() { + return findChildByClass(HaskellConid.class); } @Override @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); + public HaskellConsym getConsym() { + return findChildByClass(HaskellConsym.class); + } + + @Override + @Nullable + public HaskellVarid getVarid() { + return findChildByClass(HaskellVarid.class); + } + + @Override + @Nullable + public HaskellVarsym getVarsym() { + return findChildByClass(HaskellVarsym.class); } public String getName() { diff --git a/gen/intellij/haskell/psi/impl/HaskellVarImpl.java b/gen/intellij/haskell/psi/impl/HaskellVarImpl.java new file mode 100644 index 00000000..4c1d27ad --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellVarImpl.java @@ -0,0 +1,44 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.HaskellVar; +import intellij.haskell.psi.HaskellVarid; +import intellij.haskell.psi.HaskellVarsym; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class HaskellVarImpl extends HaskellCNameElementImpl implements HaskellVar { + + public HaskellVarImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitVar(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + @Override + @Nullable + public HaskellVarid getVarid() { + return findChildByClass(HaskellVarid.class); + } + + @Override + @Nullable + public HaskellVarsym getVarsym() { + return findChildByClass(HaskellVarsym.class); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellVarSymImpl.java b/gen/intellij/haskell/psi/impl/HaskellVarSymImpl.java deleted file mode 100644 index 1e07756a..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellVarSymImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; - -public class HaskellVarSymImpl extends HaskellNamedElementImpl implements HaskellVarSym { - - public HaskellVarSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitVarSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public PsiElement setName(String newName) { - return HaskellPsiImplUtil.setName(this, newName); - } - - public HaskellNamedElement getNameIdentifier() { - return HaskellPsiImplUtil.getNameIdentifier(this); - } - - public PsiReference getReference() { - return HaskellPsiImplUtil.getReference(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellVaridImpl.java b/gen/intellij/haskell/psi/impl/HaskellVaridImpl.java new file mode 100644 index 00000000..98c17afd --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellVaridImpl.java @@ -0,0 +1,49 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.PsiReference; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellVarid; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +public class HaskellVaridImpl extends HaskellNamedElementImpl implements HaskellVarid { + + public HaskellVaridImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitVarid(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + + public PsiElement setName(String newName) { + return HaskellPsiImplUtil.setName(this, newName); + } + + public HaskellNamedElement getNameIdentifier() { + return HaskellPsiImplUtil.getNameIdentifier(this); + } + + public PsiReference getReference() { + return HaskellPsiImplUtil.getReference(this); + } + + public ItemPresentation getPresentation() { + return HaskellPsiImplUtil.getPresentation(this); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellVaropImpl.java b/gen/intellij/haskell/psi/impl/HaskellVaropImpl.java new file mode 100644 index 00000000..c012bd4c --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellVaropImpl.java @@ -0,0 +1,44 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElementVisitor; +import intellij.haskell.psi.HaskellVarid; +import intellij.haskell.psi.HaskellVarop; +import intellij.haskell.psi.HaskellVarsym; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class HaskellVaropImpl extends HaskellCNameElementImpl implements HaskellVarop { + + public HaskellVaropImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitVarop(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + @Override + @Nullable + public HaskellVarid getVarid() { + return findChildByClass(HaskellVarid.class); + } + + @Override + @Nullable + public HaskellVarsym getVarsym() { + return findChildByClass(HaskellVarsym.class); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + +} diff --git a/gen/intellij/haskell/psi/impl/HaskellVarsImpl.java b/gen/intellij/haskell/psi/impl/HaskellVarsImpl.java deleted file mode 100644 index 5577f07d..00000000 --- a/gen/intellij/haskell/psi/impl/HaskellVarsImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellVarsImpl extends HaskellCompositeElementImpl implements HaskellVars { - - public HaskellVarsImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitVars(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - -} diff --git a/gen/intellij/haskell/psi/impl/HaskellVarsymImpl.java b/gen/intellij/haskell/psi/impl/HaskellVarsymImpl.java new file mode 100644 index 00000000..5a644f31 --- /dev/null +++ b/gen/intellij/haskell/psi/impl/HaskellVarsymImpl.java @@ -0,0 +1,49 @@ +// This is a generated file. Not intended for manual editing. +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import com.intellij.navigation.ItemPresentation; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiElementVisitor; +import com.intellij.psi.PsiReference; +import intellij.haskell.psi.HaskellNamedElement; +import intellij.haskell.psi.HaskellVarsym; +import intellij.haskell.psi.HaskellVisitor; +import org.jetbrains.annotations.NotNull; + +public class HaskellVarsymImpl extends HaskellNamedElementImpl implements HaskellVarsym { + + public HaskellVarsymImpl(ASTNode node) { + super(node); + } + + public void accept(@NotNull HaskellVisitor visitor) { + visitor.visitVarsym(this); + } + + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); + else super.accept(visitor); + } + + public String getName() { + return HaskellPsiImplUtil.getName(this); + } + + public PsiElement setName(String newName) { + return HaskellPsiImplUtil.setName(this, newName); + } + + public HaskellNamedElement getNameIdentifier() { + return HaskellPsiImplUtil.getNameIdentifier(this); + } + + public PsiReference getReference() { + return HaskellPsiImplUtil.getReference(this); + } + + public ItemPresentation getPresentation() { + return HaskellPsiImplUtil.getPresentation(this); + } + +} diff --git a/idea-flex.skeleton b/idea-flex.skeleton index 234a62c4..2f256367 100644 --- a/idea-flex.skeleton +++ b/idea-flex.skeleton @@ -1,3 +1,7 @@ + + /** 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 = ...; @@ -8,18 +12,18 @@ private static final int ZZ_UNKNOWN_ERROR = 0; private static final int ZZ_NO_MATCH = 1; private static final int ZZ_PUSHBACK_2BIG = 2; - private static final char[] EMPTY_BUFFER = new char[0]; - private static final int YYEOF = -1; - private static java.io.Reader zzReader = null; // Fake /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", + private static final String[] ZZ_ERROR_MSG = { + "Unknown internal scanner error", "Error: could not match input", "Error: pushback value was too large" }; --- isFinal list + /** the input device */ + private java.io.Reader zzReader; + /** the current state of the DFA */ private int zzState; @@ -30,15 +34,9 @@ the source of the yytext() string */ private CharSequence zzBuffer = ""; - /** this buffer may contains the current text array to be matched when it is cheap to acquire it */ - private char[] zzBufferArray; - /** the textposition at the last accepting state */ private int zzMarkedPos; - /** the textposition at the last state to be included in yytext */ - private int zzPushbackPos; - /** the current text position in the buffer */ private int zzCurrentPos; @@ -57,23 +55,24 @@ /** 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 class code --- constructor declaration - public final int getTokenStart(){ + public final int getTokenStart() { return zzStartRead; } - public final int getTokenEnd(){ + public final int getTokenEnd() { return getTokenStart() + yylength(); } - public void reset(CharSequence buffer, int start, int end,int initialState){ + public void reset(CharSequence buffer, int start, int end, int initialState) { zzBuffer = buffer; - zzBufferArray = com.intellij.util.text.CharArrayUtil.fromSequenceWithoutCopying(buffer); zzCurrentPos = zzMarkedPos = zzStartRead = start; - zzPushbackPos = 0; zzAtEOF = false; zzAtBOL = true; zzEndRead = end; @@ -130,7 +129,7 @@ * @return the character at position pos */ public final char yycharat(int pos) { - return zzBufferArray != null ? zzBufferArray[zzStartRead+pos]:zzBuffer.charAt(zzStartRead+pos); + return zzBuffer.charAt(zzStartRead+pos); } @@ -202,8 +201,6 @@ int zzMarkedPosL; int zzEndReadL = zzEndRead; CharSequence zzBufferL = zzBuffer; - char[] zzBufferArrayL = zzBufferArray; - char [] zzCMapL = ZZ_CMAP; --- local declarations @@ -233,13 +230,13 @@ zzMarkedPos = zzMarkedPosL; --- char count update ---- actions - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; --- eofvalue - } - else { + } + else { +--- actions + default: --- no match } } diff --git a/intellij-haskell/META-INF/plugin.xml b/intellij-haskell/META-INF/plugin.xml index 2d55de6c..250aeb78 100644 --- a/intellij-haskell/META-INF/plugin.xml +++ b/intellij-haskell/META-INF/plugin.xml @@ -1,7 +1,7 @@ intellij.haskell IntelliJ-Haskell - 0.94 + 1.0.0-beta Rik van der Kleij 1.0.0-beta

+
    +
  • Replaced ghc-mod by `stack repl` and intero
  • +
  • Big rewrite/refactor of code
  • +
  • Support for IntelliJ 2016.2
  • +

0.93

  • Replaced ghc-mod legacy-interactive `check` by `ghc-mod check`
  • @@ -98,13 +104,16 @@ - + + + + @@ -119,22 +128,19 @@ implementationClass="intellij.haskell.highlighter.HaskellSyntaxHighlighterFactory"/> - + + implementationClass="intellij.haskell.annotator.HaskellAnnotator"/> - - + implementation="intellij.haskell.editor.formatter.settings.HaskellCodeStyleSettingsProvider"/> + implementation="intellij.haskell.editor.formatter.settings.HaskellLanguageCodeStyleSettingsProvider"/> @@ -145,40 +151,43 @@ - + implementationClass="intellij.haskell.navigation.HaskellFindUsagesProvider"/> + + implementationClass="intellij.haskell.external.HaskellDocumentationProvider"/> - + implementationClass="intellij.haskell.editor.HaskellCompletionContributor"/> + - + + implementation="intellij.haskell.navigation.HaskellNamedElementContributor"/> + implementationClass="intellij.haskell.navigation.HaskellStructureViewFactory"/> - + - + + implementationClass="intellij.haskell.inspection.HLintInspectionTool"/> - + + + + + @@ -187,19 +196,23 @@ - intellij.haskell.external.GhcModInfoProcess + intellij.haskell.external.repl.process.GlobalStackReplProcess - intellij.haskell.external.GhcModCheckProcess + intellij.haskell.external.repl.process.ProjectStackReplProcess - intellij.haskell.view.HaskellDocumentationProvider + intellij.haskell.external.repl.StackReplsManager + + + + intellij.haskell.external.HaskellDocumentationProvider - @@ -210,7 +223,7 @@ - @@ -221,13 +234,13 @@ - @@ -235,9 +248,15 @@ - + + + + + diff --git a/intellij-haskell/intellij-haskell.iml b/intellij-haskell/intellij-haskell.iml index 1bade026..9e629b29 100644 --- a/intellij-haskell/intellij-haskell.iml +++ b/intellij-haskell/intellij-haskell.iml @@ -4,8 +4,8 @@ - + - + \ No newline at end of file diff --git a/intellij/haskell/parser/HaskellParser.java b/intellij/haskell/parser/HaskellParser.java deleted file mode 100644 index b98172c6..00000000 --- a/intellij/haskell/parser/HaskellParser.java +++ /dev/null @@ -1,6494 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.parser; - -import com.intellij.lang.PsiBuilder; -import com.intellij.lang.PsiBuilder.Marker; -import static intellij.haskell.psi.HaskellTypes.*; -import static intellij.haskell.psi.HaskellParserUtil.*; -import com.intellij.psi.tree.IElementType; -import com.intellij.lang.ASTNode; -import com.intellij.psi.tree.TokenSet; -import com.intellij.lang.PsiParser; -import com.intellij.lang.LightPsiParser; - -@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"}) -public class HaskellParser implements PsiParser, LightPsiParser { - - public ASTNode parse(IElementType t, PsiBuilder b) { - parseLight(t, b); - return b.getTreeBuilt(); - } - - 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 == HS_ANN_PRAGMA) { - r = ann_pragma(b, 0); - } - else if (t == HS_CDECL) { - r = cdecl(b, 0); - } - else if (t == HS_CFILES_PRAGMA) { - r = cfiles_pragma(b, 0); - } - else if (t == HS_CLASS_DECLARATION) { - r = class_declaration(b, 0); - } - else if (t == HS_CLAZZ) { - r = clazz(b, 0); - } - else if (t == HS_CNAME) { - r = cname(b, 0); - } - else if (t == HS_COMMENTS) { - r = comments(b, 0); - } - else if (t == HS_CON_ID) { - r = con_id(b, 0); - } - else if (t == HS_CON_SYM) { - r = con_sym(b, 0); - } - else if (t == HS_CONSTR_1) { - r = constr1(b, 0); - } - else if (t == HS_CONSTR_2) { - r = constr2(b, 0); - } - else if (t == HS_CONSTR_3) { - r = constr3(b, 0); - } - else if (t == HS_CONSTR_4) { - r = constr4(b, 0); - } - else if (t == HS_CONTEXT) { - r = context(b, 0); - } - else if (t == HS_CTYPE_PRAGMA) { - r = ctype_pragma(b, 0); - } - else if (t == HS_DATA_DECLARATION) { - r = data_declaration(b, 0); - } - else if (t == HS_DATA_DECLARATION_DERIVING) { - r = data_declaration_deriving(b, 0); - } - else if (t == HS_DEFAULT_DECLARATION) { - r = default_declaration(b, 0); - } - else if (t == HS_DEPRECATED_WARN_PRAGMA) { - r = deprecated_warn_pragma(b, 0); - } - else if (t == HS_DERIVING_DECLARATION) { - r = deriving_declaration(b, 0); - } - else if (t == HS_DOT_DOT_PARENS) { - r = dot_dot_parens(b, 0); - } - else if (t == HS_DUMMY_PRAGMA) { - r = dummy_pragma(b, 0); - } - else if (t == HS_EXPORT) { - r = export(b, 0); - } - else if (t == HS_EXPORTS) { - r = exports(b, 0); - } - else if (t == HS_EXPRESSION) { - r = expression(b, 0); - } - else if (t == HS_FIELDDECL) { - r = fielddecl(b, 0); - } - else if (t == HS_FILE_HEADER) { - r = file_header(b, 0); - } - else if (t == HS_FILE_HEADER_PRAGMA) { - r = file_header_pragma(b, 0); - } - else if (t == HS_FIRST_LINE_EXPRESSION) { - r = first_line_expression(b, 0); - } - else if (t == HS_FIXITY) { - r = fixity(b, 0); - } - else if (t == HS_FOREIGN_DECLARATION) { - r = foreign_declaration(b, 0); - } - else if (t == HS_GCON_SYM) { - r = gcon_sym(b, 0); - } - else if (t == HS_GENERAL_PRAGMA_CONTENT) { - r = general_pragma_content(b, 0); - } - else if (t == HS_GTYCON) { - r = gtycon(b, 0); - } - else if (t == HS_HADDOCK_PRAGMA) { - r = haddock_pragma(b, 0); - } - else if (t == HS_IDECL) { - r = idecl(b, 0); - } - else if (t == HS_IMPORT_DECLARATION) { - r = import_declaration(b, 0); - } - else if (t == HS_IMPORT_EMPTY_SPEC) { - r = import_empty_spec(b, 0); - } - else if (t == HS_IMPORT_HIDING) { - r = import_hiding(b, 0); - } - else if (t == HS_IMPORT_HIDING_SPEC) { - r = import_hiding_spec(b, 0); - } - else if (t == HS_IMPORT_ID) { - r = import_id(b, 0); - } - else if (t == HS_IMPORT_IDS_SPEC) { - r = import_ids_spec(b, 0); - } - else if (t == HS_IMPORT_MODULE) { - r = import_module(b, 0); - } - else if (t == HS_IMPORT_QUALIFIED) { - r = import_qualified(b, 0); - } - else if (t == HS_IMPORT_QUALIFIED_AS) { - r = import_qualified_as(b, 0); - } - else if (t == HS_IMPORT_SPEC) { - r = import_spec(b, 0); - } - else if (t == HS_INCLUDE_PRAGMA) { - r = include_pragma(b, 0); - } - else if (t == HS_INLINABLE_PRAGMA) { - r = inlinable_pragma(b, 0); - } - else if (t == HS_INLINE_PRAGMA) { - r = inline_pragma(b, 0); - } - else if (t == HS_INST) { - r = inst(b, 0); - } - else if (t == HS_INSTANCE_DECLARATION) { - r = instance_declaration(b, 0); - } - else if (t == HS_INSTVAR) { - r = instvar(b, 0); - } - else if (t == HS_KIND_SIGNATURE) { - r = kind_signature(b, 0); - } - else if (t == HS_LANGUAGE_PRAGMA) { - r = language_pragma(b, 0); - } - else if (t == HS_LAST_LINE_EXPRESSION) { - r = last_line_expression(b, 0); - } - else if (t == HS_LINE_EXPRESSION) { - r = line_expression(b, 0); - } - else if (t == HS_LINE_PRAGMA) { - r = line_pragma(b, 0); - } - else if (t == HS_LITERAL) { - r = literal(b, 0); - } - else if (t == HS_MINIMAL_PRAGMA) { - r = minimal_pragma(b, 0); - } - else if (t == HS_MOD_ID) { - r = mod_id(b, 0); - } - else if (t == HS_MODULE_BODY) { - r = module_body(b, 0); - } - else if (t == HS_MODULE_DECLARATION) { - r = module_declaration(b, 0); - } - else if (t == HS_NEWCONSTR) { - r = newconstr(b, 0); - } - else if (t == HS_NEWCONSTR_FIELDDECL) { - r = newconstr_fielddecl(b, 0); - } - else if (t == HS_NEWTYPE_DECLARATION) { - r = newtype_declaration(b, 0); - } - else if (t == HS_NOINLINE_PRAGMA) { - r = noinline_pragma(b, 0); - } - else if (t == HS_NOUNPACK_PRAGMA) { - r = nounpack_pragma(b, 0); - } - else if (t == HS_OP) { - r = op(b, 0); - } - else if (t == HS_OPS) { - r = ops(b, 0); - } - else if (t == HS_OPTIONS_GHC_PRAGMA) { - r = options_ghc_pragma(b, 0); - } - else if (t == HS_OTHER_PRAGMA) { - r = other_pragma(b, 0); - } - else if (t == HS_OVERLAP_PRAGMA) { - r = overlap_pragma(b, 0); - } - else if (t == HS_PARALLEL_ARRAY_TYPE) { - r = parallel_array_type(b, 0); - } - else if (t == HS_QCON) { - r = qcon(b, 0); - } - else if (t == HS_QCON_ID) { - r = qcon_id(b, 0); - } - else if (t == HS_QCON_ID_QUALIFIER) { - r = qcon_id_qualifier(b, 0); - } - else if (t == HS_QCON_OP) { - r = qcon_op(b, 0); - } - else if (t == HS_QCON_SYM) { - r = qcon_sym(b, 0); - } - else if (t == HS_QQ_EXPRESSION) { - r = qq_expression(b, 0); - } - else if (t == HS_QUALIFIER) { - r = qualifier(b, 0); - } - else if (t == HS_QUASI_QUOTE) { - r = quasi_quote(b, 0); - } - else if (t == HS_QVAR) { - r = qvar(b, 0); - } - else if (t == HS_QVAR_ID) { - r = qvar_id(b, 0); - } - else if (t == HS_QVAR_OP) { - r = qvar_op(b, 0); - } - else if (t == HS_QVAR_SYM) { - r = qvar_sym(b, 0); - } - else if (t == HS_RULES_PRAGMA) { - r = rules_pragma(b, 0); - } - else if (t == HS_SCONTEXT) { - r = scontext(b, 0); - } - else if (t == HS_SIMPLECLASS) { - r = simpleclass(b, 0); - } - else if (t == HS_SIMPLECLASS_TILDE_PART) { - r = simpleclass_tilde_part(b, 0); - } - else if (t == HS_SIMPLETYPE) { - r = simpletype(b, 0); - } - else if (t == HS_SNL) { - r = snl(b, 0); - } - else if (t == HS_SOURCE_PRAGMA) { - r = source_pragma(b, 0); - } - else if (t == HS_SPECIALIZE_PRAGMA) { - r = specialize_pragma(b, 0); - } - else if (t == HS_SUB_CONSTR_2) { - r = sub_constr2(b, 0); - } - else if (t == HS_TOP_DECLARATION) { - r = top_declaration(b, 0); - } - else if (t == HS_TTYPE) { - r = ttype(b, 0); - } - else if (t == HS_TYPE_DECLARATION) { - r = type_declaration(b, 0); - } - else if (t == HS_TYPE_FAMILY_DECLARATION) { - r = type_family_declaration(b, 0); - } - else if (t == HS_TYPE_FAMILY_TYPE) { - r = type_family_type(b, 0); - } - else if (t == HS_TYPE_FAMILY_TYPE_1) { - r = type_family_type1(b, 0); - } - else if (t == HS_TYPE_FAMILY_TYPE_2) { - r = type_family_type2(b, 0); - } - else if (t == HS_TYPE_INSTANCE_DECLARATION) { - r = type_instance_declaration(b, 0); - } - else if (t == HS_TYPE_SIGNATURE) { - r = type_signature(b, 0); - } - else if (t == HS_UNPACK_NOUNPACK_PRAGMA) { - r = unpack_nounpack_pragma(b, 0); - } - else if (t == HS_UNPACK_PRAGMA) { - r = unpack_pragma(b, 0); - } - else if (t == HS_VAR_ID) { - r = var_id(b, 0); - } - else if (t == HS_VAR_SYM) { - r = var_sym(b, 0); - } - else if (t == HS_VARS) { - r = vars(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 program(b, l + 1); - } - - /* ********************************************************** */ - // PRAGMA_START onl "ANN" general_pragma_content PRAGMA_END - public static boolean ann_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ann_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "ANN"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_ANN_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // "forall" (qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT | - // LEFT_PAREN qvar TILDE qvar RIGHT_PAREN (DOUBLE_RIGHT_ARROW ttype)? | - // LEFT_PAREN osnl ttype (osnl COMMA osnl ttype)+ osnl RIGHT_PAREN | - // QUOTE? LEFT_BRACKET osnl ttype osnl RIGHT_BRACKET | - // LEFT_PAREN osnl ttype+ osnl RIGHT_PAREN | - // gtycon | - // cname - static boolean atype(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype")) return false; - boolean r; - Marker m = enter_section_(b); - r = atype_0(b, l + 1); - if (!r) r = atype_1(b, l + 1); - if (!r) r = atype_2(b, l + 1); - if (!r) r = atype_3(b, l + 1); - if (!r) r = atype_4(b, l + 1); - if (!r) r = gtycon(b, l + 1); - if (!r) r = cname(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // "forall" (qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT - private static boolean atype_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, "forall"); - r = r && atype_0_1(b, l + 1); - r = r && consumeToken(b, HS_DOT); - exit_section_(b, m, null, r); - return r; - } - - // (qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ - private static boolean atype_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = atype_0_1_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!atype_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "atype_0_1", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN - private static boolean atype_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - if (!r) r = ttype(b, l + 1); - if (!r) r = atype_0_1_0_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN type_signature RIGHT_PAREN - private static boolean atype_0_1_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_0_1_0_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && type_signature(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN qvar TILDE qvar RIGHT_PAREN (DOUBLE_RIGHT_ARROW ttype)? - private static boolean atype_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_TILDE); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - r = r && atype_1_5(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (DOUBLE_RIGHT_ARROW ttype)? - private static boolean atype_1_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_1_5")) return false; - atype_1_5_0(b, l + 1); - return true; - } - - // DOUBLE_RIGHT_ARROW ttype - private static boolean atype_1_5_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_1_5_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN osnl ttype (osnl COMMA osnl ttype)+ osnl RIGHT_PAREN - private static boolean atype_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - r = r && atype_2_3(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (osnl COMMA osnl ttype)+ - private static boolean atype_2_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = atype_2_3_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!atype_2_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "atype_2_3", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // osnl COMMA osnl ttype - private static boolean atype_2_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_2_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // QUOTE? LEFT_BRACKET osnl ttype osnl RIGHT_BRACKET - private static boolean atype_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = atype_3_0(b, l + 1); - r = r && consumeToken(b, HS_LEFT_BRACKET); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_BRACKET); - exit_section_(b, m, null, r); - return r; - } - - // QUOTE? - private static boolean atype_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_3_0")) return false; - consumeToken(b, HS_QUOTE); - return true; - } - - // LEFT_PAREN osnl ttype+ osnl RIGHT_PAREN - private static boolean atype_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && atype_4_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // ttype+ - private static boolean atype_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "atype_4_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = ttype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!ttype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "atype_4_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // import_declarations top_declarations - static boolean body(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "body")) return false; - boolean r; - Marker m = enter_section_(b); - r = import_declarations(b, l + 1); - r = r && top_declarations(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // atype+ - static boolean btype(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "btype")) return false; - boolean r; - Marker m = enter_section_(b); - r = atype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!atype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "btype", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // minimal_pragma | type_signature | cidecl - public static boolean cdecl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cdecl")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CDECL, ""); - r = minimal_pragma(b, l + 1); - if (!r) r = type_signature(b, l + 1); - if (!r) r = cidecl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // (cdecl | expression) (osnl (cdecl | expression))* - static boolean cdecls(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cdecls")) return false; - boolean r; - Marker m = enter_section_(b); - r = cdecls_0(b, l + 1); - r = r && cdecls_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // cdecl | expression - private static boolean cdecls_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cdecls_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = cdecl(b, l + 1); - if (!r) r = expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl (cdecl | expression))* - private static boolean cdecls_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cdecls_1")) return false; - int c = current_position_(b); - while (true) { - if (!cdecls_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "cdecls_1", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl (cdecl | expression) - private static boolean cdecls_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cdecls_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && cdecls_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // cdecl | expression - private static boolean cdecls_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cdecls_1_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = cdecl(b, l + 1); - if (!r) r = expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "CFILES" general_pragma_content PRAGMA_END - public static boolean cfiles_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cfiles_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "CFILES"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_CFILES_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // inline_pragma | noinline_pragma | specialize_pragma | type_declaration | instance_declaration | default_declaration | - // newtype_declaration | data_declaration - static boolean cidecl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cidecl")) return false; - boolean r; - Marker m = enter_section_(b); - r = inline_pragma(b, l + 1); - if (!r) r = noinline_pragma(b, l + 1); - if (!r) r = specialize_pragma(b, l + 1); - if (!r) r = type_declaration(b, l + 1); - if (!r) r = instance_declaration(b, l + 1); - if (!r) r = default_declaration(b, l + 1); - if (!r) r = newtype_declaration(b, l + 1); - if (!r) r = data_declaration(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // CLASS osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl - // (qvar | LEFT_PAREN type_signature RIGHT_PAREN)* - // (osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)*)? osnl WHERE? osnl cdecls? | - // CLASS osnl context osnl DOUBLE_RIGHT_ARROW osnl qcon osnl qvar osnl WHERE? osnl cdecls? - public static boolean class_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration")) return false; - if (!nextTokenIs(b, HS_CLASS)) return false; - boolean r; - Marker m = enter_section_(b); - r = class_declaration_0(b, l + 1); - if (!r) r = class_declaration_1(b, l + 1); - exit_section_(b, m, HS_CLASS_DECLARATION, r); - return r; - } - - // CLASS osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl - // (qvar | LEFT_PAREN type_signature RIGHT_PAREN)* - // (osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)*)? osnl WHERE? osnl cdecls? - private static boolean class_declaration_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_CLASS); - r = r && osnl(b, l + 1); - r = r && class_declaration_0_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && class_declaration_0_6(b, l + 1); - r = r && class_declaration_0_7(b, l + 1); - r = r && osnl(b, l + 1); - r = r && class_declaration_0_9(b, l + 1); - r = r && osnl(b, l + 1); - r = r && class_declaration_0_11(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (scontext osnl DOUBLE_RIGHT_ARROW)? - private static boolean class_declaration_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_2")) return false; - class_declaration_0_2_0(b, l + 1); - return true; - } - - // scontext osnl DOUBLE_RIGHT_ARROW - private static boolean class_declaration_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = scontext(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // (qvar | LEFT_PAREN type_signature RIGHT_PAREN)* - private static boolean class_declaration_0_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_6")) return false; - int c = current_position_(b); - while (true) { - if (!class_declaration_0_6_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "class_declaration_0_6", c)) break; - c = current_position_(b); - } - return true; - } - - // qvar | LEFT_PAREN type_signature RIGHT_PAREN - private static boolean class_declaration_0_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_6_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - if (!r) r = class_declaration_0_6_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN type_signature RIGHT_PAREN - private static boolean class_declaration_0_6_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_6_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && type_signature(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)*)? - private static boolean class_declaration_0_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_7")) return false; - class_declaration_0_7_0(b, l + 1); - return true; - } - - // osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)* - private static boolean class_declaration_0_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_7_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_VERTICAL_BAR); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - r = r && class_declaration_0_7_0_4(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl COMMA osnl ttype)* - private static boolean class_declaration_0_7_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_7_0_4")) return false; - int c = current_position_(b); - while (true) { - if (!class_declaration_0_7_0_4_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "class_declaration_0_7_0_4", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl COMMA osnl ttype - private static boolean class_declaration_0_7_0_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_7_0_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // WHERE? - private static boolean class_declaration_0_9(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_9")) return false; - consumeToken(b, HS_WHERE); - return true; - } - - // cdecls? - private static boolean class_declaration_0_11(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_0_11")) return false; - cdecls(b, l + 1); - return true; - } - - // CLASS osnl context osnl DOUBLE_RIGHT_ARROW osnl qcon osnl qvar osnl WHERE? osnl cdecls? - private static boolean class_declaration_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_CLASS); - r = r && osnl(b, l + 1); - r = r && context(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qvar(b, l + 1); - r = r && osnl(b, l + 1); - r = r && class_declaration_1_10(b, l + 1); - r = r && osnl(b, l + 1); - r = r && class_declaration_1_12(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // WHERE? - private static boolean class_declaration_1_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_1_10")) return false; - consumeToken(b, HS_WHERE); - return true; - } - - // cdecls? - private static boolean class_declaration_1_12(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "class_declaration_1_12")) return false; - cdecls(b, l + 1); - return true; - } - - /* ********************************************************** */ - // qcon qvar+ | - // qcon LEFT_PAREN qvar atype+ RIGHT_PAREN | - // qcon LEFT_PAREN qcon qvar RIGHT_PAREN - public static boolean clazz(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CLAZZ, ""); - r = clazz_0(b, l + 1); - if (!r) r = clazz_1(b, l + 1); - if (!r) r = clazz_2(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // qcon qvar+ - private static boolean clazz_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && clazz_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar+ - private static boolean clazz_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "clazz_0_1", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qcon LEFT_PAREN qvar atype+ RIGHT_PAREN - private static boolean clazz_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && qvar(b, l + 1); - r = r && clazz_1_3(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // atype+ - private static boolean clazz_1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_1_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = atype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!atype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "clazz_1_3", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qcon LEFT_PAREN qcon qvar RIGHT_PAREN - private static boolean clazz_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "clazz_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && qcon(b, l + 1); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qvar | qcon | qcon_op | qvar_op - public static boolean cname(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "cname")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CNAME, ""); - r = qvar(b, l + 1); - if (!r) r = qcon(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - if (!r) r = qvar_op(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // COMMENT | NCOMMENT | NCOMMENT_START | NCOMMENT_END - public static boolean comments(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "comments")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_COMMENTS, ""); - r = consumeToken(b, HS_COMMENT); - if (!r) r = consumeToken(b, HS_NCOMMENT); - if (!r) r = consumeToken(b, HS_NCOMMENT_START); - if (!r) r = consumeToken(b, HS_NCOMMENT_END); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // CONID_ID | LEFT_BRACKET var_id? RIGHT_BRACKET | LEFT_PAREN COMMA* RIGHT_PAREN - public static boolean con_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CON_ID, ""); - r = consumeToken(b, HS_CONID_ID); - if (!r) r = con_id_1(b, l + 1); - if (!r) r = con_id_2(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_BRACKET var_id? RIGHT_BRACKET - private static boolean con_id_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_BRACKET); - r = r && con_id_1_1(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_BRACKET); - exit_section_(b, m, null, r); - return r; - } - - // var_id? - private static boolean con_id_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_1_1")) return false; - var_id(b, l + 1); - return true; - } - - // LEFT_PAREN COMMA* RIGHT_PAREN - private static boolean con_id_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && con_id_2_1(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // COMMA* - private static boolean con_id_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_id_2_1")) return false; - int c = current_position_(b); - while (true) { - if (!consumeToken(b, HS_COMMA)) break; - if (!empty_element_parsed_guard_(b, "con_id_2_1", c)) break; - c = current_position_(b); - } - return true; - } - - /* ********************************************************** */ - // CONSYM_ID - public static boolean con_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "con_sym")) return false; - if (!nextTokenIs(b, HS_CONSYM_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_CONSYM_ID); - exit_section_(b, m, HS_CON_SYM, r); - return r; - } - - /* ********************************************************** */ - // constr1 | constr2 | constr3 | constr4 - static boolean constr(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr")) return false; - boolean r; - Marker m = enter_section_(b); - r = constr1(b, l + 1); - if (!r) r = constr2(b, l + 1); - if (!r) r = constr3(b, l + 1); - if (!r) r = constr4(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // unpack_nounpack_pragma? qcon onl unpack_nounpack_pragma? onl LEFT_BRACE onl (onl fielddecl (onl COMMA? onl fielddecl)*)? onl RIGHT_BRACE - public static boolean constr1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_1, ""); - r = constr1_0(b, l + 1); - r = r && qcon(b, l + 1); - r = r && onl(b, l + 1); - r = r && constr1_3(b, l + 1); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_BRACE); - r = r && onl(b, l + 1); - r = r && constr1_7(b, l + 1); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_BRACE); - exit_section_(b, l, m, r, false, null); - return r; - } - - // unpack_nounpack_pragma? - private static boolean constr1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1_0")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - // unpack_nounpack_pragma? - private static boolean constr1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1_3")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - // (onl fielddecl (onl COMMA? onl fielddecl)*)? - private static boolean constr1_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1_7")) return false; - constr1_7_0(b, l + 1); - return true; - } - - // onl fielddecl (onl COMMA? onl fielddecl)* - private static boolean constr1_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1_7_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && fielddecl(b, l + 1); - r = r && constr1_7_0_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (onl COMMA? onl fielddecl)* - private static boolean constr1_7_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1_7_0_2")) return false; - int c = current_position_(b); - while (true) { - if (!constr1_7_0_2_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "constr1_7_0_2", c)) break; - c = current_position_(b); - } - return true; - } - - // onl COMMA? onl fielddecl - private static boolean constr1_7_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1_7_0_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && constr1_7_0_2_0_1(b, l + 1); - r = r && onl(b, l + 1); - r = r && fielddecl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // COMMA? - private static boolean constr1_7_0_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr1_7_0_2_0_1")) return false; - consumeToken(b, HS_COMMA); - return true; - } - - /* ********************************************************** */ - // unpack_nounpack_pragma? sub_constr2 osnl unpack_nounpack_pragma? qcon_op osnl sub_constr2 - public static boolean constr2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr2")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_2, ""); - r = constr2_0(b, l + 1); - r = r && sub_constr2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && constr2_3(b, l + 1); - r = r && qcon_op(b, l + 1); - r = r && osnl(b, l + 1); - r = r && sub_constr2(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // unpack_nounpack_pragma? - private static boolean constr2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr2_0")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - // unpack_nounpack_pragma? - private static boolean constr2_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr2_3")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - /* ********************************************************** */ - // unpack_nounpack_pragma? qcon osnl (unpack_nounpack_pragma? qvar_op? osnl atype osnl)* - public static boolean constr3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_3, ""); - r = constr3_0(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && constr3_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // unpack_nounpack_pragma? - private static boolean constr3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_0")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - // (unpack_nounpack_pragma? qvar_op? osnl atype osnl)* - private static boolean constr3_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_3")) return false; - int c = current_position_(b); - while (true) { - if (!constr3_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "constr3_3", c)) break; - c = current_position_(b); - } - return true; - } - - // unpack_nounpack_pragma? qvar_op? osnl atype osnl - private static boolean constr3_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = constr3_3_0_0(b, l + 1); - r = r && constr3_3_0_1(b, l + 1); - r = r && osnl(b, l + 1); - r = r && atype(b, l + 1); - r = r && osnl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // unpack_nounpack_pragma? - private static boolean constr3_3_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_3_0_0")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - // qvar_op? - private static boolean constr3_3_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr3_3_0_1")) return false; - qvar_op(b, l + 1); - return true; - } - - /* ********************************************************** */ - // unpack_nounpack_pragma? qvar gcon_sym unpack_nounpack_pragma? qcon - public static boolean constr4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr4")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CONSTR_4, ""); - r = constr4_0(b, l + 1); - r = r && qvar(b, l + 1); - r = r && gcon_sym(b, l + 1); - r = r && constr4_3(b, l + 1); - r = r && qcon(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // unpack_nounpack_pragma? - private static boolean constr4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr4_0")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - // unpack_nounpack_pragma? - private static boolean constr4_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constr4_3")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - /* ********************************************************** */ - // constr (osnl VERTICAL_BAR osnl constr)* - static boolean constrs(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constrs")) return false; - boolean r; - Marker m = enter_section_(b); - r = constr(b, l + 1); - r = r && constrs_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl VERTICAL_BAR osnl constr)* - private static boolean constrs_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constrs_1")) return false; - int c = current_position_(b); - while (true) { - if (!constrs_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "constrs_1", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl VERTICAL_BAR osnl constr - private static boolean constrs_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "constrs_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_VERTICAL_BAR); - r = r && osnl(b, l + 1); - r = r && constr(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // LEFT_PAREN osnl (clazz (osnl COMMA osnl clazz)*)? osnl RIGHT_PAREN | - // clazz - public static boolean context(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_CONTEXT, ""); - r = context_0(b, l + 1); - if (!r) r = clazz(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_PAREN osnl (clazz (osnl COMMA osnl clazz)*)? osnl RIGHT_PAREN - private static boolean context_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && context_0_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (clazz (osnl COMMA osnl clazz)*)? - private static boolean context_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2")) return false; - context_0_2_0(b, l + 1); - return true; - } - - // clazz (osnl COMMA osnl clazz)* - private static boolean context_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = clazz(b, l + 1); - r = r && context_0_2_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl COMMA osnl clazz)* - private static boolean context_0_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2_0_1")) return false; - int c = current_position_(b); - while (true) { - if (!context_0_2_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "context_0_2_0_1", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl COMMA osnl clazz - private static boolean context_0_2_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "context_0_2_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && clazz(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "CTYPE" general_pragma_content PRAGMA_END - public static boolean ctype_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ctype_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "CTYPE"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_CTYPE_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // DATA osnl simpletype osnl LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN osnl qvar* osnl data_declaration_deriving? | - // DATA osnl ctype_pragma? osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl constrs osnl data_declaration_deriving? | - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl WHERE osnl cdecls osnl data_declaration_deriving? | - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype+ osnl (EQUAL osnl expression | EQUAL osnl simpletype+)? osnl data_declaration_deriving? - public static boolean data_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration")) return false; - if (!nextTokenIs(b, HS_DATA)) return false; - boolean r; - Marker m = enter_section_(b); - r = data_declaration_0(b, l + 1); - if (!r) r = data_declaration_1(b, l + 1); - if (!r) r = data_declaration_2(b, l + 1); - if (!r) r = data_declaration_3(b, l + 1); - exit_section_(b, m, HS_DATA_DECLARATION, r); - return r; - } - - // DATA osnl simpletype osnl LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN osnl qvar* osnl data_declaration_deriving? - private static boolean data_declaration_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && kind_signature(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - r = r && osnl(b, l + 1); - r = r && data_declaration_0_10(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_0_12(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar* - private static boolean data_declaration_0_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_0_10")) return false; - int c = current_position_(b); - while (true) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_0_10", c)) break; - c = current_position_(b); - } - return true; - } - - // data_declaration_deriving? - private static boolean data_declaration_0_12(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_0_12")) return false; - data_declaration_deriving(b, l + 1); - return true; - } - - // DATA osnl ctype_pragma? osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl constrs osnl data_declaration_deriving? - private static boolean data_declaration_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); - r = r && data_declaration_1_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_1_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_1_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && constrs(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_1_14(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // ctype_pragma? - private static boolean data_declaration_1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_1_2")) return false; - ctype_pragma(b, l + 1); - return true; - } - - // INSTANCE? - private static boolean data_declaration_1_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_1_4")) return false; - consumeToken(b, HS_INSTANCE); - return true; - } - - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean data_declaration_1_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_1_6")) return false; - data_declaration_1_6_0(b, l + 1); - return true; - } - - // context osnl DOUBLE_RIGHT_ARROW - private static boolean data_declaration_1_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_1_6_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = context(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // data_declaration_deriving? - private static boolean data_declaration_1_14(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_1_14")) return false; - data_declaration_deriving(b, l + 1); - return true; - } - - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl WHERE osnl cdecls osnl data_declaration_deriving? - private static boolean data_declaration_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); - r = r && data_declaration_2_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_2_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_WHERE); - r = r && osnl(b, l + 1); - r = r && cdecls(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_2_12(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // INSTANCE? - private static boolean data_declaration_2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2_2")) return false; - consumeToken(b, HS_INSTANCE); - return true; - } - - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean data_declaration_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2_4")) return false; - data_declaration_2_4_0(b, l + 1); - return true; - } - - // context osnl DOUBLE_RIGHT_ARROW - private static boolean data_declaration_2_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = context(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // data_declaration_deriving? - private static boolean data_declaration_2_12(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_2_12")) return false; - data_declaration_deriving(b, l + 1); - return true; - } - - // DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype+ osnl (EQUAL osnl expression | EQUAL osnl simpletype+)? osnl data_declaration_deriving? - private static boolean data_declaration_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DATA); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_8(b, l + 1); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_10(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // INSTANCE? - private static boolean data_declaration_3_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_2")) return false; - consumeToken(b, HS_INSTANCE); - return true; - } - - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean data_declaration_3_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_4")) return false; - data_declaration_3_4_0(b, l + 1); - return true; - } - - // context osnl DOUBLE_RIGHT_ARROW - private static boolean data_declaration_3_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = context(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // simpletype+ - private static boolean data_declaration_3_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_6")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!simpletype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_3_6", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // (EQUAL osnl expression | EQUAL osnl simpletype+)? - private static boolean data_declaration_3_8(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_8")) return false; - data_declaration_3_8_0(b, l + 1); - return true; - } - - // EQUAL osnl expression | EQUAL osnl simpletype+ - private static boolean data_declaration_3_8_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_8_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = data_declaration_3_8_0_0(b, l + 1); - if (!r) r = data_declaration_3_8_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // EQUAL osnl expression - private static boolean data_declaration_3_8_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_8_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // EQUAL osnl simpletype+ - private static boolean data_declaration_3_8_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_8_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && data_declaration_3_8_0_1_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // simpletype+ - private static boolean data_declaration_3_8_0_1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_8_0_1_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype(b, l + 1); - int c = current_position_(b); - while (r) { - if (!simpletype(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_3_8_0_1_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // data_declaration_deriving? - private static boolean data_declaration_3_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_3_10")) return false; - data_declaration_deriving(b, l + 1); - return true; - } - - /* ********************************************************** */ - // (DERIVING ttype osnl | DERIVING LEFT_PAREN ttype (osnl COMMA osnl ttype)* RIGHT_PAREN osnl)+ - public static boolean data_declaration_deriving(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_deriving")) return false; - if (!nextTokenIs(b, HS_DERIVING)) return false; - boolean r; - Marker m = enter_section_(b); - r = data_declaration_deriving_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!data_declaration_deriving_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_deriving", c)) break; - c = current_position_(b); - } - exit_section_(b, m, HS_DATA_DECLARATION_DERIVING, r); - return r; - } - - // DERIVING ttype osnl | DERIVING LEFT_PAREN ttype (osnl COMMA osnl ttype)* RIGHT_PAREN osnl - private static boolean data_declaration_deriving_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_deriving_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = data_declaration_deriving_0_0(b, l + 1); - if (!r) r = data_declaration_deriving_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // DERIVING ttype osnl - private static boolean data_declaration_deriving_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_deriving_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DERIVING); - r = r && ttype(b, l + 1); - r = r && osnl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // DERIVING LEFT_PAREN ttype (osnl COMMA osnl ttype)* RIGHT_PAREN osnl - private static boolean data_declaration_deriving_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_deriving_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_DERIVING, HS_LEFT_PAREN); - r = r && ttype(b, l + 1); - r = r && data_declaration_deriving_0_1_3(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - r = r && osnl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl COMMA osnl ttype)* - private static boolean data_declaration_deriving_0_1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_deriving_0_1_3")) return false; - int c = current_position_(b); - while (true) { - if (!data_declaration_deriving_0_1_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "data_declaration_deriving_0_1_3", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl COMMA osnl ttype - private static boolean data_declaration_deriving_0_1_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "data_declaration_deriving_0_1_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // DEFAULT osnl (LEFT_PAREN (ttype (COMMA ttype)*)? RIGHT_PAREN | type_signature) - public static boolean default_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "default_declaration")) return false; - if (!nextTokenIs(b, HS_DEFAULT)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DEFAULT); - r = r && osnl(b, l + 1); - r = r && default_declaration_2(b, l + 1); - exit_section_(b, m, HS_DEFAULT_DECLARATION, r); - return r; - } - - // LEFT_PAREN (ttype (COMMA ttype)*)? RIGHT_PAREN | type_signature - private static boolean default_declaration_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "default_declaration_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = default_declaration_2_0(b, l + 1); - if (!r) r = type_signature(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN (ttype (COMMA ttype)*)? RIGHT_PAREN - private static boolean default_declaration_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "default_declaration_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && default_declaration_2_0_1(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (ttype (COMMA ttype)*)? - private static boolean default_declaration_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "default_declaration_2_0_1")) return false; - default_declaration_2_0_1_0(b, l + 1); - return true; - } - - // ttype (COMMA ttype)* - private static boolean default_declaration_2_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "default_declaration_2_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = ttype(b, l + 1); - r = r && default_declaration_2_0_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (COMMA ttype)* - private static boolean default_declaration_2_0_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "default_declaration_2_0_1_0_1")) return false; - int c = current_position_(b); - while (true) { - if (!default_declaration_2_0_1_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "default_declaration_2_0_1_0_1", c)) break; - c = current_position_(b); - } - return true; - } - - // COMMA ttype - private static boolean default_declaration_2_0_1_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "default_declaration_2_0_1_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_COMMA); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl ("DEPRECATED" | "WARNING") general_pragma_content PRAGMA_END - public static boolean deprecated_warn_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "deprecated_warn_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && deprecated_warn_pragma_2(b, l + 1); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_DEPRECATED_WARN_PRAGMA, r); - return r; - } - - // "DEPRECATED" | "WARNING" - private static boolean deprecated_warn_pragma_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "deprecated_warn_pragma_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, "DEPRECATED"); - if (!r) r = consumeToken(b, "WARNING"); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // DERIVING INSTANCE (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst - public static boolean deriving_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "deriving_declaration")) return false; - if (!nextTokenIs(b, HS_DERIVING)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_DERIVING, HS_INSTANCE); - r = r && deriving_declaration_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && inst(b, l + 1); - exit_section_(b, m, HS_DERIVING_DECLARATION, r); - return r; - } - - // (scontext osnl DOUBLE_RIGHT_ARROW)? - private static boolean deriving_declaration_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "deriving_declaration_2")) return false; - deriving_declaration_2_0(b, l + 1); - return true; - } - - // scontext osnl DOUBLE_RIGHT_ARROW - private static boolean deriving_declaration_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "deriving_declaration_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = scontext(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // LEFT_PAREN VARSYM_ID RIGHT_PAREN - public static boolean dot_dot_parens(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "dot_dot_parens")) return false; - if (!nextTokenIs(b, HS_LEFT_PAREN)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_LEFT_PAREN, HS_VARSYM_ID, HS_RIGHT_PAREN); - exit_section_(b, m, HS_DOT_DOT_PARENS, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START CONID_ID? PRAGMA_END? NEWLINE? - public static boolean dummy_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "dummy_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && dummy_pragma_1(b, l + 1); - r = r && dummy_pragma_2(b, l + 1); - r = r && dummy_pragma_3(b, l + 1); - exit_section_(b, m, HS_DUMMY_PRAGMA, r); - return r; - } - - // CONID_ID? - private static boolean dummy_pragma_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "dummy_pragma_1")) return false; - consumeToken(b, HS_CONID_ID); - return true; - } - - // PRAGMA_END? - private static boolean dummy_pragma_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "dummy_pragma_2")) return false; - consumeToken(b, HS_PRAGMA_END); - return true; - } - - // NEWLINE? - private static boolean dummy_pragma_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "dummy_pragma_3")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // export1 | export2 | export3 - public static boolean export(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_EXPORT, ""); - r = export1(b, l + 1); - if (!r) r = export2(b, l + 1); - if (!r) r = export3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // TYPE? onl (qvar | qvar_op) - static boolean export1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export1")) return false; - boolean r; - Marker m = enter_section_(b); - r = export1_0(b, l + 1); - r = r && onl(b, l + 1); - r = r && export1_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE? - private static boolean export1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export1_0")) return false; - consumeToken(b, HS_TYPE); - return true; - } - - // qvar | qvar_op - private static boolean export1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export1_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - if (!r) r = qvar_op(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qcon onl (dot_dot_parens | LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN)? - static boolean export2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && onl(b, l + 1); - r = r && export2_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (dot_dot_parens | LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN)? - private static boolean export2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2")) return false; - export2_2_0(b, l + 1); - return true; - } - - // dot_dot_parens | LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN - private static boolean export2_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = dot_dot_parens(b, l + 1); - if (!r) r = export2_2_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN - private static boolean export2_2_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && onl(b, l + 1); - r = r && export2_2_0_1_2(b, l + 1); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (cname onl (onl COMMA onl cname)*)? - private static boolean export2_2_0_1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2")) return false; - export2_2_0_1_2_0(b, l + 1); - return true; - } - - // cname onl (onl COMMA onl cname)* - private static boolean export2_2_0_1_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = cname(b, l + 1); - r = r && onl(b, l + 1); - r = r && export2_2_0_1_2_0_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (onl COMMA onl cname)* - private static boolean export2_2_0_1_2_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2_0_2")) return false; - int c = current_position_(b); - while (true) { - if (!export2_2_0_1_2_0_2_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "export2_2_0_1_2_0_2", c)) break; - c = current_position_(b); - } - return true; - } - - // onl COMMA onl cname - private static boolean export2_2_0_1_2_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export2_2_0_1_2_0_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && onl(b, l + 1); - r = r && cname(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // MODULE mod_id - static boolean export3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "export3")) return false; - if (!nextTokenIs(b, HS_MODULE)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_MODULE); - r = r && mod_id(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // LEFT_PAREN onl export? (onl COMMA? onl export onl)* onl COMMA? onl RIGHT_PAREN - public static boolean exports(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports")) return false; - if (!nextTokenIs(b, HS_LEFT_PAREN)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && onl(b, l + 1); - r = r && exports_2(b, l + 1); - r = r && exports_3(b, l + 1); - r = r && onl(b, l + 1); - r = r && exports_5(b, l + 1); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, HS_EXPORTS, r); - return r; - } - - // export? - private static boolean exports_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_2")) return false; - export(b, l + 1); - return true; - } - - // (onl COMMA? onl export onl)* - private static boolean exports_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_3")) return false; - int c = current_position_(b); - while (true) { - if (!exports_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "exports_3", c)) break; - c = current_position_(b); - } - return true; - } - - // onl COMMA? onl export onl - private static boolean exports_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && exports_3_0_1(b, l + 1); - r = r && onl(b, l + 1); - r = r && export(b, l + 1); - r = r && onl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // COMMA? - private static boolean exports_3_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_3_0_1")) return false; - consumeToken(b, HS_COMMA); - return true; - } - - // COMMA? - private static boolean exports_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "exports_5")) return false; - consumeToken(b, HS_COMMA); - return true; - } - - /* ********************************************************** */ - // first_line_expression (line_expression)* last_line_expression | last_line_expression - public static boolean expression(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "expression")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_EXPRESSION, ""); - r = expression_0(b, l + 1); - if (!r) r = last_line_expression(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // first_line_expression (line_expression)* last_line_expression - private static boolean expression_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "expression_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = first_line_expression(b, l + 1); - r = r && expression_0_1(b, l + 1); - r = r && last_line_expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (line_expression)* - private static boolean expression_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "expression_0_1")) return false; - int c = current_position_(b); - while (true) { - if (!expression_0_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "expression_0_1", c)) break; - c = current_position_(b); - } - return true; - } - - // (line_expression) - private static boolean expression_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "expression_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = line_expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // vars (COLON_COLON unpack_nounpack_pragma? (ttype | qvar_op atype))? - public static boolean fielddecl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fielddecl")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_FIELDDECL, ""); - r = vars(b, l + 1); - r = r && fielddecl_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // (COLON_COLON unpack_nounpack_pragma? (ttype | qvar_op atype))? - private static boolean fielddecl_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fielddecl_1")) return false; - fielddecl_1_0(b, l + 1); - return true; - } - - // COLON_COLON unpack_nounpack_pragma? (ttype | qvar_op atype) - private static boolean fielddecl_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fielddecl_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_COLON_COLON); - r = r && fielddecl_1_0_1(b, l + 1); - r = r && fielddecl_1_0_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // unpack_nounpack_pragma? - private static boolean fielddecl_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fielddecl_1_0_1")) return false; - unpack_nounpack_pragma(b, l + 1); - return true; - } - - // ttype | qvar_op atype - private static boolean fielddecl_1_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fielddecl_1_0_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = ttype(b, l + 1); - if (!r) r = fielddecl_1_0_2_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar_op atype - private static boolean fielddecl_1_0_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fielddecl_1_0_2_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar_op(b, l + 1); - r = r && atype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // (file_header_pragma onl)+ - public static boolean file_header(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "file_header")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = file_header_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!file_header_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "file_header", c)) break; - c = current_position_(b); - } - exit_section_(b, m, HS_FILE_HEADER, r); - return r; - } - - // file_header_pragma onl - private static boolean file_header_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "file_header_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = file_header_pragma(b, l + 1); - r = r && onl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // language_pragma | options_ghc_pragma | include_pragma | haddock_pragma | ann_pragma | dummy_pragma - public static boolean file_header_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "file_header_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = language_pragma(b, l + 1); - if (!r) r = options_ghc_pragma(b, l + 1); - if (!r) r = include_pragma(b, l + 1); - if (!r) r = haddock_pragma(b, l + 1); - if (!r) r = ann_pragma(b, l + 1); - if (!r) r = dummy_pragma(b, l + 1); - exit_section_(b, m, HS_FILE_HEADER_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // general_id+ snl - public static boolean first_line_expression(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "first_line_expression")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_FIRST_LINE_EXPRESSION, ""); - r = first_line_expression_0(b, l + 1); - r = r && snl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // general_id+ - private static boolean first_line_expression_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "first_line_expression_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = general_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "first_line_expression_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // INFIXL | INFIXR | INFIX - public static boolean fixity(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "fixity")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_FIXITY, ""); - r = consumeToken(b, HS_INFIXL); - if (!r) r = consumeToken(b, HS_INFIXR); - if (!r) r = consumeToken(b, HS_INFIX); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // (FOREIGN_IMPORT | FOREIGN_EXPORT) osnl expression - public static boolean foreign_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "foreign_declaration")) return false; - if (!nextTokenIs(b, "", HS_FOREIGN_EXPORT, HS_FOREIGN_IMPORT)) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_FOREIGN_DECLARATION, ""); - r = foreign_declaration_0(b, l + 1); - r = r && osnl(b, l + 1); - r = r && expression(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // FOREIGN_IMPORT | FOREIGN_EXPORT - private static boolean foreign_declaration_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "foreign_declaration_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_FOREIGN_IMPORT); - if (!r) r = consumeToken(b, HS_FOREIGN_EXPORT); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // con_sym | qcon_sym - public static boolean gcon_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gcon_sym")) return false; - if (!nextTokenIs(b, "", HS_CONID_ID, HS_CONSYM_ID)) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_GCON_SYM, ""); - r = con_sym(b, l + 1); - if (!r) r = qcon_sym(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // qvar_op | qcon_op | qvar | qcon | LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | - // COLON_COLON | DOUBLE_RIGHT_ARROW | RIGHT_ARROW | IN | CASE | OF | LET | - // SEMICOLON | LEFT_ARROW | LEFT_BRACKET | RIGHT_BRACKET | literal | LEFT_BRACE | RIGHT_BRACE | - // COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | fixity | DOT - static boolean general_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "general_id")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar_op(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - if (!r) r = qvar(b, l + 1); - if (!r) r = qcon(b, l + 1); - if (!r) r = consumeToken(b, HS_LEFT_PAREN); - if (!r) r = consumeToken(b, HS_RIGHT_PAREN); - if (!r) r = consumeToken(b, HS_FLOAT); - if (!r) r = consumeToken(b, HS_DO); - if (!r) r = consumeToken(b, HS_WHERE); - if (!r) r = consumeToken(b, HS_IF); - if (!r) r = consumeToken(b, HS_THEN); - if (!r) r = consumeToken(b, HS_ELSE); - if (!r) r = consumeToken(b, HS_COLON_COLON); - if (!r) r = consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - if (!r) r = consumeToken(b, HS_RIGHT_ARROW); - if (!r) r = consumeToken(b, HS_IN); - if (!r) r = consumeToken(b, HS_CASE); - if (!r) r = consumeToken(b, HS_OF); - if (!r) r = consumeToken(b, HS_LET); - if (!r) r = consumeToken(b, HS_SEMICOLON); - if (!r) r = consumeToken(b, HS_LEFT_ARROW); - if (!r) r = consumeToken(b, HS_LEFT_BRACKET); - if (!r) r = consumeToken(b, HS_RIGHT_BRACKET); - if (!r) r = literal(b, l + 1); - if (!r) r = consumeToken(b, HS_LEFT_BRACE); - if (!r) r = consumeToken(b, HS_RIGHT_BRACE); - if (!r) r = consumeToken(b, HS_COMMA); - if (!r) r = consumeToken(b, HS_UNDERSCORE); - if (!r) r = symbol_reserved_op(b, l + 1); - if (!r) r = consumeToken(b, HS_QUOTE); - if (!r) r = consumeToken(b, HS_BACKQUOTE); - if (!r) r = fixity(b, l + 1); - if (!r) r = consumeToken(b, HS_DOT); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // (general_id | NEWLINE | MODULE | INSTANCE)* - public static boolean general_pragma_content(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "general_pragma_content")) return false; - Marker m = enter_section_(b, l, _NONE_, HS_GENERAL_PRAGMA_CONTENT, ""); - int c = current_position_(b); - while (true) { - if (!general_pragma_content_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "general_pragma_content", c)) break; - c = current_position_(b); - } - exit_section_(b, l, m, true, false, null); - return true; - } - - // general_id | NEWLINE | MODULE | INSTANCE - private static boolean general_pragma_content_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "general_pragma_content_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = general_id(b, l + 1); - if (!r) r = consumeToken(b, HS_NEWLINE); - if (!r) r = consumeToken(b, HS_MODULE); - if (!r) r = consumeToken(b, HS_INSTANCE); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // QUOTE? qcon | LEFT_PAREN RIGHT_ARROW RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN | QUOTE? LEFT_BRACKET RIGHT_BRACKET |LEFT_PAREN COMMA (COMMA)* RIGHT_PAREN - public static boolean gtycon(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gtycon")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_GTYCON, ""); - r = gtycon_0(b, l + 1); - if (!r) r = parseTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_ARROW, HS_RIGHT_PAREN); - if (!r) r = parseTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_PAREN); - if (!r) r = gtycon_3(b, l + 1); - if (!r) r = gtycon_4(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // QUOTE? qcon - private static boolean gtycon_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gtycon_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = gtycon_0_0(b, l + 1); - r = r && qcon(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // QUOTE? - private static boolean gtycon_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gtycon_0_0")) return false; - consumeToken(b, HS_QUOTE); - return true; - } - - // QUOTE? LEFT_BRACKET RIGHT_BRACKET - private static boolean gtycon_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gtycon_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = gtycon_3_0(b, l + 1); - r = r && consumeTokens(b, 0, HS_LEFT_BRACKET, HS_RIGHT_BRACKET); - exit_section_(b, m, null, r); - return r; - } - - // QUOTE? - private static boolean gtycon_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gtycon_3_0")) return false; - consumeToken(b, HS_QUOTE); - return true; - } - - // LEFT_PAREN COMMA (COMMA)* RIGHT_PAREN - private static boolean gtycon_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gtycon_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_LEFT_PAREN, HS_COMMA); - r = r && gtycon_4_2(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (COMMA)* - private static boolean gtycon_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "gtycon_4_2")) return false; - int c = current_position_(b); - while (true) { - if (!consumeToken(b, HS_COMMA)) break; - if (!empty_element_parsed_guard_(b, "gtycon_4_2", c)) break; - c = current_position_(b); - } - return true; - } - - /* ********************************************************** */ - // PRAGMA_START onl "OPTIONS_HADDOCK" general_pragma_content PRAGMA_END NEWLINE? - public static boolean haddock_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "haddock_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "OPTIONS_HADDOCK"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - r = r && haddock_pragma_5(b, l + 1); - exit_section_(b, m, HS_HADDOCK_PRAGMA, r); - return r; - } - - // NEWLINE? - private static boolean haddock_pragma_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "haddock_pragma_5")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // cidecl - public static boolean idecl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "idecl")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_IDECL, ""); - r = cidecl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // (idecl | expression) (osnl (idecl | expression))* - static boolean idecls(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "idecls")) return false; - boolean r; - Marker m = enter_section_(b); - r = idecls_0(b, l + 1); - r = r && idecls_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // idecl | expression - private static boolean idecls_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "idecls_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = idecl(b, l + 1); - if (!r) r = expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl (idecl | expression))* - private static boolean idecls_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "idecls_1")) return false; - int c = current_position_(b); - while (true) { - if (!idecls_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "idecls_1", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl (idecl | expression) - private static boolean idecls_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "idecls_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && idecls_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // idecl | expression - private static boolean idecls_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "idecls_1_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = idecl(b, l + 1); - if (!r) r = expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // IMPORT osnl source_pragma? osnl import_qualified? osnl import_module osnl import_qualified_as? osnl import_spec? onl - public static boolean import_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration")) return false; - if (!nextTokenIs(b, HS_IMPORT)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_IMPORT); - r = r && osnl(b, l + 1); - r = r && import_declaration_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_declaration_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_module(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_declaration_8(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_declaration_10(b, l + 1); - r = r && onl(b, l + 1); - exit_section_(b, m, HS_IMPORT_DECLARATION, r); - return r; - } - - // source_pragma? - private static boolean import_declaration_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_2")) return false; - source_pragma(b, l + 1); - return true; - } - - // import_qualified? - private static boolean import_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_4")) return false; - import_qualified(b, l + 1); - return true; - } - - // import_qualified_as? - private static boolean import_declaration_8(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_8")) return false; - import_qualified_as(b, l + 1); - return true; - } - - // import_spec? - private static boolean import_declaration_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declaration_10")) return false; - import_spec(b, l + 1); - return true; - } - - /* ********************************************************** */ - // ((import_declaration | cfiles_pragma) onl)* - static boolean import_declarations(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declarations")) return false; - int c = current_position_(b); - while (true) { - if (!import_declarations_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "import_declarations", c)) break; - c = current_position_(b); - } - return true; - } - - // (import_declaration | cfiles_pragma) onl - private static boolean import_declarations_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declarations_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = import_declarations_0_0(b, l + 1); - r = r && onl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // import_declaration | cfiles_pragma - private static boolean import_declarations_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_declarations_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = import_declaration(b, l + 1); - if (!r) r = cfiles_pragma(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // LEFT_PAREN RIGHT_PAREN - public static boolean import_empty_spec(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_empty_spec")) return false; - if (!nextTokenIs(b, HS_LEFT_PAREN)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_PAREN); - exit_section_(b, m, HS_IMPORT_EMPTY_SPEC, r); - return r; - } - - /* ********************************************************** */ - // "hiding" - public static boolean import_hiding(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_hiding")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_HIDING, ""); - r = consumeToken(b, "hiding"); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // import_hiding osnl LEFT_PAREN osnl (import_id osnl (osnl COMMA osnl import_id)* osnl (COMMA)?)? osnl RIGHT_PAREN - public static boolean import_hiding_spec(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_hiding_spec")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_HIDING_SPEC, ""); - r = import_hiding(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && import_hiding_spec_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, l, m, r, false, null); - return r; - } - - // (import_id osnl (osnl COMMA osnl import_id)* osnl (COMMA)?)? - private static boolean import_hiding_spec_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_hiding_spec_4")) return false; - import_hiding_spec_4_0(b, l + 1); - return true; - } - - // import_id osnl (osnl COMMA osnl import_id)* osnl (COMMA)? - private static boolean import_hiding_spec_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_hiding_spec_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = import_id(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_hiding_spec_4_0_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_hiding_spec_4_0_4(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl COMMA osnl import_id)* - private static boolean import_hiding_spec_4_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_hiding_spec_4_0_2")) return false; - int c = current_position_(b); - while (true) { - if (!import_hiding_spec_4_0_2_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "import_hiding_spec_4_0_2", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl COMMA osnl import_id - private static boolean import_hiding_spec_4_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_hiding_spec_4_0_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && import_id(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (COMMA)? - private static boolean import_hiding_spec_4_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_hiding_spec_4_0_4")) return false; - consumeToken(b, HS_COMMA); - return true; - } - - /* ********************************************************** */ - // TYPE? (LEFT_PAREN DOT RIGHT_PAREN | qcon osnl LEFT_PAREN osnl cname osnl (COMMA osnl cname osnl)* osnl RIGHT_PAREN | qvar | qcon dot_dot_parens?) - public static boolean import_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_ID, ""); - r = import_id_0(b, l + 1); - r = r && import_id_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // TYPE? - private static boolean import_id_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_0")) return false; - consumeToken(b, HS_TYPE); - return true; - } - - // LEFT_PAREN DOT RIGHT_PAREN | qcon osnl LEFT_PAREN osnl cname osnl (COMMA osnl cname osnl)* osnl RIGHT_PAREN | qvar | qcon dot_dot_parens? - private static boolean import_id_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = parseTokens(b, 0, HS_LEFT_PAREN, HS_DOT, HS_RIGHT_PAREN); - if (!r) r = import_id_1_1(b, l + 1); - if (!r) r = qvar(b, l + 1); - if (!r) r = import_id_1_3(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qcon osnl LEFT_PAREN osnl cname osnl (COMMA osnl cname osnl)* osnl RIGHT_PAREN - private static boolean import_id_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && cname(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_id_1_1_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (COMMA osnl cname osnl)* - private static boolean import_id_1_1_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_1_6")) return false; - int c = current_position_(b); - while (true) { - if (!import_id_1_1_6_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "import_id_1_1_6", c)) break; - c = current_position_(b); - } - return true; - } - - // COMMA osnl cname osnl - private static boolean import_id_1_1_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_1_6_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && cname(b, l + 1); - r = r && osnl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qcon dot_dot_parens? - private static boolean import_id_1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && import_id_1_3_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // dot_dot_parens? - private static boolean import_id_1_3_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_id_1_3_1")) return false; - dot_dot_parens(b, l + 1); - return true; - } - - /* ********************************************************** */ - // LEFT_PAREN osnl import_id (osnl COMMA osnl import_id)* osnl (COMMA)? osnl RIGHT_PAREN - public static boolean import_ids_spec(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_ids_spec")) return false; - if (!nextTokenIs(b, HS_LEFT_PAREN)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && import_id(b, l + 1); - r = r && import_ids_spec_3(b, l + 1); - r = r && osnl(b, l + 1); - r = r && import_ids_spec_5(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, HS_IMPORT_IDS_SPEC, r); - return r; - } - - // (osnl COMMA osnl import_id)* - private static boolean import_ids_spec_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_ids_spec_3")) return false; - int c = current_position_(b); - while (true) { - if (!import_ids_spec_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "import_ids_spec_3", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl COMMA osnl import_id - private static boolean import_ids_spec_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_ids_spec_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && import_id(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (COMMA)? - private static boolean import_ids_spec_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_ids_spec_5")) return false; - consumeToken(b, HS_COMMA); - return true; - } - - /* ********************************************************** */ - // mod_id - public static boolean import_module(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_module")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = mod_id(b, l + 1); - exit_section_(b, m, HS_IMPORT_MODULE, r); - return r; - } - - /* ********************************************************** */ - // var_id - public static boolean import_qualified(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_qualified")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = var_id(b, l + 1); - exit_section_(b, m, HS_IMPORT_QUALIFIED, r); - return r; - } - - /* ********************************************************** */ - // var_id qualifier? - public static boolean import_qualified_as(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_qualified_as")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = var_id(b, l + 1); - r = r && import_qualified_as_1(b, l + 1); - exit_section_(b, m, HS_IMPORT_QUALIFIED_AS, r); - return r; - } - - // qualifier? - private static boolean import_qualified_as_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_qualified_as_1")) return false; - qualifier(b, l + 1); - return true; - } - - /* ********************************************************** */ - // import_ids_spec | - // import_hiding_spec | - // import_empty_spec - public static boolean import_spec(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "import_spec")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_IMPORT_SPEC, ""); - r = import_ids_spec(b, l + 1); - if (!r) r = import_hiding_spec(b, l + 1); - if (!r) r = import_empty_spec(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "INCLUDE" general_pragma_content PRAGMA_END NEWLINE? - public static boolean include_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "include_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "INCLUDE"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - r = r && include_pragma_5(b, l + 1); - exit_section_(b, m, HS_INCLUDE_PRAGMA, r); - return r; - } - - // NEWLINE? - private static boolean include_pragma_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "include_pragma_5")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // PRAGMA_START onl ("INLINABLE" | "INLINEABLE") general_pragma_content PRAGMA_END - public static boolean inlinable_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inlinable_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && inlinable_pragma_2(b, l + 1); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_INLINABLE_PRAGMA, r); - return r; - } - - // "INLINABLE" | "INLINEABLE" - private static boolean inlinable_pragma_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inlinable_pragma_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, "INLINABLE"); - if (!r) r = consumeToken(b, "INLINEABLE"); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "INLINE" general_pragma_content PRAGMA_END - public static boolean inline_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inline_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "INLINE"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_INLINE_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // qvar gtycon | - // gtycon? instvar* (LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN)+ instvar* | - // gtycon+ instvar* | - // qvar instvar* | - // (LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN)+ instvar* | - // QUOTE? (LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET)+ instvar* | - // (LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN)+ instvar* | - // (LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN)+ instvar* | - // ttype - public static boolean inst(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_INST, ""); - r = inst_0(b, l + 1); - if (!r) r = inst_1(b, l + 1); - if (!r) r = inst_2(b, l + 1); - if (!r) r = inst_3(b, l + 1); - if (!r) r = inst_4(b, l + 1); - if (!r) r = inst_5(b, l + 1); - if (!r) r = inst_6(b, l + 1); - if (!r) r = inst_7(b, l + 1); - if (!r) r = ttype(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // qvar gtycon - private static boolean inst_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - r = r && gtycon(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // gtycon? instvar* (LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN)+ instvar* - private static boolean inst_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_1_0(b, l + 1); - r = r && inst_1_1(b, l + 1); - r = r && inst_1_2(b, l + 1); - r = r && inst_1_3(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // gtycon? - private static boolean inst_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1_0")) return false; - gtycon(b, l + 1); - return true; - } - - // instvar* - private static boolean inst_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1_1")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_1_1", c)) break; - c = current_position_(b); - } - return true; - } - - // (LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN)+ - private static boolean inst_1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_1_2_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!inst_1_2_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_1_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN - private static boolean inst_1_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && gtycon(b, l + 1); - r = r && inst_1_2_0_3(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (instvar)* - private static boolean inst_1_2_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1_2_0_3")) return false; - int c = current_position_(b); - while (true) { - if (!inst_1_2_0_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_1_2_0_3", c)) break; - c = current_position_(b); - } - return true; - } - - // (instvar) - private static boolean inst_1_2_0_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1_2_0_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = instvar(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // instvar* - private static boolean inst_1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_1_3")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_1_3", c)) break; - c = current_position_(b); - } - return true; - } - - // gtycon+ instvar* - private static boolean inst_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_2_0(b, l + 1); - r = r && inst_2_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // gtycon+ - private static boolean inst_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = gtycon(b, l + 1); - int c = current_position_(b); - while (r) { - if (!gtycon(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_2_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // instvar* - private static boolean inst_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_2_1")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_2_1", c)) break; - c = current_position_(b); - } - return true; - } - - // qvar instvar* - private static boolean inst_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - r = r && inst_3_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // instvar* - private static boolean inst_3_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_3_1")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_3_1", c)) break; - c = current_position_(b); - } - return true; - } - - // (LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN)+ instvar* - private static boolean inst_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_4_0(b, l + 1); - r = r && inst_4_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN)+ - private static boolean inst_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_4_0_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!inst_4_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_4_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN - private static boolean inst_4_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_4_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && instvar(b, l + 1); - r = r && inst_4_0_0_3(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // (osnl COMMA osnl instvar)+ - private static boolean inst_4_0_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_4_0_0_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_4_0_0_3_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!inst_4_0_0_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_4_0_0_3", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // osnl COMMA osnl instvar - private static boolean inst_4_0_0_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_4_0_0_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && instvar(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // instvar* - private static boolean inst_4_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_4_1")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_4_1", c)) break; - c = current_position_(b); - } - return true; - } - - // QUOTE? (LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET)+ instvar* - private static boolean inst_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_5")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_5_0(b, l + 1); - r = r && inst_5_1(b, l + 1); - r = r && inst_5_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // QUOTE? - private static boolean inst_5_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_5_0")) return false; - consumeToken(b, HS_QUOTE); - return true; - } - - // (LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET)+ - private static boolean inst_5_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_5_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_5_1_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!inst_5_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_5_1", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET - private static boolean inst_5_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_5_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_BRACKET); - r = r && osnl(b, l + 1); - r = r && instvar(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_BRACKET); - exit_section_(b, m, null, r); - return r; - } - - // instvar* - private static boolean inst_5_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_5_2")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_5_2", c)) break; - c = current_position_(b); - } - return true; - } - - // (LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN)+ instvar* - private static boolean inst_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_6")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_6_0(b, l + 1); - r = r && inst_6_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN)+ - private static boolean inst_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_6_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_6_0_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!inst_6_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_6_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN - private static boolean inst_6_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_6_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && inst_6_0_0_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // instvar+ - private static boolean inst_6_0_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_6_0_0_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = instvar(b, l + 1); - int c = current_position_(b); - while (r) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_6_0_0_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // instvar* - private static boolean inst_6_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_6_1")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_6_1", c)) break; - c = current_position_(b); - } - return true; - } - - // (LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN)+ instvar* - private static boolean inst_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_7_0(b, l + 1); - r = r && inst_7_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN)+ - private static boolean inst_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = inst_7_0_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!inst_7_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_7_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN - private static boolean inst_7_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && inst_7_0_0_2(b, l + 1); - r = r && inst_7_0_0_3(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // instvar+ - private static boolean inst_7_0_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7_0_0_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = instvar(b, l + 1); - int c = current_position_(b); - while (r) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_7_0_0_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // (RIGHT_ARROW osnl instvar* osnl)* - private static boolean inst_7_0_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7_0_0_3")) return false; - int c = current_position_(b); - while (true) { - if (!inst_7_0_0_3_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_7_0_0_3", c)) break; - c = current_position_(b); - } - return true; - } - - // RIGHT_ARROW osnl instvar* osnl - private static boolean inst_7_0_0_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7_0_0_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_RIGHT_ARROW); - r = r && osnl(b, l + 1); - r = r && inst_7_0_0_3_0_2(b, l + 1); - r = r && osnl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // instvar* - private static boolean inst_7_0_0_3_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7_0_0_3_0_2")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_7_0_0_3_0_2", c)) break; - c = current_position_(b); - } - return true; - } - - // instvar* - private static boolean inst_7_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "inst_7_1")) return false; - int c = current_position_(b); - while (true) { - if (!instvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "inst_7_1", c)) break; - c = current_position_(b); - } - return true; - } - - /* ********************************************************** */ - // INSTANCE osnl overlap_pragma? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst osnl WHERE osnl idecls - // | INSTANCE osnl overlap_pragma? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst - public static boolean instance_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration")) return false; - if (!nextTokenIs(b, HS_INSTANCE)) return false; - boolean r; - Marker m = enter_section_(b); - r = instance_declaration_0(b, l + 1); - if (!r) r = instance_declaration_1(b, l + 1); - exit_section_(b, m, HS_INSTANCE_DECLARATION, r); - return r; - } - - // INSTANCE osnl overlap_pragma? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst osnl WHERE osnl idecls - private static boolean instance_declaration_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_INSTANCE); - r = r && osnl(b, l + 1); - r = r && instance_declaration_0_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && instance_declaration_0_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && instance_declaration_0_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && inst(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_WHERE); - r = r && osnl(b, l + 1); - r = r && idecls(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // overlap_pragma? - private static boolean instance_declaration_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_0_2")) return false; - overlap_pragma(b, l + 1); - return true; - } - - // (var_id+ DOT)? - private static boolean instance_declaration_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_0_4")) return false; - instance_declaration_0_4_0(b, l + 1); - return true; - } - - // var_id+ DOT - private static boolean instance_declaration_0_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_0_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = instance_declaration_0_4_0_0(b, l + 1); - r = r && consumeToken(b, HS_DOT); - exit_section_(b, m, null, r); - return r; - } - - // var_id+ - private static boolean instance_declaration_0_4_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_0_4_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = var_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "instance_declaration_0_4_0_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // (scontext osnl DOUBLE_RIGHT_ARROW)? - private static boolean instance_declaration_0_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_0_6")) return false; - instance_declaration_0_6_0(b, l + 1); - return true; - } - - // scontext osnl DOUBLE_RIGHT_ARROW - private static boolean instance_declaration_0_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_0_6_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = scontext(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // INSTANCE osnl overlap_pragma? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst - private static boolean instance_declaration_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_INSTANCE); - r = r && osnl(b, l + 1); - r = r && instance_declaration_1_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && instance_declaration_1_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && instance_declaration_1_6(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && inst(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // overlap_pragma? - private static boolean instance_declaration_1_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_1_2")) return false; - overlap_pragma(b, l + 1); - return true; - } - - // (var_id+ DOT)? - private static boolean instance_declaration_1_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_1_4")) return false; - instance_declaration_1_4_0(b, l + 1); - return true; - } - - // var_id+ DOT - private static boolean instance_declaration_1_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_1_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = instance_declaration_1_4_0_0(b, l + 1); - r = r && consumeToken(b, HS_DOT); - exit_section_(b, m, null, r); - return r; - } - - // var_id+ - private static boolean instance_declaration_1_4_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_1_4_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = var_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "instance_declaration_1_4_0_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // (scontext osnl DOUBLE_RIGHT_ARROW)? - private static boolean instance_declaration_1_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_1_6")) return false; - instance_declaration_1_6_0(b, l + 1); - return true; - } - - // scontext osnl DOUBLE_RIGHT_ARROW - private static boolean instance_declaration_1_6_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instance_declaration_1_6_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = scontext(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qcon | qvar | gcon_sym | LEFT_BRACKET qvar RIGHT_BRACKET | LEFT_PAREN qvar? (gcon_sym | qcon) qvar? RIGHT_PAREN | - // LEFT_PAREN RIGHT_PAREN - public static boolean instvar(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_INSTVAR, ""); - r = qcon(b, l + 1); - if (!r) r = qvar(b, l + 1); - if (!r) r = gcon_sym(b, l + 1); - if (!r) r = instvar_3(b, l + 1); - if (!r) r = instvar_4(b, l + 1); - if (!r) r = parseTokens(b, 0, HS_LEFT_PAREN, HS_RIGHT_PAREN); - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_BRACKET qvar RIGHT_BRACKET - private static boolean instvar_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_BRACKET); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_BRACKET); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN qvar? (gcon_sym | qcon) qvar? RIGHT_PAREN - private static boolean instvar_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && instvar_4_1(b, l + 1); - r = r && instvar_4_2(b, l + 1); - r = r && instvar_4_3(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // qvar? - private static boolean instvar_4_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4_1")) return false; - qvar(b, l + 1); - return true; - } - - // gcon_sym | qcon - private static boolean instvar_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = gcon_sym(b, l + 1); - if (!r) r = qcon(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar? - private static boolean instvar_4_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "instvar_4_3")) return false; - qvar(b, l + 1); - return true; - } - - /* ********************************************************** */ - // var_id COLON_COLON ttype - public static boolean kind_signature(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "kind_signature")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = var_id(b, l + 1); - r = r && consumeToken(b, HS_COLON_COLON); - r = r && ttype(b, l + 1); - exit_section_(b, m, HS_KIND_SIGNATURE, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "LANGUAGE" onl qcon (onl COMMA onl qcon?)* onl PRAGMA_END NEWLINE? - public static boolean language_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "language_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "LANGUAGE"); - r = r && onl(b, l + 1); - r = r && qcon(b, l + 1); - r = r && language_pragma_5(b, l + 1); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - r = r && language_pragma_8(b, l + 1); - exit_section_(b, m, HS_LANGUAGE_PRAGMA, r); - return r; - } - - // (onl COMMA onl qcon?)* - private static boolean language_pragma_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "language_pragma_5")) return false; - int c = current_position_(b); - while (true) { - if (!language_pragma_5_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "language_pragma_5", c)) break; - c = current_position_(b); - } - return true; - } - - // onl COMMA onl qcon? - private static boolean language_pragma_5_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "language_pragma_5_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && onl(b, l + 1); - r = r && language_pragma_5_0_3(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qcon? - private static boolean language_pragma_5_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "language_pragma_5_0_3")) return false; - qcon(b, l + 1); - return true; - } - - // NEWLINE? - private static boolean language_pragma_8(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "language_pragma_8")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // general_id+ osnl - public static boolean last_line_expression(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "last_line_expression")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_LAST_LINE_EXPRESSION, ""); - r = last_line_expression_0(b, l + 1); - r = r && osnl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // general_id+ - private static boolean last_line_expression_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "last_line_expression_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = general_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "last_line_expression_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // NEWLINE* general_id+ snl - public static boolean line_expression(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "line_expression")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_LINE_EXPRESSION, ""); - r = line_expression_0(b, l + 1); - r = r && line_expression_1(b, l + 1); - r = r && snl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // NEWLINE* - private static boolean line_expression_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "line_expression_0")) return false; - int c = current_position_(b); - while (true) { - if (!consumeToken(b, HS_NEWLINE)) break; - if (!empty_element_parsed_guard_(b, "line_expression_0", c)) break; - c = current_position_(b); - } - return true; - } - - // general_id+ - private static boolean line_expression_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "line_expression_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = general_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "line_expression_1", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "LINE" general_pragma_content PRAGMA_END - public static boolean line_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "line_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "LINE"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_LINE_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // DECIMAL | HEXADECIMAL | OCTAL | FLOAT | CHARACTER_LITERAL | STRING_LITERAL - public static boolean literal(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "literal")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_LITERAL, ""); - r = consumeToken(b, HS_DECIMAL); - if (!r) r = consumeToken(b, HS_HEXADECIMAL); - if (!r) r = consumeToken(b, HS_OCTAL); - if (!r) r = consumeToken(b, HS_FLOAT); - if (!r) r = consumeToken(b, HS_CHARACTER_LITERAL); - if (!r) r = consumeToken(b, HS_STRING_LITERAL); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "MINIMAL" general_pragma_content PRAGMA_END - public static boolean minimal_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "minimal_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "MINIMAL"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_MINIMAL_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // (CONID_ID DOT)+ CONID_ID | CONID_ID - public static boolean mod_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = mod_id_0(b, l + 1); - if (!r) r = consumeToken(b, HS_CONID_ID); - exit_section_(b, m, HS_MOD_ID, r); - return r; - } - - // (CONID_ID DOT)+ CONID_ID - private static boolean mod_id_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = mod_id_0_0(b, l + 1); - r = r && consumeToken(b, HS_CONID_ID); - exit_section_(b, m, null, r); - return r; - } - - // (CONID_ID DOT)+ - private static boolean mod_id_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = mod_id_0_0_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!mod_id_0_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "mod_id_0_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // CONID_ID DOT - private static boolean mod_id_0_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "mod_id_0_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_CONID_ID, HS_DOT); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // module_declaration+ onl body | body - public static boolean module_body(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_body")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_MODULE_BODY, ""); - r = module_body_0(b, l + 1); - if (!r) r = body(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // module_declaration+ onl body - private static boolean module_body_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_body_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = module_body_0_0(b, l + 1); - r = r && onl(b, l + 1); - r = r && body(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // module_declaration+ - private static boolean module_body_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_body_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = module_declaration(b, l + 1); - int c = current_position_(b); - while (r) { - if (!module_declaration(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "module_body_0_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // MODULE mod_id onl deprecated_warn_pragma? onl WHERE? onl (onl exports)? onl WHERE? onl - public static boolean module_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration")) return false; - if (!nextTokenIs(b, HS_MODULE)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_MODULE); - r = r && mod_id(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_declaration_3(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_declaration_5(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_declaration_7(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_declaration_9(b, l + 1); - r = r && onl(b, l + 1); - exit_section_(b, m, HS_MODULE_DECLARATION, r); - return r; - } - - // deprecated_warn_pragma? - private static boolean module_declaration_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_3")) return false; - deprecated_warn_pragma(b, l + 1); - return true; - } - - // WHERE? - private static boolean module_declaration_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_5")) return false; - consumeToken(b, HS_WHERE); - return true; - } - - // (onl exports)? - private static boolean module_declaration_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_7")) return false; - module_declaration_7_0(b, l + 1); - return true; - } - - // onl exports - private static boolean module_declaration_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_7_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && exports(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // WHERE? - private static boolean module_declaration_9(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "module_declaration_9")) return false; - consumeToken(b, HS_WHERE); - return true; - } - - /* ********************************************************** */ - // qcon atype | newconstr_fielddecl - public static boolean newconstr(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newconstr")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_NEWCONSTR, ""); - r = newconstr_0(b, l + 1); - if (!r) r = newconstr_fielddecl(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // qcon atype - private static boolean newconstr_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newconstr_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && atype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qcon osnl LEFT_BRACE? osnl qvar osnl COLON_COLON osnl ttype osnl RIGHT_BRACE? - public static boolean newconstr_fielddecl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newconstr_fielddecl")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_NEWCONSTR_FIELDDECL, ""); - r = qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && newconstr_fielddecl_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && qvar(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && newconstr_fielddecl_10(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_BRACE? - private static boolean newconstr_fielddecl_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newconstr_fielddecl_2")) return false; - consumeToken(b, HS_LEFT_BRACE); - return true; - } - - // RIGHT_BRACE? - private static boolean newconstr_fielddecl_10(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newconstr_fielddecl_10")) return false; - consumeToken(b, HS_RIGHT_BRACE); - return true; - } - - /* ********************************************************** */ - // NEWTYPE osnl ctype_pragma? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl newconstr osnl (DERIVING osnl ttype)? - public static boolean newtype_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration")) return false; - if (!nextTokenIs(b, HS_NEWTYPE)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_NEWTYPE); - r = r && osnl(b, l + 1); - r = r && newtype_declaration_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && newtype_declaration_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && newconstr(b, l + 1); - r = r && osnl(b, l + 1); - r = r && newtype_declaration_12(b, l + 1); - exit_section_(b, m, HS_NEWTYPE_DECLARATION, r); - return r; - } - - // ctype_pragma? - private static boolean newtype_declaration_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_2")) return false; - ctype_pragma(b, l + 1); - return true; - } - - // (context osnl DOUBLE_RIGHT_ARROW)? - private static boolean newtype_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_4")) return false; - newtype_declaration_4_0(b, l + 1); - return true; - } - - // context osnl DOUBLE_RIGHT_ARROW - private static boolean newtype_declaration_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = context(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // (DERIVING osnl ttype)? - private static boolean newtype_declaration_12(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_12")) return false; - newtype_declaration_12_0(b, l + 1); - return true; - } - - // DERIVING osnl ttype - private static boolean newtype_declaration_12_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "newtype_declaration_12_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DERIVING); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl ("NOINLINE" | "NOTINLINE") general_id+ PRAGMA_END - public static boolean noinline_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "noinline_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && noinline_pragma_2(b, l + 1); - r = r && noinline_pragma_3(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_NOINLINE_PRAGMA, r); - return r; - } - - // "NOINLINE" | "NOTINLINE" - private static boolean noinline_pragma_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "noinline_pragma_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, "NOINLINE"); - if (!r) r = consumeToken(b, "NOTINLINE"); - exit_section_(b, m, null, r); - return r; - } - - // general_id+ - private static boolean noinline_pragma_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "noinline_pragma_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = general_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "noinline_pragma_3", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "NOUNPACK" onl PRAGMA_END - public static boolean nounpack_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "nounpack_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "NOUNPACK"); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_NOUNPACK_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // NEWLINE* - static boolean onl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "onl")) return false; - int c = current_position_(b); - while (true) { - if (!consumeToken(b, HS_NEWLINE)) break; - if (!empty_element_parsed_guard_(b, "onl", c)) break; - c = current_position_(b); - } - return true; - } - - /* ********************************************************** */ - // qvar_op | qcon_op - public static boolean op(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "op")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_OP, ""); - r = qvar_op(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // op (COMMA op)* - public static boolean ops(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ops")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_OPS, ""); - r = op(b, l + 1); - r = r && ops_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // (COMMA op)* - private static boolean ops_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ops_1")) return false; - int c = current_position_(b); - while (true) { - if (!ops_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "ops_1", c)) break; - c = current_position_(b); - } - return true; - } - - // COMMA op - private static boolean ops_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ops_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_COMMA); - r = r && op(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl ("OPTIONS_GHC" | "OPTIONS") general_pragma_content PRAGMA_END NEWLINE? - public static boolean options_ghc_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "options_ghc_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && options_ghc_pragma_2(b, l + 1); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - r = r && options_ghc_pragma_5(b, l + 1); - exit_section_(b, m, HS_OPTIONS_GHC_PRAGMA, r); - return r; - } - - // "OPTIONS_GHC" | "OPTIONS" - private static boolean options_ghc_pragma_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "options_ghc_pragma_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, "OPTIONS_GHC"); - if (!r) r = consumeToken(b, "OPTIONS"); - exit_section_(b, m, null, r); - return r; - } - - // NEWLINE? - private static boolean options_ghc_pragma_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "options_ghc_pragma_5")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)* - static boolean osnl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl")) return false; - int c = current_position_(b); - while (true) { - if (!osnl_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "osnl", c)) break; - c = current_position_(b); - } - return true; - } - - // LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE - private static boolean osnl_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl_0_0(b, l + 1); - r = r && osnl_0_1(b, l + 1); - r = r && osnl_0_2(b, l + 1); - r = r && osnl_0_3(b, l + 1); - r = r && osnl_0_4(b, l + 1); - r = r && consumeToken(b, HS_NEWLINE); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_BRACE? - private static boolean osnl_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_0")) return false; - consumeToken(b, HS_LEFT_BRACE); - return true; - } - - // RIGHT_BRACE? - private static boolean osnl_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_1")) return false; - consumeToken(b, HS_RIGHT_BRACE); - return true; - } - - // SEMICOLON? - private static boolean osnl_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_2")) return false; - consumeToken(b, HS_SEMICOLON); - return true; - } - - // BACKSLASH? - private static boolean osnl_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_3")) return false; - consumeToken(b, HS_BACKSLASH); - return true; - } - - // &<> - private static boolean osnl_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "osnl_0_4")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = containsSpaces(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // ann_pragma | deprecated_warn_pragma | noinline_pragma | inlinable_pragma | line_pragma | rules_pragma | - // specialize_pragma | inline_pragma | minimal_pragma | overlap_pragma | dummy_pragma - public static boolean other_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "other_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = ann_pragma(b, l + 1); - if (!r) r = deprecated_warn_pragma(b, l + 1); - if (!r) r = noinline_pragma(b, l + 1); - if (!r) r = inlinable_pragma(b, l + 1); - if (!r) r = line_pragma(b, l + 1); - if (!r) r = rules_pragma(b, l + 1); - if (!r) r = specialize_pragma(b, l + 1); - if (!r) r = inline_pragma(b, l + 1); - if (!r) r = minimal_pragma(b, l + 1); - if (!r) r = overlap_pragma(b, l + 1); - if (!r) r = dummy_pragma(b, l + 1); - exit_section_(b, m, HS_OTHER_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl ("OVERLAPPABLE" | "OVERLAPPING") onl PRAGMA_END - public static boolean overlap_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "overlap_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && overlap_pragma_2(b, l + 1); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_OVERLAP_PRAGMA, r); - return r; - } - - // "OVERLAPPABLE" | "OVERLAPPING" - private static boolean overlap_pragma_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "overlap_pragma_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, "OVERLAPPABLE"); - if (!r) r = consumeToken(b, "OVERLAPPING"); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // LEFT_BRACKET COLON_COLON RIGHT_BRACKET - public static boolean parallel_array_type(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "parallel_array_type")) return false; - if (!nextTokenIs(b, HS_LEFT_BRACKET)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_LEFT_BRACKET, HS_COLON_COLON, HS_RIGHT_BRACKET); - exit_section_(b, m, HS_PARALLEL_ARRAY_TYPE, r); - return r; - } - - /* ********************************************************** */ - // onl SHEBANG_LINE? onl file_header? onl module_body - static boolean program(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "program")) return false; - boolean r; - Marker m = enter_section_(b); - r = onl(b, l + 1); - r = r && program_1(b, l + 1); - r = r && onl(b, l + 1); - r = r && program_3(b, l + 1); - r = r && onl(b, l + 1); - r = r && module_body(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // SHEBANG_LINE? - private static boolean program_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "program_1")) return false; - consumeToken(b, HS_SHEBANG_LINE); - return true; - } - - // file_header? - private static boolean program_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "program_3")) return false; - file_header(b, l + 1); - return true; - } - - /* ********************************************************** */ - // qcon_id | LEFT_PAREN gcon_sym RIGHT_PAREN | con_id | LEFT_PAREN con_sym RIGHT_PAREN - public static boolean qcon(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QCON, ""); - r = qcon_id(b, l + 1); - if (!r) r = qcon_1(b, l + 1); - if (!r) r = con_id(b, l + 1); - if (!r) r = qcon_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_PAREN gcon_sym RIGHT_PAREN - private static boolean qcon_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && gcon_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN con_sym RIGHT_PAREN - private static boolean qcon_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && con_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qcon_id_qualifier con_id - public static boolean qcon_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_id")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon_id_qualifier(b, l + 1); - r = r && con_id(b, l + 1); - exit_section_(b, m, HS_QCON_ID, r); - return r; - } - - /* ********************************************************** */ - // (CONID_ID DOT)+ - public static boolean qcon_id_qualifier(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_id_qualifier")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon_id_qualifier_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qcon_id_qualifier_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "qcon_id_qualifier", c)) break; - c = current_position_(b); - } - exit_section_(b, m, HS_QCON_ID_QUALIFIER, r); - return r; - } - - // CONID_ID DOT - private static boolean qcon_id_qualifier_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_id_qualifier_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_CONID_ID, HS_DOT); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // gcon_sym | BACKQUOTE qcon_id BACKQUOTE | con_sym | BACKQUOTE con_id BACKQUOTE - public static boolean qcon_op(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_op")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QCON_OP, ""); - r = gcon_sym(b, l + 1); - if (!r) r = qcon_op_1(b, l + 1); - if (!r) r = con_sym(b, l + 1); - if (!r) r = qcon_op_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // BACKQUOTE qcon_id BACKQUOTE - private static boolean qcon_op_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_op_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && qcon_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); - return r; - } - - // BACKQUOTE con_id BACKQUOTE - private static boolean qcon_op_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_op_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && con_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qualifier DOT con_sym - public static boolean qcon_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qcon_sym")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier(b, l + 1); - r = r && consumeToken(b, HS_DOT); - r = r && con_sym(b, l + 1); - exit_section_(b, m, HS_QCON_SYM, r); - return r; - } - - /* ********************************************************** */ - // general_id+ NEWLINE? quasi_quote - public static boolean qq_expression(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qq_expression")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QQ_EXPRESSION, ""); - r = qq_expression_0(b, l + 1); - r = r && qq_expression_1(b, l + 1); - r = r && quasi_quote(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // general_id+ - private static boolean qq_expression_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qq_expression_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = general_id(b, l + 1); - int c = current_position_(b); - while (r) { - if (!general_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "qq_expression_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // NEWLINE? - private static boolean qq_expression_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qq_expression_1")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // (CONID_ID DOT)+ CONID_ID | CONID_ID - public static boolean qualifier(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qualifier")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier_0(b, l + 1); - if (!r) r = consumeToken(b, HS_CONID_ID); - exit_section_(b, m, HS_QUALIFIER, r); - return r; - } - - // (CONID_ID DOT)+ CONID_ID - private static boolean qualifier_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qualifier_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier_0_0(b, l + 1); - r = r && consumeToken(b, HS_CONID_ID); - exit_section_(b, m, null, r); - return r; - } - - // (CONID_ID DOT)+ - private static boolean qualifier_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qualifier_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier_0_0_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qualifier_0_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "qualifier_0_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // CONID_ID DOT - private static boolean qualifier_0_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qualifier_0_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeTokens(b, 0, HS_CONID_ID, HS_DOT); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // QUASI_QUOTE_D_START NEWLINE? top_declarations NEWLINE? QUASI_QUOTE_END | - // QUASI_QUOTE_E_START NEWLINE? expression NEWLINE? QUASI_QUOTE_END | - // QUASI_QUOTE_T_START NEWLINE? simpletype NEWLINE? QUASI_QUOTE_END | - // QUASI_QUOTE_P_START NEWLINE? expression NEWLINE? QUASI_QUOTE_END | - // QUASI_QUOTE_V_START NEWLINE? expression NEWLINE? QUASI_QUOTE_END - public static boolean quasi_quote(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QUASI_QUOTE, ""); - r = quasi_quote_0(b, l + 1); - if (!r) r = quasi_quote_1(b, l + 1); - if (!r) r = quasi_quote_2(b, l + 1); - if (!r) r = quasi_quote_3(b, l + 1); - if (!r) r = quasi_quote_4(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // QUASI_QUOTE_D_START NEWLINE? top_declarations NEWLINE? QUASI_QUOTE_END - private static boolean quasi_quote_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_QUASI_QUOTE_D_START); - r = r && quasi_quote_0_1(b, l + 1); - r = r && top_declarations(b, l + 1); - r = r && quasi_quote_0_3(b, l + 1); - r = r && consumeToken(b, HS_QUASI_QUOTE_END); - exit_section_(b, m, null, r); - return r; - } - - // NEWLINE? - private static boolean quasi_quote_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_0_1")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // NEWLINE? - private static boolean quasi_quote_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_0_3")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // QUASI_QUOTE_E_START NEWLINE? expression NEWLINE? QUASI_QUOTE_END - private static boolean quasi_quote_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_QUASI_QUOTE_E_START); - r = r && quasi_quote_1_1(b, l + 1); - r = r && expression(b, l + 1); - r = r && quasi_quote_1_3(b, l + 1); - r = r && consumeToken(b, HS_QUASI_QUOTE_END); - exit_section_(b, m, null, r); - return r; - } - - // NEWLINE? - private static boolean quasi_quote_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_1_1")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // NEWLINE? - private static boolean quasi_quote_1_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_1_3")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // QUASI_QUOTE_T_START NEWLINE? simpletype NEWLINE? QUASI_QUOTE_END - private static boolean quasi_quote_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_QUASI_QUOTE_T_START); - r = r && quasi_quote_2_1(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && quasi_quote_2_3(b, l + 1); - r = r && consumeToken(b, HS_QUASI_QUOTE_END); - exit_section_(b, m, null, r); - return r; - } - - // NEWLINE? - private static boolean quasi_quote_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_2_1")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // NEWLINE? - private static boolean quasi_quote_2_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_2_3")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // QUASI_QUOTE_P_START NEWLINE? expression NEWLINE? QUASI_QUOTE_END - private static boolean quasi_quote_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_QUASI_QUOTE_P_START); - r = r && quasi_quote_3_1(b, l + 1); - r = r && expression(b, l + 1); - r = r && quasi_quote_3_3(b, l + 1); - r = r && consumeToken(b, HS_QUASI_QUOTE_END); - exit_section_(b, m, null, r); - return r; - } - - // NEWLINE? - private static boolean quasi_quote_3_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_3_1")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // NEWLINE? - private static boolean quasi_quote_3_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_3_3")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // QUASI_QUOTE_V_START NEWLINE? expression NEWLINE? QUASI_QUOTE_END - private static boolean quasi_quote_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_QUASI_QUOTE_V_START); - r = r && quasi_quote_4_1(b, l + 1); - r = r && expression(b, l + 1); - r = r && quasi_quote_4_3(b, l + 1); - r = r && consumeToken(b, HS_QUASI_QUOTE_END); - exit_section_(b, m, null, r); - return r; - } - - // NEWLINE? - private static boolean quasi_quote_4_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_4_1")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - // NEWLINE? - private static boolean quasi_quote_4_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "quasi_quote_4_3")) return false; - consumeToken(b, HS_NEWLINE); - return true; - } - - /* ********************************************************** */ - // qvar_id | LEFT_PAREN qvar_sym RIGHT_PAREN | var_id | LEFT_PAREN var_sym RIGHT_PAREN - public static boolean qvar(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QVAR, ""); - r = qvar_id(b, l + 1); - if (!r) r = qvar_1(b, l + 1); - if (!r) r = var_id(b, l + 1); - if (!r) r = qvar_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_PAREN qvar_sym RIGHT_PAREN - private static boolean qvar_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && qvar_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN var_sym RIGHT_PAREN - private static boolean qvar_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && var_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qualifier DOT var_id - public static boolean qvar_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_id")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier(b, l + 1); - r = r && consumeToken(b, HS_DOT); - r = r && var_id(b, l + 1); - exit_section_(b, m, HS_QVAR_ID, r); - return r; - } - - /* ********************************************************** */ - // qvar_sym | BACKQUOTE qvar_id BACKQUOTE | var_sym | BACKQUOTE var_id BACKQUOTE - public static boolean qvar_op(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_op")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_QVAR_OP, ""); - r = qvar_sym(b, l + 1); - if (!r) r = qvar_op_1(b, l + 1); - if (!r) r = var_sym(b, l + 1); - if (!r) r = qvar_op_3(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // BACKQUOTE qvar_id BACKQUOTE - private static boolean qvar_op_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_op_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && qvar_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); - return r; - } - - // BACKQUOTE var_id BACKQUOTE - private static boolean qvar_op_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_op_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_BACKQUOTE); - r = r && var_id(b, l + 1); - r = r && consumeToken(b, HS_BACKQUOTE); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qualifier DOT var_sym - public static boolean qvar_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "qvar_sym")) return false; - if (!nextTokenIs(b, HS_CONID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = qualifier(b, l + 1); - r = r && consumeToken(b, HS_DOT); - r = r && var_sym(b, l + 1); - exit_section_(b, m, HS_QVAR_SYM, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "RULES" general_pragma_content PRAGMA_END - public static boolean rules_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "rules_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "RULES"); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_RULES_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // simpleclass? osnl LEFT_PAREN osnl simpleclass (osnl COMMA osnl simpleclass)* osnl RIGHT_PAREN | - // simpleclass - public static boolean scontext(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SCONTEXT, ""); - r = scontext_0(b, l + 1); - if (!r) r = simpleclass(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // simpleclass? osnl LEFT_PAREN osnl simpleclass (osnl COMMA osnl simpleclass)* osnl RIGHT_PAREN - private static boolean scontext_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = scontext_0_0(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && simpleclass(b, l + 1); - r = r && scontext_0_5(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // simpleclass? - private static boolean scontext_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0_0")) return false; - simpleclass(b, l + 1); - return true; - } - - // (osnl COMMA osnl simpleclass)* - private static boolean scontext_0_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0_5")) return false; - int c = current_position_(b); - while (true) { - if (!scontext_0_5_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "scontext_0_5", c)) break; - c = current_position_(b); - } - return true; - } - - // osnl COMMA osnl simpleclass - private static boolean scontext_0_5_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "scontext_0_5_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_COMMA); - r = r && osnl(b, l + 1); - r = r && simpleclass(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // simpleclass_tilde_part TILDE simpleclass_tilde_part | - // LEFT_PAREN simpleclass_tilde_part TILDE simpleclass_tilde_part RIGHT_PAREN | - // qcon+ LEFT_PAREN (qvar | qcon_op | qcon)+ RIGHT_PAREN qvar* | - // qcon+ qvar+ | - // atype - public static boolean simpleclass(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SIMPLECLASS, ""); - r = simpleclass_0(b, l + 1); - if (!r) r = simpleclass_1(b, l + 1); - if (!r) r = simpleclass_2(b, l + 1); - if (!r) r = simpleclass_3(b, l + 1); - if (!r) r = atype(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // simpleclass_tilde_part TILDE simpleclass_tilde_part - private static boolean simpleclass_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_tilde_part(b, l + 1); - r = r && consumeToken(b, HS_TILDE); - r = r && simpleclass_tilde_part(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN simpleclass_tilde_part TILDE simpleclass_tilde_part RIGHT_PAREN - private static boolean simpleclass_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && simpleclass_tilde_part(b, l + 1); - r = r && consumeToken(b, HS_TILDE); - r = r && simpleclass_tilde_part(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // qcon+ LEFT_PAREN (qvar | qcon_op | qcon)+ RIGHT_PAREN qvar* - private static boolean simpleclass_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_2_0(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && simpleclass_2_2(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - r = r && simpleclass_2_4(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qcon+ - private static boolean simpleclass_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qcon(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_2_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // (qvar | qcon_op | qcon)+ - private static boolean simpleclass_2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_2_2_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!simpleclass_2_2_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_2_2", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qvar | qcon_op | qcon - private static boolean simpleclass_2_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - if (!r) r = qcon_op(b, l + 1); - if (!r) r = qcon(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar* - private static boolean simpleclass_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_2_4")) return false; - int c = current_position_(b); - while (true) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_2_4", c)) break; - c = current_position_(b); - } - return true; - } - - // qcon+ qvar+ - private static boolean simpleclass_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_3_0(b, l + 1); - r = r && simpleclass_3_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qcon+ - private static boolean simpleclass_3_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_3_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qcon(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_3_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qvar+ - private static boolean simpleclass_3_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_3_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_3_1", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // QUOTE? ((qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? qvar+ | qcon qvar*) - public static boolean simpleclass_tilde_part(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SIMPLECLASS_TILDE_PART, ""); - r = simpleclass_tilde_part_0(b, l + 1); - r = r && simpleclass_tilde_part_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // QUOTE? - private static boolean simpleclass_tilde_part_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_0")) return false; - consumeToken(b, HS_QUOTE); - return true; - } - - // (qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? qvar+ | qcon qvar* - private static boolean simpleclass_tilde_part_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_tilde_part_1_0(b, l + 1); - if (!r) r = simpleclass_tilde_part_1_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? qvar+ - private static boolean simpleclass_tilde_part_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpleclass_tilde_part_1_0_0(b, l + 1); - r = r && simpleclass_tilde_part_1_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? - private static boolean simpleclass_tilde_part_1_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0_0")) return false; - simpleclass_tilde_part_1_0_0_0(b, l + 1); - return true; - } - - // qcon LEFT_PAREN qcon qvar RIGHT_PAREN - private static boolean simpleclass_tilde_part_1_0_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && qcon(b, l + 1); - r = r && qvar(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // qvar+ - private static boolean simpleclass_tilde_part_1_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_0_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar(b, l + 1); - int c = current_position_(b); - while (r) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_tilde_part_1_0_1", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // qcon qvar* - private static boolean simpleclass_tilde_part_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && simpleclass_tilde_part_1_1_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // qvar* - private static boolean simpleclass_tilde_part_1_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpleclass_tilde_part_1_1_1")) return false; - int c = current_position_(b); - while (true) { - if (!qvar(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpleclass_tilde_part_1_1_1", c)) break; - c = current_position_(b); - } - return true; - } - - /* ********************************************************** */ - // qcon_op var_id* | - // qcon var_id* | - // ttype | - // parallel_array_type var_id | - // var_id* osnl (LEFT_PAREN qvar_op RIGHT_PAREN | LEFT_PAREN gcon_sym RIGHT_PAREN) osnl var_id* | - // qcon osnl var_id* osnl (LEFT_PAREN type_signature RIGHT_PAREN)+ osnl var_id* - public static boolean simpletype(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SIMPLETYPE, ""); - r = simpletype_0(b, l + 1); - if (!r) r = simpletype_1(b, l + 1); - if (!r) r = ttype(b, l + 1); - if (!r) r = simpletype_3(b, l + 1); - if (!r) r = simpletype_4(b, l + 1); - if (!r) r = simpletype_5(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // qcon_op var_id* - private static boolean simpletype_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon_op(b, l + 1); - r = r && simpletype_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_0_1")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_0_1", c)) break; - c = current_position_(b); - } - return true; - } - - // qcon var_id* - private static boolean simpletype_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && simpletype_1_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_1_1")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_1_1", c)) break; - c = current_position_(b); - } - return true; - } - - // parallel_array_type var_id - private static boolean simpletype_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = parallel_array_type(b, l + 1); - r = r && var_id(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id* osnl (LEFT_PAREN qvar_op RIGHT_PAREN | LEFT_PAREN gcon_sym RIGHT_PAREN) osnl var_id* - private static boolean simpletype_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype_4_0(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_4_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_4_4(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_0")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_4_0", c)) break; - c = current_position_(b); - } - return true; - } - - // LEFT_PAREN qvar_op RIGHT_PAREN | LEFT_PAREN gcon_sym RIGHT_PAREN - private static boolean simpletype_4_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype_4_2_0(b, l + 1); - if (!r) r = simpletype_4_2_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN qvar_op RIGHT_PAREN - private static boolean simpletype_4_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_2_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && qvar_op(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN gcon_sym RIGHT_PAREN - private static boolean simpletype_4_2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_2_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && gcon_sym(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_4_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_4_4")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_4_4", c)) break; - c = current_position_(b); - } - return true; - } - - // qcon osnl var_id* osnl (LEFT_PAREN type_signature RIGHT_PAREN)+ osnl var_id* - private static boolean simpletype_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_5")) return false; - boolean r; - Marker m = enter_section_(b); - r = qcon(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_5_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_5_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && simpletype_5_6(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_5_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_5_2")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_5_2", c)) break; - c = current_position_(b); - } - return true; - } - - // (LEFT_PAREN type_signature RIGHT_PAREN)+ - private static boolean simpletype_5_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_5_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = simpletype_5_4_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!simpletype_5_4_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_5_4", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN type_signature RIGHT_PAREN - private static boolean simpletype_5_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_5_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_LEFT_PAREN); - r = r && type_signature(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_PAREN); - exit_section_(b, m, null, r); - return r; - } - - // var_id* - private static boolean simpletype_5_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "simpletype_5_6")) return false; - int c = current_position_(b); - while (true) { - if (!var_id(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "simpletype_5_6", c)) break; - c = current_position_(b); - } - return true; - } - - /* ********************************************************** */ - // (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)+ - public static boolean snl(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SNL, ""); - r = snl_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!snl_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "snl", c)) break; - c = current_position_(b); - } - exit_section_(b, l, m, r, false, null); - return r; - } - - // LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE - private static boolean snl_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = snl_0_0(b, l + 1); - r = r && snl_0_1(b, l + 1); - r = r && snl_0_2(b, l + 1); - r = r && snl_0_3(b, l + 1); - r = r && snl_0_4(b, l + 1); - r = r && consumeToken(b, HS_NEWLINE); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_BRACE? - private static boolean snl_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_0")) return false; - consumeToken(b, HS_LEFT_BRACE); - return true; - } - - // RIGHT_BRACE? - private static boolean snl_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_1")) return false; - consumeToken(b, HS_RIGHT_BRACE); - return true; - } - - // SEMICOLON? - private static boolean snl_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_2")) return false; - consumeToken(b, HS_SEMICOLON); - return true; - } - - // BACKSLASH? - private static boolean snl_0_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_3")) return false; - consumeToken(b, HS_BACKSLASH); - return true; - } - - // &<> - private static boolean snl_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "snl_0_4")) return false; - boolean r; - Marker m = enter_section_(b, l, _AND_); - r = containsSpaces(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "SOURCE" onl PRAGMA_END - public static boolean source_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "source_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "SOURCE"); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_SOURCE_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl ("SPECIALIZE" | "SPECIALISE") general_pragma_content PRAGMA_END - public static boolean specialize_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "specialize_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && specialize_pragma_2(b, l + 1); - r = r && general_pragma_content(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_SPECIALIZE_PRAGMA, r); - return r; - } - - // "SPECIALIZE" | "SPECIALISE" - private static boolean specialize_pragma_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "specialize_pragma_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, "SPECIALIZE"); - if (!r) r = consumeToken(b, "SPECIALISE"); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // btype | qvar_op atype - public static boolean sub_constr2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "sub_constr2")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_SUB_CONSTR_2, ""); - r = btype(b, l + 1); - if (!r) r = sub_constr2_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // qvar_op atype - private static boolean sub_constr2_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "sub_constr2_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = qvar_op(b, l + 1); - r = r && atype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // AT | BACKSLASH | VERTICAL_BAR | TILDE | EQUAL | COLON - static boolean symbol_reserved_op(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "symbol_reserved_op")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_AT); - if (!r) r = consumeToken(b, HS_BACKSLASH); - if (!r) r = consumeToken(b, HS_VERTICAL_BAR); - if (!r) r = consumeToken(b, HS_TILDE); - if (!r) r = consumeToken(b, HS_EQUAL); - if (!r) r = consumeToken(b, HS_COLON); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // type_declaration | data_declaration | newtype_declaration | class_declaration | instance_declaration | default_declaration | - // foreign_declaration | type_family_declaration | deriving_declaration | type_instance_declaration | type_signature | - // other_pragma | quasi_quote | qq_expression | expression | cfiles_pragma - public static boolean top_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "top_declaration")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_TOP_DECLARATION, ""); - r = type_declaration(b, l + 1); - if (!r) r = data_declaration(b, l + 1); - if (!r) r = newtype_declaration(b, l + 1); - if (!r) r = class_declaration(b, l + 1); - if (!r) r = instance_declaration(b, l + 1); - if (!r) r = default_declaration(b, l + 1); - if (!r) r = foreign_declaration(b, l + 1); - if (!r) r = type_family_declaration(b, l + 1); - if (!r) r = deriving_declaration(b, l + 1); - if (!r) r = type_instance_declaration(b, l + 1); - if (!r) r = type_signature(b, l + 1); - if (!r) r = other_pragma(b, l + 1); - if (!r) r = quasi_quote(b, l + 1); - if (!r) r = qq_expression(b, l + 1); - if (!r) r = expression(b, l + 1); - if (!r) r = cfiles_pragma(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // (top_declaration onl)* - static boolean top_declarations(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "top_declarations")) return false; - int c = current_position_(b); - while (true) { - if (!top_declarations_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "top_declarations", c)) break; - c = current_position_(b); - } - return true; - } - - // top_declaration onl - private static boolean top_declarations_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "top_declarations_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = top_declaration(b, l + 1); - r = r && onl(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // btype (osnl RIGHT_ARROW osnl ttype)? | parallel_array_type - public static boolean ttype(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ttype")) return false; - boolean r; - Marker m = enter_section_(b, l, _COLLAPSE_, HS_TTYPE, ""); - r = ttype_0(b, l + 1); - if (!r) r = parallel_array_type(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // btype (osnl RIGHT_ARROW osnl ttype)? - private static boolean ttype_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ttype_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = btype(b, l + 1); - r = r && ttype_0_1(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (osnl RIGHT_ARROW osnl ttype)? - private static boolean ttype_0_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ttype_0_1")) return false; - ttype_0_1_0(b, l + 1); - return true; - } - - // osnl RIGHT_ARROW osnl ttype - private static boolean ttype_0_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "ttype_0_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = osnl(b, l + 1); - r = r && consumeToken(b, HS_RIGHT_ARROW); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // TYPE osnl simpletype osnl COLON_COLON osnl ttype | - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl ttype (DOUBLE_RIGHT_ARROW ttype)? | - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl type_signature (DOUBLE_RIGHT_ARROW ttype)? | - // TYPE osnl simpletype osnl EQUAL osnl expression | - // TYPE osnl simpletype osnl LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN EQUAL osnl ttype | - // TYPE osnl simpletype - public static boolean type_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration")) return false; - if (!nextTokenIs(b, HS_TYPE)) return false; - boolean r; - Marker m = enter_section_(b); - r = type_declaration_0(b, l + 1); - if (!r) r = type_declaration_1(b, l + 1); - if (!r) r = type_declaration_2(b, l + 1); - if (!r) r = type_declaration_3(b, l + 1); - if (!r) r = type_declaration_4(b, l + 1); - if (!r) r = type_declaration_5(b, l + 1); - exit_section_(b, m, HS_TYPE_DECLARATION, r); - return r; - } - - // TYPE osnl simpletype osnl COLON_COLON osnl ttype - private static boolean type_declaration_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl ttype (DOUBLE_RIGHT_ARROW ttype)? - private static boolean type_declaration_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_declaration_1_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - r = r && type_declaration_1_7(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // EQUAL | WHERE - private static boolean type_declaration_1_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_1_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_EQUAL); - if (!r) r = consumeToken(b, HS_WHERE); - exit_section_(b, m, null, r); - return r; - } - - // (DOUBLE_RIGHT_ARROW ttype)? - private static boolean type_declaration_1_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_1_7")) return false; - type_declaration_1_7_0(b, l + 1); - return true; - } - - // DOUBLE_RIGHT_ARROW ttype - private static boolean type_declaration_1_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_1_7_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE osnl simpletype osnl (EQUAL | WHERE) osnl type_signature (DOUBLE_RIGHT_ARROW ttype)? - private static boolean type_declaration_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_declaration_2_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_signature(b, l + 1); - r = r && type_declaration_2_7(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // EQUAL | WHERE - private static boolean type_declaration_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_2_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_EQUAL); - if (!r) r = consumeToken(b, HS_WHERE); - exit_section_(b, m, null, r); - return r; - } - - // (DOUBLE_RIGHT_ARROW ttype)? - private static boolean type_declaration_2_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_2_7")) return false; - type_declaration_2_7_0(b, l + 1); - return true; - } - - // DOUBLE_RIGHT_ARROW ttype - private static boolean type_declaration_2_7_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_2_7_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE osnl simpletype osnl EQUAL osnl expression - private static boolean type_declaration_3(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_3")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && expression(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE osnl simpletype osnl LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN EQUAL osnl ttype - private static boolean type_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_4")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_LEFT_PAREN); - r = r && osnl(b, l + 1); - r = r && kind_signature(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeTokens(b, 0, HS_RIGHT_PAREN, HS_EQUAL); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // TYPE osnl simpletype - private static boolean type_declaration_5(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_declaration_5")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE); - r = r && osnl(b, l + 1); - r = r && simpletype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // TYPE_FAMILY osnl type_family_type osnl WHERE? osnl expression? - public static boolean type_family_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_declaration")) return false; - if (!nextTokenIs(b, HS_TYPE_FAMILY)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE_FAMILY); - r = r && osnl(b, l + 1); - r = r && type_family_type(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_family_declaration_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_family_declaration_6(b, l + 1); - exit_section_(b, m, HS_TYPE_FAMILY_DECLARATION, r); - return r; - } - - // WHERE? - private static boolean type_family_declaration_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_declaration_4")) return false; - consumeToken(b, HS_WHERE); - return true; - } - - // expression? - private static boolean type_family_declaration_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_declaration_6")) return false; - expression(b, l + 1); - return true; - } - - /* ********************************************************** */ - // (type_family_type1 | type_family_type2 | LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN?)+ (COLON_COLON osnl ttype)? - public static boolean type_family_type(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_TYPE_FAMILY_TYPE, ""); - r = type_family_type_0(b, l + 1); - r = r && type_family_type_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // (type_family_type1 | type_family_type2 | LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN?)+ - private static boolean type_family_type_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = type_family_type_0_0(b, l + 1); - int c = current_position_(b); - while (r) { - if (!type_family_type_0_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "type_family_type_0", c)) break; - c = current_position_(b); - } - exit_section_(b, m, null, r); - return r; - } - - // type_family_type1 | type_family_type2 | LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN? - private static boolean type_family_type_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = type_family_type1(b, l + 1); - if (!r) r = type_family_type2(b, l + 1); - if (!r) r = type_family_type_0_0_2(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN? - private static boolean type_family_type_0_0_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2")) return false; - boolean r; - Marker m = enter_section_(b); - r = type_family_type_0_0_2_0(b, l + 1); - r = r && vars(b, l + 1); - r = r && type_family_type_0_0_2_2(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_family_type_0_0_2_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && type_family_type_0_0_2_6(b, l + 1); - r = r && type_family_type_0_0_2_7(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // LEFT_PAREN? - private static boolean type_family_type_0_0_2_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_0")) return false; - consumeToken(b, HS_LEFT_PAREN); - return true; - } - - // COLON_COLON? - private static boolean type_family_type_0_0_2_2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_2")) return false; - consumeToken(b, HS_COLON_COLON); - return true; - } - - // (context DOUBLE_RIGHT_ARROW)? - private static boolean type_family_type_0_0_2_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_4")) return false; - type_family_type_0_0_2_4_0(b, l + 1); - return true; - } - - // context DOUBLE_RIGHT_ARROW - private static boolean type_family_type_0_0_2_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = context(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // ttype? - private static boolean type_family_type_0_0_2_6(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_6")) return false; - ttype(b, l + 1); - return true; - } - - // RIGHT_PAREN? - private static boolean type_family_type_0_0_2_7(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_0_0_2_7")) return false; - consumeToken(b, HS_RIGHT_PAREN); - return true; - } - - // (COLON_COLON osnl ttype)? - private static boolean type_family_type_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_1")) return false; - type_family_type_1_0(b, l + 1); - return true; - } - - // COLON_COLON osnl ttype - private static boolean type_family_type_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - /* ********************************************************** */ - // qcon - public static boolean type_family_type1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type1")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_TYPE_FAMILY_TYPE_1, ""); - r = qcon(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // qvar_op - public static boolean type_family_type2(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_family_type2")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_TYPE_FAMILY_TYPE_2, ""); - r = qvar_op(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // TYPE_INSTANCE osnl expression - public static boolean type_instance_declaration(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_instance_declaration")) return false; - if (!nextTokenIs(b, HS_TYPE_INSTANCE)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_TYPE_INSTANCE); - r = r && osnl(b, l + 1); - r = r && expression(b, l + 1); - exit_section_(b, m, HS_TYPE_INSTANCE_DECLARATION, r); - return r; - } - - /* ********************************************************** */ - // vars osnl COLON_COLON osnl ((ttype | context) DOUBLE_RIGHT_ARROW)? osnl ttype | fixity (DECIMAL)? ops - public static boolean type_signature(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_TYPE_SIGNATURE, ""); - r = type_signature_0(b, l + 1); - if (!r) r = type_signature_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // vars osnl COLON_COLON osnl ((ttype | context) DOUBLE_RIGHT_ARROW)? osnl ttype - private static boolean type_signature_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = vars(b, l + 1); - r = r && osnl(b, l + 1); - r = r && consumeToken(b, HS_COLON_COLON); - r = r && osnl(b, l + 1); - r = r && type_signature_0_4(b, l + 1); - r = r && osnl(b, l + 1); - r = r && ttype(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // ((ttype | context) DOUBLE_RIGHT_ARROW)? - private static boolean type_signature_0_4(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature_0_4")) return false; - type_signature_0_4_0(b, l + 1); - return true; - } - - // (ttype | context) DOUBLE_RIGHT_ARROW - private static boolean type_signature_0_4_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature_0_4_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = type_signature_0_4_0_0(b, l + 1); - r = r && consumeToken(b, HS_DOUBLE_RIGHT_ARROW); - exit_section_(b, m, null, r); - return r; - } - - // ttype | context - private static boolean type_signature_0_4_0_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature_0_4_0_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = ttype(b, l + 1); - if (!r) r = context(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // fixity (DECIMAL)? ops - private static boolean type_signature_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature_1")) return false; - boolean r; - Marker m = enter_section_(b); - r = fixity(b, l + 1); - r = r && type_signature_1_1(b, l + 1); - r = r && ops(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - - // (DECIMAL)? - private static boolean type_signature_1_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "type_signature_1_1")) return false; - consumeToken(b, HS_DECIMAL); - return true; - } - - /* ********************************************************** */ - // unpack_pragma | nounpack_pragma - public static boolean unpack_nounpack_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "unpack_nounpack_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = unpack_pragma(b, l + 1); - if (!r) r = nounpack_pragma(b, l + 1); - exit_section_(b, m, HS_UNPACK_NOUNPACK_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // PRAGMA_START onl "UNPACK" onl PRAGMA_END - public static boolean unpack_pragma(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "unpack_pragma")) return false; - if (!nextTokenIs(b, HS_PRAGMA_START)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_PRAGMA_START); - r = r && onl(b, l + 1); - r = r && consumeToken(b, "UNPACK"); - r = r && onl(b, l + 1); - r = r && consumeToken(b, HS_PRAGMA_END); - exit_section_(b, m, HS_UNPACK_PRAGMA, r); - return r; - } - - /* ********************************************************** */ - // VARID_ID - public static boolean var_id(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "var_id")) return false; - if (!nextTokenIs(b, HS_VARID_ID)) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_VARID_ID); - exit_section_(b, m, HS_VAR_ID, r); - return r; - } - - /* ********************************************************** */ - // VARSYM_ID | TILDE - public static boolean var_sym(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "var_sym")) return false; - if (!nextTokenIs(b, "", HS_TILDE, HS_VARSYM_ID)) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_VAR_SYM, ""); - r = consumeToken(b, HS_VARSYM_ID); - if (!r) r = consumeToken(b, HS_TILDE); - exit_section_(b, l, m, r, false, null); - return r; - } - - /* ********************************************************** */ - // qvar (COMMA qvar)* - public static boolean vars(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "vars")) return false; - boolean r; - Marker m = enter_section_(b, l, _NONE_, HS_VARS, ""); - r = qvar(b, l + 1); - r = r && vars_1(b, l + 1); - exit_section_(b, l, m, r, false, null); - return r; - } - - // (COMMA qvar)* - private static boolean vars_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "vars_1")) return false; - int c = current_position_(b); - while (true) { - if (!vars_1_0(b, l + 1)) break; - if (!empty_element_parsed_guard_(b, "vars_1", c)) break; - c = current_position_(b); - } - return true; - } - - // COMMA qvar - private static boolean vars_1_0(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "vars_1_0")) return false; - boolean r; - Marker m = enter_section_(b); - r = consumeToken(b, HS_COMMA); - r = r && qvar(b, l + 1); - exit_section_(b, m, null, r); - return r; - } - -} diff --git a/intellij/haskell/psi/HaskellCdecl.java b/intellij/haskell/psi/HaskellCdecl.java deleted file mode 100644 index d1923167..00000000 --- a/intellij/haskell/psi/HaskellCdecl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellCdecl extends HaskellCompositeElement { - - @Nullable - HaskellDataDeclaration getDataDeclaration(); - - @Nullable - HaskellDefaultDeclaration getDefaultDeclaration(); - - @Nullable - HaskellInlinePragma getInlinePragma(); - - @Nullable - HaskellInstanceDeclaration getInstanceDeclaration(); - - @Nullable - HaskellMinimalPragma getMinimalPragma(); - - @Nullable - HaskellNewtypeDeclaration getNewtypeDeclaration(); - - @Nullable - HaskellNoinlinePragma getNoinlinePragma(); - - @Nullable - HaskellSpecializePragma getSpecializePragma(); - - @Nullable - HaskellTypeDeclaration getTypeDeclaration(); - - @Nullable - HaskellTypeSignature getTypeSignature(); - -} diff --git a/intellij/haskell/psi/HaskellCfilesPragma.java b/intellij/haskell/psi/HaskellCfilesPragma.java deleted file mode 100644 index 9a937104..00000000 --- a/intellij/haskell/psi/HaskellCfilesPragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellCfilesPragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellClassDeclaration.java b/intellij/haskell/psi/HaskellClassDeclaration.java deleted file mode 100644 index e7d21bb6..00000000 --- a/intellij/haskell/psi/HaskellClassDeclaration.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellClassDeclaration extends HaskellDeclarationElement { - - @NotNull - List getCdeclList(); - - @Nullable - HaskellContext getContext(); - - @NotNull - List getExpressionList(); - - @NotNull - HaskellQcon getQcon(); - - @NotNull - List getQvarList(); - - @Nullable - HaskellScontext getScontext(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - -} diff --git a/intellij/haskell/psi/HaskellClazz.java b/intellij/haskell/psi/HaskellClazz.java deleted file mode 100644 index 089222a7..00000000 --- a/intellij/haskell/psi/HaskellClazz.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellClazz extends HaskellCompositeElement { - - @NotNull - List getCnameList(); - - @NotNull - List getGtyconList(); - - @NotNull - List getQconList(); - - @NotNull - List getQvarList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - -} diff --git a/intellij/haskell/psi/HaskellCname.java b/intellij/haskell/psi/HaskellCname.java deleted file mode 100644 index 35d10a2d..00000000 --- a/intellij/haskell/psi/HaskellCname.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellCname extends HaskellCompositeElement { - - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQconOp getQconOp(); - - @Nullable - HaskellQvar getQvar(); - - @Nullable - HaskellQvarOp getQvarOp(); - -} diff --git a/intellij/haskell/psi/HaskellComments.java b/intellij/haskell/psi/HaskellComments.java deleted file mode 100644 index 3010a644..00000000 --- a/intellij/haskell/psi/HaskellComments.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellComments extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellConId.java b/intellij/haskell/psi/HaskellConId.java deleted file mode 100644 index 5da33e87..00000000 --- a/intellij/haskell/psi/HaskellConId.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellConId extends HaskellNamedElement { - - @Nullable - HaskellVarId getVarId(); - -} diff --git a/intellij/haskell/psi/HaskellConSym.java b/intellij/haskell/psi/HaskellConSym.java deleted file mode 100644 index 212425ab..00000000 --- a/intellij/haskell/psi/HaskellConSym.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellConSym extends HaskellNamedElement { - -} diff --git a/intellij/haskell/psi/HaskellConstr1.java b/intellij/haskell/psi/HaskellConstr1.java deleted file mode 100644 index 9e84cb6c..00000000 --- a/intellij/haskell/psi/HaskellConstr1.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellConstr1 extends HaskellCompositeElement { - - @NotNull - List getFielddeclList(); - - @NotNull - HaskellQcon getQcon(); - - @NotNull - List getUnpackNounpackPragmaList(); - -} diff --git a/intellij/haskell/psi/HaskellConstr2.java b/intellij/haskell/psi/HaskellConstr2.java deleted file mode 100644 index 32118bff..00000000 --- a/intellij/haskell/psi/HaskellConstr2.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellConstr2 extends HaskellCompositeElement { - - @NotNull - HaskellQconOp getQconOp(); - - @NotNull - List getSubConstr2List(); - - @NotNull - List getUnpackNounpackPragmaList(); - -} diff --git a/intellij/haskell/psi/HaskellConstr3.java b/intellij/haskell/psi/HaskellConstr3.java deleted file mode 100644 index b7216b18..00000000 --- a/intellij/haskell/psi/HaskellConstr3.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellConstr3 extends HaskellCompositeElement { - - @NotNull - List getCnameList(); - - @NotNull - List getGtyconList(); - - @NotNull - HaskellQcon getQcon(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - - @NotNull - List getUnpackNounpackPragmaList(); - -} diff --git a/intellij/haskell/psi/HaskellConstr4.java b/intellij/haskell/psi/HaskellConstr4.java deleted file mode 100644 index 26d17afb..00000000 --- a/intellij/haskell/psi/HaskellConstr4.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellConstr4 extends HaskellCompositeElement { - - @NotNull - HaskellGconSym getGconSym(); - - @NotNull - HaskellQcon getQcon(); - - @NotNull - HaskellQvar getQvar(); - - @NotNull - List getUnpackNounpackPragmaList(); - -} diff --git a/intellij/haskell/psi/HaskellContext.java b/intellij/haskell/psi/HaskellContext.java deleted file mode 100644 index 9af27153..00000000 --- a/intellij/haskell/psi/HaskellContext.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellContext extends HaskellCompositeElement { - - @NotNull - List getClazzList(); - -} diff --git a/intellij/haskell/psi/HaskellCtypePragma.java b/intellij/haskell/psi/HaskellCtypePragma.java deleted file mode 100644 index 31610d49..00000000 --- a/intellij/haskell/psi/HaskellCtypePragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellCtypePragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellDataDeclaration.java b/intellij/haskell/psi/HaskellDataDeclaration.java deleted file mode 100644 index 98bbba73..00000000 --- a/intellij/haskell/psi/HaskellDataDeclaration.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellDataDeclaration extends HaskellDataConstructorDeclarationElement { - - @NotNull - List getCdeclList(); - - @NotNull - List getConstr1List(); - - @NotNull - List getConstr2List(); - - @NotNull - List getConstr3List(); - - @NotNull - List getConstr4List(); - - @Nullable - HaskellContext getContext(); - - @Nullable - HaskellCtypePragma getCtypePragma(); - - @Nullable - HaskellDataDeclarationDeriving getDataDeclarationDeriving(); - - @NotNull - List getExpressionList(); - - @Nullable - HaskellKindSignature getKindSignature(); - - @NotNull - List getQvarList(); - - @NotNull - List getSimpletypeList(); - -} diff --git a/intellij/haskell/psi/HaskellDataDeclarationDeriving.java b/intellij/haskell/psi/HaskellDataDeclarationDeriving.java deleted file mode 100644 index f619e09d..00000000 --- a/intellij/haskell/psi/HaskellDataDeclarationDeriving.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellDataDeclarationDeriving extends HaskellCompositeElement { - - @NotNull - List getTtypeList(); - -} diff --git a/intellij/haskell/psi/HaskellDefaultDeclaration.java b/intellij/haskell/psi/HaskellDefaultDeclaration.java deleted file mode 100644 index baa1129c..00000000 --- a/intellij/haskell/psi/HaskellDefaultDeclaration.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellDefaultDeclaration extends HaskellDeclarationElement { - - @NotNull - List getTtypeList(); - - @Nullable - HaskellTypeSignature getTypeSignature(); - -} diff --git a/intellij/haskell/psi/HaskellDeprecatedWarnPragma.java b/intellij/haskell/psi/HaskellDeprecatedWarnPragma.java deleted file mode 100644 index adb2f863..00000000 --- a/intellij/haskell/psi/HaskellDeprecatedWarnPragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellDeprecatedWarnPragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellDerivingDeclaration.java b/intellij/haskell/psi/HaskellDerivingDeclaration.java deleted file mode 100644 index f0cd50ca..00000000 --- a/intellij/haskell/psi/HaskellDerivingDeclaration.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellDerivingDeclaration extends HaskellDeclarationElement { - - @NotNull - HaskellInst getInst(); - - @NotNull - HaskellQcon getQcon(); - - @Nullable - HaskellScontext getScontext(); - -} diff --git a/intellij/haskell/psi/HaskellDotDotParens.java b/intellij/haskell/psi/HaskellDotDotParens.java deleted file mode 100644 index 66027ffa..00000000 --- a/intellij/haskell/psi/HaskellDotDotParens.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellDotDotParens extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellDummyPragma.java b/intellij/haskell/psi/HaskellDummyPragma.java deleted file mode 100644 index b232d18b..00000000 --- a/intellij/haskell/psi/HaskellDummyPragma.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellDummyPragma extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellExport.java b/intellij/haskell/psi/HaskellExport.java deleted file mode 100644 index ace98ca7..00000000 --- a/intellij/haskell/psi/HaskellExport.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellExport extends HaskellCompositeElement { - - @NotNull - List getCnameList(); - - @Nullable - HaskellDotDotParens getDotDotParens(); - - @Nullable - HaskellModId getModId(); - - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQvar getQvar(); - - @Nullable - HaskellQvarOp getQvarOp(); - -} diff --git a/intellij/haskell/psi/HaskellExports.java b/intellij/haskell/psi/HaskellExports.java deleted file mode 100644 index b8743c22..00000000 --- a/intellij/haskell/psi/HaskellExports.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellExports extends HaskellCompositeElement { - - @NotNull - List getExportList(); - -} diff --git a/intellij/haskell/psi/HaskellExpression.java b/intellij/haskell/psi/HaskellExpression.java deleted file mode 100644 index a2e1027d..00000000 --- a/intellij/haskell/psi/HaskellExpression.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellExpression extends HaskellCompositeElement { - - @Nullable - HaskellFirstLineExpression getFirstLineExpression(); - - @NotNull - HaskellLastLineExpression getLastLineExpression(); - - @NotNull - List getLineExpressionList(); - -} diff --git a/intellij/haskell/psi/HaskellFielddecl.java b/intellij/haskell/psi/HaskellFielddecl.java deleted file mode 100644 index 2217e066..00000000 --- a/intellij/haskell/psi/HaskellFielddecl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellFielddecl extends HaskellCompositeElement { - - @Nullable - HaskellCname getCname(); - - @Nullable - HaskellGtycon getGtycon(); - - @NotNull - List getQvarList(); - - @Nullable - HaskellQvarOp getQvarOp(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - - @Nullable - HaskellUnpackNounpackPragma getUnpackNounpackPragma(); - - @NotNull - HaskellVars getVars(); - -} diff --git a/intellij/haskell/psi/HaskellFileHeader.java b/intellij/haskell/psi/HaskellFileHeader.java deleted file mode 100644 index 41245718..00000000 --- a/intellij/haskell/psi/HaskellFileHeader.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellFileHeader extends HaskellCompositeElement { - - @NotNull - List getFileHeaderPragmaList(); - -} diff --git a/intellij/haskell/psi/HaskellFileHeaderPragma.java b/intellij/haskell/psi/HaskellFileHeaderPragma.java deleted file mode 100644 index 270f5b63..00000000 --- a/intellij/haskell/psi/HaskellFileHeaderPragma.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellFileHeaderPragma extends HaskellCompositeElement { - - @Nullable - HaskellAnnPragma getAnnPragma(); - - @Nullable - HaskellDummyPragma getDummyPragma(); - - @Nullable - HaskellHaddockPragma getHaddockPragma(); - - @Nullable - HaskellIncludePragma getIncludePragma(); - - @Nullable - HaskellLanguagePragma getLanguagePragma(); - - @Nullable - HaskellOptionsGhcPragma getOptionsGhcPragma(); - -} diff --git a/intellij/haskell/psi/HaskellFirstLineExpression.java b/intellij/haskell/psi/HaskellFirstLineExpression.java deleted file mode 100644 index 7eeb1fb3..00000000 --- a/intellij/haskell/psi/HaskellFirstLineExpression.java +++ /dev/null @@ -1,31 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellFirstLineExpression extends HaskellLineExpressionElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - - @NotNull - HaskellSnl getSnl(); - -} diff --git a/intellij/haskell/psi/HaskellFixity.java b/intellij/haskell/psi/HaskellFixity.java deleted file mode 100644 index ac105681..00000000 --- a/intellij/haskell/psi/HaskellFixity.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellFixity extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellForeignDeclaration.java b/intellij/haskell/psi/HaskellForeignDeclaration.java deleted file mode 100644 index 59dab8ff..00000000 --- a/intellij/haskell/psi/HaskellForeignDeclaration.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellForeignDeclaration extends HaskellDeclarationElement { - - @NotNull - HaskellExpression getExpression(); - -} diff --git a/intellij/haskell/psi/HaskellGconSym.java b/intellij/haskell/psi/HaskellGconSym.java deleted file mode 100644 index 4a5b39b8..00000000 --- a/intellij/haskell/psi/HaskellGconSym.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellGconSym extends HaskellCompositeElement { - - @Nullable - HaskellConSym getConSym(); - - @Nullable - HaskellQconSym getQconSym(); - -} diff --git a/intellij/haskell/psi/HaskellGeneralPragmaContent.java b/intellij/haskell/psi/HaskellGeneralPragmaContent.java deleted file mode 100644 index 13be0b2b..00000000 --- a/intellij/haskell/psi/HaskellGeneralPragmaContent.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellGeneralPragmaContent extends HaskellCompositeElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - -} diff --git a/intellij/haskell/psi/HaskellGtycon.java b/intellij/haskell/psi/HaskellGtycon.java deleted file mode 100644 index 95eff81a..00000000 --- a/intellij/haskell/psi/HaskellGtycon.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellGtycon extends HaskellCompositeElement { - - @Nullable - HaskellQcon getQcon(); - -} diff --git a/intellij/haskell/psi/HaskellHaddockPragma.java b/intellij/haskell/psi/HaskellHaddockPragma.java deleted file mode 100644 index 29709747..00000000 --- a/intellij/haskell/psi/HaskellHaddockPragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellHaddockPragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellIdecl.java b/intellij/haskell/psi/HaskellIdecl.java deleted file mode 100644 index d33ea874..00000000 --- a/intellij/haskell/psi/HaskellIdecl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellIdecl extends HaskellCompositeElement { - - @Nullable - HaskellDataDeclaration getDataDeclaration(); - - @Nullable - HaskellDefaultDeclaration getDefaultDeclaration(); - - @Nullable - HaskellInlinePragma getInlinePragma(); - - @Nullable - HaskellInstanceDeclaration getInstanceDeclaration(); - - @Nullable - HaskellNewtypeDeclaration getNewtypeDeclaration(); - - @Nullable - HaskellNoinlinePragma getNoinlinePragma(); - - @Nullable - HaskellSpecializePragma getSpecializePragma(); - - @Nullable - HaskellTypeDeclaration getTypeDeclaration(); - -} diff --git a/intellij/haskell/psi/HaskellImportDeclaration.java b/intellij/haskell/psi/HaskellImportDeclaration.java deleted file mode 100644 index f3212872..00000000 --- a/intellij/haskell/psi/HaskellImportDeclaration.java +++ /dev/null @@ -1,25 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportDeclaration extends HaskellCompositeElement { - - @NotNull - HaskellImportModule getImportModule(); - - @Nullable - HaskellImportQualified getImportQualified(); - - @Nullable - HaskellImportQualifiedAs getImportQualifiedAs(); - - @Nullable - HaskellImportSpec getImportSpec(); - - @Nullable - HaskellSourcePragma getSourcePragma(); - -} diff --git a/intellij/haskell/psi/HaskellImportEmptySpec.java b/intellij/haskell/psi/HaskellImportEmptySpec.java deleted file mode 100644 index c6f5f1d7..00000000 --- a/intellij/haskell/psi/HaskellImportEmptySpec.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportEmptySpec extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellImportHiding.java b/intellij/haskell/psi/HaskellImportHiding.java deleted file mode 100644 index dbe03108..00000000 --- a/intellij/haskell/psi/HaskellImportHiding.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportHiding extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellImportHidingSpec.java b/intellij/haskell/psi/HaskellImportHidingSpec.java deleted file mode 100644 index 9aeec2d1..00000000 --- a/intellij/haskell/psi/HaskellImportHidingSpec.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportHidingSpec extends HaskellCompositeElement { - - @NotNull - HaskellImportHiding getImportHiding(); - - @NotNull - List getImportIdList(); - -} diff --git a/intellij/haskell/psi/HaskellImportId.java b/intellij/haskell/psi/HaskellImportId.java deleted file mode 100644 index 9a67e01d..00000000 --- a/intellij/haskell/psi/HaskellImportId.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportId extends HaskellCompositeElement { - - @NotNull - List getCnameList(); - - @Nullable - HaskellDotDotParens getDotDotParens(); - - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQvar getQvar(); - -} diff --git a/intellij/haskell/psi/HaskellImportIdsSpec.java b/intellij/haskell/psi/HaskellImportIdsSpec.java deleted file mode 100644 index 1bbf9798..00000000 --- a/intellij/haskell/psi/HaskellImportIdsSpec.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportIdsSpec extends HaskellCompositeElement { - - @NotNull - List getImportIdList(); - -} diff --git a/intellij/haskell/psi/HaskellImportModule.java b/intellij/haskell/psi/HaskellImportModule.java deleted file mode 100644 index 9b233ef0..00000000 --- a/intellij/haskell/psi/HaskellImportModule.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportModule extends HaskellCompositeElement { - - @NotNull - HaskellModId getModId(); - -} diff --git a/intellij/haskell/psi/HaskellImportQualified.java b/intellij/haskell/psi/HaskellImportQualified.java deleted file mode 100644 index 43c70784..00000000 --- a/intellij/haskell/psi/HaskellImportQualified.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportQualified extends HaskellCompositeElement { - - @NotNull - HaskellVarId getVarId(); - -} diff --git a/intellij/haskell/psi/HaskellImportQualifiedAs.java b/intellij/haskell/psi/HaskellImportQualifiedAs.java deleted file mode 100644 index b9761776..00000000 --- a/intellij/haskell/psi/HaskellImportQualifiedAs.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportQualifiedAs extends HaskellCompositeElement { - - @Nullable - HaskellQualifier getQualifier(); - - @NotNull - HaskellVarId getVarId(); - -} diff --git a/intellij/haskell/psi/HaskellImportSpec.java b/intellij/haskell/psi/HaskellImportSpec.java deleted file mode 100644 index b4397a3d..00000000 --- a/intellij/haskell/psi/HaskellImportSpec.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellImportSpec extends HaskellCompositeElement { - - @Nullable - HaskellImportEmptySpec getImportEmptySpec(); - - @Nullable - HaskellImportHidingSpec getImportHidingSpec(); - - @Nullable - HaskellImportIdsSpec getImportIdsSpec(); - -} diff --git a/intellij/haskell/psi/HaskellIncludePragma.java b/intellij/haskell/psi/HaskellIncludePragma.java deleted file mode 100644 index 4bb7ccd9..00000000 --- a/intellij/haskell/psi/HaskellIncludePragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellIncludePragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellInlinablePragma.java b/intellij/haskell/psi/HaskellInlinablePragma.java deleted file mode 100644 index 99b42e7f..00000000 --- a/intellij/haskell/psi/HaskellInlinablePragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellInlinablePragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellInlinePragma.java b/intellij/haskell/psi/HaskellInlinePragma.java deleted file mode 100644 index b0d76c0b..00000000 --- a/intellij/haskell/psi/HaskellInlinePragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellInlinePragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellInst.java b/intellij/haskell/psi/HaskellInst.java deleted file mode 100644 index 5597fb02..00000000 --- a/intellij/haskell/psi/HaskellInst.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellInst extends HaskellCompositeElement { - - @Nullable - HaskellGtycon getGtycon(); - - @NotNull - List getInstvarList(); - - @Nullable - HaskellQvar getQvar(); - - @Nullable - HaskellTtype getTtype(); - -} diff --git a/intellij/haskell/psi/HaskellInstanceDeclaration.java b/intellij/haskell/psi/HaskellInstanceDeclaration.java deleted file mode 100644 index 185fafbd..00000000 --- a/intellij/haskell/psi/HaskellInstanceDeclaration.java +++ /dev/null @@ -1,31 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellInstanceDeclaration extends HaskellDeclarationElement { - - @NotNull - List getExpressionList(); - - @NotNull - List getIdeclList(); - - @NotNull - HaskellInst getInst(); - - @Nullable - HaskellOverlapPragma getOverlapPragma(); - - @NotNull - HaskellQcon getQcon(); - - @Nullable - HaskellScontext getScontext(); - - @NotNull - List getVarIdList(); - -} diff --git a/intellij/haskell/psi/HaskellInstvar.java b/intellij/haskell/psi/HaskellInstvar.java deleted file mode 100644 index 0201a823..00000000 --- a/intellij/haskell/psi/HaskellInstvar.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellInstvar extends HaskellCompositeElement { - - @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQvar getQvar(); - -} diff --git a/intellij/haskell/psi/HaskellKindSignature.java b/intellij/haskell/psi/HaskellKindSignature.java deleted file mode 100644 index c59cf222..00000000 --- a/intellij/haskell/psi/HaskellKindSignature.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellKindSignature extends HaskellCompositeElement { - - @NotNull - HaskellTtype getTtype(); - - @NotNull - HaskellVarId getVarId(); - -} diff --git a/intellij/haskell/psi/HaskellLanguagePragma.java b/intellij/haskell/psi/HaskellLanguagePragma.java deleted file mode 100644 index f65c11ec..00000000 --- a/intellij/haskell/psi/HaskellLanguagePragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLanguagePragma extends HaskellCompositeElement { - - @NotNull - List getQconList(); - -} diff --git a/intellij/haskell/psi/HaskellLastLineExpression.java b/intellij/haskell/psi/HaskellLastLineExpression.java deleted file mode 100644 index c3819031..00000000 --- a/intellij/haskell/psi/HaskellLastLineExpression.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLastLineExpression extends HaskellLineExpressionElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - -} diff --git a/intellij/haskell/psi/HaskellLineExpression.java b/intellij/haskell/psi/HaskellLineExpression.java deleted file mode 100644 index 9930b05f..00000000 --- a/intellij/haskell/psi/HaskellLineExpression.java +++ /dev/null @@ -1,31 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLineExpression extends HaskellLineExpressionElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - - @NotNull - HaskellSnl getSnl(); - -} diff --git a/intellij/haskell/psi/HaskellLinePragma.java b/intellij/haskell/psi/HaskellLinePragma.java deleted file mode 100644 index 9ed90de7..00000000 --- a/intellij/haskell/psi/HaskellLinePragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLinePragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellLiteral.java b/intellij/haskell/psi/HaskellLiteral.java deleted file mode 100644 index 8e47b11d..00000000 --- a/intellij/haskell/psi/HaskellLiteral.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellLiteral extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellMinimalPragma.java b/intellij/haskell/psi/HaskellMinimalPragma.java deleted file mode 100644 index b931c1fa..00000000 --- a/intellij/haskell/psi/HaskellMinimalPragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellMinimalPragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellModId.java b/intellij/haskell/psi/HaskellModId.java deleted file mode 100644 index 9a4fd9fc..00000000 --- a/intellij/haskell/psi/HaskellModId.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellModId extends HaskellNamedElement { - -} diff --git a/intellij/haskell/psi/HaskellModuleBody.java b/intellij/haskell/psi/HaskellModuleBody.java deleted file mode 100644 index 99c57748..00000000 --- a/intellij/haskell/psi/HaskellModuleBody.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellModuleBody extends HaskellCompositeElement { - - @NotNull - List getCfilesPragmaList(); - - @NotNull - List getImportDeclarationList(); - - @NotNull - List getModuleDeclarationList(); - - @NotNull - List getTopDeclarationList(); - -} diff --git a/intellij/haskell/psi/HaskellModuleDeclaration.java b/intellij/haskell/psi/HaskellModuleDeclaration.java deleted file mode 100644 index 6fed12f2..00000000 --- a/intellij/haskell/psi/HaskellModuleDeclaration.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellModuleDeclaration extends HaskellDeclarationElement { - - @Nullable - HaskellDeprecatedWarnPragma getDeprecatedWarnPragma(); - - @Nullable - HaskellExports getExports(); - - @NotNull - HaskellModId getModId(); - -} diff --git a/intellij/haskell/psi/HaskellNewconstr.java b/intellij/haskell/psi/HaskellNewconstr.java deleted file mode 100644 index b2e73e1d..00000000 --- a/intellij/haskell/psi/HaskellNewconstr.java +++ /dev/null @@ -1,31 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellNewconstr extends HaskellCompositeElement { - - @Nullable - HaskellCname getCname(); - - @Nullable - HaskellGtycon getGtycon(); - - @Nullable - HaskellNewconstrFielddecl getNewconstrFielddecl(); - - @Nullable - HaskellQcon getQcon(); - - @NotNull - List getQvarList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - -} diff --git a/intellij/haskell/psi/HaskellNewconstrFielddecl.java b/intellij/haskell/psi/HaskellNewconstrFielddecl.java deleted file mode 100644 index 2b0869f1..00000000 --- a/intellij/haskell/psi/HaskellNewconstrFielddecl.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellNewconstrFielddecl extends HaskellCompositeElement { - - @NotNull - HaskellQcon getQcon(); - - @NotNull - HaskellQvar getQvar(); - - @NotNull - HaskellTtype getTtype(); - -} diff --git a/intellij/haskell/psi/HaskellNewtypeDeclaration.java b/intellij/haskell/psi/HaskellNewtypeDeclaration.java deleted file mode 100644 index 6be6442a..00000000 --- a/intellij/haskell/psi/HaskellNewtypeDeclaration.java +++ /dev/null @@ -1,25 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellNewtypeDeclaration extends HaskellDataConstructorDeclarationElement { - - @Nullable - HaskellContext getContext(); - - @Nullable - HaskellCtypePragma getCtypePragma(); - - @NotNull - HaskellNewconstr getNewconstr(); - - @NotNull - HaskellSimpletype getSimpletype(); - - @Nullable - HaskellTtype getTtype(); - -} diff --git a/intellij/haskell/psi/HaskellNoinlinePragma.java b/intellij/haskell/psi/HaskellNoinlinePragma.java deleted file mode 100644 index 5fedc943..00000000 --- a/intellij/haskell/psi/HaskellNoinlinePragma.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellNoinlinePragma extends HaskellCompositeElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - -} diff --git a/intellij/haskell/psi/HaskellNounpackPragma.java b/intellij/haskell/psi/HaskellNounpackPragma.java deleted file mode 100644 index 1e161d82..00000000 --- a/intellij/haskell/psi/HaskellNounpackPragma.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellNounpackPragma extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellOp.java b/intellij/haskell/psi/HaskellOp.java deleted file mode 100644 index 11387145..00000000 --- a/intellij/haskell/psi/HaskellOp.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellOp extends HaskellCompositeElement { - - @Nullable - HaskellQconOp getQconOp(); - - @Nullable - HaskellQvarOp getQvarOp(); - -} diff --git a/intellij/haskell/psi/HaskellOps.java b/intellij/haskell/psi/HaskellOps.java deleted file mode 100644 index 4e83c45d..00000000 --- a/intellij/haskell/psi/HaskellOps.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellOps extends HaskellCompositeElement { - - @NotNull - List getOpList(); - -} diff --git a/intellij/haskell/psi/HaskellOptionsGhcPragma.java b/intellij/haskell/psi/HaskellOptionsGhcPragma.java deleted file mode 100644 index 4f9361cc..00000000 --- a/intellij/haskell/psi/HaskellOptionsGhcPragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellOptionsGhcPragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellOtherPragma.java b/intellij/haskell/psi/HaskellOtherPragma.java deleted file mode 100644 index 894a42c6..00000000 --- a/intellij/haskell/psi/HaskellOtherPragma.java +++ /dev/null @@ -1,43 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellOtherPragma extends HaskellCompositeElement { - - @Nullable - HaskellAnnPragma getAnnPragma(); - - @Nullable - HaskellDeprecatedWarnPragma getDeprecatedWarnPragma(); - - @Nullable - HaskellDummyPragma getDummyPragma(); - - @Nullable - HaskellInlinablePragma getInlinablePragma(); - - @Nullable - HaskellInlinePragma getInlinePragma(); - - @Nullable - HaskellLinePragma getLinePragma(); - - @Nullable - HaskellMinimalPragma getMinimalPragma(); - - @Nullable - HaskellNoinlinePragma getNoinlinePragma(); - - @Nullable - HaskellOverlapPragma getOverlapPragma(); - - @Nullable - HaskellRulesPragma getRulesPragma(); - - @Nullable - HaskellSpecializePragma getSpecializePragma(); - -} diff --git a/intellij/haskell/psi/HaskellOverlapPragma.java b/intellij/haskell/psi/HaskellOverlapPragma.java deleted file mode 100644 index ff931c16..00000000 --- a/intellij/haskell/psi/HaskellOverlapPragma.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellOverlapPragma extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellParallelArrayType.java b/intellij/haskell/psi/HaskellParallelArrayType.java deleted file mode 100644 index 7b89b3df..00000000 --- a/intellij/haskell/psi/HaskellParallelArrayType.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellParallelArrayType extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellQcon.java b/intellij/haskell/psi/HaskellQcon.java deleted file mode 100644 index cfdbe1a4..00000000 --- a/intellij/haskell/psi/HaskellQcon.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQcon extends HaskellQVarConOpElement { - - @Nullable - HaskellConId getConId(); - - @Nullable - HaskellConSym getConSym(); - - @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellQconId getQconId(); - -} diff --git a/intellij/haskell/psi/HaskellQconId.java b/intellij/haskell/psi/HaskellQconId.java deleted file mode 100644 index b4e92583..00000000 --- a/intellij/haskell/psi/HaskellQconId.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQconId extends HaskellCompositeElement { - - @NotNull - HaskellConId getConId(); - - @NotNull - HaskellQconIdQualifier getQconIdQualifier(); - -} diff --git a/intellij/haskell/psi/HaskellQconIdQualifier.java b/intellij/haskell/psi/HaskellQconIdQualifier.java deleted file mode 100644 index ce6afff2..00000000 --- a/intellij/haskell/psi/HaskellQconIdQualifier.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQconIdQualifier extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellQconOp.java b/intellij/haskell/psi/HaskellQconOp.java deleted file mode 100644 index 489add8c..00000000 --- a/intellij/haskell/psi/HaskellQconOp.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQconOp extends HaskellQVarConOpElement { - - @Nullable - HaskellConId getConId(); - - @Nullable - HaskellConSym getConSym(); - - @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellQconId getQconId(); - -} diff --git a/intellij/haskell/psi/HaskellQconSym.java b/intellij/haskell/psi/HaskellQconSym.java deleted file mode 100644 index 49362c45..00000000 --- a/intellij/haskell/psi/HaskellQconSym.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQconSym extends HaskellCompositeElement { - - @NotNull - HaskellConSym getConSym(); - - @NotNull - HaskellQualifier getQualifier(); - -} diff --git a/intellij/haskell/psi/HaskellQqExpression.java b/intellij/haskell/psi/HaskellQqExpression.java deleted file mode 100644 index 88f51b2e..00000000 --- a/intellij/haskell/psi/HaskellQqExpression.java +++ /dev/null @@ -1,31 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQqExpression extends HaskellCompositeElement { - - @NotNull - List getFixityList(); - - @NotNull - List getLiteralList(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - HaskellQuasiQuote getQuasiQuote(); - - @NotNull - List getQvarList(); - - @NotNull - List getQvarOpList(); - -} diff --git a/intellij/haskell/psi/HaskellQualifier.java b/intellij/haskell/psi/HaskellQualifier.java deleted file mode 100644 index a7387495..00000000 --- a/intellij/haskell/psi/HaskellQualifier.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQualifier extends HaskellNamedElement { - -} diff --git a/intellij/haskell/psi/HaskellQuasiQuote.java b/intellij/haskell/psi/HaskellQuasiQuote.java deleted file mode 100644 index afe68669..00000000 --- a/intellij/haskell/psi/HaskellQuasiQuote.java +++ /dev/null @@ -1,19 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQuasiQuote extends HaskellCompositeElement { - - @Nullable - HaskellExpression getExpression(); - - @Nullable - HaskellSimpletype getSimpletype(); - - @NotNull - List getTopDeclarationList(); - -} diff --git a/intellij/haskell/psi/HaskellQvar.java b/intellij/haskell/psi/HaskellQvar.java deleted file mode 100644 index fb9ab9e3..00000000 --- a/intellij/haskell/psi/HaskellQvar.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQvar extends HaskellQVarConOpElement { - - @Nullable - HaskellQvarId getQvarId(); - - @Nullable - HaskellQvarSym getQvarSym(); - - @Nullable - HaskellVarId getVarId(); - - @Nullable - HaskellVarSym getVarSym(); - -} diff --git a/intellij/haskell/psi/HaskellQvarId.java b/intellij/haskell/psi/HaskellQvarId.java deleted file mode 100644 index 2d8600ee..00000000 --- a/intellij/haskell/psi/HaskellQvarId.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQvarId extends HaskellCompositeElement { - - @NotNull - HaskellQualifier getQualifier(); - - @NotNull - HaskellVarId getVarId(); - -} diff --git a/intellij/haskell/psi/HaskellQvarOp.java b/intellij/haskell/psi/HaskellQvarOp.java deleted file mode 100644 index e8f0c148..00000000 --- a/intellij/haskell/psi/HaskellQvarOp.java +++ /dev/null @@ -1,22 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQvarOp extends HaskellQVarConOpElement { - - @Nullable - HaskellQvarId getQvarId(); - - @Nullable - HaskellQvarSym getQvarSym(); - - @Nullable - HaskellVarId getVarId(); - - @Nullable - HaskellVarSym getVarSym(); - -} diff --git a/intellij/haskell/psi/HaskellQvarSym.java b/intellij/haskell/psi/HaskellQvarSym.java deleted file mode 100644 index a0010edd..00000000 --- a/intellij/haskell/psi/HaskellQvarSym.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellQvarSym extends HaskellCompositeElement { - - @NotNull - HaskellQualifier getQualifier(); - - @NotNull - HaskellVarSym getVarSym(); - -} diff --git a/intellij/haskell/psi/HaskellRulesPragma.java b/intellij/haskell/psi/HaskellRulesPragma.java deleted file mode 100644 index bcbfd5fb..00000000 --- a/intellij/haskell/psi/HaskellRulesPragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellRulesPragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellScontext.java b/intellij/haskell/psi/HaskellScontext.java deleted file mode 100644 index 035da062..00000000 --- a/intellij/haskell/psi/HaskellScontext.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellScontext extends HaskellCompositeElement { - - @NotNull - List getSimpleclassList(); - -} diff --git a/intellij/haskell/psi/HaskellSimpleclass.java b/intellij/haskell/psi/HaskellSimpleclass.java deleted file mode 100644 index 672bdbc4..00000000 --- a/intellij/haskell/psi/HaskellSimpleclass.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSimpleclass extends HaskellCompositeElement { - - @Nullable - HaskellCname getCname(); - - @Nullable - HaskellGtycon getGtycon(); - - @NotNull - List getQconList(); - - @NotNull - List getQconOpList(); - - @NotNull - List getQvarList(); - - @NotNull - List getSimpleclassTildePartList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - -} diff --git a/intellij/haskell/psi/HaskellSimpleclassTildePart.java b/intellij/haskell/psi/HaskellSimpleclassTildePart.java deleted file mode 100644 index 13e9844b..00000000 --- a/intellij/haskell/psi/HaskellSimpleclassTildePart.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSimpleclassTildePart extends HaskellCompositeElement { - - @NotNull - List getQconList(); - - @NotNull - List getQvarList(); - -} diff --git a/intellij/haskell/psi/HaskellSimpletype.java b/intellij/haskell/psi/HaskellSimpletype.java deleted file mode 100644 index 2488d159..00000000 --- a/intellij/haskell/psi/HaskellSimpletype.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSimpletype extends HaskellCompositeElement { - - @Nullable - HaskellGconSym getGconSym(); - - @Nullable - HaskellParallelArrayType getParallelArrayType(); - - @Nullable - HaskellQcon getQcon(); - - @Nullable - HaskellQconOp getQconOp(); - - @Nullable - HaskellQvarOp getQvarOp(); - - @Nullable - HaskellTtype getTtype(); - - @NotNull - List getTypeSignatureList(); - - @NotNull - List getVarIdList(); - -} diff --git a/intellij/haskell/psi/HaskellSnl.java b/intellij/haskell/psi/HaskellSnl.java deleted file mode 100644 index 1396d6a2..00000000 --- a/intellij/haskell/psi/HaskellSnl.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSnl extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellSourcePragma.java b/intellij/haskell/psi/HaskellSourcePragma.java deleted file mode 100644 index bcf729b7..00000000 --- a/intellij/haskell/psi/HaskellSourcePragma.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSourcePragma extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellSpecializePragma.java b/intellij/haskell/psi/HaskellSpecializePragma.java deleted file mode 100644 index eae15e7f..00000000 --- a/intellij/haskell/psi/HaskellSpecializePragma.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSpecializePragma extends HaskellCompositeElement { - - @NotNull - HaskellGeneralPragmaContent getGeneralPragmaContent(); - -} diff --git a/intellij/haskell/psi/HaskellSubConstr2.java b/intellij/haskell/psi/HaskellSubConstr2.java deleted file mode 100644 index 4be86be8..00000000 --- a/intellij/haskell/psi/HaskellSubConstr2.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellSubConstr2 extends HaskellCompositeElement { - - @NotNull - List getCnameList(); - - @NotNull - List getGtyconList(); - - @NotNull - List getQvarList(); - - @Nullable - HaskellQvarOp getQvarOp(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - -} diff --git a/intellij/haskell/psi/HaskellTopDeclaration.java b/intellij/haskell/psi/HaskellTopDeclaration.java deleted file mode 100644 index e181f9ea..00000000 --- a/intellij/haskell/psi/HaskellTopDeclaration.java +++ /dev/null @@ -1,58 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTopDeclaration extends HaskellCompositeElement { - - @Nullable - HaskellCfilesPragma getCfilesPragma(); - - @Nullable - HaskellClassDeclaration getClassDeclaration(); - - @Nullable - HaskellDataDeclaration getDataDeclaration(); - - @Nullable - HaskellDefaultDeclaration getDefaultDeclaration(); - - @Nullable - HaskellDerivingDeclaration getDerivingDeclaration(); - - @Nullable - HaskellExpression getExpression(); - - @Nullable - HaskellForeignDeclaration getForeignDeclaration(); - - @Nullable - HaskellInstanceDeclaration getInstanceDeclaration(); - - @Nullable - HaskellNewtypeDeclaration getNewtypeDeclaration(); - - @Nullable - HaskellOtherPragma getOtherPragma(); - - @Nullable - HaskellQqExpression getQqExpression(); - - @Nullable - HaskellQuasiQuote getQuasiQuote(); - - @Nullable - HaskellTypeDeclaration getTypeDeclaration(); - - @Nullable - HaskellTypeFamilyDeclaration getTypeFamilyDeclaration(); - - @Nullable - HaskellTypeInstanceDeclaration getTypeInstanceDeclaration(); - - @Nullable - HaskellTypeSignature getTypeSignature(); - -} diff --git a/intellij/haskell/psi/HaskellTtype.java b/intellij/haskell/psi/HaskellTtype.java deleted file mode 100644 index 248f1494..00000000 --- a/intellij/haskell/psi/HaskellTtype.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTtype extends HaskellCompositeElement { - - @NotNull - List getCnameList(); - - @NotNull - List getGtyconList(); - - @Nullable - HaskellParallelArrayType getParallelArrayType(); - - @NotNull - List getQvarList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeSignatureList(); - -} diff --git a/intellij/haskell/psi/HaskellTypeDeclaration.java b/intellij/haskell/psi/HaskellTypeDeclaration.java deleted file mode 100644 index 4b2b1dcf..00000000 --- a/intellij/haskell/psi/HaskellTypeDeclaration.java +++ /dev/null @@ -1,25 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeDeclaration extends HaskellDeclarationElement { - - @Nullable - HaskellExpression getExpression(); - - @Nullable - HaskellKindSignature getKindSignature(); - - @NotNull - HaskellSimpletype getSimpletype(); - - @Nullable - HaskellTtype getTtype(); - - @Nullable - HaskellTypeSignature getTypeSignature(); - -} diff --git a/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java b/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java deleted file mode 100644 index 7eb8e31c..00000000 --- a/intellij/haskell/psi/HaskellTypeFamilyDeclaration.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeFamilyDeclaration extends HaskellDeclarationElement { - - @Nullable - HaskellExpression getExpression(); - - @NotNull - HaskellTypeFamilyType getTypeFamilyType(); - -} diff --git a/intellij/haskell/psi/HaskellTypeFamilyType.java b/intellij/haskell/psi/HaskellTypeFamilyType.java deleted file mode 100644 index 39fb52af..00000000 --- a/intellij/haskell/psi/HaskellTypeFamilyType.java +++ /dev/null @@ -1,25 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeFamilyType extends HaskellCompositeElement { - - @NotNull - List getContextList(); - - @NotNull - List getTtypeList(); - - @NotNull - List getTypeFamilyType1List(); - - @NotNull - List getTypeFamilyType2List(); - - @NotNull - List getVarsList(); - -} diff --git a/intellij/haskell/psi/HaskellTypeFamilyType1.java b/intellij/haskell/psi/HaskellTypeFamilyType1.java deleted file mode 100644 index ab3074bc..00000000 --- a/intellij/haskell/psi/HaskellTypeFamilyType1.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeFamilyType1 extends HaskellCompositeElement { - - @NotNull - HaskellQcon getQcon(); - -} diff --git a/intellij/haskell/psi/HaskellTypeFamilyType2.java b/intellij/haskell/psi/HaskellTypeFamilyType2.java deleted file mode 100644 index 74c26b40..00000000 --- a/intellij/haskell/psi/HaskellTypeFamilyType2.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeFamilyType2 extends HaskellCompositeElement { - - @NotNull - HaskellQvarOp getQvarOp(); - -} diff --git a/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java b/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java deleted file mode 100644 index 58e916cc..00000000 --- a/intellij/haskell/psi/HaskellTypeInstanceDeclaration.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeInstanceDeclaration extends HaskellDeclarationElement { - - @NotNull - HaskellExpression getExpression(); - -} diff --git a/intellij/haskell/psi/HaskellTypeSignature.java b/intellij/haskell/psi/HaskellTypeSignature.java deleted file mode 100644 index c3e40bf0..00000000 --- a/intellij/haskell/psi/HaskellTypeSignature.java +++ /dev/null @@ -1,25 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellTypeSignature extends HaskellDeclarationElement { - - @Nullable - HaskellContext getContext(); - - @Nullable - HaskellFixity getFixity(); - - @Nullable - HaskellOps getOps(); - - @NotNull - List getTtypeList(); - - @Nullable - HaskellVars getVars(); - -} diff --git a/intellij/haskell/psi/HaskellTypes.java b/intellij/haskell/psi/HaskellTypes.java deleted file mode 100644 index 4c09d551..00000000 --- a/intellij/haskell/psi/HaskellTypes.java +++ /dev/null @@ -1,522 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import com.intellij.psi.tree.IElementType; -import com.intellij.psi.PsiElement; -import com.intellij.lang.ASTNode; -import intellij.haskell.psi.impl.*; - -public interface HaskellTypes { - - IElementType HS_ANN_PRAGMA = new HaskellCompositeElementType("HS_ANN_PRAGMA"); - IElementType HS_CDECL = new HaskellCompositeElementType("HS_CDECL"); - IElementType HS_CFILES_PRAGMA = new HaskellCompositeElementType("HS_CFILES_PRAGMA"); - IElementType HS_CLASS_DECLARATION = new HaskellCompositeElementType("HS_CLASS_DECLARATION"); - IElementType HS_CLAZZ = new HaskellCompositeElementType("HS_CLAZZ"); - IElementType HS_CNAME = new HaskellCompositeElementType("HS_CNAME"); - IElementType HS_COMMENTS = new HaskellCompositeElementType("HS_COMMENTS"); - IElementType HS_CONSTR_1 = new HaskellCompositeElementType("HS_CONSTR_1"); - IElementType HS_CONSTR_2 = new HaskellCompositeElementType("HS_CONSTR_2"); - IElementType HS_CONSTR_3 = new HaskellCompositeElementType("HS_CONSTR_3"); - IElementType HS_CONSTR_4 = new HaskellCompositeElementType("HS_CONSTR_4"); - IElementType HS_CONTEXT = new HaskellCompositeElementType("HS_CONTEXT"); - IElementType HS_CON_ID = new HaskellCompositeElementType("HS_CON_ID"); - IElementType HS_CON_SYM = new HaskellCompositeElementType("HS_CON_SYM"); - IElementType HS_CTYPE_PRAGMA = new HaskellCompositeElementType("HS_CTYPE_PRAGMA"); - IElementType HS_DATA_DECLARATION = new HaskellCompositeElementType("HS_DATA_DECLARATION"); - IElementType HS_DATA_DECLARATION_DERIVING = new HaskellCompositeElementType("HS_DATA_DECLARATION_DERIVING"); - IElementType HS_DEFAULT_DECLARATION = new HaskellCompositeElementType("HS_DEFAULT_DECLARATION"); - IElementType HS_DEPRECATED_WARN_PRAGMA = new HaskellCompositeElementType("HS_DEPRECATED_WARN_PRAGMA"); - IElementType HS_DERIVING_DECLARATION = new HaskellCompositeElementType("HS_DERIVING_DECLARATION"); - IElementType HS_DOT_DOT_PARENS = new HaskellCompositeElementType("HS_DOT_DOT_PARENS"); - IElementType HS_DUMMY_PRAGMA = new HaskellCompositeElementType("HS_DUMMY_PRAGMA"); - IElementType HS_EXPORT = new HaskellCompositeElementType("HS_EXPORT"); - IElementType HS_EXPORTS = new HaskellCompositeElementType("HS_EXPORTS"); - IElementType HS_EXPRESSION = new HaskellCompositeElementType("HS_EXPRESSION"); - IElementType HS_FIELDDECL = new HaskellCompositeElementType("HS_FIELDDECL"); - IElementType HS_FILE_HEADER = new HaskellCompositeElementType("HS_FILE_HEADER"); - IElementType HS_FILE_HEADER_PRAGMA = new HaskellCompositeElementType("HS_FILE_HEADER_PRAGMA"); - IElementType HS_FIRST_LINE_EXPRESSION = new HaskellCompositeElementType("HS_FIRST_LINE_EXPRESSION"); - IElementType HS_FIXITY = new HaskellCompositeElementType("HS_FIXITY"); - IElementType HS_FOREIGN_DECLARATION = new HaskellCompositeElementType("HS_FOREIGN_DECLARATION"); - IElementType HS_GCON_SYM = new HaskellCompositeElementType("HS_GCON_SYM"); - IElementType HS_GENERAL_PRAGMA_CONTENT = new HaskellCompositeElementType("HS_GENERAL_PRAGMA_CONTENT"); - IElementType HS_GTYCON = new HaskellCompositeElementType("HS_GTYCON"); - IElementType HS_HADDOCK_PRAGMA = new HaskellCompositeElementType("HS_HADDOCK_PRAGMA"); - IElementType HS_IDECL = new HaskellCompositeElementType("HS_IDECL"); - IElementType HS_IMPORT_DECLARATION = new HaskellCompositeElementType("HS_IMPORT_DECLARATION"); - IElementType HS_IMPORT_EMPTY_SPEC = new HaskellCompositeElementType("HS_IMPORT_EMPTY_SPEC"); - IElementType HS_IMPORT_HIDING = new HaskellCompositeElementType("HS_IMPORT_HIDING"); - IElementType HS_IMPORT_HIDING_SPEC = new HaskellCompositeElementType("HS_IMPORT_HIDING_SPEC"); - IElementType HS_IMPORT_ID = new HaskellCompositeElementType("HS_IMPORT_ID"); - IElementType HS_IMPORT_IDS_SPEC = new HaskellCompositeElementType("HS_IMPORT_IDS_SPEC"); - IElementType HS_IMPORT_MODULE = new HaskellCompositeElementType("HS_IMPORT_MODULE"); - IElementType HS_IMPORT_QUALIFIED = new HaskellCompositeElementType("HS_IMPORT_QUALIFIED"); - IElementType HS_IMPORT_QUALIFIED_AS = new HaskellCompositeElementType("HS_IMPORT_QUALIFIED_AS"); - IElementType HS_IMPORT_SPEC = new HaskellCompositeElementType("HS_IMPORT_SPEC"); - IElementType HS_INCLUDE_PRAGMA = new HaskellCompositeElementType("HS_INCLUDE_PRAGMA"); - IElementType HS_INLINABLE_PRAGMA = new HaskellCompositeElementType("HS_INLINABLE_PRAGMA"); - IElementType HS_INLINE_PRAGMA = new HaskellCompositeElementType("HS_INLINE_PRAGMA"); - IElementType HS_INST = new HaskellCompositeElementType("HS_INST"); - IElementType HS_INSTANCE_DECLARATION = new HaskellCompositeElementType("HS_INSTANCE_DECLARATION"); - IElementType HS_INSTVAR = new HaskellCompositeElementType("HS_INSTVAR"); - IElementType HS_KIND_SIGNATURE = new HaskellCompositeElementType("HS_KIND_SIGNATURE"); - IElementType HS_LANGUAGE_PRAGMA = new HaskellCompositeElementType("HS_LANGUAGE_PRAGMA"); - IElementType HS_LAST_LINE_EXPRESSION = new HaskellCompositeElementType("HS_LAST_LINE_EXPRESSION"); - IElementType HS_LINE_EXPRESSION = new HaskellCompositeElementType("HS_LINE_EXPRESSION"); - IElementType HS_LINE_PRAGMA = new HaskellCompositeElementType("HS_LINE_PRAGMA"); - IElementType HS_LITERAL = new HaskellCompositeElementType("HS_LITERAL"); - IElementType HS_MINIMAL_PRAGMA = new HaskellCompositeElementType("HS_MINIMAL_PRAGMA"); - IElementType HS_MODULE_BODY = new HaskellCompositeElementType("HS_MODULE_BODY"); - IElementType HS_MODULE_DECLARATION = new HaskellCompositeElementType("HS_MODULE_DECLARATION"); - IElementType HS_MOD_ID = new HaskellCompositeElementType("HS_MOD_ID"); - IElementType HS_NEWCONSTR = new HaskellCompositeElementType("HS_NEWCONSTR"); - IElementType HS_NEWCONSTR_FIELDDECL = new HaskellCompositeElementType("HS_NEWCONSTR_FIELDDECL"); - IElementType HS_NEWTYPE_DECLARATION = new HaskellCompositeElementType("HS_NEWTYPE_DECLARATION"); - IElementType HS_NOINLINE_PRAGMA = new HaskellCompositeElementType("HS_NOINLINE_PRAGMA"); - IElementType HS_NOUNPACK_PRAGMA = new HaskellCompositeElementType("HS_NOUNPACK_PRAGMA"); - IElementType HS_OP = new HaskellCompositeElementType("HS_OP"); - IElementType HS_OPS = new HaskellCompositeElementType("HS_OPS"); - IElementType HS_OPTIONS_GHC_PRAGMA = new HaskellCompositeElementType("HS_OPTIONS_GHC_PRAGMA"); - IElementType HS_OTHER_PRAGMA = new HaskellCompositeElementType("HS_OTHER_PRAGMA"); - IElementType HS_OVERLAP_PRAGMA = new HaskellCompositeElementType("HS_OVERLAP_PRAGMA"); - IElementType HS_PARALLEL_ARRAY_TYPE = new HaskellCompositeElementType("HS_PARALLEL_ARRAY_TYPE"); - IElementType HS_QCON = new HaskellCompositeElementType("HS_QCON"); - IElementType HS_QCON_ID = new HaskellCompositeElementType("HS_QCON_ID"); - IElementType HS_QCON_ID_QUALIFIER = new HaskellCompositeElementType("HS_QCON_ID_QUALIFIER"); - IElementType HS_QCON_OP = new HaskellCompositeElementType("HS_QCON_OP"); - IElementType HS_QCON_SYM = new HaskellCompositeElementType("HS_QCON_SYM"); - IElementType HS_QQ_EXPRESSION = new HaskellCompositeElementType("HS_QQ_EXPRESSION"); - IElementType HS_QUALIFIER = new HaskellCompositeElementType("HS_QUALIFIER"); - IElementType HS_QUASI_QUOTE = new HaskellCompositeElementType("HS_QUASI_QUOTE"); - IElementType HS_QVAR = new HaskellCompositeElementType("HS_QVAR"); - IElementType HS_QVAR_ID = new HaskellCompositeElementType("HS_QVAR_ID"); - IElementType HS_QVAR_OP = new HaskellCompositeElementType("HS_QVAR_OP"); - IElementType HS_QVAR_SYM = new HaskellCompositeElementType("HS_QVAR_SYM"); - IElementType HS_RULES_PRAGMA = new HaskellCompositeElementType("HS_RULES_PRAGMA"); - IElementType HS_SCONTEXT = new HaskellCompositeElementType("HS_SCONTEXT"); - IElementType HS_SIMPLECLASS = new HaskellCompositeElementType("HS_SIMPLECLASS"); - IElementType HS_SIMPLECLASS_TILDE_PART = new HaskellCompositeElementType("HS_SIMPLECLASS_TILDE_PART"); - IElementType HS_SIMPLETYPE = new HaskellCompositeElementType("HS_SIMPLETYPE"); - IElementType HS_SNL = new HaskellCompositeElementType("HS_SNL"); - IElementType HS_SOURCE_PRAGMA = new HaskellCompositeElementType("HS_SOURCE_PRAGMA"); - IElementType HS_SPECIALIZE_PRAGMA = new HaskellCompositeElementType("HS_SPECIALIZE_PRAGMA"); - IElementType HS_SUB_CONSTR_2 = new HaskellCompositeElementType("HS_SUB_CONSTR_2"); - IElementType HS_TOP_DECLARATION = new HaskellCompositeElementType("HS_TOP_DECLARATION"); - IElementType HS_TTYPE = new HaskellCompositeElementType("HS_TTYPE"); - IElementType HS_TYPE_DECLARATION = new HaskellCompositeElementType("HS_TYPE_DECLARATION"); - IElementType HS_TYPE_FAMILY_DECLARATION = new HaskellCompositeElementType("HS_TYPE_FAMILY_DECLARATION"); - IElementType HS_TYPE_FAMILY_TYPE = new HaskellCompositeElementType("HS_TYPE_FAMILY_TYPE"); - IElementType HS_TYPE_FAMILY_TYPE_1 = new HaskellCompositeElementType("HS_TYPE_FAMILY_TYPE_1"); - IElementType HS_TYPE_FAMILY_TYPE_2 = new HaskellCompositeElementType("HS_TYPE_FAMILY_TYPE_2"); - IElementType HS_TYPE_INSTANCE_DECLARATION = new HaskellCompositeElementType("HS_TYPE_INSTANCE_DECLARATION"); - IElementType HS_TYPE_SIGNATURE = new HaskellCompositeElementType("HS_TYPE_SIGNATURE"); - IElementType HS_UNPACK_NOUNPACK_PRAGMA = new HaskellCompositeElementType("HS_UNPACK_NOUNPACK_PRAGMA"); - IElementType HS_UNPACK_PRAGMA = new HaskellCompositeElementType("HS_UNPACK_PRAGMA"); - IElementType HS_VARS = new HaskellCompositeElementType("HS_VARS"); - IElementType HS_VAR_ID = new HaskellCompositeElementType("HS_VAR_ID"); - IElementType HS_VAR_SYM = new HaskellCompositeElementType("HS_VAR_SYM"); - - IElementType HS_AT = new HaskellTokenType("AT"); - IElementType HS_BACKQUOTE = new HaskellTokenType("BACKQUOTE"); - IElementType HS_BACKSLASH = new HaskellTokenType("BACKSLASH"); - IElementType HS_CASE = new HaskellTokenType("CASE"); - IElementType HS_CHARACTER_LITERAL = new HaskellTokenType("CHARACTER_LITERAL"); - IElementType HS_CLASS = new HaskellTokenType("CLASS"); - IElementType HS_COLON = new HaskellTokenType("COLON"); - IElementType HS_COLON_COLON = new HaskellTokenType("COLON_COLON"); - IElementType HS_COMMA = new HaskellTokenType("COMMA"); - IElementType HS_COMMENT = new HaskellTokenType("COMMENT"); - IElementType HS_CONID_ID = new HaskellTokenType("CONID_ID"); - IElementType HS_CONSYM_ID = new HaskellTokenType("CONSYM_ID"); - IElementType HS_DATA = new HaskellTokenType("DATA"); - IElementType HS_DECIMAL = new HaskellTokenType("DECIMAL"); - IElementType HS_DEFAULT = new HaskellTokenType("DEFAULT"); - IElementType HS_DERIVING = new HaskellTokenType("DERIVING"); - IElementType HS_DO = new HaskellTokenType("DO"); - IElementType HS_DOT = new HaskellTokenType("DOT"); - IElementType HS_DOUBLE_RIGHT_ARROW = new HaskellTokenType("DOUBLE_RIGHT_ARROW"); - IElementType HS_ELSE = new HaskellTokenType("ELSE"); - IElementType HS_EQUAL = new HaskellTokenType("EQUAL"); - IElementType HS_FLOAT = new HaskellTokenType("FLOAT"); - IElementType HS_FOREIGN_EXPORT = new HaskellTokenType("FOREIGN_EXPORT"); - IElementType HS_FOREIGN_IMPORT = new HaskellTokenType("FOREIGN_IMPORT"); - IElementType HS_HEXADECIMAL = new HaskellTokenType("HEXADECIMAL"); - IElementType HS_IF = new HaskellTokenType("IF"); - IElementType HS_IMPORT = new HaskellTokenType("IMPORT"); - IElementType HS_IN = new HaskellTokenType("IN"); - IElementType HS_INFIX = new HaskellTokenType("INFIX"); - IElementType HS_INFIXL = new HaskellTokenType("INFIXL"); - IElementType HS_INFIXR = new HaskellTokenType("INFIXR"); - IElementType HS_INSTANCE = new HaskellTokenType("INSTANCE"); - IElementType HS_LEFT_ARROW = new HaskellTokenType("LEFT_ARROW"); - IElementType HS_LEFT_BRACE = new HaskellTokenType("LEFT_BRACE"); - IElementType HS_LEFT_BRACKET = new HaskellTokenType("LEFT_BRACKET"); - IElementType HS_LEFT_PAREN = new HaskellTokenType("LEFT_PAREN"); - IElementType HS_LET = new HaskellTokenType("LET"); - IElementType HS_MODULE = new HaskellTokenType("MODULE"); - IElementType HS_NCOMMENT = new HaskellTokenType("NCOMMENT"); - IElementType HS_NCOMMENT_END = new HaskellTokenType("NCOMMENT_END"); - IElementType HS_NCOMMENT_START = new HaskellTokenType("NCOMMENT_START"); - IElementType HS_NEWLINE = new HaskellTokenType("NEWLINE"); - IElementType HS_NEWTYPE = new HaskellTokenType("NEWTYPE"); - IElementType HS_OCTAL = new HaskellTokenType("OCTAL"); - IElementType HS_OF = new HaskellTokenType("OF"); - IElementType HS_PRAGMA_END = new HaskellTokenType("PRAGMA_END"); - IElementType HS_PRAGMA_START = new HaskellTokenType("PRAGMA_START"); - IElementType HS_QUASI_QUOTE_D_START = new HaskellTokenType("QUASI_QUOTE_D_START"); - IElementType HS_QUASI_QUOTE_END = new HaskellTokenType("QUASI_QUOTE_END"); - IElementType HS_QUASI_QUOTE_E_START = new HaskellTokenType("QUASI_QUOTE_E_START"); - IElementType HS_QUASI_QUOTE_P_START = new HaskellTokenType("QUASI_QUOTE_P_START"); - IElementType HS_QUASI_QUOTE_T_START = new HaskellTokenType("QUASI_QUOTE_T_START"); - IElementType HS_QUASI_QUOTE_V_START = new HaskellTokenType("QUASI_QUOTE_V_START"); - IElementType HS_QUOTE = new HaskellTokenType("QUOTE"); - IElementType HS_RIGHT_ARROW = new HaskellTokenType("RIGHT_ARROW"); - IElementType HS_RIGHT_BRACE = new HaskellTokenType("RIGHT_BRACE"); - IElementType HS_RIGHT_BRACKET = new HaskellTokenType("RIGHT_BRACKET"); - IElementType HS_RIGHT_PAREN = new HaskellTokenType("RIGHT_PAREN"); - IElementType HS_SEMICOLON = new HaskellTokenType("SEMICOLON"); - IElementType HS_SHEBANG_LINE = new HaskellTokenType("SHEBANG_LINE"); - IElementType HS_STRING_LITERAL = new HaskellTokenType("STRING_LITERAL"); - IElementType HS_THEN = new HaskellTokenType("THEN"); - IElementType HS_TILDE = new HaskellTokenType("TILDE"); - IElementType HS_TYPE = new HaskellTokenType("TYPE"); - IElementType HS_TYPE_FAMILY = new HaskellTokenType("TYPE_FAMILY"); - IElementType HS_TYPE_INSTANCE = new HaskellTokenType("TYPE_INSTANCE"); - IElementType HS_UNDERSCORE = new HaskellTokenType("UNDERSCORE"); - IElementType HS_VARID_ID = new HaskellTokenType("VARID_ID"); - IElementType HS_VARSYM_ID = new HaskellTokenType("VARSYM_ID"); - IElementType HS_VERTICAL_BAR = new HaskellTokenType("VERTICAL_BAR"); - IElementType HS_WHERE = new HaskellTokenType("WHERE"); - - class Factory { - public static PsiElement createElement(ASTNode node) { - IElementType type = node.getElementType(); - if (type == HS_ANN_PRAGMA) { - return new HaskellAnnPragmaImpl(node); - } - else if (type == HS_CDECL) { - return new HaskellCdeclImpl(node); - } - else if (type == HS_CFILES_PRAGMA) { - return new HaskellCfilesPragmaImpl(node); - } - else if (type == HS_CLASS_DECLARATION) { - return new HaskellClassDeclarationImpl(node); - } - else if (type == HS_CLAZZ) { - return new HaskellClazzImpl(node); - } - else if (type == HS_CNAME) { - return new HaskellCnameImpl(node); - } - else if (type == HS_COMMENTS) { - return new HaskellCommentsImpl(node); - } - else if (type == HS_CONSTR_1) { - return new HaskellConstr1Impl(node); - } - else if (type == HS_CONSTR_2) { - return new HaskellConstr2Impl(node); - } - else if (type == HS_CONSTR_3) { - return new HaskellConstr3Impl(node); - } - else if (type == HS_CONSTR_4) { - return new HaskellConstr4Impl(node); - } - else if (type == HS_CONTEXT) { - return new HaskellContextImpl(node); - } - else if (type == HS_CON_ID) { - return new HaskellConIdImpl(node); - } - else if (type == HS_CON_SYM) { - return new HaskellConSymImpl(node); - } - else if (type == HS_CTYPE_PRAGMA) { - return new HaskellCtypePragmaImpl(node); - } - else if (type == HS_DATA_DECLARATION) { - return new HaskellDataDeclarationImpl(node); - } - else if (type == HS_DATA_DECLARATION_DERIVING) { - return new HaskellDataDeclarationDerivingImpl(node); - } - else if (type == HS_DEFAULT_DECLARATION) { - return new HaskellDefaultDeclarationImpl(node); - } - else if (type == HS_DEPRECATED_WARN_PRAGMA) { - return new HaskellDeprecatedWarnPragmaImpl(node); - } - else if (type == HS_DERIVING_DECLARATION) { - return new HaskellDerivingDeclarationImpl(node); - } - else if (type == HS_DOT_DOT_PARENS) { - return new HaskellDotDotParensImpl(node); - } - else if (type == HS_DUMMY_PRAGMA) { - return new HaskellDummyPragmaImpl(node); - } - else if (type == HS_EXPORT) { - return new HaskellExportImpl(node); - } - else if (type == HS_EXPORTS) { - return new HaskellExportsImpl(node); - } - else if (type == HS_EXPRESSION) { - return new HaskellExpressionImpl(node); - } - else if (type == HS_FIELDDECL) { - return new HaskellFielddeclImpl(node); - } - else if (type == HS_FILE_HEADER) { - return new HaskellFileHeaderImpl(node); - } - else if (type == HS_FILE_HEADER_PRAGMA) { - return new HaskellFileHeaderPragmaImpl(node); - } - else if (type == HS_FIRST_LINE_EXPRESSION) { - return new HaskellFirstLineExpressionImpl(node); - } - else if (type == HS_FIXITY) { - return new HaskellFixityImpl(node); - } - else if (type == HS_FOREIGN_DECLARATION) { - return new HaskellForeignDeclarationImpl(node); - } - else if (type == HS_GCON_SYM) { - return new HaskellGconSymImpl(node); - } - else if (type == HS_GENERAL_PRAGMA_CONTENT) { - return new HaskellGeneralPragmaContentImpl(node); - } - else if (type == HS_GTYCON) { - return new HaskellGtyconImpl(node); - } - else if (type == HS_HADDOCK_PRAGMA) { - return new HaskellHaddockPragmaImpl(node); - } - else if (type == HS_IDECL) { - return new HaskellIdeclImpl(node); - } - else if (type == HS_IMPORT_DECLARATION) { - return new HaskellImportDeclarationImpl(node); - } - else if (type == HS_IMPORT_EMPTY_SPEC) { - return new HaskellImportEmptySpecImpl(node); - } - else if (type == HS_IMPORT_HIDING) { - return new HaskellImportHidingImpl(node); - } - else if (type == HS_IMPORT_HIDING_SPEC) { - return new HaskellImportHidingSpecImpl(node); - } - else if (type == HS_IMPORT_ID) { - return new HaskellImportIdImpl(node); - } - else if (type == HS_IMPORT_IDS_SPEC) { - return new HaskellImportIdsSpecImpl(node); - } - else if (type == HS_IMPORT_MODULE) { - return new HaskellImportModuleImpl(node); - } - else if (type == HS_IMPORT_QUALIFIED) { - return new HaskellImportQualifiedImpl(node); - } - else if (type == HS_IMPORT_QUALIFIED_AS) { - return new HaskellImportQualifiedAsImpl(node); - } - else if (type == HS_IMPORT_SPEC) { - return new HaskellImportSpecImpl(node); - } - else if (type == HS_INCLUDE_PRAGMA) { - return new HaskellIncludePragmaImpl(node); - } - else if (type == HS_INLINABLE_PRAGMA) { - return new HaskellInlinablePragmaImpl(node); - } - else if (type == HS_INLINE_PRAGMA) { - return new HaskellInlinePragmaImpl(node); - } - else if (type == HS_INST) { - return new HaskellInstImpl(node); - } - else if (type == HS_INSTANCE_DECLARATION) { - return new HaskellInstanceDeclarationImpl(node); - } - else if (type == HS_INSTVAR) { - return new HaskellInstvarImpl(node); - } - else if (type == HS_KIND_SIGNATURE) { - return new HaskellKindSignatureImpl(node); - } - else if (type == HS_LANGUAGE_PRAGMA) { - return new HaskellLanguagePragmaImpl(node); - } - else if (type == HS_LAST_LINE_EXPRESSION) { - return new HaskellLastLineExpressionImpl(node); - } - else if (type == HS_LINE_EXPRESSION) { - return new HaskellLineExpressionImpl(node); - } - else if (type == HS_LINE_PRAGMA) { - return new HaskellLinePragmaImpl(node); - } - else if (type == HS_LITERAL) { - return new HaskellLiteralImpl(node); - } - else if (type == HS_MINIMAL_PRAGMA) { - return new HaskellMinimalPragmaImpl(node); - } - else if (type == HS_MODULE_BODY) { - return new HaskellModuleBodyImpl(node); - } - else if (type == HS_MODULE_DECLARATION) { - return new HaskellModuleDeclarationImpl(node); - } - else if (type == HS_MOD_ID) { - return new HaskellModIdImpl(node); - } - else if (type == HS_NEWCONSTR) { - return new HaskellNewconstrImpl(node); - } - else if (type == HS_NEWCONSTR_FIELDDECL) { - return new HaskellNewconstrFielddeclImpl(node); - } - else if (type == HS_NEWTYPE_DECLARATION) { - return new HaskellNewtypeDeclarationImpl(node); - } - else if (type == HS_NOINLINE_PRAGMA) { - return new HaskellNoinlinePragmaImpl(node); - } - else if (type == HS_NOUNPACK_PRAGMA) { - return new HaskellNounpackPragmaImpl(node); - } - else if (type == HS_OP) { - return new HaskellOpImpl(node); - } - else if (type == HS_OPS) { - return new HaskellOpsImpl(node); - } - else if (type == HS_OPTIONS_GHC_PRAGMA) { - return new HaskellOptionsGhcPragmaImpl(node); - } - else if (type == HS_OTHER_PRAGMA) { - return new HaskellOtherPragmaImpl(node); - } - else if (type == HS_OVERLAP_PRAGMA) { - return new HaskellOverlapPragmaImpl(node); - } - else if (type == HS_PARALLEL_ARRAY_TYPE) { - return new HaskellParallelArrayTypeImpl(node); - } - else if (type == HS_QCON) { - return new HaskellQconImpl(node); - } - else if (type == HS_QCON_ID) { - return new HaskellQconIdImpl(node); - } - else if (type == HS_QCON_ID_QUALIFIER) { - return new HaskellQconIdQualifierImpl(node); - } - else if (type == HS_QCON_OP) { - return new HaskellQconOpImpl(node); - } - else if (type == HS_QCON_SYM) { - return new HaskellQconSymImpl(node); - } - else if (type == HS_QQ_EXPRESSION) { - return new HaskellQqExpressionImpl(node); - } - else if (type == HS_QUALIFIER) { - return new HaskellQualifierImpl(node); - } - else if (type == HS_QUASI_QUOTE) { - return new HaskellQuasiQuoteImpl(node); - } - else if (type == HS_QVAR) { - return new HaskellQvarImpl(node); - } - else if (type == HS_QVAR_ID) { - return new HaskellQvarIdImpl(node); - } - else if (type == HS_QVAR_OP) { - return new HaskellQvarOpImpl(node); - } - else if (type == HS_QVAR_SYM) { - return new HaskellQvarSymImpl(node); - } - else if (type == HS_RULES_PRAGMA) { - return new HaskellRulesPragmaImpl(node); - } - else if (type == HS_SCONTEXT) { - return new HaskellScontextImpl(node); - } - else if (type == HS_SIMPLECLASS) { - return new HaskellSimpleclassImpl(node); - } - else if (type == HS_SIMPLECLASS_TILDE_PART) { - return new HaskellSimpleclassTildePartImpl(node); - } - else if (type == HS_SIMPLETYPE) { - return new HaskellSimpletypeImpl(node); - } - else if (type == HS_SNL) { - return new HaskellSnlImpl(node); - } - else if (type == HS_SOURCE_PRAGMA) { - return new HaskellSourcePragmaImpl(node); - } - else if (type == HS_SPECIALIZE_PRAGMA) { - return new HaskellSpecializePragmaImpl(node); - } - else if (type == HS_SUB_CONSTR_2) { - return new HaskellSubConstr2Impl(node); - } - else if (type == HS_TOP_DECLARATION) { - return new HaskellTopDeclarationImpl(node); - } - else if (type == HS_TTYPE) { - return new HaskellTtypeImpl(node); - } - else if (type == HS_TYPE_DECLARATION) { - return new HaskellTypeDeclarationImpl(node); - } - else if (type == HS_TYPE_FAMILY_DECLARATION) { - return new HaskellTypeFamilyDeclarationImpl(node); - } - else if (type == HS_TYPE_FAMILY_TYPE) { - return new HaskellTypeFamilyTypeImpl(node); - } - else if (type == HS_TYPE_FAMILY_TYPE_1) { - return new HaskellTypeFamilyType1Impl(node); - } - else if (type == HS_TYPE_FAMILY_TYPE_2) { - return new HaskellTypeFamilyType2Impl(node); - } - else if (type == HS_TYPE_INSTANCE_DECLARATION) { - return new HaskellTypeInstanceDeclarationImpl(node); - } - else if (type == HS_TYPE_SIGNATURE) { - return new HaskellTypeSignatureImpl(node); - } - else if (type == HS_UNPACK_NOUNPACK_PRAGMA) { - return new HaskellUnpackNounpackPragmaImpl(node); - } - else if (type == HS_UNPACK_PRAGMA) { - return new HaskellUnpackPragmaImpl(node); - } - else if (type == HS_VARS) { - return new HaskellVarsImpl(node); - } - else if (type == HS_VAR_ID) { - return new HaskellVarIdImpl(node); - } - else if (type == HS_VAR_SYM) { - return new HaskellVarSymImpl(node); - } - throw new AssertionError("Unknown element type: " + type); - } - } -} diff --git a/intellij/haskell/psi/HaskellUnpackNounpackPragma.java b/intellij/haskell/psi/HaskellUnpackNounpackPragma.java deleted file mode 100644 index 1b99a96b..00000000 --- a/intellij/haskell/psi/HaskellUnpackNounpackPragma.java +++ /dev/null @@ -1,16 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellUnpackNounpackPragma extends HaskellCompositeElement { - - @Nullable - HaskellNounpackPragma getNounpackPragma(); - - @Nullable - HaskellUnpackPragma getUnpackPragma(); - -} diff --git a/intellij/haskell/psi/HaskellUnpackPragma.java b/intellij/haskell/psi/HaskellUnpackPragma.java deleted file mode 100644 index db639476..00000000 --- a/intellij/haskell/psi/HaskellUnpackPragma.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellUnpackPragma extends HaskellCompositeElement { - -} diff --git a/intellij/haskell/psi/HaskellVarId.java b/intellij/haskell/psi/HaskellVarId.java deleted file mode 100644 index 6cc509cd..00000000 --- a/intellij/haskell/psi/HaskellVarId.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellVarId extends HaskellNamedElement { - -} diff --git a/intellij/haskell/psi/HaskellVarSym.java b/intellij/haskell/psi/HaskellVarSym.java deleted file mode 100644 index fb45bb02..00000000 --- a/intellij/haskell/psi/HaskellVarSym.java +++ /dev/null @@ -1,10 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellVarSym extends HaskellNamedElement { - -} diff --git a/intellij/haskell/psi/HaskellVars.java b/intellij/haskell/psi/HaskellVars.java deleted file mode 100644 index b02f1d6a..00000000 --- a/intellij/haskell/psi/HaskellVars.java +++ /dev/null @@ -1,13 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElement; - -public interface HaskellVars extends HaskellCompositeElement { - - @NotNull - List getQvarList(); - -} diff --git a/intellij/haskell/psi/HaskellVisitor.java b/intellij/haskell/psi/HaskellVisitor.java deleted file mode 100644 index 647f14dd..00000000 --- a/intellij/haskell/psi/HaskellVisitor.java +++ /dev/null @@ -1,465 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi; - -import org.jetbrains.annotations.*; -import com.intellij.psi.PsiElementVisitor; - -public class HaskellVisitor extends PsiElementVisitor { - - public void visitAnnPragma(@NotNull HaskellAnnPragma o) { - visitCompositeElement(o); - } - - public void visitCdecl(@NotNull HaskellCdecl o) { - visitCompositeElement(o); - } - - public void visitCfilesPragma(@NotNull HaskellCfilesPragma o) { - visitCompositeElement(o); - } - - public void visitClassDeclaration(@NotNull HaskellClassDeclaration o) { - visitDeclarationElement(o); - } - - public void visitClazz(@NotNull HaskellClazz o) { - visitCompositeElement(o); - } - - public void visitCname(@NotNull HaskellCname o) { - visitCompositeElement(o); - } - - public void visitComments(@NotNull HaskellComments o) { - visitCompositeElement(o); - } - - public void visitConId(@NotNull HaskellConId o) { - visitNamedElement(o); - } - - public void visitConSym(@NotNull HaskellConSym o) { - visitNamedElement(o); - } - - public void visitConstr1(@NotNull HaskellConstr1 o) { - visitCompositeElement(o); - } - - public void visitConstr2(@NotNull HaskellConstr2 o) { - visitCompositeElement(o); - } - - public void visitConstr3(@NotNull HaskellConstr3 o) { - visitCompositeElement(o); - } - - public void visitConstr4(@NotNull HaskellConstr4 o) { - visitCompositeElement(o); - } - - public void visitContext(@NotNull HaskellContext o) { - visitCompositeElement(o); - } - - public void visitCtypePragma(@NotNull HaskellCtypePragma o) { - visitCompositeElement(o); - } - - public void visitDataDeclaration(@NotNull HaskellDataDeclaration o) { - visitDataConstructorDeclarationElement(o); - } - - public void visitDataDeclarationDeriving(@NotNull HaskellDataDeclarationDeriving o) { - visitCompositeElement(o); - } - - public void visitDefaultDeclaration(@NotNull HaskellDefaultDeclaration o) { - visitDeclarationElement(o); - } - - public void visitDeprecatedWarnPragma(@NotNull HaskellDeprecatedWarnPragma o) { - visitCompositeElement(o); - } - - public void visitDerivingDeclaration(@NotNull HaskellDerivingDeclaration o) { - visitDeclarationElement(o); - } - - public void visitDotDotParens(@NotNull HaskellDotDotParens o) { - visitCompositeElement(o); - } - - public void visitDummyPragma(@NotNull HaskellDummyPragma o) { - visitCompositeElement(o); - } - - public void visitExport(@NotNull HaskellExport o) { - visitCompositeElement(o); - } - - public void visitExports(@NotNull HaskellExports o) { - visitCompositeElement(o); - } - - public void visitExpression(@NotNull HaskellExpression o) { - visitCompositeElement(o); - } - - public void visitFielddecl(@NotNull HaskellFielddecl o) { - visitCompositeElement(o); - } - - public void visitFileHeader(@NotNull HaskellFileHeader o) { - visitCompositeElement(o); - } - - public void visitFileHeaderPragma(@NotNull HaskellFileHeaderPragma o) { - visitCompositeElement(o); - } - - public void visitFirstLineExpression(@NotNull HaskellFirstLineExpression o) { - visitLineExpressionElement(o); - } - - public void visitFixity(@NotNull HaskellFixity o) { - visitCompositeElement(o); - } - - public void visitForeignDeclaration(@NotNull HaskellForeignDeclaration o) { - visitDeclarationElement(o); - } - - public void visitGconSym(@NotNull HaskellGconSym o) { - visitCompositeElement(o); - } - - public void visitGeneralPragmaContent(@NotNull HaskellGeneralPragmaContent o) { - visitCompositeElement(o); - } - - public void visitGtycon(@NotNull HaskellGtycon o) { - visitCompositeElement(o); - } - - public void visitHaddockPragma(@NotNull HaskellHaddockPragma o) { - visitCompositeElement(o); - } - - public void visitIdecl(@NotNull HaskellIdecl o) { - visitCompositeElement(o); - } - - public void visitImportDeclaration(@NotNull HaskellImportDeclaration o) { - visitCompositeElement(o); - } - - public void visitImportEmptySpec(@NotNull HaskellImportEmptySpec o) { - visitCompositeElement(o); - } - - public void visitImportHiding(@NotNull HaskellImportHiding o) { - visitCompositeElement(o); - } - - public void visitImportHidingSpec(@NotNull HaskellImportHidingSpec o) { - visitCompositeElement(o); - } - - public void visitImportId(@NotNull HaskellImportId o) { - visitCompositeElement(o); - } - - public void visitImportIdsSpec(@NotNull HaskellImportIdsSpec o) { - visitCompositeElement(o); - } - - public void visitImportModule(@NotNull HaskellImportModule o) { - visitCompositeElement(o); - } - - public void visitImportQualified(@NotNull HaskellImportQualified o) { - visitCompositeElement(o); - } - - public void visitImportQualifiedAs(@NotNull HaskellImportQualifiedAs o) { - visitCompositeElement(o); - } - - public void visitImportSpec(@NotNull HaskellImportSpec o) { - visitCompositeElement(o); - } - - public void visitIncludePragma(@NotNull HaskellIncludePragma o) { - visitCompositeElement(o); - } - - public void visitInlinablePragma(@NotNull HaskellInlinablePragma o) { - visitCompositeElement(o); - } - - public void visitInlinePragma(@NotNull HaskellInlinePragma o) { - visitCompositeElement(o); - } - - public void visitInst(@NotNull HaskellInst o) { - visitCompositeElement(o); - } - - public void visitInstanceDeclaration(@NotNull HaskellInstanceDeclaration o) { - visitDeclarationElement(o); - } - - public void visitInstvar(@NotNull HaskellInstvar o) { - visitCompositeElement(o); - } - - public void visitKindSignature(@NotNull HaskellKindSignature o) { - visitCompositeElement(o); - } - - public void visitLanguagePragma(@NotNull HaskellLanguagePragma o) { - visitCompositeElement(o); - } - - public void visitLastLineExpression(@NotNull HaskellLastLineExpression o) { - visitLineExpressionElement(o); - } - - public void visitLineExpression(@NotNull HaskellLineExpression o) { - visitLineExpressionElement(o); - } - - public void visitLinePragma(@NotNull HaskellLinePragma o) { - visitCompositeElement(o); - } - - public void visitLiteral(@NotNull HaskellLiteral o) { - visitCompositeElement(o); - } - - public void visitMinimalPragma(@NotNull HaskellMinimalPragma o) { - visitCompositeElement(o); - } - - public void visitModId(@NotNull HaskellModId o) { - visitNamedElement(o); - } - - public void visitModuleBody(@NotNull HaskellModuleBody o) { - visitCompositeElement(o); - } - - public void visitModuleDeclaration(@NotNull HaskellModuleDeclaration o) { - visitDeclarationElement(o); - } - - public void visitNewconstr(@NotNull HaskellNewconstr o) { - visitCompositeElement(o); - } - - public void visitNewconstrFielddecl(@NotNull HaskellNewconstrFielddecl o) { - visitCompositeElement(o); - } - - public void visitNewtypeDeclaration(@NotNull HaskellNewtypeDeclaration o) { - visitDataConstructorDeclarationElement(o); - } - - public void visitNoinlinePragma(@NotNull HaskellNoinlinePragma o) { - visitCompositeElement(o); - } - - public void visitNounpackPragma(@NotNull HaskellNounpackPragma o) { - visitCompositeElement(o); - } - - public void visitOp(@NotNull HaskellOp o) { - visitCompositeElement(o); - } - - public void visitOps(@NotNull HaskellOps o) { - visitCompositeElement(o); - } - - public void visitOptionsGhcPragma(@NotNull HaskellOptionsGhcPragma o) { - visitCompositeElement(o); - } - - public void visitOtherPragma(@NotNull HaskellOtherPragma o) { - visitCompositeElement(o); - } - - public void visitOverlapPragma(@NotNull HaskellOverlapPragma o) { - visitCompositeElement(o); - } - - public void visitParallelArrayType(@NotNull HaskellParallelArrayType o) { - visitCompositeElement(o); - } - - public void visitQcon(@NotNull HaskellQcon o) { - visitQVarConOpElement(o); - } - - public void visitQconId(@NotNull HaskellQconId o) { - visitCompositeElement(o); - } - - public void visitQconIdQualifier(@NotNull HaskellQconIdQualifier o) { - visitCompositeElement(o); - } - - public void visitQconOp(@NotNull HaskellQconOp o) { - visitQVarConOpElement(o); - } - - public void visitQconSym(@NotNull HaskellQconSym o) { - visitCompositeElement(o); - } - - public void visitQqExpression(@NotNull HaskellQqExpression o) { - visitCompositeElement(o); - } - - public void visitQualifier(@NotNull HaskellQualifier o) { - visitNamedElement(o); - } - - public void visitQuasiQuote(@NotNull HaskellQuasiQuote o) { - visitCompositeElement(o); - } - - public void visitQvar(@NotNull HaskellQvar o) { - visitQVarConOpElement(o); - } - - public void visitQvarId(@NotNull HaskellQvarId o) { - visitCompositeElement(o); - } - - public void visitQvarOp(@NotNull HaskellQvarOp o) { - visitQVarConOpElement(o); - } - - public void visitQvarSym(@NotNull HaskellQvarSym o) { - visitCompositeElement(o); - } - - public void visitRulesPragma(@NotNull HaskellRulesPragma o) { - visitCompositeElement(o); - } - - public void visitScontext(@NotNull HaskellScontext o) { - visitCompositeElement(o); - } - - public void visitSimpleclass(@NotNull HaskellSimpleclass o) { - visitCompositeElement(o); - } - - public void visitSimpleclassTildePart(@NotNull HaskellSimpleclassTildePart o) { - visitCompositeElement(o); - } - - public void visitSimpletype(@NotNull HaskellSimpletype o) { - visitCompositeElement(o); - } - - public void visitSnl(@NotNull HaskellSnl o) { - visitCompositeElement(o); - } - - public void visitSourcePragma(@NotNull HaskellSourcePragma o) { - visitCompositeElement(o); - } - - public void visitSpecializePragma(@NotNull HaskellSpecializePragma o) { - visitCompositeElement(o); - } - - public void visitSubConstr2(@NotNull HaskellSubConstr2 o) { - visitCompositeElement(o); - } - - public void visitTopDeclaration(@NotNull HaskellTopDeclaration o) { - visitCompositeElement(o); - } - - public void visitTtype(@NotNull HaskellTtype o) { - visitCompositeElement(o); - } - - public void visitTypeDeclaration(@NotNull HaskellTypeDeclaration o) { - visitDeclarationElement(o); - } - - public void visitTypeFamilyDeclaration(@NotNull HaskellTypeFamilyDeclaration o) { - visitDeclarationElement(o); - } - - public void visitTypeFamilyType(@NotNull HaskellTypeFamilyType o) { - visitCompositeElement(o); - } - - public void visitTypeFamilyType1(@NotNull HaskellTypeFamilyType1 o) { - visitCompositeElement(o); - } - - public void visitTypeFamilyType2(@NotNull HaskellTypeFamilyType2 o) { - visitCompositeElement(o); - } - - public void visitTypeInstanceDeclaration(@NotNull HaskellTypeInstanceDeclaration o) { - visitDeclarationElement(o); - } - - public void visitTypeSignature(@NotNull HaskellTypeSignature o) { - visitDeclarationElement(o); - } - - public void visitUnpackNounpackPragma(@NotNull HaskellUnpackNounpackPragma o) { - visitCompositeElement(o); - } - - public void visitUnpackPragma(@NotNull HaskellUnpackPragma o) { - visitCompositeElement(o); - } - - public void visitVarId(@NotNull HaskellVarId o) { - visitNamedElement(o); - } - - public void visitVarSym(@NotNull HaskellVarSym o) { - visitNamedElement(o); - } - - public void visitVars(@NotNull HaskellVars o) { - visitCompositeElement(o); - } - - public void visitDataConstructorDeclarationElement(@NotNull HaskellDataConstructorDeclarationElement o) { - visitCompositeElement(o); - } - - public void visitDeclarationElement(@NotNull HaskellDeclarationElement o) { - visitCompositeElement(o); - } - - public void visitLineExpressionElement(@NotNull HaskellLineExpressionElement o) { - visitCompositeElement(o); - } - - public void visitNamedElement(@NotNull HaskellNamedElement o) { - visitCompositeElement(o); - } - - public void visitQVarConOpElement(@NotNull HaskellQVarConOpElement o) { - visitCompositeElement(o); - } - - public void visitCompositeElement(@NotNull HaskellCompositeElement o) { - visitElement(o); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellCdeclImpl.java b/intellij/haskell/psi/impl/HaskellCdeclImpl.java deleted file mode 100644 index 16851c9c..00000000 --- a/intellij/haskell/psi/impl/HaskellCdeclImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellCdeclImpl extends HaskellCompositeElementImpl implements HaskellCdecl { - - public HaskellCdeclImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitCdecl(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellDataDeclaration getDataDeclaration() { - return findChildByClass(HaskellDataDeclaration.class); - } - - @Override - @Nullable - public HaskellDefaultDeclaration getDefaultDeclaration() { - return findChildByClass(HaskellDefaultDeclaration.class); - } - - @Override - @Nullable - public HaskellInlinePragma getInlinePragma() { - return findChildByClass(HaskellInlinePragma.class); - } - - @Override - @Nullable - public HaskellInstanceDeclaration getInstanceDeclaration() { - return findChildByClass(HaskellInstanceDeclaration.class); - } - - @Override - @Nullable - public HaskellMinimalPragma getMinimalPragma() { - return findChildByClass(HaskellMinimalPragma.class); - } - - @Override - @Nullable - public HaskellNewtypeDeclaration getNewtypeDeclaration() { - return findChildByClass(HaskellNewtypeDeclaration.class); - } - - @Override - @Nullable - public HaskellNoinlinePragma getNoinlinePragma() { - return findChildByClass(HaskellNoinlinePragma.class); - } - - @Override - @Nullable - public HaskellSpecializePragma getSpecializePragma() { - return findChildByClass(HaskellSpecializePragma.class); - } - - @Override - @Nullable - public HaskellTypeDeclaration getTypeDeclaration() { - return findChildByClass(HaskellTypeDeclaration.class); - } - - @Override - @Nullable - public HaskellTypeSignature getTypeSignature() { - return findChildByClass(HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellCfilesPragmaImpl.java b/intellij/haskell/psi/impl/HaskellCfilesPragmaImpl.java deleted file mode 100644 index 65a60f24..00000000 --- a/intellij/haskell/psi/impl/HaskellCfilesPragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellCfilesPragmaImpl extends HaskellCompositeElementImpl implements HaskellCfilesPragma { - - public HaskellCfilesPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitCfilesPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellClassDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellClassDeclarationImpl.java deleted file mode 100644 index ba04972b..00000000 --- a/intellij/haskell/psi/impl/HaskellClassDeclarationImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellClassDeclarationImpl extends HaskellCompositeElementImpl implements HaskellClassDeclaration { - - public HaskellClassDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitClassDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCdeclList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCdecl.class); - } - - @Override - @Nullable - public HaskellContext getContext() { - return findChildByClass(HaskellContext.class); - } - - @Override - @NotNull - public List getExpressionList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellExpression.class); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @Nullable - public HaskellScontext getScontext() { - return findChildByClass(HaskellScontext.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellClazzImpl.java b/intellij/haskell/psi/impl/HaskellClazzImpl.java deleted file mode 100644 index 81b12153..00000000 --- a/intellij/haskell/psi/impl/HaskellClazzImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellClazzImpl extends HaskellCompositeElementImpl implements HaskellClazz { - - public HaskellClazzImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitClazz(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCnameList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCname.class); - } - - @Override - @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellCnameImpl.java b/intellij/haskell/psi/impl/HaskellCnameImpl.java deleted file mode 100644 index 0553e7ac..00000000 --- a/intellij/haskell/psi/impl/HaskellCnameImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellCnameImpl extends HaskellCompositeElementImpl implements HaskellCname { - - public HaskellCnameImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitCname(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQconOp getQconOp() { - return findChildByClass(HaskellQconOp.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellCommentsImpl.java b/intellij/haskell/psi/impl/HaskellCommentsImpl.java deleted file mode 100644 index d9c7d0bd..00000000 --- a/intellij/haskell/psi/impl/HaskellCommentsImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellCommentsImpl extends HaskellCompositeElementImpl implements HaskellComments { - - public HaskellCommentsImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitComments(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellConIdImpl.java b/intellij/haskell/psi/impl/HaskellConIdImpl.java deleted file mode 100644 index d59bcd74..00000000 --- a/intellij/haskell/psi/impl/HaskellConIdImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellConIdImpl extends HaskellNamedElementImpl implements HaskellConId { - - public HaskellConIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellVarId getVarId() { - return findChildByClass(HaskellVarId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellConSymImpl.java b/intellij/haskell/psi/impl/HaskellConSymImpl.java deleted file mode 100644 index 854a6b4a..00000000 --- a/intellij/haskell/psi/impl/HaskellConSymImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellConSymImpl extends HaskellNamedElementImpl implements HaskellConSym { - - public HaskellConSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellConstr1Impl.java b/intellij/haskell/psi/impl/HaskellConstr1Impl.java deleted file mode 100644 index 21a01523..00000000 --- a/intellij/haskell/psi/impl/HaskellConstr1Impl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellConstr1Impl extends HaskellCompositeElementImpl implements HaskellConstr1 { - - public HaskellConstr1Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConstr1(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFielddeclList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFielddecl.class); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public List getUnpackNounpackPragmaList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellUnpackNounpackPragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellConstr2Impl.java b/intellij/haskell/psi/impl/HaskellConstr2Impl.java deleted file mode 100644 index 58458dde..00000000 --- a/intellij/haskell/psi/impl/HaskellConstr2Impl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellConstr2Impl extends HaskellCompositeElementImpl implements HaskellConstr2 { - - public HaskellConstr2Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConstr2(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQconOp getQconOp() { - return findNotNullChildByClass(HaskellQconOp.class); - } - - @Override - @NotNull - public List getSubConstr2List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSubConstr2.class); - } - - @Override - @NotNull - public List getUnpackNounpackPragmaList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellUnpackNounpackPragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellConstr3Impl.java b/intellij/haskell/psi/impl/HaskellConstr3Impl.java deleted file mode 100644 index da8be0b2..00000000 --- a/intellij/haskell/psi/impl/HaskellConstr3Impl.java +++ /dev/null @@ -1,76 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellConstr3Impl extends HaskellCompositeElementImpl implements HaskellConstr3 { - - public HaskellConstr3Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConstr3(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCnameList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCname.class); - } - - @Override - @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - - @Override - @NotNull - public List getUnpackNounpackPragmaList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellUnpackNounpackPragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellConstr4Impl.java b/intellij/haskell/psi/impl/HaskellConstr4Impl.java deleted file mode 100644 index 3eba959a..00000000 --- a/intellij/haskell/psi/impl/HaskellConstr4Impl.java +++ /dev/null @@ -1,52 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellConstr4Impl extends HaskellCompositeElementImpl implements HaskellConstr4 { - - public HaskellConstr4Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitConstr4(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGconSym getGconSym() { - return findNotNullChildByClass(HaskellGconSym.class); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public HaskellQvar getQvar() { - return findNotNullChildByClass(HaskellQvar.class); - } - - @Override - @NotNull - public List getUnpackNounpackPragmaList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellUnpackNounpackPragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellContextImpl.java b/intellij/haskell/psi/impl/HaskellContextImpl.java deleted file mode 100644 index 0b368c97..00000000 --- a/intellij/haskell/psi/impl/HaskellContextImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellContextImpl extends HaskellCompositeElementImpl implements HaskellContext { - - public HaskellContextImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitContext(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getClazzList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellClazz.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellCtypePragmaImpl.java b/intellij/haskell/psi/impl/HaskellCtypePragmaImpl.java deleted file mode 100644 index ff99beb8..00000000 --- a/intellij/haskell/psi/impl/HaskellCtypePragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellCtypePragmaImpl extends HaskellCompositeElementImpl implements HaskellCtypePragma { - - public HaskellCtypePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitCtypePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellDataDeclarationDerivingImpl.java b/intellij/haskell/psi/impl/HaskellDataDeclarationDerivingImpl.java deleted file mode 100644 index 832b72d5..00000000 --- a/intellij/haskell/psi/impl/HaskellDataDeclarationDerivingImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellDataDeclarationDerivingImpl extends HaskellCompositeElementImpl implements HaskellDataDeclarationDeriving { - - public HaskellDataDeclarationDerivingImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitDataDeclarationDeriving(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellDataDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellDataDeclarationImpl.java deleted file mode 100644 index 52122f35..00000000 --- a/intellij/haskell/psi/impl/HaskellDataDeclarationImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellDataDeclarationImpl extends HaskellCompositeElementImpl implements HaskellDataDeclaration { - - public HaskellDataDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitDataDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCdeclList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCdecl.class); - } - - @Override - @NotNull - public List getConstr1List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellConstr1.class); - } - - @Override - @NotNull - public List getConstr2List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellConstr2.class); - } - - @Override - @NotNull - public List getConstr3List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellConstr3.class); - } - - @Override - @NotNull - public List getConstr4List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellConstr4.class); - } - - @Override - @Nullable - public HaskellContext getContext() { - return findChildByClass(HaskellContext.class); - } - - @Override - @Nullable - public HaskellCtypePragma getCtypePragma() { - return findChildByClass(HaskellCtypePragma.class); - } - - @Override - @Nullable - public HaskellDataDeclarationDeriving getDataDeclarationDeriving() { - return findChildByClass(HaskellDataDeclarationDeriving.class); - } - - @Override - @NotNull - public List getExpressionList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellExpression.class); - } - - @Override - @Nullable - public HaskellKindSignature getKindSignature() { - return findChildByClass(HaskellKindSignature.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getSimpletypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSimpletype.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellDefaultDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellDefaultDeclarationImpl.java deleted file mode 100644 index cbcf0a24..00000000 --- a/intellij/haskell/psi/impl/HaskellDefaultDeclarationImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellDefaultDeclarationImpl extends HaskellCompositeElementImpl implements HaskellDefaultDeclaration { - - public HaskellDefaultDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitDefaultDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @Nullable - public HaskellTypeSignature getTypeSignature() { - return findChildByClass(HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellDeprecatedWarnPragmaImpl.java b/intellij/haskell/psi/impl/HaskellDeprecatedWarnPragmaImpl.java deleted file mode 100644 index de528430..00000000 --- a/intellij/haskell/psi/impl/HaskellDeprecatedWarnPragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellDeprecatedWarnPragmaImpl extends HaskellCompositeElementImpl implements HaskellDeprecatedWarnPragma { - - public HaskellDeprecatedWarnPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitDeprecatedWarnPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellDerivingDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellDerivingDeclarationImpl.java deleted file mode 100644 index 9fba5f20..00000000 --- a/intellij/haskell/psi/impl/HaskellDerivingDeclarationImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellDerivingDeclarationImpl extends HaskellCompositeElementImpl implements HaskellDerivingDeclaration { - - public HaskellDerivingDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitDerivingDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellInst getInst() { - return findNotNullChildByClass(HaskellInst.class); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellScontext getScontext() { - return findChildByClass(HaskellScontext.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellDotDotParensImpl.java b/intellij/haskell/psi/impl/HaskellDotDotParensImpl.java deleted file mode 100644 index 9eb24c44..00000000 --- a/intellij/haskell/psi/impl/HaskellDotDotParensImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellDotDotParensImpl extends HaskellCompositeElementImpl implements HaskellDotDotParens { - - public HaskellDotDotParensImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitDotDotParens(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellDummyPragmaImpl.java b/intellij/haskell/psi/impl/HaskellDummyPragmaImpl.java deleted file mode 100644 index bee3e2c8..00000000 --- a/intellij/haskell/psi/impl/HaskellDummyPragmaImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellDummyPragmaImpl extends HaskellCompositeElementImpl implements HaskellDummyPragma { - - public HaskellDummyPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitDummyPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellExportImpl.java b/intellij/haskell/psi/impl/HaskellExportImpl.java deleted file mode 100644 index 37664452..00000000 --- a/intellij/haskell/psi/impl/HaskellExportImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellExportImpl extends HaskellCompositeElementImpl implements HaskellExport { - - public HaskellExportImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitExport(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCnameList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCname.class); - } - - @Override - @Nullable - public HaskellDotDotParens getDotDotParens() { - return findChildByClass(HaskellDotDotParens.class); - } - - @Override - @Nullable - public HaskellModId getModId() { - return findChildByClass(HaskellModId.class); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellExportsImpl.java b/intellij/haskell/psi/impl/HaskellExportsImpl.java deleted file mode 100644 index e2f23ab4..00000000 --- a/intellij/haskell/psi/impl/HaskellExportsImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellExportsImpl extends HaskellCompositeElementImpl implements HaskellExports { - - public HaskellExportsImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitExports(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getExportList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellExport.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellExpressionImpl.java b/intellij/haskell/psi/impl/HaskellExpressionImpl.java deleted file mode 100644 index 9766328a..00000000 --- a/intellij/haskell/psi/impl/HaskellExpressionImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellExpressionImpl extends HaskellCompositeElementImpl implements HaskellExpression { - - public HaskellExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellFirstLineExpression getFirstLineExpression() { - return findChildByClass(HaskellFirstLineExpression.class); - } - - @Override - @NotNull - public HaskellLastLineExpression getLastLineExpression() { - return findNotNullChildByClass(HaskellLastLineExpression.class); - } - - @Override - @NotNull - public List getLineExpressionList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLineExpression.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellFielddeclImpl.java b/intellij/haskell/psi/impl/HaskellFielddeclImpl.java deleted file mode 100644 index 14b968f1..00000000 --- a/intellij/haskell/psi/impl/HaskellFielddeclImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellFielddeclImpl extends HaskellCompositeElementImpl implements HaskellFielddecl { - - public HaskellFielddeclImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitFielddecl(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellCname getCname() { - return findChildByClass(HaskellCname.class); - } - - @Override - @Nullable - public HaskellGtycon getGtycon() { - return findChildByClass(HaskellGtycon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - - @Override - @Nullable - public HaskellUnpackNounpackPragma getUnpackNounpackPragma() { - return findChildByClass(HaskellUnpackNounpackPragma.class); - } - - @Override - @NotNull - public HaskellVars getVars() { - return findNotNullChildByClass(HaskellVars.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellFileHeaderImpl.java b/intellij/haskell/psi/impl/HaskellFileHeaderImpl.java deleted file mode 100644 index 4dec4aa2..00000000 --- a/intellij/haskell/psi/impl/HaskellFileHeaderImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellFileHeaderImpl extends HaskellCompositeElementImpl implements HaskellFileHeader { - - public HaskellFileHeaderImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitFileHeader(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFileHeaderPragmaList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFileHeaderPragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellFileHeaderPragmaImpl.java b/intellij/haskell/psi/impl/HaskellFileHeaderPragmaImpl.java deleted file mode 100644 index b03c90fe..00000000 --- a/intellij/haskell/psi/impl/HaskellFileHeaderPragmaImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellFileHeaderPragmaImpl extends HaskellCompositeElementImpl implements HaskellFileHeaderPragma { - - public HaskellFileHeaderPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitFileHeaderPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellAnnPragma getAnnPragma() { - return findChildByClass(HaskellAnnPragma.class); - } - - @Override - @Nullable - public HaskellDummyPragma getDummyPragma() { - return findChildByClass(HaskellDummyPragma.class); - } - - @Override - @Nullable - public HaskellHaddockPragma getHaddockPragma() { - return findChildByClass(HaskellHaddockPragma.class); - } - - @Override - @Nullable - public HaskellIncludePragma getIncludePragma() { - return findChildByClass(HaskellIncludePragma.class); - } - - @Override - @Nullable - public HaskellLanguagePragma getLanguagePragma() { - return findChildByClass(HaskellLanguagePragma.class); - } - - @Override - @Nullable - public HaskellOptionsGhcPragma getOptionsGhcPragma() { - return findChildByClass(HaskellOptionsGhcPragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellFirstLineExpressionImpl.java b/intellij/haskell/psi/impl/HaskellFirstLineExpressionImpl.java deleted file mode 100644 index ba5f31ed..00000000 --- a/intellij/haskell/psi/impl/HaskellFirstLineExpressionImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellFirstLineExpressionImpl extends HaskellLineExpressionElementImpl implements HaskellFirstLineExpression { - - public HaskellFirstLineExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitFirstLineExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - - @Override - @NotNull - public HaskellSnl getSnl() { - return findNotNullChildByClass(HaskellSnl.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellFixityImpl.java b/intellij/haskell/psi/impl/HaskellFixityImpl.java deleted file mode 100644 index 4b95c4a8..00000000 --- a/intellij/haskell/psi/impl/HaskellFixityImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellFixityImpl extends HaskellCompositeElementImpl implements HaskellFixity { - - public HaskellFixityImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitFixity(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellForeignDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellForeignDeclarationImpl.java deleted file mode 100644 index 0d6e1425..00000000 --- a/intellij/haskell/psi/impl/HaskellForeignDeclarationImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellForeignDeclarationImpl extends HaskellCompositeElementImpl implements HaskellForeignDeclaration { - - public HaskellForeignDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitForeignDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellExpression getExpression() { - return findNotNullChildByClass(HaskellExpression.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellGconSymImpl.java b/intellij/haskell/psi/impl/HaskellGconSymImpl.java deleted file mode 100644 index f29a3e29..00000000 --- a/intellij/haskell/psi/impl/HaskellGconSymImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellGconSymImpl extends HaskellCompositeElementImpl implements HaskellGconSym { - - public HaskellGconSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitGconSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellConSym getConSym() { - return findChildByClass(HaskellConSym.class); - } - - @Override - @Nullable - public HaskellQconSym getQconSym() { - return findChildByClass(HaskellQconSym.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java b/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java deleted file mode 100644 index 8788014f..00000000 --- a/intellij/haskell/psi/impl/HaskellGeneralPragmaContentImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellGeneralPragmaContentImpl extends HaskellCompositeElementImpl implements HaskellGeneralPragmaContent { - - public HaskellGeneralPragmaContentImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitGeneralPragmaContent(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellGtyconImpl.java b/intellij/haskell/psi/impl/HaskellGtyconImpl.java deleted file mode 100644 index c76e170b..00000000 --- a/intellij/haskell/psi/impl/HaskellGtyconImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellGtyconImpl extends HaskellCompositeElementImpl implements HaskellGtycon { - - public HaskellGtyconImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitGtycon(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellHaddockPragmaImpl.java b/intellij/haskell/psi/impl/HaskellHaddockPragmaImpl.java deleted file mode 100644 index 3289e033..00000000 --- a/intellij/haskell/psi/impl/HaskellHaddockPragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellHaddockPragmaImpl extends HaskellCompositeElementImpl implements HaskellHaddockPragma { - - public HaskellHaddockPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitHaddockPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellIdeclImpl.java b/intellij/haskell/psi/impl/HaskellIdeclImpl.java deleted file mode 100644 index 80f1778a..00000000 --- a/intellij/haskell/psi/impl/HaskellIdeclImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellIdeclImpl extends HaskellCompositeElementImpl implements HaskellIdecl { - - public HaskellIdeclImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitIdecl(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellDataDeclaration getDataDeclaration() { - return findChildByClass(HaskellDataDeclaration.class); - } - - @Override - @Nullable - public HaskellDefaultDeclaration getDefaultDeclaration() { - return findChildByClass(HaskellDefaultDeclaration.class); - } - - @Override - @Nullable - public HaskellInlinePragma getInlinePragma() { - return findChildByClass(HaskellInlinePragma.class); - } - - @Override - @Nullable - public HaskellInstanceDeclaration getInstanceDeclaration() { - return findChildByClass(HaskellInstanceDeclaration.class); - } - - @Override - @Nullable - public HaskellNewtypeDeclaration getNewtypeDeclaration() { - return findChildByClass(HaskellNewtypeDeclaration.class); - } - - @Override - @Nullable - public HaskellNoinlinePragma getNoinlinePragma() { - return findChildByClass(HaskellNoinlinePragma.class); - } - - @Override - @Nullable - public HaskellSpecializePragma getSpecializePragma() { - return findChildByClass(HaskellSpecializePragma.class); - } - - @Override - @Nullable - public HaskellTypeDeclaration getTypeDeclaration() { - return findChildByClass(HaskellTypeDeclaration.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellImportDeclarationImpl.java deleted file mode 100644 index f8214039..00000000 --- a/intellij/haskell/psi/impl/HaskellImportDeclarationImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportDeclarationImpl extends HaskellCompositeElementImpl implements HaskellImportDeclaration { - - public HaskellImportDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellImportModule getImportModule() { - return findNotNullChildByClass(HaskellImportModule.class); - } - - @Override - @Nullable - public HaskellImportQualified getImportQualified() { - return findChildByClass(HaskellImportQualified.class); - } - - @Override - @Nullable - public HaskellImportQualifiedAs getImportQualifiedAs() { - return findChildByClass(HaskellImportQualifiedAs.class); - } - - @Override - @Nullable - public HaskellImportSpec getImportSpec() { - return findChildByClass(HaskellImportSpec.class); - } - - @Override - @Nullable - public HaskellSourcePragma getSourcePragma() { - return findChildByClass(HaskellSourcePragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportEmptySpecImpl.java b/intellij/haskell/psi/impl/HaskellImportEmptySpecImpl.java deleted file mode 100644 index 78de7e0d..00000000 --- a/intellij/haskell/psi/impl/HaskellImportEmptySpecImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportEmptySpecImpl extends HaskellCompositeElementImpl implements HaskellImportEmptySpec { - - public HaskellImportEmptySpecImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportEmptySpec(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportHidingImpl.java b/intellij/haskell/psi/impl/HaskellImportHidingImpl.java deleted file mode 100644 index 5101d4e2..00000000 --- a/intellij/haskell/psi/impl/HaskellImportHidingImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportHidingImpl extends HaskellCompositeElementImpl implements HaskellImportHiding { - - public HaskellImportHidingImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportHiding(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportHidingSpecImpl.java b/intellij/haskell/psi/impl/HaskellImportHidingSpecImpl.java deleted file mode 100644 index f7d5619d..00000000 --- a/intellij/haskell/psi/impl/HaskellImportHidingSpecImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportHidingSpecImpl extends HaskellCompositeElementImpl implements HaskellImportHidingSpec { - - public HaskellImportHidingSpecImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportHidingSpec(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellImportHiding getImportHiding() { - return findNotNullChildByClass(HaskellImportHiding.class); - } - - @Override - @NotNull - public List getImportIdList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellImportId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportIdImpl.java b/intellij/haskell/psi/impl/HaskellImportIdImpl.java deleted file mode 100644 index 244e2a16..00000000 --- a/intellij/haskell/psi/impl/HaskellImportIdImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportIdImpl extends HaskellCompositeElementImpl implements HaskellImportId { - - public HaskellImportIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCnameList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCname.class); - } - - @Override - @Nullable - public HaskellDotDotParens getDotDotParens() { - return findChildByClass(HaskellDotDotParens.class); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportIdsSpecImpl.java b/intellij/haskell/psi/impl/HaskellImportIdsSpecImpl.java deleted file mode 100644 index 28696f10..00000000 --- a/intellij/haskell/psi/impl/HaskellImportIdsSpecImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportIdsSpecImpl extends HaskellCompositeElementImpl implements HaskellImportIdsSpec { - - public HaskellImportIdsSpecImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportIdsSpec(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getImportIdList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellImportId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportModuleImpl.java b/intellij/haskell/psi/impl/HaskellImportModuleImpl.java deleted file mode 100644 index 916c2424..00000000 --- a/intellij/haskell/psi/impl/HaskellImportModuleImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportModuleImpl extends HaskellCompositeElementImpl implements HaskellImportModule { - - public HaskellImportModuleImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportModule(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellModId getModId() { - return findNotNullChildByClass(HaskellModId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java b/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java deleted file mode 100644 index bb9ab2d8..00000000 --- a/intellij/haskell/psi/impl/HaskellImportQualifiedAsImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportQualifiedAsImpl extends HaskellCompositeElementImpl implements HaskellImportQualifiedAs { - - public HaskellImportQualifiedAsImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportQualifiedAs(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellQualifier getQualifier() { - return findChildByClass(HaskellQualifier.class); - } - - @Override - @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java b/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java deleted file mode 100644 index d598b166..00000000 --- a/intellij/haskell/psi/impl/HaskellImportQualifiedImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportQualifiedImpl extends HaskellCompositeElementImpl implements HaskellImportQualified { - - public HaskellImportQualifiedImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportQualified(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellImportSpecImpl.java b/intellij/haskell/psi/impl/HaskellImportSpecImpl.java deleted file mode 100644 index 59479bd5..00000000 --- a/intellij/haskell/psi/impl/HaskellImportSpecImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellImportSpecImpl extends HaskellCompositeElementImpl implements HaskellImportSpec { - - public HaskellImportSpecImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitImportSpec(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellImportEmptySpec getImportEmptySpec() { - return findChildByClass(HaskellImportEmptySpec.class); - } - - @Override - @Nullable - public HaskellImportHidingSpec getImportHidingSpec() { - return findChildByClass(HaskellImportHidingSpec.class); - } - - @Override - @Nullable - public HaskellImportIdsSpec getImportIdsSpec() { - return findChildByClass(HaskellImportIdsSpec.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellIncludePragmaImpl.java b/intellij/haskell/psi/impl/HaskellIncludePragmaImpl.java deleted file mode 100644 index 321ef727..00000000 --- a/intellij/haskell/psi/impl/HaskellIncludePragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellIncludePragmaImpl extends HaskellCompositeElementImpl implements HaskellIncludePragma { - - public HaskellIncludePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitIncludePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellInlinablePragmaImpl.java b/intellij/haskell/psi/impl/HaskellInlinablePragmaImpl.java deleted file mode 100644 index 7163edd2..00000000 --- a/intellij/haskell/psi/impl/HaskellInlinablePragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellInlinablePragmaImpl extends HaskellCompositeElementImpl implements HaskellInlinablePragma { - - public HaskellInlinablePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitInlinablePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellInlinePragmaImpl.java b/intellij/haskell/psi/impl/HaskellInlinePragmaImpl.java deleted file mode 100644 index 472e1b72..00000000 --- a/intellij/haskell/psi/impl/HaskellInlinePragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellInlinePragmaImpl extends HaskellCompositeElementImpl implements HaskellInlinePragma { - - public HaskellInlinePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitInlinePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellInstImpl.java b/intellij/haskell/psi/impl/HaskellInstImpl.java deleted file mode 100644 index dac533a3..00000000 --- a/intellij/haskell/psi/impl/HaskellInstImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellInstImpl extends HaskellCompositeElementImpl implements HaskellInst { - - public HaskellInstImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitInst(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellGtycon getGtycon() { - return findChildByClass(HaskellGtycon.class); - } - - @Override - @NotNull - public List getInstvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellInstvar.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); - } - - @Override - @Nullable - public HaskellTtype getTtype() { - return findChildByClass(HaskellTtype.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellInstanceDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellInstanceDeclarationImpl.java deleted file mode 100644 index a1c237ea..00000000 --- a/intellij/haskell/psi/impl/HaskellInstanceDeclarationImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellInstanceDeclarationImpl extends HaskellCompositeElementImpl implements HaskellInstanceDeclaration { - - public HaskellInstanceDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitInstanceDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getExpressionList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellExpression.class); - } - - @Override - @NotNull - public List getIdeclList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellIdecl.class); - } - - @Override - @NotNull - public HaskellInst getInst() { - return findNotNullChildByClass(HaskellInst.class); - } - - @Override - @Nullable - public HaskellOverlapPragma getOverlapPragma() { - return findChildByClass(HaskellOverlapPragma.class); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellScontext getScontext() { - return findChildByClass(HaskellScontext.class); - } - - @Override - @NotNull - public List getVarIdList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellInstvarImpl.java b/intellij/haskell/psi/impl/HaskellInstvarImpl.java deleted file mode 100644 index ee450b9b..00000000 --- a/intellij/haskell/psi/impl/HaskellInstvarImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellInstvarImpl extends HaskellCompositeElementImpl implements HaskellInstvar { - - public HaskellInstvarImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitInstvar(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQvar getQvar() { - return findChildByClass(HaskellQvar.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java b/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java deleted file mode 100644 index bdca0419..00000000 --- a/intellij/haskell/psi/impl/HaskellKindSignatureImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellKindSignatureImpl extends HaskellCompositeElementImpl implements HaskellKindSignature { - - public HaskellKindSignatureImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitKindSignature(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellTtype getTtype() { - return findNotNullChildByClass(HaskellTtype.class); - } - - @Override - @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellLanguagePragmaImpl.java b/intellij/haskell/psi/impl/HaskellLanguagePragmaImpl.java deleted file mode 100644 index 2cd5b207..00000000 --- a/intellij/haskell/psi/impl/HaskellLanguagePragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLanguagePragmaImpl extends HaskellCompositeElementImpl implements HaskellLanguagePragma { - - public HaskellLanguagePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLanguagePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellLastLineExpressionImpl.java b/intellij/haskell/psi/impl/HaskellLastLineExpressionImpl.java deleted file mode 100644 index d06158d8..00000000 --- a/intellij/haskell/psi/impl/HaskellLastLineExpressionImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLastLineExpressionImpl extends HaskellLineExpressionElementImpl implements HaskellLastLineExpression { - - public HaskellLastLineExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLastLineExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellLineExpressionImpl.java b/intellij/haskell/psi/impl/HaskellLineExpressionImpl.java deleted file mode 100644 index 5caef2d5..00000000 --- a/intellij/haskell/psi/impl/HaskellLineExpressionImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLineExpressionImpl extends HaskellLineExpressionElementImpl implements HaskellLineExpression { - - public HaskellLineExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLineExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - - @Override - @NotNull - public HaskellSnl getSnl() { - return findNotNullChildByClass(HaskellSnl.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellLinePragmaImpl.java b/intellij/haskell/psi/impl/HaskellLinePragmaImpl.java deleted file mode 100644 index 6fac9bff..00000000 --- a/intellij/haskell/psi/impl/HaskellLinePragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLinePragmaImpl extends HaskellCompositeElementImpl implements HaskellLinePragma { - - public HaskellLinePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLinePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellLiteralImpl.java b/intellij/haskell/psi/impl/HaskellLiteralImpl.java deleted file mode 100644 index 38c8d4be..00000000 --- a/intellij/haskell/psi/impl/HaskellLiteralImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellLiteralImpl extends HaskellCompositeElementImpl implements HaskellLiteral { - - public HaskellLiteralImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitLiteral(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellMinimalPragmaImpl.java b/intellij/haskell/psi/impl/HaskellMinimalPragmaImpl.java deleted file mode 100644 index a910c96d..00000000 --- a/intellij/haskell/psi/impl/HaskellMinimalPragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellMinimalPragmaImpl extends HaskellCompositeElementImpl implements HaskellMinimalPragma { - - public HaskellMinimalPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitMinimalPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellModIdImpl.java b/intellij/haskell/psi/impl/HaskellModIdImpl.java deleted file mode 100644 index 504682b0..00000000 --- a/intellij/haskell/psi/impl/HaskellModIdImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellModIdImpl extends HaskellNamedElementImpl implements HaskellModId { - - public HaskellModIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitModId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - public PsiElement setName(String newName) { - return HaskellPsiImplUtil.setName(this, newName); - } - - public HaskellNamedElement getNameIdentifier() { - return HaskellPsiImplUtil.getNameIdentifier(this); - } - - public com.intellij.psi.PsiReference getReference() { - return HaskellPsiImplUtil.getReference(this); - } - - public com.intellij.navigation.ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public com.intellij.psi.search.SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellModuleDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellModuleDeclarationImpl.java deleted file mode 100644 index 3d3fa4eb..00000000 --- a/intellij/haskell/psi/impl/HaskellModuleDeclarationImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import scala.collection.Seq; - -public class HaskellModuleDeclarationImpl extends HaskellCompositeElementImpl implements HaskellModuleDeclaration { - - public HaskellModuleDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitModuleDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellDeprecatedWarnPragma getDeprecatedWarnPragma() { - return findChildByClass(HaskellDeprecatedWarnPragma.class); - } - - @Override - @Nullable - public HaskellExports getExports() { - return findChildByClass(HaskellExports.class); - } - - @Override - @NotNull - public HaskellModId getModId() { - return findNotNullChildByClass(HaskellModId.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public Seq getIdentifierElements() { - return HaskellPsiImplUtil.getIdentifierElements(this); - } - - public String getModuleName() { - return HaskellPsiImplUtil.getModuleName(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellNewconstrFielddeclImpl.java b/intellij/haskell/psi/impl/HaskellNewconstrFielddeclImpl.java deleted file mode 100644 index 9943b2ac..00000000 --- a/intellij/haskell/psi/impl/HaskellNewconstrFielddeclImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellNewconstrFielddeclImpl extends HaskellCompositeElementImpl implements HaskellNewconstrFielddecl { - - public HaskellNewconstrFielddeclImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitNewconstrFielddecl(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public HaskellQvar getQvar() { - return findNotNullChildByClass(HaskellQvar.class); - } - - @Override - @NotNull - public HaskellTtype getTtype() { - return findNotNullChildByClass(HaskellTtype.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellNewconstrImpl.java b/intellij/haskell/psi/impl/HaskellNewconstrImpl.java deleted file mode 100644 index 58169d63..00000000 --- a/intellij/haskell/psi/impl/HaskellNewconstrImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellNewconstrImpl extends HaskellCompositeElementImpl implements HaskellNewconstr { - - public HaskellNewconstrImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitNewconstr(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellCname getCname() { - return findChildByClass(HaskellCname.class); - } - - @Override - @Nullable - public HaskellGtycon getGtycon() { - return findChildByClass(HaskellGtycon.class); - } - - @Override - @Nullable - public HaskellNewconstrFielddecl getNewconstrFielddecl() { - return findChildByClass(HaskellNewconstrFielddecl.class); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellNewtypeDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellNewtypeDeclarationImpl.java deleted file mode 100644 index 6b63cb6a..00000000 --- a/intellij/haskell/psi/impl/HaskellNewtypeDeclarationImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import scala.collection.Seq; - -public class HaskellNewtypeDeclarationImpl extends HaskellCompositeElementImpl implements HaskellNewtypeDeclaration { - - public HaskellNewtypeDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitNewtypeDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellContext getContext() { - return findChildByClass(HaskellContext.class); - } - - @Override - @Nullable - public HaskellCtypePragma getCtypePragma() { - return findChildByClass(HaskellCtypePragma.class); - } - - @Override - @NotNull - public HaskellNewconstr getNewconstr() { - return findNotNullChildByClass(HaskellNewconstr.class); - } - - @Override - @NotNull - public HaskellSimpletype getSimpletype() { - return findNotNullChildByClass(HaskellSimpletype.class); - } - - @Override - @Nullable - public HaskellTtype getTtype() { - return findChildByClass(HaskellTtype.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public Seq getIdentifierElements() { - return HaskellPsiImplUtil.getIdentifierElements(this); - } - - public String getModuleName() { - return HaskellPsiImplUtil.getModuleName(this); - } - - public HaskellNamedElement getDataTypeConstructor() { - return HaskellPsiImplUtil.getDataTypeConstructor(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellNoinlinePragmaImpl.java b/intellij/haskell/psi/impl/HaskellNoinlinePragmaImpl.java deleted file mode 100644 index d1af40e2..00000000 --- a/intellij/haskell/psi/impl/HaskellNoinlinePragmaImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellNoinlinePragmaImpl extends HaskellCompositeElementImpl implements HaskellNoinlinePragma { - - public HaskellNoinlinePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitNoinlinePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellNounpackPragmaImpl.java b/intellij/haskell/psi/impl/HaskellNounpackPragmaImpl.java deleted file mode 100644 index 63c16e46..00000000 --- a/intellij/haskell/psi/impl/HaskellNounpackPragmaImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellNounpackPragmaImpl extends HaskellCompositeElementImpl implements HaskellNounpackPragma { - - public HaskellNounpackPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitNounpackPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellOpsImpl.java b/intellij/haskell/psi/impl/HaskellOpsImpl.java deleted file mode 100644 index d55e6903..00000000 --- a/intellij/haskell/psi/impl/HaskellOpsImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellOpsImpl extends HaskellCompositeElementImpl implements HaskellOps { - - public HaskellOpsImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitOps(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellOptionsGhcPragmaImpl.java b/intellij/haskell/psi/impl/HaskellOptionsGhcPragmaImpl.java deleted file mode 100644 index 2094ccea..00000000 --- a/intellij/haskell/psi/impl/HaskellOptionsGhcPragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellOptionsGhcPragmaImpl extends HaskellCompositeElementImpl implements HaskellOptionsGhcPragma { - - public HaskellOptionsGhcPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitOptionsGhcPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellOtherPragmaImpl.java b/intellij/haskell/psi/impl/HaskellOtherPragmaImpl.java deleted file mode 100644 index b0984eaa..00000000 --- a/intellij/haskell/psi/impl/HaskellOtherPragmaImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellOtherPragmaImpl extends HaskellCompositeElementImpl implements HaskellOtherPragma { - - public HaskellOtherPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitOtherPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellAnnPragma getAnnPragma() { - return findChildByClass(HaskellAnnPragma.class); - } - - @Override - @Nullable - public HaskellDeprecatedWarnPragma getDeprecatedWarnPragma() { - return findChildByClass(HaskellDeprecatedWarnPragma.class); - } - - @Override - @Nullable - public HaskellDummyPragma getDummyPragma() { - return findChildByClass(HaskellDummyPragma.class); - } - - @Override - @Nullable - public HaskellInlinablePragma getInlinablePragma() { - return findChildByClass(HaskellInlinablePragma.class); - } - - @Override - @Nullable - public HaskellInlinePragma getInlinePragma() { - return findChildByClass(HaskellInlinePragma.class); - } - - @Override - @Nullable - public HaskellLinePragma getLinePragma() { - return findChildByClass(HaskellLinePragma.class); - } - - @Override - @Nullable - public HaskellMinimalPragma getMinimalPragma() { - return findChildByClass(HaskellMinimalPragma.class); - } - - @Override - @Nullable - public HaskellNoinlinePragma getNoinlinePragma() { - return findChildByClass(HaskellNoinlinePragma.class); - } - - @Override - @Nullable - public HaskellOverlapPragma getOverlapPragma() { - return findChildByClass(HaskellOverlapPragma.class); - } - - @Override - @Nullable - public HaskellRulesPragma getRulesPragma() { - return findChildByClass(HaskellRulesPragma.class); - } - - @Override - @Nullable - public HaskellSpecializePragma getSpecializePragma() { - return findChildByClass(HaskellSpecializePragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellOverlapPragmaImpl.java b/intellij/haskell/psi/impl/HaskellOverlapPragmaImpl.java deleted file mode 100644 index 08fc5ff4..00000000 --- a/intellij/haskell/psi/impl/HaskellOverlapPragmaImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellOverlapPragmaImpl extends HaskellCompositeElementImpl implements HaskellOverlapPragma { - - public HaskellOverlapPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitOverlapPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellParallelArrayTypeImpl.java b/intellij/haskell/psi/impl/HaskellParallelArrayTypeImpl.java deleted file mode 100644 index 9ccd903c..00000000 --- a/intellij/haskell/psi/impl/HaskellParallelArrayTypeImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellParallelArrayTypeImpl extends HaskellCompositeElementImpl implements HaskellParallelArrayType { - - public HaskellParallelArrayTypeImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitParallelArrayType(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQconIdImpl.java b/intellij/haskell/psi/impl/HaskellQconIdImpl.java deleted file mode 100644 index 1bd05944..00000000 --- a/intellij/haskell/psi/impl/HaskellQconIdImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQconIdImpl extends HaskellCompositeElementImpl implements HaskellQconId { - - public HaskellQconIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellConId getConId() { - return findNotNullChildByClass(HaskellConId.class); - } - - @Override - @NotNull - public HaskellQconIdQualifier getQconIdQualifier() { - return findNotNullChildByClass(HaskellQconIdQualifier.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQconIdQualifierImpl.java b/intellij/haskell/psi/impl/HaskellQconIdQualifierImpl.java deleted file mode 100644 index 17cfc528..00000000 --- a/intellij/haskell/psi/impl/HaskellQconIdQualifierImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQconIdQualifierImpl extends HaskellCompositeElementImpl implements HaskellQconIdQualifier { - - public HaskellQconIdQualifierImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconIdQualifier(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQconImpl.java b/intellij/haskell/psi/impl/HaskellQconImpl.java deleted file mode 100644 index 947f1d3e..00000000 --- a/intellij/haskell/psi/impl/HaskellQconImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.Option; - -public class HaskellQconImpl extends HaskellCompositeElementImpl implements HaskellQcon { - - public HaskellQconImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQcon(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellConId getConId() { - return findChildByClass(HaskellConId.class); - } - - @Override - @Nullable - public HaskellConSym getConSym() { - return findChildByClass(HaskellConSym.class); - } - - @Override - @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); - } - - @Override - @Nullable - public HaskellQconId getQconId() { - return findChildByClass(HaskellQconId.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQconOpImpl.java b/intellij/haskell/psi/impl/HaskellQconOpImpl.java deleted file mode 100644 index bd883a90..00000000 --- a/intellij/haskell/psi/impl/HaskellQconOpImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.Option; - -public class HaskellQconOpImpl extends HaskellCompositeElementImpl implements HaskellQconOp { - - public HaskellQconOpImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconOp(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellConId getConId() { - return findChildByClass(HaskellConId.class); - } - - @Override - @Nullable - public HaskellConSym getConSym() { - return findChildByClass(HaskellConSym.class); - } - - @Override - @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); - } - - @Override - @Nullable - public HaskellQconId getQconId() { - return findChildByClass(HaskellQconId.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQconSymImpl.java b/intellij/haskell/psi/impl/HaskellQconSymImpl.java deleted file mode 100644 index 92dda776..00000000 --- a/intellij/haskell/psi/impl/HaskellQconSymImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQconSymImpl extends HaskellCompositeElementImpl implements HaskellQconSym { - - public HaskellQconSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQconSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellConSym getConSym() { - return findNotNullChildByClass(HaskellConSym.class); - } - - @Override - @NotNull - public HaskellQualifier getQualifier() { - return findNotNullChildByClass(HaskellQualifier.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQqExpressionImpl.java b/intellij/haskell/psi/impl/HaskellQqExpressionImpl.java deleted file mode 100644 index ffee384e..00000000 --- a/intellij/haskell/psi/impl/HaskellQqExpressionImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQqExpressionImpl extends HaskellCompositeElementImpl implements HaskellQqExpression { - - public HaskellQqExpressionImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQqExpression(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getFixityList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellFixity.class); - } - - @Override - @NotNull - public List getLiteralList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellLiteral.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public HaskellQuasiQuote getQuasiQuote() { - return findNotNullChildByClass(HaskellQuasiQuote.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getQvarOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvarOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQualifierImpl.java b/intellij/haskell/psi/impl/HaskellQualifierImpl.java deleted file mode 100644 index 17278474..00000000 --- a/intellij/haskell/psi/impl/HaskellQualifierImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; - -public class HaskellQualifierImpl extends HaskellNamedElementImpl implements HaskellQualifier { - - public HaskellQualifierImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQualifier(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public PsiElement setName(String newName) { - return HaskellPsiImplUtil.setName(this, newName); - } - - public HaskellNamedElement getNameIdentifier() { - return HaskellPsiImplUtil.getNameIdentifier(this); - } - - public PsiReference getReference() { - return HaskellPsiImplUtil.getReference(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQuasiQuoteImpl.java b/intellij/haskell/psi/impl/HaskellQuasiQuoteImpl.java deleted file mode 100644 index e8fa2411..00000000 --- a/intellij/haskell/psi/impl/HaskellQuasiQuoteImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQuasiQuoteImpl extends HaskellCompositeElementImpl implements HaskellQuasiQuote { - - public HaskellQuasiQuoteImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQuasiQuote(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellExpression getExpression() { - return findChildByClass(HaskellExpression.class); - } - - @Override - @Nullable - public HaskellSimpletype getSimpletype() { - return findChildByClass(HaskellSimpletype.class); - } - - @Override - @NotNull - public List getTopDeclarationList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTopDeclaration.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQvarIdImpl.java b/intellij/haskell/psi/impl/HaskellQvarIdImpl.java deleted file mode 100644 index 1963409a..00000000 --- a/intellij/haskell/psi/impl/HaskellQvarIdImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQvarIdImpl extends HaskellCompositeElementImpl implements HaskellQvarId { - - public HaskellQvarIdImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvarId(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQualifier getQualifier() { - return findNotNullChildByClass(HaskellQualifier.class); - } - - @Override - @NotNull - public HaskellVarId getVarId() { - return findNotNullChildByClass(HaskellVarId.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQvarImpl.java b/intellij/haskell/psi/impl/HaskellQvarImpl.java deleted file mode 100644 index 70ec8320..00000000 --- a/intellij/haskell/psi/impl/HaskellQvarImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.Option; - -public class HaskellQvarImpl extends HaskellCompositeElementImpl implements HaskellQvar { - - public HaskellQvarImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvar(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellQvarId getQvarId() { - return findChildByClass(HaskellQvarId.class); - } - - @Override - @Nullable - public HaskellQvarSym getQvarSym() { - return findChildByClass(HaskellQvarSym.class); - } - - @Override - @Nullable - public HaskellVarId getVarId() { - return findChildByClass(HaskellVarId.class); - } - - @Override - @Nullable - public HaskellVarSym getVarSym() { - return findChildByClass(HaskellVarSym.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQvarOpImpl.java b/intellij/haskell/psi/impl/HaskellQvarOpImpl.java deleted file mode 100644 index 93bba330..00000000 --- a/intellij/haskell/psi/impl/HaskellQvarOpImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.Option; - -public class HaskellQvarOpImpl extends HaskellCompositeElementImpl implements HaskellQvarOp { - - public HaskellQvarOpImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvarOp(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellQvarId getQvarId() { - return findChildByClass(HaskellQvarId.class); - } - - @Override - @Nullable - public HaskellQvarSym getQvarSym() { - return findChildByClass(HaskellQvarSym.class); - } - - @Override - @Nullable - public HaskellVarId getVarId() { - return findChildByClass(HaskellVarId.class); - } - - @Override - @Nullable - public HaskellVarSym getVarSym() { - return findChildByClass(HaskellVarSym.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public HaskellNamedElement getIdentifierElement() { - return HaskellPsiImplUtil.getIdentifierElement(this); - } - - public Option getQualifier() { - return HaskellPsiImplUtil.getQualifier(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellQvarSymImpl.java b/intellij/haskell/psi/impl/HaskellQvarSymImpl.java deleted file mode 100644 index aaa10453..00000000 --- a/intellij/haskell/psi/impl/HaskellQvarSymImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellQvarSymImpl extends HaskellCompositeElementImpl implements HaskellQvarSym { - - public HaskellQvarSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitQvarSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQualifier getQualifier() { - return findNotNullChildByClass(HaskellQualifier.class); - } - - @Override - @NotNull - public HaskellVarSym getVarSym() { - return findNotNullChildByClass(HaskellVarSym.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellRulesPragmaImpl.java b/intellij/haskell/psi/impl/HaskellRulesPragmaImpl.java deleted file mode 100644 index 0628b614..00000000 --- a/intellij/haskell/psi/impl/HaskellRulesPragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellRulesPragmaImpl extends HaskellCompositeElementImpl implements HaskellRulesPragma { - - public HaskellRulesPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitRulesPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellScontextImpl.java b/intellij/haskell/psi/impl/HaskellScontextImpl.java deleted file mode 100644 index 3b429c3b..00000000 --- a/intellij/haskell/psi/impl/HaskellScontextImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellScontextImpl extends HaskellCompositeElementImpl implements HaskellScontext { - - public HaskellScontextImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitScontext(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getSimpleclassList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSimpleclass.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java b/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java deleted file mode 100644 index 96109348..00000000 --- a/intellij/haskell/psi/impl/HaskellSimpleclassImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellSimpleclassImpl extends HaskellCompositeElementImpl implements HaskellSimpleclass { - - public HaskellSimpleclassImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSimpleclass(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellCname getCname() { - return findChildByClass(HaskellCname.class); - } - - @Override - @Nullable - public HaskellGtycon getGtycon() { - return findChildByClass(HaskellGtycon.class); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQconOpList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQconOp.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getSimpleclassTildePartList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellSimpleclassTildePart.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellSimpleclassTildePartImpl.java b/intellij/haskell/psi/impl/HaskellSimpleclassTildePartImpl.java deleted file mode 100644 index 98b092be..00000000 --- a/intellij/haskell/psi/impl/HaskellSimpleclassTildePartImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellSimpleclassTildePartImpl extends HaskellCompositeElementImpl implements HaskellSimpleclassTildePart { - - public HaskellSimpleclassTildePartImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSimpleclassTildePart(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getQconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQcon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellSimpletypeImpl.java b/intellij/haskell/psi/impl/HaskellSimpletypeImpl.java deleted file mode 100644 index 1876090e..00000000 --- a/intellij/haskell/psi/impl/HaskellSimpletypeImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import scala.collection.Seq; - -public class HaskellSimpletypeImpl extends HaskellCompositeElementImpl implements HaskellSimpletype { - - public HaskellSimpletypeImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSimpletype(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellGconSym getGconSym() { - return findChildByClass(HaskellGconSym.class); - } - - @Override - @Nullable - public HaskellParallelArrayType getParallelArrayType() { - return findChildByClass(HaskellParallelArrayType.class); - } - - @Override - @Nullable - public HaskellQcon getQcon() { - return findChildByClass(HaskellQcon.class); - } - - @Override - @Nullable - public HaskellQconOp getQconOp() { - return findChildByClass(HaskellQconOp.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); - } - - @Override - @Nullable - public HaskellTtype getTtype() { - return findChildByClass(HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - - @Override - @NotNull - public List getVarIdList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVarId.class); - } - - public Seq getIdentifierElements() { - return HaskellPsiImplUtil.getIdentifierElements(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellSourcePragmaImpl.java b/intellij/haskell/psi/impl/HaskellSourcePragmaImpl.java deleted file mode 100644 index 8c9e50ef..00000000 --- a/intellij/haskell/psi/impl/HaskellSourcePragmaImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellSourcePragmaImpl extends HaskellCompositeElementImpl implements HaskellSourcePragma { - - public HaskellSourcePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSourcePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellSpecializePragmaImpl.java b/intellij/haskell/psi/impl/HaskellSpecializePragmaImpl.java deleted file mode 100644 index d561ae18..00000000 --- a/intellij/haskell/psi/impl/HaskellSpecializePragmaImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellSpecializePragmaImpl extends HaskellCompositeElementImpl implements HaskellSpecializePragma { - - public HaskellSpecializePragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSpecializePragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellGeneralPragmaContent getGeneralPragmaContent() { - return findNotNullChildByClass(HaskellGeneralPragmaContent.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellSubConstr2Impl.java b/intellij/haskell/psi/impl/HaskellSubConstr2Impl.java deleted file mode 100644 index dc145101..00000000 --- a/intellij/haskell/psi/impl/HaskellSubConstr2Impl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellSubConstr2Impl extends HaskellCompositeElementImpl implements HaskellSubConstr2 { - - public HaskellSubConstr2Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitSubConstr2(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCnameList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCname.class); - } - - @Override - @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @Nullable - public HaskellQvarOp getQvarOp() { - return findChildByClass(HaskellQvarOp.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTopDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellTopDeclarationImpl.java deleted file mode 100644 index 1953b5e1..00000000 --- a/intellij/haskell/psi/impl/HaskellTopDeclarationImpl.java +++ /dev/null @@ -1,124 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellTopDeclarationImpl extends HaskellCompositeElementImpl implements HaskellTopDeclaration { - - public HaskellTopDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTopDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellCfilesPragma getCfilesPragma() { - return findChildByClass(HaskellCfilesPragma.class); - } - - @Override - @Nullable - public HaskellClassDeclaration getClassDeclaration() { - return findChildByClass(HaskellClassDeclaration.class); - } - - @Override - @Nullable - public HaskellDataDeclaration getDataDeclaration() { - return findChildByClass(HaskellDataDeclaration.class); - } - - @Override - @Nullable - public HaskellDefaultDeclaration getDefaultDeclaration() { - return findChildByClass(HaskellDefaultDeclaration.class); - } - - @Override - @Nullable - public HaskellDerivingDeclaration getDerivingDeclaration() { - return findChildByClass(HaskellDerivingDeclaration.class); - } - - @Override - @Nullable - public HaskellExpression getExpression() { - return findChildByClass(HaskellExpression.class); - } - - @Override - @Nullable - public HaskellForeignDeclaration getForeignDeclaration() { - return findChildByClass(HaskellForeignDeclaration.class); - } - - @Override - @Nullable - public HaskellInstanceDeclaration getInstanceDeclaration() { - return findChildByClass(HaskellInstanceDeclaration.class); - } - - @Override - @Nullable - public HaskellNewtypeDeclaration getNewtypeDeclaration() { - return findChildByClass(HaskellNewtypeDeclaration.class); - } - - @Override - @Nullable - public HaskellOtherPragma getOtherPragma() { - return findChildByClass(HaskellOtherPragma.class); - } - - @Override - @Nullable - public HaskellQqExpression getQqExpression() { - return findChildByClass(HaskellQqExpression.class); - } - - @Override - @Nullable - public HaskellQuasiQuote getQuasiQuote() { - return findChildByClass(HaskellQuasiQuote.class); - } - - @Override - @Nullable - public HaskellTypeDeclaration getTypeDeclaration() { - return findChildByClass(HaskellTypeDeclaration.class); - } - - @Override - @Nullable - public HaskellTypeFamilyDeclaration getTypeFamilyDeclaration() { - return findChildByClass(HaskellTypeFamilyDeclaration.class); - } - - @Override - @Nullable - public HaskellTypeInstanceDeclaration getTypeInstanceDeclaration() { - return findChildByClass(HaskellTypeInstanceDeclaration.class); - } - - @Override - @Nullable - public HaskellTypeSignature getTypeSignature() { - return findChildByClass(HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTtypeImpl.java b/intellij/haskell/psi/impl/HaskellTtypeImpl.java deleted file mode 100644 index e941d586..00000000 --- a/intellij/haskell/psi/impl/HaskellTtypeImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellTtypeImpl extends HaskellCompositeElementImpl implements HaskellTtype { - - public HaskellTtypeImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTtype(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getCnameList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellCname.class); - } - - @Override - @NotNull - public List getGtyconList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellGtycon.class); - } - - @Override - @Nullable - public HaskellParallelArrayType getParallelArrayType() { - return findChildByClass(HaskellParallelArrayType.class); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeSignatureList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeSignature.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTypeDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellTypeDeclarationImpl.java deleted file mode 100644 index 201ab090..00000000 --- a/intellij/haskell/psi/impl/HaskellTypeDeclarationImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import scala.collection.Seq; - -public class HaskellTypeDeclarationImpl extends HaskellCompositeElementImpl implements HaskellTypeDeclaration { - - public HaskellTypeDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellExpression getExpression() { - return findChildByClass(HaskellExpression.class); - } - - @Override - @Nullable - public HaskellKindSignature getKindSignature() { - return findChildByClass(HaskellKindSignature.class); - } - - @Override - @NotNull - public HaskellSimpletype getSimpletype() { - return findNotNullChildByClass(HaskellSimpletype.class); - } - - @Override - @Nullable - public HaskellTtype getTtype() { - return findChildByClass(HaskellTtype.class); - } - - @Override - @Nullable - public HaskellTypeSignature getTypeSignature() { - return findChildByClass(HaskellTypeSignature.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public Seq getIdentifierElements() { - return HaskellPsiImplUtil.getIdentifierElements(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTypeFamilyDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellTypeFamilyDeclarationImpl.java deleted file mode 100644 index dce1bb47..00000000 --- a/intellij/haskell/psi/impl/HaskellTypeFamilyDeclarationImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import scala.collection.Seq; - -public class HaskellTypeFamilyDeclarationImpl extends HaskellCompositeElementImpl implements HaskellTypeFamilyDeclaration { - - public HaskellTypeFamilyDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeFamilyDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellExpression getExpression() { - return findChildByClass(HaskellExpression.class); - } - - @Override - @NotNull - public HaskellTypeFamilyType getTypeFamilyType() { - return findNotNullChildByClass(HaskellTypeFamilyType.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public Seq getIdentifierElements() { - return HaskellPsiImplUtil.getIdentifierElements(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTypeFamilyType1Impl.java b/intellij/haskell/psi/impl/HaskellTypeFamilyType1Impl.java deleted file mode 100644 index f7af1a0f..00000000 --- a/intellij/haskell/psi/impl/HaskellTypeFamilyType1Impl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellTypeFamilyType1Impl extends HaskellCompositeElementImpl implements HaskellTypeFamilyType1 { - - public HaskellTypeFamilyType1Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeFamilyType1(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQcon getQcon() { - return findNotNullChildByClass(HaskellQcon.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTypeFamilyType2Impl.java b/intellij/haskell/psi/impl/HaskellTypeFamilyType2Impl.java deleted file mode 100644 index 736f9ae2..00000000 --- a/intellij/haskell/psi/impl/HaskellTypeFamilyType2Impl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellTypeFamilyType2Impl extends HaskellCompositeElementImpl implements HaskellTypeFamilyType2 { - - public HaskellTypeFamilyType2Impl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeFamilyType2(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellQvarOp getQvarOp() { - return findNotNullChildByClass(HaskellQvarOp.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTypeFamilyTypeImpl.java b/intellij/haskell/psi/impl/HaskellTypeFamilyTypeImpl.java deleted file mode 100644 index 0202e898..00000000 --- a/intellij/haskell/psi/impl/HaskellTypeFamilyTypeImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellTypeFamilyTypeImpl extends HaskellCompositeElementImpl implements HaskellTypeFamilyType { - - public HaskellTypeFamilyTypeImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeFamilyType(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getContextList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellContext.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @NotNull - public List getTypeFamilyType1List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeFamilyType1.class); - } - - @Override - @NotNull - public List getTypeFamilyType2List() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTypeFamilyType2.class); - } - - @Override - @NotNull - public List getVarsList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellVars.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTypeInstanceDeclarationImpl.java b/intellij/haskell/psi/impl/HaskellTypeInstanceDeclarationImpl.java deleted file mode 100644 index 587ff58b..00000000 --- a/intellij/haskell/psi/impl/HaskellTypeInstanceDeclarationImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import scala.collection.Seq; - -public class HaskellTypeInstanceDeclarationImpl extends HaskellCompositeElementImpl implements HaskellTypeInstanceDeclaration { - - public HaskellTypeInstanceDeclarationImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeInstanceDeclaration(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public HaskellExpression getExpression() { - return findNotNullChildByClass(HaskellExpression.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public Seq getIdentifierElements() { - return HaskellPsiImplUtil.getIdentifierElements(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellTypeSignatureImpl.java b/intellij/haskell/psi/impl/HaskellTypeSignatureImpl.java deleted file mode 100644 index 38169c69..00000000 --- a/intellij/haskell/psi/impl/HaskellTypeSignatureImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import scala.collection.Seq; - -public class HaskellTypeSignatureImpl extends HaskellCompositeElementImpl implements HaskellTypeSignature { - - public HaskellTypeSignatureImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitTypeSignature(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellContext getContext() { - return findChildByClass(HaskellContext.class); - } - - @Override - @Nullable - public HaskellFixity getFixity() { - return findChildByClass(HaskellFixity.class); - } - - @Override - @Nullable - public HaskellOps getOps() { - return findChildByClass(HaskellOps.class); - } - - @Override - @NotNull - public List getTtypeList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellTtype.class); - } - - @Override - @Nullable - public HaskellVars getVars() { - return findChildByClass(HaskellVars.class); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public Seq getIdentifierElements() { - return HaskellPsiImplUtil.getIdentifierElements(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellUnpackNounpackPragmaImpl.java b/intellij/haskell/psi/impl/HaskellUnpackNounpackPragmaImpl.java deleted file mode 100644 index e89ebde2..00000000 --- a/intellij/haskell/psi/impl/HaskellUnpackNounpackPragmaImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellUnpackNounpackPragmaImpl extends HaskellCompositeElementImpl implements HaskellUnpackNounpackPragma { - - public HaskellUnpackNounpackPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitUnpackNounpackPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @Nullable - public HaskellNounpackPragma getNounpackPragma() { - return findChildByClass(HaskellNounpackPragma.class); - } - - @Override - @Nullable - public HaskellUnpackPragma getUnpackPragma() { - return findChildByClass(HaskellUnpackPragma.class); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellUnpackPragmaImpl.java b/intellij/haskell/psi/impl/HaskellUnpackPragmaImpl.java deleted file mode 100644 index 0b57e74e..00000000 --- a/intellij/haskell/psi/impl/HaskellUnpackPragmaImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellUnpackPragmaImpl extends HaskellCompositeElementImpl implements HaskellUnpackPragma { - - public HaskellUnpackPragmaImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitUnpackPragma(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellVarSymImpl.java b/intellij/haskell/psi/impl/HaskellVarSymImpl.java deleted file mode 100644 index 1e07756a..00000000 --- a/intellij/haskell/psi/impl/HaskellVarSymImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; -import com.intellij.navigation.ItemPresentation; -import com.intellij.psi.PsiReference; -import com.intellij.psi.search.SearchScope; - -public class HaskellVarSymImpl extends HaskellNamedElementImpl implements HaskellVarSym { - - public HaskellVarSymImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitVarSym(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - public String getName() { - return HaskellPsiImplUtil.getName(this); - } - - public PsiElement setName(String newName) { - return HaskellPsiImplUtil.setName(this, newName); - } - - public HaskellNamedElement getNameIdentifier() { - return HaskellPsiImplUtil.getNameIdentifier(this); - } - - public PsiReference getReference() { - return HaskellPsiImplUtil.getReference(this); - } - - public ItemPresentation getPresentation() { - return HaskellPsiImplUtil.getPresentation(this); - } - - public SearchScope getUseScope() { - return HaskellPsiImplUtil.getUseScope(this); - } - -} diff --git a/intellij/haskell/psi/impl/HaskellVarsImpl.java b/intellij/haskell/psi/impl/HaskellVarsImpl.java deleted file mode 100644 index 5577f07d..00000000 --- a/intellij/haskell/psi/impl/HaskellVarsImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -// This is a generated file. Not intended for manual editing. -package intellij.haskell.psi.impl; - -import java.util.List; -import org.jetbrains.annotations.*; -import com.intellij.lang.ASTNode; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiElementVisitor; -import com.intellij.psi.util.PsiTreeUtil; -import static intellij.haskell.psi.HaskellTypes.*; -import intellij.haskell.psi.*; - -public class HaskellVarsImpl extends HaskellCompositeElementImpl implements HaskellVars { - - public HaskellVarsImpl(ASTNode node) { - super(node); - } - - public void accept(@NotNull HaskellVisitor visitor) { - visitor.visitVars(this); - } - - public void accept(@NotNull PsiElementVisitor visitor) { - if (visitor instanceof HaskellVisitor) accept((HaskellVisitor)visitor); - else super.accept(visitor); - } - - @Override - @NotNull - public List getQvarList() { - return PsiTreeUtil.getChildrenOfTypeAsList(this, HaskellQvar.class); - } - -} diff --git a/project/build.properties b/project/build.properties index 817bc38d..35c88bab 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.9 +sbt.version=0.13.12 diff --git a/src/main/resources/icons/cabal.png b/src/main/resources/icons/cabal.png new file mode 100644 index 00000000..82462531 Binary files /dev/null and b/src/main/resources/icons/cabal.png differ diff --git a/src/main/scala/intellij/haskell/HaskellFile.scala b/src/main/scala/intellij/haskell/HaskellFile.scala index 11b509fe..5e835100 100644 --- a/src/main/scala/intellij/haskell/HaskellFile.scala +++ b/src/main/scala/intellij/haskell/HaskellFile.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,32 +62,8 @@ class HaskellFileType extends LanguageFileType(HaskellLanguage.Instance) { } } -object LiterateHaskellFileType { - final val INSTANCE: LiterateHaskellFileType = new LiterateHaskellFileType -} - -class LiterateHaskellFileType extends LanguageFileType(HaskellLanguage.Instance) { - - def getName: String = { - "Literate Haskell file" - } - - def getDescription: String = { - "Literate Haskell language file" - } - - def getDefaultExtension: String = { - "lhs" - } - - def getIcon: Icon = { - HaskellIcons.HaskellSmallLogo - } -} - class HaskellLanguageFileTypeFactory extends FileTypeFactory { def createFileTypes(consumer: FileTypeConsumer) { consumer.consume(HaskellFileType.INSTANCE, HaskellFileType.INSTANCE.getDefaultExtension) - consumer.consume(LiterateHaskellFileType.INSTANCE, LiterateHaskellFileType.INSTANCE.getDefaultExtension) } } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/HaskellIcons.scala b/src/main/scala/intellij/haskell/HaskellIcons.scala index 726fea0c..ea39aac8 100644 --- a/src/main/scala/intellij/haskell/HaskellIcons.scala +++ b/src/main/scala/intellij/haskell/HaskellIcons.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,4 +34,6 @@ object HaskellIcons { final val TypeSignature = IconLoader.getIcon("/icons/type_signature.png") final val Instance = IconLoader.getIcon("/icons/instance.png") final val Foreign = IconLoader.getIcon("/icons/foreign.png") + + final val CabalLogo = IconLoader.getIcon("/icons/cabal.png") } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/HaskellLanguage.java b/src/main/scala/intellij/haskell/HaskellLanguage.java index d4c5b6a9..5f3cec02 100644 --- a/src/main/scala/intellij/haskell/HaskellLanguage.java +++ b/src/main/scala/intellij/haskell/HaskellLanguage.java @@ -23,7 +23,7 @@ public class HaskellLanguage extends Language { public static final HaskellLanguage Instance = new HaskellLanguage(); - private HaskellLanguage() { + public HaskellLanguage() { super("Haskell"); } diff --git a/src/main/scala/intellij/haskell/HaskellNotificationGroup.scala b/src/main/scala/intellij/haskell/HaskellNotificationGroup.scala index 20069815..962e465e 100644 --- a/src/main/scala/intellij/haskell/HaskellNotificationGroup.scala +++ b/src/main/scala/intellij/haskell/HaskellNotificationGroup.scala @@ -21,17 +21,27 @@ import com.intellij.openapi.ui.MessageType object HaskellNotificationGroup { - private val Group = NotificationGroup.logOnlyGroup("Haskell") + private val LogOnlyGroup = NotificationGroup.logOnlyGroup("LogOnly Haskell") + private val BalloonGroup = NotificationGroup.balloonGroup("Balllon Haskell") - def notifyError(message: String) { - Group.createNotification(message, MessageType.ERROR).notify(null) + + def logError(message: String) { + LogOnlyGroup.createNotification(message, MessageType.ERROR).notify(null) } - def notifyWarning(message: String) { - Group.createNotification(message, MessageType.WARNING).notify(null) + def logWarning(message: String) { + LogOnlyGroup.createNotification(message, MessageType.WARNING).notify(null) } - def notifyInfo(message: String) { - Group.createNotification(message, MessageType.INFO).notify(null) + def logInfo(message: String) { + LogOnlyGroup.createNotification(message, MessageType.INFO).notify(null) + } + + def notifyBalloonWarning(message: String) { + BalloonGroup.createNotification(message, MessageType.WARNING).notify(null) + } + + def notifyBalloonError(message: String) { + BalloonGroup.createNotification(message, MessageType.ERROR).notify(null) } } diff --git a/src/main/scala/intellij/haskell/HaskellParserDefinition.scala b/src/main/scala/intellij/haskell/HaskellParserDefinition.scala index 60d08c64..1a204022 100644 --- a/src/main/scala/intellij/haskell/HaskellParserDefinition.scala +++ b/src/main/scala/intellij/haskell/HaskellParserDefinition.scala @@ -35,7 +35,7 @@ object HaskellParserDefinition { final val SPECIAL_RESERVED_IDS = TokenSet.create(HS_TYPE_FAMILY, HS_FOREIGN_IMPORT, HS_FOREIGN_EXPORT, HS_TYPE_INSTANCE) final val ALL_RESERVED_IDS = TokenSet.orSet(RESERVED_IDS, SPECIAL_RESERVED_IDS) final val RESERVED_OPERATORS = TokenSet.create(HS_COLON_COLON, HS_EQUAL, HS_BACKSLASH, HS_VERTICAL_BAR, HS_LEFT_ARROW, - HS_RIGHT_ARROW, HS_AT, HS_TILDE, HS_DOUBLE_RIGHT_ARROW, HS_COLON) + HS_RIGHT_ARROW, HS_AT, HS_TILDE, HS_DOUBLE_RIGHT_ARROW, HS_DOT_DOT) final val OPERATORS = TokenSet.orSet(RESERVED_OPERATORS, TokenSet.create(HS_VARSYM_ID, HS_CONSYM_ID), TokenSet.create(HS_DOT)) final val NUMBERS = TokenSet.create(HS_DECIMAL, HS_FLOAT, HS_HEXADECIMAL, HS_OCTAL) final val SYMBOLS_RES_OP = TokenSet.create(HS_EQUAL, HS_AT, HS_BACKSLASH, HS_VERTICAL_BAR, HS_TILDE) diff --git a/src/main/scala/intellij/haskell/_HaskellLexer.flex b/src/main/scala/intellij/haskell/_HaskellLexer.flex index 6e625004..dd8b0bc9 100644 --- a/src/main/scala/intellij/haskell/_HaskellLexer.flex +++ b/src/main/scala/intellij/haskell/_HaskellLexer.flex @@ -23,7 +23,7 @@ import static intellij.haskell.psi.HaskellTypes.*; private int commentDepth; %} -%xstate NCOMMENT, TEX +%xstate NCOMMENT control_character = [\000 - \037] newline = \r|\n|\r\n @@ -62,7 +62,7 @@ hash = "#" dollar = "$" percentage = "%" ampersand = "&" -star = "*" +star = "*" | "★" plus = "+" dot = "." slash = "/" @@ -80,11 +80,11 @@ vertical_bar = "|" tilde = "~" colon = ":" -// reservedop and not symbol, '..' is handled as two dots as symbol, see also special symbol (..) colon_colon = "::" left_arrow = "<-" | "\u2190" right_arrow = "->" | "\u2192" double_right_arrow = "=>" | "\u21D2" +dot_dot = ".." // special left_paren = "(" @@ -102,8 +102,8 @@ quote = "'" symbol_no_colon_dot = {equal} | {at} | {backslash} | {vertical_bar} | {tilde} | {exclamation_mark} | {hash} | {dollar} | {percentage} | {ampersand} | {star} | {plus} | {slash} | {lt} | {gt} | {question_mark} | {caret} | {dash} -var_id = {small} ({small} | {large} | {digit} | {quote})* {hash}* -varsym_id = ({symbol_no_colon_dot} | {dot}) ({symbol_no_colon_dot} | {dot} | {colon})* +var_id = {question_mark}? {small} ({small} | {large} | {digit} | {quote})* {hash}* +varsym_id = {symbol_no_colon_dot} ({symbol_no_colon_dot} | {dot} | {colon})* con_id = {large} ({small} | {large} | {digit} | {quote})* {hash}* consym_id = {quote}? {colon} ({symbol_no_colon_dot} | {dot} | {colon})* @@ -120,18 +120,12 @@ shebang_line = {hash} {exclamation_mark} [^\r\n]* pragma_start = "{-#" pragma_end = "#-}" -comment = ({dash}{dash}[^\r\n]* | "\\begin{code}") {newline}? +comment = {dash}{dash}[^\r\n]* | "\\begin{code}" ncomment_start = "{-" ncomment_end = "-}" %% - { - [^\\]+ { return HS_NCOMMENT; } - "\\begin{code}" { yybegin(YYINITIAL); return HS_NCOMMENT; } - \\+* { return HS_NCOMMENT; } -} - { {ncomment_start} { commentDepth++; @@ -159,7 +153,7 @@ ncomment_end = "-}" .|{white_char}|{newline} {} } -{ncomment_start}({white_char} | {newline} | [^#\-\}]) { +{ncomment_start}({white_char} | {newline} | "-" | [^#\-\}]) { yybegin(NCOMMENT); commentDepth = 0; commentStart = getTokenStart(); @@ -174,7 +168,6 @@ ncomment_end = "-}" {pragma_start} { return HS_PRAGMA_START; } {pragma_end} { return HS_PRAGMA_END; } - // not listed as reserved identifier but have meaning in certain context, // let's say specialreservedid "type family" { return HS_TYPE_FAMILY; } @@ -208,18 +201,17 @@ ncomment_end = "-}" "_" { return HS_UNDERSCORE; } // identifiers - {var_id} { return HS_VARID_ID; } - {con_id} { return HS_CONID_ID; } + {var_id} { return HS_VAR_ID; } + {con_id} { return HS_CON_ID; } {character_literal} { return HS_CHARACTER_LITERAL; } {string_literal} { return HS_STRING_LITERAL; } - // reservedop and no symbol, except dot_dot because this one is handled as symbol + // reservedop and no symbol, except dot_dot because that one is handled as symbol {colon_colon} { return HS_COLON_COLON; } {left_arrow} { return HS_LEFT_ARROW; } {right_arrow} { return HS_RIGHT_ARROW; } {double_right_arrow} { return HS_DOUBLE_RIGHT_ARROW; } - {colon} { return HS_COLON; } // number {decimal} { return HS_DECIMAL; } @@ -234,13 +226,14 @@ ncomment_end = "-}" {vertical_bar} { return HS_VERTICAL_BAR; } {tilde} { return HS_TILDE; } - // symbols - {dot} { return HS_DOT; } + {dot_dot} { return HS_DOT_DOT; } // symbol identifiers {varsym_id} { return HS_VARSYM_ID; } {consym_id} { return HS_CONSYM_ID; } + {dot} { return HS_DOT; } + // special {left_paren} { return HS_LEFT_PAREN; } {right_paren} { return HS_RIGHT_PAREN; } @@ -254,9 +247,6 @@ ncomment_end = "-}" {quote} { return HS_QUOTE; } - "\\end{code}" { yybegin(TEX); return HS_NCOMMENT; } - "\\section" { yybegin(TEX); return HS_NCOMMENT; } - {quasi_quote_e_start} { return HS_QUASI_QUOTE_E_START; } {quasi_quote_d_start} { return HS_QUASI_QUOTE_D_START; } {quasi_quote_t_start} { return HS_QUASI_QUOTE_T_START; } diff --git a/src/main/scala/intellij/haskell/_HaskellLexer.java b/src/main/scala/intellij/haskell/_HaskellLexer.java index 1ecdabd8..09b311e4 100644 --- a/src/main/scala/intellij/haskell/_HaskellLexer.java +++ b/src/main/scala/intellij/haskell/_HaskellLexer.java @@ -1,24 +1,28 @@ -/* The following code was generated by JFlex 1.4.3 on 4/20/16 5:59 PM */ +/* The following code was generated by JFlex 1.7.0-SNAPSHOT tweaked for IntelliJ platform */ package intellij.haskell; -import com.intellij.lexer.*; + +import com.intellij.lexer.FlexLexer; import com.intellij.psi.tree.IElementType; + import static intellij.haskell.psi.HaskellTypes.*; /** * This class is a scanner generated by - * JFlex 1.4.3 - * on 4/20/16 5:59 PM from the specification file - * /Users/rik/idea/intellij-haskell/src/main/scala/intellij/haskell/_HaskellLexer.flex + * JFlex 1.7.0-SNAPSHOT + * from the specification file _HaskellLexer.flex */ public class _HaskellLexer 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 TEX = 4; public static final int NCOMMENT = 2; /** @@ -28,29 +32,36 @@ public class _HaskellLexer implements FlexLexer { * 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 + 0, 0, 1, 1 }; /** * Translates characters to character classes + * Chosen bits are [9, 6, 6] + * Total runtime size is 1952 bytes */ - private static final String ZZ_CMAP_PACKED = - "\1\1\4\0\1\1\3\0\1\1\1\3\1\0\1\1\1\2\21\0"+ - "\1\1\1\4\1\70\1\67\1\5\1\71\1\71\1\40\1\66\1\106"+ - "\1\107\1\71\1\72\1\110\1\25\1\73\1\71\1\30\1\62\1\62"+ - "\1\62\1\62\3\33\2\24\1\102\1\111\1\74\1\76\1\75\1\71"+ - "\1\77\1\52\1\55\1\53\1\27\1\35\1\56\1\65\1\47\1\61"+ - "\1\23\1\54\1\45\1\64\1\43\1\34\1\61\1\51\1\60\1\46"+ - "\1\50\1\44\1\57\1\23\1\32\1\63\1\23\1\112\1\21\1\36"+ - "\1\42\1\37\1\113\1\26\1\120\1\17\1\10\1\11\1\7\1\121"+ - "\1\125\1\6\2\22\1\13\1\123\1\12\1\16\1\117\1\22\1\15"+ - "\1\14\1\116\1\20\1\41\1\124\1\31\1\122\1\22\1\114\1\100"+ - "\1\115\1\101\u2111\0\1\103\1\0\1\104\77\0\1\105\ude2d\0"; + public static int ZZ_CMAP(int ch) { + return ZZ_CMAP_A[(ZZ_CMAP_Y[ZZ_CMAP_Z[ch>>12]|((ch>>6)&0x3f)]<<6)|(ch&0x3f)]; + } - /** - * Translates characters to character classes - */ - private static final char [] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED); + /* The ZZ_CMAP_Z table has 272 entries */ + static final char ZZ_CMAP_Z[] = zzUnpackCMap( + "\1\0\1\100\1\200\u010d\100"); + + /* The ZZ_CMAP_Y table has 192 entries */ + static final char ZZ_CMAP_Y[] = zzUnpackCMap( + "\1\0\1\1\1\2\175\3\1\4\5\3\1\5\1\6\20\3\1\7\47\3"); + + /* The ZZ_CMAP_A table has 512 entries */ + static final char ZZ_CMAP_A[] = zzUnpackCMap( + "\1\1\4\0\1\1\3\0\1\1\1\3\1\35\1\36\1\2\21\0\1\1\1\4\1\72\1\71\1\5\2\73\1\42"+ + "\1\70\1\111\1\112\1\73\1\74\1\113\1\25\1\75\1\73\1\30\4\64\3\33\2\24\1\105"+ + "\1\114\1\76\1\101\1\77\1\100\1\102\1\54\1\57\1\55\1\27\1\37\1\60\1\67\1\51"+ + "\1\63\1\23\1\56\1\47\1\66\1\45\1\34\1\63\1\53\1\62\1\50\1\52\1\46\1\61\1\23"+ + "\1\32\1\65\1\23\1\115\1\21\1\40\1\44\1\41\1\116\1\26\1\123\1\17\1\10\1\11"+ + "\1\7\1\124\1\130\1\6\2\22\1\13\1\126\1\12\1\16\1\122\1\22\1\15\1\14\1\121"+ + "\1\20\1\43\1\127\1\31\1\125\1\22\1\117\1\103\1\120\1\104\6\0\1\35\242\0\2"+ + "\35\46\0\1\106\1\0\1\107\77\0\1\110\62\0\1\73\72\0"); /** * Translates DFA states to action switch labels. @@ -58,28 +69,27 @@ public class _HaskellLexer implements FlexLexer { private static final int [] ZZ_ACTION = zzUnpackAction(); private static final String ZZ_ACTION_PACKED_0 = - "\2\0\1\1\1\2\1\3\2\4\1\5\11\6\1\7"+ - "\1\10\1\11\1\5\1\11\1\12\1\13\1\5\1\14"+ - "\1\2\1\5\1\15\1\5\1\16\1\17\1\20\1\21"+ + "\2\0\1\1\1\2\2\3\1\4\11\5\1\6\1\7"+ + "\1\10\1\4\1\10\1\11\1\12\1\4\1\13\1\1"+ + "\1\4\1\14\2\4\1\15\1\16\1\17\1\20\1\21"+ "\1\22\1\23\1\24\1\25\1\26\1\27\1\30\1\31"+ - "\1\32\1\33\1\34\1\35\3\6\4\36\2\1\5\0"+ - "\2\5\1\6\1\37\1\40\3\6\1\41\4\6\1\42"+ - "\2\6\1\0\1\5\3\0\1\10\2\0\1\5\1\43"+ - "\1\24\1\44\4\0\1\45\1\0\1\46\1\0\1\23"+ - "\1\25\1\47\1\45\1\50\3\0\1\51\2\0\1\52"+ - "\4\6\1\53\1\54\1\1\1\0\1\3\6\0\1\55"+ - "\1\56\11\6\1\57\2\6\1\60\3\0\1\60\1\0"+ - "\2\43\1\61\1\62\1\63\37\0\1\64\1\65\1\66"+ - "\1\67\2\70\1\71\4\6\2\53\1\0\1\3\7\0"+ - "\6\6\1\72\1\73\2\6\1\74\32\0\1\75\1\76"+ - "\2\6\1\0\1\3\3\0\1\77\6\6\1\100\4\0"+ - "\1\6\1\101\2\0\1\102\1\103\1\6\1\104\4\6"+ - "\5\0\1\105\1\0\2\6\1\106\1\6\1\107\6\0"+ - "\1\110\1\0\1\111\1\0\1\112\25\0\1\113\3\0"+ - "\1\43\1\0\1\114\2\0\1\115\1\116\1\117"; + "\1\32\1\33\1\34\3\5\4\35\5\0\2\4\1\5"+ + "\1\36\1\37\3\5\1\40\4\5\1\41\2\5\1\0"+ + "\1\4\1\0\1\7\2\0\1\4\1\42\1\23\1\43"+ + "\4\0\1\21\1\0\1\44\1\0\1\45\1\22\1\24"+ + "\1\46\1\21\1\47\4\0\1\50\2\0\1\51\4\5"+ + "\1\52\1\53\1\2\6\0\1\54\1\55\11\5\1\56"+ + "\2\5\1\57\1\0\1\57\1\0\1\60\1\61\1\62"+ + "\37\0\1\63\1\64\1\65\1\66\2\67\1\70\4\5"+ + "\2\52\1\2\7\0\6\5\1\71\1\72\2\5\1\73"+ + "\30\0\1\74\1\75\2\5\1\2\3\0\1\76\6\5"+ + "\1\77\2\0\1\5\1\100\1\0\1\101\1\102\1\5"+ + "\1\103\4\5\3\0\1\104\2\5\1\105\1\5\1\106"+ + "\3\0\1\107\1\0\1\110\21\0\1\111\2\0\1\42"+ + "\3\0\1\112\1\113\1\114"; private static int [] zzUnpackAction() { - int [] result = new int[327]; + int [] result = new int[298]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; @@ -104,50 +114,47 @@ public class _HaskellLexer implements FlexLexer { private static final int [] ZZ_ROWMAP = zzUnpackRowMap(); private static final String ZZ_ROWMAP_PACKED_0 = - "\0\0\0\126\0\254\0\u0102\0\u0158\0\u01ae\0\u0102\0\u0204"+ - "\0\u025a\0\u02b0\0\u0306\0\u035c\0\u03b2\0\u0408\0\u045e\0\u04b4"+ - "\0\u050a\0\u0560\0\u05b6\0\u060c\0\u0662\0\u06b8\0\u0102\0\u045e"+ - "\0\u070e\0\u0764\0\u07ba\0\u0810\0\u070e\0\u0866\0\u08bc\0\u070e"+ - "\0\u0912\0\u070e\0\u0968\0\u0102\0\u0102\0\u0102\0\u0102\0\u0102"+ - "\0\u0102\0\u0102\0\u09be\0\u0102\0\u0a14\0\u0102\0\u0a6a\0\u0ac0"+ - "\0\u0b16\0\u0102\0\u0b6c\0\u0bc2\0\u0c18\0\u0c6e\0\u0cc4\0\u0d1a"+ - "\0\u0d70\0\u0dc6\0\u0e1c\0\u0e72\0\u0ec8\0\u0f1e\0\u0f74\0\u045e"+ - "\0\u0fca\0\u1020\0\u1076\0\u10cc\0\u045e\0\u1122\0\u1178\0\u11ce"+ - "\0\u1224\0\u045e\0\u127a\0\u12d0\0\u1326\0\u137c\0\u13d2\0\u1428"+ - "\0\u147e\0\u14d4\0\u152a\0\u1580\0\u15d6\0\u162c\0\u070e\0\u0102"+ - "\0\u1682\0\u16d8\0\u172e\0\u1784\0\u17da\0\u07ba\0\u0102\0\u1830"+ - "\0\u070e\0\u070e\0\u0102\0\u1886\0\u1886\0\u18dc\0\u1932\0\u1988"+ - "\0\u0102\0\u19de\0\u1a34\0\u1a8a\0\u1ae0\0\u1b36\0\u1b8c\0\u1be2"+ - "\0\u1c38\0\u0102\0\u1c8e\0\u1ce4\0\u1d3a\0\u1d90\0\u1de6\0\u1e3c"+ - "\0\u1e92\0\u1ee8\0\u1f3e\0\u0102\0\u1f94\0\u1fea\0\u2040\0\u2096"+ - "\0\u20ec\0\u2142\0\u2198\0\u21ee\0\u2244\0\u229a\0\u045e\0\u22f0"+ - "\0\u2346\0\u239c\0\u23f2\0\u2448\0\u249e\0\u24f4\0\u24f4\0\u254a"+ - "\0\u0102\0\u1682\0\u16d8\0\u0102\0\u25a0\0\u25f6\0\u264c\0\u26a2"+ - "\0\u26f8\0\u274e\0\u27a4\0\u27fa\0\u2850\0\u28a6\0\u28fc\0\u2952"+ - "\0\u29a8\0\u29fe\0\u2a54\0\u2aaa\0\u2b00\0\u2b56\0\u2bac\0\u2c02"+ - "\0\u2c58\0\u2cae\0\u2d04\0\u2d5a\0\u2db0\0\u2e06\0\u2e5c\0\u2eb2"+ - "\0\u2f08\0\u2f5e\0\u2fb4\0\u0102\0\u0102\0\u0102\0\u0102\0\u0102"+ - "\0\u300a\0\u0102\0\u3060\0\u30b6\0\u310c\0\u3162\0\u31b8\0\u0102"+ - "\0\u320e\0\u3264\0\u32ba\0\u3310\0\u3366\0\u33bc\0\u3412\0\u3468"+ - "\0\u34be\0\u3514\0\u356a\0\u35c0\0\u3616\0\u366c\0\u36c2\0\u045e"+ - "\0\u045e\0\u3718\0\u376e\0\u045e\0\u37c4\0\u381a\0\u3870\0\u38c6"+ - "\0\u391c\0\u3972\0\u39c8\0\u3a1e\0\u3a74\0\u3aca\0\u3b20\0\u3b76"+ - "\0\u3bcc\0\u3c22\0\u3c78\0\u3cce\0\u3d24\0\u3d7a\0\u3dd0\0\u3e26"+ - "\0\u3e7c\0\u3ed2\0\u3f28\0\u3f7e\0\u3fd4\0\u402a\0\u4080\0\u045e"+ - "\0\u40d6\0\u412c\0\u4182\0\u41d8\0\u422e\0\u4284\0\u42da\0\u4330"+ - "\0\u4386\0\u43dc\0\u4432\0\u4488\0\u44de\0\u4534\0\u045e\0\u458a"+ - "\0\u45e0\0\u4636\0\u468c\0\u46e2\0\u045e\0\u4738\0\u478e\0\u045e"+ - "\0\u045e\0\u47e4\0\u045e\0\u483a\0\u4890\0\u48e6\0\u493c\0\u4992"+ - "\0\u49e8\0\u4a3e\0\u4a94\0\u4aea\0\u045e\0\u4b40\0\u4b96\0\u4bec"+ - "\0\u045e\0\u4c42\0\u045e\0\u4c98\0\u4cee\0\u4d44\0\u4d9a\0\u4df0"+ - "\0\u4e46\0\u045e\0\u4e9c\0\u045e\0\u4ef2\0\u0102\0\u4f48\0\u4f9e"+ - "\0\u4ff4\0\u504a\0\u50a0\0\u50f6\0\u514c\0\u51a2\0\u51f8\0\u524e"+ - "\0\u52a4\0\u52fa\0\u5350\0\u53a6\0\u53fc\0\u5452\0\u54a8\0\u54fe"+ - "\0\u5554\0\u55aa\0\u5600\0\u0102\0\u5656\0\u56ac\0\u5702\0\u5758"+ - "\0\u57ae\0\u0102\0\u5804\0\u585a\0\u0102\0\u0102\0\u0102"; + "\0\0\0\131\0\262\0\u010b\0\u0164\0\262\0\u01bd\0\u0216"+ + "\0\u026f\0\u02c8\0\u0321\0\u037a\0\u03d3\0\u042c\0\u0485\0\u04de"+ + "\0\u0537\0\u0590\0\u05e9\0\u0642\0\u069b\0\262\0\u042c\0\u06f4"+ + "\0\u074d\0\u07a6\0\u07ff\0\u0858\0\u08b1\0\u090a\0\u0963\0\u06f4"+ + "\0\u09bc\0\u06f4\0\u0a15\0\262\0\262\0\262\0\262\0\262"+ + "\0\262\0\262\0\u0a6e\0\262\0\u0ac7\0\262\0\u0b20\0\u0b79"+ + "\0\u0bd2\0\262\0\u0c2b\0\u0c84\0\u0cdd\0\u0d36\0\u0d8f\0\u0de8"+ + "\0\u0e41\0\u0e9a\0\u0ef3\0\u0f4c\0\u0fa5\0\u042c\0\u0ffe\0\u1057"+ + "\0\u10b0\0\u1109\0\u042c\0\u1162\0\u11bb\0\u1214\0\u126d\0\u042c"+ + "\0\u12c6\0\u131f\0\u1378\0\u13d1\0\u142a\0\u1483\0\u14dc\0\u1535"+ + "\0\u158e\0\u15e7\0\u06f4\0\262\0\u1640\0\u1699\0\u16f2\0\u174b"+ + "\0\u17a4\0\u07a6\0\262\0\u17fd\0\262\0\u06f4\0\u06f4\0\262"+ + "\0\u1856\0\u1856\0\u18af\0\u1908\0\u1961\0\u19ba\0\262\0\u1a13"+ + "\0\u1a6c\0\u1ac5\0\u1b1e\0\u1b77\0\u1bd0\0\u1c29\0\u1c82\0\262"+ + "\0\u1cdb\0\u1d34\0\u1d8d\0\u1de6\0\u1e3f\0\u1e98\0\u1ef1\0\262"+ + "\0\u1f4a\0\u1fa3\0\u1ffc\0\u2055\0\u20ae\0\u2107\0\u2160\0\u21b9"+ + "\0\u2212\0\u226b\0\u042c\0\u22c4\0\u231d\0\u2376\0\u23cf\0\u2428"+ + "\0\u2428\0\u1640\0\u1699\0\262\0\u2481\0\u24da\0\u2533\0\u258c"+ + "\0\u25e5\0\u263e\0\u2697\0\u26f0\0\u2749\0\u27a2\0\u27fb\0\u2854"+ + "\0\u28ad\0\u2906\0\u295f\0\u29b8\0\u2a11\0\u2a6a\0\u2ac3\0\u2b1c"+ + "\0\u2b75\0\u2bce\0\u2c27\0\u2c80\0\u2cd9\0\u2d32\0\u2d8b\0\u2de4"+ + "\0\u2e3d\0\u2e96\0\u2eef\0\262\0\262\0\262\0\262\0\262"+ + "\0\u2f48\0\262\0\u2fa1\0\u2ffa\0\u3053\0\u30ac\0\u3105\0\262"+ + "\0\u315e\0\u31b7\0\u3210\0\u3269\0\u32c2\0\u331b\0\u3374\0\u33cd"+ + "\0\u3426\0\u347f\0\u34d8\0\u3531\0\u358a\0\u35e3\0\u042c\0\u042c"+ + "\0\u363c\0\u3695\0\u042c\0\u36ee\0\u3747\0\u37a0\0\u37f9\0\u3852"+ + "\0\u38ab\0\u3904\0\u395d\0\u39b6\0\u3a0f\0\u3a68\0\u3ac1\0\u3b1a"+ + "\0\u3b73\0\u3bcc\0\u3c25\0\u3c7e\0\u3cd7\0\u3d30\0\u3d89\0\u3de2"+ + "\0\u3e3b\0\u3e94\0\u3eed\0\u3f46\0\u042c\0\u3f9f\0\u3ff8\0\u4051"+ + "\0\u40aa\0\u4103\0\u415c\0\u41b5\0\u420e\0\u4267\0\u42c0\0\u4319"+ + "\0\u4372\0\u43cb\0\u042c\0\u4424\0\u447d\0\u44d6\0\u042c\0\u452f"+ + "\0\u042c\0\u042c\0\u4588\0\u042c\0\u45e1\0\u463a\0\u4693\0\u46ec"+ + "\0\u4745\0\u479e\0\u47f7\0\u042c\0\u4850\0\u48a9\0\u042c\0\u4902"+ + "\0\u042c\0\u495b\0\u49b4\0\u4a0d\0\u042c\0\u4a66\0\u042c\0\u4abf"+ + "\0\u4b18\0\u4b71\0\u4bca\0\u4c23\0\u4c7c\0\u4cd5\0\u4d2e\0\u4d87"+ + "\0\u4de0\0\u4e39\0\u4e92\0\u4eeb\0\u4f44\0\u4f9d\0\u4ff6\0\u504f"+ + "\0\262\0\u50a8\0\u5101\0\262\0\u515a\0\u51b3\0\u520c\0\262"+ + "\0\262\0\262"; private static int [] zzUnpackRowMap() { - int [] result = new int[327]; + int [] result = new int[298]; int offset = 0; offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result); return result; @@ -170,304 +177,319 @@ public class _HaskellLexer implements FlexLexer { private static final int [] ZZ_TRANS = zzUnpackTrans(); private static final String ZZ_TRANS_PACKED_0 = - "\1\4\1\5\1\6\1\7\1\5\1\10\1\11\1\12"+ - "\1\13\1\14\1\15\1\16\2\17\1\20\1\21\1\17"+ - "\1\22\1\17\1\23\1\24\1\25\1\17\1\23\1\26"+ - "\1\17\1\23\1\24\2\23\1\27\1\30\1\31\1\17"+ - "\1\31\17\23\1\24\3\23\1\32\1\33\2\31\1\34"+ - "\1\35\1\36\1\31\1\37\1\40\1\41\1\42\1\43"+ - "\1\44\1\45\1\46\1\47\1\50\1\51\1\52\1\53"+ - "\1\54\1\55\1\56\1\57\4\17\1\60\1\61\1\17"+ - "\2\62\1\63\22\62\1\64\66\62\1\65\11\62\21\66"+ - "\1\67\104\66\127\0\1\5\2\0\1\5\124\0\1\7"+ - "\123\0\1\70\2\0\1\70\1\31\1\71\1\0\1\72"+ - "\1\73\6\0\1\74\1\31\3\0\1\75\12\0\1\31"+ - "\1\0\1\31\25\0\1\76\12\31\30\0\1\77\1\17"+ - "\1\100\2\17\1\101\6\17\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\5\17"+ - "\1\102\2\17\5\0\1\77\10\17\1\103\2\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\10\17\5\0\1\77\3\17\1\104\4\17"+ - "\1\105\2\17\1\0\3\17\1\0\1\106\7\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\5\17\1\107\5\17\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\10\17"+ - "\5\0\1\77\3\17\1\110\7\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\10\17\5\0\1\77\3\17\1\111\7\17\1\0\3\17"+ - "\1\0\10\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\10\17\5\0\1\77\13\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\10\17\5\0\1\77\1\17\1\112\11\17\1\0\3\17"+ - "\1\0\10\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\10\17\5\0\1\77\5\17\1\113\5\17\1\0"+ - "\3\17\1\0\1\114\7\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\10\17\3\115\1\0\1\115\1\116"+ - "\3\115\1\117\2\115\1\120\4\115\1\116\3\115\1\116"+ - "\12\115\1\116\1\115\1\116\25\115\13\116\15\115\1\121"+ - "\5\115\5\0\1\122\13\23\1\0\3\23\1\0\10\23"+ - "\1\0\1\23\1\0\1\23\1\0\24\23\27\0\10\23"+ - "\11\0\1\123\7\0\1\124\2\0\1\24\3\0\1\24"+ - "\2\0\1\24\1\0\1\123\24\0\1\24\50\0\1\31"+ - "\13\0\1\125\2\0\1\24\1\126\2\0\1\24\2\0"+ - "\1\24\4\0\1\31\1\0\1\31\17\0\1\24\5\0"+ - "\5\31\1\127\5\31\12\0\1\130\21\0\1\123\4\0"+ - "\1\131\2\0\1\124\2\0\1\24\3\0\1\24\2\132"+ - "\1\24\1\131\1\123\24\0\1\24\50\0\1\31\13\0"+ - "\1\31\3\0\1\31\12\0\1\31\1\0\1\31\25\0"+ - "\13\31\23\0\3\133\1\0\15\133\1\134\44\133\1\0"+ - "\13\133\1\135\23\133\3\136\1\137\15\136\1\140\45\136"+ - "\1\137\36\136\5\0\1\31\13\0\1\125\2\0\1\24"+ - "\1\31\2\0\1\24\2\0\1\24\4\0\1\31\1\0"+ - "\1\31\17\0\1\24\5\0\13\31\30\0\1\31\13\0"+ - "\1\31\3\0\1\141\12\0\1\31\1\0\1\31\25\0"+ - "\13\31\30\0\1\31\13\0\1\31\3\0\1\31\12\0"+ - "\1\31\1\0\1\31\25\0\5\31\1\142\5\31\30\0"+ - "\1\31\13\0\1\31\3\0\1\31\10\0\1\143\1\0"+ - "\1\31\1\0\1\31\25\0\13\31\30\0\1\144\13\0"+ - "\1\144\3\0\1\144\12\0\1\144\1\0\1\144\25\0"+ - "\12\144\1\145\31\0\2\146\1\147\1\150\7\146\1\0"+ - "\1\146\3\0\1\146\2\0\1\146\5\0\1\146\1\0"+ - "\1\146\36\0\1\151\15\0\1\152\1\153\6\146\25\0"+ - "\1\154\105\0\1\77\13\17\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\4\17"+ - "\1\155\2\17\1\156\5\0\1\77\10\17\1\157\2\17"+ - "\1\0\3\17\1\0\10\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\10\17\5\0\1\77\13\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\7\17\1\160\3\0\1\62\237\0\1\161"+ - "\35\0\1\162\100\0\21\66\1\0\104\66\21\0\1\163"+ - "\76\0\1\164\6\0\1\70\2\0\1\70\1\0\1\71"+ - "\1\0\1\72\1\73\6\0\1\74\114\0\1\165\2\0"+ - "\1\166\124\0\1\167\126\0\1\170\1\171\1\0\1\172"+ - "\122\0\1\173\120\0\1\31\13\0\1\31\3\0\1\31"+ - "\12\0\1\31\1\0\1\31\25\0\13\31\12\0\1\174"+ - "\10\0\2\175\2\0\1\175\1\76\13\175\1\76\3\175"+ - "\1\76\12\175\1\76\1\175\1\76\25\175\13\76\23\175"+ - "\5\0\1\77\125\0\1\77\1\17\1\176\4\17\1\177"+ - "\4\17\1\0\3\17\1\0\10\17\1\0\1\17\1\0"+ - "\1\17\1\0\24\17\27\0\10\17\5\0\1\77\13\17"+ - "\1\0\3\17\1\0\10\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\1\17\1\200\6\17\5\0\1\77"+ - "\7\17\1\201\3\17\1\0\3\17\1\0\10\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\1\17\1\202\5\17\1\203\3\17\1\0\3\17"+ - "\1\0\10\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\10\17\5\0\1\77\13\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\1\204\7\17\5\0\1\77\6\17\1\205\4\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\10\17\5\0\1\77\13\17\1\0\3\17"+ - "\1\0\10\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\6\17\1\206\1\17\5\0\1\77\13\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\1\207\7\17\5\0\1\77\13\17\1\0"+ - "\3\17\1\0\1\210\7\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\10\17\5\0\1\77\6\17\1\211"+ - "\4\17\1\0\3\17\1\0\10\17\1\0\1\17\1\0"+ - "\1\17\1\0\24\17\27\0\10\17\24\0\1\212\3\0"+ - "\1\212\2\0\1\212\26\0\1\212\50\0\1\31\13\0"+ - "\1\31\2\0\1\212\1\31\2\0\1\212\2\0\1\212"+ - "\4\0\1\31\1\0\1\31\17\0\1\212\5\0\13\31"+ - "\35\0\1\213\11\0\1\212\3\0\1\212\2\0\1\212"+ - "\26\0\1\212\54\0\1\214\12\0\1\212\3\0\1\212"+ - "\2\0\1\212\26\0\1\212\54\0\1\215\12\0\1\212"+ - "\3\0\1\212\2\0\1\212\26\0\1\212\50\0\1\122"+ - "\144\0\1\216\1\217\2\0\1\216\2\0\1\216\26\0"+ - "\1\216\7\0\1\217\33\0\3\212\1\0\122\212\3\115"+ - "\1\0\1\115\1\116\13\115\1\116\3\115\1\116\12\115"+ - "\1\116\1\115\1\116\25\115\13\116\23\115\2\126\1\220"+ - "\1\221\122\126\30\0\1\222\2\0\1\222\26\0\1\222"+ - "\52\0\3\223\5\0\1\223\4\0\1\223\1\0\3\223"+ - "\2\0\1\223\1\0\1\223\14\0\2\223\1\0\2\223"+ - "\3\0\1\223\35\0\1\223\73\0\1\224\46\0\1\133"+ - "\2\0\1\133\2\0\1\133\1\225\2\0\1\133\2\0"+ - "\1\226\1\0\1\133\1\227\1\226\1\230\1\0\1\226"+ - "\1\0\1\231\2\0\2\133\1\232\1\233\1\234\1\235"+ - "\1\236\1\237\2\0\1\240\1\241\1\0\1\242\1\243"+ - "\1\237\1\234\1\0\1\226\2\0\1\234\2\133\26\0"+ - "\1\133\1\0\1\133\12\0\1\144\13\0\1\144\3\0"+ - "\1\144\12\0\1\144\1\0\1\144\23\0\1\224\1\0"+ - "\13\144\24\0\4\244\2\0\1\136\2\0\1\136\2\0"+ - "\1\136\1\245\2\0\1\136\2\0\1\136\1\0\1\136"+ - "\1\246\1\136\1\247\1\0\1\136\1\0\1\250\2\0"+ - "\2\136\1\251\1\252\1\253\1\254\1\255\1\256\2\0"+ - "\1\257\1\260\1\0\1\261\1\262\1\256\1\253\1\0"+ - "\1\136\2\0\1\253\2\136\26\0\1\136\1\0\1\136"+ - "\12\0\1\144\13\0\1\144\3\0\1\144\12\0\1\144"+ - "\1\0\1\144\25\0\13\144\30\0\1\263\13\146\1\0"+ - "\3\146\1\0\10\146\1\0\1\146\1\0\1\146\1\0"+ - "\24\146\11\0\1\264\15\0\10\146\5\0\1\263\13\146"+ - "\1\0\3\146\1\0\10\146\1\0\1\146\1\0\1\146"+ - "\1\0\24\146\11\0\1\265\15\0\10\146\5\0\1\263"+ - "\13\146\1\0\3\146\1\0\10\146\1\0\1\146\1\0"+ - "\1\146\1\0\24\146\11\0\1\151\15\0\10\146\5\0"+ - "\1\263\13\146\1\0\3\146\1\0\10\146\1\0\1\146"+ - "\1\0\1\146\1\0\24\146\11\0\1\266\15\0\10\146"+ - "\5\0\1\263\13\146\1\0\3\146\1\0\10\146\1\0"+ - "\1\146\1\0\1\146\1\0\24\146\11\0\1\267\15\0"+ - "\10\146\2\270\1\271\2\270\1\272\17\270\1\0\67\270"+ - "\1\0\10\270\5\0\1\77\13\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\1\17\1\273\6\17\5\0\1\77\3\17\1\274\7\17"+ - "\1\0\3\17\1\0\10\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\10\17\5\0\1\77\2\17\1\275"+ - "\10\17\1\0\3\17\1\0\10\17\1\0\1\17\1\0"+ - "\1\17\1\0\24\17\27\0\10\17\5\0\1\77\3\17"+ - "\1\276\7\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\10\17\2\0\1\277"+ - "\1\300\143\0\1\163\115\0\1\301\114\0\2\165\2\0"+ - "\15\165\1\302\104\165\17\0\1\303\115\0\1\304\126\0"+ - "\1\305\123\0\1\306\5\0\1\307\126\0\1\310\120\0"+ - "\1\311\115\0\2\175\2\0\122\175\5\0\1\77\1\312"+ - "\12\17\1\0\3\17\1\0\10\17\1\0\1\17\1\0"+ - "\1\17\1\0\24\17\27\0\10\17\5\0\1\77\13\17"+ - "\1\0\3\17\1\0\10\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\1\313\7\17\5\0\1\77\10\17"+ - "\1\314\2\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\10\17\5\0\1\77"+ - "\3\17\1\315\7\17\1\0\3\17\1\0\10\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\13\17\1\0\3\17\1\0\1\316\7\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\1\317\12\17\1\0\3\17\1\0\10\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\13\17\1\0\3\17\1\0\1\320\7\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\3\17\1\321\7\17\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\10\17"+ - "\5\0\1\77\13\17\1\0\3\17\1\0\10\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\1\322\7\17"+ - "\5\0\1\77\6\17\1\323\4\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\10\17\5\0\1\77\3\17\1\324\7\17\1\0\3\17"+ - "\1\0\10\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\10\17\11\0\1\123\12\0\1\212\3\0\1\212"+ - "\2\0\1\212\1\0\1\123\24\0\1\212\53\0\1\325"+ - "\134\0\1\326\227\0\1\327\30\0\1\216\3\0\1\216"+ - "\2\0\1\216\26\0\1\216\46\0\1\221\152\0\1\330"+ - "\2\0\1\330\26\0\1\330\67\0\1\226\3\0\1\226"+ - "\2\0\1\226\26\0\1\226\3\0\1\224\74\0\1\331"+ - "\7\0\1\332\5\0\1\333\61\0\3\334\5\0\1\334"+ - "\4\0\1\334\1\0\3\334\2\0\1\334\1\0\1\334"+ - "\14\0\2\334\1\0\2\334\3\0\1\334\35\0\1\334"+ - "\41\0\1\237\6\0\1\335\2\0\1\336\1\0\1\337"+ - "\13\0\1\133\62\0\1\133\1\0\1\133\3\0\1\133"+ - "\2\0\1\133\1\0\4\133\2\0\20\133\1\0\3\133"+ - "\11\0\1\133\12\0\1\133\57\0\1\331\5\0\1\340"+ - "\121\0\1\133\135\0\1\133\103\0\1\341\7\0\1\342"+ - "\3\0\1\343\10\0\1\133\1\0\1\344\112\0\1\133"+ - "\130\0\1\340\124\0\1\344\5\0\1\133\102\0\1\331"+ - "\10\0\1\133\125\0\1\133\7\0\1\133\50\0\4\244"+ - "\14\0\1\136\134\0\1\136\2\0\1\136\26\0\1\136"+ - "\100\0\1\345\7\0\1\346\5\0\1\347\61\0\3\136"+ - "\5\0\1\136\4\0\1\136\1\0\3\136\2\0\1\136"+ - "\1\0\1\136\14\0\2\136\1\0\2\136\3\0\1\136"+ - "\35\0\1\136\41\0\1\256\6\0\1\350\2\0\1\351"+ - "\1\0\1\352\13\0\1\136\62\0\1\136\1\0\1\136"+ - "\3\0\1\136\2\0\1\136\1\0\4\136\2\0\20\136"+ - "\1\0\3\136\11\0\1\136\12\0\1\136\57\0\1\345"+ - "\5\0\1\353\121\0\1\136\135\0\1\136\103\0\1\136"+ - "\7\0\1\354\3\0\1\355\10\0\1\136\1\0\1\356"+ - "\112\0\1\136\130\0\1\353\124\0\1\356\5\0\1\136"+ - "\102\0\1\345\10\0\1\136\125\0\1\136\7\0\1\136"+ - "\54\0\1\263\72\0\1\264\30\0\1\270\127\0\1\77"+ - "\3\17\1\357\7\17\1\0\3\17\1\0\10\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\4\17\1\360\6\17\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\10\17"+ - "\5\0\1\77\12\17\1\361\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\10\17"+ - "\5\0\1\77\7\17\1\362\3\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\10\17\3\0\1\300\243\0\1\363\4\0\2\165\1\364"+ - "\16\165\1\302\104\165\13\0\1\365\120\0\1\366\125\0"+ - "\1\306\126\0\1\165\127\0\1\165\132\0\1\367\120\0"+ - "\1\306\121\0\1\77\13\17\1\0\3\17\1\0\3\17"+ - "\1\370\4\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\10\17\5\0\1\77\13\17\1\0\3\17\1\0"+ - "\1\371\7\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\10\17\5\0\1\77\7\17\1\372\3\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\10\17\5\0\1\77\1\373\12\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\10\17\5\0\1\77\12\17\1\374\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\10\17\5\0\1\77\13\17\1\0\3\17"+ - "\1\0\10\17\1\0\1\17\1\0\1\375\1\0\24\17"+ - "\27\0\10\17\5\0\1\77\13\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\4\17\1\376\3\17\5\0\1\77\6\17\1\377\4\17"+ - "\1\0\3\17\1\0\10\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\10\17\114\0\1\u0100\127\0\1\u0101"+ - "\15\0\1\u0102\147\0\1\330\2\0\1\330\26\0\1\330"+ - "\3\0\1\224\104\0\1\133\115\0\1\133\152\0\1\133"+ - "\52\0\3\334\5\0\1\334\4\0\1\334\1\0\3\334"+ - "\2\0\1\334\1\0\1\334\14\0\2\334\1\0\2\334"+ - "\3\0\1\334\3\0\1\224\31\0\1\334\56\0\1\133"+ - "\127\0\1\133\104\0\1\133\22\0\1\133\124\0\1\133"+ - "\120\0\1\133\16\0\1\224\114\0\1\133\102\0\1\133"+ - "\136\0\1\133\127\0\1\136\115\0\1\136\152\0\1\136"+ - "\114\0\1\136\127\0\1\136\104\0\1\136\22\0\1\136"+ - "\124\0\1\136\126\0\1\136\102\0\1\136\136\0\1\136"+ - "\66\0\1\u0103\1\77\13\17\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\10\17"+ - "\5\0\1\77\5\17\1\u0104\5\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\10\17\5\0\1\77\3\17\1\u0105\7\17\1\0\3\17"+ - "\1\0\10\17\1\0\1\17\1\0\1\17\1\0\24\17"+ - "\27\0\10\17\6\0\1\u0106\117\0\2\165\1\0\16\165"+ - "\1\302\104\165\20\0\1\u0107\117\0\1\307\130\0\1\165"+ - "\115\0\1\77\5\17\1\u0108\1\17\1\u0109\3\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\10\17\5\0\1\77\4\17\1\u010a\6\17"+ - "\1\0\3\17\1\0\10\17\1\0\1\17\1\0\1\17"+ - "\1\0\24\17\27\0\10\17\5\0\1\77\13\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\1\u010b\7\17\5\0\1\77\13\17\1\0"+ - "\3\17\1\0\10\17\1\0\1\17\1\0\1\17\1\0"+ - "\24\17\27\0\3\17\1\u010c\4\17\5\0\1\77\5\17"+ - "\1\u010d\5\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\10\17\5\0\1\77"+ - "\1\u010e\12\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\10\17\5\0\1\77"+ - "\13\17\1\0\3\17\1\0\10\17\1\0\1\17\1\0"+ - "\1\17\1\0\24\17\27\0\1\17\1\u010f\6\17\17\0"+ - "\1\u0110\114\0\1\u0111\131\0\1\u0112\121\0\1\u0113\1\u0114"+ - "\123\0\1\77\3\17\1\u0115\7\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\10\17\12\0\1\u0116\123\0\1\307\122\0\1\77\11\17"+ - "\1\u0117\1\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\10\17\5\0\1\77"+ - "\4\17\1\u0118\6\17\1\0\3\17\1\0\10\17\1\0"+ - "\1\17\1\0\1\17\1\0\24\17\27\0\10\17\5\0"+ - "\1\77\13\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\1\u0119\7\17\5\0"+ - "\1\77\4\17\1\u011a\6\17\1\0\3\17\1\0\10\17"+ - "\1\0\1\17\1\0\1\17\1\0\24\17\27\0\10\17"+ - "\5\0\1\77\3\17\1\u011b\7\17\1\0\3\17\1\0"+ - "\10\17\1\0\1\17\1\0\1\17\1\0\24\17\27\0"+ - "\10\17\16\0\1\u011c\125\0\1\u011d\223\0\1\u011e\23\0"+ - "\1\u011f\141\0\1\u0120\213\0\1\u0121\16\0\1\77\3\17"+ - "\1\u0122\7\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\10\17\4\0\1\u0123"+ - "\1\77\13\17\1\0\3\17\1\0\10\17\1\0\1\17"+ - "\1\0\1\17\1\0\24\17\27\0\10\17\5\0\1\77"+ - "\13\17\1\0\3\17\1\0\10\17\1\0\1\17\1\0"+ - "\1\17\1\0\24\17\27\0\3\17\1\u0124\4\17\10\0"+ - "\1\u0125\127\0\1\u0126\132\0\1\u0127\122\0\1\u0128\234\0"+ - "\1\u0129\21\0\1\u012a\114\0\1\u012b\2\0\1\u012c\125\0"+ - "\1\u012d\132\0\1\u012e\225\0\1\u012f\15\0\1\u0130\135\0"+ - "\1\u0131\232\0\1\u0132\33\0\1\u0133\211\0\1\u0126\20\0"+ - "\1\u0134\143\0\1\u0135\112\0\1\u0136\122\0\1\u0137\234\0"+ - "\1\u0138\125\0\1\u0139\17\0\1\u013a\126\0\1\u013b\235\0"+ - "\1\u013c\14\0\1\u013d\132\0\1\u013e\125\0\1\u013f\224\0"+ - "\1\u0140\27\0\1\u0141\223\0\1\u0142\25\0\1\u0143\125\0"+ - "\1\u0144\112\0\1\220\1\221\133\0\1\u0145\232\0\1\u0146"+ - "\125\0\1\u0147\7\0"; + "\1\3\1\4\1\5\1\6\1\4\1\7\1\10\1\11"+ + "\1\12\1\13\1\14\1\15\2\16\1\17\1\20\1\16"+ + "\1\21\1\16\1\22\1\23\1\24\1\16\1\22\1\25"+ + "\1\16\1\22\1\23\1\22\1\0\1\4\1\22\1\26"+ + "\1\27\1\30\1\16\1\30\17\22\1\23\3\22\1\31"+ + "\1\32\2\30\1\33\1\34\1\35\1\30\1\36\1\37"+ + "\1\40\1\41\1\42\1\43\1\44\1\45\1\46\1\47"+ + "\1\50\1\51\1\52\1\53\1\54\1\55\1\56\1\57"+ + "\4\16\1\60\1\61\1\16\2\62\1\63\22\62\1\64"+ + "\7\62\1\0\61\62\1\65\11\62\132\0\1\4\2\0"+ + "\1\4\31\0\1\4\75\0\1\6\126\0\1\66\2\0"+ + "\1\66\1\30\1\67\1\0\1\70\1\71\6\0\1\72"+ + "\1\30\3\0\1\73\10\0\1\66\3\0\1\30\1\0"+ + "\1\30\25\0\1\74\13\30\30\0\1\75\1\16\1\76"+ + "\2\16\1\77\6\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\5\16\1\100\2\16\5\0\1\75\10\16\1\101\2\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\3\16\1\102\4\16\1\103\2\16\1\0\3\16\1\0"+ + "\1\104\6\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\5\16\1\105"+ + "\5\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\5\0"+ + "\1\75\3\16\1\106\7\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\10\16\5\0\1\75\3\16\1\107\7\16\1\0"+ + "\3\16\1\0\7\16\2\0\1\16\1\0\1\16\1\0"+ + "\1\16\1\0\24\16\30\0\10\16\5\0\1\75\13\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\1\16\1\110\11\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\10\16\5\0\1\75\5\16\1\111\5\16\1\0\3\16"+ + "\1\0\1\112\6\16\2\0\1\16\1\0\1\16\1\0"+ + "\1\16\1\0\24\16\30\0\10\16\2\113\2\0\1\113"+ + "\1\114\13\113\1\114\3\113\1\114\7\113\2\0\3\113"+ + "\1\114\1\113\1\114\25\113\14\114\15\113\1\115\5\113"+ + "\5\0\1\116\13\22\1\0\3\22\1\0\7\22\2\0"+ + "\1\22\1\0\1\22\1\0\1\22\1\0\24\22\30\0"+ + "\10\22\11\0\1\117\7\0\1\120\2\0\1\23\3\0"+ + "\1\23\2\0\1\23\3\0\1\117\24\0\1\23\51\0"+ + "\1\30\13\0\1\121\2\0\1\23\1\122\2\0\1\23"+ + "\2\0\1\23\6\0\1\30\1\0\1\30\17\0\1\23"+ + "\5\0\5\30\1\123\6\30\12\0\1\124\21\0\1\117"+ + "\4\0\1\125\2\0\1\120\2\0\1\23\3\0\1\23"+ + "\2\126\1\23\1\125\2\0\1\117\24\0\1\23\51\0"+ + "\1\30\13\0\1\30\3\0\1\30\14\0\1\30\1\0"+ + "\1\30\25\0\14\30\23\0\3\127\1\0\15\127\1\130"+ + "\46\127\1\0\14\127\1\131\23\127\3\132\1\133\15\132"+ + "\1\134\47\132\1\133\37\132\5\0\1\30\13\0\1\121"+ + "\2\0\1\23\1\30\2\0\1\23\2\0\1\23\6\0"+ + "\1\30\1\0\1\30\17\0\1\23\5\0\14\30\120\0"+ + "\1\135\40\0\1\30\13\0\1\30\3\0\1\136\14\0"+ + "\1\30\1\0\1\30\25\0\14\30\30\0\1\30\13\16"+ + "\1\30\1\16\2\0\1\30\1\16\2\0\1\16\7\0"+ + "\1\16\1\30\1\16\1\30\25\0\14\30\13\0\10\16"+ + "\5\0\1\30\13\0\1\30\3\0\1\30\14\0\1\30"+ + "\1\0\1\30\25\0\5\30\1\137\6\30\30\0\1\30"+ + "\13\0\1\30\3\0\1\30\12\0\1\140\1\0\1\30"+ + "\1\0\1\30\25\0\14\30\30\0\1\141\13\0\1\141"+ + "\3\0\1\141\14\0\1\141\1\0\1\141\25\0\13\141"+ + "\1\142\31\0\2\143\1\144\1\145\7\143\1\0\1\143"+ + "\3\0\1\143\2\0\1\143\7\0\1\143\1\0\1\143"+ + "\34\0\1\146\2\0\1\147\15\0\1\150\1\151\6\143"+ + "\25\0\1\152\110\0\1\75\13\16\1\0\3\16\1\0"+ + "\7\16\2\0\1\16\1\0\1\16\1\0\1\16\1\0"+ + "\24\16\30\0\4\16\1\153\2\16\1\154\5\0\1\75"+ + "\10\16\1\155\2\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\10\16\5\0\1\75\13\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\7\16\1\156\3\0\1\62\245\0\1\157\35\0"+ + "\1\160\104\0\1\66\2\0\1\66\1\0\1\67\1\0"+ + "\1\70\1\71\6\0\1\72\15\0\1\66\101\0\1\161"+ + "\2\0\1\162\127\0\1\163\131\0\1\164\1\165\1\0"+ + "\1\166\125\0\1\167\123\0\1\30\13\0\1\30\3\0"+ + "\1\30\14\0\1\30\1\0\1\30\25\0\14\30\12\0"+ + "\1\170\10\0\2\171\2\0\1\171\1\74\13\171\1\74"+ + "\3\171\1\74\14\171\1\74\1\171\1\74\25\171\14\74"+ + "\23\171\5\0\1\75\130\0\1\75\1\16\1\172\4\16"+ + "\1\173\4\16\1\0\3\16\1\0\7\16\2\0\1\16"+ + "\1\0\1\16\1\0\1\16\1\0\24\16\30\0\10\16"+ + "\5\0\1\75\13\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\1\16\1\174\6\16\5\0\1\75\7\16\1\175\3\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\1\16\1\176\5\16\1\177\3\16\1\0\3\16\1\0"+ + "\7\16\2\0\1\16\1\0\1\16\1\0\1\16\1\0"+ + "\24\16\30\0\10\16\5\0\1\75\13\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\1\200\7\16\5\0\1\75\6\16"+ + "\1\201\4\16\1\0\3\16\1\0\7\16\2\0\1\16"+ + "\1\0\1\16\1\0\1\16\1\0\24\16\30\0\10\16"+ + "\5\0\1\75\13\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\6\16\1\202\1\16\5\0\1\75\13\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\1\203\7\16\5\0\1\75\13\16"+ + "\1\0\3\16\1\0\1\204\6\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\5\0"+ + "\1\75\6\16\1\205\4\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\10\16\24\0\1\206\3\0\1\206\2\0\1\206"+ + "\30\0\1\206\51\0\1\30\13\0\1\30\2\0\1\206"+ + "\1\30\2\0\1\206\2\0\1\206\6\0\1\30\1\0"+ + "\1\30\17\0\1\206\5\0\14\30\34\0\1\207\12\0"+ + "\1\206\3\0\1\206\2\0\1\206\30\0\1\206\51\0"+ + "\1\116\147\0\1\210\1\211\2\0\1\210\2\0\1\210"+ + "\30\0\1\210\7\0\1\211\34\0\2\206\2\0\31\206"+ + "\2\0\72\206\2\113\2\0\1\113\1\114\13\113\1\114"+ + "\3\113\1\114\7\113\2\0\3\113\1\114\1\113\1\114"+ + "\25\113\14\114\23\113\2\122\2\0\125\122\30\0\1\212"+ + "\2\0\1\212\30\0\1\212\53\0\3\213\5\0\1\213"+ + "\4\0\1\213\1\0\3\213\2\0\1\213\3\0\1\213"+ + "\14\0\2\213\1\0\2\213\3\0\1\213\36\0\1\213"+ + "\75\0\1\214\47\0\1\127\2\0\1\127\2\0\1\127"+ + "\1\215\2\0\1\127\2\0\1\216\1\0\1\127\1\217"+ + "\1\216\1\220\1\0\1\216\3\0\1\221\2\0\2\127"+ + "\1\222\1\223\1\224\1\225\1\226\1\227\2\0\1\230"+ + "\1\231\1\0\1\232\1\233\1\227\1\224\1\0\1\216"+ + "\2\0\1\224\2\127\27\0\1\127\1\0\1\127\12\0"+ + "\1\141\13\0\1\141\3\0\1\141\14\0\1\141\1\0"+ + "\1\141\23\0\1\214\1\0\14\141\24\0\4\234\2\0"+ + "\1\132\2\0\1\132\2\0\1\132\1\235\2\0\1\132"+ + "\2\0\1\132\1\0\1\132\1\236\1\132\1\237\1\0"+ + "\1\132\2\0\1\234\1\240\2\0\2\132\1\241\1\242"+ + "\1\243\1\244\1\245\1\246\2\0\1\247\1\250\1\0"+ + "\1\251\1\252\1\246\1\243\1\0\1\132\2\0\1\243"+ + "\2\132\27\0\1\132\1\0\1\132\12\0\1\141\13\0"+ + "\1\141\3\0\1\141\14\0\1\141\1\0\1\141\25\0"+ + "\14\141\30\0\1\253\13\143\1\0\3\143\1\0\7\143"+ + "\2\0\1\143\1\0\1\143\1\0\1\143\1\0\24\143"+ + "\12\0\1\254\15\0\10\143\5\0\1\253\13\143\1\0"+ + "\3\143\1\0\7\143\2\0\1\143\1\0\1\143\1\0"+ + "\1\143\1\0\24\143\12\0\1\255\15\0\10\143\5\0"+ + "\1\253\13\143\1\0\3\143\1\0\7\143\2\0\1\143"+ + "\1\0\1\143\1\0\1\143\1\0\24\143\12\0\1\147"+ + "\15\0\10\143\6\0\13\143\1\0\1\143\3\0\1\143"+ + "\2\0\1\143\7\0\1\143\1\0\1\143\55\0\10\143"+ + "\5\0\1\253\13\143\1\0\3\143\1\0\7\143\2\0"+ + "\1\143\1\0\1\143\1\0\1\143\1\0\24\143\12\0"+ + "\1\256\15\0\10\143\5\0\1\253\13\143\1\0\3\143"+ + "\1\0\7\143\2\0\1\143\1\0\1\143\1\0\1\143"+ + "\1\0\24\143\12\0\1\257\15\0\10\143\2\260\1\261"+ + "\2\260\1\262\112\260\1\0\10\260\5\0\1\75\13\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\1\16\1\263\6\16"+ + "\5\0\1\75\3\16\1\264\7\16\1\0\3\16\1\0"+ + "\7\16\2\0\1\16\1\0\1\16\1\0\1\16\1\0"+ + "\24\16\30\0\10\16\5\0\1\75\2\16\1\265\10\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\3\16\1\266\7\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\10\16\2\0\1\267\1\270\125\0\2\161\2\0\15\161"+ + "\1\271\107\161\17\0\1\272\120\0\1\273\131\0\1\274"+ + "\126\0\1\275\5\0\1\276\131\0\1\277\123\0\1\300"+ + "\120\0\2\171\2\0\125\171\5\0\1\75\1\301\12\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\13\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\1\302\7\16"+ + "\5\0\1\75\10\16\1\303\2\16\1\0\3\16\1\0"+ + "\7\16\2\0\1\16\1\0\1\16\1\0\1\16\1\0"+ + "\24\16\30\0\10\16\5\0\1\75\3\16\1\304\7\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\13\16\1\0\3\16\1\0\1\305\6\16\2\0\1\16"+ + "\1\0\1\16\1\0\1\16\1\0\24\16\30\0\10\16"+ + "\5\0\1\75\1\306\12\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\10\16\5\0\1\75\13\16\1\0\3\16\1\0"+ + "\1\307\6\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\3\16\1\310"+ + "\7\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\5\0"+ + "\1\75\13\16\1\0\3\16\1\0\7\16\2\0\1\16"+ + "\1\0\1\16\1\0\1\16\1\0\24\16\30\0\1\311"+ + "\7\16\5\0\1\75\6\16\1\312\4\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\3\16\1\313"+ + "\7\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\11\0"+ + "\1\117\12\0\1\206\3\0\1\206\2\0\1\206\3\0"+ + "\1\117\24\0\1\206\170\0\1\314\30\0\1\210\3\0"+ + "\1\210\2\0\1\210\30\0\1\210\74\0\1\315\2\0"+ + "\1\315\30\0\1\315\70\0\1\216\3\0\1\216\2\0"+ + "\1\216\30\0\1\216\3\0\1\214\77\0\1\316\7\0"+ + "\1\317\5\0\1\320\62\0\3\321\5\0\1\321\4\0"+ + "\1\321\1\0\3\321\2\0\1\321\3\0\1\321\14\0"+ + "\2\321\1\0\2\321\3\0\1\321\36\0\1\321\41\0"+ + "\1\227\10\0\1\322\2\0\1\323\1\0\1\324\13\0"+ + "\1\127\63\0\1\127\1\0\1\127\3\0\1\127\2\0"+ + "\1\127\1\0\1\127\2\0\3\127\2\0\20\127\1\0"+ + "\3\127\12\0\1\127\12\0\1\127\61\0\1\316\5\0"+ + "\1\325\124\0\1\127\140\0\1\127\104\0\1\326\11\0"+ + "\1\327\3\0\1\330\10\0\1\127\1\0\1\331\115\0"+ + "\1\127\133\0\1\325\127\0\1\331\5\0\1\127\105\0"+ + "\1\316\10\0\1\127\130\0\1\127\7\0\1\127\51\0"+ + "\4\234\14\0\1\132\14\0\1\234\122\0\1\132\2\0"+ + "\1\132\30\0\1\132\103\0\1\332\7\0\1\333\5\0"+ + "\1\334\62\0\3\132\5\0\1\132\4\0\1\132\1\0"+ + "\3\132\2\0\1\132\3\0\1\132\14\0\2\132\1\0"+ + "\2\132\3\0\1\132\36\0\1\132\41\0\1\246\10\0"+ + "\1\335\2\0\1\336\1\0\1\337\13\0\1\132\63\0"+ + "\1\132\1\0\1\132\3\0\1\132\2\0\1\132\1\0"+ + "\1\132\2\0\3\132\2\0\20\132\1\0\3\132\12\0"+ + "\1\132\12\0\1\132\61\0\1\332\5\0\1\340\124\0"+ + "\1\132\140\0\1\132\104\0\1\132\11\0\1\341\3\0"+ + "\1\342\10\0\1\132\1\0\1\343\115\0\1\132\133\0"+ + "\1\340\127\0\1\343\5\0\1\132\105\0\1\332\10\0"+ + "\1\132\130\0\1\132\7\0\1\132\55\0\1\253\75\0"+ + "\1\254\30\0\1\260\132\0\1\75\3\16\1\344\7\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\4\16\1\345\6\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\10\16\5\0\1\75\12\16\1\346\1\0\3\16\1\0"+ + "\7\16\2\0\1\16\1\0\1\16\1\0\1\16\1\0"+ + "\24\16\30\0\10\16\5\0\1\75\7\16\1\347\3\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\3\0\1\270"+ + "\125\0\2\161\1\350\16\161\1\271\107\161\13\0\1\351"+ + "\123\0\1\352\130\0\1\275\131\0\1\161\132\0\1\161"+ + "\135\0\1\353\123\0\1\275\124\0\1\75\13\16\1\0"+ + "\3\16\1\0\3\16\1\354\3\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\5\0"+ + "\1\75\13\16\1\0\3\16\1\0\1\355\6\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\10\16\5\0\1\75\7\16\1\356\3\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\1\357\12\16"+ + "\1\0\3\16\1\0\7\16\2\0\1\16\1\0\1\16"+ + "\1\0\1\16\1\0\24\16\30\0\10\16\5\0\1\75"+ + "\12\16\1\360\1\0\3\16\1\0\7\16\2\0\1\16"+ + "\1\0\1\16\1\0\1\16\1\0\24\16\30\0\10\16"+ + "\5\0\1\75\13\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\361\1\0\24\16\30\0"+ + "\10\16\5\0\1\75\13\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\4\16\1\362\3\16\5\0\1\75\6\16\1\363"+ + "\4\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\6\0"+ + "\1\364\152\0\1\315\2\0\1\315\30\0\1\315\3\0"+ + "\1\214\107\0\1\127\120\0\1\127\155\0\1\127\53\0"+ + "\3\321\5\0\1\321\4\0\1\321\1\0\3\321\2\0"+ + "\1\321\3\0\1\321\14\0\2\321\1\0\2\321\3\0"+ + "\1\321\3\0\1\214\32\0\1\321\60\0\1\127\132\0"+ + "\1\127\105\0\1\127\24\0\1\127\127\0\1\127\123\0"+ + "\1\127\16\0\1\214\117\0\1\127\103\0\1\127\143\0"+ + "\1\127\132\0\1\132\120\0\1\132\155\0\1\132\117\0"+ + "\1\132\132\0\1\132\105\0\1\132\24\0\1\132\127\0"+ + "\1\132\131\0\1\132\103\0\1\132\143\0\1\132\67\0"+ + "\1\365\1\75\13\16\1\0\3\16\1\0\7\16\2\0"+ + "\1\16\1\0\1\16\1\0\1\16\1\0\24\16\30\0"+ + "\10\16\5\0\1\75\5\16\1\366\5\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\3\16\1\367"+ + "\7\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\2\161"+ + "\1\0\16\161\1\271\107\161\20\0\1\370\122\0\1\276"+ + "\133\0\1\161\120\0\1\75\5\16\1\371\1\16\1\372"+ + "\3\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\5\0"+ + "\1\75\4\16\1\373\6\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\10\16\5\0\1\75\13\16\1\0\3\16\1\0"+ + "\7\16\2\0\1\16\1\0\1\16\1\0\1\16\1\0"+ + "\24\16\30\0\1\374\7\16\5\0\1\75\13\16\1\0"+ + "\3\16\1\0\7\16\2\0\1\16\1\0\1\16\1\0"+ + "\1\16\1\0\24\16\30\0\3\16\1\375\4\16\5\0"+ + "\1\75\5\16\1\376\5\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\10\16\5\0\1\75\1\377\12\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\13\16\1\0"+ + "\3\16\1\0\7\16\2\0\1\16\1\0\1\16\1\0"+ + "\1\16\1\0\24\16\30\0\1\16\1\u0100\6\16\12\0"+ + "\1\u0101\124\0\1\u0102\1\u0103\126\0\1\75\3\16\1\u0104"+ + "\7\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\10\0"+ + "\1\276\125\0\1\75\11\16\1\u0105\1\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\4\16\1\u0106"+ + "\6\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\5\0"+ + "\1\75\13\16\1\0\3\16\1\0\7\16\2\0\1\16"+ + "\1\0\1\16\1\0\1\16\1\0\24\16\30\0\1\u0107"+ + "\7\16\5\0\1\75\4\16\1\u0108\6\16\1\0\3\16"+ + "\1\0\7\16\2\0\1\16\1\0\1\16\1\0\1\16"+ + "\1\0\24\16\30\0\10\16\5\0\1\75\3\16\1\u0109"+ + "\7\16\1\0\3\16\1\0\7\16\2\0\1\16\1\0"+ + "\1\16\1\0\1\16\1\0\24\16\30\0\10\16\117\0"+ + "\1\u010a\23\0\1\u010b\144\0\1\u010c\107\0\1\75\3\16"+ + "\1\u010d\7\16\1\0\3\16\1\0\7\16\2\0\1\16"+ + "\1\0\1\16\1\0\1\16\1\0\24\16\30\0\10\16"+ + "\4\0\1\u010e\1\75\13\16\1\0\3\16\1\0\7\16"+ + "\2\0\1\16\1\0\1\16\1\0\1\16\1\0\24\16"+ + "\30\0\10\16\5\0\1\75\13\16\1\0\3\16\1\0"+ + "\7\16\2\0\1\16\1\0\1\16\1\0\1\16\1\0"+ + "\24\16\30\0\3\16\1\u010f\4\16\17\0\1\u0110\125\0"+ + "\1\u0111\242\0\1\u0112\10\0\1\u0113\2\0\1\u0114\135\0"+ + "\1\u0115\233\0\1\u0116\15\0\1\u0117\250\0\1\u0118\33\0"+ + "\1\u0119\107\0\1\u011a\146\0\1\u011b\115\0\1\u011c\237\0"+ + "\1\u011d\130\0\1\u011e\17\0\1\u011f\131\0\1\u0120\243\0"+ + "\1\u0121\21\0\1\u0122\130\0\1\u0123\232\0\1\u0124\27\0"+ + "\1\u0125\126\0\1\u0126\130\0\1\u0127\124\0\1\u0128\240\0"+ + "\1\u0129\130\0\1\u012a\7\0"; private static int [] zzUnpackTrans() { - int [] result = new int[22704]; + int [] result = new int[21093]; int offset = 0; offset = zzUnpackTrans(ZZ_TRANS_PACKED_0, offset, result); return result; @@ -491,13 +513,10 @@ public class _HaskellLexer implements FlexLexer { private static final int ZZ_UNKNOWN_ERROR = 0; private static final int ZZ_NO_MATCH = 1; private static final int ZZ_PUSHBACK_2BIG = 2; - private static final char[] EMPTY_BUFFER = new char[0]; - private static final int YYEOF = -1; - private static java.io.Reader zzReader = null; // Fake /* error messages for the codes above */ - private static final String ZZ_ERROR_MSG[] = { - "Unkown internal scanner error", + private static final String[] ZZ_ERROR_MSG = { + "Unknown internal scanner error", "Error: could not match input", "Error: pushback value was too large" }; @@ -508,21 +527,19 @@ public class _HaskellLexer implements FlexLexer { private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute(); private static final String ZZ_ATTRIBUTE_PACKED_0 = - "\2\0\1\1\1\11\2\1\1\11\17\1\1\11\14\1"+ - "\7\11\1\1\1\11\1\1\1\11\3\1\1\11\5\1"+ - "\5\0\20\1\1\0\1\1\3\0\1\1\2\0\3\1"+ - "\1\11\4\0\1\1\1\0\1\11\1\0\2\1\1\11"+ - "\2\1\3\0\1\11\2\0\6\1\1\11\1\1\1\0"+ - "\1\1\6\0\1\11\16\1\3\0\1\1\1\0\1\1"+ - "\1\11\2\1\1\11\37\0\5\11\1\1\1\11\5\1"+ - "\1\11\1\0\1\1\7\0\13\1\32\0\4\1\1\0"+ - "\1\1\3\0\10\1\4\0\2\1\2\0\10\1\5\0"+ - "\1\1\1\0\5\1\6\0\1\1\1\0\1\1\1\0"+ - "\1\11\25\0\1\11\3\0\1\1\1\0\1\11\2\0"+ - "\3\11"; + "\2\0\1\11\2\1\1\11\17\1\1\11\15\1\7\11"+ + "\1\1\1\11\1\1\1\11\3\1\1\11\3\1\5\0"+ + "\20\1\1\0\1\1\1\0\1\1\2\0\3\1\1\11"+ + "\4\0\1\1\1\0\1\11\1\0\1\11\2\1\1\11"+ + "\2\1\4\0\1\11\2\0\6\1\1\11\1\1\6\0"+ + "\1\11\16\1\1\0\1\1\1\0\2\1\1\11\37\0"+ + "\5\11\1\1\1\11\5\1\1\11\1\1\7\0\13\1"+ + "\30\0\5\1\3\0\10\1\2\0\2\1\1\0\10\1"+ + "\3\0\6\1\3\0\1\1\1\0\1\1\21\0\1\11"+ + "\2\0\1\11\3\0\3\11"; private static int [] zzUnpackAttribute() { - int [] result = new int[327]; + int [] result = new int[298]; int offset = 0; offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result); return result; @@ -540,6 +557,9 @@ public class _HaskellLexer implements FlexLexer { return j; } + /** the input device */ + private java.io.Reader zzReader; + /** the current state of the DFA */ private int zzState; @@ -550,15 +570,9 @@ public class _HaskellLexer implements FlexLexer { the source of the yytext() string */ private CharSequence zzBuffer = ""; - /** this buffer may contains the current text array to be matched when it is cheap to acquire it */ - private char[] zzBufferArray; - /** the textposition at the last accepting state */ private int zzMarkedPos; - /** the textposition at the last state to be included in yytext */ - private int zzPushbackPos; - /** the current text position in the buffer */ private int zzCurrentPos; @@ -577,6 +591,9 @@ public class _HaskellLexer implements FlexLexer { /** 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: */ public _HaskellLexer() { this((java.io.Reader)null); @@ -602,10 +619,14 @@ public class _HaskellLexer implements FlexLexer { * @return the unpacked character translation table */ private static char [] zzUnpackCMap(String packed) { - char [] map = new char[0x10000]; + 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 < 218) { + while (i < packed.length()) { int count = packed.charAt(i++); char value = packed.charAt(i++); do map[j++] = value; while (--count > 0); @@ -613,19 +634,17 @@ public class _HaskellLexer implements FlexLexer { return map; } - public final int getTokenStart(){ + public final int getTokenStart() { return zzStartRead; } - public final int getTokenEnd(){ + public final int getTokenEnd() { return getTokenStart() + yylength(); } - public void reset(CharSequence buffer, int start, int end,int initialState){ + public void reset(CharSequence buffer, int start, int end, int initialState) { zzBuffer = buffer; - zzBufferArray = com.intellij.util.text.CharArrayUtil.fromSequenceWithoutCopying(buffer); zzCurrentPos = zzMarkedPos = zzStartRead = start; - zzPushbackPos = 0; zzAtEOF = false; zzAtBOL = true; zzEndRead = end; @@ -682,7 +701,7 @@ public class _HaskellLexer implements FlexLexer { * @return the character at position pos */ public final char yycharat(int pos) { - return zzBufferArray != null ? zzBufferArray[zzStartRead+pos]:zzBuffer.charAt(zzStartRead+pos); + return zzBuffer.charAt(zzStartRead+pos); } @@ -753,8 +772,6 @@ public class _HaskellLexer implements FlexLexer { int zzMarkedPosL; int zzEndReadL = zzEndRead; CharSequence zzBufferL = zzBuffer; - char[] zzBufferArrayL = zzBufferArray; - char [] zzCMapL = ZZ_CMAP; int [] zzTransL = ZZ_TRANS; int [] zzRowMapL = ZZ_ROWMAP; @@ -769,12 +786,20 @@ public class _HaskellLexer implements FlexLexer { 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 = (zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++] : zzBufferL.charAt(zzCurrentPosL++)); + if (zzCurrentPosL < zzEndReadL) { + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); + zzCurrentPosL += Character.charCount(zzInput); + } else if (zzAtEOF) { zzInput = YYEOF; break zzForAction; @@ -794,14 +819,15 @@ public class _HaskellLexer implements FlexLexer { break zzForAction; } else { - zzInput = (zzBufferArrayL != null ? zzBufferArrayL[zzCurrentPosL++] : zzBufferL.charAt(zzCurrentPosL++)); + zzInput = Character.codePointAt(zzBufferL, zzCurrentPosL/*, zzEndReadL*/); + zzCurrentPosL += Character.charCount(zzInput); } } - int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput] ]; + int zzNext = zzTransL[ zzRowMapL[zzState] + ZZ_CMAP(zzInput) ]; if (zzNext == -1) break zzForAction; zzState = zzNext; - int zzAttributes = zzAttrL[zzState]; + zzAttributes = zzAttrL[zzState]; if ( (zzAttributes & 1) == 1 ) { zzAction = zzState; zzMarkedPosL = zzCurrentPosL; @@ -814,123 +840,188 @@ public class _HaskellLexer implements FlexLexer { // store back cached position zzMarkedPos = zzMarkedPosL; - switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { - case 60: - { return HS_CASE; - } - case 80: break; - case 50: - { return HS_HEXADECIMAL; - } - case 81: break; - case 35: - { return HS_COMMENT; - } - case 82: break; - case 40: - { return HS_COLON_COLON; - } - case 83: break; - case 64: - { return HS_CLASS; - } - case 84: break; - case 71: - { return HS_NEWTYPE; - } - case 85: break; - case 41: - { return HS_QUASI_QUOTE_E_START; - } - case 86: break; - case 45: - { return HS_PRAGMA_END; - } - case 87: break; - case 6: - { return HS_VARID_ID; - } - case 88: break; - case 15: - { return HS_AT; - } - case 89: break; - case 46: - { return HS_SHEBANG_LINE; - } - case 90: break; - case 31: - { return HS_IF; - } - case 91: break; - case 39: - { return HS_QUASI_QUOTE_END; - } - case 92: break; - case 12: - { return HS_QUOTE; - } - case 93: break; - case 75: - { return HS_TYPE_FAMILY; - } - case 94: break; - case 55: - { return HS_QUASI_QUOTE_P_START; - } - case 95: break; - case 56: - { yybegin(NCOMMENT); - commentDepth = 0; - commentStart = getTokenStart(); - } - case 96: break; - case 4: - { return HS_NEWLINE; - } - case 97: break; - case 25: - { return HS_SEMICOLON; - } - case 98: break; - case 63: - { return HS_INFIX; - } - case 99: break; - case 3: - { return com.intellij.psi.TokenType.WHITE_SPACE; - } - case 100: break; - case 37: - { return HS_CONSYM_ID; - } - case 101: break; - case 48: - { return HS_FLOAT; - } - case 102: break; - case 23: - { return HS_RIGHT_PAREN; - } - case 103: break; - case 1: - { return HS_NCOMMENT; - } - case 104: break; - case 17: - { return HS_TILDE; - } - case 105: break; - case 74: - { yybegin(TEX); return HS_NCOMMENT; - } - case 106: break; - case 9: - { return HS_DECIMAL; - } - case 107: break; - case 43: - { if (commentDepth > 0) { + if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { + zzAtEOF = true; + switch (zzLexicalState) { + case NCOMMENT: { + int state = yystate(); + yybegin(YYINITIAL); + zzStartRead = commentStart; + return HS_NCOMMENT; + } + case 299: break; + default: + return null; + } + } + else { + switch (zzAction < 0 ? zzAction : ZZ_ACTION[zzAction]) { + case 1: + { return com.intellij.psi.TokenType.BAD_CHARACTER; + } + case 77: break; + case 2: + { return com.intellij.psi.TokenType.WHITE_SPACE; + } + case 78: break; + case 3: + { return HS_NEWLINE; + } + case 79: break; + case 4: + { return HS_VARSYM_ID; + } + case 80: break; + case 5: + { return HS_VAR_ID; + } + case 81: break; + case 6: + { return HS_BACKSLASH; + } + case 82: break; + case 7: + { return HS_CON_ID; + } + case 83: break; + case 8: + { return HS_DECIMAL; + } + case 84: break; + case 9: + { return HS_RIGHT_BRACKET; + } + case 85: break; + case 10: + { return HS_UNDERSCORE; + } + case 86: break; + case 11: + { return HS_QUOTE; + } + case 87: break; + case 12: + { return HS_DOT; + } + case 88: break; + case 13: + { return HS_EQUAL; + } + case 89: break; + case 14: + { return HS_AT; + } + case 90: break; + case 15: + { return HS_VERTICAL_BAR; + } + case 91: break; + case 16: + { return HS_TILDE; + } + case 92: break; + case 17: + { return HS_CONSYM_ID; + } + case 93: break; + case 18: + { return HS_LEFT_ARROW; + } + case 94: break; + case 19: + { return HS_RIGHT_ARROW; + } + case 95: break; + case 20: + { return HS_DOUBLE_RIGHT_ARROW; + } + case 96: break; + case 21: + { return HS_LEFT_PAREN; + } + case 97: break; + case 22: + { return HS_RIGHT_PAREN; + } + case 98: break; + case 23: + { return HS_COMMA; + } + case 99: break; + case 24: + { return HS_SEMICOLON; + } + case 100: break; + case 25: + { return HS_LEFT_BRACKET; + } + case 101: break; + case 26: + { return HS_BACKQUOTE; + } + case 102: break; + case 27: + { return HS_LEFT_BRACE; + } + case 103: break; + case 28: + { return HS_RIGHT_BRACE; + } + case 104: break; + case 29: + { + } + case 105: break; + case 30: + { return HS_IF; + } + case 106: break; + case 31: + { return HS_IN; + } + case 107: break; + case 32: + { return HS_DO; + } + case 108: break; + case 33: + { return HS_OF; + } + case 109: break; + case 34: + { return HS_COMMENT; + } + case 110: break; + case 35: + { return HS_NCOMMENT_END; + } + case 111: break; + case 36: + { return HS_STRING_LITERAL; + } + case 112: break; + case 37: + { return HS_DOT_DOT; + } + case 113: break; + case 38: + { return HS_QUASI_QUOTE_END; + } + case 114: break; + case 39: + { return HS_COLON_COLON; + } + case 115: break; + case 40: + { return HS_QUASI_QUOTE_E_START; + } + case 116: break; + case 41: + { return HS_NCOMMENT_START; + } + case 117: break; + case 42: + { if (commentDepth > 0) { commentDepth--; } else { @@ -939,224 +1030,147 @@ public class _HaskellLexer implements FlexLexer { zzStartRead = commentStart; return HS_NCOMMENT; } - } - case 108: break; - case 47: - { return HS_LET; - } - case 109: break; - case 65: - { return HS_WHERE; - } - case 110: break; - case 8: - { return HS_CONID_ID; - } - case 111: break; - case 38: - { return HS_STRING_LITERAL; - } - case 112: break; - case 19: - { return HS_LEFT_ARROW; - } - case 113: break; - case 69: - { return HS_MODULE; - } - case 114: break; - case 28: - { return HS_LEFT_BRACE; - } - case 115: break; - case 58: - { return HS_DATA; - } - case 116: break; - case 51: - { return HS_CHARACTER_LITERAL; - } - case 117: break; - case 57: - { return HS_PRAGMA_START; - } - case 118: break; - case 11: - { return HS_UNDERSCORE; - } - case 119: break; - case 36: - { return HS_NCOMMENT_END; - } - case 120: break; - case 78: - { return HS_FOREIGN_IMPORT; - } - case 121: break; - case 53: - { return HS_QUASI_QUOTE_D_START; - } - case 122: break; - case 16: - { return HS_VERTICAL_BAR; - } - case 123: break; - case 61: - { return HS_TYPE; - } - case 124: break; - case 5: - { return HS_VARSYM_ID; - } - case 125: break; - case 14: - { return HS_EQUAL; - } - case 126: break; - case 42: - { return HS_NCOMMENT_START; - } - case 127: break; - case 18: - { return HS_COLON; - } - case 128: break; - case 72: - { return HS_INSTANCE; - } - case 129: break; - case 10: - { return HS_RIGHT_BRACKET; - } - case 130: break; - case 22: - { return HS_LEFT_PAREN; - } - case 131: break; - case 27: - { return HS_BACKQUOTE; - } - case 132: break; - case 26: - { return HS_LEFT_BRACKET; - } - case 133: break; - case 66: - { return HS_INFIXL; - } - case 134: break; - case 68: - { return HS_IMPORT; - } - case 135: break; - case 73: - { return HS_DERIVING; - } - case 136: break; - case 33: - { return HS_DO; - } - case 137: break; - case 13: - { return HS_DOT; - } - case 138: break; - case 32: - { return HS_IN; - } - case 139: break; - case 49: - { return HS_OCTAL; - } - case 140: break; - case 67: - { return HS_INFIXR; - } - case 141: break; - case 77: - { return HS_TYPE_INSTANCE; - } - case 142: break; - case 44: - { commentDepth++; - } - case 143: break; - case 2: - { return com.intellij.psi.TokenType.BAD_CHARACTER; - } - case 144: break; - case 70: - { return HS_DEFAULT; - } - case 145: break; - case 21: - { return HS_DOUBLE_RIGHT_ARROW; - } - case 146: break; - case 59: - { return HS_ELSE; - } - case 147: break; - case 24: - { return HS_COMMA; - } - case 148: break; - case 7: - { return HS_BACKSLASH; - } - case 149: break; - case 34: - { return HS_OF; - } - case 150: break; - case 62: - { return HS_THEN; - } - case 151: break; - case 20: - { return HS_RIGHT_ARROW; - } - case 152: break; - case 29: - { return HS_RIGHT_BRACE; - } - case 153: break; - case 54: - { return HS_QUASI_QUOTE_T_START; - } - case 154: break; - case 52: - { return HS_QUASI_QUOTE_V_START; - } - case 155: break; - case 79: - { return HS_FOREIGN_EXPORT; - } - case 156: break; - case 76: - { yybegin(YYINITIAL); return HS_NCOMMENT; - } - case 157: break; - case 30: - { - } - case 158: break; - default: - if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { - zzAtEOF = true; - switch (zzLexicalState) { - case NCOMMENT: { - int state = yystate(); - yybegin(YYINITIAL); - zzStartRead = commentStart; - return HS_NCOMMENT; } - case 328: break; - default: - return null; + case 118: break; + case 43: + { commentDepth++; } - } - else { + case 119: break; + case 44: + { return HS_PRAGMA_END; + } + case 120: break; + case 45: + { return HS_SHEBANG_LINE; + } + case 121: break; + case 46: + { return HS_LET; + } + case 122: break; + case 47: + { return HS_FLOAT; + } + case 123: break; + case 48: + { return HS_OCTAL; + } + case 124: break; + case 49: + { return HS_HEXADECIMAL; + } + case 125: break; + case 50: + { return HS_CHARACTER_LITERAL; + } + case 126: break; + case 51: + { return HS_QUASI_QUOTE_V_START; + } + case 127: break; + case 52: + { return HS_QUASI_QUOTE_D_START; + } + case 128: break; + case 53: + { return HS_QUASI_QUOTE_T_START; + } + case 129: break; + case 54: + { return HS_QUASI_QUOTE_P_START; + } + case 130: break; + case 55: + { yybegin(NCOMMENT); + commentDepth = 0; + commentStart = getTokenStart(); + } + case 131: break; + case 56: + { return HS_PRAGMA_START; + } + case 132: break; + case 57: + { return HS_DATA; + } + case 133: break; + case 58: + { return HS_ELSE; + } + case 134: break; + case 59: + { return HS_CASE; + } + case 135: break; + case 60: + { return HS_TYPE; + } + case 136: break; + case 61: + { return HS_THEN; + } + case 137: break; + case 62: + { return HS_INFIX; + } + case 138: break; + case 63: + { return HS_CLASS; + } + case 139: break; + case 64: + { return HS_WHERE; + } + case 140: break; + case 65: + { return HS_INFIXL; + } + case 141: break; + case 66: + { return HS_INFIXR; + } + case 142: break; + case 67: + { return HS_IMPORT; + } + case 143: break; + case 68: + { return HS_MODULE; + } + case 144: break; + case 69: + { return HS_DEFAULT; + } + case 145: break; + case 70: + { return HS_NEWTYPE; + } + case 146: break; + case 71: + { return HS_INSTANCE; + } + case 147: break; + case 72: + { return HS_DERIVING; + } + case 148: break; + case 73: + { return HS_TYPE_FAMILY; + } + case 149: break; + case 74: + { return HS_TYPE_INSTANCE; + } + case 150: break; + case 75: + { return HS_FOREIGN_IMPORT; + } + case 151: break; + case 76: + { return HS_FOREIGN_EXPORT; + } + case 152: break; + default: zzScanError(ZZ_NO_MATCH); } } diff --git a/src/main/scala/intellij/haskell/view/CreateHaskellFileAction.scala b/src/main/scala/intellij/haskell/action/CreateHaskellFileAction.scala similarity index 91% rename from src/main/scala/intellij/haskell/view/CreateHaskellFileAction.scala rename to src/main/scala/intellij/haskell/action/CreateHaskellFileAction.scala index f372a2ca..e9b16372 100644 --- a/src/main/scala/intellij/haskell/view/CreateHaskellFileAction.scala +++ b/src/main/scala/intellij/haskell/action/CreateHaskellFileAction.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.view +package intellij.haskell.action import com.intellij.ide.actions.{CreateFileFromTemplateAction, CreateFileFromTemplateDialog} import com.intellij.openapi.project.{DumbAware, Project} @@ -29,7 +29,7 @@ object CreateHaskellFileAction { class CreateHaskellFileAction extends CreateFileFromTemplateAction(CreateHaskellFileAction.NEW_HASKELL_FILE, "", HaskellIcons.HaskellSmallLogo) with DumbAware { - protected def buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) { + override def buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) { builder.setTitle(CreateHaskellFileAction.NEW_HASKELL_FILE).addKind("Empty module", HaskellIcons.HaskellSmallLogo, "Haskell Module").setValidator(new InputValidatorEx { def checkInput(inputString: String): Boolean = { diff --git a/src/main/scala/intellij/haskell/action/DownloadLibrarySources.scala b/src/main/scala/intellij/haskell/action/DownloadLibrarySources.scala new file mode 100644 index 00000000..9197941d --- /dev/null +++ b/src/main/scala/intellij/haskell/action/DownloadLibrarySources.scala @@ -0,0 +1,32 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.action + +import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent} +import com.intellij.openapi.module.ModuleManager +import intellij.haskell.module.HaskellModuleBuilder +import intellij.haskell.util.HaskellProjectUtil + +class DownloadLibrarySources extends AnAction { + + override def update(e: AnActionEvent): Unit = e.getPresentation.setEnabledAndVisible(HaskellProjectUtil.isHaskellStackProject(e.getProject)) + + override def actionPerformed(e: AnActionEvent): Unit = { + ModuleManager.getInstance(e.getProject).getModules.foreach(m => + HaskellModuleBuilder.addLibrarySources(m)) + } +} diff --git a/src/main/scala/intellij/haskell/action/RestartStackRepls.scala b/src/main/scala/intellij/haskell/action/RestartStackRepls.scala new file mode 100644 index 00000000..b803936a --- /dev/null +++ b/src/main/scala/intellij/haskell/action/RestartStackRepls.scala @@ -0,0 +1,87 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.action + +import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent} +import com.intellij.openapi.progress.{ProgressIndicator, ProgressManager, Task} +import com.intellij.openapi.project.Project +import intellij.haskell.HaskellNotificationGroup +import intellij.haskell.external._ +import intellij.haskell.external.component.StackReplsComponentsManager +import intellij.haskell.external.repl.StackReplsManager +import intellij.haskell.sdk.HaskellSdkType +import intellij.haskell.util.HaskellProjectUtil + +import scala.concurrent.SyncVar + +class RestartStackRepls extends AnAction { + + val restarting: SyncVar[Boolean] = new SyncVar() + + override def update(e: AnActionEvent): Unit = { + e.getPresentation.setVisible(HaskellProjectUtil.isHaskellStackProject(e.getProject)) + e.getPresentation.setEnabled(!restarting.isSet) + } + + override def actionPerformed(e: AnActionEvent): Unit = { + if (restarting.isSet) { + HaskellNotificationGroup.notifyBalloonWarning("Stack repls are already restarting") + return + } + + Option(e.getProject) match { + case None => () + case Some(project) => + restarting.put(true) + ProgressManager.getInstance().run(new Task.Backgroundable(project, "Busy with restarting Stack repls") { + def run(progressIndicator: ProgressIndicator) { + try { + val projectRepl = StackReplsManager.getProjectRepl(project) + val globalRepl = StackReplsManager.getGlobalRepl(project) + + progressIndicator.setText("Busy with stopping Stack repls") + globalRepl.exit() + projectRepl.exit() + + progressIndicator.setText("Busy with cleaning up") + cleanLocalPackages(project) + StackReplsComponentsManager.invalidateModuleIdentifierCaches(project) + + progressIndicator.setText("Busy with starting Stack repls and building project") + globalRepl.start() + projectRepl.start() + + progressIndicator.setText("Busy with preloading cache") + StackReplsComponentsManager.preloadModuleIdentifiersCaches(project) + } finally { + restarting.take(100) + } + } + }) + } + } + + private def cleanLocalPackages(project: Project): Unit = { + HaskellSdkType.getStackPath(project).foreach { stackPath => + CommandLine.getProcessOutput( + project.getBasePath, + stackPath, + Seq("clean") + ) + } + } +} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/view/ShowInfoAction.scala b/src/main/scala/intellij/haskell/action/ShowNameInfoAction.scala similarity index 58% rename from src/main/scala/intellij/haskell/view/ShowInfoAction.scala rename to src/main/scala/intellij/haskell/action/ShowNameInfoAction.scala index 96c2b7c1..29dacdbe 100644 --- a/src/main/scala/intellij/haskell/view/ShowInfoAction.scala +++ b/src/main/scala/intellij/haskell/action/ShowNameInfoAction.scala @@ -14,19 +14,18 @@ * limitations under the License. */ -package intellij.haskell.view +package intellij.haskell.action import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent, CommonDataKeys} import com.intellij.openapi.util.text.StringUtil import com.intellij.psi.util.PsiUtilBase -import intellij.haskell.external._ -import intellij.haskell.psi.HaskellPsiHelper +import intellij.haskell.external.component._ import intellij.haskell.util.HaskellEditorUtil -class ShowInfoAction extends AnAction { +class ShowNameInfoAction extends AnAction { override def update(actionEvent: AnActionEvent) { - HaskellEditorUtil.enableAndShowIfInHaskellFile(actionEvent) + HaskellEditorUtil.enableAction(onlyForProjectFile = false, actionEvent) } def actionPerformed(actionEvent: AnActionEvent) { @@ -35,22 +34,19 @@ class ShowInfoAction extends AnAction { editor <- Option(CommonDataKeys.EDITOR.getData(context)) psiFile <- Option(PsiUtilBase.getPsiFileInEditor(editor, CommonDataKeys.PROJECT.getData(context))) offset = editor.getCaretModel.getOffset - project = psiFile.getProject psiElement <- Option(psiFile.findElementAt(offset)) - namedElement <- HaskellPsiHelper.findHaskellNamedElement(psiElement) } yield - GhcModInfo.findInfoFor(psiFile, namedElement) match { - case Seq(identifierInfos@_*) if identifierInfos.nonEmpty => HaskellEditorUtil.createInfoBallon(identifierInfos.map(createInfoText).mkString("
    "), editor) - case _ => HaskellEditorUtil.showHint(editor, s"Could not determine info for ${StringUtil.escapeXml(namedElement.getName)}") + StackReplsComponentsManager.findNameInfo(psiElement) match { + case Seq(identifierInfos@_*) if identifierInfos.nonEmpty => HaskellEditorUtil.showInfoMessageBallon(identifierInfos.map(createInfoText).mkString("
    "), editor) + case _ => HaskellEditorUtil.showHint(editor, s"Could not determine info for ${StringUtil.escapeXml(psiElement.getText)}") } } - private def createInfoText(identifierInfo: IdentifierInfo): String = { - identifierInfo match { - case pi: ProjectIdentifierInfo => s"${pi.declaration} -- ${pi.filePath.getOrElse("File not found")}" - case li: LibraryIdentifierInfo => s"${li.declaration} -- ${li.module}" - case bi: BuiltInIdentifierInfo => s"${bi.declaration} -- ${bi.module} BUILT-IN" - case gi: NoLocationIdentifierInfo => s"${gi.declaration}" + private def createInfoText(nameInfo: NameInfo): String = { + nameInfo match { + case pi: ProjectNameInfo => s"${pi.escapedDeclaration} -- ${pi.filePath}" + case li: LibraryNameInfo => s"${li.escapedDeclaration} -- ${li.moduleName}" + case bi: BuiltInNameInfo => s"${bi.escapedDeclaration} -- ${bi.moduleName} BUILT-IN" } } } diff --git a/src/main/scala/intellij/haskell/view/ShowProblemMessageAction.scala b/src/main/scala/intellij/haskell/action/ShowProblemMessageAction.scala similarity index 74% rename from src/main/scala/intellij/haskell/view/ShowProblemMessageAction.scala rename to src/main/scala/intellij/haskell/action/ShowProblemMessageAction.scala index 054f1f28..9093e080 100644 --- a/src/main/scala/intellij/haskell/view/ShowProblemMessageAction.scala +++ b/src/main/scala/intellij/haskell/action/ShowProblemMessageAction.scala @@ -14,17 +14,16 @@ * limitations under the License. */ -package intellij.haskell.view +package intellij.haskell.action -import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer -import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent, CommonDataKeys} +import intellij.haskell.annotator.HaskellAnnotator import intellij.haskell.util.HaskellEditorUtil class ShowProblemMessageAction extends AnAction { override def update(actionEvent: AnActionEvent) { - HaskellEditorUtil.enableAndShowIfInHaskellFile(actionEvent) + HaskellEditorUtil.enableAction(onlyForProjectFile = true, actionEvent) } override def actionPerformed(actionEvent: AnActionEvent): Unit = { @@ -33,8 +32,7 @@ class ShowProblemMessageAction extends AnAction { project <- Option(CommonDataKeys.PROJECT.getData(context)) editor <- Option(CommonDataKeys.EDITOR.getData(context)) offset = editor.getCaretModel.getOffset - codeAnalyzer <- Option(DaemonCodeAnalyzer.getInstance(project).asInstanceOf[DaemonCodeAnalyzerImpl]) - info <- Option(codeAnalyzer.findHighlightByOffset(editor.getDocument, offset, false)) + info <- Option(HaskellAnnotator.getDaemonCodeAnalyzer(project).findHighlightByOffset(editor.getDocument, offset, false)) message = info.getToolTip } yield { HaskellEditorUtil.showHint(editor, message) diff --git a/src/main/scala/intellij/haskell/view/ShowTypeAction.scala b/src/main/scala/intellij/haskell/action/ShowTypeAction.scala similarity index 67% rename from src/main/scala/intellij/haskell/view/ShowTypeAction.scala rename to src/main/scala/intellij/haskell/action/ShowTypeAction.scala index ae049d72..afe01e2d 100644 --- a/src/main/scala/intellij/haskell/view/ShowTypeAction.scala +++ b/src/main/scala/intellij/haskell/action/ShowTypeAction.scala @@ -14,21 +14,21 @@ * limitations under the License. */ -package intellij.haskell.view +package intellij.haskell.action import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent, CommonDataKeys} -import com.intellij.openapi.util.text.StringUtil import com.intellij.psi.util.PsiUtilBase -import intellij.haskell.external.GhcModTypeInfo -import intellij.haskell.psi.HaskellPsiHelper -import intellij.haskell.util.HaskellEditorUtil +import intellij.haskell.external.component.StackReplsComponentsManager +import intellij.haskell.util.{HaskellEditorUtil, Util} class ShowTypeAction extends AnAction { override def update(actionEvent: AnActionEvent) { - HaskellEditorUtil.enableAndShowIfInHaskellFile(actionEvent) + HaskellEditorUtil.enableAction(onlyForProjectFile = true, actionEvent) } + // TODO: Add smart enter for adding Hole + // TODO: In case of underscore use GHC error to display expected type def actionPerformed(actionEvent: AnActionEvent) { val context = actionEvent.getDataContext for { @@ -39,18 +39,17 @@ class ShowTypeAction extends AnAction { } yield { val selectionModel = Option(editor.getSelectionModel) selectionModel match { - case Some(sm) if Option(sm.getSelectedText).isDefined => GhcModTypeInfo.findTypeInfoForSelection(psiFile, sm) match { - case Some(ti) => HaskellEditorUtil.showHint(editor, ti.typeSignature) + case Some(sm) if Option(sm.getSelectedText).isDefined => StackReplsComponentsManager.findTypeInfoForSelection(psiFile, sm) match { + case Some(ti) => HaskellEditorUtil.showHint(editor, Util.escapeString(ti.typeSignature)) case None => HaskellEditorUtil.showHint(editor, "Could not determine type for selection") } - case _ => Option(psiFile.findElementAt(offset)).flatMap(e => HaskellPsiHelper.findHaskellNamedElement(e)).foreach { psiElement => - GhcModTypeInfo.findTypeInfoFor(psiFile, psiElement) match { - case Some(ti) => HaskellEditorUtil.showHint(editor, ti.typeSignature) - case None => HaskellEditorUtil.showHint(editor, s"Could not determine type for ${StringUtil.escapeXml(psiElement.getText)}") + case _ => Option(psiFile.findElementAt(offset)).foreach { psiElement => + StackReplsComponentsManager.findTypeInfoForElement(psiElement) match { + case Some(ti) => HaskellEditorUtil.showHint(editor, Util.escapeString(ti.typeSignature)) + case None => HaskellEditorUtil.showHint(editor, s"Could not determine type for ${Util.escapeString(psiElement.getText)}") } } } } } - } diff --git a/src/main/scala/intellij/haskell/annotator/GhcModExternalAnnotator.scala b/src/main/scala/intellij/haskell/annotator/GhcModExternalAnnotator.scala deleted file mode 100644 index 42789314..00000000 --- a/src/main/scala/intellij/haskell/annotator/GhcModExternalAnnotator.scala +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.annotator - -import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer -import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl -import com.intellij.codeInsight.intention.impl.BaseIntentionAction -import com.intellij.lang.annotation.{AnnotationHolder, ExternalAnnotator, HighlightSeverity} -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.project.Project -import com.intellij.openapi.util.TextRange -import com.intellij.psi.PsiFile -import com.intellij.psi.impl.source.tree.TreeUtil -import com.intellij.psi.util.PsiTreeUtil -import intellij.haskell.code.HaskellImportOptimizer -import intellij.haskell.external._ -import intellij.haskell.psi._ -import intellij.haskell.util._ -import intellij.haskell.{HaskellFile, HaskellFileType} - -import scala.annotation.tailrec -import scala.collection.Iterable -import scala.collection.JavaConversions._ - -class GhcModExternalAnnotator extends ExternalAnnotator[GhcModInitialInfo, GhcModCheckResult] { - - private final val NoTypeSignaturePattern = """Warning: Top-level binding with no type signature: (.+)""".r - private final val UseLanguageExtensionPattern = """.*Perhaps you intended to use (\w+) .*""".r - private final val PerhapsYouMeantPattern = """.*Perhaps you meant(.*)""".r - private final val SuggestionPattern = """‘([^‘’]+)’ \(([^\(]+)\)""".r - - override def collectInformation(psiFile: PsiFile, editor: Editor, hasErrors: Boolean): GhcModInitialInfo = { - (psiFile, Option(psiFile.getVirtualFile)) match { - case (_, None) => null // can be case if file is in memory only (just created file) - case (_, Some(f)) if f.getFileType != HaskellFileType.INSTANCE => null - case (_, Some(f)) if f.getPath == null => null - case (_, Some(f)) => GhcModInitialInfo(psiFile, f.getPath) - } - } - - - - override def doAnnotate(initialInfoGhcMod: GhcModInitialInfo): GhcModCheckResult = { - FileUtil.saveFile(initialInfoGhcMod.psiFile) - GhcModCheck.check(initialInfoGhcMod.psiFile.getProject, initialInfoGhcMod) - } - - override def apply(psiFile: PsiFile, ghcModResult: GhcModCheckResult, holder: AnnotationHolder) { - if (psiFile.isValid) { - for (annotation <- createAnnotations(ghcModResult, psiFile)) { - annotation match { - case ErrorAnnotation(textRange, message, htmlMessage) => holder.createAnnotation(HighlightSeverity.ERROR, textRange, message, htmlMessage) - case ErrorAnnotationWithIntentionActions(textRange, message, htmlMessage, intentionActions) => - val annotation = holder.createAnnotation(HighlightSeverity.ERROR, textRange, message, htmlMessage) - intentionActions.foreach(annotation.registerFix) - case WarningAnnotation(textRange, message, htmlMessage) => holder.createAnnotation(HighlightSeverity.WARNING, textRange, message, htmlMessage) - case WarningAnnotationWithIntentionActions(textRange, message, htmlMessage, intentionActions) => - val annotation = holder.createAnnotation(HighlightSeverity.WARNING, textRange, message, htmlMessage) - intentionActions.foreach(annotation.registerFix) - } - } - } - restartCodeAnalyser(psiFile) - } - - private def restartCodeAnalyser(psiFile: PsiFile) { - DaemonCodeAnalyzer.getInstance(psiFile.getProject).asInstanceOf[DaemonCodeAnalyzerImpl].restart(psiFile) - } - - private[annotator] def createAnnotations(ghcModCheckResult: GhcModCheckResult, psiFile: PsiFile): Iterable[Annotation] = { - val problems = ghcModCheckResult.problems.filter(_.filePath == psiFile.getOriginalFile.getVirtualFile.getPath) - problems.flatMap { problem => - val textRange = getProblemTextRange(psiFile, problem) - textRange.map { tr => - val normalizedMessage = problem.normalizedMessage - if (normalizedMessage.startsWith("Warning:")) { - normalizedMessage match { - case NoTypeSignaturePattern(typeSignature) => WarningAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, Iterable(new TypeSignatureIntentionAction(typeSignature))) - case HaskellImportOptimizer.WarningRedundantImport() => WarningAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, Iterable(new OptimizeImportIntentionAction)) - case _ => WarningAnnotation(tr, problem.normalizedMessage, problem.htmlMessage) - } - } else { - normalizedMessage match { - case UseLanguageExtensionPattern(languageExtension) => ErrorAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, Iterable(new LanguageExtensionIntentionAction(languageExtension))) - case PerhapsYouMeantPattern(suggestions) => - val intentionActions = SuggestionPattern.findAllMatchIn(suggestions).map(s => { - val suggestion = s.group(1) - val message = s.group(2) - new PerhapsYouMeantIntentionAction(suggestion, message) - }).toIterable - ErrorAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, intentionActions) - case _ => ErrorAnnotation(tr, problem.normalizedMessage, problem.htmlMessage) - } - } - } - } - } - - private def getProblemTextRange(psiFile: PsiFile, problem: GhcModProblem): Option[TextRange] = { - val ghcModOffset = LineColumnPosition.getOffset(psiFile, LineColumnPosition(problem.lineNr, problem.columnNr)) - ghcModOffset match { - case Some(offset) => Some(findTextRange(psiFile, offset)) - case None => None - } - } - - private def findTextRange(psiFile: PsiFile, offset: Int): TextRange = { - Option(psiFile.findElementAt(offset)) match { - case Some(e: HaskellNamedElement) => e.getTextRange - case Some(e) => Option(PsiTreeUtil.findFirstParent(e, HaskellElementCondition.QVarConOpElementCondition)).map(_.getTextRange).getOrElse(e.getTextRange) - case None => findTextRangeLastElement(offset, psiFile).getOrElse(TextRange.create(0, 0)) - } - } - - @tailrec - private def findTextRangeLastElement(offset: Int, psiFile: PsiFile): Option[TextRange] = { - if (offset > 0) { - Option(psiFile.findElementAt(offset)) match { - case Some(e) => Some(e.getTextRange) - case None => findTextRangeLastElement(offset - 1, psiFile) - } - } - else { - None - } - } -} - -case class GhcModInitialInfo(psiFile: PsiFile, filePath: String) - -sealed trait Annotation { - def textRange: TextRange - - def message: String -} - -case class ErrorAnnotation(textRange: TextRange, message: String, htmlMessage: String) extends Annotation - -case class ErrorAnnotationWithIntentionActions(textRange: TextRange, message: String, htmlMessage: String, baseIntentionActions: Iterable[HaskellBaseIntentionAction]) extends Annotation - -case class WarningAnnotation(textRange: TextRange, message: String, htmlMessage: String) extends Annotation - -case class WarningAnnotationWithIntentionActions(textRange: TextRange, message: String, htmlMessage: String, baseIntentionActions: Iterable[HaskellBaseIntentionAction]) extends Annotation - -abstract class HaskellBaseIntentionAction extends BaseIntentionAction { - override def isAvailable(project: Project, editor: Editor, file: PsiFile): Boolean = { - file.isInstanceOf[HaskellFile] - } -} - -class TypeSignatureIntentionAction(typeSignature: String) extends HaskellBaseIntentionAction { - setText(s"Add type signature: $typeSignature") - - override def getFamilyName: String = "Add type signature" - - override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { - val offset = editor.getCaretModel.getOffset - Option(file.findElementAt(offset)) match { - case Some(e) => - val topDeclaration = TreeUtil.findParent(e.getNode, HaskellTypes.HS_TOP_DECLARATION).getPsi - val moduleBody = topDeclaration.getParent - val topTypeSignature = moduleBody.addBefore(HaskellElementFactory.createTopDeclaration(project, typeSignature), topDeclaration) - moduleBody.addAfter(HaskellElementFactory.createNewLine(project), topTypeSignature) - case None => () - } - } -} - -class LanguageExtensionIntentionAction(languageExtension: String) extends HaskellBaseIntentionAction { - setText(s"Add language extension: $languageExtension") - - override def getFamilyName: String = "Add language extension" - - override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { - val languagePragma = HaskellElementFactory.createLanguagePragma(project, s"{-# LANGUAGE $languageExtension #-} ${OSUtil.LineSeparator}") - Option(PsiTreeUtil.findChildOfType(file, classOf[HaskellFileHeader])) match { - case Some(fh) => - val lastPragma = PsiTreeUtil.findChildrenOfType(fh, classOf[HaskellFileHeaderPragma]).lastOption.orNull - fh.addAfter(languagePragma, lastPragma) - case None => Option(file.getFirstChild) match { - case Some(c) => - val lp = file.addBefore(languagePragma, c) - file.addAfter(HaskellElementFactory.createNewLine(project), lp) - case None => file.add(languagePragma) - } - } - } -} - -class PerhapsYouMeantIntentionAction(suggestion: String, message: String) extends HaskellBaseIntentionAction { - setText(s"Perhaps you meant: $suggestion ($message)") - - override def getFamilyName: String = "Perhaps you meant" - - override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { - val offset = editor.getCaretModel.getOffset - Option(file.findElementAt(offset)).flatMap(e => Option(PsiTreeUtil.findFirstParent(e, HaskellElementCondition.QVarConOpElementCondition))) match { - case Some(e) => - if (e.getText.startsWith("`") && e.getText.endsWith("`")) { - e.replace(HaskellElementFactory.createQVarConOp(project, s"`$suggestion`")) - } else if (e.getText.startsWith("(") && e.getText.endsWith(")")) { - e.replace(HaskellElementFactory.createQVarConOp(project, s"($suggestion)")) - } else { - e.replace(HaskellElementFactory.createQVarConOp(project, suggestion)) - } - case None => () - } - } -} - -class OptimizeImportIntentionAction extends HaskellBaseIntentionAction { - setText("Optimize imports") - - override def getFamilyName: String = "Optimize imports" - - override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { - new HaskellImportOptimizer().processFile(file).run() - } -} diff --git a/src/main/scala/intellij/haskell/annotator/HaskellAnnotator.scala b/src/main/scala/intellij/haskell/annotator/HaskellAnnotator.scala new file mode 100644 index 00000000..b342afcb --- /dev/null +++ b/src/main/scala/intellij/haskell/annotator/HaskellAnnotator.scala @@ -0,0 +1,312 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.annotator + +import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer +import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl +import com.intellij.codeInsight.intention.impl.BaseIntentionAction +import com.intellij.lang.annotation.{AnnotationHolder, ExternalAnnotator, HighlightSeverity} +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.fileEditor.FileEditorManager +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.TextRange +import com.intellij.psi.PsiFile +import com.intellij.psi.impl.source.tree.TreeUtil +import com.intellij.psi.util.PsiTreeUtil +import intellij.haskell.editor.HaskellImportOptimizer +import intellij.haskell.external.component.StackReplsComponentsManager._ +import intellij.haskell.external.component._ +import intellij.haskell.psi._ +import intellij.haskell.util._ +import intellij.haskell.{HaskellFile, HaskellFileType, HaskellNotificationGroup} + +import scala.annotation.tailrec +import scala.collection.Iterable +import scala.collection.JavaConversions._ + +class HaskellAnnotator extends ExternalAnnotator[PsiFile, LoadResult] { + + private final val NoTypeSignaturePattern = """Warning: Top-level binding with no type signature: (.+)""".r + private final val UseLanguageExtensionPattern = """Error: Perhaps you intended to use (\w+) .*""".r + private final val PerhapsYouMeantPattern = """Error: Perhaps you meant(.*)""".r + private final val DefinedButNotUsedPattern = """Warning: Defined but not used: ‘(.*)’""".r + private final val NotInScopePattern = """Error: Not in scope.+ ‘(.*)’""".r + private final val SuggestionPattern = """‘([^‘’]+)’ \(([^\(]+)\)""".r + + override def collectInformation(psiFile: PsiFile, editor: Editor, hasErrors: Boolean): PsiFile = { + (psiFile, Option(psiFile.getOriginalFile.getVirtualFile)) match { + case (_, None) => null // can be in case if file is in memory only (just created file) + case (_, Some(f)) if f.getFileType != HaskellFileType.INSTANCE => null + case (_, Some(f)) if !HaskellProjectUtil.isProjectFile(psiFile) => null + case (_, Some(f)) => psiFile + } + } + + override def doAnnotate(psiFile: PsiFile): LoadResult = { + HaskellFileUtil.saveAllFiles() + StackReplsComponentsManager.loadHaskellFile(psiFile, refreshCache = true) + } + + override def apply(psiFile: PsiFile, loadResult: LoadResult, holder: AnnotationHolder) { + if (psiFile.isValid) { + for (annotation <- createAnnotations(loadResult, psiFile)) { + annotation match { + case ErrorAnnotation(textRange, message, htmlMessage) => holder.createAnnotation(HighlightSeverity.ERROR, textRange, message, htmlMessage) + case ErrorAnnotationWithIntentionActions(textRange, message, htmlMessage, intentionActions) => + val annotation = holder.createAnnotation(HighlightSeverity.ERROR, textRange, message, htmlMessage) + intentionActions.foreach(annotation.registerFix) + case WarningAnnotation(textRange, message, htmlMessage) => holder.createAnnotation(HighlightSeverity.WARNING, textRange, message, htmlMessage) + case WarningAnnotationWithIntentionActions(textRange, message, htmlMessage, intentionActions) => + val annotation = holder.createAnnotation(HighlightSeverity.WARNING, textRange, message, htmlMessage) + intentionActions.foreach(annotation.registerFix) + } + } + } + restartCodeAnalyser(psiFile) + } + + private def restartCodeAnalyser(psiFile: PsiFile) { + HaskellAnnotator.getDaemonCodeAnalyzer(psiFile.getProject).restart(psiFile) + } + + private[annotator] def createAnnotations(loadResult: LoadResult, psiFile: PsiFile): Iterable[Annotation] = { + val problems = loadResult.currentFileProblems.filter(_.filePath == psiFile.getOriginalFile.getVirtualFile.getPath) + + if (loadResult.loadFailed && loadResult.currentFileProblems.isEmpty) { + loadResult.otherFileProblems.foreach { + case cpf: LoadProblemInOtherFile => HaskellNotificationGroup.notifyBalloonError(s"Error in file `${cpf.filePath}`: ${cpf.htmlMessage}") + case cpf: LoadProblemWithoutLocation => HaskellNotificationGroup.notifyBalloonError(s"Error ${cpf.htmlMessage}") + case _ => () + } + } + + problems.flatMap { problem => + val textRange = getProblemTextRange(psiFile, problem) + textRange.map { tr => + val normalizedMessage = problem.normalizedMessage + if (normalizedMessage.startsWith("Warning:")) { + normalizedMessage match { + case NoTypeSignaturePattern(typeSignature) => WarningAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, Iterable(new TypeSignatureIntentionAction(typeSignature))) + case HaskellImportOptimizer.WarningRedundantImport() => WarningAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, Iterable(new OptimizeImportIntentionAction)) + case DefinedButNotUsedPattern(n) => WarningAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, Iterable(new DefinedButNotUsedIntentionAction(n))) + case _ => WarningAnnotation(tr, problem.normalizedMessage, problem.htmlMessage) + } + } else { + normalizedMessage match { + case UseLanguageExtensionPattern(languageExtension) => ErrorAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, Iterable(new LanguageExtensionIntentionAction(languageExtension))) + case PerhapsYouMeantPattern(suggestions) => + val intentionActions = SuggestionPattern.findAllMatchIn(suggestions).map(s => { + val suggestion = s.group(1) + val message = s.group(2) + new PerhapsYouMeantIntentionAction(suggestion, message) + }).toIterable + ErrorAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, intentionActions) + case NotInScopePattern(name) => + val project = psiFile.getProject + val moduleNames = (if (HaskellProjectUtil.isProjectTestFile(psiFile)) { + findGlobalProjectInfo(project).map(_.availableInTestLibraryModuleNames).getOrElse(Iterable()) + } else { + findGlobalProjectInfo(project).map(_.availableInProdLibraryModuleNames).getOrElse(Iterable()) + }) ++ findAvailableProjectModules(project).prodModuleNames + + val moduleIdentifiers = moduleNames.flatMap(mn => findImportedModuleIdentifiers(project, mn).filter(_.name == name)) + val intentions = moduleIdentifiers.map(mi => new NotInScopeIntentionAction(mi.name, mi.moduleName, psiFile)) + ErrorAnnotationWithIntentionActions(tr, problem.normalizedMessage, problem.htmlMessage, intentions) + case _ => ErrorAnnotation(tr, problem.normalizedMessage, problem.htmlMessage) + } + } + } + } + } + + private def getProblemTextRange(psiFile: PsiFile, problem: LoadProblemInCurrentFile): Option[TextRange] = { + LineColumnPosition.getOffset(psiFile, LineColumnPosition(problem.lineNr, problem.columnNr)).map(offset => { + findTextRange(psiFile, offset) + }) + } + + private def findTextRange(psiFile: PsiFile, offset: Int): TextRange = { + Option(psiFile.findElementAt(offset)) match { + case Some(e: HaskellNamedElement) => e.getTextRange + case Some(e) => Option(PsiTreeUtil.findFirstParent(e, HaskellElementCondition.QualifiedNameElementCondition)).map(_.getTextRange).getOrElse(e.getTextRange) + case None => findTextRangeLastElement(offset, psiFile).getOrElse(TextRange.create(0, 0)) + } + } + + @tailrec + private def findTextRangeLastElement(offset: Int, psiFile: PsiFile): Option[TextRange] = { + if (offset > 0) { + Option(psiFile.findElementAt(offset)) match { + case Some(e) => Some(e.getTextRange) + case None => findTextRangeLastElement(offset - 1, psiFile) + } + } + else { + None + } + } +} + +object HaskellAnnotator { + + def getDaemonCodeAnalyzer(project: Project) = { + DaemonCodeAnalyzer.getInstance(project).asInstanceOf[DaemonCodeAnalyzerImpl] + } + + def restartDaemonCodeAnalyzerForOpenFiles(project: Project) = { + ApplicationManager.getApplication.invokeLater { + new Runnable { + override def run(): Unit = { + val openFiles = FileEditorManager.getInstance(project).getOpenFiles + val openProjectFiles = openFiles.filter(vf => HaskellProjectUtil.isProjectFile(vf, project)) + val openProjectPsiFiles = HaskellFileUtil.convertToHaskellFiles(openProjectFiles, project) + openProjectPsiFiles.foreach(pf => + getDaemonCodeAnalyzer(project).restart(pf) + ) + } + } + } + } +} + +private sealed trait Annotation { + def textRange: TextRange + + def message: String +} + +private case class ErrorAnnotation(textRange: TextRange, message: String, htmlMessage: String) extends Annotation + +private case class ErrorAnnotationWithIntentionActions(textRange: TextRange, message: String, htmlMessage: String, baseIntentionActions: Iterable[HaskellBaseIntentionAction]) extends Annotation + +private case class WarningAnnotation(textRange: TextRange, message: String, htmlMessage: String) extends Annotation + +private case class WarningAnnotationWithIntentionActions(textRange: TextRange, message: String, htmlMessage: String, baseIntentionActions: Iterable[HaskellBaseIntentionAction]) extends Annotation + +sealed abstract class HaskellBaseIntentionAction extends BaseIntentionAction { + override def isAvailable(project: Project, editor: Editor, file: PsiFile): Boolean = { + file.isInstanceOf[HaskellFile] + } +} + +class TypeSignatureIntentionAction(typeSignature: String) extends HaskellBaseIntentionAction { + setText(s"Add type signature `$typeSignature`") + + override def getFamilyName: String = "Add type signature" + + override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { + val offset = editor.getCaretModel.getOffset + Option(file.findElementAt(offset)) match { + case Some(e) => + for { + topDeclaration <- Option(TreeUtil.findParent(e.getNode, HaskellTypes.HS_TOP_DECLARATION)) + psi <- Option(topDeclaration.getPsi) + moduleBody <- Option(psi.getParent) + typeSignatureElement <- HaskellElementFactory.createTopDeclaration(project, typeSignature) + typeSignature = moduleBody.addBefore(typeSignatureElement, psi) + } yield moduleBody.addAfter(HaskellElementFactory.createNewLine(project), typeSignature) + case None => () + } + } +} + +class LanguageExtensionIntentionAction(languageExtension: String) extends HaskellBaseIntentionAction { + setText(s"Add language extension `$languageExtension`") + + override def getFamilyName: String = "Add language extension" + + override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { + val languagePragmaElement = HaskellElementFactory.createLanguagePragma(project, s"{-# LANGUAGE $languageExtension #-} ${OSUtil.LineSeparator}") + Option(PsiTreeUtil.findChildOfType(file, classOf[HaskellFileHeader])) match { + case Some(fh) => + val lastPragmaElement = PsiTreeUtil.findChildrenOfType(fh, classOf[HaskellFileHeaderPragma]).lastOption.orNull + fh.addAfter(languagePragmaElement, lastPragmaElement) + case None => Option(file.getFirstChild) match { + case Some(c) => + val addedPragmaElement = file.addBefore(languagePragmaElement, c) + file.addAfter(HaskellElementFactory.createNewLine(project), addedPragmaElement) + case None => file.add(languagePragmaElement) + } + } + } +} + +class PerhapsYouMeantIntentionAction(suggestion: String, message: String) extends HaskellBaseIntentionAction { + setText(s"Perhaps you meant: `$suggestion` ($message)") + + override def getFamilyName: String = "Perhaps you meant" + + override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { + val offset = editor.getCaretModel.getOffset + Option(file.findElementAt(offset)).flatMap(e => Option(PsiTreeUtil.findFirstParent(e, HaskellElementCondition.QualifiedNameElementCondition))) match { + case Some(e) => + if (e.getText.startsWith("`") && e.getText.endsWith("`")) { + e.replace(HaskellElementFactory.createQualifiedNameElement(project, s"`$suggestion`")) + } else if (e.getText.startsWith("(") && e.getText.endsWith(")")) { + e.replace(HaskellElementFactory.createQualifiedNameElement(project, s"($suggestion)")) + } else { + e.replace(HaskellElementFactory.createQualifiedNameElement(project, suggestion)) + } + case None => () + } + } +} + +class DefinedButNotUsedIntentionAction(name: String) extends HaskellBaseIntentionAction { + setText(s"Remove: `$name`") + + override def getFamilyName: String = "Defined but not used" + + override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { + val offset = editor.getCaretModel.getOffset + Option(file.findElementAt(offset)).foreach(_.delete()) + } +} + +class NotInScopeIntentionAction(name: String, moduleName: String, psiFile: PsiFile) extends HaskellBaseIntentionAction { + setText(s"Import `$name` of module `$moduleName`") + + override def getFamilyName: String = "Perhaps you meant" + + override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { + HaskellElementFactory.createImportDeclaration(project, moduleName + "\n").foreach { importDeclarationElement => + Option(PsiTreeUtil.findChildOfType(file, classOf[HaskellImportDeclarations])) match { + case Some(ids) if ids.getImportDeclarationList.nonEmpty => + val lastImportDeclarationElement = PsiTreeUtil.findChildrenOfType(ids, classOf[HaskellImportDeclaration]).lastOption.orNull + ids.addAfter(importDeclarationElement, lastImportDeclarationElement) + case _ => + HaskellPsiUtil.findModuleDeclaration(psiFile) match { + case Some(md) => + val newLine = md.getParent.addAfter(HaskellElementFactory.createNewLine(project), md.getNextSibling) + md.getParent.addAfter(importDeclarationElement, newLine) + case None => file.add(importDeclarationElement) + } + } + } + } +} + +class OptimizeImportIntentionAction extends HaskellBaseIntentionAction { + setText("Optimize imports") + + override def getFamilyName: String = "Optimize imports" + + override def invoke(project: Project, editor: Editor, file: PsiFile): Unit = { + new HaskellImportOptimizer().processFile(file).run() + } +} diff --git a/src/main/scala/intellij/haskell/cabal/CabalCommenter.scala b/src/main/scala/intellij/haskell/cabal/CabalCommenter.scala new file mode 100644 index 00000000..73a50175 --- /dev/null +++ b/src/main/scala/intellij/haskell/cabal/CabalCommenter.scala @@ -0,0 +1,31 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.cabal + +import com.intellij.lang.Commenter + +class CabalCommenter extends Commenter { + override def getCommentedBlockCommentPrefix: String = null + + override def getBlockCommentSuffix: String = null + + override def getBlockCommentPrefix: String = null + + override def getLineCommentPrefix: String = "--" + + override def getCommentedBlockCommentSuffix: String = null +} diff --git a/src/main/scala/intellij/haskell/cabal/CabalFile.scala b/src/main/scala/intellij/haskell/cabal/CabalFile.scala new file mode 100644 index 00000000..a325c15c --- /dev/null +++ b/src/main/scala/intellij/haskell/cabal/CabalFile.scala @@ -0,0 +1,70 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.cabal + +import javax.swing._ + +import com.intellij.extapi.psi.PsiFileBase +import com.intellij.openapi.fileTypes.{FileType, FileTypeConsumer, FileTypeFactory, LanguageFileType} +import com.intellij.psi.FileViewProvider +import intellij.haskell.HaskellIcons +import org.jetbrains.annotations.NotNull + +class CabalFile(viewProvider: FileViewProvider) extends PsiFileBase(viewProvider, CabalLanguage.Instance) { + + @NotNull + def getFileType: FileType = { + CabalFileType.INSTANCE + } + + override def toString: String = { + "Cabal file" + } + + override def getIcon(flags: Int): Icon = { + super.getIcon(flags) + } +} + +object CabalFileType { + final val INSTANCE = new CabalFileType +} + +class CabalFileType extends LanguageFileType(CabalLanguage.Instance) { + + def getName: String = { + "Cabal file" + } + + def getDescription: String = { + "Cabal file (Haskell package description)" + } + + def getDefaultExtension: String = { + "cabal" + } + + def getIcon: Icon = { + HaskellIcons.CabalLogo + } +} + +class CabalFileTypeFactory extends FileTypeFactory { + def createFileTypes(consumer: FileTypeConsumer) { + consumer.consume(CabalFileType.INSTANCE, CabalFileType.INSTANCE.getDefaultExtension) + } +} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/cabal/CabalLanguage.java b/src/main/scala/intellij/haskell/cabal/CabalLanguage.java new file mode 100644 index 00000000..87fc9de9 --- /dev/null +++ b/src/main/scala/intellij/haskell/cabal/CabalLanguage.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.cabal; + +import com.intellij.lang.Language; +import org.jetbrains.annotations.NotNull; + +public class CabalLanguage extends Language { + + public static final CabalLanguage Instance = new CabalLanguage(); + + public CabalLanguage() { + super("Cabal"); + } + + @NotNull + @Override + public String getDisplayName() { + return "Cabal"; + } + + @Override + public boolean isCaseSensitive() { + return true; + } +} diff --git a/src/main/scala/intellij/haskell/code/HaskellCompletionContributor.scala b/src/main/scala/intellij/haskell/code/HaskellCompletionContributor.scala deleted file mode 100644 index ac67ea86..00000000 --- a/src/main/scala/intellij/haskell/code/HaskellCompletionContributor.scala +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.code - -import java.util.concurrent.{Executors, TimeUnit} - -import com.intellij.codeInsight.completion._ -import com.intellij.codeInsight.lookup.LookupElementBuilder -import com.intellij.openapi.editor.Editor -import com.intellij.openapi.project.Project -import com.intellij.patterns.PlatformPatterns -import com.intellij.psi.impl.source.tree.TreeUtil -import com.intellij.psi.util.PsiTreeUtil -import com.intellij.psi.{PsiElement, PsiFile} -import com.intellij.util.ProcessingContext -import intellij.haskell.external.{BrowseInfo, GhcModBrowseInfo, GhcModHaskellInfo, GhcModModulesInfo} -import intellij.haskell.psi.HaskellTypes._ -import intellij.haskell.psi._ -import intellij.haskell.util.{HaskellElementCondition, OSUtil} -import intellij.haskell.{HaskellIcons, HaskellParserDefinition} - -import scala.annotation.tailrec -import scala.collection.JavaConversions._ -import scala.concurrent.duration.Duration -import scala.concurrent.{Await, ExecutionContext, Future} - -class HaskellCompletionContributor extends CompletionContributor { - - private final val ExecutorService = Executors.newCachedThreadPool() - implicit private final val ExecContext = ExecutionContext.fromExecutorService(ExecutorService) - - private final val ReservedIds = HaskellParserDefinition.ALL_RESERVED_IDS.getTypes.map(_.asInstanceOf[HaskellTokenType].getName).toSeq - private final val SpecialReservedIds = Seq("forall", "safe", "unsafe") - private final val PragmaStartEndIds = Seq("{-#", "#-}") - private final val FileHeaderPragmaIds = Seq("LANGUAGE", "OPTIONS_HADDOCK", "INCLUDE", "OPTIONS", "OPTIONS_GHC", "ANN") - private final val ModulePragmaIds = Seq("ANN", "DEPRECATED", "WARING", "INLINE", "NOINLINE", "NOTINLINE", "INLINABEL", "LINE", "RULES", - "SPECIALIZE", "SPECIALISE", "MINIMAL", "SOURCE", "UNPACK", "NOUNPACK") - private final val InsideImportClauses = Seq("as", "hiding", "qualified") - private final val CommentIds = Seq("{-", "-}", "--") - - private final val PlainPrefixElementTypes = Seq(HS_COMMENT, HS_NCOMMENT, HS_PRAGMA_START, HS_PRAGMA_END) - - val provider = new CompletionProvider[CompletionParameters] { - def addCompletions(parameters: CompletionParameters, context: ProcessingContext, originalResultSet: CompletionResultSet) { - val project = parameters.getPosition.getProject - val file = parameters.getOriginalFile - - val resultSet = getNonEmptyElement(parameters.getOriginalPosition).orElse(getNonEmptyElement(parameters.getPosition)) match { - case Some(e) if PlainPrefixElementTypes.contains(e.getNode.getElementType) | e.getText.startsWith("{") | e.getText.startsWith("#") | e.getText.startsWith("-") => originalResultSet.withPrefixMatcher(new PlainPrefixMatcher(getTextAtCaret(parameters.getEditor, file))) - case Some(e) if e.getNode.getElementType == HS_CONID_ID && getTextAtCaret(parameters.getEditor, file).endsWith(".") => originalResultSet.withPrefixMatcher(new PlainPrefixMatcher(getTextAtCaret(parameters.getEditor, file))) - case _ => originalResultSet - } - - val completionPosition = Option(parameters.getOriginalPosition).orElse(Option(parameters.getPosition)) - completionPosition match { - case Some(p) if isFileHeaderPragmaInProgress(p) => - resultSet.addAllElements(getLanguageExtensions(project).toSeq) - resultSet.addAllElements(getPragmaStartEndIds) - resultSet.addAllElements(getFileHeaderPragmaIds) - case Some(p) if isPragmaInProgress(p) => - resultSet.addAllElements(getModulePragmaIds) - resultSet.addAllElements(getPragmaStartEndIds) - case Some(p) if isImportSpecInProgress(p) => - resultSet.addAllElements(findIdsForInImportModuleSpec(project, p).toSeq) - case Some(p) if isImportQualifiedAsInProgress(p) => - resultSet.addAllElements(Seq[LookupElementBuilder]()) - case Some(p) if isImportModuleDeclarationInProgress(p) => - resultSet.addAllElements(findModulesToImport(project).toSeq) - resultSet.addAllElements(getInsideImportClauses) - case Some(p) if isNCommentInProgress(p) => - resultSet.addAllElements(getPragmaStartEndIds) - resultSet.addAllElements(getCommentIds) - case Some(p) => - val importDeclarations = findImportDeclarations(file) - getQualifiedIdentifierInProgress(p) match { - case Some(qid) => - val fullScopeIds = getIdsFromFullScopeImportedModules(project, file, importDeclarations, Some(qid)) - val specIdsScopeIds = getIdsFromSpecIdsImportedModules(project, file, importDeclarations, Some(qid)) - resultSet.addAllElements(if (fullScopeIds.isEmpty) specIdsScopeIds else fullScopeIds) - case _ => - resultSet.addAllElements(getReservedIds) - resultSet.addAllElements(getSpecialReservedIds) - resultSet.addAllElements(getPragmaStartEndIds) - resultSet.addAllElements(getCommentIds) - resultSet.addAllElements(getIdsFromFullScopeImportedModules(project, file, importDeclarations)) - resultSet.addAllElements(getIdsFromHidingIdsImportedModules(project, file, importDeclarations)) - resultSet.addAllElements(getIdsFromSpecIdsImportedModules(project, file, importDeclarations)) - } - case _ => () - } - } - } - - Seq(HS_VARID_ID, HS_CONID_ID, HS_VARSYM_ID, HS_CONSYM_ID).foreach(t => - extend(CompletionType.BASIC, PlatformPatterns.psiElement().withElementType(t), provider) - ) - - private def getTextAtCaret(editor: Editor, file: PsiFile): String = { - val caretOffset = editor.getCaretModel.getOffset - getTextUntilNoChar(file.getText, if (caretOffset > 0) caretOffset - 1 else caretOffset, "") - } - - @tailrec - private def getTextUntilNoChar(fileText: String, offset: Int, text: String): String = { - val c = fileText.charAt(offset) - if (c < ' ' || c == OSUtil.LineSeparator || c == '\r') { - text - } else { - if (offset > 0) { - getTextUntilNoChar(fileText, offset - 1, c.toString + text) - } else { - c.toString + text - } - } - } - - private def getNonEmptyElement(element: PsiElement) = { - Option(element) match { - case Some(s) if !s.getText.trim.isEmpty => Some(s) - case _ => None - } - } - - private def isImportSpecInProgress(position: PsiElement): Boolean = { - Option(PsiTreeUtil.findFirstParent(position, HaskellElementCondition.ImportSpecCondition)).isDefined - } - - private def findIdsForInImportModuleSpec(project: Project, position: PsiElement) = { - (for { - importDeclaration <- Option(TreeUtil.findParent(position.getNode, HS_IMPORT_DECLARATION)) - moduleName <- Option(PsiTreeUtil.findChildOfType(importDeclaration.getPsi, classOf[HaskellImportModule])).map(_.getModId.getText) - } yield GhcModBrowseInfo.browseInfo(project, moduleName, removeParensFromOperator = false)).map(_.map(createLookUpElementForBrowseInfo)).getOrElse(Seq()) - } - - private def isImportModuleDeclarationInProgress(position: PsiElement): Boolean = { - Option(PsiTreeUtil.findFirstParent(position, HaskellElementCondition.ImportDeclarationCondition)).isDefined || - Option(TreeUtil.findSiblingBackward(position.getNode, HS_IMPORT)).isDefined - } - - private def isImportQualifiedAsInProgress(position: PsiElement): Boolean = { - Option(TreeUtil.findSiblingBackward(position.getNode, HS_IMPORT_QUALIFIED_AS)).isDefined - } - - private def findModulesToImport(project: Project) = { - GhcModModulesInfo.listAvailableModules(project).map(m => LookupElementBuilder.create(m).withTailText(" module", true)) - } - - private def getInsideImportClauses = { - InsideImportClauses.map(c => LookupElementBuilder.create(c).withTailText(" clause", true)) - } - - private def isFileHeaderPragmaInProgress(position: PsiElement): Boolean = { - Option(PsiTreeUtil.findFirstParent(position, HaskellElementCondition.FileHeaderCondition)).isDefined - } - - private def isPragmaInProgress(position: PsiElement): Boolean = { - Option(TreeUtil.findSiblingBackward(position.getNode, HS_PRAGMA_START)).isDefined - } - - private def getQualifiedIdentifierInProgress(position: PsiElement): Option[String] = { - val qualifiedElement = Option(PsiTreeUtil.findFirstParent(position, HaskellElementCondition.QualifiedElementCondition)) - qualifiedElement.map { - case qe: HaskellQvarId => qe.getQualifier.getName - case qe: HaskellQconId => qe.getQconIdQualifier.getText.init // init to remove trailing dot - case qe: HaskellQvarSym => qe.getQualifier.getName - case qe: HaskellQconSym => qe.getQualifier.getName - }.orElse { - val elementType = position.getNode.getElementType - if (elementType == HS_DOT) { - Option(position.getPrevSibling).flatMap(ps => { - Option(PsiTreeUtil.findChildOfType(ps, classOf[HaskellQcon])).flatMap(_.getQualifier) - }) - } else { - None - } - } - } - - private def isNCommentInProgress(position: PsiElement): Boolean = { - position.getNode.getElementType == HS_NCOMMENT - } - - private def getLanguageExtensions(project: Project) = { - GhcModHaskellInfo.listLanguageExtensions(project).map(n => LookupElementBuilder.create(n).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" language extension", true)) - } - - private def getPragmaStartEndIds = { - PragmaStartEndIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" pragma", true)) - } - - private def getFileHeaderPragmaIds = { - FileHeaderPragmaIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" pragma", true)) - } - - private def getModulePragmaIds = { - ModulePragmaIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" pragma", true)) - } - - private def getCommentIds = { - CommentIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" comment", true)) - } - - private def getImportedModulesWithFullScope(psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]): Iterable[ImportFullSpec] = { - val moduleNames = importDeclarations.filter(i => Option(i.getImportSpec).isEmpty). - map(i => ImportFullSpec(i.getModuleName, Option(i.getImportQualified).isDefined, Option(i.getImportQualifiedAs).map(_.getQualifier).map(_.getName))) - if (importDeclarations.exists(_.getModuleName == "Prelude")) { - moduleNames - } else { - Iterable(ImportFullSpec("Prelude", qualified = false, None)) ++ moduleNames - } - } - - private def getImportedModulesWithHidingIdsSpec(psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]): Iterable[ImportHidingIdsSpec] = { - for { - importDeclaration <- importDeclarations.filter(i => Option(i.getImportSpec).flatMap(is => Option(is.getImportHidingSpec)).isDefined) - importIdList = importDeclaration.getImportSpec.getImportHidingSpec.getImportIdList - } yield ImportHidingIdsSpec( - importDeclaration.getModuleName, - importIdList.map(id => Option(id.getQvar).map(_.getName).getOrElse(id.getQcon.getName)), - Option(importDeclaration.getImportQualified).isDefined, - Option(importDeclaration.getImportQualifiedAs).map(_.getQualifier).map(_.getName) - ) - } - - private def getImportedModulesWithSpecIds(psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]): Iterable[ImportIdsSpec] = { - for { - importDeclaration <- importDeclarations.filter(i => Option(i.getImportSpec).flatMap(is => Option(is.getImportIdsSpec)).isDefined) - importIdList = importDeclaration.getImportSpec.getImportIdsSpec.getImportIdList - } yield ImportIdsSpec( - importDeclaration.getModuleName, - importIdList.map(id => Option(id.getQvar).map(_.getName).getOrElse(id.getQcon.getName)), - Option(importDeclaration.getImportQualified).isDefined, - Option(importDeclaration.getImportQualifiedAs).map(_.getQualifier).map(_.getName) - ) - } - - private def getIdsFromFullScopeImportedModules(project: Project, file: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration], qualifier: Option[String] = None) = { - val importFullSpecs = getImportedModulesWithFullScope(file, importDeclarations).toSeq - - val browseInfosWithImportSpecFutures = importFullSpecs. - map(ifs => Future { - BrowseInfosForImportFullSpec(ifs, GhcModBrowseInfo.browseInfo(project, ifs.moduleName, removeParensFromOperator = true)) - }.map(bi => createLookupElements(bi.importSpec, bi.browseInfos, qualifier))) - - Await.result(Future.sequence(browseInfosWithImportSpecFutures), Duration.create(5, TimeUnit.SECONDS)).flatten - } - - private def getIdsFromHidingIdsImportedModules(project: Project, file: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]) = { - val importHidingIdsSpec = getImportedModulesWithHidingIdsSpec(file, importDeclarations).toSeq - - val browseInfosWithImportHidingIdsSpecFutures = importHidingIdsSpec. - map(bi => Future { - BrowseInfosForImportHidingIdsSpec(bi, GhcModBrowseInfo.browseInfo(project, bi.moduleName, removeParensFromOperator = true)) - }.map(bis => createLookupElements(bis.importSpec, bis.browseInfos.filterNot(bi => bis.importSpec.ids.contains(bi.name)), None))) - - Await.result(Future.sequence(browseInfosWithImportHidingIdsSpecFutures), Duration.create(5, TimeUnit.SECONDS)).flatten - } - - private def getIdsFromSpecIdsImportedModules(project: Project, file: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration], qualifier: Option[String] = None) = { - val importIdsSpec = getImportedModulesWithSpecIds(file, importDeclarations).toSeq - - val browseInfosWithImportIdsSpecFutures = importIdsSpec. - map(iis => Future { - BrowseInfosForImportIdsSpec(iis, GhcModBrowseInfo.browseInfo(project, iis.moduleName, removeParensFromOperator = true)) - }.map(bis => createLookupElements(bis.importSpec, bis.browseInfos.filter(bi => bis.importSpec.ids.contains(bi.name)), qualifier))) - - Await.result(Future.sequence(browseInfosWithImportIdsSpecFutures), Duration.create(5, TimeUnit.SECONDS)).flatten - } - - private def createLookupElements(importSpec: ImportSpec, browseInfos: Iterable[BrowseInfo], qualifier: Option[String]): Iterable[LookupElementBuilder] = { - browseInfos.flatMap(bi => { - (qualifier, importSpec.as) match { - case (Some(q), Some(as)) if q == as => Iterable(createLookUpElementForBrowseInfo(bi)) - case (None, _) => - if (importSpec.qualified) - Iterable(createQualifiedLookUpElementForBrowseInfo(bi, importSpec.as)) - else - Iterable(createQualifiedLookUpElementForBrowseInfo(bi, importSpec.as), createLookUpElementForBrowseInfo(bi)) - case _ => Iterable() - } - }) - } - - private def getReservedIds = { - ReservedIds.map(r => LookupElementBuilder.create(r).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" keyword", true)) - } - - private def getSpecialReservedIds = { - SpecialReservedIds.map(sr => LookupElementBuilder.create(sr).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" special keyword", true)) - } - - private def findImportDeclarations(psiFile: PsiFile) = { - HaskellPsiHelper.findImportDeclarations(psiFile) - } - - private def createLookUpElementForBrowseInfo(browseInfo: BrowseInfo) = { - val leb = LookupElementBuilder.create(browseInfo.name).withTailText(" " + browseInfo.moduleName, true).withIcon(findIcon(browseInfo)) - withTypeText(leb, browseInfo) - } - - private def createQualifiedLookUpElementForBrowseInfo(browseInfo: BrowseInfo, as: Option[String]) = { - val le = LookupElementBuilder.create(as.getOrElse(browseInfo.moduleName) + "." + browseInfo.name).withTailText(" " + browseInfo.moduleName, true).withIcon(findIcon(browseInfo)) - withTypeText(le, browseInfo) - } - - private def withTypeText(lookupElement: LookupElementBuilder, browseInfo: BrowseInfo) = { - browseInfo.declaration match { - case Some(d) => lookupElement.withTypeText(d) - case None => lookupElement - } - } - - private def findIcon(browseInfo: BrowseInfo) = { - import intellij.haskell.HaskellIcons._ - browseInfo.declaration match { - case Some(d) if d.startsWith("class ") => Class - case Some(d) if d.startsWith("data ") => Data - case Some(d) if d.startsWith("default ") => Default - case Some(d) if d.startsWith("foreign ") => Foreign - case Some(d) if d.startsWith("instance ") => Instance - case Some(d) if d.startsWith("new type ") => NewType - case Some(d) if d.startsWith("type family ") => TypeFamily - case Some(d) if d.startsWith("type instance ") => TypeInstance - case Some(d) if d.startsWith("type ") => Type - case Some(d) if d.startsWith("module ") => Module - case _ => TypeSignature - } - } - - private sealed abstract class ImportSpec { - def moduleName: String - - def qualified: Boolean - - def as: Option[String] - } - - private case class ImportFullSpec(moduleName: String, qualified: Boolean, as: Option[String]) extends ImportSpec - - private case class ImportHidingIdsSpec(moduleName: String, ids: Iterable[String], qualified: Boolean, as: Option[String]) extends ImportSpec - - private case class ImportIdsSpec(moduleName: String, ids: Iterable[String], qualified: Boolean, as: Option[String]) extends ImportSpec - - private case class BrowseInfosForImportFullSpec(importSpec: ImportSpec, browseInfos: Iterable[BrowseInfo]) - - private case class BrowseInfosForImportHidingIdsSpec(importSpec: ImportHidingIdsSpec, browseInfos: Iterable[BrowseInfo]) - - private case class BrowseInfosForImportIdsSpec(importSpec: ImportIdsSpec, browseInfos: Iterable[BrowseInfo]) - -} diff --git a/src/main/scala/intellij/haskell/code/formatter/HaskellFormattingBlock.scala b/src/main/scala/intellij/haskell/code/formatter/HaskellFormattingBlock.scala deleted file mode 100644 index e7c2d6d4..00000000 --- a/src/main/scala/intellij/haskell/code/formatter/HaskellFormattingBlock.scala +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.code.formatter - -import java.util - -import com.intellij.formatting._ -import com.intellij.lang.ASTNode -import com.intellij.psi.TokenType -import com.intellij.psi.formatter.common.AbstractBlock -import com.intellij.psi.impl.source.tree.TreeUtil -import com.intellij.psi.tree.IElementType -import intellij.haskell.psi.HaskellTypes -import intellij.haskell.psi.HaskellTypes._ - -import scala.annotation.tailrec -import scala.collection.JavaConversions._ -import scala.collection.mutable - -class HaskellFormattingBlock(node: ASTNode, alignment: Option[Alignment], spacingBuilder: SpacingBuilder, parentBlock: Block) extends AbstractBlock(node, null, alignment.orNull) { - - private var subBlocks: Option[Seq[Block]] = None - - override def buildChildren: util.List[Block] = { - subBlocks match { - case Some(b) => b - case None => - val blocks = buildSubBlocks - subBlocks = Some(blocks) - blocks - } - } - - def buildSubBlocks: util.List[Block] = { - val alignments = Seq.fill(9)(Alignment.createAlignment(true)) - - val child: ASTNode = node.getFirstChildNode - - @tailrec - def getBlocks(child: ASTNode, previousChild: ASTNode, blocks: mutable.Seq[Block]): Seq[Block] = { - if (child == null) { - blocks - } else if (shouldCreateBlockFor(child, previousChild)) { - getBlocks(child.getTreeNext, child, blocks.:+(createChildBlock(node, child, alignments))) - } else { - getBlocks(child.getTreeNext, child, blocks) - } - } - getBlocks(child, null, mutable.Seq()) - } - - def createChildBlock(parent: ASTNode, child: ASTNode, alignments: Seq[Alignment]): Block = { - new HaskellFormattingBlock(child, getAlignment(parent, child, alignments), spacingBuilder, this) - } - - private def getAlignment(parent: ASTNode, child: ASTNode, alignments: Seq[Alignment]): Option[Alignment] = { - val childType: IElementType = child.getElementType - - childType match { - case HS_LEFT_PAREN | HS_RIGHT_PAREN | HS_LEFT_BRACE | HS_RIGHT_BRACE | HS_LEFT_BRACKET | HS_RIGHT_BRACKET | HS_COMMA => Some(alignments.head) - case HS_VERTICAL_BAR | HS_EQUAL => Some(alignments(1)) - case HS_EXPORT => Some(alignments(2)) - case HS_IF | HS_THEN | HS_ELSE => Some(alignments(3)) - case HS_DO | HS_WHERE if parent.getElementType != HS_MODULE_DECLARATION => Some(alignments(4)) - case HS_EXPORTS | HS_WHERE if parent.getElementType != HS_MODULE_DECLARATION => Some(alignments(5)) - case HS_LINE_EXPRESSION | HS_LAST_LINE_EXPRESSION => Some(alignments(6)) - case HS_CONSTR_1 | HS_CONSTR_2 | HS_CONSTR_3 | HS_CONSTR_4 => Some(alignments(7)) - case _ => None - } - } - - private def shouldCreateBlockFor(node: ASTNode, previousNode: ASTNode): Boolean = { - if (node.getElementType == HS_MODULE_BODY) { - node.getChildren(null).length > 0 - } - else { - (node.getElementType == TokenType.WHITE_SPACE && previousNode != null && previousNode.getElementType == HS_NEWLINE) || - (node.getElementType == HS_NEWLINE && previousNode != null && previousNode.getElementType == TokenType.WHITE_SPACE) || - node.getElementType != TokenType.WHITE_SPACE && node.getElementType != HS_NEWLINE - } - } - - override def getChildAttributes(newChildIndex: Int): ChildAttributes = { - new ChildAttributes(Indent.getNoneIndent, getFirstChildAlignment) - } - - private def getFirstChildAlignment: Alignment = { - getSubBlocks.find(_.getAlignment != null).map(_.getAlignment).orNull - } - - override def getIndent: Indent = { - IndentProcessor.getChildIndent(node) - } - - override def isLeaf: Boolean = { - node.getFirstChildNode == null - } - - override def getSpacing(child1: Block, child2: Block): Spacing = { - spacingBuilder.getSpacing(this, child1, child2) - } -} - -object IndentProcessor { - - def getChildIndent(child: ASTNode): Indent = { - import com.intellij.formatting.Indent._ - - val childType = child.getElementType - childType match { - case HS_MODULE_BODY | HS_MODULE_DECLARATION | HS_IMPORT_DECLARATION => getAbsoluteNoneIndent - case HS_MODULE => getAbsoluteNoneIndent - case HS_DO | HS_WHERE | HS_IF | HS_CASE | HS_DERIVING => getNormalIndent - case HS_EQUAL | HS_QVAR_SYM => getNormalIndent - case HS_VERTICAL_BAR => getNormalIndent - case HS_IDECL | HS_CDECL => getNormalIndent - case HS_CONSTR_1 | HS_CONSTR_2 | HS_CONSTR_3 | HS_CONSTR_4 => getNormalIndent - case HS_EXPRESSION if child.getTreeParent.getElementType == HS_TOP_DECLARATION => getAbsoluteNoneIndent - case HS_EXPRESSION => getNormalIndent - case HS_LAST_LINE_EXPRESSION | HS_FIRST_LINE_EXPRESSION | HS_LINE_EXPRESSION if Option(child.getTreeParent).map(_.getTreeParent).exists(_.getElementType == HS_TOP_DECLARATION) => getNoneIndent - case HS_LINE_EXPRESSION => getNormalIndent - case HS_COMMENT | HS_NCOMMENT => getNoneIndent - case HS_LEFT_PAREN | HS_LEFT_BRACE | HS_LEFT_BRACKET - if TreeUtil.findParent(child, HaskellTypes.HS_LINE_EXPRESSION) != null | - TreeUtil.findParent(child, HaskellTypes.HS_MODULE_DECLARATION) != null | - TreeUtil.findParent(child, HaskellTypes.HS_IMPORT_DECLARATION) != null => getContinuationIndent - case _ => getNoneIndent - } - } -} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/code/formatter/HaskellFormattingModelBuilder.scala b/src/main/scala/intellij/haskell/code/formatter/HaskellFormattingModelBuilder.scala deleted file mode 100644 index 52a8e048..00000000 --- a/src/main/scala/intellij/haskell/code/formatter/HaskellFormattingModelBuilder.scala +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.code.formatter - -import com.intellij.formatting._ -import com.intellij.lang.ASTNode -import com.intellij.openapi.util.TextRange -import com.intellij.psi.codeStyle.{CodeStyleSettings, CommonCodeStyleSettings} -import com.intellij.psi.tree.TokenSet -import com.intellij.psi.{PsiElement, PsiFile} -import intellij.haskell.code.formatter.settings.HaskellCodeStyleSettings -import intellij.haskell.psi.HaskellTypes._ -import intellij.haskell.{HaskellLanguage, HaskellParserDefinition} -import org.jetbrains.annotations.{NotNull, Nullable} - -object HaskellFormattingModelBuilder { - def createSpacingBuilder(settings: CommonCodeStyleSettings, haskellCodeStyleSettings: HaskellCodeStyleSettings): SpacingBuilder = { - new SpacingBuilder(settings.getRootSettings, HaskellLanguage.Instance). - before(HS_COMMA).spaceIf(settings.SPACE_BEFORE_COMMA). - after(HS_COMMA).spaceIf(settings.SPACE_AFTER_COMMA). - before(HS_LEFT_PAREN).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_LEFT_PAREN).spacing(0, 0, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - before(HS_RIGHT_PAREN).spacing(0, 0, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_RIGHT_PAREN).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - before(HS_LEFT_BRACKET).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_LEFT_BRACKET).spacing(0, 0, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - before(HS_RIGHT_BRACKET).spacing(0, 0, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_RIGHT_BRACKET).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_RIGHT_BRACE).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - before(HS_LEFT_BRACE).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_LEFT_BRACE).spacing(0, 0, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - before(HS_RIGHT_BRACE).spacing(0, 0, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_RIGHT_BRACE).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - around(HS_DOT).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - around(HaskellParserDefinition.RESERVED_IDS).spaces(1). - around(TokenSet.create(HS_TTYPE)).spaces(1). - around(HS_QVAR).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - around(HS_QCON).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - around(HS_QVAR_OP).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - around(HS_QCON_OP).spacing(0, 1, 0, settings.KEEP_LINE_BREAKS, settings.KEEP_BLANK_LINES_IN_CODE). - after(HS_VERTICAL_BAR).spaces(1). - around(HS_EXPORT).spaces(0). - around(TokenSet.create(HS_COLON_COLON, HS_DOUBLE_RIGHT_ARROW, HS_LEFT_ARROW, HS_RIGHT_ARROW)).spaces(1). - after(TokenSet.create(HS_EQUAL)).spaces(1) - } -} - -class HaskellFormattingModelBuilder extends FormattingModelBuilder { - - @NotNull - def createModel(element: PsiElement, settings: CodeStyleSettings): FormattingModel = { - val commonSettings: CommonCodeStyleSettings = settings.getCommonSettings(HaskellLanguage.Instance) - val haskellSettings: HaskellCodeStyleSettings = settings.getCustomSettings(classOf[HaskellCodeStyleSettings]) - val spacingBuilder: SpacingBuilder = HaskellFormattingModelBuilder.createSpacingBuilder(commonSettings, haskellSettings) - val block: HaskellFormattingBlock = new HaskellFormattingBlock(element.getNode, None, spacingBuilder, null) - FormattingModelProvider.createFormattingModelForPsiFile(element.getContainingFile, block, settings) - } - - @Nullable - def getRangeAffectingIndent(file: PsiFile, offset: Int, elementAtOffset: ASTNode): TextRange = { - null - } -} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/code/HaskellCommenter.scala b/src/main/scala/intellij/haskell/editor/HaskellCommenter.scala similarity index 98% rename from src/main/scala/intellij/haskell/code/HaskellCommenter.scala rename to src/main/scala/intellij/haskell/editor/HaskellCommenter.scala index fb5b722a..785056aa 100644 --- a/src/main/scala/intellij/haskell/code/HaskellCommenter.scala +++ b/src/main/scala/intellij/haskell/editor/HaskellCommenter.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.code +package intellij.haskell.editor import com.intellij.lang.CodeDocumentationAwareCommenter import com.intellij.psi.PsiComment diff --git a/src/main/scala/intellij/haskell/code/HaskellCompletionCharFilter.scala b/src/main/scala/intellij/haskell/editor/HaskellCompletionCharFilter.scala similarity index 93% rename from src/main/scala/intellij/haskell/code/HaskellCompletionCharFilter.scala rename to src/main/scala/intellij/haskell/editor/HaskellCompletionCharFilter.scala index e41a3741..d5370955 100644 --- a/src/main/scala/intellij/haskell/code/HaskellCompletionCharFilter.scala +++ b/src/main/scala/intellij/haskell/editor/HaskellCompletionCharFilter.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.code +package intellij.haskell.editor import com.intellij.codeInsight.lookup.CharFilter.Result import com.intellij.codeInsight.lookup.{CharFilter, Lookup} diff --git a/src/main/scala/intellij/haskell/editor/HaskellCompletionContributor.scala b/src/main/scala/intellij/haskell/editor/HaskellCompletionContributor.scala new file mode 100644 index 00000000..bacbb7a1 --- /dev/null +++ b/src/main/scala/intellij/haskell/editor/HaskellCompletionContributor.scala @@ -0,0 +1,424 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.editor + +import java.util +import java.util.concurrent.{Executors, TimeUnit} + +import com.intellij.codeInsight.completion._ +import com.intellij.codeInsight.lookup.LookupElementBuilder +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.text.StringUtil +import com.intellij.patterns.PlatformPatterns +import com.intellij.psi.impl.source.tree.TreeUtil +import com.intellij.psi.util.PsiTreeUtil +import com.intellij.psi.{PsiElement, PsiFile, TokenType} +import com.intellij.util.ProcessingContext +import intellij.haskell.HaskellIcons +import intellij.haskell.external.component.StackReplsComponentsManager._ +import intellij.haskell.external.component.{ModuleIdentifier, StackReplsComponentsManager} +import intellij.haskell.psi.HaskellElementCondition._ +import intellij.haskell.psi.HaskellPsiUtil._ +import intellij.haskell.psi.HaskellTypes._ +import intellij.haskell.psi._ +import intellij.haskell.util.HaskellProjectUtil + +import scala.collection.JavaConversions._ +import scala.concurrent.duration.Duration +import scala.concurrent.{Await, ExecutionContext, Future} + +class HaskellCompletionContributor extends CompletionContributor { + + private final val ExecutorService = Executors.newCachedThreadPool() + implicit private final val ExecContext = ExecutionContext.fromExecutorService(ExecutorService) + + private final val Keywords = Stream("data", "class", "instance", "type", "family", "module", "newtype", "let", "where", "if", "then", "else", "of", + "foreign", "case", "deriving", "infixr", "infixl", "infix", "in", "forall") + private final val SpecialReservedIds = Stream("safe", "unsafe") + private final val PragmaIds = Stream("{-#", "#-}") + private final val FileHeaderPragmaIds = Stream("LANGUAGE", "OPTIONS_HADDOCK", "INCLUDE", "OPTIONS", "OPTIONS_GHC", "ANN") + private final val ModulePragmaIds = Stream("ANN", "DEPRECATED", "WARING", "INLINE", "NOINLINE", "NOTINLINE", "INLINABEL", "LINE", "RULES", + "SPECIALIZE", "SPECIALISE", "MINIMAL", "SOURCE", "UNPACK", "NOUNPACK") + private final val InsideImportKeywords = Stream("as", "hiding", "qualified") + private final val CommentIds = Stream("{-", "-}", "--") + + def findQualifiedNamedElementToComplete(element: PsiElement) = { + val elementType = Option(element.getNode.getElementType) + val psiFile = element.getContainingFile + (for { + et <- elementType + if et == HS_DOT + e <- Option(psiFile.findElementAt(element.getTextOffset - 1)) + p <- HaskellPsiUtil.findQualifiedNameElement(e) + } yield p).orElse(for { + et <- elementType + if et == HS_NEWLINE || et == TokenType.WHITE_SPACE + d <- Option(psiFile.findElementAt(element.getTextOffset - 1)) + if d.getNode.getElementType == HS_DOT + e <- Option(psiFile.findElementAt(element.getTextOffset - 2)) + p <- HaskellPsiUtil.findQualifiedNameElement(e) + } yield p). + orElse(HaskellPsiUtil.findQualifiedNameElement(element)) + } + + val provider = new CompletionProvider[CompletionParameters] { + def addCompletions(parameters: CompletionParameters, context: ProcessingContext, originalResultSet: CompletionResultSet) { + + val project = parameters.getPosition.getProject + val psiFile = parameters.getOriginalFile + + if (!HaskellProjectUtil.isProjectFile(psiFile)) { + return + } + + // In case element before caret is a qualifier, module name or a dot we have to "help" IntelliJ to get the right preselected elements behavior + // For example, asking for completion in case typing `Data.List.` will give without this help no prefix. + val originalPositionElement = Option(parameters.getOriginalPosition) + val prefixText = ( + for { + e <- originalPositionElement + p <- HaskellPsiUtil.findModIdElement(e) + start = p.getTextRange.getStartOffset + end = parameters.getOffset + } yield psiFile.getText.substring(start, end) + ).orElse({ + for { + e <- originalPositionElement + p <- findQualifiedNamedElementToComplete(e) + start = if (p.getText.startsWith("(")) p.getTextRange.getStartOffset + 1 else p.getTextRange.getStartOffset + end = parameters.getOffset + } yield psiFile.getText.substring(start, end) + }).orElse( + for { + e <- originalPositionElement + if e.getNode.getElementType != HS_RIGHT_PAREN + t <- Option(e.getText).filter(_.trim.nonEmpty) + } yield t + ) + + val resultSet = prefixText match { + case Some(t) => originalResultSet.withPrefixMatcher(originalResultSet.getPrefixMatcher.cloneWithPrefix(t)) + case _ => originalResultSet + } + + originalPositionElement match { + case Some(e) if isFileHeaderPragmaInProgress(e) => + resultSet.addAllElements(getLanguageExtensions(project).toStream) + resultSet.addAllElements(getPragmaStartEndIds) + resultSet.addAllElements(getFileHeaderPragmaIds) + case Some(e) if isPragmaInProgress(e) => + resultSet.addAllElements(getModulePragmaIds) + resultSet.addAllElements(getPragmaStartEndIds) + case Some(e) if isImportSpecInProgress(e) => + resultSet.addAllElements(findAvailableIdsForImportModuleSpec(project, e, psiFile).toStream) + case Some(e) if isImportModuleDeclarationInProgress(e) => + // Do not give suggestions when defining import qualifier + if (e.getParent.getNode.getElementType != HS_QUALIFIER) { + resultSet.addAllElements(findAvailableModules(project, psiFile).toStream) + resultSet.addAllElements(getInsideImportClauses) + } + case Some(e) if isNCommentInProgress(e) => + resultSet.addAllElements(getPragmaStartEndIds) + resultSet.addAllElements(getCommentIds) + case op => + val importDeclarations = findImportDeclarations(psiFile) + resultSet.addAllElements(getReservedNames) + resultSet.addAllElements(getSpecialReservedIds) + resultSet.addAllElements(getPragmaStartEndIds) + resultSet.addAllElements(getCommentIds) + resultSet.addAllElements(getIdsFromFullImportedModules(project, psiFile, importDeclarations).toStream) + resultSet.addAllElements(getIdsFromHidingIdsImportedModules(project, psiFile, importDeclarations).toStream) + resultSet.addAllElements(getIdsFromSpecIdsImportedModules(project, psiFile, importDeclarations).toStream) + + val moduleName = HaskellPsiUtil.findModuleName(psiFile) + val topLevelLookupElements = moduleName.map(mn => findAllTopLevelModuleIdentifiers(project, mn). + map(mi => createTopLevelLookupElement(mi)).toStream).getOrElse(Stream()) + resultSet.addAllElements(topLevelLookupElements) + + resultSet.addAllElements(findTopLevelTypeSignatureLookupElements(psiFile).toStream) + + op match { + case Some(e) => + val localElements = if (e.getText.trim.isEmpty) + findLocalElements(e) + else + findLocalElements(e).filterNot(_.getText == e.getText) + resultSet.addAllElements(localElements.map(createLocalLookupElement)) + case _ => () + } + } + } + } + + extend(CompletionType.BASIC, PlatformPatterns.psiElement(), provider) + + override def beforeCompletion(context: CompletionInitializationContext): Unit = { + val psiFile = context.getFile + val contextElement = Option(psiFile.findElementAt(context.getStartOffset - 1)) + contextElement match { + case None => context.setDummyIdentifier("a") + case Some(ce) if ce.getNode.getElementType == HS_NEWLINE | ce.getNode.getElementType == HS_LEFT_PAREN => context.setDummyIdentifier("a") + case Some(ce) => + HaskellPsiUtil.findModIdElement(ce) match { + case Some(modid) => context.setDummyIdentifier(modid.getName) + case _ => findQualifiedNamedElementToComplete(ce) match { + case Some(qualifiedNameElement) => context.setDummyIdentifier(qualifiedNameElement.getNameWithoutParens) + case _ => ce.getText.trim match { + case t if t.nonEmpty => context.setDummyIdentifier(t) + case _ => context.setDummyIdentifier("a") + } + } + } + } + } + + // Type signatures in case they exist without accompanying implementation + private def findTopLevelTypeSignatureLookupElements(psiFile: PsiFile): Iterable[LookupElementBuilder] = { + val typeSignatures = HaskellPsiUtil.findTopLevelTypeSignatures(psiFile) + typeSignatures.flatMap(ts => ts.getIdentifierElements.map(e => createTopLevelTypeSignatureLookupElement(e.getName, ts.getText))) + } + + private def createLocalLookupElement(namedElement: HaskellNamedElement): LookupElementBuilder = { + LookupElementBuilder.create(namedElement.getName).withTypeText(StackReplsComponentsManager.findTypeInfoForElement(namedElement).map(ti => StringUtil.unescapeXml(ti.typeSignature)).getOrElse("")).withIcon(HaskellIcons.HaskellSmallBlueLogo) + } + + private def createTopLevelLookupElement(moduleIdentifier: ModuleIdentifier): LookupElementBuilder = { + LookupElementBuilder.create(moduleIdentifier.name).withTypeText(moduleIdentifier.declaration).withIcon(findIcon(moduleIdentifier)) + } + + private def createTopLevelTypeSignatureLookupElement(name: String, declaration: String): LookupElementBuilder = { + LookupElementBuilder.create(name).withTypeText(declaration).withIcon(HaskellIcons.HaskellSmallBlueLogo) + } + + private def findLocalElements(element: PsiElement) = { + Option(PsiTreeUtil.getParentOfType(element, classOf[HaskellExpression])).toStream.flatMap(e => HaskellPsiUtil.findNamedElements(e)) + } + + private def isImportSpecInProgress(element: PsiElement): Boolean = { + Option(PsiTreeUtil.findFirstParent(element, ImportSpecCondition)).isDefined + } + + private def isFileHeaderPragmaInProgress(element: PsiElement): Boolean = { + Option(PsiTreeUtil.findFirstParent(element, FileHeaderCondition)).isDefined + } + + private def isPragmaInProgress(element: PsiElement): Boolean = { + Option(TreeUtil.findSiblingBackward(element.getNode, HS_PRAGMA_START)).isDefined + } + + private def isImportModuleDeclarationInProgress(element: PsiElement): Boolean = { + Option(PsiTreeUtil.findFirstParent(element, ImportDeclarationCondition)).isDefined || + Option(TreeUtil.findSiblingBackward(element.getNode, HS_IMPORT)).isDefined || + isImportIdInProgressInsideImportModuleDeclaration(element) + } + + private def isImportIdInProgressInsideImportModuleDeclaration(element: PsiElement): Boolean = { + val prevNode = Option(TreeUtil.prevLeaf(element.getNode)) + prevNode.exists(node => Option(PsiTreeUtil.findFirstParent(node.getPsi, ImportDeclarationCondition)).isDefined) + } + + private def isNCommentInProgress(element: PsiElement): Boolean = { + element.getNode.getElementType == HS_NCOMMENT + } + + private def findAvailableIdsForImportModuleSpec(project: Project, element: PsiElement, psiFile: PsiFile) = { + (for { + moduleName <- HaskellPsiUtil.findImportDeclarationParent(element).flatMap(_.getModuleName) + } yield findImportedModuleIdentifiers(project, moduleName).map(m => createLookupElement(m, addParens = true))).getOrElse(Stream()) + } + + private def findAvailableModules(project: Project, psiFile: PsiFile) = { + val moduleNames = if (HaskellProjectUtil.isProjectTestFile(psiFile)) { + findAvailableProjectModules(project).prodModuleNames ++ findGlobalProjectInfo(project).map(_.availableInTestLibraryModuleNames).getOrElse(Iterable()) + } else { + findAvailableProjectModules(project).prodModuleNames ++ findGlobalProjectInfo(project).map(_.availableInProdLibraryModuleNames).getOrElse(Iterable()) + } + moduleNames.map(m => LookupElementBuilder.create(m).withTailText(" module", true)) + } + + private def getInsideImportClauses = { + InsideImportKeywords.map(c => LookupElementBuilder.create(c).withTailText(" clause", true)) + } + + private def getLanguageExtensions(project: Project) = { + findGlobalProjectInfo(project).map(_.languageExtensions.map(n => LookupElementBuilder.create(n).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" language extension", true))).getOrElse(Iterable()) + } + + private def getPragmaStartEndIds = { + PragmaIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" pragma", true)) + } + + private def getFileHeaderPragmaIds = { + FileHeaderPragmaIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" pragma", true)) + } + + private def getModulePragmaIds = { + ModulePragmaIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" pragma", true)) + } + + private def getCommentIds = { + CommentIds.map(p => LookupElementBuilder.create(p).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" comment", true)) + } + + private def getFullImportedModules(psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]): Iterable[ImportFull] = { + val moduleNames = for { + id <- importDeclarations + if Option(id.getImportSpec).isEmpty + mn <- id.getModuleName + } yield ImportFull(mn, Option(id.getImportQualified).isDefined, Option(id.getImportQualifiedAs).map(_.getQualifier.getName)) + + if (importDeclarations.exists(_.getModuleName == "Prelude") || isNoImplicitPreludeActive(psiFile)) { + moduleNames + } else { + Iterable(ImportFull("Prelude", qualified = false, None)) ++ moduleNames + } + } + + private def isNoImplicitPreludeActive(psiFile: PsiFile): Boolean = { + findGlobalProjectInfo(psiFile.getProject).exists(_.noImplicitPreludeActive) || + HaskellPsiUtil.findLanguageExtensions(psiFile).exists(_.getQNameList.exists(_.getName == "NoImplicitPrelude")) + } + + private def findImportIds(importIdList: util.List[HaskellImportId]): Iterable[String] = { + importIdList.flatMap(ii => ii.getCnameList.map(_.getName)) + } + + private def getImportedModulesWithHidingIdsSpec(psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]): Iterable[ImportWithHiding] = { + for { + importDeclaration <- importDeclarations.filter(i => Option(i.getImportSpec).flatMap(is => Option(is.getImportHidingSpec)).isDefined) + importIdList = importDeclaration.getImportSpec.getImportHidingSpec.getImportIdList + mn <- importDeclaration.getModuleName + } yield ImportWithHiding( + mn, + findImportIds(importIdList), + Option(importDeclaration.getImportQualified).isDefined, + Option(importDeclaration.getImportQualifiedAs).map(_.getQualifier).map(_.getName) + ) + } + + private def getImportedModulesWithSpecIds(psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]): Iterable[ImportWithIds] = { + for { + importDeclaration <- importDeclarations.filter(i => Option(i.getImportSpec).flatMap(is => Option(is.getImportIdsSpec)).isDefined) + importIdList = importDeclaration.getImportSpec.getImportIdsSpec.getImportIdList + mn <- importDeclaration.getModuleName + } yield ImportWithIds( + mn, + findImportIds(importIdList), + Option(importDeclaration.getImportQualified).isDefined, + Option(importDeclaration.getImportQualifiedAs).map(_.getQualifier).map(_.getName) + ) + } + + private def getIdsFromFullImportedModules(project: Project, psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]) = { + val importInfos = getFullImportedModules(psiFile, importDeclarations) + + val lookupElements = importInfos.map(importInfo => Future { + val moduleIdentifiers = findImportedModuleIdentifiers(project, importInfo.moduleName) + createLookupElements(importInfo, moduleIdentifiers) + }) + Await.result(Future.sequence(lookupElements), Duration.create(2, TimeUnit.SECONDS)).flatten + } + + private def getIdsFromHidingIdsImportedModules(project: Project, psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]) = { + val importInfos = getImportedModulesWithHidingIdsSpec(psiFile, importDeclarations) + + val lookupElements = importInfos.map(importInfo => Future { + val moduleIdentifiers = findImportedModuleIdentifiers(project, importInfo.moduleName) + createLookupElements(importInfo, moduleIdentifiers.filterNot(bi => importInfo.ids.contains(bi.name))) + }) + Await.result(Future.sequence(lookupElements), Duration.create(2, TimeUnit.SECONDS)).flatten + } + + private def getIdsFromSpecIdsImportedModules(project: Project, psiFile: PsiFile, importDeclarations: Iterable[HaskellImportDeclaration]) = { + val importInfos = getImportedModulesWithSpecIds(psiFile, importDeclarations) + + val lookupElements = importInfos.map(importInfo => Future { + val moduleIdentifiers = findImportedModuleIdentifiers(project, importInfo.moduleName) + createLookupElements(importInfo, moduleIdentifiers.filter(mi => importInfo.ids.exists(id => if (mi.isOperator) s"(${mi.name})" == id else id == mi.name))) + }) + Await.result(Future.sequence(lookupElements), Duration.create(2, TimeUnit.SECONDS)).flatten + } + + private def createLookupElements(importInfo: ImportInfo, moduleIdentifiers: Iterable[ModuleIdentifier]): Iterable[LookupElementBuilder] = { + moduleIdentifiers.flatMap(mi => { + (importInfo.as, importInfo.qualified) match { + case (None, false) => Iterable(createLookupElement(mi), createQualifiedLookUpElement(mi, mi.moduleName)) + case (None, true) => Iterable(createQualifiedLookUpElement(mi, mi.moduleName)) + case (Some(q), false) => Iterable(createLookupElement(mi), createQualifiedLookUpElement(mi, q)) + case (Some(q), true) => Iterable(createQualifiedLookUpElement(mi, q)) + } + }) + } + + private def getReservedNames = { + Keywords.map(r => LookupElementBuilder.create(r).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" keyword", true)) + } + + private def getSpecialReservedIds = { + SpecialReservedIds.map(sr => LookupElementBuilder.create(sr).withIcon(HaskellIcons.HaskellSmallBlueLogo).withTailText(" special keyword", true)) + } + + private def createLookupElement(moduleIdentifier: ModuleIdentifier, addParens: Boolean = false) = { + LookupElementBuilder.create( + if (moduleIdentifier.isOperator && addParens) + s"""(${moduleIdentifier.name})""" + else + moduleIdentifier.name + ).withTailText(" " + moduleIdentifier.moduleName, true). + withIcon(findIcon(moduleIdentifier)). + withTypeText(moduleIdentifier.declaration) + } + + private def createQualifiedLookUpElement(moduleIdentifier: ModuleIdentifier, qualifier: String) = { + LookupElementBuilder.create(qualifier + "." + moduleIdentifier.name). + withTailText(" " + moduleIdentifier.moduleName, true). + withIcon(findIcon(moduleIdentifier)). + withTypeText(moduleIdentifier.declaration) + } + + private def findIcon(moduleIdentifier: ModuleIdentifier) = { + import intellij.haskell.HaskellIcons._ + moduleIdentifier.declaration match { + case d if d.startsWith("class ") => Class + case d if d.startsWith("data ") => Data + case d if d.startsWith("default ") => Default + case d if d.startsWith("foreign ") => Foreign + case d if d.startsWith("instance ") => Instance + case d if d.startsWith("newtype ") => NewType + case d if d.startsWith("type family ") => TypeFamily + case d if d.startsWith("type instance ") => TypeInstance + case d if d.startsWith("type ") => Type + case d if d.startsWith("module ") => Module + case _ => HaskellSmallBlueLogo + } + } + + private sealed trait ImportInfo { + def moduleName: String + + def qualified: Boolean + + def as: Option[String] + } + + private case class ImportFull(moduleName: String, qualified: Boolean, as: Option[String]) extends ImportInfo + + private case class ImportWithHiding(moduleName: String, ids: Iterable[String], qualified: Boolean, as: Option[String]) extends ImportInfo + + private case class ImportWithIds(moduleName: String, ids: Iterable[String], qualified: Boolean, as: Option[String]) extends ImportInfo + +} diff --git a/src/main/scala/intellij/haskell/code/HaskellImportOptimizer.scala b/src/main/scala/intellij/haskell/editor/HaskellImportOptimizer.scala similarity index 64% rename from src/main/scala/intellij/haskell/code/HaskellImportOptimizer.scala rename to src/main/scala/intellij/haskell/editor/HaskellImportOptimizer.scala index 7a855ac7..23bc978c 100644 --- a/src/main/scala/intellij/haskell/code/HaskellImportOptimizer.scala +++ b/src/main/scala/intellij/haskell/editor/HaskellImportOptimizer.scala @@ -14,31 +14,31 @@ * limitations under the License. */ -package intellij.haskell.code +package intellij.haskell.editor import com.intellij.lang.ImportOptimizer import com.intellij.psi.PsiFile import com.intellij.psi.util.PsiTreeUtil import intellij.haskell.HaskellFile -import intellij.haskell.annotator.GhcModInitialInfo -import intellij.haskell.external.GhcModCheck -import intellij.haskell.util.{HaskellElementCondition, LineColumnPosition} +import intellij.haskell.external.component.StackReplsComponentsManager +import intellij.haskell.psi.HaskellElementCondition +import intellij.haskell.util.{HaskellProjectUtil, LineColumnPosition} class HaskellImportOptimizer extends ImportOptimizer { - override def supports(file: PsiFile): Boolean = file.isInstanceOf[HaskellFile] + override def supports(psiFile: PsiFile): Boolean = psiFile.isInstanceOf[HaskellFile] && HaskellProjectUtil.isProjectFile(psiFile) - override def processFile(file: PsiFile): Runnable = { + override def processFile(psiFile: PsiFile): Runnable = { new Runnable { override def run(): Unit = { - val problems = GhcModCheck.check(file.getProject, GhcModInitialInfo(file, file.getVirtualFile.getCanonicalPath)).problems + val problems = StackReplsComponentsManager.loadHaskellFile(psiFile, refreshCache = false).currentFileProblems val redundantImports = problems.filter(p => p.normalizedMessage match { case HaskellImportOptimizer.WarningRedundantImport() => true case _ => false }) - val redundantImportModuleOffsets = redundantImports.flatMap(p => LineColumnPosition.getOffset(file, LineColumnPosition(p.lineNr, p.columnNr))) - val redundantModuleDeclarations = redundantImportModuleOffsets.map(offset => file.findElementAt(offset)).map(e => PsiTreeUtil.findFirstParent(e, HaskellElementCondition.ImportDeclarationCondition)) + val redundantImportModuleOffsets = redundantImports.flatMap(p => LineColumnPosition.getOffset(psiFile, LineColumnPosition(p.lineNr, p.columnNr))) + val redundantModuleDeclarations = redundantImportModuleOffsets.map(offset => psiFile.findElementAt(offset)).map(e => PsiTreeUtil.findFirstParent(e, HaskellElementCondition.ImportDeclarationCondition)) redundantModuleDeclarations.foreach { me => me.delete() } diff --git a/src/main/scala/intellij/haskell/code/HaskellQuoteHandler.scala b/src/main/scala/intellij/haskell/editor/HaskellQuoteHandler.scala similarity index 92% rename from src/main/scala/intellij/haskell/code/HaskellQuoteHandler.scala rename to src/main/scala/intellij/haskell/editor/HaskellQuoteHandler.scala index 5041557e..3559c1c4 100644 --- a/src/main/scala/intellij/haskell/code/HaskellQuoteHandler.scala +++ b/src/main/scala/intellij/haskell/editor/HaskellQuoteHandler.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package intellij.haskell.code + +package intellij.haskell.editor import com.intellij.codeInsight.editorActions.SimpleTokenSetQuoteHandler import com.intellij.psi.TokenType diff --git a/src/main/scala/intellij/haskell/code/HaskellTypedHandler.java b/src/main/scala/intellij/haskell/editor/HaskellTypedHandler.java similarity index 99% rename from src/main/scala/intellij/haskell/code/HaskellTypedHandler.java rename to src/main/scala/intellij/haskell/editor/HaskellTypedHandler.java index 1dbc1bc1..b9845575 100644 --- a/src/main/scala/intellij/haskell/code/HaskellTypedHandler.java +++ b/src/main/scala/intellij/haskell/editor/HaskellTypedHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.code; +package intellij.haskell.editor; import com.intellij.codeInsight.CodeInsightSettings; import com.intellij.codeInsight.editorActions.TypedHandlerDelegate; diff --git a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleConfigurable.scala b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleConfigurable.scala similarity index 92% rename from src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleConfigurable.scala rename to src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleConfigurable.scala index 3e46d57e..08a84415 100644 --- a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleConfigurable.scala +++ b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleConfigurable.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.code.formatter.settings +package intellij.haskell.editor.formatter.settings import com.intellij.application.options.{CodeStyleAbstractConfigurable, CodeStyleAbstractPanel, TabbedLanguageCodeStylePanel} import com.intellij.psi.codeStyle.CodeStyleSettings @@ -34,8 +34,6 @@ class HaskellCodeStyleConfigurable(@NotNull settings: CodeStyleSettings, cloneSe class HaskellCodeStyleMainPanel(currentSettings: CodeStyleSettings, settings: CodeStyleSettings) extends TabbedLanguageCodeStylePanel(HaskellLanguage.Instance, currentSettings, settings) { protected override def initTabs(settings: CodeStyleSettings) { addIndentOptionsTab(settings) - addSpacesTab(settings) } } - } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleSettings.scala b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleSettings.scala similarity index 85% rename from src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleSettings.scala rename to src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleSettings.scala index 9c5ce226..d394996c 100644 --- a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleSettings.scala +++ b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleSettings.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,10 @@ * limitations under the License. */ -package intellij.haskell.code.formatter.settings +package intellij.haskell.editor.formatter.settings import com.intellij.psi.codeStyle.{CodeStyleSettings, CustomCodeStyleSettings} -class HaskellCodeStyleSettings(settings: CodeStyleSettings) extends CustomCodeStyleSettings("HaskellCodeStyleSettings", settings) \ No newline at end of file +class HaskellCodeStyleSettings(settings: CodeStyleSettings) extends CustomCodeStyleSettings("HaskellCodeStyleSettings", settings) { + settings.AUTODETECT_INDENTS = false +} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleSettingsProvider.scala b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleSettingsProvider.scala similarity index 93% rename from src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleSettingsProvider.scala rename to src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleSettingsProvider.scala index 6f1c07b1..afcc7700 100644 --- a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellCodeStyleSettingsProvider.scala +++ b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellCodeStyleSettingsProvider.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.code.formatter.settings +package intellij.haskell.editor.formatter.settings import com.intellij.openapi.options.Configurable import com.intellij.psi.codeStyle.{CodeStyleSettings, CodeStyleSettingsProvider, CustomCodeStyleSettings} diff --git a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellLanguageCodeStyleSettingsProvider.scala b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellLanguageCodeStyleSettingsProvider.scala similarity index 66% rename from src/main/scala/intellij/haskell/code/formatter/settings/HaskellLanguageCodeStyleSettingsProvider.scala rename to src/main/scala/intellij/haskell/editor/formatter/settings/HaskellLanguageCodeStyleSettingsProvider.scala index c5e93ef6..3d6d77c8 100644 --- a/src/main/scala/intellij/haskell/code/formatter/settings/HaskellLanguageCodeStyleSettingsProvider.scala +++ b/src/main/scala/intellij/haskell/editor/formatter/settings/HaskellLanguageCodeStyleSettingsProvider.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,12 +14,12 @@ * limitations under the License. */ -package intellij.haskell.code.formatter.settings +package intellij.haskell.editor.formatter.settings import com.intellij.application.options.SmartIndentOptionsEditor import com.intellij.lang.Language import com.intellij.psi.codeStyle.LanguageCodeStyleSettingsProvider.SettingsType -import com.intellij.psi.codeStyle.{CodeStyleSettingsCustomizable, CommonCodeStyleSettings, LanguageCodeStyleSettingsProvider} +import com.intellij.psi.codeStyle.{CommonCodeStyleSettings, LanguageCodeStyleSettingsProvider} import intellij.haskell.HaskellLanguage import org.jetbrains.annotations.NotNull @@ -32,7 +32,7 @@ class HaskellLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSettings override def getDefaultCommonSettings: CommonCodeStyleSettings = { val defaultSettings: CommonCodeStyleSettings = new CommonCodeStyleSettings(getLanguage) - defaultSettings.KEEP_BLANK_LINES_IN_CODE = 1 + defaultSettings.KEEP_BLANK_LINES_IN_CODE = 1 val indentOptions: CommonCodeStyleSettings.IndentOptions = defaultSettings.initIndentOptions indentOptions.INDENT_SIZE = 2 indentOptions.CONTINUATION_INDENT_SIZE = 4 @@ -40,25 +40,9 @@ class HaskellLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSettings defaultSettings } - override def customizeSettings(@NotNull consumer: CodeStyleSettingsCustomizable, @NotNull settingsType: LanguageCodeStyleSettingsProvider.SettingsType) { - if (settingsType == SettingsType.SPACING_SETTINGS) { - consumer.showStandardOptions("SPACE_AFTER_COMMA", "SPACE_BEFORE_COMMA") - } - } - override def getIndentOptionsEditor: SmartIndentOptionsEditor = { new SmartIndentOptionsEditor } - private final val SpacingCodeSample = - """l = [1,2,3] - |g = (1,2,3)""".stripMargin - - override def getCodeSample(settingsType: SettingsType): String = { - if (settingsType == SettingsType.SPACING_SETTINGS) { - SpacingCodeSample - } else { - "" - } - } + override def getCodeSample(settingsType: SettingsType): String = "" } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/external/ExternalProcess.scala b/src/main/scala/intellij/haskell/external/CommandLine.scala similarity index 93% rename from src/main/scala/intellij/haskell/external/ExternalProcess.scala rename to src/main/scala/intellij/haskell/external/CommandLine.scala index 3e22520f..493608b8 100644 --- a/src/main/scala/intellij/haskell/external/ExternalProcess.scala +++ b/src/main/scala/intellij/haskell/external/CommandLine.scala @@ -24,14 +24,14 @@ import com.intellij.execution.process.{CapturingProcessHandler, ProcessOutput} import scala.collection.JavaConversions._ -object ExternalProcess { - val StandardTimeout = 3000 +object CommandLine { + val StandardTimeout = 1000 def getProcessOutput(workDir: String, commandPath: String, arguments: Seq[String], timeout: Int = StandardTimeout): ProcessOutput = { if (!new File(workDir).isDirectory || !new File(commandPath).canExecute) { new ProcessOutput } - val cmd: GeneralCommandLine = new GeneralCommandLine + val cmd = new GeneralCommandLine cmd.withWorkDirectory(workDir) cmd.setExePath(commandPath) cmd.addParameters(arguments) diff --git a/src/main/scala/intellij/haskell/external/GhcModBrowseInfo.scala b/src/main/scala/intellij/haskell/external/GhcModBrowseInfo.scala deleted file mode 100644 index 7dc9d47e..00000000 --- a/src/main/scala/intellij/haskell/external/GhcModBrowseInfo.scala +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import java.util.concurrent.{Callable, Executors, TimeUnit} - -import com.google.common.cache.{CacheBuilder, CacheLoader} -import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} -import com.intellij.openapi.progress.ProcessCanceledException -import com.intellij.openapi.project.Project - -object GhcModBrowseInfo { - - private case class ModuleInfo(project: Project, moduleName: String) - - private val executor = Executors.newCachedThreadPool() - - private final val BrowseInfoCache = CacheBuilder.newBuilder() - .refreshAfterWrite(10, TimeUnit.SECONDS) - .build( - new CacheLoader[ModuleInfo, GhcModOutput]() { - private def getProcessOutput(moduleInfo: ModuleInfo): GhcModOutput = { - GhcModProcessManager.getGhcModInfoProcess(moduleInfo.project).execute("browse -d -q -o " + moduleInfo.moduleName) - } - - override def load(moduleInfo: ModuleInfo): GhcModOutput = { - getProcessOutput(moduleInfo) - } - - override def reload(moduleInfo: ModuleInfo, oldValue: GhcModOutput): ListenableFuture[GhcModOutput] = { - val task = ListenableFutureTask.create(new Callable[GhcModOutput]() { - def call() = { - val newValue = getProcessOutput(moduleInfo) - if (newValue.outputLines.isEmpty) { - oldValue - } else { - newValue - } - } - }) - executor.execute(task) - task - } - } - ) - - def browseInfo(project: Project, moduleName: String, removeParensFromOperator: Boolean): Iterable[BrowseInfo] = { - val processOutput = try { - BrowseInfoCache.get(ModuleInfo(project, moduleName)) - } - catch { - case _: UncheckedExecutionException => GhcModOutput() - case _: ProcessCanceledException => GhcModOutput() - } - processOutput.outputLines.flatMap(createBrowseInfo(_, removeParensFromOperator)) - } - - private def createBrowseInfo(info: String, removeParensFromOperator: Boolean): Option[BrowseInfo] = { - info.split("::", 2) match { - case Array(qn, d) => - val (m, n) = getModuleAndName(qn, removeParensFromOperator) - Some(BrowseInfo(n, m, Some(d))) - case Array(qn) => - val (m, n) = getModuleAndName(qn, removeParensFromOperator) - Some(BrowseInfo(n, m, None)) - case _ => None - } - } - - private def getModuleAndName(qualifiedName: String, removeParensFromOperator: Boolean): (String, String) = { - val indexOfOperator = qualifiedName.lastIndexOf(".(") + 1 - if (indexOfOperator > 1) { - val (m, o) = trimPair(qualifiedName.splitAt(indexOfOperator)) - (m.substring(0, m.length - 1), if (removeParensFromOperator) o.substring(1, o.length - 1) else o) - } else { - val indexOfId = qualifiedName.lastIndexOf('.') + 1 - val (m, id) = trimPair(qualifiedName.splitAt(indexOfId)) - (m.substring(0, m.length - 1), id) - } - } - - private def trimPair(t: (String, String)) = { - t match { - case (t0, t1) => (t0.trim, t1.trim) - } - } -} - -case class BrowseInfo(name: String, moduleName: String, declaration: Option[String]) diff --git a/src/main/scala/intellij/haskell/external/GhcModCheck.scala b/src/main/scala/intellij/haskell/external/GhcModCheck.scala deleted file mode 100644 index 36267d3f..00000000 --- a/src/main/scala/intellij/haskell/external/GhcModCheck.scala +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import com.intellij.openapi.project.Project -import intellij.haskell.HaskellNotificationGroup -import intellij.haskell.annotator.GhcModInitialInfo -import intellij.haskell.settings.HaskellSettingsState -import intellij.haskell.util.{FileUtil, OSUtil} - -import scala.collection.JavaConversions._ - -object GhcModCheck { - - private final val GhcModProblemPattern = """(.+):([\d]+):([\d]+):(.+)""".r - - def check(project: Project, ghcModInitialInfo: GhcModInitialInfo): GhcModCheckResult = { - if (FileUtil.isLibraryFile(ghcModInitialInfo.psiFile)) { - return GhcModCheckResult() - } - - val ghcModPath = HaskellSettingsState.getGhcModPath - val output = ghcModPath.map { p => - ExternalProcess.getProcessOutput( - project.getBasePath, - p, - Seq("check", ghcModInitialInfo.filePath) - ) - }.map(_.getStdoutLines.toIterable).getOrElse(Iterable()) - - new GhcModCheckResult(output.flatMap(l => parseOutputLine(l, project))) - } - - private[external] def parseOutputLine(ghcModOutput: String, project: Project): Option[GhcModProblem] = { - ghcModOutput match { - case GhcModProblemPattern(filePath, lineNr, columnNr, message) => Some(new GhcModProblem(FileUtil.makeFilePathAbsolute(filePath, project), lineNr.toInt, columnNr.toInt, message.replace('\u0000', OSUtil.LineSeparator))) - case _ => HaskellNotificationGroup.notifyError(ghcModOutput); None - } - } -} - -case class GhcModCheckResult(problems: Iterable[GhcModProblem] = Iterable()) - -case class GhcModProblem(filePath: String, lineNr: Int, columnNr: Int, private val message: String) { - - def normalizedMessage: String = { - message.trim.replace(OSUtil.LineSeparator, ' ').replaceAll("\\s+", " ") - } - - def htmlMessage: String = { - message.replace("\n", "
    ").replace(" ", " ") - } -} diff --git a/src/main/scala/intellij/haskell/external/GhcModInfo.scala b/src/main/scala/intellij/haskell/external/GhcModInfo.scala deleted file mode 100644 index f749517c..00000000 --- a/src/main/scala/intellij/haskell/external/GhcModInfo.scala +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import java.util.concurrent.{Callable, Executors, TimeUnit} - -import com.google.common.cache.{CacheBuilder, CacheLoader} -import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} -import com.intellij.openapi.progress.ProcessCanceledException -import com.intellij.openapi.project.Project -import com.intellij.psi.PsiFile -import com.intellij.psi.util.PsiTreeUtil -import intellij.haskell.psi._ -import intellij.haskell.psi.impl.HaskellPsiImplUtil -import intellij.haskell.util.HaskellEditorUtil.escapeString -import intellij.haskell.util.{FileUtil, HaskellElementCondition, HaskellFindUtil} - -import scala.collection.mutable.ListBuffer - -object GhcModInfo { - - private final val GhcModInfoPattern = """(.+)-- Defined at (.+):([\d]+):([\d]+)""".r - private final val GhcModInfoLibraryPathPattern = """(.+)-- Defined in ‘([\w\.\-]+):([\w\.\-]+)’""".r - private final val GhcModInfoLibraryPattern = """(.+)-- Defined in ‘([\w\.\-]+)’""".r - - private final val NoInfoIndicator = "Cannot show info" - - private final val Executor = Executors.newCachedThreadPool() - - private case class NamedElementInfo(filePath: String, identifier: String, project: Project) - - private final val InfoCache = CacheBuilder.newBuilder() - .refreshAfterWrite(3, TimeUnit.SECONDS) - .build( - new CacheLoader[NamedElementInfo, GhcModOutput]() { - private def findInfoFor(namedElementInfo: NamedElementInfo): GhcModOutput = { - val cmd = s"info ${namedElementInfo.filePath} ${namedElementInfo.identifier}" - GhcModProcessManager.getGhcModInfoProcess(namedElementInfo.project).execute(cmd) - } - - override def load(namedElementInfo: NamedElementInfo): GhcModOutput = { - findInfoFor(namedElementInfo) - } - - override def reload(namedElementInfo: NamedElementInfo, oldInfo: GhcModOutput): ListenableFuture[GhcModOutput] = { - val task = ListenableFutureTask.create(new Callable[GhcModOutput]() { - def call() = { - val newInfo = findInfoFor(namedElementInfo) - if (newInfo.outputLines.isEmpty || newInfo.outputLines.head == NoInfoIndicator) { - oldInfo - } else { - newInfo - } - } - }) - Executor.execute(task) - task - } - } - ) - - def findInfoFor(psiFile: PsiFile, namedElement: HaskellNamedElement): Iterable[IdentifierInfo] = { - val ghcModOutput = findIdentifier(namedElement).map { id => - try { - val key = NamedElementInfo(FileUtil.getFilePath(psiFile), id, psiFile.getProject) - val output = InfoCache.get(key) - if (output.outputLines.isEmpty || output.outputLines.head == NoInfoIndicator) { - InfoCache.refresh(key) - InfoCache.get(key) - } else { - output - } - } - catch { - case _: UncheckedExecutionException => GhcModOutput() - case _: ProcessCanceledException => GhcModOutput() - } - } - - (for { - output <- ghcModOutput - outputLine <- output.outputLines.headOption - identifierInfos <- createIdentifierInfos(outputLine, psiFile.getProject) - } yield identifierInfos).getOrElse(Iterable()) - } - - private def createIdentifierInfos(outputLine: String, project: Project): Option[Iterable[IdentifierInfo]] = { - if (outputLine == NoInfoIndicator) { - None - } else { - val outputLines = outputLine.split("\u0000") - val outputInfos = createInfoPerDefinition(outputLines) - Some(outputInfos.map(sb => createIdentifierInfo(sb.toString, project))) - } - } - - private def createInfoPerDefinition(outputLines: Array[String]): ListBuffer[StringBuilder] = { - outputLines.foldLeft(ListBuffer[StringBuilder]())((lb, sb) => - if (sb.startsWith(" ")) { - lb.last.append(sb) - lb - } - else { - lb += new StringBuilder(2, sb) - }) - } - - private def createIdentifierInfo(outputInfo: String, project: Project): IdentifierInfo = { - outputInfo match { - case GhcModInfoPattern(typeSignature, filePath, lineNr, colNr) => ProjectIdentifierInfo(escapeString(typeSignature), Some(filePath), lineNr.toInt, colNr.toInt) - case GhcModInfoLibraryPathPattern(typeSignature, libraryName, module) => - if (libraryName == "ghc-prim" || libraryName == "integer-gmp") { - BuiltInIdentifierInfo(escapeString(typeSignature), libraryName, "GHC.Base") - } - else { - createLibraryIdentifierInfo(module, escapeString(typeSignature), project) - } - case GhcModInfoLibraryPattern(typeSignature, module) => - createLibraryIdentifierInfo(module, escapeString(typeSignature), project) - case d => NoLocationIdentifierInfo(d) - } - } - - private def findIdentifier(namedElement: HaskellNamedElement): Option[String] = { - val qVarConOp = Option(PsiTreeUtil.findFirstParent(namedElement, HaskellElementCondition.QVarConOpElementCondition)).map(_.asInstanceOf[HaskellQVarConOpElement]) - // Workaround for https://github.com/DanielG/ghc-mod/issues/432 - qVarConOp.map { qvco => - qvco.getQualifier match { - case Some(q) => - val importedQualifiedModules = getImportedQualifiedModules(namedElement.getContainingFile) - val projectModuleNames = HaskellFindUtil.findProjectModules(namedElement.getProject).map(_.getModuleName) - if (importedQualifiedModules.find(qi => qi.qualifier == q).map(_.moduleName).exists(m => projectModuleNames.exists(_ == m))) { - qvco.getIdentifierElement.getName - } else { - qvco.getName - } - case None => qvco.getIdentifierElement.getName - } - } - } - - private case class QualifiedImport(qualifier: String, moduleName: String) - - private def getImportedQualifiedModules(psiFile: PsiFile): Iterable[QualifiedImport] = { - val importDeclarations = HaskellPsiHelper.findImportDeclarations(psiFile) - importDeclarations.flatMap(i => Option(i.getImportQualifiedAs).flatMap(qa => Option(qa.getQualifier).map(q => QualifiedImport(q.getName, i.getModuleName)))) - } - - private def createLibraryIdentifierInfo(module: String, typeSignature: String, project: Project) = { - LibraryIdentifierInfo(typeSignature, FileUtil.findModuleFilePath(module, project), module) - } -} - -sealed trait IdentifierInfo { - def declaration: String -} - -trait FileInfo { - def filePath: Option[String] -} - -case class ProjectIdentifierInfo(declaration: String, filePath: Option[String], lineNr: Int, colNr: Int) extends IdentifierInfo with FileInfo - -case class LibraryIdentifierInfo(declaration: String, filePath: Option[String], module: String) extends IdentifierInfo with FileInfo - -case class BuiltInIdentifierInfo(declaration: String, libraryName: String, module: String) extends IdentifierInfo - -case class NoLocationIdentifierInfo(declaration: String) extends IdentifierInfo diff --git a/src/main/scala/intellij/haskell/external/GhcModModulesInfo.scala b/src/main/scala/intellij/haskell/external/GhcModModulesInfo.scala deleted file mode 100644 index bc179dbe..00000000 --- a/src/main/scala/intellij/haskell/external/GhcModModulesInfo.scala +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import java.util.concurrent.{Callable, Executors, TimeUnit} - -import com.google.common.cache.{CacheBuilder, CacheLoader} -import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} -import com.intellij.openapi.progress.ProcessCanceledException -import com.intellij.openapi.project.Project - -object GhcModModulesInfo { - - private case class ModuleList(project: Project) - - private val executor = Executors.newCachedThreadPool() - - private final val ModuleListCache = CacheBuilder.newBuilder() - .refreshAfterWrite(60, TimeUnit.SECONDS) - .build( - new CacheLoader[ModuleList, GhcModOutput]() { - private def getProcessOutput(moduleList: ModuleList): GhcModOutput = { - GhcModProcessManager.getGhcModInfoProcess(moduleList.project).execute("list") - } - - override def load(moduleList: ModuleList): GhcModOutput = { - getProcessOutput(moduleList) - } - - override def reload(moduleList: ModuleList, oldValue: GhcModOutput): ListenableFuture[GhcModOutput] = { - val task = ListenableFutureTask.create(new Callable[GhcModOutput]() { - def call() = { - val newValue = getProcessOutput(moduleList) - if (newValue.outputLines.isEmpty) { - oldValue - } else { - newValue - } - } - }) - executor.execute(task) - task - } - } - ) - - def listAvailableModules(project: Project): Iterable[String] = { - val processOutput = try { - ModuleListCache.get(ModuleList(project)) - } - catch { - case _: UncheckedExecutionException => GhcModOutput() - case _: ProcessCanceledException => GhcModOutput() - } - processOutput.outputLines - } -} diff --git a/src/main/scala/intellij/haskell/external/GhcModProcess.scala b/src/main/scala/intellij/haskell/external/GhcModProcess.scala deleted file mode 100644 index 6cc5daa5..00000000 --- a/src/main/scala/intellij/haskell/external/GhcModProcess.scala +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import java.io._ -import java.util.concurrent.Executors - -import com.intellij.openapi.components.ProjectComponent -import com.intellij.openapi.project.Project -import com.intellij.util.EnvironmentUtil -import intellij.haskell.HaskellNotificationGroup -import intellij.haskell.settings.HaskellSettingsState -import intellij.haskell.util._ - -import scala.collection.JavaConversions._ -import scala.collection.mutable.ListBuffer -import scala.concurrent.duration._ -import scala.concurrent.{Await, ExecutionContext, Future} -import scala.io._ -import scala.sys.process._ - -abstract class GhcModProcess(val project: Project) extends ProjectComponent { - - private final val ExecutorService = Executors.newSingleThreadExecutor - implicit private final val ExecContext = ExecutionContext.fromExecutorService(ExecutorService) - - private final val LineSeparatorInBytes = OSUtil.LineSeparator - - private[this] var outputStream: OutputStream = _ - private[this] val stdOutListBuffer = ListBuffer[String]() - private[this] val stdErrListBuffer = ListBuffer[String]() - - private final val OK = "OK" - - private final val TimeOut = 5000L - private final val GhcModErrorIndicator = "NG" - private var ghcModProblemTime: Option[Long] = None - - def execute(command: String): GhcModOutput = synchronized { - if (ghcModProblemTime.exists(problemTime => System.currentTimeMillis - problemTime < TimeOut)) { - return GhcModOutput() - } - - if (outputStream == null) { - start() - } - - if (outputStream != null) { - try { - writeToOutputStream(command) - - val waitForStdOutput = Future { - while (!stdOutListBuffer.lastOption.contains(OK) && !stdOutListBuffer.headOption.exists(_.startsWith(GhcModErrorIndicator))) { - // wait for result - Thread.sleep(5) - } - stdOutListBuffer - } - val stdOutput = Await.result(waitForStdOutput, 5.second) - - if (stdOutput.headOption.exists(_.startsWith(GhcModErrorIndicator))) { - HaskellNotificationGroup.notifyError(s"ghc-mod error output: ${stdOutput.mkString(" ")}") - GhcModOutput() - } else { - GhcModOutput(stdOutput.init) - } - } - catch { - case e: Exception => - HaskellNotificationGroup.notifyError(s"Error in communication with ghc-mod: ${e.getMessage}. Check if GHC SDK is set and ghc-mod is okay. ghc-mod will not be called for 5 seconds. Command was: $command") - setGhcModProblemTime() - GhcModOutput() - } - } else { - GhcModOutput() - } - } - - def start(): Unit = synchronized { - HaskellSettingsState.getGhcModPath match { - case Some(p) => - try { - val command = p + " legacy-interactive" - val process = getEnvParameters match { - case None => Process(command, new File(project.getBasePath)) - case Some(ep) => Process(command, new File(project.getBasePath), ep.toArray: _*) - } - process.run( - new ProcessIO( - stdin => outputStream = stdin, - stdout => Source.fromInputStream(stdout).getLines.foreach(stdOutListBuffer.+=), - stderr => Source.fromInputStream(stderr).getLines.foreach(stdErrListBuffer.+=) - )) - } - catch { - case e: Exception => - HaskellNotificationGroup.notifyError("Could not start ghc-mod in interactive mode. Make sure you have set right path to ghc-mod in settings.") - setGhcModProblemTime() - } - case None => { - HaskellNotificationGroup.notifyError(s"ghc-mod could not be started in interactive mode for project ${project.getName} because ghc-mod path is not set") - } - } - } - - def exit() = synchronized { - try { - try { - if (outputStream != null) { - writeToOutputStream("quit") - } - } - catch { - case e: Exception => - HaskellNotificationGroup.notifyError(s"Error while shutting down ghc-mod for project ${project.getName}. Error message: ${e.getMessage}") - } - if (stdin != null) { - stdin.close() - } - if (stdout != null) { - stdout.close() - } - if (stderr != null) { - stderr.close() - } - } finally { - outputStream = null - } - } - - private def writeToOutputStream(command: String) = { - stdOutListBuffer.clear() - outputStream.write(command.getBytes) - outputStream.write(LineSeparatorInBytes) - outputStream.flush() - } - - private def setGhcModProblemTime() = { - ghcModProblemTime = Some(System.currentTimeMillis) - } - - private def getEnvParameters: Option[java.util.Map[String, String]] = { - if (OSUtil.isOSX) { - Option(EnvironmentUtil.getEnvironmentMap) - } else { - None - } - } - - override def projectOpened(): Unit = { - if (HaskellProjectUtil.isHaskellProject(project)) { - start() - } - } - - override def projectClosed(): Unit = exit() - - override def initComponent(): Unit = {} - - override def disposeComponent(): Unit = {} -} - -case class GhcModOutput(outputLines: Iterable[String] = Iterable()) diff --git a/src/main/scala/intellij/haskell/external/GhcModProcessManager.scala b/src/main/scala/intellij/haskell/external/GhcModProcessManager.scala deleted file mode 100644 index 1ab8b28e..00000000 --- a/src/main/scala/intellij/haskell/external/GhcModProcessManager.scala +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import com.intellij.openapi.project.Project - -object GhcModProcessManager { - - private var restartState = false - - def setInRestartState() { - synchronized { - restartState = true - } - } - - def doRestart(project: Project) { - synchronized { - val ghcModProcesses = Seq(getGhcModCheckComponent(project), getGhcModCheckComponent(project)) - ghcModProcesses.foreach { p => - p.exit() - p.start() - } - } - } - - def getGhcModCheckProcess(project: Project) = { - synchronized { - if (restartState) { - doRestart(project) - restartState = false - } - getGhcModCheckComponent(project) - } - } - - def getGhcModInfoProcess(project: Project) = { - synchronized { - if (restartState) { - doRestart(project) - restartState = false - } - getGhcModInfoComponent(project) - } - } - - private def getGhcModCheckComponent(project: Project) = { - project.getComponent(classOf[GhcModCheckProcess]) - } - - private def getGhcModInfoComponent(project: Project) = { - project.getComponent(classOf[GhcModInfoProcess]) - } -} diff --git a/src/main/scala/intellij/haskell/external/GhcModTypeInfo.scala b/src/main/scala/intellij/haskell/external/GhcModTypeInfo.scala deleted file mode 100644 index 666ac818..00000000 --- a/src/main/scala/intellij/haskell/external/GhcModTypeInfo.scala +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import java.util.concurrent.{Callable, Executors, TimeUnit} - -import com.google.common.cache.{CacheBuilder, CacheLoader} -import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} -import com.intellij.openapi.editor.SelectionModel -import com.intellij.openapi.progress.ProcessCanceledException -import com.intellij.openapi.project.Project -import com.intellij.psi.util.PsiTreeUtil -import com.intellij.psi.{PsiElement, PsiFile} -import intellij.haskell.HaskellNotificationGroup -import intellij.haskell.psi._ -import intellij.haskell.util.{FileUtil, HaskellElementCondition, LineColumnPosition} -import intellij.haskell.util.HaskellEditorUtil.escapeString - -import scala.util.{Failure, Success, Try} - -object GhcModTypeInfo { - private final val GhcModTypeInfoPattern = """([\d]+) ([\d]+) ([\d]+) ([\d]+) "(.+)"""".r - - private final val Executor = Executors.newCachedThreadPool() - - private case class ElementTypeInfo(filePath: String, lineNr: Int, columnNr: Int, project: Project) - - private final val TypeInfoCache = CacheBuilder.newBuilder() - .refreshAfterWrite(3, TimeUnit.SECONDS) - .build( - new CacheLoader[ElementTypeInfo, GhcModOutput]() { - private def findTypeInfoFor(elementTypeInfo: ElementTypeInfo): GhcModOutput = { - val cmd = s"type ${elementTypeInfo.filePath} ${elementTypeInfo.lineNr} ${elementTypeInfo.columnNr}" - GhcModProcessManager.getGhcModInfoProcess(elementTypeInfo.project).execute(cmd) - } - - override def load(elementTypeInfo: ElementTypeInfo): GhcModOutput = { - findTypeInfoFor(elementTypeInfo) - } - - override def reload(elementTypeInfo: ElementTypeInfo, oldInfo: GhcModOutput): ListenableFuture[GhcModOutput] = { - val task = ListenableFutureTask.create(new Callable[GhcModOutput]() { - def call() = { - val newInfo = findTypeInfoFor(elementTypeInfo) - if (newInfo.outputLines.isEmpty) { - oldInfo - } else { - newInfo - } - } - }) - Executor.execute(task) - task - } - } - ) - - def findTypeInfoFor(psiFile: PsiFile, psiElement: PsiElement): Option[TypeInfo] = { - val textOffset = psiElement match { - case e: HaskellQVarConOpElement => e.getTextOffset - case e => Option(PsiTreeUtil.findFirstParent(e, HaskellElementCondition.QVarConOpElementCondition)).map(_.getTextOffset).getOrElse(e.getTextOffset) - } - - for { - spe <- LineColumnPosition.fromOffset(psiFile, textOffset) - typeInfos <- findGhcModTypeInfos(psiFile, spe) - typeInfo <- typeInfos.find(ty => ty.startLine == spe.lineNr && ty.startColumn == spe.columnNr) - } yield typeInfo - } - - def findTypeInfoForSelection(psiFile: PsiFile, selectionModel: SelectionModel): Option[TypeInfo] = { - for { - ss <- LineColumnPosition.fromOffset(psiFile, selectionModel.getSelectionStart) - se <- LineColumnPosition.fromOffset(psiFile, selectionModel.getSelectionEnd) - typeInfos <- findGhcModTypeInfos(psiFile, ss) - typeInfo <- typeInfos.find(ty => ty.startLine == ss.lineNr && ty.startColumn == ss.columnNr && ty.endLine == se.lineNr && ty.endColumn == se.columnNr) - } yield typeInfo - } - - private def findGhcModTypeInfos(psiFile: PsiFile, startPositionExpression: LineColumnPosition): Option[Iterable[TypeInfo]] = { - val filePath = FileUtil.getFilePath(psiFile) - val ghcModiOutput = try { - val key = ElementTypeInfo(filePath, startPositionExpression.lineNr, startPositionExpression.columnNr, psiFile.getProject) - val output = TypeInfoCache.get(key) - if (output.outputLines.isEmpty) { - TypeInfoCache.refresh(key) - TypeInfoCache.get(key) - } else { - output - } - } - catch { - case _: UncheckedExecutionException => GhcModOutput() - case _: ProcessCanceledException => GhcModOutput() - } - ghcModOutputToTypeInfo(ghcModiOutput.outputLines) match { - case Success(typeInfos) => Some(typeInfos) - case Failure(error) => HaskellNotificationGroup.notifyError(s"Could not determine type. Error: $error.getMessage"); None - } - } - - private[external] def ghcModOutputToTypeInfo(ghcModiOutput: Iterable[String]): Try[Iterable[TypeInfo]] = Try { - for (outputLine <- ghcModiOutput) yield { - outputLine match { - case GhcModTypeInfoPattern(startLn, startCol, endLine, endCol, typeSignature) => - TypeInfo(startLn.toInt, startCol.toInt, endLine.toInt, endCol.toInt, shortenTypeSignature(typeSignature)) - } - } - } - - private def shortenTypeSignature(typeSignature: String) = { - if (typeSignature.length > 80) { - escapeString(typeSignature).split("->").mkString("->\n") - } else { - escapeString(typeSignature) - } - } -} - -case class TypeInfo(startLine: Int, startColumn: Int, endLine: Int, endColumn: Int, typeSignature: String) diff --git a/src/main/scala/intellij/haskell/external/Hlint.scala b/src/main/scala/intellij/haskell/external/HLintComponent.scala similarity index 61% rename from src/main/scala/intellij/haskell/external/Hlint.scala rename to src/main/scala/intellij/haskell/external/HLintComponent.scala index 1be909cd..f2293e74 100644 --- a/src/main/scala/intellij/haskell/external/Hlint.scala +++ b/src/main/scala/intellij/haskell/external/HLintComponent.scala @@ -17,39 +17,47 @@ package intellij.haskell.external import com.intellij.psi.PsiFile +import intellij.haskell.HaskellNotificationGroup import intellij.haskell.settings.HaskellSettingsState +import spray.json.JsonParser.ParsingException import spray.json.{DefaultJsonProtocol, _} -object Hlint { +object HLintComponent { - def check(psiFile: PsiFile): Seq[HlintInfo] = { - val hlintPath = HaskellSettingsState.getHlintPath + def check(psiFile: PsiFile): Seq[HLintInfo] = { + val hlintPath = HaskellSettingsState.getHLintPath hlintPath match { case Some(p) => - val output = ExternalProcess.getProcessOutput( + val output = CommandLine.getProcessOutput( psiFile.getProject.getBasePath, p, Seq("--json", psiFile.getVirtualFile.getPath) ) - deserializeHlintInfo(output.getStdout) + deserializeHLintInfo(output.getStdout) case None => Seq() } } object HlintJsonProtocol extends DefaultJsonProtocol { - implicit val hlintInfoFormat = jsonFormat12(HlintInfo) + implicit val hlintInfoFormat = jsonFormat12(HLintInfo) } - import intellij.haskell.external.Hlint.HlintJsonProtocol._ + import intellij.haskell.external.HLintComponent.HlintJsonProtocol._ - private[external] def deserializeHlintInfo(hlintInfo: String) = { + private[external] def deserializeHLintInfo(hlintInfo: String) = { if (hlintInfo.trim.isEmpty || hlintInfo == "[]") { Seq() } else { - hlintInfo.parseJson.convertTo[Seq[HlintInfo]] + try { + hlintInfo.parseJson.convertTo[Seq[HLintInfo]] + } catch { + case e: ParsingException => + HaskellNotificationGroup.logInfo(s"Error ${e.getMessage} while parsing $hlintInfo") + Seq() + } } } } -case class HlintInfo(module: Option[String], decl: Option[String], severity: String, hint: String, file: String, startLine: Int, startColumn: Int, endLine: Int, endColumn: Int, from: String = "", to: Option[String], note: Seq[String]) +case class HLintInfo(module: Option[String], decl: Option[String], severity: String, hint: String, file: String, startLine: Int, startColumn: Int, endLine: Int, endColumn: Int, from: String = "", to: Option[String], note: Seq[String]) diff --git a/src/main/scala/intellij/haskell/external/HaskellDocumentationProvider.scala b/src/main/scala/intellij/haskell/external/HaskellDocumentationProvider.scala new file mode 100644 index 00000000..bde12b47 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/HaskellDocumentationProvider.scala @@ -0,0 +1,75 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external + +import java.util.regex.Pattern + +import com.intellij.lang.documentation.AbstractDocumentationProvider +import com.intellij.openapi.project.Project +import com.intellij.psi.util.PsiTreeUtil +import com.intellij.psi.{PsiElement, PsiFile} +import intellij.haskell.HaskellNotificationGroup +import intellij.haskell.external.component._ +import intellij.haskell.psi.{HaskellModuleDeclaration, HaskellNamedElement} +import intellij.haskell.sdk.HaskellSdkType +import intellij.haskell.settings.HaskellSettingsState + +import scala.collection.JavaConversions._ + +class HaskellDocumentationProvider extends AbstractDocumentationProvider { + + override def generateDoc(psiElement: PsiElement, originalPsiElement: PsiElement): String = { + originalPsiElement.getParent match { + case hne: HaskellNamedElement => getHaskellDoc(hne).getOrElse("No documentation found") + case e => s"No documentation because this is not Haskell identifier: ${e.getText}" + } + } + + private def getHaskellDoc(namedElement: HaskellNamedElement): Option[String] = { + HaskellSettingsState.getHaskellDocsPath.flatMap { hd => + val identifier = namedElement.getName + val file = namedElement.getContainingFile + val project = file.getProject + val identifierInfo = StackReplsComponentsManager.findNameInfo(namedElement).headOption + val arguments = identifierInfo.map { ii => + (ii, getModuleName(file), getPackageDbOption(project)) match { + case (lei: LibraryNameInfo, _, Some(dbPathOption)) => Seq("-g", dbPathOption, lei.moduleName, identifier) + case (pei: ProjectNameInfo, _, Some(dbPathOption)) => Seq("-g", dbPathOption, PsiTreeUtil.findChildOfType(file, classOf[HaskellModuleDeclaration]).getModuleName.get, identifier) + case (bei: BuiltInNameInfo, _, _) => Seq("Prelude", identifier) + case (_, Some(moduleName), Some(dbPathOption)) => Seq("-g", dbPathOption, moduleName, identifier) + case (_, _, _) => Seq() + } + } + + arguments.map(args => CommandLine.getProcessOutput(project.getBasePath, hd, args).getStdout).filterNot(_.trim.isEmpty).map(output => + "

    " + s"${Pattern.compile("$", Pattern.MULTILINE).matcher(output).replaceAll("
    ").replace(" ", " ")}" + "

    " + ) + } + } + + private def getModuleName(psiFile: PsiFile) = { + Option(PsiTreeUtil.findChildOfType(psiFile, classOf[HaskellModuleDeclaration])).flatMap(_.getModuleName) + } + + private def getPackageDbOption(project: Project) = { + val path = HaskellSdkType.getStackPath(project).flatMap(sp => CommandLine.getProcessOutput(project.getBasePath, sp, Seq("path", "--local-pkg-db")).getStdoutLines.headOption) + if (path.isEmpty) { + HaskellNotificationGroup.logWarning("Could not determine locale package db with `stack path --local-pkg-db`") + } + path + } +} diff --git a/src/main/scala/intellij/haskell/external/component/BrowseModuleComponent.scala b/src/main/scala/intellij/haskell/external/component/BrowseModuleComponent.scala new file mode 100644 index 00000000..6c6620c8 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/BrowseModuleComponent.scala @@ -0,0 +1,147 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import java.util.concurrent.{Callable, Executors} + +import com.google.common.cache.{CacheBuilder, CacheLoader} +import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} +import com.intellij.openapi.progress.ProcessCanceledException +import com.intellij.openapi.project.Project +import intellij.haskell.external.repl.StackReplsManager + +import scala.collection.JavaConversions._ + +private[component] object BrowseModuleComponent { + + private final val PackageNameQualifierPattern = """([a-z\-]+[0-9\.]+:)?([A-Z][A-Za-z\-\']+\.)+""" + + private case class Key(project: Project, moduleName: String, allTopLevel: Boolean) + + private val executor = Executors.newCachedThreadPool() + + private final val Cache = CacheBuilder.newBuilder() + .build( + new CacheLoader[Key, Iterable[ModuleIdentifier]]() { + + override def load(key: Key): Iterable[ModuleIdentifier] = { + findModuleIdentifiers(key) + } + + override def reload(key: Key, oldValue: Iterable[ModuleIdentifier]): ListenableFuture[Iterable[ModuleIdentifier]] = { + val task = ListenableFutureTask.create(new Callable[Iterable[ModuleIdentifier]]() { + def call() = { + findModuleIdentifiers(key) + } + }) + executor.execute(task) + task + } + + private def findModuleIdentifiers(key: Key): Iterable[ModuleIdentifier] = { + val project = key.project + val moduleName = key.moduleName + if (ProjectModulesComponent.findAvailableModules(project).allModuleNames.contains(moduleName)) { + if (key.allTopLevel) { + val outputLines = StackReplsManager.getProjectRepl(project).getAllTopLevelModuleIdentifiers(moduleName).stdOutLines + val definedLocallyLines = outputLines.takeWhile(l => !l.startsWith("-- imported via")) + definedLocallyLines.flatMap(findModuleIdentifier(_, moduleName, project)) + } else { + StackReplsManager.getProjectRepl(project).getModuleIdentifiers(moduleName).stdOutLines.flatMap(findModuleIdentifier(_, moduleName, project)) + } + } else { + StackReplsManager.getGlobalRepl(project).getModuleIdentifiers(moduleName).stdOutLines.flatMap(findModuleIdentifier(_, moduleName, project)) + } + } + + private def findModuleIdentifier(outputLine: String, moduleName: String, project: Project): Option[ModuleIdentifier] = { + val declaration = outputLine.replaceAll(PackageNameQualifierPattern, "").replaceAll("""\s+""", " ").replaceAll("""\{\-(.+)\-\}""", "") + val allTokens = declaration.split("""\s+""") + if (allTokens.isEmpty || allTokens(0) == "--") { + None + } else if (Seq("class", "instance").contains(allTokens(0))) { + declaration.split("""where|=\s""").headOption.flatMap { d => + val tokens = d.trim.split("""=>""") + if (tokens.size == 1) { + createModuleIdentifier(allTokens(1), moduleName, declaration) + } else { + createModuleIdentifier(tokens.last.trim.split("""\s+""")(0), moduleName, declaration) + } + } + } else if (allTokens(0) == "type" && allTokens(1) == "role") { + createModuleIdentifier(allTokens(2), moduleName, declaration) + } else if (Seq("data", "type").contains(allTokens(0).trim)) { + createModuleIdentifier(allTokens(1), moduleName, declaration) + } else { + val tokens = declaration.split("""::""") + if (tokens.size > 1) { + val name = tokens(0).trim + createModuleIdentifier(name, moduleName, declaration) + } else { + None + } + } + } + + private def createModuleIdentifier(name: String, moduleName: String, declaration: String) = { + if (name.startsWith("(")) { + Some(ModuleIdentifier(name.substring(1, name.length - 1), moduleName, declaration, isOperator = true)) + } else { + Some(ModuleIdentifier(name, moduleName, declaration, isOperator = false)) + } + } + } + ) + + // TODO: Consider to invalidate key if no value + def findImportedModuleIdentifiers(project: Project, moduleName: String): Iterable[ModuleIdentifier] = { + try { + Cache.get(Key(project, moduleName, allTopLevel = false)) + } + catch { + case _: UncheckedExecutionException => Iterable() + case _: ProcessCanceledException => Iterable() + } + } + + // TODO: Consider to invalidate key if no value + def findAllTopLevelModuleIdentifiers(project: Project, moduleName: String): Iterable[ModuleIdentifier] = { + try { + Cache.get(Key(project, moduleName, allTopLevel = true)) + } + catch { + case _: UncheckedExecutionException => Iterable() + case _: ProcessCanceledException => Iterable() + } + } + + def isCacheEmptyForModule(moduleName: String): Boolean = { + !Cache.asMap().exists(_._1.moduleName == moduleName) + } + + def refreshForModule(project: Project, moduleName: String): Unit = { + val keys = Cache.asMap().filter(k => k._1.project == project && k._1.moduleName == moduleName).keys + keys.foreach(k => Cache.refresh(k)) + } + + def invalidate(): Unit = { + val keys = Cache.asMap().keys + keys.foreach(k => Cache.invalidate(k)) + } +} + +case class ModuleIdentifier(name: String, moduleName: String, declaration: String, isOperator: Boolean) diff --git a/src/main/scala/intellij/haskell/external/component/DefinitionLocationComponent.scala b/src/main/scala/intellij/haskell/external/component/DefinitionLocationComponent.scala new file mode 100644 index 00000000..1bfb8aae --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/DefinitionLocationComponent.scala @@ -0,0 +1,101 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import java.util.concurrent.{Callable, Executors} + +import com.google.common.cache.{CacheBuilder, CacheLoader} +import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} +import com.intellij.openapi.progress.ProcessCanceledException +import com.intellij.psi.{PsiElement, PsiFile} +import intellij.haskell.external.repl.StackReplsManager +import intellij.haskell.psi._ +import intellij.haskell.util.LineColumnPosition + +import scala.collection.JavaConversions._ + +private[component] object DefinitionLocationComponent { + private final val Executor = Executors.newCachedThreadPool() + + private final val LocAtPattern = """(.+)\:\(([\d]+),([\d]+)\)-\(([\d]+),([\d]+)\)""".r + + private case class Key(startLineNr: Int, startColumnNr: Int, endLineNr: Int, endColumnNr: Int, expression: String, psiFile: PsiFile) + + private final val Cache = CacheBuilder.newBuilder() + .build( + new CacheLoader[Key, Option[DefinitionLocation]]() { + + override def load(key: Key): Option[DefinitionLocation] = { + createDefinitionLocation(key) + } + + override def reload(key: Key, oldInfo: Option[DefinitionLocation]): ListenableFuture[Option[DefinitionLocation]] = { + val task = ListenableFutureTask.create(new Callable[Option[DefinitionLocation]]() { + def call() = { + createDefinitionLocation(key) + } + }) + Executor.execute(task) + task + } + + private def createDefinitionLocation(key: Key): Option[DefinitionLocation] = { + val psiFile = key.psiFile + val project = psiFile.getProject + val output = StackReplsManager.getProjectRepl(project).findLocationInfoFor(psiFile, key.startLineNr, key.startColumnNr, key.endLineNr, key.endColumnNr + 1, key.expression) + output.stdOutLines.headOption.flatMap(l => createDefinitionLocationInfo(l)) + } + } + ) + + def findDefinitionLocation(psiElement: PsiElement): Option[DefinitionLocation] = { + val qualifiedNameElement = HaskellPsiUtil.findQualifiedNameElement(psiElement) + for { + qne <- qualifiedNameElement + textOffset = qne.getTextOffset + psiFile <- Option(psiElement.getContainingFile) + sp <- LineColumnPosition.fromOffset(psiFile, textOffset) + ep <- LineColumnPosition.fromOffset(psiFile, textOffset + qne.getText.length - 1) + typeInfo <- find(psiFile, sp, ep, qne.getName) + } yield typeInfo + } + + def invalidate(psiFile: PsiFile): Unit = { + val keys = Cache.asMap().filter(_._1.psiFile == psiFile).keys + keys.foreach(k => Cache.invalidate(k)) + } + + private def find(psiFile: PsiFile, startPosition: LineColumnPosition, endPosition: LineColumnPosition, expression: String): Option[DefinitionLocation] = { + val key = Key(startPosition.lineNr, startPosition.columnNr, endPosition.lineNr, endPosition.columnNr, expression, psiFile) + try { + Cache.get(key) + } + catch { + case _: UncheckedExecutionException => None + case _: ProcessCanceledException => None + } + } + + private def createDefinitionLocationInfo(output: String): Option[DefinitionLocation] = { + output match { + case LocAtPattern(filePath, startLineNr, startColumnNr, endLineNr, endColumnNr) => Some(DefinitionLocation(filePath.trim, startLineNr.toInt, startColumnNr.toInt, endLineNr.toInt, endColumnNr.toInt)) + case _ => None + } + } +} + +case class DefinitionLocation(filePath: String, startLineNr: Int, startColumnNr: Int, endLineNr: Int, endColumnNr: Int) diff --git a/src/main/scala/intellij/haskell/external/component/GlobalProjectInfoComponent.scala b/src/main/scala/intellij/haskell/external/component/GlobalProjectInfoComponent.scala new file mode 100644 index 00000000..ba44b194 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/GlobalProjectInfoComponent.scala @@ -0,0 +1,119 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import java.util.concurrent.{Callable, Executors} + +import com.google.common.cache.{CacheBuilder, CacheLoader} +import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} +import com.intellij.openapi.progress.ProcessCanceledException +import com.intellij.openapi.project.Project +import intellij.haskell.external.CommandLine +import intellij.haskell.external.repl.StackReplsManager +import intellij.haskell.external.repl.process.StackReplOutput +import intellij.haskell.sdk.HaskellSdkType + +import scala.collection.JavaConversions._ + +private[component] object GlobalProjectInfoComponent { + + private case class Key(project: Project) + + private val executor = Executors.newCachedThreadPool() + + private final val Cache = CacheBuilder.newBuilder() + .build( + new CacheLoader[Key, GlobalProjectInfo]() { + + override def load(key: Key): GlobalProjectInfo = { + createGlobalProjectInfo(key) + } + + override def reload(key: Key, oldValue: GlobalProjectInfo): ListenableFuture[GlobalProjectInfo] = { + val task = ListenableFutureTask.create(new Callable[GlobalProjectInfo]() { + def call() = { + createGlobalProjectInfo(key) + } + }) + executor.execute(task) + task + } + + private def createGlobalProjectInfo(key: Key): GlobalProjectInfo = { + val project = key.project + val allAvailableModuleNames = findTail(StackReplsManager.getProjectRepl(project).findAllAvailableLibraryModules) + val availableInProdModuleNames = allAvailableModuleNames.filterNot(_.startsWith("Test.")) + GlobalProjectInfo(availableInProdModuleNames, allAvailableModuleNames, isNoImplicitPreludeGlobalActive(project), getLanguageExtensions(project)) + } + + private def findTail(output: StackReplOutput) = { + val lines = output.stdOutLines + if (lines.isEmpty) { + Iterable() + } else { + lines.tail.map(m => m.substring(1, m.length - 1)) + } + } + + private def isNoImplicitPreludeGlobalActive(project: Project): Boolean = { + val languageFlags = StackReplsManager.getGlobalRepl(project).showActiveLanguageFlags().stdOutLines + languageFlags.exists(_.contains("-XNoImplicitPrelude")) + } + + private def getLanguageExtensions(project: Project): Iterable[String] = { + (for { + stackPath <- HaskellSdkType.getStackPath(project) + ghcPath <- findGhcPath(stackPath, project.getBasePath) + } yield ghcPath) match { + case None => Iterable() + case Some(ghcPath) => CommandLine.getProcessOutput( + project.getBasePath, + ghcPath, + Seq("--supported-languages") + ).getStdoutLines + } + } + + private def findGhcPath(stackPath: String, projectBasePath: String) = { + CommandLine.getProcessOutput( + projectBasePath, + stackPath, + Seq("path", "--compiler-exe") + ).getStdoutLines.headOption + } + } + ) + + def findGlobalProjectInfo(project: Project): GlobalProjectInfo = { + try { + Cache.get(Key(project)) + } + catch { + case _: UncheckedExecutionException => GlobalProjectInfo() + case _: ProcessCanceledException => GlobalProjectInfo() + } + } + + def invalidate(project: Project): Unit = { + Cache.invalidate(Key(project)) + } +} + +case class GlobalProjectInfo(availableInProdLibraryModuleNames: Iterable[String] = Iterable(), + availableInTestLibraryModuleNames: Iterable[String] = Iterable(), + noImplicitPreludeActive: Boolean = false, + languageExtensions: Iterable[String] = Iterable()) diff --git a/src/main/scala/intellij/haskell/external/component/LoadComponent.scala b/src/main/scala/intellij/haskell/external/component/LoadComponent.scala new file mode 100644 index 00000000..e10ce704 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/LoadComponent.scala @@ -0,0 +1,81 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import com.intellij.psi.PsiFile +import intellij.haskell.external.repl.StackReplsManager +import intellij.haskell.util.{HaskellFileUtil, OSUtil, Util} + +private[component] object LoadComponent { + + private final val ProblemPattern = """(.+):([\d]+):([\d]+):(.+)""".r + + def load(psiFile: PsiFile): LoadResult = { + val project = psiFile.getProject + val loadOutput = StackReplsManager.getProjectRepl(project).load(psiFile) + + val isLoadFailed = loadOutput.stdOutLines.lastOption.exists(_.contains("Failed, ")) + + val filePath = HaskellFileUtil.makeFilePathAbsolute(HaskellFileUtil.getFilePath(psiFile), project) + val loadProblems = loadOutput.stdErrLines.distinct.map(l => parseLoadOutputLine(filePath, l)) + val currentFileProblems = loadProblems.flatMap(lp => toLoadProblemInCurrentFile(lp)) + val otherFileProblems = loadProblems.diff(currentFileProblems) + LoadResult(currentFileProblems, otherFileProblems, isLoadFailed) + } + + private def toLoadProblemInCurrentFile(loadProblem: LoadProblem) = { + loadProblem match { + case lp: LoadProblemInCurrentFile => Some(lp) + case _ => None + } + } + + private[component] def parseLoadOutputLine(filePath: String, outputLine: String): LoadProblem = { + outputLine match { + case ProblemPattern(problemFilePath, lineNr, columnNr, message) => + val displayMessage = (if (message.startsWith(" ")) { + s"Error: $message" + } else { + message + }).replaceAll("""(\s\s\s\s+)""", OSUtil.LineSeparator + "$1") + if (filePath == problemFilePath) { + LoadProblemInCurrentFile(problemFilePath, lineNr.toInt, columnNr.toInt, displayMessage) + } else { + LoadProblemInOtherFile(problemFilePath, lineNr.toInt, columnNr.toInt, displayMessage) + } + case m => LoadProblemWithoutLocation(m) + } + } +} + +case class LoadResult(currentFileProblems: Iterable[LoadProblemInCurrentFile] = Iterable(), otherFileProblems: Iterable[LoadProblem] = Iterable(), loadFailed: Boolean = false) + +sealed abstract class LoadProblem(private val message: String) { + def normalizedMessage: String = { + message.trim.replace(OSUtil.LineSeparator, ' ').replaceAll("\\s+", " ") + } + + def htmlMessage: String = { + Util.escapeString(message.replace(' ', '\u00A0')) + } +} + +case class LoadProblemInCurrentFile(filePath: String, lineNr: Int, columnNr: Int, private val message: String) extends LoadProblem(message) + +case class LoadProblemInOtherFile(filePath: String, lineNr: Int, columnNr: Int, private val message: String) extends LoadProblem(message) + +case class LoadProblemWithoutLocation(private val message: String) extends LoadProblem(message) diff --git a/src/main/scala/intellij/haskell/external/component/NameInfoComponent.scala b/src/main/scala/intellij/haskell/external/component/NameInfoComponent.scala new file mode 100644 index 00000000..b6853711 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/NameInfoComponent.scala @@ -0,0 +1,147 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import java.util.concurrent.{Callable, Executors} + +import com.google.common.cache.{CacheBuilder, CacheLoader} +import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.progress.ProcessCanceledException +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.Computable +import com.intellij.psi.{PsiElement, PsiFile} +import intellij.haskell.external.repl.StackReplsManager +import intellij.haskell.external.repl.process.StackReplOutput +import intellij.haskell.psi._ +import intellij.haskell.util.HaskellProjectUtil +import intellij.haskell.util.Util.escapeString + +import scala.collection.JavaConversions._ + +private[component] object NameInfoComponent { + + private final val ProjectInfoPattern = """(.+)-- Defined at (.+):([\d]+):([\d]+)""".r + private final val LibraryModuleInfoPattern = """(.+)-- Defined in ‘([\w\.\-]+):([\w\.\-]+)’""".r + private final val ModuleInfoPattern = """(.+)-- Defined in ‘([\w\.\-]+)’""".r + + private final val Executor = Executors.newCachedThreadPool() + + private case class Key(psiFile: PsiFile, name: String) + + private final val Cache = CacheBuilder.newBuilder() + .build( + new CacheLoader[Key, Iterable[NameInfo]]() { + + override def load(key: Key): Iterable[NameInfo] = { + createNameInfos(key, key.psiFile.getProject) + } + + override def reload(key: Key, oldInfo: Iterable[NameInfo]): ListenableFuture[Iterable[NameInfo]] = { + val task = ListenableFutureTask.create(new Callable[Iterable[NameInfo]]() { + def call() = { + createNameInfos(key, key.psiFile.getProject) + } + }) + Executor.execute(task) + task + } + + private def createNameInfos(key: Key, project: Project): Iterable[NameInfo] = { + val output = if (HaskellProjectUtil.isProjectFile(key.psiFile)) { + StackReplsManager.getProjectRepl(project).findNameInfo(key.psiFile, key.name) + } else { + val moduleName = findModuleName(key.psiFile) + moduleName.map(mn => StackReplsManager.getGlobalRepl(project).findNameInfo(mn, key.name)).getOrElse(StackReplOutput()) + } + output.stdOutLines.flatMap(l => createNameInfo(l, project)) + } + + private def findModuleName(psiFile: PsiFile) = { + ApplicationManager.getApplication.runReadAction { + new Computable[Option[String]] { + override def compute(): Option[String] = { + HaskellPsiUtil.findModuleName(psiFile) + } + } + } + } + + private def createNameInfo(outputLine: String, project: Project): Option[NameInfo] = { + outputLine match { + case ProjectInfoPattern(declaration, filePath, lineNr, colNr) => Some(ProjectNameInfo(declaration, filePath, lineNr.toInt, colNr.toInt)) + case LibraryModuleInfoPattern(declaration, libraryName, moduleName) => + if (libraryName == "ghc-prim" || libraryName == "integer-gmp") { + Some(BuiltInNameInfo(declaration, libraryName, "GHC.Base")) + } + else { + Some(LibraryNameInfo(declaration, moduleName)) + } + case ModuleInfoPattern(declaration, moduleName) => Some(LibraryNameInfo(declaration, moduleName)) + case _ => None + } + } + } + ) + + def findNameInfo(psiElement: PsiElement): Iterable[NameInfo] = { + val namedElement = for { + qne <- HaskellPsiUtil.findQualifiedNameElement(psiElement) + pf <- Option(qne.getContainingFile.getOriginalFile) + } yield Key(pf, qne.getName.replaceAll("""\s+""", "")) + + (try { + namedElement.map(k => Cache.get(k)) + } + catch { + case _: UncheckedExecutionException => None + case _: ProcessCanceledException => None + }).getOrElse(Iterable()) + } + + def refresh(psiFile: PsiFile): Unit = { + val keys = Cache.asMap().filter(_._1.psiFile == psiFile).keys + val namedElements = findNamedElements(psiFile) + keys.filter(k => namedElements.contains(k.name)).foreach(k => Cache.refresh(k)) + } + + private def findNamedElements(psiFile: PsiFile) = { + ApplicationManager.getApplication.runReadAction { + new Computable[Iterable[String]] { + override def compute(): Iterable[String] = { + HaskellPsiUtil.findNamedElements(psiFile).map(_.getName) + } + } + } + } +} + +sealed trait NameInfo { + private final val QualifierPattern = """([A-Z][A-Za-z\-\']+\.)+""" + + def declaration: String + + def unqualifiedDeclaration = declaration.replaceAll(QualifierPattern, "") + + def escapedDeclaration = escapeString(declaration) +} + +case class ProjectNameInfo(declaration: String, filePath: String, lineNr: Int, colNr: Int) extends NameInfo + +case class LibraryNameInfo(declaration: String, moduleName: String) extends NameInfo + +case class BuiltInNameInfo(declaration: String, libraryName: String, moduleName: String) extends NameInfo diff --git a/src/main/scala/intellij/haskell/external/component/ProjectModulesComponent.scala b/src/main/scala/intellij/haskell/external/component/ProjectModulesComponent.scala new file mode 100644 index 00000000..57e2bd05 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/ProjectModulesComponent.scala @@ -0,0 +1,93 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import java.util.concurrent.{Callable, Executors} + +import com.google.common.cache.{CacheBuilder, CacheLoader} +import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.progress.ProcessCanceledException +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.Computable +import com.intellij.psi.PsiFile +import intellij.haskell.psi.HaskellPsiUtil +import intellij.haskell.util.{HaskellFileIndex, HaskellProjectUtil} + +private[component] object ProjectModulesComponent { + + private case class Key(project: Project) + + private val executor = Executors.newCachedThreadPool() + + private final val Cache = CacheBuilder.newBuilder() + .build( + new CacheLoader[Key, ProjectModules]() { + + override def load(key: Key): ProjectModules = { + createProjectModules(key) + } + + override def reload(key: Key, oldValue: ProjectModules): ListenableFuture[ProjectModules] = { + val task = ListenableFutureTask.create(new Callable[ProjectModules]() { + def call() = { + createProjectModules(key) + } + }) + executor.execute(task) + task + } + + private def createProjectModules(key: Key): ProjectModules = { + val project = key.project + val moduleNamesWithFile = findProjectModules(project) + val testAndProdModuleNamesWithFile = moduleNamesWithFile.partition(mnf => HaskellProjectUtil.isProjectTestFile(mnf._2)) + ProjectModules(moduleNamesWithFile.map(_._1), testAndProdModuleNamesWithFile._2.map(_._1), testAndProdModuleNamesWithFile._1.map(_._1)) + } + + private def findProjectModules(project: Project) = { + ApplicationManager.getApplication.runReadAction { + new Computable[Iterable[(String, PsiFile)]] { + override def compute(): Iterable[(String, PsiFile)] = { + HaskellFileIndex.findProjectHaskellFiles(project).flatMap(f => HaskellPsiUtil.findModuleName(f).map(mn => (mn, f))) + } + } + } + } + } + ) + + def findAvailableModules(project: Project): ProjectModules = { + try { + Cache.get(Key(project)) + } + catch { + case _: UncheckedExecutionException => ProjectModules() + case _: ProcessCanceledException => ProjectModules() + } + } + + def refresh(project: Project): Unit = { + Cache.refresh(Key(project)) + } + + def invalidate(project: Project): Unit = { + Cache.invalidate(Key(project)) + } +} + +case class ProjectModules(allModuleNames: Iterable[String] = Iterable(), prodModuleNames: Iterable[String] = Iterable(), testModuleNames: Iterable[String] = Iterable()) diff --git a/src/main/scala/intellij/haskell/external/component/StackReplsComponentsManager.scala b/src/main/scala/intellij/haskell/external/component/StackReplsComponentsManager.scala new file mode 100644 index 00000000..29708006 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/StackReplsComponentsManager.scala @@ -0,0 +1,153 @@ +/* +* Copyright 2016 Rik van der Kleij +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at + * +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import java.util.concurrent.TimeUnit + +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.editor.SelectionModel +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.Computable +import com.intellij.psi.{PsiElement, PsiFile} +import intellij.haskell.annotator.HaskellAnnotator +import intellij.haskell.psi.HaskellPsiUtil + +import scala.collection.mutable + +object StackReplsComponentsManager { + + private[this] final val PreloadTimeoutInMinutes = 10 + + private[this] val isCachePreloaded = mutable.Map[Project, Boolean]() + + implicit class RichBoolean(val b: Boolean) extends AnyVal { + final def option[A](a: => A): Option[A] = if (b) Some(a) else None + } + + def findImportedModuleIdentifiers(project: Project, moduleName: String) = { + findIterableIfCacheIsPreloaded(project, BrowseModuleComponent.findImportedModuleIdentifiers(project, moduleName)) + } + + def findAllTopLevelModuleIdentifiers(project: Project, moduleName: String) = { + findIterableIfCacheIsPreloaded(project, BrowseModuleComponent.findAllTopLevelModuleIdentifiers(project, moduleName)) + } + + def findDefinitionLocation(psiElement: PsiElement): Option[DefinitionLocation] = { + DefinitionLocationComponent.findDefinitionLocation(psiElement) + } + + def findNameInfo(psiElement: PsiElement): Iterable[NameInfo] = { + NameInfoComponent.findNameInfo(psiElement) + } + + def findAvailableProjectModules(project: Project): ProjectModules = { + ProjectModulesComponent.findAvailableModules(project) + } + + def findGlobalProjectInfo(project: Project): Option[GlobalProjectInfo] = { + findIfCacheIsPreloaded(project, GlobalProjectInfoComponent.findGlobalProjectInfo(project)) + } + + // TODO: Consider to pass refresh action to load so refresh starts earlier + def loadHaskellFile(psiFile: PsiFile, refreshCache: Boolean): LoadResult = { + val loadResult = LoadComponent.load(psiFile) + + if (refreshCache && !loadResult.loadFailed) { + ApplicationManager.getApplication.executeOnPooledThread(new Runnable { + override def run(): Unit = { + refreshCachesAfterLoad(psiFile.getProject, psiFile) + } + }) + } + + loadResult + } + + def invalidateModuleIdentifierCaches(project: Project) = { + isCachePreloaded.put(project, false) + BrowseModuleComponent.invalidate() + ProjectModulesComponent.invalidate(project) + GlobalProjectInfoComponent.invalidate(project) + } + + def preloadModuleIdentifiersCaches(project: Project) = { + val libraryModuleIdentifiersFuture = ApplicationManager.getApplication.executeOnPooledThread { + new Runnable { + override def run(): Unit = { + preloadAllLibraryModuleIdentifiers(project) + } + } + } + val projectModuleIdentifiersFuture = ApplicationManager.getApplication.executeOnPooledThread { + new Runnable { + override def run(): Unit = { + preloadAllProjectModuleIdentifiers(project) + } + } + } + libraryModuleIdentifiersFuture.get(PreloadTimeoutInMinutes, TimeUnit.MINUTES) + projectModuleIdentifiersFuture.get(PreloadTimeoutInMinutes, TimeUnit.MINUTES) + isCachePreloaded.put(project, true) + HaskellAnnotator.restartDaemonCodeAnalyzerForOpenFiles(project) + } + + def findTypeInfoForElement(psiElement: PsiElement): Option[TypeInfo] = { + TypeInfoComponent.findTypeInfoForElement(psiElement) + } + + def findTypeInfoForSelection(psiFile: PsiFile, selectionModel: SelectionModel): Option[TypeInfo] = { + TypeInfoComponent.findTypeInfoForSelection(psiFile, selectionModel) + } + + private def refreshCachesAfterLoad(project: Project, psiFile: PsiFile): Unit = { + findModuleName(psiFile).foreach(mn => BrowseModuleComponent.refreshForModule(project, mn)) + + NameInfoComponent.refresh(psiFile) + ProjectModulesComponent.refresh(project) + + TypeInfoComponent.invalidate(psiFile) + DefinitionLocationComponent.invalidate(psiFile) + } + + private def preloadAllLibraryModuleIdentifiers(project: Project): Unit = { + val libraryModuleNames = GlobalProjectInfoComponent.findGlobalProjectInfo(project).availableInTestLibraryModuleNames + libraryModuleNames.flatMap(mn => BrowseModuleComponent.findImportedModuleIdentifiers(project, mn)) + } + + private def preloadAllProjectModuleIdentifiers(project: Project): Unit = { + val prodModuleNames = ProjectModulesComponent.findAvailableModules(project).prodModuleNames + prodModuleNames.flatMap(mn => BrowseModuleComponent.findImportedModuleIdentifiers(project, mn)) + } + + private def findIterableIfCacheIsPreloaded[A](project: Project, f: => Iterable[A]) = { + isCachePreloaded.getOrElse(project, false).option(f).getOrElse(Iterable()) + } + + private def findIfCacheIsPreloaded[A](project: Project, f: => A) = { + isCachePreloaded.getOrElse(project, false).option(f) + } + + private def findModuleName(psiFile: PsiFile) = { + ApplicationManager.getApplication.runReadAction { + new Computable[Option[String]] { + override def compute(): Option[String] = { + HaskellPsiUtil.findModuleName(psiFile) + } + } + } + } +} diff --git a/src/main/scala/intellij/haskell/external/component/TypeInfoComponent.scala b/src/main/scala/intellij/haskell/external/component/TypeInfoComponent.scala new file mode 100644 index 00000000..db844960 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/component/TypeInfoComponent.scala @@ -0,0 +1,99 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.component + +import java.util.concurrent.{Callable, Executors} + +import com.google.common.cache.{CacheBuilder, CacheLoader} +import com.google.common.util.concurrent.{ListenableFuture, ListenableFutureTask, UncheckedExecutionException} +import com.intellij.openapi.editor.SelectionModel +import com.intellij.openapi.progress.ProcessCanceledException +import com.intellij.psi.{PsiElement, PsiFile} +import intellij.haskell.external.repl.StackReplsManager +import intellij.haskell.psi._ +import intellij.haskell.util.LineColumnPosition + +import scala.collection.JavaConversions._ + +private[component] object TypeInfoComponent { + private final val Executor = Executors.newCachedThreadPool() + + private case class Key(psiFile: PsiFile, startLineNr: Int, startColumnNr: Int, endLineNr: Int, endColumnNr: Int, expression: String) + + private final val Cache = CacheBuilder.newBuilder() + .build( + new CacheLoader[Key, Option[TypeInfo]]() { + + override def load(key: Key): Option[TypeInfo] = { + createTypeInfo(key) + } + + override def reload(key: Key, oldInfo: Option[TypeInfo]): ListenableFuture[Option[TypeInfo]] = { + val task = ListenableFutureTask.create(new Callable[Option[TypeInfo]]() { + def call() = { + createTypeInfo(key) + } + }) + Executor.execute(task) + task + } + + private def createTypeInfo(key: Key): Option[TypeInfo] = { + val project = key.psiFile.getProject + val output = StackReplsManager.getProjectRepl(project).findTypeInfoFor(key.psiFile, key.startLineNr, key.startColumnNr, key.endLineNr, key.endColumnNr, key.expression) + output.stdOutLines.headOption.filterNot(_.trim.isEmpty).map(ti => TypeInfo(ti)) + } + } + ) + + def findTypeInfoForElement(psiElement: PsiElement): Option[TypeInfo] = { + for { + qne <- HaskellPsiUtil.findQualifiedNameElement(psiElement) + to = qne.getTextOffset + f <- Option(psiElement.getContainingFile) + sp <- LineColumnPosition.fromOffset(f, to) + ep <- LineColumnPosition.fromOffset(f, to + qne.getText.length) + ti <- findTypeInfo(f, sp, ep, qne.getText) + } yield ti + } + + def findTypeInfoForSelection(psiFile: PsiFile, selectionModel: SelectionModel): Option[TypeInfo] = { + for { + sp <- LineColumnPosition.fromOffset(psiFile, selectionModel.getSelectionStart) + ep <- LineColumnPosition.fromOffset(psiFile, selectionModel.getSelectionEnd) + typeInfo <- findTypeInfo(psiFile, sp, ep, selectionModel.getSelectedText) + } yield typeInfo + } + + def invalidate(psiFile: PsiFile): Unit = { + val keys = Cache.asMap().filter(_._1.psiFile == psiFile).keys + keys.foreach(k => Cache.invalidate(k)) + } + + private def findTypeInfo(psiFile: PsiFile, startPosition: LineColumnPosition, endPosition: LineColumnPosition, expression: String): Option[TypeInfo] = { + val key = Key(psiFile, startPosition.lineNr, startPosition.columnNr, endPosition.lineNr, endPosition.columnNr, expression) + try { + Cache.get(key) + } + catch { + case _: UncheckedExecutionException => None + case _: ProcessCanceledException => None + } + } +} + +case class TypeInfo(typeSignature: String) diff --git a/src/main/scala/intellij/haskell/external/repl/StackReplsManager.scala b/src/main/scala/intellij/haskell/external/repl/StackReplsManager.scala new file mode 100644 index 00000000..01580281 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/repl/StackReplsManager.scala @@ -0,0 +1,69 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.repl + +import com.intellij.openapi.components.ProjectComponent +import com.intellij.openapi.progress.{ProgressIndicator, ProgressManager, Task} +import com.intellij.openapi.project.Project +import intellij.haskell.external.component.StackReplsComponentsManager +import intellij.haskell.external.repl.process.{GlobalStackReplProcess, ProjectStackReplProcess} +import intellij.haskell.util.HaskellProjectUtil + +object StackReplsManager { + + def getProjectRepl(project: Project) = { + projectRepl(project) + } + + def getGlobalRepl(project: Project) = { + globalRepl(project) + } + + private def projectRepl(project: Project) = { + project.getComponent(classOf[ProjectStackReplProcess]) + } + + private def globalRepl(project: Project) = { + project.getComponent(classOf[GlobalStackReplProcess]) + } +} + +class StackReplsManager(project: Project) extends ProjectComponent { + override def getComponentName: String = "stack-repls-manager" + + override def projectClosed(): Unit = {} + + override def initComponent(): Unit = {} + + override def projectOpened(): Unit = { + ProgressManager.getInstance().run(new Task.Backgroundable(project, s"[$getComponentName] Starting Stack repls, building project and preloading cache") { + + def run(progressIndicator: ProgressIndicator) { + if (HaskellProjectUtil.isHaskellStackProject(project)) { + progressIndicator.setText("Busy with starting Stack repls and building project") + StackReplsManager.getProjectRepl(project).start() + StackReplsManager.getGlobalRepl(project).start() + + progressIndicator.setText("Busy with preloading cache") + StackReplsComponentsManager.preloadModuleIdentifiersCaches(project) + } + } + }) + } + + override def disposeComponent(): Unit = {} +} diff --git a/src/main/scala/intellij/haskell/external/repl/process/GlobalStackReplProcess.scala b/src/main/scala/intellij/haskell/external/repl/process/GlobalStackReplProcess.scala new file mode 100644 index 00000000..25720b7a --- /dev/null +++ b/src/main/scala/intellij/haskell/external/repl/process/GlobalStackReplProcess.scala @@ -0,0 +1,41 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.repl.process + +import com.intellij.openapi.project.Project + +class GlobalStackReplProcess(project: Project) extends StackReplProcess(project, Seq("--no-build", "--no-package-hiding")) { + override def getComponentName: String = "global-stack-repl" + + def getModuleIdentifiers(moduleName: String): StackReplOutput = synchronized { + execute(":module " + moduleName, waitCondition = None) + execute(":browse! " + moduleName) + } + + def findNameInfo(moduleName: String, name: String): StackReplOutput = synchronized { + val output = execute(s":module $moduleName", waitCondition = None) + if (output.stdErrLines.isEmpty) { + execute(s":info $name", waitCondition = Some(StdOutputForInfo)) + } else { + StackReplOutput() + } + } + + def showActiveLanguageFlags(): StackReplOutput = { + execute(":show language") + } +} diff --git a/src/main/scala/intellij/haskell/external/repl/process/ProjectStackReplProcess.scala b/src/main/scala/intellij/haskell/external/repl/process/ProjectStackReplProcess.scala new file mode 100644 index 00000000..bb840e95 --- /dev/null +++ b/src/main/scala/intellij/haskell/external/repl/process/ProjectStackReplProcess.scala @@ -0,0 +1,75 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.repl.process + +import com.intellij.openapi.project.Project +import com.intellij.psi.PsiFile +import intellij.haskell.util.HaskellFileUtil + +class ProjectStackReplProcess(project: Project) extends StackReplProcess(project) { + + private[this] var loadedPsiFile: Option[PsiFile] = None + + override def getComponentName: String = "project-stack-repl" + + def findTypeInfoFor(psiFile: PsiFile, startLineNr: Int, startColumnNr: Int, endLineNr: Int, endColumnNr: Int, expression: String): StackReplOutput = { + checkFileIsLoadedAndExecute(psiFile, filePath => execute(s":type-at $filePath $startLineNr $startColumnNr $endLineNr $endColumnNr $expression")) + } + + def findLocationInfoFor(psiFile: PsiFile, startLineNr: Int, startColumnNr: Int, endLineNr: Int, endColumnNr: Int, expression: String): StackReplOutput = { + checkFileIsLoadedAndExecute(psiFile, filePath => execute(s":loc-at $filePath $startLineNr $startColumnNr $endLineNr $endColumnNr $expression")) + } + + def findNameInfo(psiFile: PsiFile, name: String): StackReplOutput = { + checkFileIsLoadedAndExecute(psiFile, _ => execute(s":info $name", waitCondition = Some(StdOutputForInfo))) + } + + def load(psiFile: PsiFile): StackReplOutput = { + val filePath = HaskellFileUtil.getFilePath(psiFile) + execute(":load " + filePath, waitCondition = Some(StdErrForLoad)) + } + + def load(moduleName: String): StackReplOutput = { + execute(":load " + moduleName, waitCondition = Some(StdErrForLoad)) + } + + def getModuleIdentifiers(moduleName: String): StackReplOutput = synchronized { + load(moduleName) + execute(":browse! " + moduleName) + } + + def getAllTopLevelModuleIdentifiers(moduleName: String): StackReplOutput = synchronized { + load(moduleName) + execute(s":browse! *$moduleName") + } + + def findAllAvailableLibraryModules: StackReplOutput = synchronized { + execute(":load", waitCondition = None) + loadedPsiFile = None + execute(""":complete repl "import " """) + } + + private def checkFileIsLoadedAndExecute(psiFile: PsiFile, executeAction: String => StackReplOutput): StackReplOutput = { + val filePath = HaskellFileUtil.getFilePath(psiFile) + if (!loadedPsiFile.contains(psiFile)) { + load(psiFile) + } + val output = executeAction(filePath) + loadedPsiFile = Some(psiFile) + output + } +} diff --git a/src/main/scala/intellij/haskell/external/repl/process/StackReplProcess.scala b/src/main/scala/intellij/haskell/external/repl/process/StackReplProcess.scala new file mode 100644 index 00000000..570d7bdf --- /dev/null +++ b/src/main/scala/intellij/haskell/external/repl/process/StackReplProcess.scala @@ -0,0 +1,307 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.external.repl.process + +import java.io._ +import java.util.concurrent.LinkedBlockingDeque + +import com.intellij.openapi.components.ProjectComponent +import com.intellij.openapi.project.Project +import com.intellij.util.EnvironmentUtil +import intellij.haskell.HaskellNotificationGroup +import intellij.haskell.sdk.HaskellSdkType +import intellij.haskell.util._ + +import scala.collection.JavaConversions._ +import scala.collection.mutable.{ArrayBuffer, ListBuffer} +import scala.concurrent.SyncVar +import scala.concurrent.duration._ +import scala.io._ +import scala.sys.process._ + +abstract class StackReplProcess(val project: Project, val extraCommandOptions: Seq[String] = Seq()) extends ProjectComponent { + + private final val LineSeparatorInBytes = OSUtil.LineSeparator + + private[this] var available = false + + private[this] val outputStream = new SyncVar[OutputStream]() + + private[this] val stdOut = new SyncVar[LinkedBlockingDeque[String]]() + stdOut.put(new LinkedBlockingDeque[String]) + + private[this] val stdErr = new SyncVar[LinkedBlockingDeque[String]]() + stdErr.put(new LinkedBlockingDeque[String]) + + private final val Timeout = 1.seconds + + // Only experience with Linux and OSX for now + private final val DelayBetweenReads = if (OSUtil.isOSX || OSUtil.isWindows) 80 else 30 + + protected def execute(command: String, waitCondition: Option[WaitCondition] = Some(StdOutput)): StackReplOutput = synchronized { + + var previousWait = true + + def waitForOutput(stdOutResult: java.util.List[String], stdErrResult: java.util.List[String]): Boolean = { + val wait = waitCondition match { + case Some(StdOutput) => + if (getStdErr.isEmpty && stdErrResult.isEmpty) + stdOutResult.isEmpty || !getStdOut.isEmpty + else + !getStdErr.isEmpty + case Some(StdOutputForInfo) => + if (getStdErr.isEmpty && stdErrResult.isEmpty) + !getStdOut.isEmpty || !(stdOutResult.lastOption.exists(_.contains("--")) || stdOutResult.lastOption.exists(_.startsWith("infix"))) + else + !getStdErr.isEmpty + case Some(StdErrForLoad) => (!stdOutResult.lastOption.exists(l => l.contains("Collecting type info") || l.contains("Failed"))) || !getStdErr.isEmpty + case _ => !getStdErr.isEmpty + } + + // Wait one more time in case wait is false and previous wait is true. So do not wait longer if wait is two times false directly after each other + val waitResult = wait || previousWait + previousWait = wait + waitResult + } + + if (!available) { + logInfo(s"Stack repl is not yet available. Command was: $command") + return StackReplOutput() + } + + if (!outputStream.isSet) { + logError("Can not write to Stack repl. Check if your Haskell/Stack environment is working okay") + return StackReplOutput() + } + + try { + getStdOut.clear() + getStdErr.clear() + writeToOutputStream(command) + + val stdOutResult = new ArrayBuffer[String] + val stdErrResult = new ArrayBuffer[String] + + val deadline = Timeout.fromNow + + while (deadline.hasTimeLeft && waitForOutput(stdOutResult, stdErrResult)) { + getStdOut.drainTo(stdOutResult) + getStdErr.drainTo(stdErrResult) + + // We have to wait... + Thread.sleep(DelayBetweenReads) + } + + getStdOut.drainTo(stdOutResult) + getStdErr.drainTo(stdErrResult) + + if (deadline.isOverdue()) { + logError(s"No result from Stack repl within $Timeout. Command was: $command") + } + + logInfo("command: " + command) + logInfo("stdOut: " + stdOutResult.mkString("\n")) + logInfo("errOut: " + stdErrResult.mkString("\n")) + + if (deadline.isOverdue()) { + StackReplOutput() + } else { + StackReplOutput(convertOutputToOneMessagePerLine(removePrompt(stdOutResult)), convertOutputToOneMessagePerLine(stdErrResult)) + } + } + catch { + case e: Exception => + logError(s"Error in communication with Stack repl: ${e.getMessage}. Check if your Haskell/Stack environment is working okay. Command was: $command") + exit() + StackReplOutput() + } + } + + def start(): Unit = { + if (available) { + logError("Stack repl can not be started because it's already running or busy with starting") + return + } + + HaskellSdkType.getStackPath(project).foreach { stackPath => + try { + val command = (Seq(stackPath, "repl", "--with-ghc", "intero", "--verbosity", "warn", "--fast", "--no-load", + "--force-dirty", "--ghc-options", "-v1", "--test", "--terminal") ++ extraCommandOptions).mkString(" ") + logInfo(s"Stack repl will be started with command: $command") + val process = getEnvParameters match { + case None => Process(command, new File(project.getBasePath)) + case Some(ep) => Process(command, new File(project.getBasePath), ep.toArray: _*) + } + process.run( + new ProcessIO( + in => outputStream.put(in), + (out: InputStream) => getStdOut.addAll(Source.fromInputStream(out).getLines.toSeq), + (err: InputStream) => getStdErr.addAll(Source.fromInputStream(err).getLines.toSeq) + )) + + getStdOut.clear() + getStdErr.clear() + + val stdOutResult = new ArrayBuffer[String] + val stdErrResult = new ArrayBuffer[String] + + while (stdOutResult.isEmpty || !getStdOut.isEmpty || !getStdErr.isEmpty) { + if (getStdOut.nonEmpty) { + logInfo(getStdOut.mkString("\n")) + } + + if (getStdErr.nonEmpty) { + logInfo(getStdErr.mkString("\n")) + } + + getStdOut.drainTo(stdOutResult) + getStdErr.drainTo(stdErrResult) + + // We have to wait... + Thread.sleep(200) + } + + getStdOut.drainTo(stdOutResult) + getStdErr.drainTo(stdErrResult) + + available = true + + logInfo("Stack repl is started.") + } + catch { + case e: Exception => + logError("Could not start Stack repl. Make sure you have set right path to Stack in settings.") + logError(s"Error message while trying to start Stack repl: ${e.getMessage}") + exit() + } + } + } + + def exit(): Unit = { + if (!available) { + logError("Stack repl can not be stopped because it's already stopped or busy with stopping") + return + } + + try { + try { + if (outputStream.isSet) { + writeToOutputStream(":q") + } + if (outputStream.isSet) { + outputStream.take(100).close() + } + } + catch { + case e: Exception => + logError(s"Error while shutting down Stack repl for project ${project.getName}. Error message: ${e.getMessage}") + } + if (stdin != null) { + stdin.close() + } + if (stdout != null) { + stdout.close() + } + if (stderr != null) { + stderr.close() + } + } finally { + if (outputStream.isSet) { + outputStream.take(500) + } + available = false + } + logInfo("Stack repl is stopped.") + } + + private def getStdErr = stdErr.get + + private def getStdOut = stdOut.get + + private def logError(message: String) = { + HaskellNotificationGroup.logError(s"[$getComponentName] $message") + } + + private def logInfo(message: String) = { + HaskellNotificationGroup.logInfo(s"[$getComponentName] $message") + } + + private def removePrompt(output: Seq[String]): Seq[String] = { + output.headOption.map(e => e.replaceFirst("""([\\*\w\s\\.]+>)+""", "")) match { + case Some(e) => e +: output.tail + case None => output + } + } + + private def writeToOutputStream(command: String) = { + outputStream.get.write(command.getBytes) + outputStream.get.write(LineSeparatorInBytes) + outputStream.get.flush() + } + + private def getEnvParameters: Option[java.util.Map[String, String]] = { + if (OSUtil.isOSX) { + Option(EnvironmentUtil.getEnvironmentMap) + } else { + None + } + } + + private def convertOutputToOneMessagePerLine(output: Seq[String]) = { + joinIndentedLines(output.filterNot(_.isEmpty)) + } + + private def joinIndentedLines(lines: Seq[String]): Seq[String] = { + if (lines.size == 1) { + lines + } else { + try { + lines.foldLeft(ListBuffer[StringBuilder]())((lb, s) => + if (s.startsWith(" ")) { + lb.last.append(s) + lb + } + else { + lb += new StringBuilder(2, s) + }).map(_.toString) + } catch { + case e: NoSuchElementException => + HaskellNotificationGroup.notifyBalloonWarning(s"Could not join indented lines. Probably first line started with spaces. Unexpected input was: ${lines.mkString(", ")}") + Seq() + } + } + } + + override def projectOpened(): Unit = {} + + override def projectClosed(): Unit = exit() + + override def initComponent(): Unit = {} + + override def disposeComponent(): Unit = {} + + protected abstract class WaitCondition + + protected case object StdOutput extends WaitCondition + + protected case object StdOutputForInfo extends WaitCondition + + protected case object StdErrForLoad extends WaitCondition + +} + +case class StackReplOutput(stdOutLines: Seq[String] = Seq(), stdErrLines: Seq[String] = Seq()) diff --git a/src/main/scala/intellij/haskell/framework/HaskellFrameworkSupportProvider.scala b/src/main/scala/intellij/haskell/framework/HaskellFrameworkSupportProvider.scala index 392aa297..9b7dea1b 100644 --- a/src/main/scala/intellij/haskell/framework/HaskellFrameworkSupportProvider.scala +++ b/src/main/scala/intellij/haskell/framework/HaskellFrameworkSupportProvider.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/intellij/haskell/haskell.bnf b/src/main/scala/intellij/haskell/haskell.bnf index b7f7a927..1ca6a8ea 100644 --- a/src/main/scala/intellij/haskell/haskell.bnf +++ b/src/main/scala/intellij/haskell/haskell.bnf @@ -19,13 +19,11 @@ elementTypePrefix="HS_" - methods("var_id|var_sym|con_id|con_sym|qualifier|mod_id")=[getName setName getNameIdentifier getReference getPresentation getUseScope] - mixin("var_id|var_sym|con_id|con_sym|qualifier|mod_id")="intellij.haskell.psi.impl.HaskellNamedElementImpl" - implements("var_id|var_sym|con_id|con_sym|qualifier|mod_id")="intellij.haskell.psi.HaskellNamedElement" + methods("varid|varsym|conid|consym|modid")=[getName setName getNameIdentifier getReference getPresentation] + mixin("varid|varsym|conid|consym|modid")="intellij.haskell.psi.impl.HaskellNamedElementImpl" + implements("varid|varsym|conid|consym|modid")="intellij.haskell.psi.HaskellNamedElement" - methods("qvar_id|qcon_id")=[getName getIdentifierElement] - - methods("type_signature|type_declaration|class_declaration|instance_declaration|type_family_declaration|deriving_declaration|type_instance_declaration")=[getName getPresentation getIdentifierElements] + methods("type_signature|type_declaration|class_declaration|instance_declaration|type_family_declaration|deriving_declaration|type_instance_declaration")=[getName getPresentation getIdentifierElements getModuleName] methods("default_declaration|foreign_declaration|module_declaration")=[getName getPresentation getIdentifierElements getModuleName] implements("type_signature|type_declaration|class_declaration|instance_declaration|type_family_declaration|deriving_declaration|type_instance_declaration|default_declaration")="intellij.haskell.psi.HaskellDeclarationElement" implements("default_declaration|foreign_declaration|module_declaration")="intellij.haskell.psi.HaskellDeclarationElement" @@ -33,22 +31,33 @@ methods("data_declaration|newtype_declaration")=[getName getPresentation getIdentifierElements getModuleName getDataTypeConstructor] implements("data_declaration|newtype_declaration")="intellij.haskell.psi.HaskellDataConstructorDeclarationElement" - methods("qvar|qcon|qvar_op|qcon_op")=[getName getIdentifierElement getQualifier] - implements("qvar|qcon|qvar_op|qcon_op")="intellij.haskell.psi.HaskellQVarConOpElement" + methods("var_con|q_var_con")=[getName getIdentifierElement] - implements("first_line_expression|line_expression|last_line_expression")="intellij.haskell.psi.HaskellLineExpressionElement" - mixin("first_line_expression|line_expression|last_line_expression")="intellij.haskell.psi.impl.HaskellLineExpressionElementImpl" + methods("q_name|cname")=[getName getIdentifierElement getQualifierName getNameWithoutParens] + implements("q_name|cname")="intellij.haskell.psi.HaskellQualifiedNameElement" + + implements("line_expression|last_line_expression")="intellij.haskell.psi.HaskellLineExpressionElement" + mixin("|line_expression|last_line_expression")="intellij.haskell.psi.impl.HaskellLineExpressionElementImpl" + + methods("var|con|varop|conop")=[getName] + implements("var|con|varop|conop")="intellij.haskell.psi.HaskellCNameElement" + mixin("var|con|varop|conop")="intellij.haskell.psi.impl.HaskellCNameElementImpl" + + methods("q_con_qualifier1|q_con_qualifier2|q_con_qualifier3|q_con_qualifier4|qualifier")=[getName setName getNameIdentifier getReference getPresentation getUseScope] + implements("q_con_qualifier1|q_con_qualifier2|q_con_qualifier3|q_con_qualifier4|qualifier")="intellij.haskell.psi.HaskellQualifierElement" + mixin("q_con_qualifier1|q_con_qualifier2|q_con_qualifier3|q_con_qualifier4|qualifier")="intellij.haskell.psi.impl.HaskellQualifierElementImpl" } program ::= onl SHEBANG_LINE? onl file_header? onl module_body file_header ::= (file_header_pragma onl)+ file_header_pragma ::= language_pragma | options_ghc_pragma | include_pragma | haddock_pragma | ann_pragma | dummy_pragma -language_pragma ::= PRAGMA_START onl "LANGUAGE" onl qcon (onl COMMA onl qcon?)* onl PRAGMA_END NEWLINE? -options_ghc_pragma ::= PRAGMA_START onl ("OPTIONS_GHC" | "OPTIONS") general_pragma_content PRAGMA_END NEWLINE? +language_pragma ::= PRAGMA_START onl "LANGUAGE" onl q_name (onl COMMA onl q_name?)* onl PRAGMA_END NEWLINE? +options_ghc_pragma ::= PRAGMA_START onl ("OPTIONS_GHC" | "OPTIONS") onl options_ghc_option+ onl PRAGMA_END NEWLINE? +options_ghc_option ::= (VAR_ID ("-" (VAR_ID | TYPE))* | ("-" (VAR_ID | TYPE))+ | "-" CON_ID) (EQUAL literal)? include_pragma ::= PRAGMA_START onl "INCLUDE" general_pragma_content PRAGMA_END NEWLINE? -haddock_pragma ::= PRAGMA_START onl "OPTIONS_HADDOCK" general_pragma_content PRAGMA_END NEWLINE? -dummy_pragma ::= PRAGMA_START CONID_ID? PRAGMA_END? NEWLINE? +haddock_pragma ::= PRAGMA_START onl "OPTIONS_HADDOCK" onl (VARSYM_ID | VAR_ID)+ onl (COMMA onl (VARSYM_ID | VAR_ID)+)* onl PRAGMA_END NEWLINE? +dummy_pragma ::= PRAGMA_START q_name? PRAGMA_END? NEWLINE? other_pragma ::= ann_pragma | deprecated_warn_pragma | noinline_pragma | inlinable_pragma | line_pragma | rules_pragma | specialize_pragma | inline_pragma | minimal_pragma | overlap_pragma | constant_folded_pragma | dummy_pragma @@ -70,209 +79,205 @@ ctype_pragma ::= PRAGMA_START onl "CTYPE" onl general_pragma_cont overlap_pragma ::= PRAGMA_START onl ("OVERLAPPABLE" | "OVERLAPPING") onl PRAGMA_END constant_folded_pragma ::= PRAGMA_START onl "CONSTANT_FOLDED" onl general_pragma_content onl PRAGMA_END unpack_nounpack_pragma ::= unpack_pragma | nounpack_pragma -general_pragma_content ::= (general_id | NEWLINE | MODULE | INSTANCE)* +scc_pragma ::= PRAGMA_START onl "SCC" onl general_pragma_content onl PRAGMA_END +general_pragma_content ::= (CON_ID | VAR_ID | CONSYM_ID | VARSYM_ID | DOT | + LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | + COLON_COLON | DOUBLE_RIGHT_ARROW | RIGHT_ARROW | IN | CASE | OF | LET | + SEMICOLON | LEFT_ARROW | LEFT_BRACKET | RIGHT_BRACKET | literal | LEFT_BRACE | RIGHT_BRACE | + COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | DOT_DOT | MODULE | INSTANCE | NEWLINE)+ cfiles_pragma ::= PRAGMA_START onl "CFILES" general_pragma_content PRAGMA_END -module_body ::= module_declaration+ onl body | body -module_declaration ::= MODULE mod_id onl deprecated_warn_pragma? onl WHERE? onl (onl exports)? onl WHERE? onl expression? onl +module_body ::= module_declaration onl body | onl body +module_declaration ::= MODULE modid onl deprecated_warn_pragma? onl (exports onl)? WHERE -private body ::= import_declarations top_declarations -private import_declarations ::= ((import_declaration | cfiles_pragma) onl)* +private body ::= import_declarations top_declarations NEWLINE* +import_declarations ::= ((import_declaration | cfiles_pragma) onl)* private top_declarations ::= (top_declaration onl)* -import_declaration ::= IMPORT osnl source_pragma? osnl import_qualified? osnl import_module? osnl import_qualified_as? osnl import_spec? onl {methods=[getModuleName]} -import_module ::= mod_id -import_qualified ::= var_id -import_qualified_as ::= var_id qualifier? +import_declaration ::= IMPORT onls source_pragma? import_package_name? onls import_qualified? onls modid onls import_qualified_as? onls import_spec? NEWLINE? {methods=[getModuleName] pin=1} +import_qualified ::= VAR_ID // "qualified" +import_qualified_as ::= VAR_ID qualifier // "as" qualifier import_spec ::= import_ids_spec | import_hiding_spec | import_empty_spec -import_ids_spec ::= LEFT_PAREN osnl import_id (osnl COMMA osnl import_id)* osnl (COMMA)? osnl RIGHT_PAREN -import_hiding_spec ::= import_hiding osnl LEFT_PAREN osnl (import_id osnl (osnl COMMA osnl import_id)* osnl (COMMA)?)? osnl RIGHT_PAREN +import_ids_spec ::= LEFT_PAREN onls import_id (onls COMMA? onls import_id)* onls (COMMA)? onls RIGHT_PAREN +import_hiding_spec ::= import_hiding onls LEFT_PAREN onls (import_id onls (onls COMMA onls import_id)* onls (COMMA)?)? onls RIGHT_PAREN import_empty_spec ::= LEFT_PAREN RIGHT_PAREN -import_hiding ::= "hiding" -import_id ::= TYPE? (LEFT_PAREN DOT RIGHT_PAREN | qcon osnl LEFT_PAREN osnl cname osnl (COMMA osnl cname osnl)* osnl RIGHT_PAREN | qvar | qcon dot_dot_parens?) -dot_dot_parens ::= LEFT_PAREN VARSYM_ID RIGHT_PAREN +import_hiding ::= VAR_ID // "hiding" +import_id ::= TYPE? (cname onls dot_dot_parens | cname (LEFT_PAREN onls cname onls (COMMA onls cname onls)* onls RIGHT_PAREN) | cname) +dot_dot_parens ::= LEFT_PAREN DOT_DOT RIGHT_PAREN +import_package_name ::= STRING_LITERAL top_declaration ::= type_declaration | data_declaration | newtype_declaration | class_declaration | instance_declaration | default_declaration | foreign_declaration | type_family_declaration | deriving_declaration | type_instance_declaration | type_signature | other_pragma | quasi_quote | qq_expression | expression | cfiles_pragma | fixity_declaration -type_declaration ::= TYPE osnl simpletype osnl COLON_COLON osnl ttype | - TYPE osnl simpletype osnl (EQUAL | WHERE) osnl ttype (DOUBLE_RIGHT_ARROW ttype)? | - TYPE osnl simpletype osnl (EQUAL | WHERE) osnl type_signature (DOUBLE_RIGHT_ARROW ttype)? | - TYPE osnl simpletype osnl EQUAL osnl expression | - TYPE osnl simpletype osnl LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN EQUAL osnl ttype | - TYPE osnl simpletype - -data_declaration ::= DATA osnl simpletype osnl (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ osnl qvar* osnl data_declaration_deriving? | - DATA osnl (LEFT_PAREN osnl kind_signature osnl RIGHT_PAREN)+ osnl simpletype osnl qvar* osnl data_declaration_deriving? | - DATA osnl ctype_pragma? osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl constrs osnl data_declaration_deriving? | - DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl WHERE osnl cdecls osnl data_declaration_deriving? | - DATA osnl INSTANCE? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype+ osnl (EQUAL osnl expression | EQUAL osnl simpletype+)? osnl data_declaration_deriving? +type_declaration ::= TYPE onls simpletype onls COLON_COLON onls ttype | + TYPE onls simpletype onls (EQUAL | WHERE) onls (ttype | type_signature) (DOUBLE_RIGHT_ARROW ttype)? | + TYPE onls simpletype onls EQUAL onls expression | + TYPE onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls EQUAL onls ttype | + TYPE onls simpletype -kind_signature ::= var_id COLON_COLON ttype +data_declaration ::= DATA onls ctype_pragma? onls INSTANCE? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls q_name* onls EQUAL + onls (scontext onls DOUBLE_RIGHT_ARROW)? onls constrs onls data_declaration_deriving? | + DATA onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls simpletype onls (LEFT_PAREN onls kind_signature onls RIGHT_PAREN)* onls q_name* onls data_declaration_deriving? | + DATA onls INSTANCE? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls q_name* onls (WHERE | EQUAL) onls cdecls onls data_declaration_deriving? -data_declaration_deriving ::= (DERIVING ttype osnl | DERIVING LEFT_PAREN ttype (osnl COMMA osnl ttype)* RIGHT_PAREN osnl)+ +kind_signature ::= q_name COLON_COLON ttype -newtype_declaration ::= NEWTYPE osnl ctype_pragma? osnl (context osnl DOUBLE_RIGHT_ARROW)? osnl simpletype osnl EQUAL osnl newconstr osnl (DERIVING osnl ttype)? +data_declaration_deriving ::= (DERIVING ttype onls | DERIVING LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN onls)+ -class_declaration ::= (CLASS osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl - (qvar | LEFT_PAREN type_signature RIGHT_PAREN)* - (osnl VERTICAL_BAR osnl ttype (osnl COMMA osnl ttype)*)? osnl WHERE? osnl cdecls? | - CLASS osnl context osnl DOUBLE_RIGHT_ARROW osnl qcon osnl qvar osnl WHERE? osnl cdecls?) // seen in Control.Lens.Internal.Indexed +newtype_declaration ::= NEWTYPE onls INSTANCE? onls ctype_pragma? onls (context onls DOUBLE_RIGHT_ARROW)? onls simpletype onls EQUAL onls newconstr onls (DERIVING onls ttype)? -instance_declaration ::= INSTANCE osnl (overlap_pragma | "OVERLAPPABLE_" | "OVERLAPPING_")? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst osnl WHERE osnl idecls - | INSTANCE osnl overlap_pragma? osnl (var_id+ DOT)? osnl (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst -default_declaration ::= DEFAULT osnl (LEFT_PAREN (ttype (COMMA ttype)*)? RIGHT_PAREN | type_signature) -type_instance_declaration ::= TYPE_INSTANCE osnl expression -type_signature ::= vars osnl COLON_COLON osnl ((ttype | context) DOUBLE_RIGHT_ARROW)? osnl ttype | - var_id osnl LEFT_PAREN osnl vars osnl COMMA osnl scontext osnl DOUBLE_RIGHT_ARROW osnl ttype osnl RIGHT_PAREN // seen in Test.Hspec.Expectations: with_loc(shouldBe, (Show a, Eq a) => a -> a -> Expectation) -fixity_declaration ::= fixity (DECIMAL)? ops +class_declaration ::= CLASS onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name+ onls (q_name | LEFT_PAREN ttype (onls COMMA onls ttype)* RIGHT_PAREN)* + (onls VERTICAL_BAR onls ttype (onls COMMA onls ttype)*)? onls WHERE? onls cdecls? | + CLASS onls scontext onls DOUBLE_RIGHT_ARROW onls q_name+ onls WHERE? onls cdecls? // seen in Control.Lens.Internal.Indexed -foreign_declaration ::= (FOREIGN_IMPORT | FOREIGN_EXPORT) osnl expression -type_family_declaration ::= TYPE_FAMILY osnl type_family_type osnl WHERE? osnl expression? -deriving_declaration ::= DERIVING INSTANCE (scontext osnl DOUBLE_RIGHT_ARROW)? osnl qcon osnl inst +instance_declaration ::= INSTANCE onls (overlap_pragma | "OVERLAPPABLE_" | "OVERLAPPING_")? onls (var_con+ DOT)? onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst onls WHERE onls idecls | + INSTANCE onls overlap_pragma? onls (q_name+ DOT)? onls (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst -literal ::= DECIMAL | HEXADECIMAL | OCTAL | FLOAT | CHARACTER_LITERAL | STRING_LITERAL +default_declaration ::= DEFAULT onls (LEFT_PAREN (ttype (COMMA ttype)*)? RIGHT_PAREN | type_signature) + +type_instance_declaration ::= TYPE_INSTANCE onls expression + +type_signature ::= q_names onls COLON_COLON onls (context DOUBLE_RIGHT_ARROW)? onls ttype | + q_names onls LEFT_PAREN onls q_names onls COMMA onls scontext onls DOUBLE_RIGHT_ARROW onls ttype onls RIGHT_PAREN // seen in Test.Hspec.Expectations: with_loc(shouldBe, (Show a, Eq a) => a -> a -> Expectation) + +fixity_declaration ::= fixity (DECIMAL)? q_names + +foreign_declaration ::= (FOREIGN_IMPORT | FOREIGN_EXPORT) onls expression + +type_family_declaration ::= TYPE_FAMILY onls type_family_type onls WHERE? onls expression? + +deriving_declaration ::= DERIVING INSTANCE (scontext onls DOUBLE_RIGHT_ARROW)? onls q_name onls inst + + +private literal ::= DECIMAL | HEXADECIMAL | OCTAL | FLOAT | CHARACTER_LITERAL | STRING_LITERAL private onl ::= NEWLINE* // optional new lines -private osnl ::= (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)* // optional multiple new line and spaces -snl ::= (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)+ // multiple new line and spaces +private onls ::= (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE)* // optional multiple new line and spaces +private nls ::= (LEFT_BRACE? RIGHT_BRACE? SEMICOLON? BACKSLASH? &<> NEWLINE) // one new line and spaces comments ::= COMMENT | NCOMMENT | NCOMMENT_START | NCOMMENT_END // rule is necessary to refer to various comment types in code -qualifier ::= (CONID_ID DOT)+ CONID_ID | CONID_ID -mod_id ::= (CONID_ID DOT)+ CONID_ID | CONID_ID +modid ::= (CON_ID DOT)* CON_ID {pin=1 recoverWhile=modid_recover_rule} +private modid_recover_rule ::= DOT -var_id ::= VARID_ID -qvar_id ::= qualifier DOT var_id +varid ::= VAR_ID +conid ::= CON_ID +varsym ::= VARSYM_ID | TILDE | DOT VARSYM_ID | DOT CONSYM_ID | DOT +consym ::= CONSYM_ID -con_id ::= CONID_ID | LEFT_BRACKET var_id? RIGHT_BRACKET | LEFT_PAREN COMMA* RIGHT_PAREN -qcon_id ::= qcon_id_qualifier con_id -qcon_id_qualifier ::= (CONID_ID DOT)+ +cname ::= var | con | conop | varop +var ::= varid | LEFT_PAREN varsym RIGHT_PAREN +con ::= conid | LEFT_PAREN consym RIGHT_PAREN +varop ::= varsym | BACKQUOTE varid BACKQUOTE +conop ::= consym | BACKQUOTE conid BACKQUOTE -var_sym ::= VARSYM_ID | TILDE | DOT // added tilde because: data (~) a b = Eq# ((~#) a b) in Types.hs in ghc-prim -qvar_sym ::= qualifier DOT var_sym +var_con ::= varid | consym | varsym | conid +q_var_con ::= qualifier DOT (varid | consym | DOT? varsym) | q_con -con_sym ::= CONSYM_ID -qcon_sym ::= qualifier DOT con_sym -gcon_sym ::= con_sym | qcon_sym {methods=[getName getIdentifierElement]} +qualifier ::= CON_ID (DOT CON_ID)* -qvar ::= qvar_id | LEFT_PAREN qvar_sym RIGHT_PAREN | var_id | LEFT_PAREN var_sym RIGHT_PAREN // qualified variables and type variables -qcon ::= qcon_id | LEFT_PAREN gcon_sym RIGHT_PAREN | con_id | LEFT_PAREN con_sym RIGHT_PAREN // qualified constructors, type constructors, modules and type classes +q_con ::= q_con_qualifier4 DOT conid | q_con_qualifier3 DOT conid | q_con_qualifier2 DOT conid | q_con_qualifier1 DOT conid +q_con_qualifier4 ::= CON_ID DOT CON_ID DOT CON_ID DOT CON_ID +q_con_qualifier3 ::= CON_ID DOT CON_ID DOT CON_ID +q_con_qualifier2 ::= CON_ID DOT CON_ID +q_con_qualifier1 ::= CON_ID +q_con_qualifier ::= q_con_qualifier4 | q_con_qualifier3 | q_con_qualifier2 | q_con_qualifier1 // used for renaming -qvar_op ::= qvar_sym | BACKQUOTE qvar_id BACKQUOTE | var_sym | BACKQUOTE var_id BACKQUOTE // qualified variable operator -qcon_op ::= gcon_sym | BACKQUOTE qcon_id BACKQUOTE | con_sym | BACKQUOTE con_id BACKQUOTE // qualified constructor operator +q_name ::= q_var_con | var_con | LEFT_PAREN q_var_con RIGHT_PAREN | LEFT_PAREN var_con RIGHT_PAREN | BACKQUOTE q_var_con BACKQUOTE | BACKQUOTE var_con BACKQUOTE +q_names ::= q_name (COMMA q_name)* -vars ::= qvar (COMMA qvar)* +gtycon ::= QUOTE? q_name | LEFT_PAREN RIGHT_ARROW RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN | QUOTE? LEFT_BRACKET RIGHT_BRACKET | LEFT_PAREN COMMA (COMMA)* RIGHT_PAREN -op ::= qvar_op | qcon_op {methods=[getName getIdentifierElement]} -ops ::= op (COMMA op)* - -gtycon ::= QUOTE? qcon | LEFT_PAREN RIGHT_ARROW RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN | QUOTE? LEFT_BRACKET RIGHT_BRACKET |LEFT_PAREN COMMA (COMMA)* RIGHT_PAREN - -cname ::= qvar | qcon | qcon_op | qvar_op - -private constrs ::= constr (osnl VERTICAL_BAR osnl constr)* +private constrs ::= constr (onls VERTICAL_BAR onls constr)* private constr ::= (constr1 | constr2 | constr3 | constr4) -constr1 ::= unpack_nounpack_pragma? qcon onl unpack_nounpack_pragma? onl LEFT_BRACE onl (onl fielddecl (onl COMMA? onl fielddecl)*)? onl RIGHT_BRACE -constr2 ::= unpack_nounpack_pragma? sub_constr2 osnl unpack_nounpack_pragma? qcon_op osnl sub_constr2 -constr3 ::= unpack_nounpack_pragma? qcon osnl (unpack_nounpack_pragma? qvar_op? osnl atype osnl)* -constr4 ::= unpack_nounpack_pragma? qvar gcon_sym unpack_nounpack_pragma? qcon // added because second data constructor in: data [] a = [] | a : [a] in Types.hs in ghc-prim -sub_constr2 ::= (btype | qvar_op atype) +constr1 ::= unpack_nounpack_pragma? q_name onl unpack_nounpack_pragma? onl LEFT_BRACE onl (onl fielddecl (onl COMMA? onl fielddecl)*)? onl RIGHT_BRACE +constr2 ::= unpack_nounpack_pragma? q_name onls (unpack_nounpack_pragma? onls atype onls)* +constr3 ::= unpack_nounpack_pragma? sub_constr2 onls unpack_nounpack_pragma? q_name onls unpack_nounpack_pragma? onls sub_constr2 +constr4 ::= unpack_nounpack_pragma? q_name+ unpack_nounpack_pragma? q_name // added because second data constructor in: data [] a = [] | a : [a] in Types.hs in ghc-prim +sub_constr2 ::= (btype | q_name atype) -fielddecl ::= vars (COLON_COLON unpack_nounpack_pragma? (ttype | qvar_op atype))? +fielddecl ::= q_names (COLON_COLON unpack_nounpack_pragma? (ttype | q_name atype))? -private atype ::= "forall" (qvar | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT | // forall - LEFT_PAREN qvar TILDE qvar RIGHT_PAREN (DOUBLE_RIGHT_ARROW ttype)? | - LEFT_PAREN osnl var_sym? osnl ttype (osnl COMMA osnl ttype)+ osnl var_sym? osnl RIGHT_PAREN | // var_sym? is optional # - QUOTE? LEFT_BRACKET osnl ttype osnl RIGHT_BRACKET | - LEFT_PAREN osnl ttype+ osnl RIGHT_PAREN | - gtycon | qvar +private atype ::= "forall" (q_name | ttype | LEFT_PAREN type_signature RIGHT_PAREN)+ DOT | + LEFT_PAREN onls ttype+ onls RIGHT_PAREN | + LEFT_PAREN onls ttype (onls COMMA onls ttype)+ onls q_name? onls RIGHT_PAREN | // q_name? is optional # + QUOTE? LEFT_BRACKET onls ttype? onls RIGHT_BRACKET | + q_name | LEFT_PAREN type_signature? RIGHT_PAREN - -ttype ::= btype (osnl RIGHT_ARROW osnl ttype)? | list_type var_id* +ttype ::= btype (onls RIGHT_ARROW onls ttype)? | list_type q_name* private btype ::= atype+ // generalization because left recursive is not supported -simpletype ::= qcon_op var_id* | - qcon var_id* | - ttype | - var_id* osnl (LEFT_PAREN qvar_op RIGHT_PAREN | LEFT_PAREN gcon_sym RIGHT_PAREN) osnl var_id* | - qcon osnl var_id* osnl (LEFT_PAREN type_signature RIGHT_PAREN)+ osnl var_id* {methods=[getIdentifierElements]} +simpletype ::= ttype | (q_name | LEFT_PAREN RIGHT_PAREN)+ | + q_name* onls LEFT_PAREN q_name RIGHT_PAREN onls q_name* | + q_name onls q_name* onls (LEFT_PAREN type_signature RIGHT_PAREN)+ onls q_name* | + q_name | LEFT_PAREN RIGHT_PAREN | LEFT_BRACKET RIGHT_BRACKET q_name* {methods=[getIdentifierElements]} -list_type ::= LEFT_BRACKET (COLON_COLON | VARSYM_ID) RIGHT_BRACKET +list_type ::= LEFT_BRACKET (COLON_COLON | q_name) RIGHT_BRACKET -type_family_type ::= (type_family_type1 | type_family_type2 | LEFT_PAREN? vars COLON_COLON? osnl (context DOUBLE_RIGHT_ARROW)? osnl ttype? RIGHT_PAREN?)+ (COLON_COLON osnl ttype)? -type_family_type1 ::= qcon -type_family_type2 ::= qvar_op +type_family_type ::= (q_name | LEFT_PAREN? q_names COLON_COLON? onls (context DOUBLE_RIGHT_ARROW)? onls ttype? RIGHT_PAREN?)+ (COLON_COLON onls ttype)? -context ::= LEFT_PAREN osnl (clazz (osnl COMMA osnl clazz)*)? osnl RIGHT_PAREN | +context ::= LEFT_PAREN onls clazz (onls COMMA onls clazz)* onls RIGHT_PAREN | clazz -clazz ::= qcon qvar+ | - qcon LEFT_PAREN qvar atype+ RIGHT_PAREN | - qcon LEFT_PAREN qcon qvar RIGHT_PAREN +clazz ::= q_name COLON_COLON q_name | + q_name+ | + q_name LEFT_PAREN q_name atype+ RIGHT_PAREN | + q_name LEFT_PAREN q_name+ RIGHT_PAREN q_name* -scontext ::= simpleclass? osnl LEFT_PAREN osnl simpleclass (osnl COMMA osnl simpleclass)* osnl RIGHT_PAREN | - simpleclass +scontext ::= simpleclass | simpleclass onls LEFT_PAREN onls simpleclass (onls COMMA onls simpleclass)* onls RIGHT_PAREN -simpleclass ::= simpleclass_tilde_part TILDE simpleclass_tilde_part | - LEFT_PAREN simpleclass_tilde_part TILDE simpleclass_tilde_part RIGHT_PAREN | - qcon+ LEFT_PAREN (qvar | qcon_op | qcon)+ RIGHT_PAREN qvar* | - qcon+ qvar+ | - atype +simpleclass ::= ttype | q_name+ LEFT_PAREN q_name+ RIGHT_PAREN q_name* | q_name+ -simpleclass_tilde_part ::= QUOTE? ((qcon LEFT_PAREN qcon qvar RIGHT_PAREN)? qvar+ | qcon qvar*) - -inst ::= qvar gtycon | - gtycon? instvar* (LEFT_PAREN osnl gtycon (instvar)* osnl RIGHT_PAREN)+ instvar* | +inst ::= q_name gtycon | + gtycon? instvar* (LEFT_PAREN onls gtycon (instvar)* onls RIGHT_PAREN)+ instvar* | gtycon+ instvar* | - qvar instvar* | - (LEFT_PAREN osnl instvar (osnl COMMA osnl instvar)+ osnl RIGHT_PAREN)+ instvar* | - QUOTE? (LEFT_BRACKET osnl instvar osnl RIGHT_BRACKET)+ instvar* | - (LEFT_PAREN osnl instvar+ osnl RIGHT_PAREN)+ instvar* | - (LEFT_PAREN osnl instvar+ (RIGHT_ARROW osnl instvar* osnl)* osnl RIGHT_PAREN)+ instvar* | + q_name instvar* | + (LEFT_PAREN onls instvar (onls COMMA onls instvar)+ onls RIGHT_PAREN)+ instvar* | + QUOTE? (LEFT_BRACKET onls instvar onls RIGHT_BRACKET)+ instvar* | + (LEFT_PAREN onls instvar+ onls RIGHT_PAREN)+ instvar* | + (LEFT_PAREN onls instvar+ (RIGHT_ARROW onls instvar* onls)* onls RIGHT_PAREN)+ instvar* | ttype -instvar ::= qcon | qvar | gcon_sym | LEFT_BRACKET qvar RIGHT_BRACKET | LEFT_PAREN qvar? (gcon_sym | qcon) qvar? RIGHT_PAREN | - LEFT_PAREN RIGHT_PAREN +instvar ::= q_name | LEFT_BRACKET q_name+ RIGHT_BRACKET | LEFT_PAREN q_name+ RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN -fixity ::= INFIXL | INFIXR | INFIX +private fixity ::= INFIXL | INFIXR | INFIX -exports ::= LEFT_PAREN onl export? (onl COMMA? onl export onl)* onl COMMA? onl RIGHT_PAREN -export ::= export1 | export2 | export3 -private export1 ::= TYPE? onl (qvar | qvar_op) -private export2 ::= qcon onl (dot_dot_parens | LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN)? -private export3 ::= MODULE mod_id +exports ::= LEFT_PAREN onl export (onl COMMA? onl export onl)* onl COMMA? onl RIGHT_PAREN | LEFT_PAREN RIGHT_PAREN +export ::= export3 | export1 | export2 | export4 +private export3 ::= (q_con | conid) onl LEFT_PAREN onl (cname onl (onl COMMA onl cname)*)? onl RIGHT_PAREN +private export1 ::= cname dot_dot_parens +private export2 ::= TYPE? onl cname +private export4 ::= MODULE modid -newconstr ::= qcon atype | newconstr_fielddecl -newconstr_fielddecl ::= qcon osnl LEFT_BRACE? osnl qvar osnl COLON_COLON osnl ttype osnl RIGHT_BRACE? +newconstr ::= q_name atype | newconstr_fielddecl +newconstr_fielddecl ::= q_name onls LEFT_BRACE? onls q_name onls COLON_COLON onls ttype onls RIGHT_BRACE? -private cdecls ::= (cdecl | expression) (osnl (cdecl | expression))* +private cdecls ::= (cdecl | expression) (onls (cdecl | expression))* cdecl ::= minimal_pragma | type_signature | cidecl -private idecls ::= (idecl | expression) (osnl (idecl | expression))* +private idecls ::= (idecl | expression) (onls (idecl | expression))* idecl ::= cidecl private cidecl ::= inline_pragma | noinline_pragma | specialize_pragma | type_declaration | instance_declaration | default_declaration | newtype_declaration | data_declaration -expression ::= first_line_expression (line_expression)* last_line_expression | last_line_expression -first_line_expression ::= general_id+ snl -line_expression ::= NEWLINE* general_id+ snl -last_line_expression ::= general_id+ osnl +expression ::= line_expression+ last_line_expression | last_line_expression +private line_expression ::= general_id+ nls +private last_line_expression::= general_id+ -private general_id ::= (qvar_op | qcon_op | qvar | qcon | LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | +private general_id ::= (q_name | LEFT_PAREN | RIGHT_PAREN | FLOAT | DO | WHERE | IF | THEN | ELSE | COLON_COLON | DOUBLE_RIGHT_ARROW | RIGHT_ARROW | IN | CASE | OF | LET | SEMICOLON | LEFT_ARROW | LEFT_BRACKET | RIGHT_BRACKET | literal | LEFT_BRACE | RIGHT_BRACE | - COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | fixity | DOT) + COMMA | UNDERSCORE | symbol_reserved_op | QUOTE | BACKQUOTE | fixity | DOT_DOT | scc_pragma) -private symbol_reserved_op ::= AT | BACKSLASH | VERTICAL_BAR | TILDE | EQUAL | COLON +private symbol_reserved_op ::= AT | BACKSLASH | VERTICAL_BAR | TILDE | EQUAL qq_expression ::= general_id+ NEWLINE? quasi_quote quasi_quote ::= QUASI_QUOTE_D_START NEWLINE? top_declarations NEWLINE? QUASI_QUOTE_END | diff --git a/src/main/scala/intellij/haskell/highlighter/HaskellBraceMatcher.scala b/src/main/scala/intellij/haskell/highlighter/HaskellBraceMatcher.scala index 64be3541..3b60a28b 100644 --- a/src/main/scala/intellij/haskell/highlighter/HaskellBraceMatcher.scala +++ b/src/main/scala/intellij/haskell/highlighter/HaskellBraceMatcher.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/intellij/haskell/highlighter/HaskellColorSettingsPage.scala b/src/main/scala/intellij/haskell/highlighter/HaskellColorSettingsPage.scala index d181287f..f953f36e 100644 --- a/src/main/scala/intellij/haskell/highlighter/HaskellColorSettingsPage.scala +++ b/src/main/scala/intellij/haskell/highlighter/HaskellColorSettingsPage.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,18 +76,19 @@ class HaskellColorSettingsPage extends ColorSettingsPage { @NotNull def getDemoText: String = { "{-# LANGUAGE CPP #-}\n" + - "module ModuleName\n" + - "import ImportModuleName\n" + - "\"string literal\"\n" + - "'c'\n" + - "x = (456,434)\n" + - "-- line comment\n" + - "{- nested \n" + - "comment -}\n" + - "data Bool = True | False\n" + - "let l1 = [1, 2] \n" + - "let l2 = 1 : [] \n" + - "let two = 1 + 1" + "module ModuleName\n" + + "import ImportModuleName\n" + + "\"string literal\"\n" + + "'c'\n" + + "x = (456,434)\n" + + "-- line comment\n" + + "{- nested \n" + + "comment -}\n" + + "data Bool = True | False\n" + + "let l1 = [1, 2] \n" + + "let l2 = 1 : [] \n" + + "let two = 1 + 1 \n" + + """let f = \_ + 1""" } @NotNull diff --git a/src/main/scala/intellij/haskell/highlighter/HaskellSyntaxHighlighter.scala b/src/main/scala/intellij/haskell/highlighter/HaskellSyntaxHighlighter.scala index 40f2b4ad..ca875091 100644 --- a/src/main/scala/intellij/haskell/highlighter/HaskellSyntaxHighlighter.scala +++ b/src/main/scala/intellij/haskell/highlighter/HaskellSyntaxHighlighter.scala @@ -18,8 +18,8 @@ package intellij.haskell.highlighter import com.intellij.lexer.Lexer import com.intellij.openapi.editor.DefaultLanguageHighlighterColors +import com.intellij.openapi.editor.colors.TextAttributesKey import com.intellij.openapi.editor.colors.TextAttributesKey.createTextAttributesKey -import com.intellij.openapi.editor.colors.{CodeInsightColors, TextAttributesKey} import com.intellij.openapi.fileTypes.SyntaxHighlighterBase import com.intellij.psi.TokenType import com.intellij.psi.tree.IElementType @@ -39,10 +39,10 @@ object HaskellSyntaxHighlighter { final val Bracket = createTextAttributesKey("HS_BRACKET", DefaultLanguageHighlighterColors.BRACKETS) final val Variable = createTextAttributesKey("HS_VARIABLE", DefaultLanguageHighlighterColors.LOCAL_VARIABLE) final val Constructor = createTextAttributesKey("HS_CONSTRUCTOR", DefaultLanguageHighlighterColors.INSTANCE_FIELD) - final val Operator = createTextAttributesKey("HS_OPERATOR", CodeInsightColors.TYPE_PARAMETER_NAME_ATTRIBUTES) - final val ReservedSymbol = createTextAttributesKey("HS_SYMBOL", DefaultLanguageHighlighterColors.INSTANCE_METHOD) - final val Pragma = createTextAttributesKey("HS_PRAGMA", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) - final val Default = createTextAttributesKey("HS_DEFAULT", DefaultLanguageHighlighterColors.COMMA) + final val Operator = createTextAttributesKey("HS_OPERATOR", DefaultLanguageHighlighterColors.OPERATION_SIGN) + final val ReservedSymbol = createTextAttributesKey("HS_SYMBOL", DefaultLanguageHighlighterColors.PREDEFINED_SYMBOL) + final val Pragma = createTextAttributesKey("HS_PRAGMA", DefaultLanguageHighlighterColors.METADATA) + final val Default = createTextAttributesKey("HS_DEFAULT", DefaultLanguageHighlighterColors.LOCAL_VARIABLE) } class HaskellSyntaxHighlighter extends SyntaxHighlighterBase { @@ -72,8 +72,9 @@ class HaskellSyntaxHighlighter extends SyntaxHighlighterBase { case et if ALL_RESERVED_IDS.contains(et) => pack(Keyword) case et if SYMBOLS_RES_OP.contains(et) => pack(ReservedSymbol) case et if OPERATORS.contains(et) => pack(Operator) - case et if et == HS_VARID_ID => pack(Variable) - case et if et == HS_CONID_ID => pack(Constructor) + case et if et == HS_VAR_ID => pack(Variable) + case et if et == HS_CON_ID => pack(Constructor) + case et if et == HS_MODID => pack(Constructor) case et if WHITE_SPACES.contains(et) || et == HS_NEWLINE => pack(null) case _ => pack(Default) } diff --git a/src/main/scala/intellij/haskell/inspection/HlintInspectionTool.scala b/src/main/scala/intellij/haskell/inspection/HLintInspectionTool.scala similarity index 50% rename from src/main/scala/intellij/haskell/inspection/HlintInspectionTool.scala rename to src/main/scala/intellij/haskell/inspection/HLintInspectionTool.scala index c14d3588..aca16b78 100644 --- a/src/main/scala/intellij/haskell/inspection/HlintInspectionTool.scala +++ b/src/main/scala/intellij/haskell/inspection/HLintInspectionTool.scala @@ -18,44 +18,43 @@ package intellij.haskell.inspection import com.intellij.codeInspection._ import com.intellij.psi.{PsiElement, PsiFile, TokenType} -import intellij.haskell.HaskellNotificationGroup -import intellij.haskell.external.{Hlint, HlintInfo} -import intellij.haskell.psi.HaskellTypes.{HS_COMMENT, HS_NCOMMENT, HS_NEWLINE, HS_SNL} -import intellij.haskell.settings.HaskellSettingsState -import intellij.haskell.util.LineColumnPosition +import intellij.haskell.external.{HLintComponent, HLintInfo} +import intellij.haskell.psi.HaskellTypes.{HS_COMMENT, HS_NCOMMENT, HS_NEWLINE} +import intellij.haskell.util.{HaskellProjectUtil, LineColumnPosition} import scala.annotation.tailrec -class HlintInspectionTool extends LocalInspectionTool { +class HLintInspectionTool extends LocalInspectionTool { + override def checkFile(psiFile: PsiFile, manager: InspectionManager, isOnTheFly: Boolean): Array[ProblemDescriptor] = { - val problemsHolder = new ProblemsHolder(manager, psiFile, isOnTheFly) - if (HaskellSettingsState.getHlintPath.isEmpty) { - HaskellNotificationGroup.notifyWarning("Can not run HLint. Configure path to HLint in Haskell Settings") - problemsHolder.getResultsArray - } else { - val hlintInfos = Hlint.check(psiFile) - for { - hi <- hlintInfos - se <- findStartHaskellElement(psiFile, hi) - ee <- findEndHaskellElement(psiFile, hi) - } yield - hi.to match { - case Some(to) => problemsHolder.registerProblem( - new ProblemDescriptorBase(se, ee, hi.hint, Array(new HlintQuickfix(se, ee, to, hi.note)), findProblemHighlightType(hi), false, null, true, isOnTheFly)) - case None => problemsHolder.registerProblem( - new ProblemDescriptorBase(se, ee, hi.hint, Array(), findProblemHighlightType(hi), false, null, true, isOnTheFly)) - } - problemsHolder.getResultsArray + if (!HaskellProjectUtil.isProjectFile(psiFile)) { + return Array() } + + val problemsHolder = new ProblemsHolder(manager, psiFile, isOnTheFly) + val hlintInfos = HLintComponent.check(psiFile) + for { + hi <- hlintInfos + se <- findStartHaskellElement(psiFile, hi) + ee <- findEndHaskellElement(psiFile, hi) + } yield + hi.to match { + case Some(to) => problemsHolder.registerProblem( + new ProblemDescriptorBase(se, ee, hi.hint, Array(new HLintQuickfix(se, ee, to, hi.note)), findProblemHighlightType(hi), false, null, true, isOnTheFly) + ) + case None => problemsHolder.registerProblem( + new ProblemDescriptorBase(se, ee, hi.hint, Array(), findProblemHighlightType(hi), false, null, true, isOnTheFly)) + } + problemsHolder.getResultsArray } - private def findStartHaskellElement(psiFile: PsiFile, hlintInfo: HlintInfo) = { - val startOffset = LineColumnPosition.getOffset(psiFile, LineColumnPosition(hlintInfo.startLine, hlintInfo.startColumn)) - val element = startOffset.flatMap(offset => Option(psiFile.findElementAt(offset))) - element.filterNot(HlintInspectionTool.NotHaskellIdentifiers.contains(_)) + private def findStartHaskellElement(psiFile: PsiFile, hlintInfo: HLintInfo): Option[PsiElement] = { + val offset = LineColumnPosition.getOffset(psiFile, LineColumnPosition(hlintInfo.startLine, hlintInfo.startColumn)) + val element = offset.flatMap(offset => Option(psiFile.findElementAt(offset))) + element.filterNot(e => HLintInspectionTool.NotHaskellIdentifiers.contains(e.getNode.getElementType)) } - private def findEndHaskellElement(psiFile: PsiFile, hlintInfo: HlintInfo): Option[PsiElement] = { + private def findEndHaskellElement(psiFile: PsiFile, hlintInfo: HLintInfo): Option[PsiElement] = { val endOffset = if (hlintInfo.endLine >= hlintInfo.startLine && hlintInfo.endColumn > hlintInfo.startColumn) { LineColumnPosition.getOffset(psiFile, LineColumnPosition(hlintInfo.endLine, hlintInfo.endColumn - 1)) } else { @@ -67,20 +66,21 @@ class HlintInspectionTool extends LocalInspectionTool { @tailrec private def findHaskellIdentifier(psiFile: PsiFile, offset: Int): Option[PsiElement] = { Option(psiFile.findElementAt(offset)) match { - case Some(e) if HlintInspectionTool.NotHaskellIdentifiers.contains(e.getNode.getElementType) => findHaskellIdentifier(psiFile, offset - 1) - case maybeElement => maybeElement + case None => findHaskellIdentifier(psiFile, offset - 1) + case Some(e) if HLintInspectionTool.NotHaskellIdentifiers.contains(e.getNode.getElementType) => findHaskellIdentifier(psiFile, offset - 1) + case e => e } } - private def findProblemHighlightType(hlintInfo: HlintInfo) = { + private def findProblemHighlightType(hlintInfo: HLintInfo) = { hlintInfo.severity match { case "Warning" => ProblemHighlightType.GENERIC_ERROR_OR_WARNING - case "Error" => ProblemHighlightType.ERROR - case _ => ProblemHighlightType.INFORMATION + case "Error" => ProblemHighlightType.GENERIC_ERROR + case _ => ProblemHighlightType.GENERIC_ERROR_OR_WARNING } } } -object HlintInspectionTool { - val NotHaskellIdentifiers = Seq(HS_NEWLINE, HS_SNL, HS_COMMENT, HS_NCOMMENT, TokenType.WHITE_SPACE) +object HLintInspectionTool { + val NotHaskellIdentifiers = Seq(HS_NEWLINE, HS_COMMENT, HS_NCOMMENT, TokenType.WHITE_SPACE) } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/inspection/HLintQuickfix.scala b/src/main/scala/intellij/haskell/inspection/HLintQuickfix.scala new file mode 100644 index 00000000..6447a1db --- /dev/null +++ b/src/main/scala/intellij/haskell/inspection/HLintQuickfix.scala @@ -0,0 +1,77 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.inspection + +import com.intellij.codeInspection.LocalQuickFixOnPsiElement +import com.intellij.openapi.command.undo.UndoUtil +import com.intellij.openapi.project.Project +import com.intellij.psi.util.PsiTreeUtil +import com.intellij.psi.{PsiElement, PsiFile} +import intellij.haskell.psi.{HaskellElementFactory, HaskellTypes} +import intellij.haskell.util.OSUtil + +import scala.annotation.tailrec + +class HLintQuickfix(startElement: PsiElement, endElement: PsiElement, toSuggestion: String, note: Seq[String]) extends LocalQuickFixOnPsiElement(startElement, endElement) { + override def getText: String = if (toSuggestion.isEmpty) { + "Remove" + } else { + s"Change to: $toSuggestion ${formatNote(note)}" + } + + override def invoke(project: Project, file: PsiFile, startElement: PsiElement, endElement: PsiElement): Unit = { + val commonParent = PsiTreeUtil.findCommonParent(startElement, endElement) + for { + se <- findDirectChildOfCommonParent(startElement, commonParent) + ee <- findDirectChildOfCommonParent(endElement, commonParent) + } yield { + if (toSuggestion.isEmpty) { + if (Option(ee.getNextSibling).exists(e => e.getNode.getElementType == HaskellTypes.HS_NEWLINE)) { + commonParent.deleteChildRange(se, ee.getNextSibling) + } else { + commonParent.deleteChildRange(se, ee) + } + } else { + Option(se.getNextSibling).foreach { ns => + commonParent.deleteChildRange(ns, ee) + se.replace(HaskellElementFactory.createBody(project, toSuggestion)) + } + } + } + UndoUtil.markPsiFileForUndo(file) + } + + override def getFamilyName: String = "Inspection by HLint" + + @tailrec + private def findDirectChildOfCommonParent(psiElement: PsiElement, parent: PsiElement): Option[PsiElement] = { + Option(psiElement.getParent) match { + case None => None + case Some(p) if p == parent => Some(psiElement) + case _ => findDirectChildOfCommonParent(psiElement.getParent, parent) + } + } + + private def formatNote(note: Seq[String]) = { + val formattedNote = note.map(n => if (n.length > 1 && n.head == '"' && n.last == '"') n.substring(1, n.length - 1) else n).mkString(OSUtil.LineSeparator.toString) + if (formattedNote.trim.isEmpty) { + "" + } else { + " -- " + formattedNote + } + } +} diff --git a/src/main/scala/intellij/haskell/inspection/HlintQuickfix.scala b/src/main/scala/intellij/haskell/inspection/HlintQuickfix.scala deleted file mode 100644 index 994ce33d..00000000 --- a/src/main/scala/intellij/haskell/inspection/HlintQuickfix.scala +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.inspection - -import com.intellij.codeInspection.LocalQuickFixOnPsiElement -import com.intellij.openapi.command.undo.UndoUtil -import com.intellij.openapi.project.Project -import com.intellij.psi.util.PsiTreeUtil -import com.intellij.psi.{PsiElement, PsiFile} -import intellij.haskell.psi.{HaskellElementFactory, HaskellTypes} -import intellij.haskell.util.OSUtil - -import scala.annotation.tailrec - -class HlintQuickfix(startElement: PsiElement, endElement: PsiElement, toSuggestion: String, note: Seq[String]) extends LocalQuickFixOnPsiElement(startElement, endElement) { - override def getText: String = if (toSuggestion.isEmpty) { - "Remove" - } else { - s"Change to: $toSuggestion ${formatNote(note)}" - } - - override def invoke(project: Project, file: PsiFile, startElement: PsiElement, endElement: PsiElement): Unit = { - val parent = PsiTreeUtil.findCommonParent(startElement, endElement) - for { - se <- findParentBelowParent(startElement, parent) - ee <- findParentBelowParent(endElement, parent) - } yield { - if (toSuggestion.isEmpty) { - if (Option(ee.getNextSibling).exists(e => e.getNode.getElementType == HaskellTypes.HS_NEWLINE || e.getNode.getElementType == HaskellTypes.HS_SNL)) { - parent.deleteChildRange(se, ee.getNextSibling) - } else { - parent.deleteChildRange(se, ee) - } - } else { - if (se.getChildren.headOption.exists(_.getText != startElement.getText)) { - // In this case se is parent of startElement (so line expression), for example when startElement is in different line expression - // than line expression of endElement. Common parent is in this case complete expression itself. - - // Delete line expression after line expression of start element - parent.deleteChildRange(findNextHaskellElement(se), ee) - - // Delete elements after start element is same line expression - val startElementParent = startElement.getParent - Option(startElement.getNextSibling).foreach(next => startElementParent.deleteChildRange(next, startElementParent.getLastChild)) - - // Add new line with tab and replace start element by HLint suggestion - startElementParent.addBefore(HaskellElementFactory.createNewLine(project), startElement) - startElementParent.addBefore(HaskellElementFactory.createTab(project), startElement) - startElement.replace(HaskellElementFactory.createBody(project, toSuggestion)) - } else { - parent.deleteChildRange(findParentBelowParent(se.getNextSibling, parent).getOrElse(se), ee) - if (se.getNode.getElementType == HaskellTypes.HS_LEFT_PAREN) { - parent.addBefore(HaskellElementFactory.createWhiteSpace(project), se) - } - se.replace(HaskellElementFactory.createBody(project, toSuggestion)) - } - } - } - UndoUtil.markPsiFileForUndo(file) - } - - override def getFamilyName: String = "Inspection by HLint" - - @tailrec - private def findParentBelowParent(psiElement: PsiElement, parent: PsiElement): Option[PsiElement] = { - Option(psiElement.getParent) match { - case None => None - case Some(p) if p == parent => Some(psiElement) - case _ => findParentBelowParent(psiElement.getParent, parent) - } - } - - private def formatNote(note: Seq[String]) = { - val formattedNote = note.map(n => if (n.length > 1 && n.head == '"' && n.last == '"') n.substring(1, n.length - 1) else n).mkString(OSUtil.LineSeparator.toString) - if (formattedNote.trim.isEmpty) { - "" - } else { - " -- " + formattedNote - } - } - - private def findNextHaskellElement(element: PsiElement): PsiElement = { - val next = element.getNextSibling - if (HlintInspectionTool.NotHaskellIdentifiers.contains(next.getNode.getElementType)) { - findNextHaskellElement(next) - } else { - next - } - } -} diff --git a/src/main/scala/intellij/haskell/module/HaskellModuleBuilder.scala b/src/main/scala/intellij/haskell/module/HaskellModuleBuilder.scala index e01a13b9..0d005476 100644 --- a/src/main/scala/intellij/haskell/module/HaskellModuleBuilder.scala +++ b/src/main/scala/intellij/haskell/module/HaskellModuleBuilder.scala @@ -16,18 +16,36 @@ package intellij.haskell.module +import java.io.File import javax.swing.Icon import com.intellij.ide.util.projectWizard._ +import com.intellij.openapi.Disposable import com.intellij.openapi.module.{Module, ModuleType} +import com.intellij.openapi.progress.{ProgressIndicator, ProgressManager, Task} +import com.intellij.openapi.project.Project import com.intellij.openapi.projectRoots.SdkTypeId -import com.intellij.openapi.roots.ModifiableRootModel -import intellij.haskell.HaskellIcons +import com.intellij.openapi.roots.{ModifiableRootModel, ModuleRootManager, ModuleRootModificationUtil, OrderRootType} +import com.intellij.openapi.ui.Messages +import com.intellij.openapi.util.Pair +import com.intellij.openapi.util.io.FileUtil +import com.intellij.openapi.vfs.{LocalFileSystem, VfsUtil} +import com.intellij.util.Consumer +import intellij.haskell.external.CommandLine import intellij.haskell.sdk.HaskellSdkType +import intellij.haskell.{HaskellIcons, HaskellNotificationGroup} -class HaskellModuleBuilder extends JavaModuleBuilder with SourcePathsBuilder with ModuleBuilderListener { +import scala.collection.JavaConversions._ - override def moduleCreated(module: Module): Unit = {} +class HaskellModuleBuilder extends ModuleBuilder with SourcePathsBuilder with ModuleBuilderListener { + + private[this] val sourcePaths = new java.util.ArrayList[Pair[String, String]]() + + private[this] var isNewProject = false + + override def moduleCreated(module: Module): Unit = { + HaskellModuleBuilder.addLibrarySources(module) + } override def getModuleType: ModuleType[_ <: ModuleBuilder] = HaskellModuleType.getInstance @@ -37,8 +55,201 @@ class HaskellModuleBuilder extends JavaModuleBuilder with SourcePathsBuilder wit override def getNodeIcon: Icon = HaskellIcons.HaskellSmallLogo - override def setupRootModel(rootModel: ModifiableRootModel) { - super.setupRootModel(rootModel) + // TODO: Use Cabal file to get source and test directories + override def setupRootModel(rootModel: ModifiableRootModel): Unit = { addListener(this) + + if (rootModel.getSdk == null) rootModel.setSdk(HaskellSdkType.findOrCreateSdk()) + + val contentEntry = doAddContentEntry(rootModel) + + if (contentEntry != null) { + getSourcePaths.foreach { path => + val folder = Option(LocalFileSystem.getInstance.refreshAndFindFileByPath(FileUtil.toSystemIndependentName(path.first))) + folder.foreach { f => + contentEntry.addSourceFolder(f, false, path.second) + } + } + + getTestSourcePath.foreach { path => + val folder = Option(LocalFileSystem.getInstance.refreshAndFindFileByPath(FileUtil.toSystemIndependentName(path))) + folder.foreach { f => + contentEntry.addSourceFolder(f, true, path) + } + } + + val stackWorkFolder = new File(rootModel.getProject.getBasePath, ".stack-work") + stackWorkFolder.mkdir() + contentEntry.addExcludeFolder(".stack-work") + } + } + + override def setupModule(module: Module): Unit = { + if (isNewProject) { + val configurationUpdater = new ModuleBuilder.ModuleConfigurationUpdater { + + override def update(module: Module, rootModel: ModifiableRootModel): Unit = { + val project = rootModel.getProject + CommandLine.getProcessOutput( + project.getBasePath, + getStackPath(project), + Seq("new", project.getName, "--bare", "hspec") + ) + } + } + val modifiableModel: ModifiableRootModel = ModuleRootManager.getInstance(module).getModifiableModel + configurationUpdater.update(module, modifiableModel) + } + super.setupModule(module) + } + + override def setSourcePaths(sourcePaths: java.util.List[Pair[String, String]]): Unit = { + sourcePaths.clear() + sourcePaths.addAll(sourcePaths) + } + + override def addSourcePath(sourcePathInfo: Pair[String, String]): Unit = { + sourcePaths.add(sourcePathInfo) + } + + override def getSourcePaths: java.util.List[Pair[String, String]] = { + if (sourcePaths.isEmpty) { + val paths = new java.util.ArrayList[Pair[String, String]] + Seq("src", "lib", "app", "library").foreach { dirName => + val path = getContentEntryPath + File.separator + dirName + val srcDir = new File(path) + if (srcDir.isDirectory) { + paths.add(Pair.create(path, "")) + } + } + paths + } else { + sourcePaths + } + } + + // Only called in case new project + override def getCustomOptionsStep(context: WizardContext, parentDisposable: Disposable): ModuleWizardStep = { + isNewProject = true + new HaskellModuleWizardStep(context, this) + } + + private def getTestSourcePath = { + getExistingPath("test") + } + + private def getExistingPath(dirName: String) = { + val path = new File(getContentEntryPath, dirName) + if (path.isDirectory) { + Some(path.getAbsolutePath) + } else { + None + } + } + + private def getStackPath(project: Project) = { + HaskellSdkType.getStackPath(project) match { + case Some(p) => p + case _ => throw new IllegalStateException("Stack path has to be defined here") + } } } + +class HaskellModuleWizardStep(wizardContext: WizardContext, haskellModuleBuilder: HaskellModuleBuilder) extends ProjectJdkForModuleStep(wizardContext, HaskellSdkType.getInstance) { + + override def updateDataModel() { + super.updateDataModel() + haskellModuleBuilder.setModuleJdk(getJdk) + } + + override def validate(): Boolean = { + if (getJdk == null) { + Messages.showErrorDialog("You can not create Haskell project without Stack configured as SDK", "No Haskell Tool Stack specified") + false + } else { + true + } + } +} + +object HaskellModuleBuilder { + + private final val LibName = "ideaHaskellLib" + private final val DependencyPattern = """([\w\-]+)\s([\d\.]+)""".r + private final val InitialProgressStep = 0.1 + private final val GhcPrimVersion = "0.5.0.0" + private final val GhcPrim = "ghc-prim" + + def addLibrarySources(module: Module) = { + val project = module.getProject + val stackPath = HaskellSdkType.getStackPath(project) + stackPath.foreach { sp => + ProgressManager.getInstance().run(new Task.Backgroundable(project, "Downloading Haskell library sources and adding them as source libraries to module") { + def run(progressIndicator: ProgressIndicator) { + val libPath = new File(project.getBasePath + File.separator + LibName) + FileUtil.delete(libPath) + FileUtil.createDirectory(libPath) + val dependencyLines = CommandLine.getProcessOutput(project.getBasePath, sp, Seq("list-dependencies")).getStdoutLines + val packages = getPackages(dependencyLines) + progressIndicator.setFraction(InitialProgressStep) + val downloadedPackages = downloadHaskellPackageSources(project, sp, packages, progressIndicator) + progressIndicator.setFraction(0.9) + addPackagesAsLibrariesToModule(module, downloadedPackages, libPath.getAbsolutePath) + } + }) + } + } + + private def getPackages(dependencyLines: Seq[String]) = { + val packageInfos = dependencyLines.flatMap { + case DependencyPattern(name, version) => Option(HaskellPackageInfo(name, version, s"$name-$version")) + case x => HaskellNotificationGroup.logWarning(s"Could not determine package for line [$x] in output of `stack list-dependencies`"); None + } + + if (packageInfos.exists(_.name == GhcPrim)) { + packageInfos + } else { + packageInfos ++ Seq(HaskellPackageInfo(GhcPrim, GhcPrimVersion, s"$GhcPrim-$GhcPrimVersion")) + } + } + + private def downloadHaskellPackageSources(project: Project, stackPath: String, haskellPackages: Seq[HaskellPackageInfo], progressIndicator: ProgressIndicator) = { + val step = 0.8 / haskellPackages.size + var progressFraction = InitialProgressStep + haskellPackages.flatMap { packageInfo => + val fullName = packageInfo.name + "-" + packageInfo.version + val stdErr = CommandLine.getProcessOutput(project.getBasePath + File.separator + LibName, stackPath, Seq("unpack", fullName), 10000).getStderrLines + progressFraction = progressFraction + step + progressIndicator.setFraction(progressFraction) + + // TODO: Use Cabal file to get project package name instead of catching error to exclude project package from libraries + if (stdErr.exists(_.contains("not found"))) { + Seq() + } else { + Seq(packageInfo) + } + } + } + + private def getUrlByPath(path: String): String = { + VfsUtil.getUrlForLibraryRoot(new File(path)) + } + + private def addPackagesAsLibrariesToModule(module: Module, haskellPackages: Seq[HaskellPackageInfo], libPath: String) { + ModuleRootModificationUtil.updateModel(module, new Consumer[ModifiableRootModel] { + override def consume(t: ModifiableRootModel): Unit = { + val libraryTable = t.getModuleLibraryTable + libraryTable.getLibraries.foreach(l => libraryTable.removeLibrary(l)) + haskellPackages.foreach { hp => + val library = libraryTable.createLibrary(hp.name) + val model = library.getModifiableModel + model.addRoot(getUrlByPath(libPath + File.separator + hp.dirName), OrderRootType.SOURCES) + model.commit() + } + } + }) + } + + private case class HaskellPackageInfo(name: String, version: String, dirName: String) + +} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/module/HaskellModuleType.scala b/src/main/scala/intellij/haskell/module/HaskellModuleType.scala index 1f50999f..08051d0d 100644 --- a/src/main/scala/intellij/haskell/module/HaskellModuleType.scala +++ b/src/main/scala/intellij/haskell/module/HaskellModuleType.scala @@ -18,12 +18,9 @@ package intellij.haskell.module import javax.swing.Icon -import com.intellij.ide.util.projectWizard.{ModuleWizardStep, ProjectJdkForModuleStep, WizardContext} import com.intellij.openapi.module.{Module, ModuleType, ModuleTypeManager, ModuleUtil} import com.intellij.openapi.project.Project -import com.intellij.openapi.roots.ui.configuration.ModulesProvider import intellij.haskell.HaskellIcons -import intellij.haskell.sdk.HaskellSdkType import scala.collection.JavaConversions._ @@ -38,16 +35,6 @@ class HaskellModuleType extends ModuleType[HaskellModuleBuilder](HaskellModuleTy override def getNodeIcon(isOpened: Boolean): Icon = HaskellIcons.HaskellSmallLogo override def getBigIcon: Icon = HaskellIcons.HaskellLogo - - override def createWizardSteps(wizardContext: WizardContext, moduleBuilder: HaskellModuleBuilder, modulesProvider: ModulesProvider): Array[ModuleWizardStep] = { - Array[ModuleWizardStep](new ProjectJdkForModuleStep(wizardContext, HaskellSdkType.getInstance) { - - override def updateDataModel() { - super.updateDataModel() - moduleBuilder.setModuleJdk(getJdk) - } - }) - } } object HaskellModuleType { @@ -57,7 +44,7 @@ object HaskellModuleType { ModuleTypeManager.getInstance.findByID(Id).asInstanceOf[HaskellModuleType] } - def findModules(project: Project): Seq[Module] = { - ModuleUtil.getModulesOfType(project, HaskellModuleType.getInstance).toSeq + def findHaskellProjectModules(project: Project): Iterable[Module] = { + ModuleUtil.getModulesOfType(project, HaskellModuleType.getInstance) } } diff --git a/src/main/scala/intellij/haskell/module/StackProjectImportBuilder.scala b/src/main/scala/intellij/haskell/module/StackProjectImportBuilder.scala new file mode 100644 index 00000000..2b82da3c --- /dev/null +++ b/src/main/scala/intellij/haskell/module/StackProjectImportBuilder.scala @@ -0,0 +1,81 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.module + +import java.io.File +import java.util +import javax.swing.Icon + +import com.intellij.ide.util.projectWizard.ModuleBuilder +import com.intellij.openapi.application.ApplicationManager +import com.intellij.openapi.module.{ModifiableModuleModel, Module, ModuleManager} +import com.intellij.openapi.project.Project +import com.intellij.openapi.roots.ModifiableRootModel +import com.intellij.openapi.roots.ui.configuration.ModulesProvider +import com.intellij.packaging.artifacts.ModifiableArtifactModel +import com.intellij.projectImport.ProjectImportBuilder +import intellij.haskell.HaskellIcons + +import scala.collection.JavaConversions._ + +class StackProjectImportBuilder extends ProjectImportBuilder[Unit] { + override def getName: String = "Haskell Stack importer" + + override def getList: util.List[Unit] = new util.ArrayList[Unit]() + + override def getIcon: Icon = HaskellIcons.HaskellSmallLogo + + override def setOpenProjectSettingsAfter(on: Boolean): Unit = {} + + override def setList(list: util.List[Unit]): Unit = () + + override def isMarked(element: Unit): Boolean = true + + override def commit(project: Project, model: ModifiableModuleModel, modulesProvider: ModulesProvider, artifactModel: ModifiableArtifactModel): java.util.List[Module] = { + val haskellModuleBuilder = HaskellModuleType.getInstance.createModuleBuilder() + val moduleModel = ModuleManager.getInstance(project).getModifiableModel + + ApplicationManager.getApplication.runWriteAction(new Runnable { + override def run(): Unit = { + haskellModuleBuilder.setName(getModuleName) + haskellModuleBuilder.setModuleFilePath(getModuleFilePath) + + haskellModuleBuilder.createModule(moduleModel) + haskellModuleBuilder.commit(project) + haskellModuleBuilder.addModuleConfigurationUpdater(new ModuleBuilder.ModuleConfigurationUpdater { + override def update(module: Module, rootModel: ModifiableRootModel): Unit = { + haskellModuleBuilder.setupRootModel(rootModel) + } + }) + } + }) + + haskellModuleBuilder.moduleCreated(moduleModel.getModules.head) + moduleModel.getModules.toSeq + } + + private def getModuleName: String = { + val moduleDirPath = new File(getFileToImport) + if (moduleDirPath.isDirectory) moduleDirPath.getName + else + throw new IllegalStateException("What to import has to be directory") + } + + private def getModuleFilePath = { + new File(new File(getFileToImport), getModuleName).getAbsolutePath + ".iml" + } +} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/module/StackProjectImportProvider.scala b/src/main/scala/intellij/haskell/module/StackProjectImportProvider.scala new file mode 100644 index 00000000..9d9b5520 --- /dev/null +++ b/src/main/scala/intellij/haskell/module/StackProjectImportProvider.scala @@ -0,0 +1,43 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.module + +import java.io.File + +import com.intellij.ide.util.projectWizard.{ModuleWizardStep, WizardContext} +import com.intellij.openapi.project.Project +import com.intellij.openapi.ui.Messages +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.projectImport.ProjectImportProvider + +class StackProjectImportProvider(builder: StackProjectImportBuilder) extends ProjectImportProvider(builder) { + + override def createSteps(context: WizardContext): Array[ModuleWizardStep] = + Array(new HaskellModuleWizardStep(context, HaskellModuleType.getInstance.createModuleBuilder())) + + override def canImport(fileOrDirectory: VirtualFile, project: Project): Boolean = { + val file = new File(fileOrDirectory.getPath) + if (!file.isDirectory) { + Messages.showInfoMessage(project, "Please select directory of project", "Select directory") + false + } else { + val canImport = file.listFiles().exists(_.getName.endsWith(".cabal")) + if (!canImport) Messages.showInfoMessage(project, "Cannot import Haskell stack project from " + file.getPath, "Cabal file has to exist") + canImport + } + } +} diff --git a/src/main/scala/intellij/haskell/navigate/HaskellReference.scala b/src/main/scala/intellij/haskell/navigate/HaskellReference.scala deleted file mode 100644 index bb848636..00000000 --- a/src/main/scala/intellij/haskell/navigate/HaskellReference.scala +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.navigate - -import com.intellij.codeInsight.lookup.LookupElementBuilder -import com.intellij.openapi.project.Project -import com.intellij.openapi.util.TextRange -import com.intellij.openapi.util.text.StringUtil -import com.intellij.openapi.vfs.LocalFileSystem -import com.intellij.psi._ -import com.intellij.psi.util.PsiTreeUtil -import intellij.haskell.external._ -import intellij.haskell.navigate.HaskellReference._ -import intellij.haskell.psi.HaskellTypes._ -import intellij.haskell.psi._ -import intellij.haskell.util.HaskellElementCondition._ -import intellij.haskell.util.{FileUtil, LineColumnPosition} -import intellij.haskell.{HaskellFile, HaskellIcons} - -import scala.Option.option2Iterable -import scala.annotation.tailrec -import scala.collection.JavaConversions._ - -class HaskellReference(element: HaskellNamedElement, textRange: TextRange) extends PsiPolyVariantReferenceBase[HaskellNamedElement](element, textRange) { - - private lazy val file = myElement.getContainingFile - private lazy val typeInfo = GhcModTypeInfo.findTypeInfoFor(file, myElement) - - private abstract class NoElementToReferResolveResult(val declaration: String) extends ResolveResult { - override def getElement: PsiElement = null - - override def isValidResult: Boolean = false - } - - private class BuiltInResolveResult(declaration: String, val libraryName: String, val module: String) extends NoElementToReferResolveResult(declaration) - - private class NoResolveResult(declaration: String) extends NoElementToReferResolveResult(declaration) - - override def multiResolve(incompleteCode: Boolean): Array[ResolveResult] = { - val project = myElement.getProject - val result = myElement match { - case me: HaskellModId => - (for { - filePath <- FileUtil.findModuleFilePath(me.getText, project) - file <- findFile(filePath) - } yield new HaskellFileResolveResult(file.getOriginalElement)).toArray - case qe: HaskellQualifier => - val importDeclaration = PsiTreeUtil.findChildrenOfType(file, classOf[HaskellImportDeclaration]).find(imd => Option(imd.getImportQualifiedAs).flatMap(qas => Option(qas.getQualifier)).exists(_.getName == qe.getName)) - importDeclaration.map(e => Array(new HaskellLocalResolveResult(e.getImportQualifiedAs.getQualifier))).getOrElse(Array()) - case ne: HaskellNamedElement => - resolveResults(project, ne.getName).toArray - case _ => Array() - } - result.asInstanceOf[Array[ResolveResult]] - } - - override def isReferenceTo(element: PsiElement): Boolean = { - val psiManager = getElement.getManager - val resolveResults = multiResolve(false) - resolveResults.exists(rr => psiManager.areElementsEquivalent(rr.getElement, element)) || - resolveResults.exists(rr => Option(rr.getElement).exists(_.getText == element.getText)) - } - - override def getVariants: Array[AnyRef] = { - val localLookupElements = findLocalNamedElements.flatMap(createLookupElements) - val declarationLookupElements = findDeclarationElementsInFile(file).filterNot(_.getIdentifierElements.contains(myElement)).flatMap(createLookupElements) - (localLookupElements ++ declarationLookupElements).toArray - } - - private def resolveResults(project: Project, identifier: String) = { - val globalResolveResults = getIdentifierInfos(file, myElement).flatMap { - case pi: ProjectIdentifierInfo => resolveProjectReference(pi, identifier).map(new HaskellProjectResolveResult(_)).toIterable - case li: LibraryIdentifierInfo => li.filePath.flatMap(findFile).map(f => resolveDeclarationReferencesInFile(f, li, identifier).map(de => new HaskellLibraryResolveResult(de))).getOrElse(Iterable()) - case bi: BuiltInIdentifierInfo => Iterable(new BuiltInResolveResult(bi.declaration, bi.libraryName, bi.module)) - case gi: NoLocationIdentifierInfo => Iterable(new NoResolveResult(gi.declaration)) - } - - if (globalResolveResults.isEmpty) { - findLocalLhsElements(identifier).map(e => new HaskellLocalResolveResult(e)).toIterable - } else { - globalResolveResults.toSeq.distinct - } - } - - private def createLookupElements(compositeElement: HaskellCompositeElement): Seq[LookupElementBuilder] = { - compositeElement match { - case ne: HaskellNamedElement if ne != null => Seq(LookupElementBuilder.create(ne.getName).withTypeText(GhcModTypeInfo.findTypeInfoFor(ne.getContainingFile, ne).map(ti => StringUtil.unescapeXml(ti.typeSignature)).getOrElse("")).withIcon(HaskellIcons.HaskellSmallBlueLogo)) - case de: HaskellDeclarationElement => for { - ne <- de.getIdentifierElements.toSeq - leb <- Option(ne) match { - case Some(n) => Seq(LookupElementBuilder.create(n.getName).withTypeText(getTypeText(de)).withIcon(de.getPresentation.getIcon(false))) - case None => Seq() - } - } yield leb - } - } - - private def getTypeText(declarationElement: HaskellDeclarationElement) = { - val presentableText = declarationElement.getPresentation.getPresentableText - val typeSignatureDoubleColonIndex = presentableText.indexOf("::") - if (typeSignatureDoubleColonIndex > 0) { - presentableText.drop(typeSignatureDoubleColonIndex + 2).trim - } else { - presentableText - } - } - - private implicit object ElementOrdering extends Ordering[HaskellNamedElement] { - override def compare(x: HaskellNamedElement, y: HaskellNamedElement): Int = { - x.getTextOffset.compare(y.getTextOffset) - } - } - - private def findNamedElementFromDeclaration(psiElement: PsiElement, identifier: String) = { - Option(PsiTreeUtil.findFirstParent(psiElement, DeclarationElementCondition)). - map(_.asInstanceOf[HaskellDeclarationElement]).flatMap(declaration => { - (typeInfo, declaration) match { - case (None, dd: HaskellDataConstructorDeclarationElement) if dd.getDataTypeConstructor.getName == identifier => - Some(dd.getDataTypeConstructor) - case (Some(_), dd: HaskellDataConstructorDeclarationElement) if dd.getIdentifierElements.exists(_.getName == identifier) => - Some(dd.getIdentifierElements.filter(_.getName == identifier).last) - case (_, d) => d.getIdentifierElements.find(_.getName == identifier) - } - }) - } - - private def resolveProjectReference(projectIdentifierInfo: ProjectIdentifierInfo, identifier: String): Option[HaskellNamedElement] = { - for { - filePath <- projectIdentifierInfo.filePath - haskellFile <- findFile(filePath) - offset <- LineColumnPosition.getOffset(haskellFile, LineColumnPosition(projectIdentifierInfo.lineNr, projectIdentifierInfo.colNr)) - element <- Option(haskellFile.findElementAt(offset)) - namedElement <- { - element match { - case ne: HaskellNamedElement => Some(ne) - case qvcoe: HaskellQVarConOpElement => Some(qvcoe.getIdentifierElement) - case e => findQVarConOpElementParent(e).map(_.getIdentifierElement). - orElse(PsiTreeUtil.findChildrenOfType(haskellFile, classOf[HaskellQVarConOpElement]).find(_.getTextOffset == offset).map(_.getIdentifierElement)). - orElse(findNamedElementFromDeclaration(e, identifier)) - } - } - } yield namedElement - } - - private def findFile(filePath: String): Option[HaskellFile] = { - val file = Option(LocalFileSystem.getInstance().findFileByPath(FileUtil.makeFilePathAbsolute(filePath, myElement.getProject))) - file.flatMap(f => Option(PsiManager.getInstance(myElement.getProject).findFile(f)).map(_.asInstanceOf[HaskellFile])) - } - - private def resolveDeclarationReferencesInFile(file: PsiFile, libInfo: LibraryIdentifierInfo, identifier: String): Iterable[HaskellNamedElement] = { - val namedElementInDeclarations = findDeclarationElementsInFile(file).flatMap(de => de.getIdentifierElements.find(ne => ne.getName == identifier)) - if (namedElementInDeclarations.isEmpty) { - PsiTreeUtil.findChildrenOfType(file, classOf[HaskellNamedElement]).find(_.getName == identifier) - } else { - namedElementInDeclarations - } - } - - private def findLocalNamedElements: Iterable[HaskellNamedElement] = { - Option(PsiTreeUtil.getParentOfType(myElement, classOf[HaskellExpression])) match { - case Some(p) => PsiTreeUtil.findChildrenOfType(p, classOf[HaskellNamedElement]).filterNot(_ == myElement) - case None => Iterable() - } - } - - private def nextElementInExpression(element: PsiElement): Option[PsiElement] = { - element.getNode.getElementType match { - case HS_EXPRESSION => None - case _ => Option(element.getNextSibling).flatMap(ns => Option(ns.getNextSibling)) // skip white space - } - } - - private def prevElementInExpression(element: PsiElement): Option[PsiElement] = { - element.getNode.getElementType match { - case HS_EXPRESSION => None - case _ => Option(element.getPrevSibling).flatMap(ps => Option(ps.getPrevSibling)) // skip white space - } - } - - private def findLocalLhsElements(identifier: String) = { - - @tailrec - def currentAndBackwardFind(identifier: String, lineExpression: HaskellLineExpressionElement): Option[HaskellNamedElement] = { - findLocalLhsElementsInLineExpression(identifier, lineExpression) match { - case None => prevElementInExpression(lineExpression) match { - case Some(ne: HaskellLineExpressionElement) => currentAndBackwardFind(identifier, ne) - case _ => None - } - case e => e - } - } - - @tailrec - def forwardFind(identifier: String, lineExpression: HaskellLineExpressionElement): Option[HaskellNamedElement] = { - nextElementInExpression(lineExpression) match { - case Some(pe: HaskellLineExpressionElement) => findLocalLhsElementsInLineExpression(identifier, pe) match { - case None => forwardFind(identifier, pe) - case e => e - } - case _ => None - } - } - - val currentLineExpression = Option(PsiTreeUtil.getParentOfType(myElement, classOf[HaskellLineExpressionElement])) - currentLineExpression.flatMap(cle => currentAndBackwardFind(identifier, cle).orElse(forwardFind(identifier, cle))) - } - - private def findLocalLhsElementsInLineExpression(identifier: String, lineExpression: HaskellLineExpressionElement): Option[HaskellNamedElement] = { - val localElements = PsiTreeUtil.findChildrenOfType(lineExpression, classOf[HaskellQVarConOpElement]) - val sameNameElements = localElements.filter(_.getIdentifierElement.getName == identifier) - val result = sameNameElements.find { e => - isNextSiblingLhsIndicator(e) || - isDirectSiblingConstructor(e) || - isPreviousDirectSiblingBackslash(e) - } - result.map(_.getIdentifierElement) - } - - private def isNextSiblingLhsIndicator(e: PsiElement): Boolean = { - val nextSibling = Option(e.getNextSibling) - nextSibling match { - case Some(ns) if IndicatingLhsTypes.contains(ns.getNode.getElementType) => - true - case Some(ns) if IgnoringTypes.contains(ns.getNode.getElementType) => - isNextSiblingLhsIndicator(ns) - case Some(ns) if ns.getNode.getElementType == HS_SNL => - val nextLineExpressionFirstChild = for { - p <- Option(ns.getParent) - ne <- nextElementInExpression(p) - c <- Option(ne.getFirstChild) - } yield c - - nextLineExpressionFirstChild match { - case Some(nle) if IndicatingLhsTypes.contains(nle.getNode.getElementType) => true - case Some(nle) if IgnoringTypes.contains(nle.getNode.getElementType) => isNextSiblingLhsIndicator(nle) - case _ => false - } - case _ => - false - } - } - - private def isDirectSiblingConstructor(e: PsiElement): Boolean = { - val next = nextElementInExpression(e) - (next match { - case Some(n) if LhsConstructors.contains(n.getNode.getElementType) => true - case _ => false - }) || { - val previous = prevElementInExpression(e) - previous match { - case Some(n) if LhsConstructors.contains(n.getNode.getElementType) => true - case _ => false - } - } - } - - private def isPreviousDirectSiblingBackslash(e: PsiElement): Boolean = { - val previous = Option(e.getPrevSibling) - previous match { - case Some(p) if p.findElementAt(0).getNode.getElementType == HS_BACKSLASH => true - case Some(p) if p.getNode.getElementType == TokenType.WHITE_SPACE | p.getNode.getElementType == HS_QVAR | p.findElementAt(0).getNode.getElementType == HS_UNDERSCORE => isPreviousDirectSiblingBackslash(p) - case _ => false - } - } - - private def findDeclarationElementsInFile(file: PsiFile): Iterable[HaskellDeclarationElement] = { - HaskellPsiHelper.findTopDeclarations(file) - } - - private def getIdentifierInfos(psiFile: PsiFile, namedElement: HaskellNamedElement): Iterable[IdentifierInfo] = { - GhcModInfo.findInfoFor(psiFile, namedElement) - } - - private def findQVarConOpElementParent(element: PsiElement) = { - Option(PsiTreeUtil.findFirstParent(element, QVarConOpElementCondition)).map(_.asInstanceOf[HaskellQVarConOpElement]) - } -} - -class HaskellProjectResolveResult(val element: HaskellNamedElement) extends PsiElementResolveResult(element) - -class HaskellLibraryResolveResult(val element: HaskellNamedElement) extends PsiElementResolveResult(element) - -class HaskellFileResolveResult(val element: PsiElement) extends PsiElementResolveResult(element) - -class HaskellLocalResolveResult(val element: HaskellNamedElement) extends PsiElementResolveResult(element) - -object HaskellReference { - - import intellij.haskell.psi.HaskellTypes._ - - private final val IgnoringTypes = Seq(TokenType.WHITE_SPACE, HS_QVAR, HS_LEFT_PAREN, HS_RIGHT_PAREN, HS_COMMA, HS_RIGHT_BRACKET, HS_QCON, HS_QCON_OP) - private final val IndicatingLhsTypes = Seq(HS_EQUAL, HS_VERTICAL_BAR, HS_LEFT_ARROW, HS_RIGHT_ARROW) - private final val LhsConstructors = Seq(HS_QCON, HS_QCON_OP) -} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/navigate/HaskellTargetElementEvaluator.scala b/src/main/scala/intellij/haskell/navigate/HaskellTargetElementEvaluator.scala deleted file mode 100644 index ad28085a..00000000 --- a/src/main/scala/intellij/haskell/navigate/HaskellTargetElementEvaluator.scala +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.navigate - -import com.intellij.codeInsight.TargetElementEvaluatorEx -import com.intellij.psi.{PsiElement, PsiFile, PsiReference} - -class HaskellTargetElementEvaluator extends TargetElementEvaluatorEx { - def isIdentifierPart(element: PsiFile, text: CharSequence, offset: Int): Boolean = { - import intellij.haskell.psi.HaskellTypes._ - element.findElementAt(offset).getNode.getElementType match { - case HS_VARID_ID => true - case HS_CONID_ID => true - case HS_VARSYM_ID => true - case HS_CONSYM_ID => true - case _ => false - } - } - - def includeSelfInGotoImplementation(element: PsiElement): Boolean = { - false - } - - def getElementByReference(ref: PsiReference, flags: Int): PsiElement = { - null - } -} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/navigate/HaskellDeclarationContributor.scala b/src/main/scala/intellij/haskell/navigation/HaskellDeclarationContributor.scala similarity index 76% rename from src/main/scala/intellij/haskell/navigate/HaskellDeclarationContributor.scala rename to src/main/scala/intellij/haskell/navigation/HaskellDeclarationContributor.scala index b49e8b5d..79623d7a 100644 --- a/src/main/scala/intellij/haskell/navigate/HaskellDeclarationContributor.scala +++ b/src/main/scala/intellij/haskell/navigation/HaskellDeclarationContributor.scala @@ -14,19 +14,19 @@ * limitations under the License. */ -package intellij.haskell.navigate +package intellij.haskell.navigation import com.intellij.navigation.{ChooseByNameContributor, NavigationItem} import com.intellij.openapi.project.Project -import intellij.haskell.util.HaskellFindUtil +import intellij.haskell.util.HaskellProjectUtil class HaskellDeclarationContributor extends ChooseByNameContributor { override def getNames(project: Project, includeNonProjectItems: Boolean): Array[String] = { - HaskellFindUtil.findDeclarationElements(project, includeNonProjectItems).flatMap(_.getIdentifierElements.map(_.getName)).toArray + HaskellProjectUtil.findDeclarationElements(project, includeNonProjectItems).flatMap(_.getIdentifierElements.map(_.getName)).toArray } override def getItemsByName(name: String, pattern: String, project: Project, includeNonProjectItems: Boolean): Array[NavigationItem] = { - HaskellFindUtil.findDeclarationElements(project, pattern, includeNonProjectItems).toArray + HaskellProjectUtil.findDeclarationElementsByName(project, pattern, includeNonProjectItems).toArray } } diff --git a/src/main/scala/intellij/haskell/navigate/HaskellFindUsagesProvider.scala b/src/main/scala/intellij/haskell/navigation/HaskellFindUsagesProvider.scala similarity index 74% rename from src/main/scala/intellij/haskell/navigate/HaskellFindUsagesProvider.scala rename to src/main/scala/intellij/haskell/navigation/HaskellFindUsagesProvider.scala index 09c46a2a..f4a71759 100644 --- a/src/main/scala/intellij/haskell/navigate/HaskellFindUsagesProvider.scala +++ b/src/main/scala/intellij/haskell/navigation/HaskellFindUsagesProvider.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.navigate +package intellij.haskell.navigation import com.intellij.lang.cacheBuilder.{WordOccurrence, WordsScanner} import com.intellij.lang.findUsages.FindUsagesProvider @@ -43,13 +43,8 @@ class HaskellFindUsagesProvider extends FindUsagesProvider { private def processTokens(lexer: HaskellLexer, fileText: CharSequence, processor: Processor[WordOccurrence], prevIdTokenType: IElementType) { val tokenType = lexer.getTokenType if (tokenType != null) { - if (tokenType == HS_VARID_ID || tokenType == HS_CONID_ID || tokenType == HS_VARSYM_ID || tokenType == HS_CONSYM_ID || tokenType == HS_DOT) { - val wo: WordOccurrence = - if (tokenType == HS_VARSYM_ID && prevIdTokenType == HS_DOT) { - new WordOccurrence(fileText, lexer.getTokenStart - 1, lexer.getTokenEnd, WordOccurrence.Kind.CODE) - } else { - new WordOccurrence(fileText, lexer.getTokenStart, lexer.getTokenEnd, WordOccurrence.Kind.CODE) - } + if (tokenType == HS_VAR_ID || tokenType == HS_CON_ID || tokenType == HS_VARSYM_ID || tokenType == HS_CONSYM_ID) { + val wo: WordOccurrence = new WordOccurrence(fileText, lexer.getTokenStart, lexer.getTokenEnd, WordOccurrence.Kind.CODE) processor.process(wo) lexer.advance() processTokens(lexer, fileText, processor, tokenType) @@ -62,16 +57,12 @@ class HaskellFindUsagesProvider extends FindUsagesProvider { override def getType(psiElement: PsiElement): String = { psiElement.getNode.getElementType match { - case HS_VAR_ID => "variable" - case HS_QVAR_ID => "qualified variable" - case HS_CON_ID => "constructor" - case HS_QCON_ID => "qualified constructor" - case HS_VAR_SYM => " variable operator" - case HS_QVAR_SYM => "qualified variable operator" - case HS_CON_SYM => "constructor operator" - case HS_QCON_SYM => "qualified constructor operator" + case HS_VARID => "variable" + case HS_CONID => "constructor" + case HS_VARSYM => "variable operator" + case HS_CONSYM => "constructor operator" case HS_QUALIFIER => "qualifier" - case HS_MOD_ID => "module" + case HS_MODID => "module" case _ => psiElement.getText } } diff --git a/src/main/scala/intellij/haskell/navigate/HaskellNamedElementContributor.scala b/src/main/scala/intellij/haskell/navigation/HaskellNamedElementContributor.scala similarity index 75% rename from src/main/scala/intellij/haskell/navigate/HaskellNamedElementContributor.scala rename to src/main/scala/intellij/haskell/navigation/HaskellNamedElementContributor.scala index 5739f65f..ce6f80ee 100644 --- a/src/main/scala/intellij/haskell/navigate/HaskellNamedElementContributor.scala +++ b/src/main/scala/intellij/haskell/navigation/HaskellNamedElementContributor.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,19 +14,19 @@ * limitations under the License. */ -package intellij.haskell.navigate +package intellij.haskell.navigation import com.intellij.navigation.{ChooseByNameContributor, NavigationItem} import com.intellij.openapi.project.Project -import intellij.haskell.util.HaskellFindUtil +import intellij.haskell.util.HaskellProjectUtil class HaskellNamedElementContributor extends ChooseByNameContributor { def getNames(project: Project, includeNonProjectItems: Boolean): Array[String] = { - HaskellFindUtil.findNamedElements(project, includeNonProjectItems).map(_.getName).toArray + HaskellProjectUtil.findNamedElements(project, includeNonProjectItems).map(_.getName).toArray } def getItemsByName(name: String, pattern: String, project: Project, includeNonProjectItems: Boolean): Array[NavigationItem] = { - HaskellFindUtil.findNamedElements(project, pattern, includeNonProjectItems).toArray + HaskellProjectUtil.findNamedElementsByName(project, pattern, includeNonProjectItems).toArray } } diff --git a/src/main/scala/intellij/haskell/navigation/HaskellReference.scala b/src/main/scala/intellij/haskell/navigation/HaskellReference.scala new file mode 100644 index 00000000..68c9ac5c --- /dev/null +++ b/src/main/scala/intellij/haskell/navigation/HaskellReference.scala @@ -0,0 +1,148 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.navigation + +import com.intellij.openapi.project.Project +import com.intellij.openapi.util.TextRange +import com.intellij.psi._ +import intellij.haskell.external.component._ +import intellij.haskell.psi._ +import intellij.haskell.util.{HaskellProjectUtil, LineColumnPosition} + +import scala.Option.option2Iterable + +class HaskellReference(element: HaskellNamedElement, textRange: TextRange) extends PsiPolyVariantReferenceBase[HaskellNamedElement](element, textRange) { + + override def multiResolve(incompleteCode: Boolean): Array[ResolveResult] = { + val project = myElement.getProject + val thisFile = myElement.getContainingFile + + val result = myElement match { + case mi: HaskellModid => + (for { + file <- HaskellProjectUtil.findFilesForModule(mi.getName, project) + } yield new HaskellFileResolveResult(file)).toArray + case qe: HaskellQualifierElement => + val importDeclarations = HaskellPsiUtil.findImportDeclarations(myElement.getContainingFile) + val resolveResults = findQualifier(importDeclarations, qe).map(q => Iterable(new HaskellQualifierResolveResult(q))).getOrElse( + findModuleFiles(importDeclarations, qe, project).map(f => new HaskellFileResolveResult(f.getOriginalElement))) + if (resolveResults.isEmpty) { + // return itself + HaskellPsiUtil.findNamedElement(myElement).map(new HaskellProjectResolveResult(_)).toArray + } else { + resolveResults.toArray + } + case ne: HaskellNamedElement => + val isProjectFile = HaskellProjectUtil.isProjectFile(thisFile) + findReferences(ne, isProjectFile, project).toArray + case _ => Array() + } + + result.asInstanceOf[Array[ResolveResult]] + } + + override def isReferenceTo(element: PsiElement): Boolean = { + val psiManager = getElement.getManager + val resolveResults = multiResolve(false) + resolveResults.exists(rr => psiManager.areElementsEquivalent(rr.getElement, element)) + } + + /** Implemented in [[intellij.haskell.editor.HaskellCompletionContributor]] **/ + override def getVariants: Array[AnyRef] = { + Array() + } + + private def findQualifier(importDeclarations: Iterable[HaskellImportDeclaration], qualifierElement: HaskellQualifierElement) = { + importDeclarations.flatMap(id => Option(id.getImportQualifiedAs)).flatMap(iqa => Option(iqa.getQualifier)).find(_.getName == qualifierElement.getName) + } + + private def findModuleFiles(importDeclarations: Iterable[HaskellImportDeclaration], qualifierElement: HaskellQualifierElement, project: Project) = { + importDeclarations.flatMap(id => Option(id.getModid)).find(mi => mi.getName == qualifierElement.getName).map(mi => HaskellProjectUtil.findFilesForModule(mi.getName, project)).getOrElse(Iterable()) + } + + private def findReferences(namedElement: HaskellNamedElement, isProjectFile: Boolean, project: Project) = { + val nameInfos = findNameInfos(namedElement) + val nameInfosResolvedResults = nameInfos.flatMap { + case pni: ProjectNameInfo => findProjectReference(pni, namedElement, project).map(new HaskellProjectResolveResult(_)).toIterable + case lni: LibraryNameInfo => findLibraryReferenceTo(lni, namedElement, project).map(ne => new HaskellLibraryResolveResult(ne)) + case bini: BuiltInNameInfo => Some(new BuiltInResolveResult(bini.declaration, bini.libraryName, bini.moduleName)) + } + (if (isProjectFile) { + nameInfosResolvedResults ++ findDefinitionLocationReference(namedElement, project).map(new HaskellProjectResolveResult(_)).toIterable + } else { + nameInfosResolvedResults + }).toSeq.distinct + } + + private def findDefinitionLocationReference(namedElement: HaskellNamedElement, project: Project): Option[HaskellNamedElement] = { + StackReplsComponentsManager.findDefinitionLocation(namedElement).flatMap(location => { + findReference(location.filePath, location.startLineNr, location.startColumnNr, namedElement, project) + }) + } + + private def findProjectReference(projectNameInfo: ProjectNameInfo, namedElement: HaskellNamedElement, project: Project): Option[HaskellNamedElement] = { + findReference(projectNameInfo.filePath, projectNameInfo.lineNr, projectNameInfo.colNr, namedElement, project) + } + + private def findReference(filePath: String, lineNr: Integer, columnNr: Integer, namedElement: HaskellNamedElement, project: Project): Option[HaskellNamedElement] = { + for { + haskellFile <- HaskellProjectUtil.findFile(filePath, project) + offset <- LineColumnPosition.getOffset(haskellFile, LineColumnPosition(lineNr, columnNr)) + element <- Option(haskellFile.findElementAt(offset)) + namedElement <- HaskellPsiUtil.findDeclarationElementParent(element).flatMap(_.getIdentifierElements.find(_.getName == namedElement.getName)). + orElse(HaskellPsiUtil.findQualifiedNameElement(element).map(_.getIdentifierElement)) + } yield namedElement + } + + private def findLibraryReferenceTo(libraryNameInfo: LibraryNameInfo, namedElement: HaskellNamedElement, project: Project): Iterable[HaskellNamedElement] = { + val file = HaskellProjectUtil.findFilesForModule(libraryNameInfo.moduleName, project).toSeq + file.flatMap { f => + val namedElements = HaskellPsiUtil.findTopLevelDeclarationElements(f).flatMap(_.getIdentifierElements).filter(e => e.getName == namedElement.getName) + val result = namedElements.filter(ne => StackReplsComponentsManager.findNameInfo(ne).exists(ni => compareWithoutSpaces(ni.unqualifiedDeclaration, libraryNameInfo.declaration))) + if (result.isEmpty) { + HaskellPsiUtil.findTopLevelDeclarationElements(f).filter(de => compareWithoutSpaces(libraryNameInfo.unqualifiedDeclaration, de.getText)).flatMap(_.getIdentifierElements) + } else { + result + } + } + } + + private def compareWithoutSpaces(s1: String, s2: String): Boolean = { + s1.replaceAll("""\s+""", "") == s2.replaceAll("""\s+""", "") + } + + private def findNameInfos(namedElement: HaskellNamedElement): Iterable[NameInfo] = { + StackReplsComponentsManager.findNameInfo(namedElement) + } +} + +class HaskellProjectResolveResult(val element: HaskellNamedElement) extends PsiElementResolveResult(element) + +class HaskellLibraryResolveResult(val element: HaskellNamedElement) extends PsiElementResolveResult(element) + +class HaskellFileResolveResult(val element: PsiElement) extends PsiElementResolveResult(element) + +class HaskellQualifierResolveResult(val element: HaskellNamedElement) extends PsiElementResolveResult(element) + +private class BuiltInResolveResult(declaration: String, val libraryName: String, val moduleName: String) extends NoElementToReferResolveResult(declaration) + +private sealed abstract class NoElementToReferResolveResult(val declaration: String) extends ResolveResult { + override def getElement: PsiElement = null + + override def isValidResult: Boolean = false +} + diff --git a/src/main/scala/intellij/haskell/navigate/HaskellStructureViewFactory.scala b/src/main/scala/intellij/haskell/navigation/HaskellStructureViewFactory.scala similarity index 96% rename from src/main/scala/intellij/haskell/navigate/HaskellStructureViewFactory.scala rename to src/main/scala/intellij/haskell/navigation/HaskellStructureViewFactory.scala index 6b0b2097..66fb8418 100644 --- a/src/main/scala/intellij/haskell/navigate/HaskellStructureViewFactory.scala +++ b/src/main/scala/intellij/haskell/navigation/HaskellStructureViewFactory.scala @@ -14,7 +14,7 @@ * limitations under the License. */ -package intellij.haskell.navigate +package intellij.haskell.navigation import javax.swing.Icon @@ -25,7 +25,7 @@ import com.intellij.navigation.ItemPresentation import com.intellij.openapi.editor.Editor import com.intellij.pom.Navigatable import com.intellij.psi.{PsiElement, PsiFile} -import intellij.haskell.psi.{HaskellDeclarationElement, HaskellPsiHelper} +import intellij.haskell.psi.{HaskellDeclarationElement, HaskellPsiUtil} import intellij.haskell.{HaskellFile, HaskellIcons} class HaskellStructureViewFactory extends PsiStructureViewFactory { @@ -73,9 +73,8 @@ private class HaskellStructureViewTreeElement(val element: PsiElement, val typeS def getChildren: Array[TreeElement] = { - (element match { - case hf: HaskellFile => HaskellPsiHelper.findTopDeclarations(hf) + case hf: HaskellFile => HaskellPsiUtil.findTopLevelDeclarationElements(hf) case _ => Seq() }).map(declarationElement => new HaskellStructureViewTreeElement(declarationElement, declarationElement.getText)).toArray } diff --git a/src/main/scala/intellij/haskell/external/GhcModCheckProcess.scala b/src/main/scala/intellij/haskell/psi/HaskellCNameElement.scala similarity index 72% rename from src/main/scala/intellij/haskell/external/GhcModCheckProcess.scala rename to src/main/scala/intellij/haskell/psi/HaskellCNameElement.scala index 4584013a..8367ac20 100644 --- a/src/main/scala/intellij/haskell/external/GhcModCheckProcess.scala +++ b/src/main/scala/intellij/haskell/psi/HaskellCNameElement.scala @@ -14,10 +14,9 @@ * limitations under the License. */ -package intellij.haskell.external +package intellij.haskell.psi -import com.intellij.openapi.project.Project +trait HaskellCNameElement extends HaskellCompositeElement { -class GhcModCheckProcess(project: Project) extends GhcModProcess(project) { - override def getComponentName: String = "intellij-haskell-ghc-mod-check" + def getName: String } diff --git a/src/main/scala/intellij/haskell/util/HaskellElementCondition.scala b/src/main/scala/intellij/haskell/psi/HaskellElementCondition.scala similarity index 66% rename from src/main/scala/intellij/haskell/util/HaskellElementCondition.scala rename to src/main/scala/intellij/haskell/psi/HaskellElementCondition.scala index 960231e3..fdacc733 100644 --- a/src/main/scala/intellij/haskell/util/HaskellElementCondition.scala +++ b/src/main/scala/intellij/haskell/psi/HaskellElementCondition.scala @@ -14,11 +14,10 @@ * limitations under the License. */ -package intellij.haskell.util +package intellij.haskell.psi import com.intellij.openapi.util.Condition import com.intellij.psi.PsiElement -import intellij.haskell.psi._ object HaskellElementCondition { @@ -40,10 +39,10 @@ object HaskellElementCondition { } } - final val QVarConOpElementCondition = new Condition[PsiElement]() { + final val QualifiedNameElementCondition = new Condition[PsiElement]() { override def value(psiElement: PsiElement): Boolean = { psiElement match { - case _: HaskellQVarConOpElement => true + case _: HaskellQualifiedNameElement => true case _ => false } } @@ -58,13 +57,37 @@ object HaskellElementCondition { } } - final val QualifiedElementCondition = new Condition[PsiElement]() { + final val TopDeclarationElementCondition = new Condition[PsiElement]() { override def value(psiElement: PsiElement): Boolean = { psiElement match { - case _: HaskellQvarId => true - case _: HaskellQvarSym => true - case _: HaskellQconId => true - case _: HaskellQconSym => true + case _: HaskellTopDeclaration => true + case _ => false + } + } + } + + final val ExpressionCondition = new Condition[PsiElement]() { + override def value(psiElement: PsiElement): Boolean = { + psiElement match { + case _: HaskellExpression => true + case _ => false + } + } + } + + final val NamedElementCondition = new Condition[PsiElement]() { + override def value(psiElement: PsiElement): Boolean = { + psiElement match { + case _: HaskellNamedElement => true + case _ => false + } + } + } + + final val ModIdElementCondition = new Condition[PsiElement]() { + override def value(psiElement: PsiElement): Boolean = { + psiElement match { + case _: HaskellModid => true case _ => false } } diff --git a/src/main/scala/intellij/haskell/psi/HaskellElementFactory.scala b/src/main/scala/intellij/haskell/psi/HaskellElementFactory.scala index eca09fe6..1daa5df4 100644 --- a/src/main/scala/intellij/haskell/psi/HaskellElementFactory.scala +++ b/src/main/scala/intellij/haskell/psi/HaskellElementFactory.scala @@ -16,44 +16,36 @@ package intellij.haskell.psi -import com.intellij.lang.ASTNode import com.intellij.openapi.project.Project import com.intellij.psi.codeStyle.CodeStyleSettingsManager +import com.intellij.psi.impl.PsiFileFactoryImpl +import com.intellij.psi.tree.IElementType import com.intellij.psi.util.PsiTreeUtil -import com.intellij.psi.{PsiFileFactory, PsiWhiteSpace} +import com.intellij.psi.{PsiFileFactory, PsiManager, PsiWhiteSpace} +import intellij.haskell.psi.HaskellTypes._ import intellij.haskell.util.OSUtil import intellij.haskell.{HaskellFile, HaskellFileType, HaskellLanguage} object HaskellElementFactory { - def createVarId(project: Project, name: String): ASTNode = { + def createVarid(project: Project, name: String): Option[HaskellVarid] = { + createElementFromText(project, name, HS_VARID).map(_.asInstanceOf[HaskellVarid]) + } + + def createConid(project: Project, name: String): Option[HaskellConid] = { + createElementFromText(project, name, HS_CONID).map(_.asInstanceOf[HaskellConid]) + } + + def createVarsym(project: Project, name: String): Option[HaskellVarsym] = { + createElementFromText(project, name, HS_VARSYM).map(_.asInstanceOf[HaskellVarsym]) + } + + def createConsym(project: Project, name: String): Option[HaskellConsym] = { + createElementFromText(project, name, HS_CONSYM).map(_.asInstanceOf[HaskellConsym]) + } + + def createQualifiedNameElement(project: Project, name: String): HaskellQualifiedNameElement = { val haskellFile = createFileFromText(project, name) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellVarId]).getNode - } - - - def createConId(project: Project, name: String): ASTNode = { - val haskellFile = createFileFromText(project, name) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellConId]).getNode - } - - def createVarSym(project: Project, name: String): ASTNode = { - val haskellFile = createFileFromText(project, name) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellVarSym]).getNode - } - - def createConSym(project: Project, name: String): ASTNode = { - val haskellFile = createFileFromText(project, name) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellConSym]).getNode - } - - def createExpression(project: Project, expression: String): HaskellExpression = { - val haskellFile = createFileFromText(project, expression) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellExpression]) - } - - def createQVarConOp(project: Project, qVarConOp: String): HaskellQVarConOpElement = { - val haskellFile = createFileFromText(project, qVarConOp) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellQVarConOpElement]) + PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellQualifiedNameElement]) } def createBody(project: Project, body: String): HaskellModuleBody = { @@ -61,9 +53,8 @@ object HaskellElementFactory { PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellModuleBody]) } - def createTopDeclaration(project: Project, declaration: String): HaskellTopDeclaration = { - val haskellFile = createFileFromText(project, declaration) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellTopDeclaration]) + def createTopDeclaration(project: Project, declaration: String): Option[HaskellTopDeclaration] = { + createElementFromText(project, declaration, HS_TOP_DECLARATION).map(_.asInstanceOf[HaskellTopDeclaration]) } def createLanguagePragma(project: Project, languagePragma: String): HaskellLanguagePragma = { @@ -86,16 +77,28 @@ object HaskellElementFactory { } def createQualifier(project: Project, qualifier: String) = { - val haskellFile = createFileFromText(project, qualifier + ".dummy") - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellQualifier]).getNode + createElementFromText(project, qualifier, HS_QUALIFIER).map(_.asInstanceOf[HaskellQualifier]) } - def createModId(project: Project, name: String) = { - val haskellFile = createFileFromText(project, "module " + name) - PsiTreeUtil.findChildOfType(haskellFile, classOf[HaskellModId]).getNode + def createQConQualifier(project: Project, qConQualifier: String) = { + createElementFromText(project, qConQualifier, HS_Q_CON_QUALIFIER).map(_.asInstanceOf[HaskellQConQualifier]) + } + + def createModid(project: Project, moduleName: String): Option[HaskellModid] = { + val haskellImportDeclaration = createElementFromText(project, "module " + moduleName, HS_MODULE_DECLARATION) + haskellImportDeclaration.map(_.asInstanceOf[HaskellImportDeclaration]).map(_.getModid) + } + + def createImportDeclaration(project: Project, moduleName: String): Option[HaskellImportDeclaration] = { + val haskellImportDeclaration = createElementFromText(project, "import " + moduleName, HS_IMPORT_DECLARATION) + haskellImportDeclaration.map(_.asInstanceOf[HaskellImportDeclaration]) } private def createFileFromText(project: Project, text: String): HaskellFile = { PsiFileFactory.getInstance(project).createFileFromText("a.hs", HaskellLanguage.Instance, text).asInstanceOf[HaskellFile] } + + private def createElementFromText(project: Project, text: String, elementType: IElementType) = { + Option(new PsiFileFactoryImpl(PsiManager.getInstance(project)).createElementFromText(text, HaskellLanguage.Instance, elementType, null)) + } } diff --git a/src/main/scala/intellij/haskell/psi/HaskellParserUtil.java b/src/main/scala/intellij/haskell/psi/HaskellParserUtil.java index 884fb496..cdc0fda9 100644 --- a/src/main/scala/intellij/haskell/psi/HaskellParserUtil.java +++ b/src/main/scala/intellij/haskell/psi/HaskellParserUtil.java @@ -27,6 +27,9 @@ public class HaskellParserUtil extends GeneratedParserUtilBase { return (builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == TokenType.WHITE_SPACE) || builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == HS_NEWLINE && builder.rawLookup(2) == TokenType.WHITE_SPACE || builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == HS_NEWLINE && builder.rawLookup(2) == HS_NEWLINE && builder.rawLookup(3) == TokenType.WHITE_SPACE || - builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == HS_NEWLINE && builder.rawLookup(2) == HS_NEWLINE && builder.rawLookup(3) == HS_NEWLINE && builder.rawLookup(4) == TokenType.WHITE_SPACE; + builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == HS_NEWLINE && builder.rawLookup(2) == HS_NEWLINE && builder.rawLookup(3) == HS_NEWLINE && builder.rawLookup(4) == TokenType.WHITE_SPACE || + builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == HS_NEWLINE && builder.rawLookup(2) == HS_NEWLINE && builder.rawLookup(3) == HS_NEWLINE && builder.rawLookup(4) == HS_NEWLINE && builder.rawLookup(5) == TokenType.WHITE_SPACE || + builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == HS_NEWLINE && builder.rawLookup(2) == HS_NEWLINE && builder.rawLookup(3) == HS_NEWLINE && builder.rawLookup(4) == HS_NEWLINE && builder.rawLookup(5) == HS_NEWLINE && builder.rawLookup(6) == TokenType.WHITE_SPACE || + builder.rawLookup(0) == HS_NEWLINE && builder.rawLookup(1) == HS_NEWLINE && builder.rawLookup(2) == HS_NEWLINE && builder.rawLookup(3) == HS_NEWLINE && builder.rawLookup(4) == HS_NEWLINE && builder.rawLookup(5) == HS_NEWLINE && builder.rawLookup(6) == HS_NEWLINE && builder.rawLookup(7) == TokenType.WHITE_SPACE; } } diff --git a/src/main/scala/intellij/haskell/psi/HaskellPsiHelper.scala b/src/main/scala/intellij/haskell/psi/HaskellPsiHelper.scala deleted file mode 100644 index b49a732a..00000000 --- a/src/main/scala/intellij/haskell/psi/HaskellPsiHelper.scala +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.psi - -import com.intellij.psi.util.PsiTreeUtil -import com.intellij.psi.{PsiElement, PsiFile} -import intellij.haskell.psi.HaskellTypes.HS_TOP_DECLARATION - -import scala.collection.JavaConversions._ - -object HaskellPsiHelper { - - def findImportDeclarations(psiFile: PsiFile): Iterable[HaskellImportDeclaration] = { - PsiTreeUtil.findChildrenOfType(psiFile, classOf[HaskellImportDeclaration]) - } - - - def findHaskellNamedElement(psiElement: PsiElement): Option[HaskellNamedElement] = { - psiElement.getParent match { - case hne: HaskellNamedElement => Some(hne) - case _ => None - } - } - - def findTopDeclarations(psiElement: PsiElement): Iterable[HaskellDeclarationElement] = { - PsiTreeUtil.findChildrenOfType(psiElement, classOf[HaskellDeclarationElement]).filter(_.getParent.getNode.getElementType == HS_TOP_DECLARATION) - } -} diff --git a/src/main/scala/intellij/haskell/psi/HaskellPsiUtil.scala b/src/main/scala/intellij/haskell/psi/HaskellPsiUtil.scala new file mode 100644 index 00000000..37d80a88 --- /dev/null +++ b/src/main/scala/intellij/haskell/psi/HaskellPsiUtil.scala @@ -0,0 +1,92 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.psi + +import com.intellij.psi.util.PsiTreeUtil +import com.intellij.psi.{PsiElement, PsiFile} +import intellij.haskell.psi.HaskellElementCondition._ +import intellij.haskell.psi.HaskellTypes.HS_TOP_DECLARATION + +import scala.collection.JavaConversions._ + +object HaskellPsiUtil { + + def findImportDeclarations(psiFile: PsiFile): Iterable[HaskellImportDeclaration] = { + PsiTreeUtil.findChildrenOfType(psiFile.getOriginalFile, classOf[HaskellImportDeclaration]) + } + + def findLanguageExtensions(psiFile: PsiFile): Iterable[HaskellLanguagePragma] = { + PsiTreeUtil.findChildrenOfType(psiFile.getOriginalFile, classOf[HaskellLanguagePragma]) + } + + def findNamedElement(psiElement: PsiElement): Option[HaskellNamedElement] = { + psiElement match { + case e: HaskellNamedElement => Some(e) + case e => Option(PsiTreeUtil.findFirstParent(psiElement, NamedElementCondition)).map(_.asInstanceOf[HaskellNamedElement]) + } + } + + def findModIdElement(psiElement: PsiElement): Option[HaskellModid] = { + psiElement match { + case e: HaskellModid => Some(e) + case e => Option(PsiTreeUtil.findFirstParent(psiElement, ModIdElementCondition)).map(_.asInstanceOf[HaskellModid]) + } + } + + def findNamedElements(psiElement: PsiElement): Iterable[HaskellNamedElement] = { + PsiTreeUtil.findChildrenOfType(psiElement, classOf[HaskellNamedElement]) + } + + def findTopLevelDeclarationElements(psiElement: PsiElement): Iterable[HaskellDeclarationElement] = { + PsiTreeUtil.findChildrenOfType(psiElement, classOf[HaskellDeclarationElement]).filter(_.getParent.getNode.getElementType == HS_TOP_DECLARATION) + } + + def findModuleDeclaration(psiFile: PsiFile): Option[HaskellModuleDeclaration] = { + Option(PsiTreeUtil.findChildOfType(psiFile.getOriginalFile, classOf[HaskellModuleDeclaration])) + } + + def findModuleName(psiFile: PsiFile): Option[String] = { + findModuleDeclaration(psiFile).flatMap(_.getModuleName) + } + + def findQualifiedNameElement(psiElement: PsiElement): Option[HaskellQualifiedNameElement] = { + psiElement match { + case e: HaskellQualifiedNameElement => Some(e) + case e => Option(PsiTreeUtil.findFirstParent(psiElement, QualifiedNameElementCondition)).map(_.asInstanceOf[HaskellQualifiedNameElement]) + } + } + + def findImportDeclarationParent(psiElement: PsiElement): Option[HaskellImportDeclaration] = { + Option(PsiTreeUtil.findFirstParent(psiElement, ImportDeclarationCondition)).map(_.asInstanceOf[HaskellImportDeclaration]) + } + + def findTopDeclarationParent(element: PsiElement): Option[HaskellTopDeclaration] = { + Option(PsiTreeUtil.findFirstParent(element, TopDeclarationElementCondition)).map(_.asInstanceOf[HaskellTopDeclaration]) + } + + def findDeclarationElementParent(psiElement: PsiElement): Option[HaskellDeclarationElement] = { + Option(PsiTreeUtil.findFirstParent(psiElement, DeclarationElementCondition)).map(_.asInstanceOf[HaskellDeclarationElement]) + } + + def findExpressionParent(psiElement: PsiElement): Option[HaskellExpression] = { + Option(PsiTreeUtil.findFirstParent(psiElement, ExpressionCondition)).map(_.asInstanceOf[HaskellExpression]) + } + + def findTopLevelTypeSignatures(element: PsiElement): Iterable[HaskellTypeSignature] = { + PsiTreeUtil.findChildrenOfType(element, classOf[HaskellTypeSignature]).filter(_.getParent.getNode.getElementType == HS_TOP_DECLARATION) + } +} diff --git a/src/main/scala/intellij/haskell/psi/HaskellQVarConOpElement.scala b/src/main/scala/intellij/haskell/psi/HaskellQualifiedNameElement.scala similarity index 83% rename from src/main/scala/intellij/haskell/psi/HaskellQVarConOpElement.scala rename to src/main/scala/intellij/haskell/psi/HaskellQualifiedNameElement.scala index 4e4e907c..3ffd3fbb 100644 --- a/src/main/scala/intellij/haskell/psi/HaskellQVarConOpElement.scala +++ b/src/main/scala/intellij/haskell/psi/HaskellQualifiedNameElement.scala @@ -16,11 +16,13 @@ package intellij.haskell.psi -trait HaskellQVarConOpElement extends HaskellCompositeElement { +trait HaskellQualifiedNameElement extends HaskellCompositeElement { def getName: String + def getNameWithoutParens: String + def getIdentifierElement: HaskellNamedElement - def getQualifier: Option[String] + def getQualifierName: Option[String] } diff --git a/src/main/scala/intellij/haskell/external/GhcModHaskellInfo.scala b/src/main/scala/intellij/haskell/psi/HaskellQualifierElement.scala similarity index 69% rename from src/main/scala/intellij/haskell/external/GhcModHaskellInfo.scala rename to src/main/scala/intellij/haskell/psi/HaskellQualifierElement.scala index 27ad6dd6..ae85be7d 100644 --- a/src/main/scala/intellij/haskell/external/GhcModHaskellInfo.scala +++ b/src/main/scala/intellij/haskell/psi/HaskellQualifierElement.scala @@ -14,13 +14,6 @@ * limitations under the License. */ -package intellij.haskell.external +package intellij.haskell.psi -import com.intellij.openapi.project.Project - -object GhcModHaskellInfo { - - def listLanguageExtensions(project: Project): Iterable[String] = { - GhcModProcessManager.getGhcModInfoProcess(project).execute("lang").outputLines - } -} +trait HaskellQualifierElement extends HaskellNamedElement diff --git a/src/main/scala/intellij/haskell/psi/HaskellReferenceContributor.scala b/src/main/scala/intellij/haskell/psi/HaskellReferenceContributor.scala index a314d2f0..8fb3628f 100644 --- a/src/main/scala/intellij/haskell/psi/HaskellReferenceContributor.scala +++ b/src/main/scala/intellij/haskell/psi/HaskellReferenceContributor.scala @@ -20,7 +20,7 @@ import com.intellij.openapi.util.TextRange import com.intellij.patterns.PlatformPatterns import com.intellij.psi._ import com.intellij.util.ProcessingContext -import intellij.haskell.navigate.HaskellReference +import intellij.haskell.navigation.HaskellReference import org.jetbrains.annotations.NotNull class HaskellReferenceContributor extends PsiReferenceContributor { @@ -30,10 +30,8 @@ class HaskellReferenceContributor extends PsiReferenceContributor { @NotNull def getReferencesByElement(@NotNull element: PsiElement, @NotNull context: ProcessingContext): Array[PsiReference] = { element match { - case namedElement: HaskellNamedElement => - Array(new HaskellReference(namedElement, TextRange.from(0, element.getTextLength))) - case _ => - PsiReference.EMPTY_ARRAY + case ne: HaskellNamedElement => Array(new HaskellReference(ne, TextRange.from(0, element.getTextLength))) + case _ => PsiReference.EMPTY_ARRAY } } }) diff --git a/src/main/scala/intellij/haskell/psi/impl/HaskellCNameElementImpl.java b/src/main/scala/intellij/haskell/psi/impl/HaskellCNameElementImpl.java new file mode 100644 index 00000000..4170baa5 --- /dev/null +++ b/src/main/scala/intellij/haskell/psi/impl/HaskellCNameElementImpl.java @@ -0,0 +1,27 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import intellij.haskell.psi.HaskellCNameElement; +import org.jetbrains.annotations.NotNull; + +public abstract class HaskellCNameElementImpl extends HaskellCompositeElementImpl implements HaskellCNameElement { + HaskellCNameElementImpl(@NotNull ASTNode node) { + super(node); + } +} diff --git a/src/main/scala/intellij/haskell/psi/impl/HaskellCompositeElementImpl.scala b/src/main/scala/intellij/haskell/psi/impl/HaskellCompositeElementImpl.scala index 5e374784..97bcb4dc 100644 --- a/src/main/scala/intellij/haskell/psi/impl/HaskellCompositeElementImpl.scala +++ b/src/main/scala/intellij/haskell/psi/impl/HaskellCompositeElementImpl.scala @@ -18,29 +18,11 @@ package intellij.haskell.psi.impl import com.intellij.extapi.psi.ASTWrapperPsiElement import com.intellij.lang.ASTNode -import com.intellij.psi.{PsiElement, ResolveState} -import com.intellij.psi.scope.PsiScopeProcessor import intellij.haskell.psi.HaskellCompositeElement -import org.jetbrains.annotations.NotNull - -object HaskellCompositeElementImpl { - private[impl] def processDeclarations(@NotNull element: PsiElement, @NotNull processor: PsiScopeProcessor, @NotNull state: ResolveState, lastParent: PsiElement, @NotNull place: PsiElement): Boolean = { - if (!processor.execute(element, state)) { - false - } - else { - ResolveUtil.processChildren(element, processor, state, lastParent, place) - } - } -} class HaskellCompositeElementImpl(node: ASTNode) extends ASTWrapperPsiElement(node) with HaskellCompositeElement { override def toString: String = { getNode.getElementType.toString } - - override def processDeclarations(@NotNull processor: PsiScopeProcessor, @NotNull state: ResolveState, lastParent: PsiElement, @NotNull place: PsiElement): Boolean = { - HaskellCompositeElementImpl.processDeclarations(this, processor, state, lastParent, place) - } } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/psi/impl/HaskellLineExpressionElementImpl.java b/src/main/scala/intellij/haskell/psi/impl/HaskellLineExpressionElementImpl.java index 1631785c..3bfd9630 100644 --- a/src/main/scala/intellij/haskell/psi/impl/HaskellLineExpressionElementImpl.java +++ b/src/main/scala/intellij/haskell/psi/impl/HaskellLineExpressionElementImpl.java @@ -16,13 +16,12 @@ package intellij.haskell.psi.impl; -import com.intellij.extapi.psi.ASTWrapperPsiElement; import com.intellij.lang.ASTNode; import intellij.haskell.psi.HaskellLineExpressionElement; import org.jetbrains.annotations.NotNull; -public abstract class HaskellLineExpressionElementImpl extends ASTWrapperPsiElement implements HaskellLineExpressionElement { - public HaskellLineExpressionElementImpl(@NotNull ASTNode node) { +public abstract class HaskellLineExpressionElementImpl extends HaskellCompositeElementImpl implements HaskellLineExpressionElement { + HaskellLineExpressionElementImpl(@NotNull ASTNode node) { super(node); } } diff --git a/src/main/scala/intellij/haskell/psi/impl/HaskellNamedElementImpl.java b/src/main/scala/intellij/haskell/psi/impl/HaskellNamedElementImpl.java index 8a91974b..35c39594 100644 --- a/src/main/scala/intellij/haskell/psi/impl/HaskellNamedElementImpl.java +++ b/src/main/scala/intellij/haskell/psi/impl/HaskellNamedElementImpl.java @@ -16,12 +16,11 @@ package intellij.haskell.psi.impl; -import com.intellij.extapi.psi.ASTWrapperPsiElement; import com.intellij.lang.ASTNode; import intellij.haskell.psi.HaskellNamedElement; import org.jetbrains.annotations.NotNull; -public abstract class HaskellNamedElementImpl extends ASTWrapperPsiElement implements HaskellNamedElement { +public abstract class HaskellNamedElementImpl extends HaskellCompositeElementImpl implements HaskellNamedElement { public HaskellNamedElementImpl(@NotNull ASTNode node) { super(node); } diff --git a/src/main/scala/intellij/haskell/psi/impl/HaskellPsiImplUtil.scala b/src/main/scala/intellij/haskell/psi/impl/HaskellPsiImplUtil.scala index feb46c3e..009cbb40 100644 --- a/src/main/scala/intellij/haskell/psi/impl/HaskellPsiImplUtil.scala +++ b/src/main/scala/intellij/haskell/psi/impl/HaskellPsiImplUtil.scala @@ -18,216 +18,157 @@ package intellij.haskell.psi.impl import javax.swing._ -import com.intellij.lang.ASTNode import com.intellij.navigation.ItemPresentation -import com.intellij.psi.impl.ResolveScopeManager import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry -import com.intellij.psi.search.{LocalSearchScope, SearchScope} -import com.intellij.psi.tree.IElementType -import com.intellij.psi.util.{PsiTreeUtil, PsiUtilCore} +import com.intellij.psi.util.PsiTreeUtil import com.intellij.psi.{PsiElement, PsiReference, TokenType} import com.intellij.util.ArrayUtil -import intellij.haskell.HaskellIcons -import intellij.haskell.navigate._ import intellij.haskell.psi.HaskellTypes._ import intellij.haskell.psi._ -import intellij.haskell.util.HaskellElementCondition.DeclarationElementCondition +import intellij.haskell.{HaskellFileType, HaskellIcons} import scala.collection.JavaConversions._ object HaskellPsiImplUtil { - def getName(qvar: HaskellQvar): String = { - qvar.getText + def getName(qVarCon: HaskellQVarCon): String = { + qVarCon.getText } - def getIdentifierElement(qvar: HaskellQvar): HaskellNamedElement = { - Option(qvar.getVarId). - orElse(Option(qvar.getVarSym)). - orElse(Option(qvar.getQvarId).map(_.getVarId)). - orElse(Option(qvar.getQvarSym.getVarSym)). - getOrElse(throw new Exception(s"Identifier for $qvar should exist")) + def getIdentifierElement(qVarCon: HaskellQVarCon): HaskellNamedElement = { + Option(qVarCon.getVarid).orElse(Option(qVarCon.getQCon).map(_.getConid)).orElse(Option(qVarCon.getConsym)).orElse(Option(qVarCon.getVarsym)). + getOrElse(throw new IllegalStateException(s"Identifier for $qVarCon should exist")) } - def getQualifier(qvar: HaskellQvar): Option[String] = { - Option(qvar.getQvarId).map(_.getQualifier.getName). - orElse(Option(qvar.getQvarSym).map(_.getQualifier.getName)) + def getName(varCon: HaskellVarCon): String = { + varCon.getText } - - def getName(qvarId: HaskellQvarId): String = { - qvarId.getText + def getIdentifierElement(varCon: HaskellVarCon): HaskellNamedElement = { + Option(varCon.getConid). + orElse(Option(varCon.getConsym)). + orElse(Option(varCon.getVarid)). + orElse(Option(varCon.getVarsym)). + getOrElse(throw new IllegalStateException(s"Identifier for $varCon should exist")) } - def getIdentifierElement(qvarId: HaskellQvarId): HaskellNamedElement = { - qvarId.getVarId + def getName(qName: HaskellQName): String = { + qName.getText } - - def getName(qcon: HaskellQcon): String = { - qcon.getText + def getNameWithoutParens(qName: HaskellQName): String = { + Option(qName.getVarCon).map(_.getName).getOrElse(qName.getQVarCon.getName) } - def getIdentifierElement(qcon: HaskellQcon): HaskellNamedElement = { - Option(qcon.getConId). - orElse(Option(qcon.getConSym)). - orElse(Option(qcon.getQconId).map(_.getIdentifierElement)). - orElse(Option(qcon.getGconSym.getIdentifierElement)). - getOrElse(throw new Exception(s"Identifier for $qcon should exist")) - + def getIdentifierElement(qName: HaskellQName): HaskellNamedElement = { + Option(qName.getVarCon).map(_.getIdentifierElement). + orElse(Option(qName.getQVarCon).map(_.getIdentifierElement)). + getOrElse(throw new IllegalStateException(s"Identifier for $qName should exist")) } - private def getQualifierForQConId(qconId: HaskellQconId) = { - qconId.getName.substring(0, qconId.getName.indexOf(qconId.getIdentifierElement.getName) - 1) + def getQualifierName(qName: HaskellQName): Option[String] = { + Option(qName.getQVarCon).flatMap(qvc => + Option(qvc.getQualifier).map(_.getName). + orElse(Option(qvc.getQCon).flatMap(qc => Option(qc.getQConQualifier1).orElse(Option(qc.getQConQualifier2)).orElse(Option(qc.getQConQualifier3)).map(_.getText)))) } - def getQualifier(qcon: HaskellQcon): Option[String] = { - Option(qcon.getQconId).map(getQualifierForQConId). - orElse(Option(qcon.getGconSym).flatMap(qs => Option(qs.getQconSym).map(_.getQualifier.getName))) + def getName(cname: HaskellCname): String = { + cname.getText } - - def getName(qconId: HaskellQconId): String = { - qconId.getText + def getNameWithoutParens(cname: HaskellCname): String = { + Option(cname.getVar).map(_.getName). + orElse(Option(cname.getCon).map(_.getName)). + orElse(Option(cname.getVarop).map(_.getName)). + getOrElse(cname.getConop.getName) } - def getIdentifierElement(qconId: HaskellQconId): HaskellNamedElement = { - qconId.getConId + def getIdentifierElement(cname: HaskellCname): HaskellNamedElement = { + Option(cname.getVar).map(_.getVarsym). + orElse(Option(cname.getVar).map(_.getVarid)). + orElse(Option(cname.getVarop).map(_.getVarid)). + orElse(Option(cname.getVarop).map(_.getVarsym)). + orElse(Option(cname.getCon).map(_.getConid)). + orElse(Option(cname.getCon).map(_.getConsym)). + orElse(Option(cname.getConop).map(_.getConid)). + orElse(Option(cname.getConop).map(_.getConsym)). + getOrElse(throw new IllegalStateException(s"Identifier for $cname should exist")) } - - def getName(qvarop: HaskellQvarOp): String = { - qvarop.getText + def getQualifierName(cname: HaskellCname): Option[String] = { + None } - def getIdentifierElement(qvarOp: HaskellQvarOp): HaskellNamedElement = { - Option(qvarOp.getVarId). - orElse(Option(qvarOp.getVarSym)). - orElse(Option(qvarOp.getQvarId).map(_.getVarId)). - orElse(Option(qvarOp.getQvarSym.getVarSym)). - getOrElse(throw new Exception(s"Identifier for $qvarOp should exist")) + def getName(modid: HaskellModid): String = { + modid.getText } - def getQualifier(qvarOp: HaskellQvarOp): Option[String] = { - Option(qvarOp.getQvarId).map(_.getQualifier.getName). - orElse(Option(qvarOp.getQvarSym).map(_.getQualifier.getName)) + def getNameIdentifier(modid: HaskellModid): HaskellNamedElement = { + modid } - - def getName(qconop: HaskellQconOp): String = { - qconop.getText + def setName(modid: HaskellModid, newName: String): PsiElement = { + val newModid = HaskellElementFactory.createModid(modid.getProject, removeFileExtension(newName)) + newModid.foreach(mi => modid.getNode.getTreeParent.replaceChild(modid.getNode, mi.getNode)) + modid } - def getIdentifierElement(qconOp: HaskellQconOp): HaskellNamedElement = { - Option(qconOp.getConId). - orElse(Option(qconOp.getConSym)). - orElse(Option(qconOp.getQconId).map(_.getIdentifierElement)). - orElse(Option(qconOp.getGconSym.getIdentifierElement)). - getOrElse(throw new Exception(s"Identifier for $qconOp should exist")) + def getName(varid: HaskellVarid): String = { + varid.getText } - def getQualifier(qconOp: HaskellQconOp): Option[String] = { - Option(qconOp.getQconId).map(getQualifierForQConId). - orElse(Option(qconOp.getGconSym).flatMap(qs => Option(qs.getQconSym).map(_.getQualifier.getName))) - } - - - def getName(op: HaskellOp): String = { - op.getText - } - - def getIdentifierElement(op: HaskellOp): HaskellNamedElement = { - Option(op.getQvarOp).map(_.getIdentifierElement). - orElse(Option(op.getQconOp.getIdentifierElement)). - getOrElse(throw new Exception(s"Identifier for $op should exist")) - } - - - def getName(gconSym: HaskellGconSym): String = { - gconSym.getText - } - - def getIdentifierElement(gconSym: HaskellGconSym): HaskellNamedElement = { - Option(gconSym.getQconSym).map(_.getConSym). - orElse(Option(gconSym.getConSym)). - getOrElse(throw new Exception(s"Identifier for $gconSym should exist")) - } - - - def getName(modId: HaskellModId): String = { - modId.getText - } - - def getNameIdentifier(modId: HaskellModId): HaskellNamedElement = { - modId - } - - def setName(modId: HaskellModId, newName: String): PsiElement = { - val newModId = HaskellElementFactory.createModId(modId.getProject, newName) - modId.getNode.getTreeParent.replaceChild(modId.getNode, newModId) - modId - } - - def getName(varId: HaskellVarId): String = { - varId.getText - } - - def getNameIdentifier(varId: HaskellVarId): HaskellNamedElement = { + def getNameIdentifier(varId: HaskellVarid): HaskellNamedElement = { varId } - def setName(varId: HaskellVarId, newName: String): PsiElement = { - val newVarId = HaskellElementFactory.createVarId(varId.getProject, newName) - varId.getNode.getTreeParent.replaceChild(varId.getNode, newVarId) - varId + def setName(varid: HaskellVarid, newName: String): PsiElement = { + val newVarid = HaskellElementFactory.createVarid(varid.getProject, newName) + newVarid.foreach(vid => varid.getNode.getTreeParent.replaceChild(varid.getNode, vid.getNode)) + varid } - - def getName(varSym: HaskellVarSym): String = { - varSym.getText + def getName(varsym: HaskellVarsym): String = { + varsym.getText } - def getNameIdentifier(varSym: HaskellVarSym): HaskellNamedElement = { - varSym + def getNameIdentifier(varsym: HaskellVarsym): HaskellNamedElement = { + varsym } - def setName(varSym: HaskellVarSym, newName: String): PsiElement = { - val newVarSym = HaskellElementFactory.createVarSym(varSym.getProject, newName) - varSym.getNode.getTreeParent.replaceChild(varSym.getNode, newVarSym) - varSym + def setName(varsym: HaskellVarsym, newName: String): PsiElement = { + val newVarsym = HaskellElementFactory.createVarsym(varsym.getProject, newName) + newVarsym.foreach(vs => varsym.getNode.getTreeParent.replaceChild(varsym.getNode, vs.getNode)) + varsym } - - def getName(conId: HaskellConId): String = { - conId.getText + def getName(conid: HaskellConid): String = { + conid.getText } - def getNameIdentifier(conId: HaskellConId): HaskellNamedElement = { - conId + def getNameIdentifier(conid: HaskellConid): HaskellNamedElement = { + conid } - def setName(conId: HaskellConId, newName: String): PsiElement = { - val newConId = HaskellElementFactory.createConId(conId.getProject, newName) - conId.getNode.getTreeParent.replaceChild(conId.getNode, newConId) - conId + def setName(conid: HaskellConid, newName: String): PsiElement = { + val newConid = HaskellElementFactory.createConid(conid.getProject, newName) + newConid.foreach(ci => conid.getNode.getTreeParent.replaceChild(conid.getNode, ci.getNode)) + conid } - - def getName(conSym: HaskellConSym): String = { - conSym.getText + def getName(consym: HaskellConsym): String = { + consym.getText } - def getNameIdentifier(conSym: HaskellConSym): HaskellNamedElement = { - conSym + def getNameIdentifier(consym: HaskellConsym): HaskellNamedElement = { + consym } - def setName(conSym: HaskellConSym, newName: String): PsiElement = { - val newConSym = HaskellElementFactory.createConSym(conSym.getProject, newName) - conSym.getNode.getTreeParent.replaceChild(conSym.getNode, newConSym) - conSym + def setName(consym: HaskellConsym, newName: String): PsiElement = { + val newConsym = HaskellElementFactory.createConsym(consym.getProject, newName) + newConsym.foreach(cs => consym.getNode.getTreeParent.replaceChild(consym.getNode, cs.getNode)) + consym } - def getName(qualifier: HaskellQualifier): String = { qualifier.getText } @@ -237,33 +178,66 @@ object HaskellPsiImplUtil { } def setName(qualifier: HaskellQualifier, newName: String): PsiElement = { - val newQualifier = HaskellElementFactory.createQualifier(qualifier.getProject, newName) - qualifier.getNode.getTreeParent.replaceChild(qualifier.getNode, newQualifier) + val newQualifier = HaskellElementFactory.createQualifier(qualifier.getProject, removeFileExtension(newName)) + newQualifier.foreach(q => qualifier.getNode.getTreeParent.replaceChild(qualifier.getNode, q.getNode)) qualifier } + def getName(qConQualifier: HaskellQualifierElement): String = { + qConQualifier.getText + } + + def getNameIdentifier(qConQualifier: HaskellQualifierElement): HaskellNamedElement = { + qConQualifier + } + + def setName(qualifier: HaskellQualifierElement, newName: String): PsiElement = { + val newQualifier = HaskellElementFactory.createQConQualifier(qualifier.getProject, newName) + newQualifier.foreach(q => qualifier.getNode.getTreeParent.replaceChild(qualifier.getNode, q.getNode)) + qualifier + } def getReference(element: PsiElement): PsiReference = { ArrayUtil.getFirstElement(ReferenceProvidersRegistry.getReferencesFromProviders(element)) } + def getName(`var`: HaskellVar): String = { + Option(`var`.getVarid).getOrElse(`var`.getVarsym).getName + } + + def getName(con: HaskellCon): String = { + Option(con.getConid).getOrElse(con.getConsym).getName + } + + def getName(varop: HaskellVarop): String = { + Option(varop.getVarid).getOrElse(varop.getVarsym).getName + } + + def getName(conop: HaskellConop): String = { + Option(conop.getConid).getOrElse(conop.getConsym).getName + } + private abstract class HaskellItemPresentation(haskellElement: PsiElement) extends ItemPresentation { def getLocationString: String = { - val node = haskellElement.getContainingFile.getNode.getPsi - Option(PsiTreeUtil.findChildOfType(node, classOf[HaskellModuleDeclaration])).map(_.getModId.getName).getOrElse("") + val file = haskellElement.getContainingFile + HaskellPsiUtil.findModuleDeclaration(file).map(_.getModid.getName).getOrElse("Unknown module") } def getIcon(unused: Boolean): Icon = { + findIcon(haskellElement) + } + + protected def findIcon(element: PsiElement): Icon = { import intellij.haskell.HaskellIcons._ - haskellElement match { + element match { case _: HaskellTypeDeclaration => Type case _: HaskellDataDeclaration => Data case _: HaskellNewtypeDeclaration => NewType case _: HaskellClassDeclaration => Class case _: HaskellInstanceDeclaration => Instance case _: HaskellDefaultDeclaration => Default - case _: HaskellTypeSignature => TypeSignature + case _: HaskellTypeSignature => HaskellSmallBlueLogo case _: HaskellForeignDeclaration => Foreign case _: HaskellTypeFamilyDeclaration => TypeFamily case _: HaskellTypeInstanceDeclaration => TypeInstance @@ -276,20 +250,24 @@ object HaskellPsiImplUtil { def getPresentation(namedElement: HaskellNamedElement): ItemPresentation = { new HaskellItemPresentation(namedElement) { - val declarationElement = Option(PsiTreeUtil.findFirstParent(namedElement, DeclarationElementCondition).asInstanceOf[HaskellDeclarationElement]) + val declarationElement = HaskellPsiUtil.findDeclarationElementParent(namedElement) def getPresentableText: String = { declarationElement.map(e => if (e.getIdentifierElements.map(_.getName).contains(namedElement.getName)) { getDeclarationInfo(e) } else { - namedElement.getName + " in " + getDeclarationInfo(e) - }).getOrElse(namedElement.getName) + namedElement.getName + " `in` " + getDeclarationInfo(e) + }).orElse(HaskellPsiUtil.findImportDeclarationParent(namedElement).flatMap(_.getModuleName).map(n => s"import $n")). + orElse(HaskellPsiUtil.findExpressionParent(namedElement).map(_.getText)). + orElse(HaskellPsiUtil.findTopDeclarationParent(namedElement).map(_.getText)). + map(_.replaceAll("""\s+""", " ")). + getOrElse(namedElement.getName) } override def getIcon(unused: Boolean): Icon = { declarationElement match { - case de: HaskellDeclarationElement => super.getIcon(unused) + case Some(de: HaskellDeclarationElement) => findIcon(de) case _ => HaskellIcons.HaskellSmallBlueLogo } } @@ -306,42 +284,30 @@ object HaskellPsiImplUtil { } } - private def getDeclarationInfo(declarationElement: HaskellDeclarationElement): String = { - val removeAfter = (nodes: Array[ASTNode], tokens: Seq[IElementType]) => nodes.takeWhile(e => !tokens.contains(e.getElementType)) - val removeInside = (de: HaskellCompositeElement, tokens: Seq[IElementType]) => de.getNode.getChildren(null).filterNot(e => tokens.contains(e.getElementType)) - val removeCommentsAndPragmas = (de: HaskellCompositeElement) => removeInside(de, Seq(HS_COMMENT, HS_NCOMMENT, HS_OVERLAP_PRAGMA, HS_CTYPE_PRAGMA, HS_UNPACK_PRAGMA, HS_NOUNPACK_PRAGMA, HS_INLINE_PRAGMA, HS_INLINABLE_PRAGMA, HS_NOINLINE_PRAGMA, HS_SPECIALIZE_PRAGMA)) - val removeCommentsAndPragmasAndAfterWhereOrEqual = (de: HaskellDeclarationElement) => removeAfter(removeCommentsAndPragmas(de), Seq(HS_WHERE, HS_EQUAL)) - val removeCommentsAndPragmasAndAfterModId = (de: HaskellDeclarationElement) => removeAfter(removeCommentsAndPragmas(de), Seq(HS_EXPORTS, HS_WHERE)) + private final val EndOfDeclarationInfoIndicators = Seq(HS_NEWLINE, HS_EQUAL, HS_WHERE) - (declarationElement match { - case md: HaskellModuleDeclaration => removeCommentsAndPragmasAndAfterModId(md) - case td: HaskellTypeDeclaration => removeCommentsAndPragmas(td) - case nt: HaskellNewtypeDeclaration => removeCommentsAndPragmasAndAfterWhereOrEqual(nt) - case cd: HaskellClassDeclaration => removeCommentsAndPragmasAndAfterWhereOrEqual(cd) - case id: HaskellInstanceDeclaration => removeCommentsAndPragmasAndAfterWhereOrEqual(id) - case ts: HaskellTypeSignature => removeCommentsAndPragmas(ts) - case tf: HaskellDataDeclaration => removeCommentsAndPragmasAndAfterWhereOrEqual(tf) - case tf: HaskellTypeFamilyDeclaration => removeCommentsAndPragmasAndAfterWhereOrEqual(tf) - case de => removeCommentsAndPragmas(de) - }).map(e => if (e.getElementType == TokenType.WHITE_SPACE) " " else e.getText.trim).mkString(" ").replaceAll("\\s+", " ") + private def getDeclarationInfo(declarationElement: HaskellDeclarationElement): String = { + val info = declarationElement match { + case md: HaskellModuleDeclaration => s"module ${md.getModid.getName}" + case de => de.getNode.getChildren(null).takeWhile(n => !EndOfDeclarationInfoIndicators.contains(n.getElementType)).filterNot(_.getElementType == TokenType.WHITE_SPACE).map(_.getText.trim).mkString(" ") + } + info.replaceAll("""\{\-(.+)\-\}""", " ").replaceAll("""\-\-(.+)""", "").replaceAll("""\s+""", " ") } def getName(declarationElement: HaskellDeclarationElement): String = { declarationElement.getPresentation.getPresentableText } - def getIdentifierElements(typeSignature: HaskellTypeSignature): Seq[HaskellNamedElement] = { - Option(typeSignature.getVars).map(_.getQvarList.map(_.getIdentifierElement)). - getOrElse(Seq()) + typeSignature.getQNamesList.flatMap(_.getQNameList).map(_.getIdentifierElement) } def getIdentifierElements(dataDeclaration: HaskellDataDeclaration): Seq[HaskellNamedElement] = { - dataDeclaration.getSimpletypeList.flatMap(_.getIdentifierElements) ++ - Option(dataDeclaration.getConstr1List).map(_.flatMap(c => Seq(c.getQcon.getIdentifierElement) ++ c.getFielddeclList.flatMap(_.getVars.getQvarList.map(_.getIdentifierElement)))).getOrElse(Seq()) ++ - Option(dataDeclaration.getConstr2List).map(_.map(c => c.getQconOp.getIdentifierElement)).getOrElse(Seq()) ++ - Option(dataDeclaration.getConstr3List).map(_.map(c => c.getQcon.getIdentifierElement)).getOrElse(Seq()) ++ - Option(dataDeclaration.getConstr4List).map(_.flatMap(c => Seq(c.getGconSym.getIdentifierElement, c.getQcon.getIdentifierElement))).getOrElse(Seq()) + dataDeclaration.getSimpletype.getIdentifierElements ++ + Option(dataDeclaration.getConstr1List).map(_.flatMap(c => Seq(c.getQName.getIdentifierElement) ++ c.getFielddeclList.flatMap(_.getQNameList.map(_.getIdentifierElement)))).getOrElse(Seq()) ++ + Option(dataDeclaration.getConstr3List).map(_.map(c => c.getQName.getIdentifierElement)).getOrElse(Seq()) ++ + Option(dataDeclaration.getConstr2List).map(_.flatMap(c => c.getQNameList.map(_.getIdentifierElement) ++ c.getQNameList.map(_.getIdentifierElement))).getOrElse(Seq()) ++ + Option(dataDeclaration.getConstr4List).map(_.flatMap(c => c.getQNameList.map(_.getIdentifierElement) ++ c.getQNameList.map(_.getIdentifierElement))).getOrElse(Seq()) } def getIdentifierElements(typeDeclaration: HaskellTypeDeclaration): Seq[HaskellNamedElement] = { @@ -353,38 +319,32 @@ object HaskellPsiImplUtil { } def getIdentifierElements(classDeclaration: HaskellClassDeclaration): Seq[HaskellNamedElement] = { - Seq(classDeclaration.getQcon.getIdentifierElement) + Seq(classDeclaration.getQNameList.head.getIdentifierElement) ++ + classDeclaration.getCdeclList.flatMap(cd => Option(cd.getTypeSignature).map(_.getIdentifierElements).getOrElse(Seq()) ++ + Option(cd.getTypeDeclaration).map(_.getIdentifierElements).getOrElse(Seq())) } def getIdentifierElements(instanceDeclaration: HaskellInstanceDeclaration): Seq[HaskellNamedElement] = { - val inst = instanceDeclaration.getInst - Seq(instanceDeclaration.getQcon.getIdentifierElement) ++ - Option(inst.getGtycon).flatMap(g => Option(g.getQcon).map(_.getIdentifierElement)).toSeq ++ - Option(inst.getInstvarList).map(_.flatMap(iv => Option(iv.getGconSym).map(_.getIdentifierElement). - orElse(Option(iv.getQcon).map(_.getIdentifierElement)))).getOrElse(Seq()) + Seq(instanceDeclaration.getQNameList.head.getIdentifierElement) ++ + Option(instanceDeclaration.getInst.getGtycon).map(g => findTypes(g)).getOrElse(Seq()) ++ + instanceDeclaration.getInst.getInstvarList.flatMap(g => findTypes(g)) } def getIdentifierElements(typeFamilyDeclaration: HaskellTypeFamilyDeclaration): Seq[HaskellNamedElement] = { - val familyType = typeFamilyDeclaration.getTypeFamilyType - Option(familyType.getTypeFamilyType1List).map(_.map(_.getQcon.getIdentifierElement)). - orElse(Option(familyType.getTypeFamilyType2List).map(_.map(_.getQvarOp.getIdentifierElement))). - orElse(Option(familyType.getVarsList).map(_.flatMap(_.getQvarList.map(_.getIdentifierElement)))). - getOrElse(Seq()) + typeFamilyDeclaration.getTypeFamilyType.getQNameList.map(_.getIdentifierElement) ++ + typeFamilyDeclaration.getTypeFamilyType.getQNamesList.flatMap(_.getQNameList.map(_.getIdentifierElement)) } def getIdentifierElements(derivingDeclaration: HaskellDerivingDeclaration): Seq[HaskellNamedElement] = { - Seq(derivingDeclaration.getQcon.getIdentifierElement) + Seq(derivingDeclaration.getQName.getIdentifierElement) ++ findTypes(derivingDeclaration.getInst) } def getIdentifierElements(typeInstanceDeclaration: HaskellTypeInstanceDeclaration): Seq[HaskellNamedElement] = { - Option(PsiTreeUtil.findChildOfType(typeInstanceDeclaration, classOf[HaskellQcon])).map(_.getIdentifierElement).toSeq + findTypes(typeInstanceDeclaration.getExpression) } def getIdentifierElements(simpleType: HaskellSimpletype): Seq[HaskellNamedElement] = { - Option(simpleType.getQcon).map(_.getIdentifierElement). - orElse(Option(simpleType.getQconOp).map(_.getIdentifierElement)). - orElse(Option(simpleType.getQvarOp).map(_.getIdentifierElement)). - orElse(Option(simpleType.getGconSym).map(_.getIdentifierElement)).toSeq + findTypes(simpleType) } def getIdentifierElements(defaultDeclaration: HaskellDefaultDeclaration): Seq[HaskellNamedElement] = { @@ -396,46 +356,31 @@ object HaskellPsiImplUtil { } def getIdentifierElements(moduleDeclaration: HaskellModuleDeclaration): Seq[HaskellNamedElement] = { - Seq(moduleDeclaration.getModId) + Seq(moduleDeclaration.getModid) } - - def getModuleName(importDeclaration: HaskellImportDeclaration): String = { - importDeclaration.getImportModule.getModId.getName + def getModuleName(importDeclaration: HaskellImportDeclaration): Option[String] = { + Option(importDeclaration.getModid).map(_.getName) } - def getModuleName(declarationElement: HaskellDeclarationElement): String = { - declarationElement.getPresentation.getLocationString + def getModuleName(declarationElement: HaskellDeclarationElement): Option[String] = { + Option(declarationElement.getPresentation).map(_.getLocationString) } - def getDataTypeConstructor(dataConstructorDeclaration: HaskellDataConstructorDeclarationElement): HaskellNamedElement = { dataConstructorDeclaration.getIdentifierElements.head } - def getUseScope(namedElement: HaskellNamedElement): SearchScope = { - val resolvedResult = Option(namedElement.getReference.asInstanceOf[HaskellReference]).flatMap(_.multiResolve(false).headOption) - resolvedResult match { - case Some(_: HaskellProjectResolveResult) | Some(_: HaskellLibraryResolveResult) | Some(_: HaskellFileResolveResult) => ResolveScopeManager.getElementUseScope(namedElement) - case Some(lrr: HaskellLocalResolveResult) => - Option(PsiTreeUtil.getParentOfType(namedElement, classOf[HaskellExpression])) match { - case Some(e) if findFirstChild(e).exists(_.getIdentifierElement.getName == namedElement.getName) => ResolveScopeManager.getElementUseScope(namedElement) - case Some(e) => - val target = lrr.getElement - val qVarConOpElements = PsiTreeUtil.findChildrenOfType(e, classOf[HaskellQVarConOpElement]) - val references = qVarConOpElements.filter(e => e.getIdentifierElement.getName == namedElement.getName && Option(e.getIdentifierElement.getReference).flatMap(r => Option(r.resolve)).exists(_.getTextOffset == target.getTextOffset)) - if (references.isEmpty) { - ResolveScopeManager.getElementUseScope(namedElement) - } else { - new LocalSearchScope(PsiUtilCore.toPsiElementArray(references)) - } - case None => ResolveScopeManager.getElementUseScope(namedElement) - } - case _ => ResolveScopeManager.getElementUseScope(namedElement) + private def removeFileExtension(name: String) = { + val fileExtension = "." + HaskellFileType.INSTANCE.getDefaultExtension + if (name.endsWith(fileExtension)) { + name.replaceFirst(fileExtension, "") + } else { + name } } - private def findFirstChild(e: HaskellExpression) = { - Option(PsiTreeUtil.findChildOfType(e, classOf[HaskellQVarConOpElement])) + private def findTypes(element: PsiElement) = { + PsiTreeUtil.findChildrenOfAnyType(element, Seq(classOf[HaskellConid], classOf[HaskellConsym]): _*).toSeq.distinct } } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/psi/impl/HaskellQualifierElementImpl.java b/src/main/scala/intellij/haskell/psi/impl/HaskellQualifierElementImpl.java new file mode 100644 index 00000000..ff1f32c7 --- /dev/null +++ b/src/main/scala/intellij/haskell/psi/impl/HaskellQualifierElementImpl.java @@ -0,0 +1,27 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.psi.impl; + +import com.intellij.lang.ASTNode; +import intellij.haskell.psi.HaskellQualifierElement; +import org.jetbrains.annotations.NotNull; + +public abstract class HaskellQualifierElementImpl extends HaskellNamedElementImpl implements HaskellQualifierElement { + HaskellQualifierElementImpl(@NotNull ASTNode node) { + super(node); + } +} diff --git a/src/main/scala/intellij/haskell/psi/impl/ResolveUtil.java b/src/main/scala/intellij/haskell/psi/impl/ResolveUtil.java deleted file mode 100644 index 4ea19e02..00000000 --- a/src/main/scala/intellij/haskell/psi/impl/ResolveUtil.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.psi.impl; - -import com.intellij.psi.PsiElement; -import com.intellij.psi.ResolveState; -import com.intellij.psi.scope.PsiScopeProcessor; -import com.intellij.psi.util.PsiTreeUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public abstract class ResolveUtil { - private ResolveUtil() { - } - - public static boolean processChildren(@NotNull PsiElement element, - @NotNull PsiScopeProcessor processor, - @NotNull ResolveState substitutor, - @Nullable PsiElement lastParent, - @NotNull PsiElement place) { - PsiElement run = lastParent == null ? element.getLastChild() : lastParent.getPrevSibling(); - while (run != null) { - if (PsiTreeUtil.findCommonParent(place, run) != run && !run.processDeclarations(processor, substitutor, null, place)) { - return false; - } - run = run.getPrevSibling(); - } - return true; - } -} diff --git a/src/main/scala/intellij/haskell/refactor/HaskellRefactoringSupportProvider.scala b/src/main/scala/intellij/haskell/refactor/HaskellRefactoringSupportProvider.scala index dacc160f..eb3a63e1 100644 --- a/src/main/scala/intellij/haskell/refactor/HaskellRefactoringSupportProvider.scala +++ b/src/main/scala/intellij/haskell/refactor/HaskellRefactoringSupportProvider.scala @@ -16,13 +16,22 @@ package intellij.haskell.refactor + import com.intellij.lang.refactoring.RefactoringSupportProvider -import com.intellij.psi.PsiElement -import intellij.haskell.psi.HaskellNamedElement +import com.intellij.psi.{PsiElement, PsiFile, PsiPolyVariantReference, ResolveResult} +import intellij.haskell.util.HaskellProjectUtil class HaskellRefactoringSupportProvider extends RefactoringSupportProvider { - override def isMemberInplaceRenameAvailable(element: PsiElement, context: PsiElement): Boolean = { - element.isInstanceOf[HaskellNamedElement] + override def isMemberInplaceRenameAvailable(psiElement: PsiElement, context: PsiElement): Boolean = { + !psiElement.isInstanceOf[PsiFile] && definedInProjectFile(psiElement) } -} + + private def definedInProjectFile(element: PsiElement) = { + val resolveResult = Option(element.getReference).flatMap(_.asInstanceOf[PsiPolyVariantReference].multiResolve(false).headOption) + resolveResult match { + case Some(rr: ResolveResult) => HaskellProjectUtil.isProjectFile(rr.getElement.getContainingFile) + case _ => false + } + } +} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/refactor/HaskellRenameVariableProcessor.scala b/src/main/scala/intellij/haskell/refactor/HaskellRenameVariableProcessor.scala index bdebef37..239786b6 100644 --- a/src/main/scala/intellij/haskell/refactor/HaskellRenameVariableProcessor.scala +++ b/src/main/scala/intellij/haskell/refactor/HaskellRenameVariableProcessor.scala @@ -16,40 +16,27 @@ package intellij.haskell.refactor -import com.intellij.psi.{PsiElement, PsiPolyVariantReference} +import com.intellij.psi.search.GlobalSearchScope +import com.intellij.psi.search.searches.ReferencesSearch +import com.intellij.psi.{PsiElement, PsiReference} import com.intellij.refactoring.listeners.RefactoringElementListener import com.intellij.refactoring.rename.RenamePsiElementProcessor import com.intellij.usageView.UsageInfo -import intellij.haskell.HaskellFile -import intellij.haskell.navigate.{HaskellFileResolveResult, HaskellLibraryResolveResult, HaskellProjectResolveResult} -import intellij.haskell.psi.HaskellNamedElement -import intellij.haskell.util.FileUtil +import intellij.haskell.util.{HaskellFileIndex, HaskellFileUtil} + +import scala.collection.JavaConversions._ class HaskellRenameVariableProcessor extends RenamePsiElementProcessor { - private var isShowPreviewForced: Boolean = _ - - override def prepareRenaming(element: PsiElement, newName: String, allRenames: java.util.Map[PsiElement, String]): Unit = { - if (element.isInstanceOf[HaskellNamedElement]) { - val resolvedElement = Option(element.getReference).flatMap(_.asInstanceOf[PsiPolyVariantReference].multiResolve(false).headOption) - isShowPreviewForced = resolvedElement match { - case Some(_: HaskellProjectResolveResult) | Some(_: HaskellLibraryResolveResult) | Some(_: HaskellFileResolveResult) => true - case None => true - case _ => false - } - } - } - - override def canProcessElement(element: PsiElement): Boolean = { - element.isInstanceOf[HaskellNamedElement] || element.isInstanceOf[HaskellFile] - } - - override def forcesShowPreview(): Boolean = { - isShowPreviewForced - } + override def canProcessElement(element: PsiElement): Boolean = true override def renameElement(element: PsiElement, newName: String, usages: Array[UsageInfo], listener: RefactoringElementListener): Unit = { super.renameElement(element, newName, usages, listener) - FileUtil.saveAllFiles() + HaskellFileUtil.saveAllFiles() + } + + override def findReferences(element: PsiElement): java.util.Collection[PsiReference] = { + val project = element.getProject + ReferencesSearch.search(element, GlobalSearchScope.filesScope(project, HaskellFileIndex.findProjectHaskellFiles(project).map(_.getVirtualFile))).findAll } } diff --git a/src/main/scala/intellij/haskell/refactor/HaskellVetoRenameCondition.scala b/src/main/scala/intellij/haskell/refactor/HaskellVetoRenameCondition.scala new file mode 100644 index 00000000..d0a1dd59 --- /dev/null +++ b/src/main/scala/intellij/haskell/refactor/HaskellVetoRenameCondition.scala @@ -0,0 +1,37 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.refactor + +import javax.naming.spi.ResolveResult + +import com.intellij.openapi.util.Condition +import com.intellij.psi.{PsiElement, PsiFile, PsiPolyVariantReference} +import intellij.haskell.util.HaskellProjectUtil + +class HaskellVetoRenameCondition extends Condition[PsiElement] { + override def value(element: PsiElement): Boolean = { + element match { + case f: PsiFile => !HaskellProjectUtil.isProjectFile(f) + case _ => + val resolveResult = Option(element.getReference).flatMap(_.asInstanceOf[PsiPolyVariantReference].multiResolve(false).headOption) + resolveResult match { + case Some(rr: ResolveResult) => !HaskellProjectUtil.isProjectFile(rr.getElement.getContainingFile) + case _ => true + } + } + } +} diff --git a/src/main/scala/intellij/haskell/sdk/HaskellSdkType.scala b/src/main/scala/intellij/haskell/sdk/HaskellSdkType.scala index 38f115f2..6e5fbc3a 100644 --- a/src/main/scala/intellij/haskell/sdk/HaskellSdkType.scala +++ b/src/main/scala/intellij/haskell/sdk/HaskellSdkType.scala @@ -19,30 +19,29 @@ package intellij.haskell.sdk import java.io.File import javax.swing.Icon +import com.intellij.openapi.project.Project import com.intellij.openapi.projectRoots._ -import com.intellij.openapi.roots.OrderRootType +import com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil +import com.intellij.openapi.roots.{OrderRootType, ProjectRootManager} import com.intellij.openapi.util.io.FileUtil -import intellij.haskell.HaskellIcons -import intellij.haskell.external.ExternalProcess +import intellij.haskell.external.CommandLine +import intellij.haskell.{HaskellIcons, HaskellNotificationGroup} import org.jdom.Element -/** - * Created GHC SDK because inspection tool forces to use a SDK. - */ -class HaskellSdkType extends SdkType("GHC SDK") { +class HaskellSdkType extends SdkType("Haskel Tool Stack SDK") { - override def suggestHomePath(): String = "/usr/local/bin" + override def suggestHomePath(): String = "/usr/bin" - override def suggestSdkName(currentSdkName: String, sdkHome: String): String = "GHC" + override def suggestSdkName(currentSdkName: String, sdkHome: String): String = "Haskell Tool Stack" override def createAdditionalDataConfigurable(sdkModel: SdkModel, sdkModificator: SdkModificator): AdditionalDataConfigurable = null override def isValidSdkHome(path: String): Boolean = { - val ghcPath = new File(path) - ghcPath.isDirectory && ghcPath.listFiles.map(f => FileUtil.getNameWithoutExtension(f)).contains("ghc") + val stackPath = new File(path) + stackPath.isDirectory && stackPath.listFiles.map(f => FileUtil.getNameWithoutExtension(f)).contains("stack") } - override def getPresentableName: String = "GHC binaries" + override def getPresentableName: String = "Stack binary" override def saveAdditionalData(additionalData: SdkAdditionalData, additional: Element): Unit = {} @@ -60,12 +59,32 @@ class HaskellSdkType extends SdkType("GHC SDK") { object HaskellSdkType { def getInstance: HaskellSdkType = SdkType.findInstance(classOf[HaskellSdkType]) + def getSdkHomePath(project: Project): Option[String] = { + Option(ProjectRootManager.getInstance(project).getProjectSdk).map(_.getHomePath) + } + + def findOrCreateSdk(): Sdk = { + SdkConfigurationUtil.findOrCreateSdk(null, getInstance) + } + def getNumericVersion(sdkHome: String) = { - val output = ExternalProcess.getProcessOutput( + val output = CommandLine.getProcessOutput( sdkHome, - sdkHome + File.separator + "ghc", + createPath(sdkHome), Seq("--numeric-version") ) output.getStdout } + + def getStackPath(project: Project): Option[String] = { + val sdkHomePath = getSdkHomePath(project) + if (sdkHomePath.isEmpty) { + HaskellNotificationGroup.logError("Path to directory of `stack` binary has to be set in Project SDK setting") + } + sdkHomePath.map(p => createPath(p)) + } + + private def createPath(sdkHome: String) = { + sdkHome + File.separator + "stack" + } } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/settings/HaskellConfigurable.scala b/src/main/scala/intellij/haskell/settings/HaskellConfigurable.scala index 315f9dfb..7aaf82b6 100644 --- a/src/main/scala/intellij/haskell/settings/HaskellConfigurable.scala +++ b/src/main/scala/intellij/haskell/settings/HaskellConfigurable.scala @@ -24,16 +24,13 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory import com.intellij.openapi.options.{Configurable, ConfigurationException} import com.intellij.openapi.ui.TextFieldWithBrowseButton import com.intellij.ui.DocumentAdapter -import intellij.haskell.external.GhcModProcessManager import scala.language.{existentials, reflectiveCalls} class HaskellConfigurable extends Configurable { private var isModifiedByUser = false - private val ghcModPathField = new TextFieldWithBrowseButton private val haskellDocsPathField = new TextFieldWithBrowseButton private val hlintPathField = new TextFieldWithBrowseButton - private val stackPathField = new TextFieldWithBrowseButton override def getDisplayName: String = { "Haskell" @@ -45,12 +42,6 @@ class HaskellConfigurable extends Configurable { override def createComponent: JComponent = { - ghcModPathField.addBrowseFolderListener( - s"Select $GhcMod", - null, - null, - FileChooserDescriptorFactory.createSingleLocalFileDescriptor()) - haskellDocsPathField.addBrowseFolderListener( s"Select $HaskellDocs", null, @@ -63,12 +54,6 @@ class HaskellConfigurable extends Configurable { null, FileChooserDescriptorFactory.createSingleLocalFileDescriptor()) - stackPathField.addBrowseFolderListener( - s"Select $Stack", - null, - null, - FileChooserDescriptorFactory.createSingleLocalFileDescriptor()) - val settingsPanel = new JPanel(new GridBagLayout()) val listener: DocumentAdapter = new DocumentAdapter() { @@ -77,10 +62,8 @@ class HaskellConfigurable extends Configurable { } } - ghcModPathField.getTextField.getDocument.addDocumentListener(listener) haskellDocsPathField.getTextField.getDocument.addDocumentListener(listener) hlintPathField.getTextField.getDocument.addDocumentListener(listener) - stackPathField.getTextField.getDocument.addDocumentListener(listener) val base = new GridBagConstraints { insets = new Insets(2, 0, 2, 3) @@ -117,10 +100,8 @@ class HaskellConfigurable extends Configurable { )) } - addLabeledControl(0, GhcMod, ghcModPathField) addLabeledControl(1, HaskellDocs, haskellDocsPathField) addLabeledControl(3, Hlint, hlintPathField) - addLabeledControl(4, Stack, stackPathField) settingsPanel.add(new JPanel(), base.setConstraints( gridx = 0, @@ -135,14 +116,8 @@ class HaskellConfigurable extends Configurable { validatePaths() val state = HaskellSettings.getInstance().getState - state.ghcModPath = ghcModPathField.getText state.haskellDocsPath = haskellDocsPathField.getText state.hlintPath = hlintPathField.getText - state.stackPath = stackPathField.getText - - GhcModProcessManager.setInRestartState() - - isModifiedByUser = false } private def validatePaths() { @@ -151,10 +126,7 @@ class HaskellConfigurable extends Configurable { throw new ConfigurationException(s"Invalid path to $command") } } - Seq((GhcMod, ghcModPathField.getText), - (HaskellDocs, haskellDocsPathField.getText), - (Hlint, hlintPathField.getText), - (Stack, stackPathField.getText) + Seq((HaskellDocs, haskellDocsPathField.getText), (Hlint, hlintPathField.getText) ).foreach({ case (c, p) => validate(c, p) }) } @@ -165,18 +137,12 @@ class HaskellConfigurable extends Configurable { override def reset() { val state = HaskellSettings.getInstance().getState - ghcModPathField.getTextField.setText(state.ghcModPath) haskellDocsPathField.getTextField.setText(state.haskellDocsPath) hlintPathField.getTextField.setText(state.hlintPath) - stackPathField.getTextField.setText(state.stackPath) - - isModifiedByUser = false } } object HaskellConfigurable { - val GhcMod = "ghc-mod" val HaskellDocs = "haskell-docs" val Hlint = "hlint" - val Stack = "stack" } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/settings/HaskellModuleEditorsProvider.scala b/src/main/scala/intellij/haskell/settings/HaskellModuleEditorsProvider.scala index b455d02d..4109ce4c 100644 --- a/src/main/scala/intellij/haskell/settings/HaskellModuleEditorsProvider.scala +++ b/src/main/scala/intellij/haskell/settings/HaskellModuleEditorsProvider.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/scala/intellij/haskell/settings/HaskellSettings.java b/src/main/scala/intellij/haskell/settings/HaskellSettings.java index e8d9c081..750aad5a 100644 --- a/src/main/scala/intellij/haskell/settings/HaskellSettings.java +++ b/src/main/scala/intellij/haskell/settings/HaskellSettings.java @@ -16,13 +16,16 @@ package intellij.haskell.settings; -import com.intellij.openapi.components.*; +import com.intellij.openapi.components.PersistentStateComponent; +import com.intellij.openapi.components.ServiceManager; +import com.intellij.openapi.components.State; +import com.intellij.openapi.components.Storage; import org.jetbrains.annotations.NotNull; @State( name = "HaskellConfiguration", storages = { - @Storage(id = "default", file = StoragePathMacros.APP_CONFIG + "/haskell.xml") + @Storage(file = "intellij-haskell.xml") } ) public class HaskellSettings implements PersistentStateComponent { @@ -45,9 +48,7 @@ public class HaskellSettings implements PersistentStateComponent StackInfo(p, getStackVersion(project, p))) - } - - def setStackPath(stackPath: String) { - state.stackPath = stackPath - } - - private def getStackVersion(project: Project, stackPath: String): String = { - ExternalProcess.getProcessOutput( - project.getBasePath, - stackPath, - Seq("--numeric-version") - ).getStdout - } - private def notifyIfPathIsNotSet(path: Option[String], name: String) { if (path.isEmpty) { - HaskellNotificationGroup.notifyError("Path to " + name + " is not set") + HaskellNotificationGroup.notifyBalloonError("Path to `" + name + "` is not set") } } private def findPath(path: String): Option[String] = { - Option(path).filterNot(_.isEmpty) + Option(path).filterNot(_.trim.isEmpty) } } - -case class StackInfo(path: String, version: String) \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/util/FileUtil.scala b/src/main/scala/intellij/haskell/util/FileUtil.scala deleted file mode 100644 index 7a228bf9..00000000 --- a/src/main/scala/intellij/haskell/util/FileUtil.scala +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.util - -import com.intellij.openapi.application.{ApplicationManager, ModalityState} -import com.intellij.openapi.editor.Document -import com.intellij.openapi.fileEditor.FileDocumentManager -import com.intellij.openapi.project.Project -import com.intellij.openapi.roots.libraries.LibraryUtil -import com.intellij.psi.search.GlobalSearchScope -import com.intellij.psi.{PsiDirectory, PsiFile} -import intellij.haskell.HaskellNotificationGroup -import intellij.haskell.external.GhcModModulesInfo - -object FileUtil { - - def saveFile(psiFile: PsiFile) { - ApplicationManager.getApplication.invokeLater(new Runnable { - override def run() { - FileDocumentManager.getInstance.saveDocument(FileDocumentManager.getInstance().getDocument(psiFile.getVirtualFile)) - } - }, ModalityState.NON_MODAL) - } - - def saveAllFiles() { - ApplicationManager.getApplication.invokeLater(new Runnable { - override def run() { - FileDocumentManager.getInstance.saveAllDocuments() - } - }, ModalityState.NON_MODAL) - } - - def findModuleFilePath(module: String, project: Project): Option[String] = { - val moduleFilePath = for { - (name, path) <- getNameAndPathForModule(module) - files = HaskellFileIndex.getFilesByName(project, name, GlobalSearchScope.allScope(project)) - file <- files.find(hf => checkPath(hf.getContainingDirectory, path)) - filePath <- Some(file.getVirtualFile.getPath) - } yield filePath - - moduleFilePath match { - case Some(p) => Some(p) - case None => - if (GhcModModulesInfo.listAvailableModules(project).exists(_ == module)) { - HaskellEditorUtil.createLabelMessage(s"Could not find source code for `$module`. Please add source for package to 'Project Settings/Libraries'", project) - } else { - () - } - None - } - } - - def getFilePath(psiFile: PsiFile): String = { - psiFile.getOriginalFile.getVirtualFile.getPath - } - - def isLibraryFile(psiFile: PsiFile): Boolean = { - Option(psiFile.getVirtualFile).flatMap(vf => Option(LibraryUtil.findLibraryEntry(vf, psiFile.getProject))).isDefined - } - - def makeFilePathAbsolute(filePath: String, project: Project): String = { - if (filePath.startsWith("/")) { - filePath - } else { - project.getBasePath + "/" + filePath - } - } - - private def getNameAndPathForModule(module: String) = { - module.split('.').toList.reverse match { - case n :: d => Some(n, d) - case _ => HaskellNotificationGroup.notifyError(s"Could not determine path for $module"); None - } - } - - private def checkPath(dir: PsiDirectory, dirNames: List[String]): Boolean = { - dirNames match { - case h :: t if dir.getName == h => checkPath(dir.getParentDirectory, t) - case h :: t => false - case _ => true - } - } -} - -case class LineColumnPosition(lineNr: Int, columnNr: Int) extends Ordered[LineColumnPosition] { - - def compare(that: LineColumnPosition): Int = { - val lineNrCompare = this.lineNr compare that.lineNr - if (lineNrCompare == 0) { - this.columnNr compare that.columnNr - } else { - lineNrCompare - } - } -} - -object LineColumnPosition { - - def fromOffset(psiFile: PsiFile, offset: Int): Option[LineColumnPosition] = { - val fdm = FileDocumentManager.getInstance - for { - file <- Option(psiFile.getOriginalFile.getVirtualFile) - doc <- Option(fdm.getDocument(file)) - li <- if (offset < doc.getTextLength) Some(doc.getLineNumber(offset)) else None - } yield LineColumnPosition(li + 1, offset - doc.getLineStartOffset(li) + 1) - } - - def getOffset(psiFile: PsiFile, lineColPos: LineColumnPosition): Option[Int] = { - val fdm = FileDocumentManager.getInstance - for { - file <- Option(psiFile.getOriginalFile.getVirtualFile) - doc <- Option(fdm.getDocument(file)) - lineIndex <- getLineIndex(lineColPos.lineNr, doc) - startOffsetLine = doc.getLineStartOffset(lineIndex) - } yield startOffsetLine + lineColPos.columnNr - 1 - } - - private def getLineIndex(lineNr: Int, doc: Document) = { - if (lineNr > doc.getLineCount) { - None - } else { - Some(lineNr - 1) - } - } -} diff --git a/src/main/scala/intellij/haskell/util/HaskellEditorUtil.scala b/src/main/scala/intellij/haskell/util/HaskellEditorUtil.scala index ddede82b..976967bf 100644 --- a/src/main/scala/intellij/haskell/util/HaskellEditorUtil.scala +++ b/src/main/scala/intellij/haskell/util/HaskellEditorUtil.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,13 +29,12 @@ import com.intellij.openapi.wm.WindowManager import com.intellij.ui.LightweightHint import com.intellij.ui.awt.RelativePoint import com.intellij.util.ui.{PositionTracker, UIUtil} -import com.intellij.xml.util.XmlStringUtil import intellij.haskell.HaskellFile object HaskellEditorUtil { - def enableAndShowIfInHaskellFile(e: AnActionEvent) { - val presentation = e.getPresentation + def enableAction(onlyForProjectFile: Boolean, actionEvent: AnActionEvent): Unit = { + val presentation = actionEvent.getPresentation def enable() { presentation.setEnabled(true) presentation.setVisible(true) @@ -45,10 +44,11 @@ object HaskellEditorUtil { presentation.setVisible(false) } try { - val dataContext = e.getDataContext - val file = CommonDataKeys.PSI_FILE.getData(dataContext) - file match { - case _: HaskellFile => enable() + val dataContext = actionEvent.getDataContext + val psiFile = CommonDataKeys.PSI_FILE.getData(dataContext) + psiFile match { + case _: HaskellFile if !onlyForProjectFile => enable() + case f: HaskellFile if onlyForProjectFile && HaskellProjectUtil.isProjectFile(psiFile) => enable() case _ => disable() } } @@ -57,12 +57,11 @@ object HaskellEditorUtil { } } - def showHint(editor: Editor, text: String) { + def showHint(editor: Editor, text: String): Unit = { val label = HintUtil.createInformationLabel(text) label.setFont(UIUtil.getLabelFont) val hint = new LightweightHint(label) - val hintManager = HintManagerImpl.getInstanceImpl label.addMouseMotionListener(new MouseMotionAdapter { @@ -78,13 +77,13 @@ object HaskellEditorUtil { HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_SCROLLING, 0, false) } - def createInfoBallon(message: String, editor: Editor) = { + def showInfoMessageBallon(message: String, editor: Editor): Unit = { val popupFactory = JBPopupFactory.getInstance UIUtil.invokeLaterIfNeeded(new Runnable { override def run() { val balloon = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message, MessageType.INFO, null).setCloseButtonEnabled(true).setHideOnAction(true).createBalloon() balloon.show(new PositionTracker[Balloon](editor.getContentComponent) { - def recalculateLocation(`object`: Balloon): RelativePoint = { + def recalculateLocation(balloon: Balloon): RelativePoint = { val target: RelativePoint = popupFactory.guessBestPopupLocation(editor) val screenPoint: Point = target.getScreenPoint var y: Int = screenPoint.y @@ -99,11 +98,7 @@ object HaskellEditorUtil { }) } - def createLabelMessage(message: String, project: Project) { + def showStatusBarInfoMessage(message: String, project: Project): Unit = { WindowManager.getInstance().getStatusBar(project).setInfo(message) } - - def escapeString(s: String) = { - XmlStringUtil.escapeString(s) - } } \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/util/HaskellFileIndex.scala b/src/main/scala/intellij/haskell/util/HaskellFileIndex.scala index b54a8e1c..b7202cf0 100644 --- a/src/main/scala/intellij/haskell/util/HaskellFileIndex.scala +++ b/src/main/scala/intellij/haskell/util/HaskellFileIndex.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,25 +17,18 @@ package intellij.haskell.util import java.io.{DataInput, DataOutput} -import java.util.concurrent.{Executors, TimeUnit} -import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.fileTypes.FileType import com.intellij.openapi.project.Project -import com.intellij.openapi.util.Computable import com.intellij.openapi.vfs.VirtualFile import com.intellij.psi.search.{FileTypeIndex, GlobalSearchScope} -import com.intellij.psi.{PsiFile, PsiManager} -import com.intellij.util.CommonProcessors import com.intellij.util.indexing.FileBasedIndex.InputFilter import com.intellij.util.indexing._ import com.intellij.util.io.{DataExternalizer, EnumeratorStringDescriptor, KeyDescriptor} -import intellij.haskell.{HaskellFile, HaskellFileType, HaskellNotificationGroup, LiterateHaskellFileType} -import gnu.trove.THashSet +import intellij.haskell.module.HaskellModuleType +import intellij.haskell.{HaskellFile, HaskellFileType} import scala.collection.JavaConversions._ -import scala.concurrent.duration.Duration -import scala.concurrent.{Await, ExecutionContext, Future} class HaskellFileIndex extends ScalaScalarIndexExtension[String] { @@ -58,7 +51,7 @@ class HaskellFileIndex extends ScalaScalarIndexExtension[String] { private class HaskellDataIndexer extends DataIndexer[String, Unit, FileContent] { def map(inputData: FileContent): java.util.Map[String, Unit] = { - Map(inputData.getFile.getNameWithoutExtension ->()) + Map(inputData.getFile.getNameWithoutExtension -> ()) } } @@ -66,73 +59,36 @@ class HaskellFileIndex extends ScalaScalarIndexExtension[String] { object HaskellFileIndex { - private final val ExecutorService = Executors.newCachedThreadPool() - implicit private final val ExecContext = ExecutionContext.fromExecutorService(ExecutorService) - private final val HaskellFileIndex: ID[String, Unit] = ID.create("HaskellFileIndex") private final val IndexVersion = 1 private final val Descriptor = new EnumeratorStringDescriptor private final val HaskellModuleFilter = new FileBasedIndex.InputFilter { def acceptInput(file: VirtualFile): Boolean = { - file.getFileType == HaskellFileType.INSTANCE || file.getFileType == LiterateHaskellFileType.INSTANCE + file.getFileType == HaskellFileType.INSTANCE } } - def getAllNames(project: Project, searchScope: GlobalSearchScope): collection.Set[String] = { - val allKeys: java.util.Set[String] = new THashSet[String] - FileBasedIndex.getInstance.processAllKeys(HaskellFileIndex, new CommonProcessors.CollectProcessor[String](allKeys), searchScope, null) - allKeys - } - - def getFilesByName(project: Project, name: String, searchScope: GlobalSearchScope): Iterable[HaskellFile] = { + def findFilesByName(project: Project, name: String, searchScope: GlobalSearchScope): Iterable[HaskellFile] = { getByName(project, name, searchScope) } - def getAllHaskellFiles(project: Project, searchScope: GlobalSearchScope): Iterable[HaskellFile] = { - val hsFiles = Future { - getFilesForType(HaskellFileType.INSTANCE, project, searchScope) - } - val lhsFiles = Future { - getFilesForType(LiterateHaskellFileType.INSTANCE, project, searchScope) - } + def findHaskellFiles(project: Project, searchScope: GlobalSearchScope): Iterable[HaskellFile] = { + getFilesForType(HaskellFileType.INSTANCE, project, searchScope) + } - val haskellFilesFuture = for { - hf <- hsFiles - lhsf <- lhsFiles - } yield hf ++ lhsf - - haskellFilesFuture.onFailure { case e => HaskellNotificationGroup.notifyError(s"Error while getting all (Literate) Haskell files from file index: ${e.getMessage}")} - - Await.result(haskellFilesFuture, Duration.create(2, TimeUnit.SECONDS)) + def findProjectHaskellFiles(project: Project): Iterable[HaskellFile] = { + findHaskellFiles(project, HaskellModuleType.findHaskellProjectModules(project).map(GlobalSearchScope.moduleScope).reduce(_.uniteWith(_))) } private def getFilesForType(fileType: FileType, project: Project, searchScope: GlobalSearchScope) = { - val psiManager = PsiManager.getInstance(project) - ApplicationManager.getApplication.runReadAction(new Computable[Iterable[HaskellFile]] { - override def compute() = { - FileBasedIndex.getInstance.getContainingFiles(FileTypeIndex.NAME, fileType, searchScope).flatMap(convertToHaskellFile(_, psiManager)) - } - }) + val virtualFiles = FileBasedIndex.getInstance.getContainingFiles(FileTypeIndex.NAME, fileType, searchScope) + HaskellFileUtil.convertToHaskellFiles(virtualFiles, project) } private def getByName(project: Project, name: String, searchScope: GlobalSearchScope): Iterable[HaskellFile] = { - val psiManager = PsiManager.getInstance(project) val virtualFiles = getVirtualFilesByName(project, name, searchScope) - - virtualFiles.flatMap(convertToHaskellFile(_, psiManager)) - } - - private def convertToHaskellFile(virtualFile: VirtualFile, psiManager: PsiManager): Option[HaskellFile] = { - val psiFile = ApplicationManager.getApplication.runReadAction(new Computable[PsiFile] { - override def compute(): PsiFile = { - psiManager.findFile(virtualFile) - } - }) - psiFile match { - case f: HaskellFile => Some(f) - case _ => None - } + HaskellFileUtil.convertToHaskellFiles(virtualFiles, project) } private def getVirtualFilesByName(project: Project, name: String, searchScope: GlobalSearchScope) = { @@ -141,9 +97,9 @@ object HaskellFileIndex { } /** - * A specialization of FileBasedIndexExtension allowing to create a mapping [DataObject -> List of files containing this object] - * - */ + * A specialization of FileBasedIndexExtension allowing to create a mapping [DataObject -> List of files containing this object] + * + */ object ScalaScalarIndexExtension { final val VoidDataExternalizer: DataExternalizer[Unit] = new ScalaScalarIndexExtension.UnitDataExternalizer diff --git a/src/main/scala/intellij/haskell/util/HaskellFileUtil.scala b/src/main/scala/intellij/haskell/util/HaskellFileUtil.scala new file mode 100644 index 00000000..68d791e2 --- /dev/null +++ b/src/main/scala/intellij/haskell/util/HaskellFileUtil.scala @@ -0,0 +1,56 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.util + +import java.io.File + +import com.intellij.openapi.application.{ApplicationManager, ModalityState} +import com.intellij.openapi.fileEditor.FileDocumentManager +import com.intellij.openapi.project.Project +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.{PsiFile, PsiManager} +import intellij.haskell.HaskellFile + +object HaskellFileUtil { + + def saveAllFiles() { + ApplicationManager.getApplication.invokeAndWait(new Runnable { + override def run() { + FileDocumentManager.getInstance.saveAllDocuments() + } + }, ModalityState.NON_MODAL) + } + + def getFilePath(psiFile: PsiFile): String = { + psiFile.getOriginalFile.getVirtualFile.getPath + } + + def makeFilePathAbsolute(filePath: String, project: Project): String = { + if (new File(filePath).isAbsolute) + filePath + else + new File(project.getBasePath, filePath).getAbsolutePath + } + + def convertToHaskellFiles(virtualFiles: Iterable[VirtualFile], project: Project): Iterable[HaskellFile] = { + val psiManager = PsiManager.getInstance(project) + virtualFiles.flatMap(vf => Option(psiManager.findFile(vf)) match { + case Some(pf: HaskellFile) => Some(pf) + case _ => None + }) + } +} diff --git a/src/main/scala/intellij/haskell/util/HaskellFindUtil.scala b/src/main/scala/intellij/haskell/util/HaskellFindUtil.scala deleted file mode 100644 index 48c46ccd..00000000 --- a/src/main/scala/intellij/haskell/util/HaskellFindUtil.scala +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.util - -import com.intellij.openapi.module.ModuleManager -import com.intellij.openapi.project.Project -import com.intellij.psi.search.GlobalSearchScope -import com.intellij.psi.util.PsiTreeUtil -import intellij.haskell.psi._ - -import scala.collection.JavaConversions._ - -object HaskellFindUtil { - - def findDeclarationElements(project: Project, includeNonProjectItems: Boolean): Iterable[HaskellDeclarationElement] = { - getHaskellFiles(project, includeNonProjectItems).flatMap(f => HaskellPsiHelper.findTopDeclarations(f)) - } - - def findDeclarationElements(project: Project, name: String, includeNonProjectItems: Boolean): Iterable[HaskellDeclarationElement] = { - val normalizedName = normalize(name) - if (name.endsWith(" ")) { - findDeclarationElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.startsWith(normalizedName)) - } else { - val names = normalizedName.split(' ') - if (names.length == 1) { - findDeclarationElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.contains(names.head)) - } else { - findDeclarationElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => names.forall(n => ne.contains(n))) - } - } - } - - def findNamedElements(project: Project, includeNonProjectItems: Boolean): Iterable[HaskellNamedElement] = { - getHaskellFiles(project, includeNonProjectItems).flatMap(f => PsiTreeUtil.findChildrenOfType(f, classOf[HaskellNamedElement])) - } - - def findNamedElements(project: Project, name: String, includeNonProjectItems: Boolean): Iterable[HaskellNamedElement] = { - val normalizedName = normalize(name) - if (name.endsWith(" ")) { - findNamedElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.startsWith(normalizedName)) - } else { - val names = normalizedName.split(' ') - if (names.length == 1) { - findNamedElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.contains(names.head)) - } else { - findNamedElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => names.forall(n => ne.contains(n))) - } - } - } - - def findProjectModules(project: Project): Iterable[HaskellModuleDeclaration] = { - getHaskellFiles(project, false).flatMap(f => PsiTreeUtil.findChildrenOfType(f, classOf[HaskellModuleDeclaration])) - } - - private def findDeclarationElementsByConditionOnName(project: Project, includeNonProjectItems: Boolean, condition: String => Boolean) = { - findDeclarationElements(project, includeNonProjectItems).filter(de => de.getIdentifierElements.map(n => normalize(n.getName)).exists(n => condition(n))) - } - - private def findNamedElementsByConditionOnName(project: Project, includeNonProjectItems: Boolean, condition: String => Boolean) = { - findNamedElements(project, includeNonProjectItems).filter(ne => condition(normalize(ne.getName))) - } - - private def getHaskellFiles(project: Project, includeNonProjectItems: Boolean) = { - val scope = if (includeNonProjectItems) { - GlobalSearchScope.allScope(project) - } else { - ModuleManager.getInstance(project).getModules.map(GlobalSearchScope.moduleScope).reduce(_.uniteWith(_)) - } - HaskellFileIndex.getAllHaskellFiles(project, scope) - } - - private def normalize(name: String): String = { - name.trim.toLowerCase - } -} \ No newline at end of file diff --git a/src/main/scala/intellij/haskell/util/HaskellProjectUtil.scala b/src/main/scala/intellij/haskell/util/HaskellProjectUtil.scala index 9b571a6b..4cc3f3a8 100644 --- a/src/main/scala/intellij/haskell/util/HaskellProjectUtil.scala +++ b/src/main/scala/intellij/haskell/util/HaskellProjectUtil.scala @@ -16,18 +16,149 @@ package intellij.haskell.util -import com.intellij.openapi.project.Project -import intellij.haskell.external.ExternalProcess +import com.intellij.openapi.module.ModuleManager +import com.intellij.openapi.project.{Project, ProjectManager} +import com.intellij.openapi.roots.ProjectRootManager +import com.intellij.openapi.vfs.{LocalFileSystem, VirtualFile} +import com.intellij.psi.search.GlobalSearchScope +import com.intellij.psi.{PsiDirectory, PsiFile, PsiManager} +import intellij.haskell.external.component.StackReplsComponentsManager import intellij.haskell.module.HaskellModuleType -import intellij.haskell.settings.HaskellSettingsState +import intellij.haskell.psi.{HaskellDeclarationElement, HaskellNamedElement, HaskellPsiUtil} +import intellij.haskell.sdk.HaskellSdkType +import intellij.haskell.{HaskellFile, HaskellNotificationGroup} object HaskellProjectUtil { - def isHaskellProject(project: Project): Boolean = { - HaskellModuleType.findModules(project).nonEmpty + def isHaskellStackProject(project: Project): Boolean = { + HaskellModuleType.findHaskellProjectModules(project).nonEmpty && HaskellSdkType.getSdkHomePath(project) != null } - def cleanBuild(project: Project) { - HaskellSettingsState.getStackInfo(project).map(si => ExternalProcess.getProcessOutput(project.getBasePath, si.path, Seq("clean"))) + def findProjectByLocationHash(locationHash: String): Project = { + val project = ProjectManager.getInstance().getOpenProjects.find(_.getLocationHash == locationHash) + project match { + case Some(p) => p + case None => throw new IllegalStateException(s"Could not find open project for project location hash: $locationHash") + } + } + + def findFile(filePath: String, project: Project): Option[HaskellFile] = { + val file = Option(LocalFileSystem.getInstance().findFileByPath(HaskellFileUtil.makeFilePathAbsolute(filePath, project))) + file.flatMap(f => Option(PsiManager.getInstance(project).findFile(f)).map(_.asInstanceOf[HaskellFile])) + } + + def isProjectFile(psiFile: PsiFile): Boolean = { + ProjectRootManager.getInstance(psiFile.getProject).getFileIndex.isInSourceContent(psiFile.getVirtualFile) + } + + def isProjectFile(virtualFile: VirtualFile, project: Project): Boolean = { + ProjectRootManager.getInstance(project).getFileIndex.isInSourceContent(virtualFile) + } + + def isProjectTestFile(psiFile: PsiFile): Boolean = { + ProjectRootManager.getInstance(psiFile.getProject).getFileIndex.isInTestSourceContent(psiFile.getVirtualFile) + } + + def findFilesForModule(moduleName: String, project: Project): Iterable[HaskellFile] = { + for { + fp <- findFilePathsForModule(moduleName, project) + f <- findFile(fp, project) + } yield f + } + + def findFilePathsForModule(moduleName: String, project: Project): Iterable[String] = { + getFileNameAndDirNamesForModule(moduleName).map(names => { + val (fileName, dirNames) = names + val filePaths = for { + file <- HaskellFileIndex.findFilesByName(project, fileName, GlobalSearchScope.allScope(project)) + if checkDirNames(file.getContainingDirectory, dirNames) + } yield file.getVirtualFile.getPath + + if (filePaths.isEmpty) { + if (StackReplsComponentsManager.findAvailableProjectModules(project).allModuleNames.exists(_ == moduleName)) { + HaskellEditorUtil.showStatusBarInfoMessage(s"Could not find source code for `$moduleName`.'", project) + } else { + HaskellEditorUtil.showStatusBarInfoMessage(s"Could not find source code for `$moduleName`. Please use `Download Haskell library sources` in `Tools` from menu. Test dependencieas are not supported yet, see https://github.com/commercialhaskell/stack/issues/1919", project) + } + filePaths + } else { + filePaths + } + }).getOrElse(Iterable()) + } + + def findDeclarationElements(project: Project, includeNonProjectItems: Boolean): Iterable[HaskellDeclarationElement] = { + getHaskellFiles(project, includeNonProjectItems).flatMap(f => HaskellPsiUtil.findTopLevelDeclarationElements(f)) + } + + def findDeclarationElementsByName(project: Project, name: String, includeNonProjectItems: Boolean): Iterable[HaskellDeclarationElement] = { + val normalizedName = normalize(name) + if (name.endsWith(" ")) { + findDeclarationElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.startsWith(normalizedName)) + } else { + val names = normalizedName.split(' ') + if (names.length == 1) { + findDeclarationElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.contains(names.head)) + } else { + findDeclarationElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => names.exists(n => ne.contains(n))) + } + } + } + + def findNamedElements(project: Project, includeNonProjectItems: Boolean): Iterable[HaskellNamedElement] = { + getHaskellFiles(project, includeNonProjectItems).flatMap(f => HaskellPsiUtil.findNamedElements(f)) + } + + def findNamedElementsByName(project: Project, name: String, includeNonProjectItems: Boolean): Iterable[HaskellNamedElement] = { + val normalizedName = normalize(name) + if (name.endsWith(" ")) { + findNamedElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.startsWith(normalizedName)) + } else { + val names = normalizedName.split(' ') + if (names.length == 1) { + findNamedElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => ne.contains(names.head)) + } else { + findNamedElementsByConditionOnName(project, includeNonProjectItems, (ne: String) => names.exists(n => ne.contains(n))) + } + } + } + + private def findDeclarationElementsByConditionOnName(project: Project, includeNonProjectItems: Boolean, condition: String => Boolean) = { + findDeclarationElements(project, includeNonProjectItems).filter(de => de.getIdentifierElements.map(n => normalize(n.getName)).exists(n => condition(n))) + } + + private def findNamedElementsByConditionOnName(project: Project, includeNonProjectItems: Boolean, condition: String => Boolean) = { + findNamedElements(project, includeNonProjectItems).filter(ne => condition(normalize(ne.getName))) + } + + private def getHaskellFiles(project: Project, includeNonProjectItems: Boolean) = { + val scope = if (includeNonProjectItems) { + GlobalSearchScope.allScope(project) + } else { + ModuleManager.getInstance(project).getModules.map(GlobalSearchScope.moduleScope).reduce(_.uniteWith(_)) + } + HaskellFileIndex.findHaskellFiles(project, scope) + } + + private def normalize(name: String): String = { + name.trim.toLowerCase + } + + private def getFileNameAndDirNamesForModule(module: String) = { + module.split('.').toList.reverse match { + case n :: d => Some(n, d) + case _ => HaskellNotificationGroup.logError(s"Could not determine directory names for $module"); None + } + } + + private def checkDirNames(dir: PsiDirectory, dirNames: List[String]): Boolean = { + dirNames match { + case dirName :: parentDirName => + if (dir.getName == dirName) + checkDirNames(dir.getParentDirectory, parentDirName) + else + false + case _ => true + } } } diff --git a/src/main/scala/intellij/haskell/util/LineColumnPosition.scala b/src/main/scala/intellij/haskell/util/LineColumnPosition.scala new file mode 100644 index 00000000..3cdeda5c --- /dev/null +++ b/src/main/scala/intellij/haskell/util/LineColumnPosition.scala @@ -0,0 +1,63 @@ +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package intellij.haskell.util + +import com.intellij.openapi.editor.Document +import com.intellij.openapi.fileEditor.FileDocumentManager +import com.intellij.psi.PsiFile + +case class LineColumnPosition(lineNr: Int, columnNr: Int) extends Ordered[LineColumnPosition] { + + def compare(that: LineColumnPosition): Int = { + val lineNrCompare = this.lineNr compare that.lineNr + if (lineNrCompare == 0) { + this.columnNr compare that.columnNr + } else { + lineNrCompare + } + } +} + +object LineColumnPosition { + + def fromOffset(psiFile: PsiFile, offset: Int): Option[LineColumnPosition] = { + val fdm = FileDocumentManager.getInstance + for { + file <- Option(psiFile.getOriginalFile.getVirtualFile) + doc <- Option(fdm.getDocument(file)) + li <- if (offset < doc.getTextLength) Some(doc.getLineNumber(offset)) else None + } yield LineColumnPosition(li + 1, offset - doc.getLineStartOffset(li) + 1) + } + + def getOffset(psiFile: PsiFile, lineColPos: LineColumnPosition): Option[Int] = { + val fdm = FileDocumentManager.getInstance + for { + file <- Option(psiFile.getOriginalFile.getVirtualFile) + doc <- Option(fdm.getDocument(file)) + lineIndex <- getLineIndex(lineColPos.lineNr, doc) + startOffsetLine = doc.getLineStartOffset(lineIndex) + } yield startOffsetLine + lineColPos.columnNr - 1 + } + + private def getLineIndex(lineNr: Int, doc: Document) = { + if (lineNr > doc.getLineCount) { + None + } else { + Some(lineNr - 1) + } + } +} diff --git a/src/main/scala/intellij/haskell/util/OSUtil.scala b/src/main/scala/intellij/haskell/util/OSUtil.scala index 92301f80..9e5222e1 100644 --- a/src/main/scala/intellij/haskell/util/OSUtil.scala +++ b/src/main/scala/intellij/haskell/util/OSUtil.scala @@ -20,11 +20,15 @@ import sun.security.action.GetPropertyAction object OSUtil { - private final val OsName = System.getProperty("os.name").toLowerCase - final lazy val LineSeparator = java.security.AccessController.doPrivileged(new GetPropertyAction("line.separator")).toCharArray.head def isOSX: Boolean = { OsName.indexOf("mac") >= 0 || OsName.indexOf("darwin") >= 0 } + + def isWindows: Boolean = { + OsName.startsWith("windows") + } + + private final val OsName = System.getProperty("os.name").toLowerCase } diff --git a/src/main/scala/intellij/haskell/external/GhcModInfoProcess.scala b/src/main/scala/intellij/haskell/util/Util.scala similarity index 72% rename from src/main/scala/intellij/haskell/external/GhcModInfoProcess.scala rename to src/main/scala/intellij/haskell/util/Util.scala index 1c2d2bfd..439d1900 100644 --- a/src/main/scala/intellij/haskell/external/GhcModInfoProcess.scala +++ b/src/main/scala/intellij/haskell/util/Util.scala @@ -14,11 +14,13 @@ * limitations under the License. */ -package intellij.haskell.external +package intellij.haskell.util -import com.intellij.openapi.project.Project +import com.intellij.xml.util.XmlStringUtil -class GhcModInfoProcess(project: Project) extends GhcModProcess(project) { +object Util { - override def getComponentName: String = "intellij-haskell-ghc-mod-info" + def escapeString(s: String) = { + XmlStringUtil.escapeString(s, false, false) + } } diff --git a/src/main/scala/intellij/haskell/view/AddDependencies.scala b/src/main/scala/intellij/haskell/view/AddDependencies.scala deleted file mode 100644 index 3cf98565..00000000 --- a/src/main/scala/intellij/haskell/view/AddDependencies.scala +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.view - -import java.io.File - -import com.intellij.openapi.actionSystem.{AnAction, AnActionEvent} -import com.intellij.openapi.module.ModuleManager -import com.intellij.openapi.progress.{ProgressIndicator, ProgressManager, Task} -import com.intellij.openapi.project.Project -import com.intellij.openapi.roots.{ModifiableRootModel, ModuleRootModificationUtil, OrderRootType} -import com.intellij.openapi.util.io.FileUtil -import com.intellij.openapi.vfs.VfsUtil -import com.intellij.util.Consumer -import intellij.haskell.HaskellNotificationGroup -import intellij.haskell.external.{ExternalProcess, GhcModProcessManager} -import intellij.haskell.settings.HaskellSettingsState -import intellij.haskell.util.HaskellProjectUtil - -import scala.collection.JavaConversions._ - -class AddDependencies extends AnAction { - - private final val LibName = "ideaHaskellLib" - private final val DependencyPattern = """([\w\-]+)\s([\d\.]+)""".r - private final val InitialProgressStep = 0.1 - - override def update(e: AnActionEvent): Unit = e.getPresentation.setEnabledAndVisible(HaskellProjectUtil.isHaskellProject(e.getProject)) - - override def actionPerformed(e: AnActionEvent): Unit = { - HaskellSettingsState.getStackInfo(e.getProject) match { - case Some(stackInfo) => - val project = e.getProject - - ProgressManager.getInstance().run(new Task.Backgroundable(project, "Downloading Haskell package sources and adding them as source libraries to module") { - def run(progressIndicator: ProgressIndicator) { - val libPath = new File(project.getBasePath + File.separator + LibName) - FileUtil.delete(libPath) - FileUtil.createDirectory(libPath) - val dependencyLines = ExternalProcess.getProcessOutput(project.getBasePath, stackInfo.path, Seq("list-dependencies")).getStdoutLines - val packageInfos = getPackageInfos(dependencyLines) - progressIndicator.setFraction(InitialProgressStep) - downloadHaskellPackageSources(project, stackInfo.path, packageInfos, progressIndicator) - progressIndicator.setFraction(0.9) - addPackagesAsLibrariesToModule(project, packageInfos, libPath.getAbsolutePath) - GhcModProcessManager.doRestart(project) - } - }) - case None => HaskellNotificationGroup.notifyError("Could not download sources because path to Stack is not set") - } - } - - private def getPackageInfos(dependencyLines: Seq[String]) = { - dependencyLines.flatMap { - case DependencyPattern(name, version) => Option(HaskellPackageInfo(name, version, s"$name-$version")) - case x => HaskellNotificationGroup.notifyWarning(s"Could not determine package for line [$x] in output of `stack list-dependencies`"); None - } - } - - private def downloadHaskellPackageSources(project: Project, stackPath: String, haskellPackages: Seq[HaskellPackageInfo], progressIndicator: ProgressIndicator) { - val step = 0.8 / haskellPackages.size - var progressFraction = InitialProgressStep - haskellPackages.foreach { p => - val fullName = p.name + "-" + p.version - ExternalProcess.getProcessOutput(project.getBasePath + File.separator + LibName, stackPath, Seq("unpack", fullName)) - progressFraction = progressFraction + step - progressIndicator.setFraction(progressFraction) - } - } - - private def getUrlByPath(path: String): String = { - VfsUtil.getUrlForLibraryRoot(new File(path)) - } - - private def addPackagesAsLibrariesToModule(project: Project, haskellPackages: Seq[HaskellPackageInfo], libPath: String) { - ModuleManager.getInstance(project).getModules.headOption match { - case Some(m) => - ModuleRootModificationUtil.updateModel(m, new Consumer[ModifiableRootModel] { - override def consume(t: ModifiableRootModel): Unit = { - val libraryTable = t.getModuleLibraryTable - libraryTable.getLibraries.foreach(l => libraryTable.removeLibrary(l)) - haskellPackages.foreach { hp => - val library = libraryTable.createLibrary(hp.name) - val model = library.getModifiableModel - model.addRoot(getUrlByPath(libPath + File.separator + hp.fileName), OrderRootType.SOURCES) - model.commit() - } - } - }) - case None => HaskellNotificationGroup.notifyWarning("Could not add packages as libraries because not Haskell module defined in project") - } - } - - private case class HaskellPackageInfo(name: String, version: String, fileName: String) - -} diff --git a/src/main/scala/intellij/haskell/view/HaskellDocumentationProvider.scala b/src/main/scala/intellij/haskell/view/HaskellDocumentationProvider.scala deleted file mode 100644 index 68fc6b6e..00000000 --- a/src/main/scala/intellij/haskell/view/HaskellDocumentationProvider.scala +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.view - -import java.util.regex.Pattern - -import com.intellij.lang.documentation.AbstractDocumentationProvider -import com.intellij.openapi.project.Project -import com.intellij.psi.util.PsiTreeUtil -import com.intellij.psi.{PsiElement, PsiFile} -import intellij.haskell.HaskellNotificationGroup -import intellij.haskell.external._ -import intellij.haskell.psi.{HaskellModuleDeclaration, HaskellNamedElement} -import intellij.haskell.settings.HaskellSettingsState - -import scala.collection.JavaConversions._ - -class HaskellDocumentationProvider extends AbstractDocumentationProvider { - - override def generateDoc(psiElement: PsiElement, originalPsiElement: PsiElement): String = { - originalPsiElement.getParent match { - case hne: HaskellNamedElement => getHaskellDoc(hne).getOrElse("No documentation found") - case e => s"No documentation because this is not Haskell identifier: ${e.getText}" - } - } - - private def getHaskellDoc(namedElement: HaskellNamedElement) = { - val haskellDocs = HaskellSettingsState.getHaskellDocsPath - haskellDocs match { - case Some(hd) => - val identifier = namedElement.getName - val file = namedElement.getContainingFile - val project = file.getProject - val identifierInfo = GhcModInfo.findInfoFor(file, namedElement).headOption - val arguments = identifierInfo.map { ii => - (ii, getModuleName(file), getPackageDbOption(project)) match { - case (lei: LibraryIdentifierInfo, _, Some(dbPathOption)) => Seq("-g", dbPathOption, lei.module, identifier) - case (pei: ProjectIdentifierInfo, _, Some(dbPathOption)) => Seq("-g", dbPathOption, PsiTreeUtil.findChildOfType(file, classOf[HaskellModuleDeclaration]).getModuleName, identifier) - case (bei: BuiltInIdentifierInfo, _, _) => Seq("Prelude", identifier) - case (_, Some(moduleName), Some(dbPathOption)) => Seq("-g", dbPathOption, moduleName, identifier) - case (_, _, _) => Seq() - } - } - - arguments.map(args => ExternalProcess.getProcessOutput(project.getBasePath, hd, args).getStdout).filterNot(_.trim.isEmpty).map(output => - s"
    ${Pattern.compile("$", Pattern.MULTILINE).matcher(output).replaceAll("
    ").replace(" ", " ")}
    " - ) - case None => - HaskellNotificationGroup.notifyError("Path to `haskell-docs` not set") - None - } - } - - private def getModuleName(psiFile: PsiFile) = { - Option(PsiTreeUtil.findChildOfType(psiFile, classOf[HaskellModuleDeclaration])).map(_.getModuleName) - } - - private def getPackageDbOption(project: Project) = { - HaskellSettingsState.getStackInfo(project) match { - case Some(stackInfo) => - val pathLines = ExternalProcess.getProcessOutput(project.getBasePath, stackInfo.path, Seq("path")).getStdoutLines - val path = pathLines.find(l => l.startsWith("local-pkg-db: ")).map(_.replace("local-pkg-db: ", "")).map(p => s"-package-db=$p") - if (path.isEmpty) { - HaskellNotificationGroup.notifyWarning("Could not determine locale package db with `Stack path`") - } - path - case None => HaskellNotificationGroup.notifyWarning("Could not retrieve project or library documentation because path to `Stack` is not set"); None - } - } -} diff --git a/src/test/scala/intellij/haskell/external/GhcModTypeInfoSpec.scala b/src/test/scala/intellij/haskell/external/GhcModTypeInfoSpec.scala deleted file mode 100644 index 6e963372..00000000 --- a/src/test/scala/intellij/haskell/external/GhcModTypeInfoSpec.scala +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2016 Rik van der Kleij - - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package intellij.haskell.external - -import org.scalatest.{BeforeAndAfterEach, FunSpec, GivenWhenThen, Matchers} - -class GhcModTypeInfoSpec extends FunSpec with Matchers with GivenWhenThen with BeforeAndAfterEach { - - val ghcModiTypeInfo = GhcModTypeInfo - - describe("Parsing ghc-mod type info output") { - Given("type info output of ghc-mod") - val output = List( - """12 10 12 19 "[Integer] -> [Integer]"""", - """12 10 12 25 "[Integer]"""", - """12 1 12 25 "[Integer]"""") - - When("converted to list of type info") - val typeInfos = ghcModiTypeInfo.ghcModOutputToTypeInfo(output).get.toSeq - - Then("it should contain right info") - typeInfos should have length 3 - - typeInfos(0) shouldEqual TypeInfo(12, 10, 12, 19, """[Integer] -> [Integer]""") - typeInfos(1) shouldEqual TypeInfo(12, 10, 12, 25, "[Integer]") - typeInfos(2) shouldEqual TypeInfo(12, 1, 12, 25, "[Integer]") - } -} diff --git a/src/test/scala/intellij/haskell/external/HlintSpec.scala b/src/test/scala/intellij/haskell/external/component/HLintSpec.scala similarity index 52% rename from src/test/scala/intellij/haskell/external/HlintSpec.scala rename to src/test/scala/intellij/haskell/external/component/HLintSpec.scala index a65a51c5..848ad585 100644 --- a/src/test/scala/intellij/haskell/external/HlintSpec.scala +++ b/src/test/scala/intellij/haskell/external/component/HLintSpec.scala @@ -1,8 +1,25 @@ -package intellij.haskell.external +/* + * Copyright 2016 Rik van der Kleij + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package intellij.haskell.external.component + +import intellij.haskell.external.HLintComponent import org.scalatest.{FunSpec, GivenWhenThen, Matchers} -class HlintSpec extends FunSpec with Matchers with GivenWhenThen { +class HLintSpec extends FunSpec with Matchers with GivenWhenThen { describe("Parsing HLint output") { Given("output of HLint") @@ -13,16 +30,16 @@ class HlintSpec extends FunSpec with Matchers with GivenWhenThen { """ When("converted to list of hlint infos") - val hlintInfos = Hlint.deserializeHlintInfo(output) + val hlintInfos = HLintComponent.deserializeHLintInfo(output) Then("it should contain right info") hlintInfos should have size 2 - val hlintInfo1 = hlintInfos(0) + val hlintInfo1 = hlintInfos.head hlintInfo1.startLine shouldEqual 17 hlintInfo1.note.size shouldEqual 1 - hlintInfo1.note(0) shouldEqual "\"increases laziness\"" + hlintInfo1.note.head shouldEqual "\"increases laziness\"" val hlintInfo2 = hlintInfos(1) hlintInfo2.endLine shouldEqual 34 diff --git a/src/test/scala/intellij/haskell/external/GhcModCheckSpec.scala b/src/test/scala/intellij/haskell/external/component/LoadSpec.scala similarity index 56% rename from src/test/scala/intellij/haskell/external/GhcModCheckSpec.scala rename to src/test/scala/intellij/haskell/external/component/LoadSpec.scala index 9a62527f..f9c20dcb 100644 --- a/src/test/scala/intellij/haskell/external/GhcModCheckSpec.scala +++ b/src/test/scala/intellij/haskell/external/component/LoadSpec.scala @@ -1,5 +1,5 @@ /* - * Copyright 2014 Rik van der Kleij + * Copyright 2016 Rik van der Kleij * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,23 +14,22 @@ * limitations under the License. */ -package intellij.haskell.external +package intellij.haskell.external.component -import intellij.haskell.util.OSUtil import org.scalatest.{BeforeAndAfterEach, FunSpec, GivenWhenThen, Matchers} -class GhcModCheckSpec extends FunSpec with Matchers with GivenWhenThen with BeforeAndAfterEach { +class LoadSpec extends FunSpec with Matchers with GivenWhenThen with BeforeAndAfterEach { - describe("Parsing ghc-mod check output") { - Given("output of ghc-mod check") - val output = "/file/path/HaskellFile.hs:1:11:parse error on input\u0000 and so on" + describe("Parsing `stack repl :load` output") { + Given("output load") + val output = "/file/path/HaskellFile.hs:1:11:parse error on input and so on" - When("parsed to ghc-mod problem") - val ghcModProblem = GhcModCheck.parseOutputLine(output, null).get + When("parsed to problem") + val problem = LoadComponent.parseLoadOutputLine("/file/path/HaskellFile.hs", output).asInstanceOf[LoadProblemInCurrentFile] Then("it should contain right data") - ghcModProblem.lineNr should equal(1) - ghcModProblem.columnNr should equal(11) - ghcModProblem.normalizedMessage should equal(s"parse error on input and so on") + problem.lineNr should equal(1) + problem.columnNr should equal(11) + problem.normalizedMessage should equal(s"parse error on input and so on") } }