Rename jet -> kotlin in frontend: parsing

org.jetbrains.jet.lang.parsing -> org.jetbrains.kotlin.parsing
This commit is contained in:
Alexander Udalov
2015-01-10 16:06:07 +03:00
parent 524fdc2527
commit fe67b374e7
43 changed files with 83 additions and 171 deletions
@@ -16,7 +16,7 @@
package org.jetbrains.jet.config;
import org.jetbrains.jet.lang.parsing.JetScriptDefinition;
import org.jetbrains.kotlin.parsing.JetScriptDefinition;
import java.util.List;
@@ -1,81 +0,0 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.WhitespacesAndCommentsBinder;
import com.intellij.psi.tree.IElementType;
import org.jetbrains.annotations.Nullable;
public class MarkerAdapter implements PsiBuilder.Marker {
private final PsiBuilder.Marker delegate;
public MarkerAdapter(PsiBuilder.Marker delegate) {
this.delegate = delegate;
}
@Override
public PsiBuilder.Marker precede() {
return delegate.precede();
}
@Override
public void drop() {
delegate.drop();
}
@Override
public void rollbackTo() {
delegate.rollbackTo();
}
@Override
public void done(IElementType type) {
delegate.done(type);
}
@Override
public void collapse(IElementType type) {
delegate.collapse(type);
}
@Override
public void doneBefore(IElementType type, PsiBuilder.Marker before) {
delegate.doneBefore(type, before);
}
@Override
public void doneBefore(IElementType type, PsiBuilder.Marker before, String errorMessage) {
delegate.doneBefore(type, before, errorMessage);
}
@Override
public void error(String message) {
delegate.error(message);
}
@Override
public void errorBefore(String message, PsiBuilder.Marker before) {
delegate.errorBefore(message, before);
}
@Override
public void setCustomEdgeTokenBinders(@Nullable WhitespacesAndCommentsBinder left, @Nullable WhitespacesAndCommentsBinder right) {
delegate.setCustomEdgeTokenBinders(left, right);
}
}
@@ -17,12 +17,12 @@
package org.jetbrains.jet.lang.resolve;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.parsing.JetScriptDefinition;
import org.jetbrains.jet.lang.parsing.JetScriptDefinitionProvider;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.parsing.JetScriptDefinition;
import org.jetbrains.kotlin.parsing.JetScriptDefinitionProvider;
import org.jetbrains.kotlin.psi.JetFile;
import org.jetbrains.kotlin.psi.JetPackageDirective;
import org.jetbrains.kotlin.psi.JetScript;
import org.jetbrains.kotlin.name.FqName;
public class ScriptNameUtil {
private ScriptNameUtil() {
@@ -23,8 +23,8 @@ import org.jetbrains.kotlin.descriptors.SourceElement;
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor;
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl;
import org.jetbrains.jet.lang.parsing.JetScriptDefinition;
import org.jetbrains.jet.lang.parsing.JetScriptDefinitionProvider;
import org.jetbrains.kotlin.parsing.JetScriptDefinition;
import org.jetbrains.kotlin.parsing.JetScriptDefinitionProvider;
import org.jetbrains.kotlin.psi.JetFile;
import org.jetbrains.kotlin.psi.JetScript;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.lang.PsiBuilder;
import com.intellij.psi.tree.IElementType;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.psi.tree.IElementType;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
public abstract class AbstractTokenStreamPredicate implements TokenStreamPredicate {
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2014 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing
package org.jetbrains.kotlin.parsing
import com.intellij.lang.WhitespacesAndCommentsBinder
import com.intellij.psi.tree.IElementType
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
public interface Consumer<T> {
void consume(T item);
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
public class FirstBefore extends AbstractTokenStreamPattern {
private final TokenStreamPredicate lookFor;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2014 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.google.common.collect.ImmutableMap;
import com.intellij.lang.PsiBuilder;
@@ -31,8 +31,8 @@ import java.util.HashSet;
import java.util.Set;
import static org.jetbrains.jet.JetNodeTypes.*;
import static org.jetbrains.jet.lang.parsing.JetParsing.AnnotationParsingMode.REGULAR_ANNOTATIONS_ALLOW_SHORTS;
import static org.jetbrains.jet.lang.parsing.JetParsing.AnnotationParsingMode.REGULAR_ANNOTATIONS_ONLY_WITH_BRACKETS;
import static org.jetbrains.kotlin.parsing.JetParsing.AnnotationParsingMode.REGULAR_ANNOTATIONS_ALLOW_SHORTS;
import static org.jetbrains.kotlin.parsing.JetParsing.AnnotationParsingMode.REGULAR_ANNOTATIONS_ONLY_WITH_BRACKETS;
import static org.jetbrains.kotlin.lexer.JetTokens.*;
public class JetExpressionParsing extends AbstractJetParsing {
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.lang.ASTNode;
import com.intellij.lang.PsiBuilder;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.intellij.lang.ASTNode;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2014 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.lang.PsiBuilder;
import com.intellij.openapi.diagnostic.Logger;
@@ -29,7 +29,7 @@ import java.util.HashMap;
import java.util.Map;
import static org.jetbrains.jet.JetNodeTypes.*;
import static org.jetbrains.jet.lang.parsing.JetParsing.AnnotationParsingMode.*;
import static org.jetbrains.kotlin.parsing.JetParsing.AnnotationParsingMode.*;
import static org.jetbrains.kotlin.lexer.JetTokens.*;
public class JetParsing extends AbstractJetParsing {
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,9 +14,8 @@
* limitations under the License.
*/
package org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
import org.jetbrains.jet.lang.resolve.ImportPath;
@@ -35,7 +34,7 @@ public class JetScriptDefinition {
}
private static List<ImportPath> importPaths(List<String> imports) {
ArrayList<ImportPath> paths = new ArrayList<ImportPath>(imports.size());
List<ImportPath> paths = new ArrayList<ImportPath>(imports.size());
for (String anImport : imports) {
paths.add(new ImportPath(anImport));
}
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
public class LastBefore extends AbstractTokenStreamPattern {
private final boolean dontStopRightAfterOccurrence;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.lang.PsiBuilder;
import com.intellij.psi.tree.IElementType;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.lang.impl.PsiBuilderAdapter;
import com.intellij.psi.tree.IElementType;
@@ -24,7 +24,6 @@ public class SemanticWhitespaceAwarePsiBuilderAdapter extends PsiBuilderAdapter
private final SemanticWhitespaceAwarePsiBuilder myBuilder;
public SemanticWhitespaceAwarePsiBuilderAdapter(SemanticWhitespaceAwarePsiBuilder builder) {
super(builder);
this.myBuilder = builder;
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
public class SemanticWhitespaceAwarePsiBuilderForByClause extends SemanticWhitespaceAwarePsiBuilderAdapter {
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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,7 @@
* limitations under the License.
*/
package org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.lang.PsiBuilder;
import com.intellij.lang.impl.PsiBuilderAdapter;
@@ -23,13 +22,11 @@ import com.intellij.lang.impl.PsiBuilderImpl;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.util.containers.Stack;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.lexer.JetTokens;
import com.intellij.util.containers.Stack;
import static org.jetbrains.kotlin.lexer.JetTokens.*;
public class SemanticWhitespaceAwarePsiBuilderImpl extends PsiBuilderAdapter implements SemanticWhitespaceAwarePsiBuilder {
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.psi.tree.IElementType;
@@ -34,7 +34,7 @@ public interface TokenStreamPattern {
int result();
/**
* Decides if the combination of open bracet counts makes a "top level position"
* Decides if the combination of open bracket counts makes a "top level position"
* Straightforward meaning would be: if all counts are zero, then it's a top level
*/
boolean isTopLevel(int openAngleBrackets, int openBrackets, int openBraces, int openParentheses);
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
public interface TokenStreamPredicate {
boolean matching(boolean topLevel);
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
* Copyright 2010-2015 JetBrains s.r.o.
*
* 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 org.jetbrains.jet.lang.parsing;
package org.jetbrains.kotlin.parsing;
import com.intellij.psi.tree.IElementType;
@@ -22,7 +22,6 @@ public class TruncatedSemanticWhitespaceAwarePsiBuilder extends SemanticWhitespa
private final int myEOFPosition;
public TruncatedSemanticWhitespaceAwarePsiBuilder(SemanticWhitespaceAwarePsiBuilder builder, int eofPosition) {
super(builder);
this.myEOFPosition = eofPosition;
@@ -23,7 +23,7 @@ import com.intellij.lang.PsiBuilderFactory;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.parsing.JetParser;
import org.jetbrains.kotlin.parsing.JetParser;
import org.jetbrains.kotlin.psi.stubs.elements.JetFileElementType;
public class JetBlockCodeFragmentType extends JetFileElementType {
@@ -23,7 +23,7 @@ import com.intellij.lang.PsiBuilderFactory;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.parsing.JetParser;
import org.jetbrains.kotlin.parsing.JetParser;
import org.jetbrains.kotlin.psi.stubs.elements.JetFileElementType;
public class JetExpressionCodeFragmentType extends JetFileElementType {
@@ -17,7 +17,7 @@
package org.jetbrains.kotlin.psi
import com.intellij.lang.ASTNode
import org.jetbrains.jet.lang.parsing.JetExpressionParsing
import org.jetbrains.kotlin.parsing.JetExpressionParsing
public class JetOperationReferenceExpression(node: ASTNode) : JetSimpleNameExpressionImpl(node) {
override fun getReferencedNameElement() = findChildByType(JetExpressionParsing.ALL_OPERATIONS) ?: this
@@ -36,7 +36,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.JetNodeTypes;
import org.jetbrains.kotlin.kdoc.psi.api.KDocElement;
import org.jetbrains.jet.lang.parsing.JetExpressionParsing;
import org.jetbrains.kotlin.parsing.JetExpressionParsing;
import org.jetbrains.kotlin.psi.psiUtil.PsiUtilPackage;
import org.jetbrains.kotlin.name.FqName;
import org.jetbrains.kotlin.name.Name;
@@ -23,7 +23,7 @@ import com.intellij.lang.PsiBuilderFactory;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.parsing.JetParser;
import org.jetbrains.kotlin.parsing.JetParser;
import org.jetbrains.kotlin.psi.stubs.elements.JetFileElementType;
public class JetTypeCodeFragmentType extends JetFileElementType {
@@ -28,7 +28,7 @@ import com.intellij.psi.tree.IStubFileElementType;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.lang.parsing.JetParser;
import org.jetbrains.kotlin.parsing.JetParser;
import org.jetbrains.kotlin.psi.stubs.KotlinFileStub;
import org.jetbrains.kotlin.psi.stubs.impl.KotlinFileStubImpl;
import org.jetbrains.jet.plugin.JetLanguage;