summaryrefslogtreecommitdiff
path: root/source/slang/slang-ast-expr.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-06-07 14:10:49 -0700
committerGitHub <noreply@github.com>2022-06-07 14:10:49 -0700
commit0c64995ea28febcc7d38e1519da8d93391ce2e7d (patch)
tree8696ab86b29caf80c3ebbd205c700e24b8c20bf3 /source/slang/slang-ast-expr.h
parent8c4a15c522861d2f30eacc9cd2b03ad793018639 (diff)
Major language server features. (#2264)
* Major language server features. * Include slangd in binary release. * Fix compiler issues. * Fix compiler error. * Completion resolve. * Various improvements. * Update diagnostic test expected output. * Bug fix for source locations. * Adjust diagnostic update frequency. * Update github actions to store artifacts. * Fix infinite parser loop. * Fix parser recovery. * Fix parser recovery. * Update test. * Fix test. * Disable IR gen for language server. * Allow commit characters in auto completion. * Fix lookup for invoke exprs. * More parser robustness fixes. * update solution file Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ast-expr.h')
-rw-r--r--source/slang/slang-ast-expr.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/source/slang/slang-ast-expr.h b/source/slang/slang-ast-expr.h
index f2fae7ced..647eb37a4 100644
--- a/source/slang/slang-ast-expr.h
+++ b/source/slang/slang-ast-expr.h
@@ -7,8 +7,13 @@
namespace Slang {
// Syntax class definitions for expressions.
-
-// Base class for expressions that will reference declarations
+//
+ // A placeholder for where an Expr is expected but is missing from source.
+class IncompleteExpr : public Expr
+{
+ SLANG_AST_CLASS(IncompleteExpr)
+};
+ // Base class for expressions that will reference declarations
class DeclRefExpr: public Expr
{
SLANG_ABSTRACT_AST_CLASS(DeclRefExpr)
@@ -20,6 +25,9 @@ class DeclRefExpr: public Expr
// The name of the symbol being referenced
Name* name = nullptr;
+ // The original expr before DeclRef resolution.
+ Expr* originalExpr = nullptr;
+
SLANG_UNREFLECTED
// The scope in which to perform lookup
Scope* scope = nullptr;
@@ -137,6 +145,13 @@ class AppExprBase : public ExprWithArgsBase
SLANG_ABSTRACT_AST_CLASS(AppExprBase)
Expr* functionExpr = nullptr;
+
+ // The original function expr before overload resolution.
+ Expr* originalFunctionExpr = nullptr;
+
+ // The source location of `(`, `)`, and `,` that marks the start/end of the application op and
+ // each argument expr. This info is used by language server.
+ List<SourceLoc> argumentDelimeterLocs;
};
class InvokeExpr: public AppExprBase
@@ -196,6 +211,7 @@ class MemberExpr: public DeclRefExpr
{
SLANG_AST_CLASS(MemberExpr)
Expr* baseExpression = nullptr;
+ SourceLoc memberOperatorLoc;
};
// Member looked up on a type, rather than a value
@@ -203,6 +219,7 @@ class StaticMemberExpr: public DeclRefExpr
{
SLANG_AST_CLASS(StaticMemberExpr)
Expr* baseExpression = nullptr;
+ SourceLoc memberOperatorLoc;
};
struct MatrixCoord
@@ -220,6 +237,7 @@ class MatrixSwizzleExpr : public Expr
Expr* base = nullptr;
int elementCount;
MatrixCoord elementCoords[4];
+ SourceLoc memberOpLoc;
};
class SwizzleExpr: public Expr
@@ -228,6 +246,7 @@ class SwizzleExpr: public Expr
Expr* base = nullptr;
int elementCount;
int elementIndices[4];
+ SourceLoc memberOpLoc;
};
// A dereference of a pointer or pointer-like type