Skip to content

Commit

Permalink
Parser: support for import types(wildcard, in and regular)
Browse files Browse the repository at this point in the history
Parser: one line function with return statement (Fixes #9)
Added tests for added features and for property declaration
  • Loading branch information
as3boyan committed Aug 9, 2014
1 parent 67126d5 commit 4b82210
Show file tree
Hide file tree
Showing 43 changed files with 1,025 additions and 200 deletions.
34 changes: 34 additions & 0 deletions gen/com/intellij/plugins/haxe/lang/lexer/HaxeTokenTypes.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.lexer;

Expand Down Expand Up @@ -62,6 +80,9 @@ public interface HaxeTokenTypes {
IElementType IDENTIFIER = new HaxeElementType("IDENTIFIER");
IElementType IF_STATEMENT = new HaxeElementType("IF_STATEMENT");
IElementType IMPORT_STATEMENT = new HaxeElementType("IMPORT_STATEMENT");
IElementType IMPORT_STATEMENT_REGULAR = new HaxeElementType("IMPORT_STATEMENT_REGULAR");
IElementType IMPORT_STATEMENT_WITH_IN_SUPPORT = new HaxeElementType("IMPORT_STATEMENT_WITH_IN_SUPPORT");
IElementType IMPORT_STATEMENT_WITH_WILDCARD = new HaxeElementType("IMPORT_STATEMENT_WITH_WILDCARD");
IElementType INHERIT = new HaxeElementType("INHERIT");
IElementType INHERIT_LIST = new HaxeElementType("INHERIT_LIST");
IElementType INTERFACE_BODY = new HaxeElementType("INTERFACE_BODY");
Expand Down Expand Up @@ -128,6 +149,7 @@ public interface HaxeTokenTypes {
IElementType VAR_DECLARATION_PART = new HaxeElementType("VAR_DECLARATION_PART");
IElementType VAR_INIT = new HaxeElementType("VAR_INIT");
IElementType WHILE_STATEMENT = new HaxeElementType("WHILE_STATEMENT");
IElementType WILDCARD = new HaxeElementType("WILDCARD");

IElementType CLOSING_QUOTE = new HaxeElementType("CLOSING_QUOTE");
IElementType ID = new HaxeElementType("ID");
Expand Down Expand Up @@ -427,6 +449,15 @@ else if (type == IF_STATEMENT) {
else if (type == IMPORT_STATEMENT) {
return new HaxeImportStatementImpl(node);
}
else if (type == IMPORT_STATEMENT_REGULAR) {
return new HaxeImportStatementRegularImpl(node);
}
else if (type == IMPORT_STATEMENT_WITH_IN_SUPPORT) {
return new HaxeImportStatementWithInSupportImpl(node);
}
else if (type == IMPORT_STATEMENT_WITH_WILDCARD) {
return new HaxeImportStatementWithWildcardImpl(node);
}
else if (type == INHERIT) {
return new HaxeInheritImpl(node);
}
Expand Down Expand Up @@ -625,6 +656,9 @@ else if (type == VAR_INIT) {
else if (type == WHILE_STATEMENT) {
return new HaxeWhileStatementImpl(node);
}
else if (type == WILDCARD) {
return new HaxeWildcardImpl(node);
}
throw new AssertionError("Unknown element type: " + type);
}
}
Expand Down
351 changes: 214 additions & 137 deletions gen/com/intellij/plugins/haxe/lang/parser/HaxeParser.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

Expand Down Expand Up @@ -50,7 +68,7 @@ public interface HaxeExternFunctionDeclaration extends HaxeComponentWithDeclarat
List<HaxeRequireMeta> getRequireMetaList();

@Nullable
HaxeReturnStatementWithoutSemicolon getReturnStatementWithoutSemicolon();
HaxeReturnStatement getReturnStatement();

@NotNull
List<HaxeSetterMeta> getSetterMetaList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

Expand Down Expand Up @@ -50,7 +68,7 @@ public interface HaxeFunctionDeclarationWithAttributes extends HaxeComponentWith
List<HaxeRequireMeta> getRequireMetaList();

@Nullable
HaxeReturnStatementWithoutSemicolon getReturnStatementWithoutSemicolon();
HaxeReturnStatement getReturnStatement();

@NotNull
List<HaxeSetterMeta> getSetterMetaList();
Expand Down
20 changes: 19 additions & 1 deletion gen/com/intellij/plugins/haxe/lang/psi/HaxeFunctionLiteral.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

Expand All @@ -17,7 +35,7 @@ public interface HaxeFunctionLiteral extends HaxeExpression {
HaxeParameterList getParameterList();

@Nullable
HaxeReturnStatementWithoutSemicolon getReturnStatementWithoutSemicolon();
HaxeReturnStatement getReturnStatement();

@Nullable
HaxeThrowStatement getThrowStatement();
Expand Down
10 changes: 8 additions & 2 deletions gen/com/intellij/plugins/haxe/lang/psi/HaxeImportStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@

public interface HaxeImportStatement extends HaxePsiCompositeElement {

@NotNull
List<HaxeReferenceExpression> getReferenceExpressionList();
@Nullable
HaxeImportStatementRegular getImportStatementRegular();

@Nullable
HaxeImportStatementWithInSupport getImportStatementWithInSupport();

@Nullable
HaxeImportStatementWithWildcard getImportStatementWithWildcard();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;

public interface HaxeImportStatementRegular extends HaxePsiCompositeElement {

@NotNull
HaxeReferenceExpression getReferenceExpression();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;

public interface HaxeImportStatementWithInSupport extends HaxePsiCompositeElement {

@NotNull
List<HaxeReferenceExpression> getReferenceExpressionList();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;

public interface HaxeImportStatementWithWildcard extends HaxePsiCompositeElement {

@NotNull
HaxeReferenceExpression getReferenceExpression();

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

Expand All @@ -23,7 +41,7 @@ public interface HaxeLocalFunctionDeclaration extends HaxeComponent {
HaxeParameterList getParameterList();

@Nullable
HaxeReturnStatementWithoutSemicolon getReturnStatementWithoutSemicolon();
HaxeReturnStatement getReturnStatement();

@Nullable
HaxeThrowStatement getThrowStatement();
Expand Down
34 changes: 34 additions & 0 deletions gen/com/intellij/plugins/haxe/lang/psi/HaxeVisitor.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

Expand Down Expand Up @@ -226,6 +244,18 @@ public void visitImportStatement(@NotNull HaxeImportStatement o) {
visitPsiCompositeElement(o);
}

public void visitImportStatementRegular(@NotNull HaxeImportStatementRegular o) {
visitPsiCompositeElement(o);
}

public void visitImportStatementWithInSupport(@NotNull HaxeImportStatementWithInSupport o) {
visitPsiCompositeElement(o);
}

public void visitImportStatementWithWildcard(@NotNull HaxeImportStatementWithWildcard o) {
visitPsiCompositeElement(o);
}

public void visitInherit(@NotNull HaxeInherit o) {
visitPsiCompositeElement(o);
}
Expand Down Expand Up @@ -497,6 +527,10 @@ public void visitWhileStatement(@NotNull HaxeWhileStatement o) {
visitPsiCompositeElement(o);
}

public void visitWildcard(@NotNull HaxeWildcard o) {
visitPsiCompositeElement(o);
}

public void visitClass(@NotNull HaxeClass o) {
visitPsiCompositeElement(o);
}
Expand Down
31 changes: 31 additions & 0 deletions gen/com/intellij/plugins/haxe/lang/psi/HaxeWildcard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2014-2014 AS3Boyan
* Copyright 2014-2014 Elias Ku
*
* 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.
*/

// This is a generated file. Not intended for manual editing.
package com.intellij.plugins.haxe.lang.psi;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.psi.PsiElement;

public interface HaxeWildcard extends HaxePsiCompositeElement {

@NotNull
HaxeReferenceExpression getReferenceExpression();

}
Loading

0 comments on commit 4b82210

Please sign in to comment.