Skip to content

Commit

Permalink
Merge pull request #204 from TiVo/AllowMetaTagsOnExternTypes
Browse files Browse the repository at this point in the history
Allow extern interfaces #202
  • Loading branch information
as3boyan committed Apr 6, 2015
2 parents 4ce764f + 9955a46 commit 840dcaa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions gen/com/intellij/plugins/haxe/lang/parser/HaxeParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -1952,14 +1952,14 @@ private static boolean extendsDeclaration_0(PsiBuilder b, int l) {
}

/* ********************************************************** */
// macroClassList? externOrPrivate* 'class' componentName genericParam? inheritList? '{' externClassDeclarationBody '}'
// macroClassList? externOrPrivate* ('class' | 'interface') componentName genericParam? inheritList? '{' externClassDeclarationBody '}'
public static boolean externClassDeclaration(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "externClassDeclaration")) return false;
boolean r, p;
Marker m = enter_section_(b, l, _NONE_, "<extern class declaration>");
r = externClassDeclaration_0(b, l + 1);
r = r && externClassDeclaration_1(b, l + 1);
r = r && consumeToken(b, KCLASS);
r = r && externClassDeclaration_2(b, l + 1);
r = r && componentName(b, l + 1);
p = r; // pin = 4
r = r && report_error_(b, externClassDeclaration_4(b, l + 1));
Expand Down Expand Up @@ -1990,6 +1990,17 @@ private static boolean externClassDeclaration_1(PsiBuilder b, int l) {
return true;
}

// 'class' | 'interface'
private static boolean externClassDeclaration_2(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "externClassDeclaration_2")) return false;
boolean r;
Marker m = enter_section_(b);
r = consumeToken(b, KCLASS);
if (!r) r = consumeToken(b, KINTERFACE);
exit_section_(b, m, null, r);
return r;
}

// genericParam?
private static boolean externClassDeclaration_4(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "externClassDeclaration_4")) return false;
Expand Down
2 changes: 1 addition & 1 deletion grammar/haxe.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ externOrPrivate ::= 'extern' | privateKeyWord
typedefDeclaration ::= macroClassList? externOrPrivate? 'typedef' componentName genericParam? '=' functionTypeWrapper ';'?
{pin=5 mixin="com.intellij.plugins.haxe.lang.psi.impl.AbstractHaxeTypeDefImpl" implements="com.intellij.plugins.haxe.lang.psi.HaxeClass"}

externClassDeclaration ::= macroClassList? externOrPrivate* 'class' componentName genericParam? inheritList? '{' externClassDeclarationBody '}'
externClassDeclaration ::= macroClassList? externOrPrivate* ('class' | 'interface') componentName genericParam? inheritList? '{' externClassDeclarationBody '}'
{pin=4 mixin="com.intellij.plugins.haxe.lang.psi.impl.AbstractHaxePsiClass" implements="com.intellij.plugins.haxe.lang.psi.HaxeClass"}
externClassDeclarationBody ::= externClassDeclarationBodyPart*
private externClassDeclarationBodyPart ::= varDeclaration | externFunctionDeclaration {recoverWhile="extern_class_body_part_recover"}
Expand Down

0 comments on commit 840dcaa

Please sign in to comment.