brighterscript 1.0.0-alpha.41 → 1.0.0-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -2
- package/dist/AstValidationSegmenter.d.ts +3 -0
- package/dist/AstValidationSegmenter.js +62 -2
- package/dist/AstValidationSegmenter.js.map +1 -1
- package/dist/BsConfig.d.ts +7 -7
- package/dist/CrossScopeValidator.js +3 -3
- package/dist/CrossScopeValidator.js.map +1 -1
- package/dist/DiagnosticFilterer.d.ts +5 -1
- package/dist/DiagnosticFilterer.js +92 -33
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticManager.js +12 -9
- package/dist/DiagnosticManager.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +374 -225
- package/dist/DiagnosticMessages.js +641 -424
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/DiagnosticSeverityAdjuster.js +4 -0
- package/dist/DiagnosticSeverityAdjuster.js.map +1 -1
- package/dist/LanguageServer.js +0 -7
- package/dist/LanguageServer.js.map +1 -1
- package/dist/PluginInterface.js +2 -0
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +22 -1
- package/dist/Program.js +206 -49
- package/dist/Program.js.map +1 -1
- package/dist/SymbolTable.d.ts +3 -0
- package/dist/SymbolTable.js +19 -1
- package/dist/SymbolTable.js.map +1 -1
- package/dist/XmlScope.js +3 -6
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/creators.d.ts +35 -3
- package/dist/astUtils/creators.js +52 -1
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +4 -2
- package/dist/astUtils/reflection.js +12 -3
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +3 -2
- package/dist/astUtils/visitors.js +37 -14
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +172 -6
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.d.ts +0 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +0 -13
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.d.ts +2 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.js +5 -5
- package/dist/bscPlugin/completions/CompletionsProcessor.js.map +1 -1
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js +106 -2
- package/dist/bscPlugin/completions/CompletionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/hover/HoverProcessor.spec.js +51 -3
- package/dist/bscPlugin/hover/HoverProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js +149 -0
- package/dist/bscPlugin/transpile/BrsFileTranspileProcessor.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.js +15 -8
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -1
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js +80 -9
- package/dist/bscPlugin/validation/BrsFileValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +7 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +149 -79
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -1
- package/dist/bscPlugin/validation/ScopeValidator.spec.js +1227 -27
- package/dist/bscPlugin/validation/ScopeValidator.spec.js.map +1 -1
- package/dist/bscPlugin/validation/XmlFileValidator.js +0 -8
- package/dist/bscPlugin/validation/XmlFileValidator.js.map +1 -1
- package/dist/diagnosticUtils.js +6 -5
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/files/BrsFile.Class.spec.js +87 -28
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +1 -0
- package/dist/files/BrsFile.js +20 -8
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +133 -34
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.js +2 -2
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +3 -20
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/globalCallables.js +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +24 -16
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +18 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/lexer/Lexer.js +17 -11
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +21 -3
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/TokenKind.d.ts +9 -0
- package/dist/lexer/TokenKind.js +11 -1
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/AstNode.d.ts +2 -1
- package/dist/parser/AstNode.js +3 -2
- package/dist/parser/AstNode.js.map +1 -1
- package/dist/parser/Expression.d.ts +22 -2
- package/dist/parser/Expression.js +76 -48
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +3 -3
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.js +73 -61
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +198 -15
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.js +9 -9
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +3 -2
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/Statement.d.ts +16 -18
- package/dist/parser/Statement.js +136 -82
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +3 -3
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +3 -3
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +9 -9
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +3 -3
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +353 -71
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +10 -3
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.js +2 -2
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +3 -5
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +3 -3
- package/dist/parser/tests/statement/TryCatch.spec.js +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/roku-types/data.json +430 -235
- package/dist/roku-types/index.d.ts +30 -37
- package/dist/types/ArrayType.d.ts +2 -0
- package/dist/types/ArrayType.js +14 -4
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/AssociativeArrayType.d.ts +1 -0
- package/dist/types/AssociativeArrayType.js +1 -0
- package/dist/types/AssociativeArrayType.js.map +1 -1
- package/dist/types/BaseFunctionType.d.ts +1 -0
- package/dist/types/BaseFunctionType.js +1 -0
- package/dist/types/BaseFunctionType.js.map +1 -1
- package/dist/types/BooleanType.d.ts +1 -0
- package/dist/types/BooleanType.js +1 -0
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BscType.d.ts +8 -1
- package/dist/types/BscType.js +12 -3
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/BuiltInInterfaceAdder.js +10 -6
- package/dist/types/BuiltInInterfaceAdder.js.map +1 -1
- package/dist/types/ClassType.d.ts +1 -0
- package/dist/types/ClassType.js +5 -2
- package/dist/types/ClassType.js.map +1 -1
- package/dist/types/ComponentType.d.ts +11 -4
- package/dist/types/ComponentType.js +100 -8
- package/dist/types/ComponentType.js.map +1 -1
- package/dist/types/DoubleType.d.ts +2 -0
- package/dist/types/DoubleType.js +2 -0
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DynamicType.d.ts +1 -0
- package/dist/types/DynamicType.js +4 -0
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/EnumType.d.ts +2 -0
- package/dist/types/EnumType.js +20 -2
- package/dist/types/EnumType.js.map +1 -1
- package/dist/types/FloatType.d.ts +2 -0
- package/dist/types/FloatType.js +2 -0
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/InheritableType.js +8 -0
- package/dist/types/InheritableType.js.map +1 -1
- package/dist/types/IntegerType.d.ts +2 -0
- package/dist/types/IntegerType.js +2 -0
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/InterfaceType.js +4 -1
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InvalidType.d.ts +2 -1
- package/dist/types/InvalidType.js +1 -0
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +2 -0
- package/dist/types/LongIntegerType.js +2 -0
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/ObjectType.d.ts +1 -0
- package/dist/types/ObjectType.js +1 -0
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ReferenceType.d.ts +20 -2
- package/dist/types/ReferenceType.js +106 -5
- package/dist/types/ReferenceType.js.map +1 -1
- package/dist/types/StringType.d.ts +1 -0
- package/dist/types/StringType.js +1 -0
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +1 -1
- package/dist/types/TypedFunctionType.js +8 -2
- package/dist/types/TypedFunctionType.js.map +1 -1
- package/dist/types/UninitializedType.d.ts +2 -0
- package/dist/types/UninitializedType.js +5 -6
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/UnionType.js +8 -2
- package/dist/types/UnionType.js.map +1 -1
- package/dist/types/VoidType.d.ts +4 -1
- package/dist/types/VoidType.js +5 -0
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/helpers.js +8 -1
- package/dist/types/helpers.js.map +1 -1
- package/dist/util.d.ts +15 -5
- package/dist/util.js +281 -14
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.js +13 -5
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { Token, Identifier } from '../lexer/Token';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import type { DottedGetExpression, FunctionParameterExpression, TypecastExpression, TypeExpression } from './Expression';
|
|
3
|
+
import { FunctionExpression } from './Expression';
|
|
4
4
|
import { VariableExpression } from './Expression';
|
|
5
5
|
import type { Location } from 'vscode-languageserver';
|
|
6
6
|
import type { BrsTranspileState } from './BrsTranspileState';
|
|
7
7
|
import { ParseMode } from './Parser';
|
|
8
8
|
import type { WalkVisitor, WalkOptions } from '../astUtils/visitors';
|
|
9
|
-
import {
|
|
9
|
+
import type { GetTypeOptions } from '../interfaces';
|
|
10
|
+
import { type TranspileResult, type TypedefProvider } from '../interfaces';
|
|
10
11
|
import type { BscType } from '../types/BscType';
|
|
11
12
|
import { SymbolTable } from '../SymbolTable';
|
|
12
13
|
import type { Expression } from './AstNode';
|
|
13
|
-
import { AstNodeKind } from './AstNode';
|
|
14
|
-
import { Statement } from './AstNode';
|
|
14
|
+
import { AstNodeKind, Statement } from './AstNode';
|
|
15
15
|
import { ClassType } from '../types/ClassType';
|
|
16
16
|
import { NamespaceType } from '../types/NamespaceType';
|
|
17
17
|
import { InterfaceType } from '../types/InterfaceType';
|
|
@@ -198,14 +198,6 @@ export declare class IncrementStatement extends Statement {
|
|
|
198
198
|
get leadingTrivia(): Token[];
|
|
199
199
|
clone(): IncrementStatement;
|
|
200
200
|
}
|
|
201
|
-
/** Used to indent the current `print` position to the next 16-character-width output zone. */
|
|
202
|
-
export interface PrintSeparatorTab extends Token {
|
|
203
|
-
kind: TokenKind.Comma;
|
|
204
|
-
}
|
|
205
|
-
/** Used to insert a single whitespace character at the current `print` position. */
|
|
206
|
-
export interface PrintSeparatorSpace extends Token {
|
|
207
|
-
kind: TokenKind.Semicolon;
|
|
208
|
-
}
|
|
209
201
|
/**
|
|
210
202
|
* Represents a `print` statement within BrightScript.
|
|
211
203
|
*/
|
|
@@ -214,16 +206,16 @@ export declare class PrintStatement extends Statement {
|
|
|
214
206
|
* Creates a new internal representation of a BrightScript `print` statement.
|
|
215
207
|
* @param options the options for this statement
|
|
216
208
|
* @param options.print a print token
|
|
217
|
-
* @param options.expressions an array of expressions
|
|
209
|
+
* @param options.expressions an array of expressions to be evaluated and printed. Wrap PrintSeparator tokens (`;` or `,`) in `PrintSeparatorExpression`
|
|
218
210
|
*/
|
|
219
211
|
constructor(options: {
|
|
220
|
-
print
|
|
221
|
-
expressions: Array<Expression
|
|
212
|
+
print?: Token;
|
|
213
|
+
expressions: Array<Expression>;
|
|
222
214
|
});
|
|
223
215
|
readonly tokens: {
|
|
224
|
-
readonly print
|
|
216
|
+
readonly print?: Token;
|
|
225
217
|
};
|
|
226
|
-
readonly expressions: Array<Expression
|
|
218
|
+
readonly expressions: Array<Expression>;
|
|
227
219
|
readonly kind = AstNodeKind.PrintStatement;
|
|
228
220
|
readonly location: Location | undefined;
|
|
229
221
|
transpile(state: BrsTranspileState): TranspileResult;
|
|
@@ -674,6 +666,12 @@ export declare class ClassStatement extends Statement implements TypedefProvider
|
|
|
674
666
|
* Get the constructor function for this class (if exists), or undefined if not exist
|
|
675
667
|
*/
|
|
676
668
|
private getConstructorFunction;
|
|
669
|
+
/**
|
|
670
|
+
* Return the parameters for the first constructor function for this class
|
|
671
|
+
* @param ancestors The list of ancestors for this class
|
|
672
|
+
* @returns The parameters for the first constructor function for this class
|
|
673
|
+
*/
|
|
674
|
+
private getConstructorParams;
|
|
677
675
|
/**
|
|
678
676
|
* Determine if the specified field was declared in one of the ancestor classes
|
|
679
677
|
*/
|