Rename package ast to syntax (#968)

This commit is contained in:
Daniel Chao
2025-02-19 10:57:41 -08:00
committed by GitHub
parent baa34a6dd1
commit 227f0637fc
48 changed files with 396 additions and 396 deletions

View File

@@ -23,7 +23,7 @@ import org.pkl.core.util.IoUtils
import org.pkl.core.http.HttpClient import org.pkl.core.http.HttpClient
import org.pkl.core.parser.Parser import org.pkl.core.parser.Parser
import org.pkl.core.parser.ParserError import org.pkl.core.parser.ParserError
import org.pkl.core.parser.ast.ClassProperty import org.pkl.core.parser.syntax.ClassProperty
import org.pkl.core.resource.ResourceReaders import org.pkl.core.resource.ResourceReaders
import java.nio.file.Files import java.nio.file.Files
import kotlin.io.path.isDirectory import kotlin.io.path.isDirectory
@@ -302,7 +302,7 @@ class DocSnippetTestsEngine : HierarchicalTestEngine<DocSnippetTestsEngine.Execu
override fun getType() = Type.TEST override fun getType() = Type.TEST
private val parsed: org.pkl.core.parser.ast.Node by lazy { private val parsed: org.pkl.core.parser.syntax.Node by lazy {
when (language) { when (language) {
"pkl" -> Parser().parseModule(code) "pkl" -> Parser().parseModule(code)
"pkl-expr" -> Parser().parseExpressionInput(code) "pkl-expr" -> Parser().parseExpressionInput(code)

View File

@@ -20,10 +20,10 @@ import com.oracle.truffle.api.source.SourceSection;
import java.util.List; import java.util.List;
import org.pkl.core.parser.BaseParserVisitor; import org.pkl.core.parser.BaseParserVisitor;
import org.pkl.core.parser.Span; import org.pkl.core.parser.Span;
import org.pkl.core.parser.ast.DocComment; import org.pkl.core.parser.syntax.DocComment;
import org.pkl.core.parser.ast.Modifier; import org.pkl.core.parser.syntax.Modifier;
import org.pkl.core.parser.ast.Modifier.ModifierValue; import org.pkl.core.parser.syntax.Modifier.ModifierValue;
import org.pkl.core.parser.ast.Node; import org.pkl.core.parser.syntax.Node;
import org.pkl.core.runtime.VmExceptionBuilder; import org.pkl.core.runtime.VmExceptionBuilder;
import org.pkl.core.util.Nullable; import org.pkl.core.util.Nullable;

View File

@@ -158,80 +158,80 @@ import org.pkl.core.module.ModuleKeys;
import org.pkl.core.module.ResolvedModuleKey; import org.pkl.core.module.ResolvedModuleKey;
import org.pkl.core.packages.PackageLoadError; import org.pkl.core.packages.PackageLoadError;
import org.pkl.core.parser.Span; import org.pkl.core.parser.Span;
import org.pkl.core.parser.ast.Annotation; import org.pkl.core.parser.syntax.Annotation;
import org.pkl.core.parser.ast.ArgumentList; import org.pkl.core.parser.syntax.ArgumentList;
import org.pkl.core.parser.ast.Class; import org.pkl.core.parser.syntax.Class;
import org.pkl.core.parser.ast.ClassMethod; import org.pkl.core.parser.syntax.ClassMethod;
import org.pkl.core.parser.ast.ClassProperty; import org.pkl.core.parser.syntax.ClassProperty;
import org.pkl.core.parser.ast.Expr; import org.pkl.core.parser.syntax.Expr;
import org.pkl.core.parser.ast.Expr.AmendsExpr; import org.pkl.core.parser.syntax.Expr.AmendsExpr;
import org.pkl.core.parser.ast.Expr.BinaryOperatorExpr; import org.pkl.core.parser.syntax.Expr.BinaryOperatorExpr;
import org.pkl.core.parser.ast.Expr.BoolLiteralExpr; import org.pkl.core.parser.syntax.Expr.BoolLiteralExpr;
import org.pkl.core.parser.ast.Expr.FloatLiteralExpr; import org.pkl.core.parser.syntax.Expr.FloatLiteralExpr;
import org.pkl.core.parser.ast.Expr.FunctionLiteralExpr; import org.pkl.core.parser.syntax.Expr.FunctionLiteralExpr;
import org.pkl.core.parser.ast.Expr.IfExpr; import org.pkl.core.parser.syntax.Expr.IfExpr;
import org.pkl.core.parser.ast.Expr.ImportExpr; import org.pkl.core.parser.syntax.Expr.ImportExpr;
import org.pkl.core.parser.ast.Expr.IntLiteralExpr; import org.pkl.core.parser.syntax.Expr.IntLiteralExpr;
import org.pkl.core.parser.ast.Expr.LetExpr; import org.pkl.core.parser.syntax.Expr.LetExpr;
import org.pkl.core.parser.ast.Expr.LogicalNotExpr; import org.pkl.core.parser.syntax.Expr.LogicalNotExpr;
import org.pkl.core.parser.ast.Expr.ModuleExpr; import org.pkl.core.parser.syntax.Expr.ModuleExpr;
import org.pkl.core.parser.ast.Expr.MultiLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.MultiLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.NewExpr; import org.pkl.core.parser.syntax.Expr.NewExpr;
import org.pkl.core.parser.ast.Expr.NonNullExpr; import org.pkl.core.parser.syntax.Expr.NonNullExpr;
import org.pkl.core.parser.ast.Expr.NullLiteralExpr; import org.pkl.core.parser.syntax.Expr.NullLiteralExpr;
import org.pkl.core.parser.ast.Expr.OuterExpr; import org.pkl.core.parser.syntax.Expr.OuterExpr;
import org.pkl.core.parser.ast.Expr.ParenthesizedExpr; import org.pkl.core.parser.syntax.Expr.ParenthesizedExpr;
import org.pkl.core.parser.ast.Expr.QualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.QualifiedAccessExpr;
import org.pkl.core.parser.ast.Expr.ReadExpr; import org.pkl.core.parser.syntax.Expr.ReadExpr;
import org.pkl.core.parser.ast.Expr.SingleLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.SingleLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.SubscriptExpr; import org.pkl.core.parser.syntax.Expr.SubscriptExpr;
import org.pkl.core.parser.ast.Expr.SuperAccessExpr; import org.pkl.core.parser.syntax.Expr.SuperAccessExpr;
import org.pkl.core.parser.ast.Expr.SuperSubscriptExpr; import org.pkl.core.parser.syntax.Expr.SuperSubscriptExpr;
import org.pkl.core.parser.ast.Expr.ThisExpr; import org.pkl.core.parser.syntax.Expr.ThisExpr;
import org.pkl.core.parser.ast.Expr.ThrowExpr; import org.pkl.core.parser.syntax.Expr.ThrowExpr;
import org.pkl.core.parser.ast.Expr.TraceExpr; import org.pkl.core.parser.syntax.Expr.TraceExpr;
import org.pkl.core.parser.ast.Expr.TypeCastExpr; import org.pkl.core.parser.syntax.Expr.TypeCastExpr;
import org.pkl.core.parser.ast.Expr.TypeCheckExpr; import org.pkl.core.parser.syntax.Expr.TypeCheckExpr;
import org.pkl.core.parser.ast.Expr.UnaryMinusExpr; import org.pkl.core.parser.syntax.Expr.UnaryMinusExpr;
import org.pkl.core.parser.ast.Expr.UnqualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.UnqualifiedAccessExpr;
import org.pkl.core.parser.ast.ExtendsOrAmendsClause; import org.pkl.core.parser.syntax.ExtendsOrAmendsClause;
import org.pkl.core.parser.ast.Identifier; import org.pkl.core.parser.syntax.Identifier;
import org.pkl.core.parser.ast.ImportClause; import org.pkl.core.parser.syntax.ImportClause;
import org.pkl.core.parser.ast.Modifier; import org.pkl.core.parser.syntax.Modifier;
import org.pkl.core.parser.ast.Modifier.ModifierValue; import org.pkl.core.parser.syntax.Modifier.ModifierValue;
import org.pkl.core.parser.ast.Module; import org.pkl.core.parser.syntax.Module;
import org.pkl.core.parser.ast.Node; import org.pkl.core.parser.syntax.Node;
import org.pkl.core.parser.ast.ObjectBody; import org.pkl.core.parser.syntax.ObjectBody;
import org.pkl.core.parser.ast.ObjectMember.ForGenerator; import org.pkl.core.parser.syntax.ObjectMember.ForGenerator;
import org.pkl.core.parser.ast.ObjectMember.MemberPredicate; import org.pkl.core.parser.syntax.ObjectMember.MemberPredicate;
import org.pkl.core.parser.ast.ObjectMember.ObjectElement; import org.pkl.core.parser.syntax.ObjectMember.ObjectElement;
import org.pkl.core.parser.ast.ObjectMember.ObjectEntry; import org.pkl.core.parser.syntax.ObjectMember.ObjectEntry;
import org.pkl.core.parser.ast.ObjectMember.ObjectMethod; import org.pkl.core.parser.syntax.ObjectMember.ObjectMethod;
import org.pkl.core.parser.ast.ObjectMember.ObjectProperty; import org.pkl.core.parser.syntax.ObjectMember.ObjectProperty;
import org.pkl.core.parser.ast.ObjectMember.ObjectSpread; import org.pkl.core.parser.syntax.ObjectMember.ObjectSpread;
import org.pkl.core.parser.ast.ObjectMember.WhenGenerator; import org.pkl.core.parser.syntax.ObjectMember.WhenGenerator;
import org.pkl.core.parser.ast.Parameter; import org.pkl.core.parser.syntax.Parameter;
import org.pkl.core.parser.ast.Parameter.TypedIdentifier; import org.pkl.core.parser.syntax.Parameter.TypedIdentifier;
import org.pkl.core.parser.ast.ParameterList; import org.pkl.core.parser.syntax.ParameterList;
import org.pkl.core.parser.ast.QualifiedIdentifier; import org.pkl.core.parser.syntax.QualifiedIdentifier;
import org.pkl.core.parser.ast.StringConstant; import org.pkl.core.parser.syntax.StringConstant;
import org.pkl.core.parser.ast.StringPart; import org.pkl.core.parser.syntax.StringPart;
import org.pkl.core.parser.ast.StringPart.StringChars; import org.pkl.core.parser.syntax.StringPart.StringChars;
import org.pkl.core.parser.ast.StringPart.StringInterpolation; import org.pkl.core.parser.syntax.StringPart.StringInterpolation;
import org.pkl.core.parser.ast.Type; import org.pkl.core.parser.syntax.Type;
import org.pkl.core.parser.ast.Type.ConstrainedType; import org.pkl.core.parser.syntax.Type.ConstrainedType;
import org.pkl.core.parser.ast.Type.DeclaredType; import org.pkl.core.parser.syntax.Type.DeclaredType;
import org.pkl.core.parser.ast.Type.FunctionType; import org.pkl.core.parser.syntax.Type.FunctionType;
import org.pkl.core.parser.ast.Type.ModuleType; import org.pkl.core.parser.syntax.Type.ModuleType;
import org.pkl.core.parser.ast.Type.NothingType; import org.pkl.core.parser.syntax.Type.NothingType;
import org.pkl.core.parser.ast.Type.NullableType; import org.pkl.core.parser.syntax.Type.NullableType;
import org.pkl.core.parser.ast.Type.ParenthesizedType; import org.pkl.core.parser.syntax.Type.ParenthesizedType;
import org.pkl.core.parser.ast.Type.StringConstantType; import org.pkl.core.parser.syntax.Type.StringConstantType;
import org.pkl.core.parser.ast.Type.UnionType; import org.pkl.core.parser.syntax.Type.UnionType;
import org.pkl.core.parser.ast.Type.UnknownType; import org.pkl.core.parser.syntax.Type.UnknownType;
import org.pkl.core.parser.ast.TypeAlias; import org.pkl.core.parser.syntax.TypeAlias;
import org.pkl.core.parser.ast.TypeAnnotation; import org.pkl.core.parser.syntax.TypeAnnotation;
import org.pkl.core.parser.ast.TypeParameterList; import org.pkl.core.parser.syntax.TypeParameterList;
import org.pkl.core.runtime.BaseModule; import org.pkl.core.runtime.BaseModule;
import org.pkl.core.runtime.ModuleInfo; import org.pkl.core.runtime.ModuleInfo;
import org.pkl.core.runtime.ModuleResolver; import org.pkl.core.runtime.ModuleResolver;
@@ -1097,7 +1097,7 @@ public class AstBuilder extends AbstractAstBuilder<Object> {
return Pair.of(elementNodes, isConstantNodes); return Pair.of(elementNodes, isConstantNodes);
} }
public GeneratorMemberNode visitObjectMember(org.pkl.core.parser.ast.ObjectMember member) { public GeneratorMemberNode visitObjectMember(org.pkl.core.parser.syntax.ObjectMember member) {
return (GeneratorMemberNode) member.accept(this); return (GeneratorMemberNode) member.accept(this);
} }
@@ -2375,7 +2375,7 @@ public class AstBuilder extends AbstractAstBuilder<Object> {
} }
private GeneratorMemberNode[] doVisitGeneratorMemberNodes( private GeneratorMemberNode[] doVisitGeneratorMemberNodes(
List<? extends org.pkl.core.parser.ast.ObjectMember> members) { List<? extends org.pkl.core.parser.syntax.ObjectMember> members) {
var result = new GeneratorMemberNode[members.size()]; var result = new GeneratorMemberNode[members.size()];
for (var i = 0; i < result.length; i++) { for (var i = 0; i < result.length; i++) {
result[i] = visitObjectMember(members.get(i)); result[i] = visitObjectMember(members.get(i));
@@ -2666,7 +2666,7 @@ public class AstBuilder extends AbstractAstBuilder<Object> {
} }
var forExprCtx = ctx.parent(); var forExprCtx = ctx.parent();
while (forExprCtx != null while (forExprCtx != null
&& forExprCtx.getClass() != org.pkl.core.parser.ast.ObjectMember.ForGenerator.class) { && forExprCtx.getClass() != org.pkl.core.parser.syntax.ObjectMember.ForGenerator.class) {
forExprCtx = forExprCtx.parent(); forExprCtx = forExprCtx.parent();
} }
assert forExprCtx != null; assert forExprCtx != null;
@@ -2674,7 +2674,7 @@ public class AstBuilder extends AbstractAstBuilder<Object> {
.evalError(errorMessageKey) .evalError(errorMessageKey)
.withSourceSection( .withSourceSection(
createSourceSection( createSourceSection(
((org.pkl.core.parser.ast.ObjectMember.ForGenerator) forExprCtx).forSpan())) ((org.pkl.core.parser.syntax.ObjectMember.ForGenerator) forExprCtx).forSpan()))
.build(); .build();
} }

View File

@@ -26,15 +26,15 @@ import org.pkl.core.module.ModuleKey;
import org.pkl.core.module.ResolvedModuleKey; import org.pkl.core.module.ResolvedModuleKey;
import org.pkl.core.parser.Parser; import org.pkl.core.parser.Parser;
import org.pkl.core.parser.ParserError; import org.pkl.core.parser.ParserError;
import org.pkl.core.parser.ast.Expr; import org.pkl.core.parser.syntax.Expr;
import org.pkl.core.parser.ast.Expr.ImportExpr; import org.pkl.core.parser.syntax.Expr.ImportExpr;
import org.pkl.core.parser.ast.Expr.ReadExpr; import org.pkl.core.parser.syntax.Expr.ReadExpr;
import org.pkl.core.parser.ast.Expr.ReadType; import org.pkl.core.parser.syntax.Expr.ReadType;
import org.pkl.core.parser.ast.Expr.SingleLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.SingleLineStringLiteralExpr;
import org.pkl.core.parser.ast.ExtendsOrAmendsClause; import org.pkl.core.parser.syntax.ExtendsOrAmendsClause;
import org.pkl.core.parser.ast.ExtendsOrAmendsClause.Type; import org.pkl.core.parser.syntax.ExtendsOrAmendsClause.Type;
import org.pkl.core.parser.ast.ImportClause; import org.pkl.core.parser.syntax.ImportClause;
import org.pkl.core.parser.ast.StringPart.StringChars; import org.pkl.core.parser.syntax.StringPart.StringChars;
import org.pkl.core.runtime.VmExceptionBuilder; import org.pkl.core.runtime.VmExceptionBuilder;
import org.pkl.core.runtime.VmUtils; import org.pkl.core.runtime.VmUtils;
import org.pkl.core.util.IoUtils; import org.pkl.core.util.IoUtils;

View File

@@ -15,80 +15,80 @@
*/ */
package org.pkl.core.parser; package org.pkl.core.parser;
import org.pkl.core.parser.ast.Annotation; import org.pkl.core.parser.syntax.Annotation;
import org.pkl.core.parser.ast.ArgumentList; import org.pkl.core.parser.syntax.ArgumentList;
import org.pkl.core.parser.ast.Class; import org.pkl.core.parser.syntax.Class;
import org.pkl.core.parser.ast.ClassBody; import org.pkl.core.parser.syntax.ClassBody;
import org.pkl.core.parser.ast.ClassMethod; import org.pkl.core.parser.syntax.ClassMethod;
import org.pkl.core.parser.ast.ClassProperty; import org.pkl.core.parser.syntax.ClassProperty;
import org.pkl.core.parser.ast.DocComment; import org.pkl.core.parser.syntax.DocComment;
import org.pkl.core.parser.ast.Expr.AmendsExpr; import org.pkl.core.parser.syntax.Expr.AmendsExpr;
import org.pkl.core.parser.ast.Expr.BinaryOperatorExpr; import org.pkl.core.parser.syntax.Expr.BinaryOperatorExpr;
import org.pkl.core.parser.ast.Expr.BoolLiteralExpr; import org.pkl.core.parser.syntax.Expr.BoolLiteralExpr;
import org.pkl.core.parser.ast.Expr.FloatLiteralExpr; import org.pkl.core.parser.syntax.Expr.FloatLiteralExpr;
import org.pkl.core.parser.ast.Expr.FunctionLiteralExpr; import org.pkl.core.parser.syntax.Expr.FunctionLiteralExpr;
import org.pkl.core.parser.ast.Expr.IfExpr; import org.pkl.core.parser.syntax.Expr.IfExpr;
import org.pkl.core.parser.ast.Expr.ImportExpr; import org.pkl.core.parser.syntax.Expr.ImportExpr;
import org.pkl.core.parser.ast.Expr.IntLiteralExpr; import org.pkl.core.parser.syntax.Expr.IntLiteralExpr;
import org.pkl.core.parser.ast.Expr.LetExpr; import org.pkl.core.parser.syntax.Expr.LetExpr;
import org.pkl.core.parser.ast.Expr.LogicalNotExpr; import org.pkl.core.parser.syntax.Expr.LogicalNotExpr;
import org.pkl.core.parser.ast.Expr.ModuleExpr; import org.pkl.core.parser.syntax.Expr.ModuleExpr;
import org.pkl.core.parser.ast.Expr.MultiLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.MultiLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.NewExpr; import org.pkl.core.parser.syntax.Expr.NewExpr;
import org.pkl.core.parser.ast.Expr.NonNullExpr; import org.pkl.core.parser.syntax.Expr.NonNullExpr;
import org.pkl.core.parser.ast.Expr.NullLiteralExpr; import org.pkl.core.parser.syntax.Expr.NullLiteralExpr;
import org.pkl.core.parser.ast.Expr.OuterExpr; import org.pkl.core.parser.syntax.Expr.OuterExpr;
import org.pkl.core.parser.ast.Expr.ParenthesizedExpr; import org.pkl.core.parser.syntax.Expr.ParenthesizedExpr;
import org.pkl.core.parser.ast.Expr.QualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.QualifiedAccessExpr;
import org.pkl.core.parser.ast.Expr.ReadExpr; import org.pkl.core.parser.syntax.Expr.ReadExpr;
import org.pkl.core.parser.ast.Expr.SingleLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.SingleLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.SubscriptExpr; import org.pkl.core.parser.syntax.Expr.SubscriptExpr;
import org.pkl.core.parser.ast.Expr.SuperAccessExpr; import org.pkl.core.parser.syntax.Expr.SuperAccessExpr;
import org.pkl.core.parser.ast.Expr.SuperSubscriptExpr; import org.pkl.core.parser.syntax.Expr.SuperSubscriptExpr;
import org.pkl.core.parser.ast.Expr.ThisExpr; import org.pkl.core.parser.syntax.Expr.ThisExpr;
import org.pkl.core.parser.ast.Expr.ThrowExpr; import org.pkl.core.parser.syntax.Expr.ThrowExpr;
import org.pkl.core.parser.ast.Expr.TraceExpr; import org.pkl.core.parser.syntax.Expr.TraceExpr;
import org.pkl.core.parser.ast.Expr.TypeCastExpr; import org.pkl.core.parser.syntax.Expr.TypeCastExpr;
import org.pkl.core.parser.ast.Expr.TypeCheckExpr; import org.pkl.core.parser.syntax.Expr.TypeCheckExpr;
import org.pkl.core.parser.ast.Expr.UnaryMinusExpr; import org.pkl.core.parser.syntax.Expr.UnaryMinusExpr;
import org.pkl.core.parser.ast.Expr.UnqualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.UnqualifiedAccessExpr;
import org.pkl.core.parser.ast.ExtendsOrAmendsClause; import org.pkl.core.parser.syntax.ExtendsOrAmendsClause;
import org.pkl.core.parser.ast.Identifier; import org.pkl.core.parser.syntax.Identifier;
import org.pkl.core.parser.ast.ImportClause; import org.pkl.core.parser.syntax.ImportClause;
import org.pkl.core.parser.ast.Keyword; import org.pkl.core.parser.syntax.Keyword;
import org.pkl.core.parser.ast.Modifier; import org.pkl.core.parser.syntax.Modifier;
import org.pkl.core.parser.ast.ModuleDecl; import org.pkl.core.parser.syntax.ModuleDecl;
import org.pkl.core.parser.ast.Node; import org.pkl.core.parser.syntax.Node;
import org.pkl.core.parser.ast.ObjectBody; import org.pkl.core.parser.syntax.ObjectBody;
import org.pkl.core.parser.ast.ObjectMember.ForGenerator; import org.pkl.core.parser.syntax.ObjectMember.ForGenerator;
import org.pkl.core.parser.ast.ObjectMember.MemberPredicate; import org.pkl.core.parser.syntax.ObjectMember.MemberPredicate;
import org.pkl.core.parser.ast.ObjectMember.ObjectElement; import org.pkl.core.parser.syntax.ObjectMember.ObjectElement;
import org.pkl.core.parser.ast.ObjectMember.ObjectEntry; import org.pkl.core.parser.syntax.ObjectMember.ObjectEntry;
import org.pkl.core.parser.ast.ObjectMember.ObjectMethod; import org.pkl.core.parser.syntax.ObjectMember.ObjectMethod;
import org.pkl.core.parser.ast.ObjectMember.ObjectProperty; import org.pkl.core.parser.syntax.ObjectMember.ObjectProperty;
import org.pkl.core.parser.ast.ObjectMember.ObjectSpread; import org.pkl.core.parser.syntax.ObjectMember.ObjectSpread;
import org.pkl.core.parser.ast.ObjectMember.WhenGenerator; import org.pkl.core.parser.syntax.ObjectMember.WhenGenerator;
import org.pkl.core.parser.ast.Parameter; import org.pkl.core.parser.syntax.Parameter;
import org.pkl.core.parser.ast.ParameterList; import org.pkl.core.parser.syntax.ParameterList;
import org.pkl.core.parser.ast.QualifiedIdentifier; import org.pkl.core.parser.syntax.QualifiedIdentifier;
import org.pkl.core.parser.ast.ReplInput; import org.pkl.core.parser.syntax.ReplInput;
import org.pkl.core.parser.ast.StringConstant; import org.pkl.core.parser.syntax.StringConstant;
import org.pkl.core.parser.ast.StringPart; import org.pkl.core.parser.syntax.StringPart;
import org.pkl.core.parser.ast.Type.ConstrainedType; import org.pkl.core.parser.syntax.Type.ConstrainedType;
import org.pkl.core.parser.ast.Type.DeclaredType; import org.pkl.core.parser.syntax.Type.DeclaredType;
import org.pkl.core.parser.ast.Type.FunctionType; import org.pkl.core.parser.syntax.Type.FunctionType;
import org.pkl.core.parser.ast.Type.ModuleType; import org.pkl.core.parser.syntax.Type.ModuleType;
import org.pkl.core.parser.ast.Type.NothingType; import org.pkl.core.parser.syntax.Type.NothingType;
import org.pkl.core.parser.ast.Type.NullableType; import org.pkl.core.parser.syntax.Type.NullableType;
import org.pkl.core.parser.ast.Type.ParenthesizedType; import org.pkl.core.parser.syntax.Type.ParenthesizedType;
import org.pkl.core.parser.ast.Type.StringConstantType; import org.pkl.core.parser.syntax.Type.StringConstantType;
import org.pkl.core.parser.ast.Type.UnionType; import org.pkl.core.parser.syntax.Type.UnionType;
import org.pkl.core.parser.ast.Type.UnknownType; import org.pkl.core.parser.syntax.Type.UnknownType;
import org.pkl.core.parser.ast.TypeAlias; import org.pkl.core.parser.syntax.TypeAlias;
import org.pkl.core.parser.ast.TypeAnnotation; import org.pkl.core.parser.syntax.TypeAnnotation;
import org.pkl.core.parser.ast.TypeArgumentList; import org.pkl.core.parser.syntax.TypeArgumentList;
import org.pkl.core.parser.ast.TypeParameter; import org.pkl.core.parser.syntax.TypeParameter;
import org.pkl.core.parser.ast.TypeParameterList; import org.pkl.core.parser.syntax.TypeParameterList;
public abstract class BaseParserVisitor<T> implements ParserVisitor<T> { public abstract class BaseParserVisitor<T> implements ParserVisitor<T> {
@@ -338,7 +338,7 @@ public abstract class BaseParserVisitor<T> implements ParserVisitor<T> {
} }
@Override @Override
public T visitModule(org.pkl.core.parser.ast.Module module) { public T visitModule(org.pkl.core.parser.syntax.Module module) {
return visitChildren(module); return visitChildren(module);
} }

View File

@@ -17,13 +17,13 @@ package org.pkl.core.parser;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ast.Expr; import org.pkl.core.parser.syntax.Expr;
import org.pkl.core.parser.ast.Expr.BinaryOperatorExpr; import org.pkl.core.parser.syntax.Expr.BinaryOperatorExpr;
import org.pkl.core.parser.ast.Expr.OperatorExpr; import org.pkl.core.parser.syntax.Expr.OperatorExpr;
import org.pkl.core.parser.ast.Expr.TypeCastExpr; import org.pkl.core.parser.syntax.Expr.TypeCastExpr;
import org.pkl.core.parser.ast.Expr.TypeCheckExpr; import org.pkl.core.parser.syntax.Expr.TypeCheckExpr;
import org.pkl.core.parser.ast.Expr.TypeExpr; import org.pkl.core.parser.syntax.Expr.TypeExpr;
import org.pkl.core.parser.ast.Operator; import org.pkl.core.parser.syntax.Operator;
import org.pkl.core.util.Nullable; import org.pkl.core.util.Nullable;
class OperatorResolver { class OperatorResolver {

View File

@@ -21,70 +21,70 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Supplier; import java.util.function.Supplier;
import org.pkl.core.PklBugException; import org.pkl.core.PklBugException;
import org.pkl.core.parser.ast.Annotation; import org.pkl.core.parser.syntax.Annotation;
import org.pkl.core.parser.ast.ArgumentList; import org.pkl.core.parser.syntax.ArgumentList;
import org.pkl.core.parser.ast.Class; import org.pkl.core.parser.syntax.Class;
import org.pkl.core.parser.ast.ClassBody; import org.pkl.core.parser.syntax.ClassBody;
import org.pkl.core.parser.ast.ClassMethod; import org.pkl.core.parser.syntax.ClassMethod;
import org.pkl.core.parser.ast.ClassProperty; import org.pkl.core.parser.syntax.ClassProperty;
import org.pkl.core.parser.ast.DocComment; import org.pkl.core.parser.syntax.DocComment;
import org.pkl.core.parser.ast.Expr; import org.pkl.core.parser.syntax.Expr;
import org.pkl.core.parser.ast.Expr.AmendsExpr; import org.pkl.core.parser.syntax.Expr.AmendsExpr;
import org.pkl.core.parser.ast.Expr.BoolLiteralExpr; import org.pkl.core.parser.syntax.Expr.BoolLiteralExpr;
import org.pkl.core.parser.ast.Expr.FloatLiteralExpr; import org.pkl.core.parser.syntax.Expr.FloatLiteralExpr;
import org.pkl.core.parser.ast.Expr.FunctionLiteralExpr; import org.pkl.core.parser.syntax.Expr.FunctionLiteralExpr;
import org.pkl.core.parser.ast.Expr.IfExpr; import org.pkl.core.parser.syntax.Expr.IfExpr;
import org.pkl.core.parser.ast.Expr.IntLiteralExpr; import org.pkl.core.parser.syntax.Expr.IntLiteralExpr;
import org.pkl.core.parser.ast.Expr.LetExpr; import org.pkl.core.parser.syntax.Expr.LetExpr;
import org.pkl.core.parser.ast.Expr.LogicalNotExpr; import org.pkl.core.parser.syntax.Expr.LogicalNotExpr;
import org.pkl.core.parser.ast.Expr.ModuleExpr; import org.pkl.core.parser.syntax.Expr.ModuleExpr;
import org.pkl.core.parser.ast.Expr.MultiLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.MultiLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.NewExpr; import org.pkl.core.parser.syntax.Expr.NewExpr;
import org.pkl.core.parser.ast.Expr.NonNullExpr; import org.pkl.core.parser.syntax.Expr.NonNullExpr;
import org.pkl.core.parser.ast.Expr.NullLiteralExpr; import org.pkl.core.parser.syntax.Expr.NullLiteralExpr;
import org.pkl.core.parser.ast.Expr.OperatorExpr; import org.pkl.core.parser.syntax.Expr.OperatorExpr;
import org.pkl.core.parser.ast.Expr.OuterExpr; import org.pkl.core.parser.syntax.Expr.OuterExpr;
import org.pkl.core.parser.ast.Expr.ParenthesizedExpr; import org.pkl.core.parser.syntax.Expr.ParenthesizedExpr;
import org.pkl.core.parser.ast.Expr.QualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.QualifiedAccessExpr;
import org.pkl.core.parser.ast.Expr.ReadExpr; import org.pkl.core.parser.syntax.Expr.ReadExpr;
import org.pkl.core.parser.ast.Expr.ReadType; import org.pkl.core.parser.syntax.Expr.ReadType;
import org.pkl.core.parser.ast.Expr.SingleLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.SingleLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.SubscriptExpr; import org.pkl.core.parser.syntax.Expr.SubscriptExpr;
import org.pkl.core.parser.ast.Expr.SuperAccessExpr; import org.pkl.core.parser.syntax.Expr.SuperAccessExpr;
import org.pkl.core.parser.ast.Expr.SuperSubscriptExpr; import org.pkl.core.parser.syntax.Expr.SuperSubscriptExpr;
import org.pkl.core.parser.ast.Expr.ThisExpr; import org.pkl.core.parser.syntax.Expr.ThisExpr;
import org.pkl.core.parser.ast.Expr.ThrowExpr; import org.pkl.core.parser.syntax.Expr.ThrowExpr;
import org.pkl.core.parser.ast.Expr.TraceExpr; import org.pkl.core.parser.syntax.Expr.TraceExpr;
import org.pkl.core.parser.ast.Expr.UnaryMinusExpr; import org.pkl.core.parser.syntax.Expr.UnaryMinusExpr;
import org.pkl.core.parser.ast.Expr.UnqualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.UnqualifiedAccessExpr;
import org.pkl.core.parser.ast.ExtendsOrAmendsClause; import org.pkl.core.parser.syntax.ExtendsOrAmendsClause;
import org.pkl.core.parser.ast.Identifier; import org.pkl.core.parser.syntax.Identifier;
import org.pkl.core.parser.ast.ImportClause; import org.pkl.core.parser.syntax.ImportClause;
import org.pkl.core.parser.ast.Keyword; import org.pkl.core.parser.syntax.Keyword;
import org.pkl.core.parser.ast.Modifier; import org.pkl.core.parser.syntax.Modifier;
import org.pkl.core.parser.ast.Module; import org.pkl.core.parser.syntax.Module;
import org.pkl.core.parser.ast.ModuleDecl; import org.pkl.core.parser.syntax.ModuleDecl;
import org.pkl.core.parser.ast.Node; import org.pkl.core.parser.syntax.Node;
import org.pkl.core.parser.ast.ObjectBody; import org.pkl.core.parser.syntax.ObjectBody;
import org.pkl.core.parser.ast.ObjectMember; import org.pkl.core.parser.syntax.ObjectMember;
import org.pkl.core.parser.ast.Operator; import org.pkl.core.parser.syntax.Operator;
import org.pkl.core.parser.ast.Parameter; import org.pkl.core.parser.syntax.Parameter;
import org.pkl.core.parser.ast.Parameter.TypedIdentifier; import org.pkl.core.parser.syntax.Parameter.TypedIdentifier;
import org.pkl.core.parser.ast.ParameterList; import org.pkl.core.parser.syntax.ParameterList;
import org.pkl.core.parser.ast.QualifiedIdentifier; import org.pkl.core.parser.syntax.QualifiedIdentifier;
import org.pkl.core.parser.ast.ReplInput; import org.pkl.core.parser.syntax.ReplInput;
import org.pkl.core.parser.ast.StringConstant; import org.pkl.core.parser.syntax.StringConstant;
import org.pkl.core.parser.ast.StringPart; import org.pkl.core.parser.syntax.StringPart;
import org.pkl.core.parser.ast.StringPart.StringChars; import org.pkl.core.parser.syntax.StringPart.StringChars;
import org.pkl.core.parser.ast.Type; import org.pkl.core.parser.syntax.Type;
import org.pkl.core.parser.ast.Type.DeclaredType; import org.pkl.core.parser.syntax.Type.DeclaredType;
import org.pkl.core.parser.ast.Type.ParenthesizedType; import org.pkl.core.parser.syntax.Type.ParenthesizedType;
import org.pkl.core.parser.ast.Type.StringConstantType; import org.pkl.core.parser.syntax.Type.StringConstantType;
import org.pkl.core.parser.ast.TypeAlias; import org.pkl.core.parser.syntax.TypeAlias;
import org.pkl.core.parser.ast.TypeAnnotation; import org.pkl.core.parser.syntax.TypeAnnotation;
import org.pkl.core.parser.ast.TypeArgumentList; import org.pkl.core.parser.syntax.TypeArgumentList;
import org.pkl.core.parser.ast.TypeParameter; import org.pkl.core.parser.syntax.TypeParameter;
import org.pkl.core.parser.ast.TypeParameterList; import org.pkl.core.parser.syntax.TypeParameterList;
import org.pkl.core.util.ErrorMessages; import org.pkl.core.util.ErrorMessages;
import org.pkl.core.util.Nullable; import org.pkl.core.util.Nullable;

View File

@@ -15,7 +15,7 @@
*/ */
package org.pkl.core.parser; package org.pkl.core.parser;
import org.pkl.core.parser.ast.Module; import org.pkl.core.parser.syntax.Module;
import org.pkl.core.util.Nullable; import org.pkl.core.util.Nullable;
public class ParserError extends RuntimeException { public class ParserError extends RuntimeException {

View File

@@ -15,64 +15,64 @@
*/ */
package org.pkl.core.parser; package org.pkl.core.parser;
import org.pkl.core.parser.ast.Annotation; import org.pkl.core.parser.syntax.Annotation;
import org.pkl.core.parser.ast.ArgumentList; import org.pkl.core.parser.syntax.ArgumentList;
import org.pkl.core.parser.ast.Class; import org.pkl.core.parser.syntax.Class;
import org.pkl.core.parser.ast.ClassBody; import org.pkl.core.parser.syntax.ClassBody;
import org.pkl.core.parser.ast.ClassMethod; import org.pkl.core.parser.syntax.ClassMethod;
import org.pkl.core.parser.ast.ClassProperty; import org.pkl.core.parser.syntax.ClassProperty;
import org.pkl.core.parser.ast.DocComment; import org.pkl.core.parser.syntax.DocComment;
import org.pkl.core.parser.ast.Expr; import org.pkl.core.parser.syntax.Expr;
import org.pkl.core.parser.ast.Expr.AmendsExpr; import org.pkl.core.parser.syntax.Expr.AmendsExpr;
import org.pkl.core.parser.ast.Expr.BinaryOperatorExpr; import org.pkl.core.parser.syntax.Expr.BinaryOperatorExpr;
import org.pkl.core.parser.ast.Expr.BoolLiteralExpr; import org.pkl.core.parser.syntax.Expr.BoolLiteralExpr;
import org.pkl.core.parser.ast.Expr.FloatLiteralExpr; import org.pkl.core.parser.syntax.Expr.FloatLiteralExpr;
import org.pkl.core.parser.ast.Expr.FunctionLiteralExpr; import org.pkl.core.parser.syntax.Expr.FunctionLiteralExpr;
import org.pkl.core.parser.ast.Expr.IfExpr; import org.pkl.core.parser.syntax.Expr.IfExpr;
import org.pkl.core.parser.ast.Expr.IntLiteralExpr; import org.pkl.core.parser.syntax.Expr.IntLiteralExpr;
import org.pkl.core.parser.ast.Expr.LetExpr; import org.pkl.core.parser.syntax.Expr.LetExpr;
import org.pkl.core.parser.ast.Expr.LogicalNotExpr; import org.pkl.core.parser.syntax.Expr.LogicalNotExpr;
import org.pkl.core.parser.ast.Expr.ModuleExpr; import org.pkl.core.parser.syntax.Expr.ModuleExpr;
import org.pkl.core.parser.ast.Expr.MultiLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.MultiLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.NewExpr; import org.pkl.core.parser.syntax.Expr.NewExpr;
import org.pkl.core.parser.ast.Expr.NonNullExpr; import org.pkl.core.parser.syntax.Expr.NonNullExpr;
import org.pkl.core.parser.ast.Expr.NullLiteralExpr; import org.pkl.core.parser.syntax.Expr.NullLiteralExpr;
import org.pkl.core.parser.ast.Expr.OuterExpr; import org.pkl.core.parser.syntax.Expr.OuterExpr;
import org.pkl.core.parser.ast.Expr.ParenthesizedExpr; import org.pkl.core.parser.syntax.Expr.ParenthesizedExpr;
import org.pkl.core.parser.ast.Expr.QualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.QualifiedAccessExpr;
import org.pkl.core.parser.ast.Expr.ReadExpr; import org.pkl.core.parser.syntax.Expr.ReadExpr;
import org.pkl.core.parser.ast.Expr.SingleLineStringLiteralExpr; import org.pkl.core.parser.syntax.Expr.SingleLineStringLiteralExpr;
import org.pkl.core.parser.ast.Expr.SubscriptExpr; import org.pkl.core.parser.syntax.Expr.SubscriptExpr;
import org.pkl.core.parser.ast.Expr.SuperAccessExpr; import org.pkl.core.parser.syntax.Expr.SuperAccessExpr;
import org.pkl.core.parser.ast.Expr.SuperSubscriptExpr; import org.pkl.core.parser.syntax.Expr.SuperSubscriptExpr;
import org.pkl.core.parser.ast.Expr.ThisExpr; import org.pkl.core.parser.syntax.Expr.ThisExpr;
import org.pkl.core.parser.ast.Expr.ThrowExpr; import org.pkl.core.parser.syntax.Expr.ThrowExpr;
import org.pkl.core.parser.ast.Expr.TraceExpr; import org.pkl.core.parser.syntax.Expr.TraceExpr;
import org.pkl.core.parser.ast.Expr.TypeCastExpr; import org.pkl.core.parser.syntax.Expr.TypeCastExpr;
import org.pkl.core.parser.ast.Expr.TypeCheckExpr; import org.pkl.core.parser.syntax.Expr.TypeCheckExpr;
import org.pkl.core.parser.ast.Expr.UnaryMinusExpr; import org.pkl.core.parser.syntax.Expr.UnaryMinusExpr;
import org.pkl.core.parser.ast.Expr.UnqualifiedAccessExpr; import org.pkl.core.parser.syntax.Expr.UnqualifiedAccessExpr;
import org.pkl.core.parser.ast.ExtendsOrAmendsClause; import org.pkl.core.parser.syntax.ExtendsOrAmendsClause;
import org.pkl.core.parser.ast.Identifier; import org.pkl.core.parser.syntax.Identifier;
import org.pkl.core.parser.ast.ImportClause; import org.pkl.core.parser.syntax.ImportClause;
import org.pkl.core.parser.ast.Keyword; import org.pkl.core.parser.syntax.Keyword;
import org.pkl.core.parser.ast.Modifier; import org.pkl.core.parser.syntax.Modifier;
import org.pkl.core.parser.ast.Module; import org.pkl.core.parser.syntax.Module;
import org.pkl.core.parser.ast.ModuleDecl; import org.pkl.core.parser.syntax.ModuleDecl;
import org.pkl.core.parser.ast.ObjectBody; import org.pkl.core.parser.syntax.ObjectBody;
import org.pkl.core.parser.ast.ObjectMember; import org.pkl.core.parser.syntax.ObjectMember;
import org.pkl.core.parser.ast.Parameter; import org.pkl.core.parser.syntax.Parameter;
import org.pkl.core.parser.ast.ParameterList; import org.pkl.core.parser.syntax.ParameterList;
import org.pkl.core.parser.ast.QualifiedIdentifier; import org.pkl.core.parser.syntax.QualifiedIdentifier;
import org.pkl.core.parser.ast.ReplInput; import org.pkl.core.parser.syntax.ReplInput;
import org.pkl.core.parser.ast.StringConstant; import org.pkl.core.parser.syntax.StringConstant;
import org.pkl.core.parser.ast.StringPart; import org.pkl.core.parser.syntax.StringPart;
import org.pkl.core.parser.ast.Type; import org.pkl.core.parser.syntax.Type;
import org.pkl.core.parser.ast.TypeAlias; import org.pkl.core.parser.syntax.TypeAlias;
import org.pkl.core.parser.ast.TypeAnnotation; import org.pkl.core.parser.syntax.TypeAnnotation;
import org.pkl.core.parser.ast.TypeArgumentList; import org.pkl.core.parser.syntax.TypeArgumentList;
import org.pkl.core.parser.ast.TypeParameter; import org.pkl.core.parser.syntax.TypeParameter;
import org.pkl.core.parser.ast.TypeParameterList; import org.pkl.core.parser.syntax.TypeParameterList;
public interface ParserVisitor<Result> { public interface ParserVisitor<Result> {

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Objects; import java.util.Objects;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects; import java.util.Objects;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;
import org.pkl.core.parser.Span; import org.pkl.core.parser.Span;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Objects; import java.util.Objects;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
public enum Operator { public enum Operator {
POW, POW,

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Objects; import java.util.Objects;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;

View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import java.util.List; import java.util.List;
import org.pkl.core.parser.ParserVisitor; import org.pkl.core.parser.ParserVisitor;

View File

@@ -1,4 +1,4 @@
@NonnullByDefault @NonnullByDefault
package org.pkl.core.parser.ast; package org.pkl.core.parser.syntax;
import org.pkl.core.util.NonnullByDefault; import org.pkl.core.util.NonnullByDefault;

View File

@@ -37,12 +37,12 @@ import org.pkl.core.module.*;
import org.pkl.core.packages.PackageResolver; import org.pkl.core.packages.PackageResolver;
import org.pkl.core.parser.Parser; import org.pkl.core.parser.Parser;
import org.pkl.core.parser.ParserError; import org.pkl.core.parser.ParserError;
import org.pkl.core.parser.ast.Class; import org.pkl.core.parser.syntax.Class;
import org.pkl.core.parser.ast.ClassProperty; import org.pkl.core.parser.syntax.ClassProperty;
import org.pkl.core.parser.ast.Expr; import org.pkl.core.parser.syntax.Expr;
import org.pkl.core.parser.ast.ImportClause; import org.pkl.core.parser.syntax.ImportClause;
import org.pkl.core.parser.ast.ModuleDecl; import org.pkl.core.parser.syntax.ModuleDecl;
import org.pkl.core.parser.ast.ReplInput; import org.pkl.core.parser.syntax.ReplInput;
import org.pkl.core.project.DeclaredDependencies; import org.pkl.core.project.DeclaredDependencies;
import org.pkl.core.repl.ReplRequest.Eval; import org.pkl.core.repl.ReplRequest.Eval;
import org.pkl.core.repl.ReplRequest.Load; import org.pkl.core.repl.ReplRequest.Load;
@@ -222,9 +222,9 @@ public class ReplServer implements AutoCloseable {
} }
} else if (tree instanceof Class clazz) { } else if (tree instanceof Class clazz) {
addStaticModuleProperty(builder.visitClass(clazz)); addStaticModuleProperty(builder.visitClass(clazz));
} else if (tree instanceof org.pkl.core.parser.ast.TypeAlias typeAlias) { } else if (tree instanceof org.pkl.core.parser.syntax.TypeAlias typeAlias) {
addStaticModuleProperty(builder.visitTypeAlias(typeAlias)); addStaticModuleProperty(builder.visitTypeAlias(typeAlias));
} else if (tree instanceof org.pkl.core.parser.ast.ClassMethod classMethod) { } else if (tree instanceof org.pkl.core.parser.syntax.ClassMethod classMethod) {
addModuleMethodDef(builder.visitClassMethod(classMethod)); addModuleMethodDef(builder.visitClassMethod(classMethod));
} else if (tree instanceof ModuleDecl) { } else if (tree instanceof ModuleDecl) {
// do nothing for now // do nothing for now

View File

@@ -18,10 +18,10 @@ package org.pkl.core.runtime;
import com.oracle.truffle.api.nodes.Node; import com.oracle.truffle.api.nodes.Node;
import org.pkl.core.Release; import org.pkl.core.Release;
import org.pkl.core.Version; import org.pkl.core.Version;
import org.pkl.core.parser.ast.Module; import org.pkl.core.parser.syntax.Module;
import org.pkl.core.parser.ast.ObjectMember.ObjectProperty; import org.pkl.core.parser.syntax.ObjectMember.ObjectProperty;
import org.pkl.core.parser.ast.Type; import org.pkl.core.parser.syntax.Type;
import org.pkl.core.parser.ast.Type.DeclaredType; import org.pkl.core.parser.syntax.Type.DeclaredType;
import org.pkl.core.util.Nullable; import org.pkl.core.util.Nullable;
final class MinPklVersionChecker { final class MinPklVersionChecker {

View File

@@ -25,7 +25,7 @@ import org.pkl.core.module.ModuleKey;
import org.pkl.core.module.ResolvedModuleKey; import org.pkl.core.module.ResolvedModuleKey;
import org.pkl.core.parser.Parser; import org.pkl.core.parser.Parser;
import org.pkl.core.parser.ParserError; import org.pkl.core.parser.ParserError;
import org.pkl.core.parser.ast.Module; import org.pkl.core.parser.syntax.Module;
import org.pkl.core.util.IoUtils; import org.pkl.core.util.IoUtils;
import org.pkl.core.util.Nullable; import org.pkl.core.util.Nullable;

View File

@@ -58,7 +58,7 @@ import org.pkl.core.module.ModuleKeys;
import org.pkl.core.module.ResolvedModuleKey; import org.pkl.core.module.ResolvedModuleKey;
import org.pkl.core.parser.Parser; import org.pkl.core.parser.Parser;
import org.pkl.core.parser.ParserError; import org.pkl.core.parser.ParserError;
import org.pkl.core.parser.ast.Expr; import org.pkl.core.parser.syntax.Expr;
import org.pkl.core.util.EconomicMaps; import org.pkl.core.util.EconomicMaps;
import org.pkl.core.util.Nullable; import org.pkl.core.util.Nullable;

View File

@@ -15,27 +15,27 @@
*/ */
package org.pkl.core.parser package org.pkl.core.parser
import org.pkl.core.parser.ast.* import org.pkl.core.parser.syntax.*
import org.pkl.core.parser.ast.Annotation import org.pkl.core.parser.syntax.Annotation
import org.pkl.core.parser.ast.Expr.* import org.pkl.core.parser.syntax.Expr.*
import org.pkl.core.parser.ast.Expr.ModuleExpr import org.pkl.core.parser.syntax.Expr.ModuleExpr
import org.pkl.core.parser.ast.ObjectMember.* import org.pkl.core.parser.syntax.ObjectMember.*
import org.pkl.core.parser.ast.Parameter.TypedIdentifier import org.pkl.core.parser.syntax.Parameter.TypedIdentifier
import org.pkl.core.parser.ast.Type.* import org.pkl.core.parser.syntax.Type.*
@Suppress("MemberVisibilityCanBePrivate") @Suppress("MemberVisibilityCanBePrivate")
class SexpRenderer { class SexpRenderer {
private var tab = "" private var tab = ""
private var buf = StringBuilder() private var buf = StringBuilder()
fun render(mod: org.pkl.core.parser.ast.Module): String { fun render(mod: org.pkl.core.parser.syntax.Module): String {
renderModule(mod) renderModule(mod)
val res = buf.toString() val res = buf.toString()
reset() reset()
return res return res
} }
fun renderModule(mod: org.pkl.core.parser.ast.Module) { fun renderModule(mod: org.pkl.core.parser.syntax.Module) {
buf.append(tab) buf.append(tab)
buf.append("(module") buf.append("(module")
val oldTab = increaseTab() val oldTab = increaseTab()
@@ -1055,7 +1055,7 @@ class SexpRenderer {
} }
companion object { companion object {
private fun sortModuleEntries(mod: org.pkl.core.parser.ast.Module): List<Node> { private fun sortModuleEntries(mod: org.pkl.core.parser.syntax.Module): List<Node> {
val res = mutableListOf<Node>() val res = mutableListOf<Node>()
res += mod.classes res += mod.classes
res += mod.typeAliases res += mod.typeAliases

View File

@@ -19,47 +19,47 @@ import org.antlr.v4.runtime.ParserRuleContext
import org.antlr.v4.runtime.tree.TerminalNode import org.antlr.v4.runtime.tree.TerminalNode
import org.assertj.core.api.SoftAssertions import org.assertj.core.api.SoftAssertions
import org.pkl.core.parser.antlr.PklParser.* import org.pkl.core.parser.antlr.PklParser.*
import org.pkl.core.parser.ast.* import org.pkl.core.parser.syntax.*
import org.pkl.core.parser.ast.Annotation import org.pkl.core.parser.syntax.Annotation
import org.pkl.core.parser.ast.Expr.AmendsExpr import org.pkl.core.parser.syntax.Expr.AmendsExpr
import org.pkl.core.parser.ast.Expr.BinaryOperatorExpr import org.pkl.core.parser.syntax.Expr.BinaryOperatorExpr
import org.pkl.core.parser.ast.Expr.FunctionLiteralExpr import org.pkl.core.parser.syntax.Expr.FunctionLiteralExpr
import org.pkl.core.parser.ast.Expr.IfExpr import org.pkl.core.parser.syntax.Expr.IfExpr
import org.pkl.core.parser.ast.Expr.ImportExpr import org.pkl.core.parser.syntax.Expr.ImportExpr
import org.pkl.core.parser.ast.Expr.LetExpr import org.pkl.core.parser.syntax.Expr.LetExpr
import org.pkl.core.parser.ast.Expr.LogicalNotExpr import org.pkl.core.parser.syntax.Expr.LogicalNotExpr
import org.pkl.core.parser.ast.Expr.MultiLineStringLiteralExpr import org.pkl.core.parser.syntax.Expr.MultiLineStringLiteralExpr
import org.pkl.core.parser.ast.Expr.NewExpr import org.pkl.core.parser.syntax.Expr.NewExpr
import org.pkl.core.parser.ast.Expr.NonNullExpr import org.pkl.core.parser.syntax.Expr.NonNullExpr
import org.pkl.core.parser.ast.Expr.ParenthesizedExpr import org.pkl.core.parser.syntax.Expr.ParenthesizedExpr
import org.pkl.core.parser.ast.Expr.QualifiedAccessExpr import org.pkl.core.parser.syntax.Expr.QualifiedAccessExpr
import org.pkl.core.parser.ast.Expr.ReadExpr import org.pkl.core.parser.syntax.Expr.ReadExpr
import org.pkl.core.parser.ast.Expr.SingleLineStringLiteralExpr import org.pkl.core.parser.syntax.Expr.SingleLineStringLiteralExpr
import org.pkl.core.parser.ast.Expr.SubscriptExpr import org.pkl.core.parser.syntax.Expr.SubscriptExpr
import org.pkl.core.parser.ast.Expr.SuperAccessExpr import org.pkl.core.parser.syntax.Expr.SuperAccessExpr
import org.pkl.core.parser.ast.Expr.SuperSubscriptExpr import org.pkl.core.parser.syntax.Expr.SuperSubscriptExpr
import org.pkl.core.parser.ast.Expr.ThrowExpr import org.pkl.core.parser.syntax.Expr.ThrowExpr
import org.pkl.core.parser.ast.Expr.TraceExpr import org.pkl.core.parser.syntax.Expr.TraceExpr
import org.pkl.core.parser.ast.Expr.TypeCastExpr import org.pkl.core.parser.syntax.Expr.TypeCastExpr
import org.pkl.core.parser.ast.Expr.TypeCheckExpr import org.pkl.core.parser.syntax.Expr.TypeCheckExpr
import org.pkl.core.parser.ast.Expr.UnaryMinusExpr import org.pkl.core.parser.syntax.Expr.UnaryMinusExpr
import org.pkl.core.parser.ast.Expr.UnqualifiedAccessExpr import org.pkl.core.parser.syntax.Expr.UnqualifiedAccessExpr
import org.pkl.core.parser.ast.ObjectMember.ForGenerator import org.pkl.core.parser.syntax.ObjectMember.ForGenerator
import org.pkl.core.parser.ast.ObjectMember.MemberPredicate import org.pkl.core.parser.syntax.ObjectMember.MemberPredicate
import org.pkl.core.parser.ast.ObjectMember.ObjectElement import org.pkl.core.parser.syntax.ObjectMember.ObjectElement
import org.pkl.core.parser.ast.ObjectMember.ObjectEntry import org.pkl.core.parser.syntax.ObjectMember.ObjectEntry
import org.pkl.core.parser.ast.ObjectMember.ObjectMethod import org.pkl.core.parser.syntax.ObjectMember.ObjectMethod
import org.pkl.core.parser.ast.ObjectMember.ObjectProperty import org.pkl.core.parser.syntax.ObjectMember.ObjectProperty
import org.pkl.core.parser.ast.ObjectMember.ObjectSpread import org.pkl.core.parser.syntax.ObjectMember.ObjectSpread
import org.pkl.core.parser.ast.ObjectMember.WhenGenerator import org.pkl.core.parser.syntax.ObjectMember.WhenGenerator
import org.pkl.core.parser.ast.Parameter.TypedIdentifier import org.pkl.core.parser.syntax.Parameter.TypedIdentifier
import org.pkl.core.parser.ast.Type.ConstrainedType import org.pkl.core.parser.syntax.Type.ConstrainedType
import org.pkl.core.parser.ast.Type.DeclaredType import org.pkl.core.parser.syntax.Type.DeclaredType
import org.pkl.core.parser.ast.Type.FunctionType import org.pkl.core.parser.syntax.Type.FunctionType
import org.pkl.core.parser.ast.Type.NullableType import org.pkl.core.parser.syntax.Type.NullableType
import org.pkl.core.parser.ast.Type.ParenthesizedType import org.pkl.core.parser.syntax.Type.ParenthesizedType
import org.pkl.core.parser.ast.Type.StringConstantType import org.pkl.core.parser.syntax.Type.StringConstantType
import org.pkl.core.parser.ast.Type.UnionType import org.pkl.core.parser.syntax.Type.UnionType
class SpanComparison(val path: String, private val softly: SoftAssertions) { class SpanComparison(val path: String, private val softly: SoftAssertions) {