<NME> TypeDecl.txt
<BEF> Elm File
  ElmTypeDeclaration(TYPE_DECLARATION)
    PsiElement(TYPE)('type')
    PsiWhiteSpace(' ')
    PsiElement(UPPER_CASE_IDENTIFIER)('User')
    PsiErrorElement:EQ or LOWER_CASE_IDENTIFIER expected, got '{'
      <empty list>
  PsiWhiteSpace(' ')
  PsiElement(LEFT_BRACE)('{')
  PsiWhiteSpace(' ')
  PsiElement(LOWER_CASE_IDENTIFIER)('xyz')
  PsiWhiteSpace(' ')
  PsiElement(RIGHT_BRACE)('}')
  PsiWhiteSpace('\n')
  PsiElement(VIRTUAL_END_DECL)('\n')
  ElmTypeDeclaration(TYPE_DECLARATION)
  PsiWhiteSpace('\n')
  ElmTypeDeclaration(TYPE_DECLARATION)
    PsiElement(UPPER_CASE_IDENTIFIER)('User')
    PsiWhiteSpace(' ')
    PsiElement(EQ)('=')
    PsiErrorElement:UPPER_CASE_IDENTIFIER expected, got 'if'
      <empty list>
  PsiWhiteSpace(' ')
  PsiElement(IF)('if')
  PsiWhiteSpace(' ')
  PsiElement(NUMBER_LITERAL)('0')
  PsiWhiteSpace(' ')
  PsiElement(THEN)('then')
  PsiWhiteSpace(' ')
  PsiElement(NUMBER_LITERAL)('1')
  PsiWhiteSpace(' ')
  PsiElement(ELSE)('else')
  PsiWhiteSpace(' ')
  PsiElement(NUMBER_LITERAL)('2')
  PsiWhiteSpace('\n')
  PsiElement(VIRTUAL_END_DECL)('\n')
  ElmTypeDeclaration(TYPE_DECLARATION)
      <empty list>
  PsiElement(VIRTUAL_END_DECL)('\n')
    PsiElement(UPPER_CASE_IDENTIFIER)('User')
    PsiErrorElement:EQ or LOWER_CASE_IDENTIFIER expected, got '['
      <empty list>
  PsiWhiteSpace(' ')
  PsiElement(LEFT_SQUARE_BRACKET)('[')
  PsiElement(LOWER_CASE_IDENTIFIER)('garbage')
  PsiElement(RIGHT_SQUARE_BRACKET)(']')
      PsiElement(LOWER_CASE_IDENTIFIER)('bogus_identifier')
    PsiWhiteSpace(' ')
    PsiElement(PIPE)('|')
    PsiWhiteSpace(' ')
    ElmUnionVariant(UNION_VARIANT)
      PsiElement(UPPER_CASE_IDENTIFIER)('C')
<MSG> Big improvements to parse error recovery

Fixes issue #3

<DFF> @@ -5,12 +5,15 @@ Elm File
     PsiElement(UPPER_CASE_IDENTIFIER)('User')
     PsiErrorElement:EQ or LOWER_CASE_IDENTIFIER expected, got '{'
       <empty list>
-  PsiWhiteSpace(' ')
-  PsiElement(LEFT_BRACE)('{')
-  PsiWhiteSpace(' ')
-  PsiElement(LOWER_CASE_IDENTIFIER)('xyz')
-  PsiWhiteSpace(' ')
-  PsiElement(RIGHT_BRACE)('}')
+    PsiWhiteSpace(' ')
+    PsiElement(DUMMY_BLOCK)
+      PsiErrorElement:EQ, LOWER_CASE_IDENTIFIER or UPPER_CASE_IDENTIFIER expected, got '{'
+        PsiElement(LEFT_BRACE)('{')
+      PsiElement(DUMMY_BLOCK)
+        PsiWhiteSpace(' ')
+        PsiElement(LOWER_CASE_IDENTIFIER)('xyz')
+      PsiWhiteSpace(' ')
+      PsiElement(RIGHT_BRACE)('}')
   PsiWhiteSpace('\n')
   PsiElement(VIRTUAL_END_DECL)('\n')
   ElmTypeDeclaration(TYPE_DECLARATION)
@@ -19,20 +22,19 @@ Elm File
     PsiElement(UPPER_CASE_IDENTIFIER)('User')
     PsiWhiteSpace(' ')
     PsiElement(EQ)('=')
+    PsiWhiteSpace(' ')
     PsiErrorElement:UPPER_CASE_IDENTIFIER expected, got 'if'
-      <empty list>
-  PsiWhiteSpace(' ')
-  PsiElement(IF)('if')
-  PsiWhiteSpace(' ')
-  PsiElement(NUMBER_LITERAL)('0')
-  PsiWhiteSpace(' ')
-  PsiElement(THEN)('then')
-  PsiWhiteSpace(' ')
-  PsiElement(NUMBER_LITERAL)('1')
-  PsiWhiteSpace(' ')
-  PsiElement(ELSE)('else')
-  PsiWhiteSpace(' ')
-  PsiElement(NUMBER_LITERAL)('2')
+      PsiElement(IF)('if')
+    PsiWhiteSpace(' ')
+    PsiElement(NUMBER_LITERAL)('0')
+    PsiWhiteSpace(' ')
+    PsiElement(THEN)('then')
+    PsiWhiteSpace(' ')
+    PsiElement(NUMBER_LITERAL)('1')
+    PsiWhiteSpace(' ')
+    PsiElement(ELSE)('else')
+    PsiWhiteSpace(' ')
+    PsiElement(NUMBER_LITERAL)('2')
   PsiWhiteSpace('\n')
   PsiElement(VIRTUAL_END_DECL)('\n')
   ElmTypeDeclaration(TYPE_DECLARATION)
@@ -41,7 +43,29 @@ Elm File
     PsiElement(UPPER_CASE_IDENTIFIER)('User')
     PsiErrorElement:EQ or LOWER_CASE_IDENTIFIER expected, got '['
       <empty list>
-  PsiWhiteSpace(' ')
-  PsiElement(LEFT_SQUARE_BRACKET)('[')
-  PsiElement(LOWER_CASE_IDENTIFIER)('garbage')
-  PsiElement(RIGHT_SQUARE_BRACKET)(']')
\ No newline at end of file
+    PsiWhiteSpace(' ')
+    PsiErrorElement:EQ, LOWER_CASE_IDENTIFIER or UPPER_CASE_IDENTIFIER expected, got '['
+      PsiElement(LEFT_SQUARE_BRACKET)('[')
+    PsiElement(LOWER_CASE_IDENTIFIER)('garbage')
+    PsiElement(RIGHT_SQUARE_BRACKET)(']')
+  PsiWhiteSpace('\n')
+  PsiElement(VIRTUAL_END_DECL)('\n')
+  ElmTypeDeclaration(TYPE_DECLARATION)
+    PsiElement(TYPE)('type')
+    PsiWhiteSpace(' ')
+    PsiElement(UPPER_CASE_IDENTIFIER)('User')
+    PsiWhiteSpace(' ')
+    PsiElement(EQ)('=')
+    PsiWhiteSpace(' ')
+    ElmUnionMember(UNION_MEMBER)
+      PsiElement(UPPER_CASE_IDENTIFIER)('A')
+    PsiWhiteSpace(' ')
+    PsiElement(PIPE)('|')
+    PsiWhiteSpace(' ')
+    PsiErrorElement:UPPER_CASE_IDENTIFIER expected, got 'bogus_identifier'
+      PsiElement(LOWER_CASE_IDENTIFIER)('bogus_identifier')
+    PsiWhiteSpace(' ')
+    PsiElement(PIPE)('|')
+    PsiWhiteSpace(' ')
+    ElmUnionMember(UNION_MEMBER)
+      PsiElement(UPPER_CASE_IDENTIFIER)('C')
\ No newline at end of file

Big improvements to parse error recovery