Import syntax fixed
This commit is contained in:
@@ -15,7 +15,7 @@ namespaceHeader
|
||||
;
|
||||
|
||||
import
|
||||
: "import" SimpleName{"."} ("." "*" | "as" SimpleName)?
|
||||
: "import" ("namespace" ".")? SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI?
|
||||
;
|
||||
|
||||
toplevelObject
|
||||
|
||||
@@ -146,7 +146,7 @@ public class JetParsing extends AbstractJetParsing {
|
||||
|
||||
/*
|
||||
* import
|
||||
* : "import" SimpleName{"."} ("." "*" | "as" SimpleName)?
|
||||
* : "import" ("namespace" ".")? SimpleName{"."} ("." "*" | "as" SimpleName)? SEMI?
|
||||
* ;
|
||||
*/
|
||||
private void parseImportDirective() {
|
||||
@@ -154,26 +154,31 @@ public class JetParsing extends AbstractJetParsing {
|
||||
PsiBuilder.Marker importDirective = mark();
|
||||
advance(); // IMPORT_KEYWORD
|
||||
|
||||
expect(IDENTIFIER, "Expecting qualified name", TokenSet.create(DOT, MAP));
|
||||
while (at(DOT)) {
|
||||
advance(); // DOT
|
||||
if (at(IDENTIFIER)) {
|
||||
advance(); // IDENTIFIER
|
||||
}
|
||||
else if (at(MUL)) {
|
||||
advance(); // MUL
|
||||
handleUselessRename();
|
||||
break;
|
||||
}
|
||||
else {
|
||||
errorWithRecovery("Qualified name must be a '.'-separated identifier list", TokenSet.create(AS_KEYWORD, DOT, MAP, SEMICOLON));
|
||||
}
|
||||
|
||||
PsiBuilder.Marker reference = mark();
|
||||
|
||||
if (at(NAMESPACE_KEYWORD)) {
|
||||
advance(); // NAMESPACE_KEYWORD
|
||||
expect(DOT, "Expecting '.'", TokenSet.create(IDENTIFIER, MUL, SEMICOLON));
|
||||
}
|
||||
if (at(MAP)) {
|
||||
advance(); // MAP
|
||||
|
||||
expect(IDENTIFIER, "Expecting qualified name", TokenSet.create(DOT, AS_KEYWORD));
|
||||
while (at(DOT) && lookahead(1) != MUL) {
|
||||
PsiBuilder.Marker precede = reference.precede();
|
||||
reference.done(REFERENCE_EXPRESSION);
|
||||
reference = precede;
|
||||
advance(); // DOT
|
||||
expect(IDENTIFIER, "Qualified name must be a '.'-separated identifier list", TokenSet.create(AS_KEYWORD, DOT, SEMICOLON));
|
||||
}
|
||||
reference.done(REFERENCE_EXPRESSION);
|
||||
|
||||
if (at(DOT)) {
|
||||
advance(); // DOT
|
||||
assert _at(MUL);
|
||||
advance(); // MUL
|
||||
handleUselessRename();
|
||||
}
|
||||
else if (at(AS_KEYWORD)) {
|
||||
if (at(AS_KEYWORD)) {
|
||||
advance(); // AS_KEYWORD
|
||||
expect(IDENTIFIER, "Expecting identifier", TokenSet.create(SEMICOLON));
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.intellij.lang.ASTNode;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.JetNodeTypes;
|
||||
import org.jetbrains.jet.lexer.JetTokens;
|
||||
|
||||
/**
|
||||
@@ -19,23 +20,13 @@ public class JetImportDirective extends JetElement {
|
||||
visitor.visitImportDirective(this);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getImportedName() {
|
||||
StringBuilder answer = new StringBuilder();
|
||||
ASTNode childNode = getNode().getFirstChildNode();
|
||||
while (childNode != null) {
|
||||
IElementType tt = childNode.getElementType();
|
||||
if (tt == JetTokens.MAP || tt == JetTokens.AS_KEYWORD) break;
|
||||
if (tt == JetTokens.IDENTIFIER || tt == JetTokens.DOT) {
|
||||
answer.append(childNode.getText());
|
||||
}
|
||||
childNode = childNode.getTreeNext();
|
||||
}
|
||||
return answer.toString();
|
||||
@Nullable @IfNotParsed
|
||||
public JetReferenceExpression getImportedName() {
|
||||
return (JetReferenceExpression) findChildByType(JetNodeTypes.REFERENCE_EXPRESSION);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ASTNode getAliasNameNode() {
|
||||
public ASTNode getAliasNameNode() {
|
||||
boolean asPassed = false;
|
||||
ASTNode childNode = getNode().getFirstChildNode();
|
||||
while (childNode != null) {
|
||||
@@ -60,6 +51,6 @@ public class JetImportDirective extends JetElement {
|
||||
}
|
||||
|
||||
public boolean isAllUnder() {
|
||||
return getNode().findChildByType(JetTokens.MAP) != null;
|
||||
return getNode().findChildByType(JetTokens.MUL) != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,10 @@ public class JetReferenceExpression extends JetExpression {
|
||||
return findChildByClass(JetReferenceExpression.class);
|
||||
}
|
||||
|
||||
@Nullable @IfNotParsed
|
||||
public String getReferencedName() {
|
||||
return getNode().findChildByType(REFERENCE_TOKENS).getText();
|
||||
ASTNode node = getNode().findChildByType(REFERENCE_TOKENS);
|
||||
return node == null ? null : node.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,6 +49,7 @@ public class JetReferenceExpression extends JetExpression {
|
||||
|
||||
@Override
|
||||
public PsiReference getReference() {
|
||||
if (getReferencedName() == null) return null;
|
||||
return new PsiReference() {
|
||||
@Override
|
||||
public PsiElement getElement() {
|
||||
|
||||
@@ -136,8 +136,8 @@ RAW_STRING_LITERAL = {THREE_QUO} {QUO_STRING_CHAR}* {THREE_QUO}?
|
||||
<YYINITIAL> "||" { return JetTokens.OROR ; }
|
||||
<YYINITIAL> "?." { return JetTokens.SAFE_ACCESS;}
|
||||
<YYINITIAL> "?:" { return JetTokens.ELVIS ; }
|
||||
<YYINITIAL> ".*" { return JetTokens.MAP ; }
|
||||
<YYINITIAL> ".?" { return JetTokens.FILTER ; }
|
||||
//<YYINITIAL> ".*" { return JetTokens.MAP ; }
|
||||
//<YYINITIAL> ".?" { return JetTokens.FILTER ; }
|
||||
<YYINITIAL> "*=" { return JetTokens.MULTEQ ; }
|
||||
<YYINITIAL> "/=" { return JetTokens.DIVEQ ; }
|
||||
<YYINITIAL> "%=" { return JetTokens.PERCEQ ; }
|
||||
|
||||
@@ -88,8 +88,8 @@ public interface JetTokens {
|
||||
JetToken OROR = new JetToken("OROR");
|
||||
JetToken SAFE_ACCESS = new JetToken("SAFE_ACCESS");
|
||||
JetToken ELVIS = new JetToken("ELVIS");
|
||||
JetToken MAP = new JetToken("MAP");
|
||||
JetToken FILTER = new JetToken("FILTER");
|
||||
// JetToken MAP = new JetToken("MAP");
|
||||
// JetToken FILTER = new JetToken("FILTER");
|
||||
JetToken QUEST = new JetToken("QUEST");
|
||||
JetToken COLON = new JetToken("COLON");
|
||||
JetToken SEMICOLON = new JetToken("SEMICOLON");
|
||||
@@ -160,6 +160,8 @@ public interface JetTokens {
|
||||
|
||||
TokenSet OPERATIONS = TokenSet.create(AS_KEYWORD, IS_KEYWORD, IN_KEYWORD, DOT, PLUSPLUS, MINUSMINUS, MUL, PLUS,
|
||||
MINUS, EXCL, DIV, PERC, LT, GT, LTEQ, GTEQ, EQEQEQ, ARROW, EXCLEQEQEQ, EQEQ, EXCLEQ, ANDAND, OROR,
|
||||
SAFE_ACCESS, ELVIS, MAP, FILTER, QUEST, COLON, SEMICOLON, RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ,
|
||||
SAFE_ACCESS, ELVIS,
|
||||
// MAP, FILTER,
|
||||
QUEST, COLON, SEMICOLON, RANGE, EQ, MULTEQ, DIVEQ, PERCEQ, PLUSEQ, MINUSEQ,
|
||||
NOT_IN, NOT_IS, HASH, IDENTIFIER, LABEL_IDENTIFIER, ATAT, AT);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,4 +15,5 @@ JetFile: FileStart_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
@@ -3,13 +3,17 @@ JetFile: ImportSoftKW.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
namespace foo.bar.goo
|
||||
|
||||
import namespace.foo
|
||||
import foo
|
||||
import foo.bar
|
||||
import foo as bar
|
||||
|
||||
@@ -12,19 +12,31 @@ JetFile: Imports.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(namespace)('namespace')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -33,9 +45,11 @@ JetFile: Imports.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -44,13 +58,16 @@ JetFile: Imports.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(MAP)('.*')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(MUL)('*')
|
||||
@@ -1,5 +1,9 @@
|
||||
namespace foo.bar.goo
|
||||
|
||||
import namespace ;
|
||||
import namespace.*
|
||||
import namespace. ;
|
||||
|
||||
import foo as
|
||||
import foo.
|
||||
import foo.bar.
|
||||
|
||||
@@ -12,7 +12,38 @@ JetFile: Imports_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(namespace)('namespace')
|
||||
PsiErrorElement:Expecting '.'
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting qualified name
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(namespace)('namespace')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Expecting qualified name
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(namespace)('namespace')
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting qualified name
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace('\n')
|
||||
@@ -26,12 +57,15 @@ JetFile: Imports_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting namespace or top level declaration
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
@@ -47,10 +81,13 @@ JetFile: Imports_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
@@ -60,10 +97,13 @@ JetFile: Imports_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
@@ -82,32 +122,39 @@ JetFile: Imports_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -118,10 +165,13 @@ JetFile: Imports_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
@@ -133,10 +183,13 @@ JetFile: Imports_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
|
||||
@@ -12,7 +12,8 @@ JetFile: NamespaceBlock.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -30,10 +31,13 @@ JetFile: NamespaceBlock.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
CLASS
|
||||
@@ -133,6 +137,7 @@ JetFile: NamespaceBlock.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('sdf')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('sdf')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -12,7 +12,8 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace('\n')
|
||||
@@ -26,12 +27,15 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(IDENTIFIER)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Expecting namespace or top level declaration
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
@@ -56,10 +60,13 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
@@ -69,10 +76,13 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
@@ -91,32 +101,39 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n ')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(SEMICOLON)(';')
|
||||
PsiWhiteSpace('\n ')
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiErrorElement:Qualified name must be a '.'-separated identifier list
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(as)('as')
|
||||
PsiWhiteSpace(' ')
|
||||
@@ -127,10 +144,13 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
@@ -142,10 +162,13 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(DOT)('.')
|
||||
PsiElement(IDENTIFIER)('bar')
|
||||
PsiElement(MAP)('.*')
|
||||
PsiElement(MUL)('*')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:Cannot rename a all imported items to one identifier
|
||||
PsiElement(as)('as')
|
||||
@@ -266,6 +289,7 @@ JetFile: NamespaceBlock_ERR.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('sdf')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('sdf')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -12,7 +12,8 @@ JetFile: SoftKeywords.jet
|
||||
IMPORT_DIRECTIVE
|
||||
PsiElement(import)('import')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('foo')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
MODIFIER_LIST
|
||||
|
||||
Reference in New Issue
Block a user