11import * as ts from "typescript" ;
22import * as tstl from "../../LuaAST" ;
33import { FunctionVisitor , TransformationContext , TransformerPlugin } from "../context" ;
4- import { AnnotationKind , getCustomTypeAnnotations } from "../utils/annotations" ;
4+ import { AnnotationKind , getTypeAnnotations } from "../utils/annotations" ;
55import { ForbiddenLuaTableUseException , UnsupportedKind , UnsupportedProperty } from "../utils/errors" ;
66import { transformArguments } from "./call" ;
77
@@ -68,7 +68,7 @@ const transformExpressionStatement: FunctionVisitor<ts.ExpressionStatement> = (n
6868
6969 if ( ts . isCallExpression ( expression ) && ts . isPropertyAccessExpression ( expression . expression ) ) {
7070 const ownerType = context . checker . getTypeAtLocation ( expression . expression . expression ) ;
71- const annotations = getCustomTypeAnnotations ( context , ownerType ) ;
71+ const annotations = getTypeAnnotations ( context , ownerType ) ;
7272 if ( annotations . has ( AnnotationKind . LuaTable ) ) {
7373 return transformLuaTableExpressionAsExpressionStatement ( context , expression ) ;
7474 }
@@ -97,7 +97,7 @@ function transformLuaTableCallExpression(
9797const transformCallExpression : FunctionVisitor < ts . CallExpression > = ( node , context ) => {
9898 if ( ts . isPropertyAccessExpression ( node . expression ) || ts . isElementAccessExpression ( node . expression ) ) {
9999 const ownerType = context . checker . getTypeAtLocation ( node . expression . expression ) ;
100- const annotations = getCustomTypeAnnotations ( context , ownerType ) ;
100+ const annotations = getTypeAnnotations ( context , ownerType ) ;
101101
102102 if ( annotations . has ( AnnotationKind . LuaTable ) ) {
103103 return transformLuaTableCallExpression ( context , node ) ;
@@ -109,7 +109,7 @@ const transformCallExpression: FunctionVisitor<ts.CallExpression> = (node, conte
109109
110110const transformPropertyAccessExpression : FunctionVisitor < ts . PropertyAccessExpression > = ( node , context ) => {
111111 const type = context . checker . getTypeAtLocation ( node . expression ) ;
112- const annotations = getCustomTypeAnnotations ( context , type ) ;
112+ const annotations = getTypeAnnotations ( context , type ) ;
113113 if ( annotations . has ( AnnotationKind . LuaTable ) ) {
114114 const [ luaTable , propertyName ] = parseLuaTableExpression ( context , node ) ;
115115 switch ( node . name . text ) {
@@ -124,7 +124,7 @@ const transformPropertyAccessExpression: FunctionVisitor<ts.PropertyAccessExpres
124124} ;
125125
126126const transformElementAccessExpression : FunctionVisitor < ts . ElementAccessExpression > = ( node , context ) => {
127- const annotations = getCustomTypeAnnotations ( context , context . checker . getTypeAtLocation ( node . expression ) ) ;
127+ const annotations = getTypeAnnotations ( context , context . checker . getTypeAtLocation ( node . expression ) ) ;
128128 if ( annotations . has ( AnnotationKind . LuaTable ) ) {
129129 throw UnsupportedKind ( "LuaTable access expression" , node . kind , node ) ;
130130 }
@@ -134,7 +134,7 @@ const transformElementAccessExpression: FunctionVisitor<ts.ElementAccessExpressi
134134
135135const transformNewExpression : FunctionVisitor < ts . NewExpression > = ( node , context ) => {
136136 const type = context . checker . getTypeAtLocation ( node ) ;
137- const annotations = getCustomTypeAnnotations ( context , type ) ;
137+ const annotations = getTypeAnnotations ( context , type ) ;
138138 if ( annotations . has ( AnnotationKind . LuaTable ) ) {
139139 if ( node . arguments && node . arguments . length > 0 ) {
140140 throw ForbiddenLuaTableUseException ( "No parameters are allowed when constructing a LuaTable object." , node ) ;
0 commit comments