brighterscript 1.0.0-alpha.2 → 1.0.0-alpha.20
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 +542 -253
- package/README.md +30 -9
- package/bsconfig.schema.json +13 -1
- package/dist/BsConfig.d.ts +4 -0
- package/dist/Cache.d.ts +3 -8
- package/dist/Cache.js +9 -14
- package/dist/Cache.js.map +1 -1
- package/dist/CodeActionUtil.d.ts +11 -2
- package/dist/CodeActionUtil.js +17 -3
- package/dist/CodeActionUtil.js.map +1 -1
- package/dist/CommentFlagProcessor.d.ts +4 -4
- package/dist/CommentFlagProcessor.js +5 -3
- package/dist/CommentFlagProcessor.js.map +1 -1
- package/dist/DependencyGraph.js +5 -4
- package/dist/DependencyGraph.js.map +1 -1
- package/dist/DiagnosticFilterer.js +1 -1
- package/dist/DiagnosticFilterer.js.map +1 -1
- package/dist/DiagnosticMessages.d.ts +59 -4
- package/dist/DiagnosticMessages.js +65 -7
- package/dist/DiagnosticMessages.js.map +1 -1
- package/dist/LanguageServer.d.ts +4 -14
- package/dist/LanguageServer.js +40 -26
- package/dist/LanguageServer.js.map +1 -1
- package/dist/Logger.d.ts +2 -0
- package/dist/Logger.js +10 -8
- package/dist/Logger.js.map +1 -1
- package/dist/PluginInterface.d.ts +7 -3
- package/dist/PluginInterface.js +9 -0
- package/dist/PluginInterface.js.map +1 -1
- package/dist/Program.d.ts +43 -25
- package/dist/Program.js +180 -82
- package/dist/Program.js.map +1 -1
- package/dist/ProgramBuilder.d.ts +4 -0
- package/dist/ProgramBuilder.js +30 -14
- package/dist/ProgramBuilder.js.map +1 -1
- package/dist/Scope.d.ts +100 -28
- package/dist/Scope.js +382 -154
- package/dist/Scope.js.map +1 -1
- package/dist/SemanticTokenUtils.d.ts +14 -0
- package/dist/SemanticTokenUtils.js +81 -0
- package/dist/SemanticTokenUtils.js.map +1 -0
- package/dist/SymbolTable.d.ts +10 -4
- package/dist/SymbolTable.js +40 -13
- package/dist/SymbolTable.js.map +1 -1
- package/dist/XmlScope.d.ts +8 -3
- package/dist/XmlScope.js +65 -27
- package/dist/XmlScope.js.map +1 -1
- package/dist/astUtils/AstEditor.d.ts +33 -0
- package/dist/astUtils/AstEditor.js +107 -0
- package/dist/astUtils/AstEditor.js.map +1 -0
- package/dist/{types/FunctionType.spec.d.ts → astUtils/AstEditor.spec.d.ts} +0 -0
- package/dist/astUtils/AstEditor.spec.js +170 -0
- package/dist/astUtils/AstEditor.spec.js.map +1 -0
- package/dist/astUtils/creators.d.ts +24 -6
- package/dist/astUtils/creators.js +130 -19
- package/dist/astUtils/creators.js.map +1 -1
- package/dist/astUtils/creators.spec.js +14 -4
- package/dist/astUtils/creators.spec.js.map +1 -1
- package/dist/astUtils/reflection.d.ts +27 -8
- package/dist/astUtils/reflection.js +66 -1
- package/dist/astUtils/reflection.js.map +1 -1
- package/dist/astUtils/reflection.spec.js +130 -119
- package/dist/astUtils/reflection.spec.js.map +1 -1
- package/dist/astUtils/stackedVisitor.js.map +1 -1
- package/dist/astUtils/stackedVisitor.spec.js +13 -13
- package/dist/astUtils/stackedVisitor.spec.js.map +1 -1
- package/dist/astUtils/visitors.d.ts +17 -2
- package/dist/astUtils/visitors.js +2 -2
- package/dist/astUtils/visitors.js.map +1 -1
- package/dist/astUtils/visitors.spec.js +31 -29
- package/dist/astUtils/visitors.spec.js.map +1 -1
- package/dist/astUtils/xml.d.ts +4 -3
- package/dist/astUtils/xml.js +8 -3
- package/dist/astUtils/xml.js.map +1 -1
- package/dist/bscPlugin/BscPlugin.d.ts +7 -1
- package/dist/bscPlugin/BscPlugin.js +28 -0
- package/dist/bscPlugin/BscPlugin.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js +4 -4
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.js.map +1 -1
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js +26 -26
- package/dist/bscPlugin/codeActions/CodeActionsProcessor.spec.js.map +1 -1
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.d.ts +9 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js +97 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.js.map +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js +73 -0
- package/dist/bscPlugin/semanticTokens/BrsFileSemanticTokensProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.d.ts +8 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js +52 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.js.map +1 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.d.ts +1 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js +32 -0
- package/dist/bscPlugin/transpile/BrsFilePreTranspileProcessor.spec.js.map +1 -0
- package/dist/bscPlugin/validation/BrsFileValidator.d.ts +9 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js +66 -0
- package/dist/bscPlugin/validation/BrsFileValidator.js.map +1 -0
- package/dist/bscPlugin/validation/ScopeValidator.d.ts +29 -0
- package/dist/bscPlugin/validation/ScopeValidator.js +183 -0
- package/dist/bscPlugin/validation/ScopeValidator.js.map +1 -0
- package/dist/cli.js +9 -3
- package/dist/cli.js.map +1 -1
- package/dist/diagnosticUtils.d.ts +1 -0
- package/dist/diagnosticUtils.js +15 -8
- package/dist/diagnosticUtils.js.map +1 -1
- package/dist/examples/plugins/removePrint.js +12 -14
- package/dist/examples/plugins/removePrint.js.map +1 -1
- package/dist/files/BrsFile.Class.spec.js +634 -145
- package/dist/files/BrsFile.Class.spec.js.map +1 -1
- package/dist/files/BrsFile.d.ts +62 -30
- package/dist/files/BrsFile.js +683 -335
- package/dist/files/BrsFile.js.map +1 -1
- package/dist/files/BrsFile.spec.js +1055 -449
- package/dist/files/BrsFile.spec.js.map +1 -1
- package/dist/files/XmlFile.d.ts +11 -10
- package/dist/files/XmlFile.js +33 -26
- package/dist/files/XmlFile.js.map +1 -1
- package/dist/files/XmlFile.spec.js +302 -237
- package/dist/files/XmlFile.spec.js.map +1 -1
- package/dist/files/tests/imports.spec.js +44 -42
- package/dist/files/tests/imports.spec.js.map +1 -1
- package/dist/files/tests/optionalChaning.spec.d.ts +1 -0
- package/dist/files/tests/optionalChaning.spec.js +88 -0
- package/dist/files/tests/optionalChaning.spec.js.map +1 -0
- package/dist/globalCallables.d.ts +3 -1
- package/dist/globalCallables.js +424 -152
- package/dist/globalCallables.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +23 -4
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +129 -16
- package/dist/lexer/Lexer.d.ts +19 -1
- package/dist/lexer/Lexer.js +127 -21
- package/dist/lexer/Lexer.js.map +1 -1
- package/dist/lexer/Lexer.spec.js +657 -536
- package/dist/lexer/Lexer.spec.js.map +1 -1
- package/dist/lexer/Token.d.ts +2 -2
- package/dist/lexer/TokenKind.d.ts +13 -1
- package/dist/lexer/TokenKind.js +60 -3
- package/dist/lexer/TokenKind.js.map +1 -1
- package/dist/parser/BrsTranspileState.d.ts +7 -0
- package/dist/parser/BrsTranspileState.js +9 -0
- package/dist/parser/BrsTranspileState.js.map +1 -1
- package/dist/parser/Expression.d.ts +150 -34
- package/dist/parser/Expression.js +337 -150
- package/dist/parser/Expression.js.map +1 -1
- package/dist/parser/Parser.Class.spec.js +189 -89
- package/dist/parser/Parser.Class.spec.js.map +1 -1
- package/dist/parser/Parser.d.ts +152 -29
- package/dist/parser/Parser.js +1095 -501
- package/dist/parser/Parser.js.map +1 -1
- package/dist/parser/Parser.spec.js +687 -266
- package/dist/parser/Parser.spec.js.map +1 -1
- package/dist/parser/SGParser.d.ts +41 -4
- package/dist/parser/SGParser.js +186 -175
- package/dist/parser/SGParser.js.map +1 -1
- package/dist/parser/SGParser.spec.js +35 -22
- package/dist/parser/SGParser.spec.js.map +1 -1
- package/dist/parser/SGTypes.d.ts +206 -38
- package/dist/parser/SGTypes.js +470 -161
- package/dist/parser/SGTypes.js.map +1 -1
- package/dist/parser/SGTypes.spec.d.ts +1 -0
- package/dist/parser/SGTypes.spec.js +351 -0
- package/dist/parser/SGTypes.spec.js.map +1 -0
- package/dist/parser/Statement.d.ts +194 -40
- package/dist/parser/Statement.js +597 -160
- package/dist/parser/Statement.js.map +1 -1
- package/dist/parser/Statement.spec.js +11 -11
- package/dist/parser/Statement.spec.js.map +1 -1
- package/dist/parser/TranspileState.d.ts +1 -1
- package/dist/parser/TranspileState.js +15 -7
- package/dist/parser/TranspileState.js.map +1 -1
- package/dist/parser/tests/Parser.spec.d.ts +10 -9
- package/dist/parser/tests/Parser.spec.js +15 -11
- package/dist/parser/tests/Parser.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/For.spec.js +60 -60
- package/dist/parser/tests/controlFlow/For.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/ForEach.spec.js +40 -39
- package/dist/parser/tests/controlFlow/ForEach.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/If.spec.js +213 -194
- package/dist/parser/tests/controlFlow/If.spec.js.map +1 -1
- package/dist/parser/tests/controlFlow/While.spec.js +37 -37
- package/dist/parser/tests/controlFlow/While.spec.js.map +1 -1
- package/dist/parser/tests/expression/Additive.spec.js +30 -30
- package/dist/parser/tests/expression/Additive.spec.js.map +1 -1
- package/dist/parser/tests/expression/ArrayLiterals.spec.js +119 -119
- package/dist/parser/tests/expression/ArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js +162 -138
- package/dist/parser/tests/expression/AssociativeArrayLiterals.spec.js.map +1 -1
- package/dist/parser/tests/expression/Boolean.spec.js +24 -24
- package/dist/parser/tests/expression/Boolean.spec.js.map +1 -1
- package/dist/parser/tests/expression/Call.spec.js +41 -40
- package/dist/parser/tests/expression/Call.spec.js.map +1 -1
- package/dist/parser/tests/expression/Exponential.spec.js +17 -17
- package/dist/parser/tests/expression/Exponential.spec.js.map +1 -1
- package/dist/parser/tests/expression/Function.spec.js +256 -256
- package/dist/parser/tests/expression/Function.spec.js.map +1 -1
- package/dist/parser/tests/expression/Indexing.spec.js +87 -87
- package/dist/parser/tests/expression/Indexing.spec.js.map +1 -1
- package/dist/parser/tests/expression/Multiplicative.spec.js +37 -37
- package/dist/parser/tests/expression/Multiplicative.spec.js.map +1 -1
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js +75 -63
- package/dist/parser/tests/expression/NullCoalescenceExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/PrefixUnary.spec.js +41 -41
- package/dist/parser/tests/expression/PrefixUnary.spec.js.map +1 -1
- package/dist/parser/tests/expression/Primary.spec.js +41 -41
- package/dist/parser/tests/expression/Primary.spec.js.map +1 -1
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.d.ts +1 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js +171 -0
- package/dist/parser/tests/expression/RegexLiteralExpression.spec.js.map +1 -0
- package/dist/parser/tests/expression/Relational.spec.js +43 -43
- package/dist/parser/tests/expression/Relational.spec.js.map +1 -1
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js +9 -9
- package/dist/parser/tests/expression/SourceLiteralExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js +28 -28
- package/dist/parser/tests/expression/TemplateStringExpression.spec.js.map +1 -1
- package/dist/parser/tests/expression/TernaryExpression.spec.js +102 -102
- package/dist/parser/tests/expression/TernaryExpression.spec.js.map +1 -1
- package/dist/parser/tests/statement/AssignmentOperators.spec.js +36 -36
- package/dist/parser/tests/statement/AssignmentOperators.spec.js.map +1 -1
- package/dist/parser/tests/statement/Declaration.spec.js +44 -44
- package/dist/parser/tests/statement/Declaration.spec.js.map +1 -1
- package/dist/parser/tests/statement/Dim.spec.js +21 -21
- package/dist/parser/tests/statement/Dim.spec.js.map +1 -1
- package/dist/parser/tests/statement/Enum.spec.d.ts +1 -0
- package/dist/parser/tests/statement/Enum.spec.js +840 -0
- package/dist/parser/tests/statement/Enum.spec.js.map +1 -0
- package/dist/parser/tests/statement/For.spec.d.ts +1 -0
- package/dist/parser/tests/statement/For.spec.js +46 -0
- package/dist/parser/tests/statement/For.spec.js.map +1 -0
- package/dist/parser/tests/statement/ForEach.spec.d.ts +1 -0
- package/dist/parser/tests/statement/ForEach.spec.js +37 -0
- package/dist/parser/tests/statement/ForEach.spec.js.map +1 -0
- package/dist/parser/tests/statement/Function.spec.js +198 -197
- package/dist/parser/tests/statement/Function.spec.js.map +1 -1
- package/dist/parser/tests/statement/Goto.spec.js +15 -14
- package/dist/parser/tests/statement/Goto.spec.js.map +1 -1
- package/dist/parser/tests/statement/Increment.spec.js +50 -50
- package/dist/parser/tests/statement/Increment.spec.js.map +1 -1
- package/dist/parser/tests/statement/InterfaceStatement.spec.d.ts +1 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js +254 -0
- package/dist/parser/tests/statement/InterfaceStatement.spec.js.map +1 -0
- package/dist/parser/tests/statement/LibraryStatement.spec.js +17 -17
- package/dist/parser/tests/statement/LibraryStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Misc.spec.js +108 -106
- package/dist/parser/tests/statement/Misc.spec.js.map +1 -1
- package/dist/parser/tests/statement/PrintStatement.spec.js +40 -40
- package/dist/parser/tests/statement/PrintStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/ReturnStatement.spec.js +46 -46
- package/dist/parser/tests/statement/ReturnStatement.spec.js.map +1 -1
- package/dist/parser/tests/statement/Set.spec.js +83 -83
- package/dist/parser/tests/statement/Set.spec.js.map +1 -1
- package/dist/parser/tests/statement/Stop.spec.js +12 -11
- package/dist/parser/tests/statement/Stop.spec.js.map +1 -1
- package/dist/parser/tests/statement/Throw.spec.js +5 -5
- package/dist/parser/tests/statement/Throw.spec.js.map +1 -1
- package/dist/parser/tests/statement/TryCatch.spec.js +15 -13
- package/dist/parser/tests/statement/TryCatch.spec.js.map +1 -1
- package/dist/preprocessor/Chunk.d.ts +1 -1
- package/dist/preprocessor/Chunk.js.map +1 -1
- package/dist/preprocessor/Manifest.d.ts +5 -5
- package/dist/preprocessor/Manifest.js +14 -35
- package/dist/preprocessor/Manifest.js.map +1 -1
- package/dist/preprocessor/Manifest.spec.d.ts +1 -0
- package/dist/preprocessor/Manifest.spec.js +78 -103
- package/dist/preprocessor/Manifest.spec.js.map +1 -1
- package/dist/preprocessor/Preprocessor.d.ts +1 -1
- package/dist/preprocessor/Preprocessor.js +8 -8
- package/dist/preprocessor/Preprocessor.js.map +1 -1
- package/dist/preprocessor/Preprocessor.spec.js +49 -49
- package/dist/preprocessor/Preprocessor.spec.js.map +1 -1
- package/dist/preprocessor/PreprocessorParser.spec.js +72 -72
- package/dist/preprocessor/PreprocessorParser.spec.js.map +1 -1
- package/dist/roku-types/data.json +21891 -0
- package/dist/roku-types/index.d.ts +6776 -0
- package/dist/roku-types/index.js +11 -0
- package/dist/roku-types/index.js.map +1 -0
- package/dist/types/ArrayType.d.ts +8 -5
- package/dist/types/ArrayType.js +52 -12
- package/dist/types/ArrayType.js.map +1 -1
- package/dist/types/ArrayType.spec.js +72 -11
- package/dist/types/ArrayType.spec.js.map +1 -1
- package/dist/types/BooleanType.d.ts +4 -2
- package/dist/types/BooleanType.js +9 -4
- package/dist/types/BooleanType.js.map +1 -1
- package/dist/types/BooleanType.spec.js +5 -3
- package/dist/types/BooleanType.spec.js.map +1 -1
- package/dist/types/BscType.d.ts +20 -5
- package/dist/types/BscType.js +24 -0
- package/dist/types/BscType.js.map +1 -1
- package/dist/types/CustomType.d.ts +8 -6
- package/dist/types/CustomType.js +20 -11
- package/dist/types/CustomType.js.map +1 -1
- package/dist/types/DoubleType.d.ts +2 -0
- package/dist/types/DoubleType.js +14 -9
- package/dist/types/DoubleType.js.map +1 -1
- package/dist/types/DoubleType.spec.js +5 -3
- package/dist/types/DoubleType.spec.js.map +1 -1
- package/dist/types/DynamicType.d.ts +2 -0
- package/dist/types/DynamicType.js +6 -2
- package/dist/types/DynamicType.js.map +1 -1
- package/dist/types/DynamicType.spec.js +2 -2
- package/dist/types/DynamicType.spec.js.map +1 -1
- package/dist/types/FloatType.d.ts +2 -0
- package/dist/types/FloatType.js +14 -9
- package/dist/types/FloatType.js.map +1 -1
- package/dist/types/FloatType.spec.js +4 -2
- package/dist/types/FloatType.spec.js.map +1 -1
- package/dist/types/FunctionType.d.ts +7 -31
- package/dist/types/FunctionType.js +11 -57
- package/dist/types/FunctionType.js.map +1 -1
- package/dist/types/IntegerType.d.ts +2 -0
- package/dist/types/IntegerType.js +14 -9
- package/dist/types/IntegerType.js.map +1 -1
- package/dist/types/IntegerType.spec.js +5 -3
- package/dist/types/IntegerType.spec.js.map +1 -1
- package/dist/types/InterfaceType.d.ts +13 -4
- package/dist/types/InterfaceType.js +48 -8
- package/dist/types/InterfaceType.js.map +1 -1
- package/dist/types/InterfaceType.spec.d.ts +1 -0
- package/dist/types/InterfaceType.spec.js +194 -0
- package/dist/types/InterfaceType.spec.js.map +1 -0
- package/dist/types/InvalidType.d.ts +4 -2
- package/dist/types/InvalidType.js +10 -5
- package/dist/types/InvalidType.js.map +1 -1
- package/dist/types/InvalidType.spec.js +4 -2
- package/dist/types/InvalidType.spec.js.map +1 -1
- package/dist/types/LazyType.d.ts +8 -7
- package/dist/types/LazyType.js +22 -10
- package/dist/types/LazyType.js.map +1 -1
- package/dist/types/LongIntegerType.d.ts +2 -0
- package/dist/types/LongIntegerType.js +14 -9
- package/dist/types/LongIntegerType.js.map +1 -1
- package/dist/types/LongIntegerType.spec.js +4 -2
- package/dist/types/LongIntegerType.spec.js.map +1 -1
- package/dist/types/ObjectType.d.ts +8 -4
- package/dist/types/ObjectType.js +9 -4
- package/dist/types/ObjectType.js.map +1 -1
- package/dist/types/ObjectType.spec.js +2 -2
- package/dist/types/ObjectType.spec.js.map +1 -1
- package/dist/types/StringType.d.ts +4 -2
- package/dist/types/StringType.js +9 -4
- package/dist/types/StringType.js.map +1 -1
- package/dist/types/StringType.spec.js +4 -2
- package/dist/types/StringType.spec.js.map +1 -1
- package/dist/types/TypedFunctionType.d.ts +28 -0
- package/dist/types/TypedFunctionType.js +88 -0
- package/dist/types/TypedFunctionType.js.map +1 -0
- package/dist/types/TypedFunctionType.spec.d.ts +1 -0
- package/dist/types/TypedFunctionType.spec.js +37 -0
- package/dist/types/TypedFunctionType.spec.js.map +1 -0
- package/dist/types/UninitializedType.js +3 -3
- package/dist/types/UninitializedType.js.map +1 -1
- package/dist/types/VoidType.d.ts +4 -2
- package/dist/types/VoidType.js +8 -4
- package/dist/types/VoidType.js.map +1 -1
- package/dist/types/VoidType.spec.js +2 -2
- package/dist/types/VoidType.spec.js.map +1 -1
- package/dist/types/helpers.d.ts +42 -0
- package/dist/types/helpers.js +118 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/util.d.ts +87 -16
- package/dist/util.js +339 -94
- package/dist/util.js.map +1 -1
- package/dist/validators/ClassValidator.d.ts +19 -2
- package/dist/validators/ClassValidator.js +163 -102
- package/dist/validators/ClassValidator.js.map +1 -1
- package/package.json +26 -15
- package/dist/astUtils/index.d.ts +0 -7
- package/dist/astUtils/index.js +0 -26
- package/dist/astUtils/index.js.map +0 -1
- package/dist/lexer/index.d.ts +0 -3
- package/dist/lexer/index.js +0 -17
- package/dist/lexer/index.js.map +0 -1
- package/dist/parser/index.d.ts +0 -3
- package/dist/parser/index.js +0 -16
- package/dist/parser/index.js.map +0 -1
- package/dist/preprocessor/index.d.ts +0 -3
- package/dist/preprocessor/index.js +0 -16
- package/dist/preprocessor/index.js.map +0 -1
- package/dist/types/FunctionType.spec.js +0 -23
- package/dist/types/FunctionType.spec.js.map +0 -1
package/dist/globalCallables.js
CHANGED
|
@@ -6,7 +6,7 @@ const ArrayType_1 = require("./types/ArrayType");
|
|
|
6
6
|
const BooleanType_1 = require("./types/BooleanType");
|
|
7
7
|
const DynamicType_1 = require("./types/DynamicType");
|
|
8
8
|
const FloatType_1 = require("./types/FloatType");
|
|
9
|
-
const
|
|
9
|
+
const TypedFunctionType_1 = require("./types/TypedFunctionType");
|
|
10
10
|
const IntegerType_1 = require("./types/IntegerType");
|
|
11
11
|
const ObjectType_1 = require("./types/ObjectType");
|
|
12
12
|
const StringType_1 = require("./types/StringType");
|
|
@@ -17,166 +17,184 @@ exports.globalFile.parse('');
|
|
|
17
17
|
let mathFunctions = [{
|
|
18
18
|
name: 'Abs',
|
|
19
19
|
shortDescription: 'Returns the absolute value of the argument.',
|
|
20
|
-
type: new
|
|
20
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
21
21
|
file: exports.globalFile,
|
|
22
22
|
params: [{
|
|
23
23
|
name: 'x',
|
|
24
|
-
type: new FloatType_1.FloatType()
|
|
24
|
+
type: new FloatType_1.FloatType(),
|
|
25
|
+
isOptional: false
|
|
25
26
|
}]
|
|
26
27
|
}, {
|
|
27
28
|
name: 'Atn',
|
|
28
29
|
shortDescription: 'Returns the arctangent (in radians) of the argument.',
|
|
29
30
|
documentation: '`ATN(X)` returns "the angle whose tangent is X". To get arctangent in degrees, multiply `ATN(X)` by `57.29578`.',
|
|
30
|
-
type: new
|
|
31
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
31
32
|
file: exports.globalFile,
|
|
32
33
|
params: [{
|
|
33
34
|
name: 'x',
|
|
34
|
-
type: new FloatType_1.FloatType()
|
|
35
|
+
type: new FloatType_1.FloatType(),
|
|
36
|
+
isOptional: false
|
|
35
37
|
}]
|
|
36
38
|
}, {
|
|
37
39
|
name: 'Cdbl',
|
|
38
40
|
shortDescription: 'Returns a single precision float representation of the argument. Someday may return double.',
|
|
39
|
-
type: new
|
|
41
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
40
42
|
file: exports.globalFile,
|
|
41
43
|
params: [{
|
|
42
44
|
name: 'x',
|
|
43
|
-
type: new IntegerType_1.IntegerType()
|
|
45
|
+
type: new IntegerType_1.IntegerType(),
|
|
46
|
+
isOptional: false
|
|
44
47
|
}]
|
|
45
48
|
}, {
|
|
46
49
|
name: 'Cint',
|
|
47
50
|
shortDescription: 'Returns an integer representation of the argument, rounding up from midpoints. CINT(2.1) returns 2; CINT(2.5) returns 3; CINT(-2.2) returns -2; CINT(-2.5) returns -2; CINT(-2.6) returns -3.',
|
|
48
|
-
type: new
|
|
51
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
49
52
|
file: exports.globalFile,
|
|
50
53
|
params: [{
|
|
51
54
|
name: 'x',
|
|
52
|
-
type: new FloatType_1.FloatType()
|
|
55
|
+
type: new FloatType_1.FloatType(),
|
|
56
|
+
isOptional: false
|
|
53
57
|
}]
|
|
54
58
|
}, {
|
|
55
59
|
name: 'Cos',
|
|
56
60
|
shortDescription: 'Returns the cosine of the argument (argument must be in radians). To obtain the cosine of X when X is in degrees, use CGS(X*.01745329).',
|
|
57
|
-
type: new
|
|
61
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
58
62
|
file: exports.globalFile,
|
|
59
63
|
params: [{
|
|
60
64
|
name: 'x',
|
|
61
|
-
type: new FloatType_1.FloatType()
|
|
65
|
+
type: new FloatType_1.FloatType(),
|
|
66
|
+
isOptional: false
|
|
62
67
|
}]
|
|
63
68
|
}, {
|
|
64
69
|
name: 'Csng',
|
|
65
70
|
shortDescription: 'Returns a single-precision float representation of the argument.',
|
|
66
|
-
type: new
|
|
71
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
67
72
|
file: exports.globalFile,
|
|
68
73
|
params: [{
|
|
69
74
|
name: 'x',
|
|
70
|
-
type: new IntegerType_1.IntegerType()
|
|
75
|
+
type: new IntegerType_1.IntegerType(),
|
|
76
|
+
isOptional: false
|
|
71
77
|
}]
|
|
72
78
|
}, {
|
|
73
79
|
name: 'Exp',
|
|
74
80
|
shortDescription: 'Returns the "natural exponential" of X, that is, ex. This is the inverse of the LOG function, so X=EXP(LOG(X)).',
|
|
75
|
-
type: new
|
|
81
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
76
82
|
file: exports.globalFile,
|
|
77
83
|
params: [{
|
|
78
84
|
name: 'x',
|
|
79
|
-
type: new FloatType_1.FloatType()
|
|
85
|
+
type: new FloatType_1.FloatType(),
|
|
86
|
+
isOptional: false
|
|
80
87
|
}]
|
|
81
88
|
}, {
|
|
82
89
|
name: 'Fix',
|
|
83
90
|
shortDescription: 'Returns a truncated representation of the argument. All digits to the right of the decimal point are simply chopped off, so the resultant value is an integer. For non-negative X, FIX(X)=lNT(X). For negative values of X, FIX(X)=INT(X)+1. For example, FIX(2.2) returns 2, and FIX(-2.2) returns -2.',
|
|
84
|
-
type: new
|
|
91
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
85
92
|
file: exports.globalFile,
|
|
86
93
|
params: [{
|
|
87
94
|
name: 'x',
|
|
88
|
-
type: new FloatType_1.FloatType()
|
|
95
|
+
type: new FloatType_1.FloatType(),
|
|
96
|
+
isOptional: false
|
|
89
97
|
}]
|
|
90
98
|
}, {
|
|
91
99
|
name: 'Int',
|
|
92
100
|
shortDescription: 'Returns an integer representation of the argument, using the largest whole number that is not greater than the argument.. INT(2.5) returns 2; INT(-2.5) returns -3; and INT(1000101.23) returns 10000101.',
|
|
93
|
-
type: new
|
|
101
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
94
102
|
file: exports.globalFile,
|
|
95
103
|
params: [{
|
|
96
104
|
name: 'x',
|
|
97
|
-
type: new FloatType_1.FloatType()
|
|
105
|
+
type: new FloatType_1.FloatType(),
|
|
106
|
+
isOptional: false
|
|
98
107
|
}]
|
|
99
108
|
}, {
|
|
100
109
|
name: 'Log',
|
|
101
110
|
shortDescription: 'Returns the natural logarithm of the argument, that is, loge(x) or ln(x). This is the inverse of the EXP function, so LOG(EXP(X)) = X. To find the logarithm of a number to another base b, use the formula logb(X) = loge(X) / loge(b). For example, LOG(32767) / LOG(2) returns the logarithm to base 2 of 32767.',
|
|
102
|
-
type: new
|
|
111
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
103
112
|
file: exports.globalFile,
|
|
104
113
|
params: [{
|
|
105
114
|
name: 'x',
|
|
106
|
-
type: new FloatType_1.FloatType()
|
|
115
|
+
type: new FloatType_1.FloatType(),
|
|
116
|
+
isOptional: false
|
|
107
117
|
}]
|
|
108
118
|
}, {
|
|
109
119
|
name: 'Rnd',
|
|
110
120
|
shortDescription: 'Generates a pseudo-random number using the current pseudo-random "seed number" (generated internally and not accessible to user).returns an integer between 1 and integer inclusive . For example, RND(55) returns a pseudo-random integer greater than zero and less than 56.',
|
|
111
|
-
type: new
|
|
121
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
112
122
|
file: exports.globalFile,
|
|
113
123
|
params: [{
|
|
114
124
|
name: 'range',
|
|
115
|
-
type: new IntegerType_1.IntegerType()
|
|
125
|
+
type: new IntegerType_1.IntegerType(),
|
|
126
|
+
isOptional: false
|
|
116
127
|
}]
|
|
117
128
|
}, {
|
|
118
129
|
name: 'Rnd',
|
|
119
130
|
shortDescription: 'Generates a pseudo-random number using the current pseudo-random "seed number" (generated internally and not accessible to user). Returns a float value between 0 and 1.',
|
|
120
|
-
type: new
|
|
131
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
121
132
|
file: exports.globalFile,
|
|
122
133
|
params: [{
|
|
123
134
|
name: '0',
|
|
124
|
-
type: new IntegerType_1.IntegerType()
|
|
135
|
+
type: new IntegerType_1.IntegerType(),
|
|
136
|
+
isOptional: false
|
|
125
137
|
}]
|
|
126
138
|
}, {
|
|
127
139
|
name: 'Sgn',
|
|
128
140
|
shortDescription: 'The "sign" function: returns -1 for X negative, 0 for X zero, and +1 for X positive.',
|
|
129
|
-
type: new
|
|
141
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
130
142
|
file: exports.globalFile,
|
|
131
143
|
params: [{
|
|
132
144
|
name: 'x',
|
|
133
|
-
type: new FloatType_1.FloatType()
|
|
145
|
+
type: new FloatType_1.FloatType(),
|
|
146
|
+
isOptional: false
|
|
134
147
|
}]
|
|
135
148
|
}, {
|
|
136
149
|
name: 'Sgn',
|
|
137
150
|
shortDescription: 'The "sign" function: returns -1 for X negative, 0 for X zero, and +1 for X positive.',
|
|
138
|
-
type: new
|
|
151
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
139
152
|
file: exports.globalFile,
|
|
140
153
|
params: [{
|
|
141
154
|
name: 'x',
|
|
142
|
-
type: new IntegerType_1.IntegerType()
|
|
155
|
+
type: new IntegerType_1.IntegerType(),
|
|
156
|
+
isOptional: false
|
|
143
157
|
}]
|
|
144
158
|
}, {
|
|
145
159
|
name: 'Sin',
|
|
146
160
|
shortDescription: 'Returns the sine of the argument (argument must be in radians). To obtain the sine of X when X is in degrees, use SIN(X*.01745329).',
|
|
147
|
-
type: new
|
|
161
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
148
162
|
file: exports.globalFile,
|
|
149
163
|
params: [{
|
|
150
164
|
name: 'x',
|
|
151
|
-
type: new FloatType_1.FloatType()
|
|
165
|
+
type: new FloatType_1.FloatType(),
|
|
166
|
+
isOptional: false
|
|
152
167
|
}]
|
|
153
168
|
}, {
|
|
154
169
|
name: 'Sqr',
|
|
155
170
|
shortDescription: 'Returns the square root of the argument. SQR(X) is the same as X ^ (1/2), only faster.',
|
|
156
|
-
type: new
|
|
171
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
157
172
|
file: exports.globalFile,
|
|
158
173
|
params: [{
|
|
159
174
|
name: 'x',
|
|
160
|
-
type: new FloatType_1.FloatType()
|
|
175
|
+
type: new FloatType_1.FloatType(),
|
|
176
|
+
isOptional: false
|
|
161
177
|
}]
|
|
162
178
|
}, {
|
|
163
179
|
name: 'Tan',
|
|
164
180
|
shortDescription: 'Returns the tangent of the argument (argument must be in radians). To obtain the tangent of X when X is in degrees, use TAN(X*.01745329).',
|
|
165
|
-
type: new
|
|
181
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
166
182
|
file: exports.globalFile,
|
|
167
183
|
params: [{
|
|
168
184
|
name: 'x',
|
|
169
|
-
type: new FloatType_1.FloatType()
|
|
185
|
+
type: new FloatType_1.FloatType(),
|
|
186
|
+
isOptional: false
|
|
170
187
|
}]
|
|
171
188
|
}];
|
|
172
189
|
let runtimeFunctions = [{
|
|
173
190
|
name: 'CreateObject',
|
|
174
191
|
shortDescription: 'Creates a BrightScript Component of class classname specified. Return invalid if the object creation fails. Some Objects have optional parameters in their constructor that are passed after name.',
|
|
175
|
-
type: new
|
|
192
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
176
193
|
file: exports.globalFile,
|
|
177
194
|
params: [{
|
|
178
195
|
name: 'name',
|
|
179
|
-
type: new StringType_1.StringType()
|
|
196
|
+
type: new StringType_1.StringType(),
|
|
197
|
+
isOptional: false
|
|
180
198
|
}, {
|
|
181
199
|
name: 'param2',
|
|
182
200
|
type: new DynamicType_1.DynamicType(),
|
|
@@ -189,15 +207,24 @@ let runtimeFunctions = [{
|
|
|
189
207
|
name: 'param4',
|
|
190
208
|
type: new DynamicType_1.DynamicType(),
|
|
191
209
|
isOptional: true
|
|
210
|
+
}, {
|
|
211
|
+
name: 'param5',
|
|
212
|
+
type: new DynamicType_1.DynamicType(),
|
|
213
|
+
isOptional: true
|
|
214
|
+
}, {
|
|
215
|
+
name: 'param6',
|
|
216
|
+
type: new DynamicType_1.DynamicType(),
|
|
217
|
+
isOptional: true
|
|
192
218
|
}]
|
|
193
219
|
}, {
|
|
194
220
|
name: 'Type',
|
|
195
221
|
shortDescription: 'Returns the type of a variable and/or object. See the BrightScript Component specification for a list of types.',
|
|
196
|
-
type: new
|
|
222
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
197
223
|
file: exports.globalFile,
|
|
198
224
|
params: [{
|
|
199
225
|
name: 'variable',
|
|
200
|
-
type: new ObjectType_1.ObjectType()
|
|
226
|
+
type: new ObjectType_1.ObjectType(),
|
|
227
|
+
isOptional: false
|
|
201
228
|
}, {
|
|
202
229
|
name: 'version',
|
|
203
230
|
type: new StringType_1.StringType(),
|
|
@@ -206,64 +233,70 @@ let runtimeFunctions = [{
|
|
|
206
233
|
}, {
|
|
207
234
|
name: 'GetGlobalAA',
|
|
208
235
|
shortDescription: 'Each script has a global Associative Array. It can be fetched with this function. ',
|
|
209
|
-
type: new
|
|
236
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
210
237
|
file: exports.globalFile,
|
|
211
238
|
params: []
|
|
212
239
|
}, {
|
|
213
240
|
name: 'Box',
|
|
214
241
|
shortDescription: 'Box() will return an object version of an intrinsic type, or pass through an object if given one.',
|
|
215
|
-
type: new
|
|
242
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
216
243
|
file: exports.globalFile,
|
|
217
244
|
params: [{
|
|
218
245
|
name: 'x',
|
|
219
|
-
type: new DynamicType_1.DynamicType()
|
|
246
|
+
type: new DynamicType_1.DynamicType(),
|
|
247
|
+
isOptional: false
|
|
220
248
|
}]
|
|
221
249
|
}, {
|
|
222
250
|
name: 'Run',
|
|
223
251
|
shortDescription: `The Run function can be used to compile and run a script dynamically.\nThe file specified by that path is compiled and run.\nArguments may be passed to the script's Main function, and that script may return a result value.'`,
|
|
224
|
-
type: new
|
|
252
|
+
type: new TypedFunctionType_1.TypedFunctionType(new DynamicType_1.DynamicType()),
|
|
225
253
|
file: exports.globalFile,
|
|
226
254
|
params: [{
|
|
227
255
|
name: 'filename',
|
|
228
|
-
type: new StringType_1.StringType()
|
|
256
|
+
type: new StringType_1.StringType(),
|
|
257
|
+
isOptional: false
|
|
229
258
|
}, {
|
|
230
259
|
name: 'arg',
|
|
231
260
|
type: new DynamicType_1.DynamicType(),
|
|
232
|
-
isRestArgument: true
|
|
261
|
+
isRestArgument: true,
|
|
262
|
+
isOptional: false
|
|
233
263
|
}]
|
|
234
264
|
}, {
|
|
235
265
|
name: 'Run',
|
|
236
266
|
shortDescription: `The Run function can be used to compile and run a script dynamically.\nAll files specified are compiled together, then run.\nArguments may be passed to the script's Main function, and that script may return a result value.'`,
|
|
237
|
-
type: new
|
|
267
|
+
type: new TypedFunctionType_1.TypedFunctionType(new DynamicType_1.DynamicType()),
|
|
238
268
|
file: exports.globalFile,
|
|
239
269
|
params: [{
|
|
240
270
|
name: 'filename',
|
|
241
|
-
type: new ArrayType_1.ArrayType(new StringType_1.StringType())
|
|
271
|
+
type: new ArrayType_1.ArrayType(new StringType_1.StringType()),
|
|
272
|
+
isOptional: false
|
|
242
273
|
}, {
|
|
243
274
|
name: 'arg',
|
|
244
275
|
type: new DynamicType_1.DynamicType(),
|
|
245
|
-
isRestArgument: true
|
|
276
|
+
isRestArgument: true,
|
|
277
|
+
isOptional: true
|
|
246
278
|
}]
|
|
247
279
|
}, {
|
|
248
280
|
name: 'Eval',
|
|
249
281
|
shortDescription: `Eval can be used to run a code snippet in the context of the current function. It performs a compile, and then the bytecode execution.\nIf a compilation error occurs, no bytecode execution is performed, and Eval returns an roList with one or more compile errors. Each list entry is an roAssociativeArray with ERRNO and ERRSTR keys describing the error.\nIf compilation succeeds, bytecode execution is performed and the integer runtime error code is returned. These are the same error codes as returned by GetLastRunRuntimeError().\nEval() can be usefully in two cases. The first is when you need to dynamically generate code at runtime.\nThe other is if you need to execute a statement that could result in a runtime error, but you don't want code execution to stop. '`,
|
|
250
|
-
type: new
|
|
282
|
+
type: new TypedFunctionType_1.TypedFunctionType(new DynamicType_1.DynamicType()),
|
|
251
283
|
file: exports.globalFile,
|
|
252
284
|
isDeprecated: true,
|
|
253
285
|
params: [{
|
|
254
286
|
name: 'code',
|
|
255
|
-
type: new StringType_1.StringType()
|
|
287
|
+
type: new StringType_1.StringType(),
|
|
288
|
+
isOptional: false
|
|
256
289
|
}]
|
|
257
290
|
}, {
|
|
258
291
|
name: 'GetLastRunCompileError',
|
|
259
292
|
shortDescription: 'Returns an roList of compile errors, or invalid if no errors. Each list entry is an roAssociativeArray with the keys: ERRNO, ERRSTR, FILESPEC, and LINENO.',
|
|
260
|
-
type: new
|
|
293
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
261
294
|
file: exports.globalFile,
|
|
262
295
|
params: []
|
|
263
296
|
}, {
|
|
264
297
|
name: 'GetLastRunRuntimeError',
|
|
265
298
|
shortDescription: 'Returns an error code result after the last script Run().These are normal:\\,&hFF==ERR_OKAY\\n&hFC==ERR_NORMAL_END\\n&hE2==ERR_VALUE_RETURN',
|
|
266
|
-
type: new
|
|
299
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
267
300
|
file: exports.globalFile,
|
|
268
301
|
params: []
|
|
269
302
|
}];
|
|
@@ -271,116 +304,132 @@ let globalUtilityFunctions = [
|
|
|
271
304
|
{
|
|
272
305
|
name: 'Sleep',
|
|
273
306
|
shortDescription: 'This function causes the script to pause for the specified time, without wasting CPU cycles. There are 1000 milliseconds in one second.',
|
|
274
|
-
type: new
|
|
307
|
+
type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
|
|
275
308
|
file: exports.globalFile,
|
|
276
309
|
params: [{
|
|
277
310
|
name: 'milliseconds',
|
|
278
|
-
type: new IntegerType_1.IntegerType()
|
|
311
|
+
type: new IntegerType_1.IntegerType(),
|
|
312
|
+
isOptional: false
|
|
279
313
|
}]
|
|
280
314
|
}, {
|
|
281
315
|
name: 'Wait',
|
|
282
316
|
shortDescription: 'This function waits on objects that are "waitable" (those that have a MessagePort interface). Wait() returns the event object that was posted to the message port. If timeout is zero, "wait" will wait for ever. Otherwise, Wait will return after timeout milliseconds if no messages are received. In this case, Wait returns a type "invalid".',
|
|
283
|
-
type: new
|
|
317
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
284
318
|
file: exports.globalFile,
|
|
285
319
|
params: [{
|
|
286
320
|
name: 'timeout',
|
|
287
|
-
type: new IntegerType_1.IntegerType()
|
|
321
|
+
type: new IntegerType_1.IntegerType(),
|
|
322
|
+
isOptional: false
|
|
288
323
|
}, {
|
|
289
324
|
name: 'port',
|
|
290
|
-
type: new ObjectType_1.ObjectType()
|
|
325
|
+
type: new ObjectType_1.ObjectType(),
|
|
326
|
+
isOptional: false
|
|
291
327
|
}]
|
|
292
328
|
}, {
|
|
293
329
|
name: 'GetInterface',
|
|
294
330
|
shortDescription: 'Each BrightScript Component has one or more interfaces. This function returns a value of type "Interface". \nNote that generally BrightScript Components allow you to skip the interface specification. In which case, the appropriate interface within the object is used. This works as long as the function names within the interfaces are unique.',
|
|
295
|
-
type: new
|
|
331
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
296
332
|
file: exports.globalFile,
|
|
297
333
|
params: [{
|
|
298
334
|
name: 'object',
|
|
299
|
-
type: new ObjectType_1.ObjectType()
|
|
335
|
+
type: new ObjectType_1.ObjectType(),
|
|
336
|
+
isOptional: false
|
|
300
337
|
}, {
|
|
301
338
|
name: 'ifname',
|
|
302
|
-
type: new StringType_1.StringType()
|
|
339
|
+
type: new StringType_1.StringType(),
|
|
340
|
+
isOptional: false
|
|
303
341
|
}]
|
|
304
342
|
}, {
|
|
305
343
|
name: 'FindMemberFunction',
|
|
306
344
|
shortDescription: 'Returns the interface from the object that provides the specified function, or invalid if not found.',
|
|
307
|
-
type: new
|
|
345
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
308
346
|
file: exports.globalFile,
|
|
309
347
|
params: [{
|
|
310
348
|
name: 'object',
|
|
311
|
-
type: new ObjectType_1.ObjectType()
|
|
349
|
+
type: new ObjectType_1.ObjectType(),
|
|
350
|
+
isOptional: false
|
|
312
351
|
}, {
|
|
313
352
|
name: 'functionName',
|
|
314
|
-
type: new StringType_1.StringType()
|
|
353
|
+
type: new StringType_1.StringType(),
|
|
354
|
+
isOptional: false
|
|
315
355
|
}]
|
|
316
356
|
}, {
|
|
317
357
|
name: 'UpTime',
|
|
318
358
|
shortDescription: 'Returns the uptime of the system since the last reboot in seconds.',
|
|
319
|
-
type: new
|
|
359
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
320
360
|
file: exports.globalFile,
|
|
321
361
|
params: [{
|
|
322
362
|
name: 'dummy',
|
|
323
|
-
type: new IntegerType_1.IntegerType()
|
|
363
|
+
type: new IntegerType_1.IntegerType(),
|
|
364
|
+
isOptional: false
|
|
324
365
|
}]
|
|
325
366
|
}, {
|
|
326
367
|
name: 'RebootSystem',
|
|
327
368
|
shortDescription: 'Requests the system to perform a soft reboot. The Roku platform has disabled this feature.',
|
|
328
|
-
type: new
|
|
369
|
+
type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
|
|
329
370
|
file: exports.globalFile,
|
|
330
371
|
params: []
|
|
331
372
|
}, {
|
|
332
373
|
name: 'ListDir',
|
|
333
374
|
shortDescription: 'Returns a List object containing the contents of the directory path specified.',
|
|
334
|
-
type: new
|
|
375
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
335
376
|
file: exports.globalFile,
|
|
336
377
|
params: [{
|
|
337
378
|
name: 'path',
|
|
338
|
-
type: new StringType_1.StringType()
|
|
379
|
+
type: new StringType_1.StringType(),
|
|
380
|
+
isOptional: false
|
|
339
381
|
}]
|
|
340
382
|
}, {
|
|
341
383
|
name: 'ReadAsciiFile',
|
|
342
384
|
shortDescription: 'This function reads the specified file and returns the data as a string.\nThe file can be encoded as either UTF-8 (which includes the 7-bit ASCII subset) or UTF-16.\nAn empty string is returned if the file can not be read.',
|
|
343
|
-
type: new
|
|
385
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
344
386
|
file: exports.globalFile,
|
|
345
387
|
params: [{
|
|
346
388
|
name: 'filePath',
|
|
347
|
-
type: new StringType_1.StringType()
|
|
389
|
+
type: new StringType_1.StringType(),
|
|
390
|
+
isOptional: false
|
|
348
391
|
}]
|
|
349
392
|
}, {
|
|
350
393
|
name: 'WriteAsciiFile',
|
|
351
394
|
shortDescription: 'This function writes the specified string data to a file at the specified location.\nThe string data is written as UTF-8 encoded (which includes the 7-bit ASCII subset).\nThe function returns true if the file was successfully written.',
|
|
352
|
-
type: new
|
|
395
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
353
396
|
file: exports.globalFile,
|
|
354
397
|
params: [{
|
|
355
398
|
name: 'filePath',
|
|
356
|
-
type: new StringType_1.StringType()
|
|
399
|
+
type: new StringType_1.StringType(),
|
|
400
|
+
isOptional: false
|
|
357
401
|
}, {
|
|
358
402
|
name: 'text',
|
|
359
|
-
type: new StringType_1.StringType()
|
|
403
|
+
type: new StringType_1.StringType(),
|
|
404
|
+
isOptional: false
|
|
360
405
|
}]
|
|
361
406
|
}, {
|
|
362
407
|
name: 'CopyFile',
|
|
363
408
|
shortDescription: 'Make a copy of a file.',
|
|
364
|
-
type: new
|
|
409
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
365
410
|
file: exports.globalFile,
|
|
366
411
|
params: [{
|
|
367
412
|
name: 'source',
|
|
368
|
-
type: new StringType_1.StringType()
|
|
413
|
+
type: new StringType_1.StringType(),
|
|
414
|
+
isOptional: false
|
|
369
415
|
}, {
|
|
370
416
|
name: 'destination',
|
|
371
|
-
type: new StringType_1.StringType()
|
|
417
|
+
type: new StringType_1.StringType(),
|
|
418
|
+
isOptional: false
|
|
372
419
|
}]
|
|
373
420
|
}, {
|
|
374
421
|
name: 'MoveFile',
|
|
375
422
|
shortDescription: 'Rename a file.',
|
|
376
|
-
type: new
|
|
423
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
377
424
|
file: exports.globalFile,
|
|
378
425
|
params: [{
|
|
379
426
|
name: 'source',
|
|
380
|
-
type: new StringType_1.StringType()
|
|
427
|
+
type: new StringType_1.StringType(),
|
|
428
|
+
isOptional: false
|
|
381
429
|
}, {
|
|
382
430
|
name: 'destination',
|
|
383
|
-
type: new StringType_1.StringType()
|
|
431
|
+
type: new StringType_1.StringType(),
|
|
432
|
+
isOptional: false
|
|
384
433
|
}]
|
|
385
434
|
}, {
|
|
386
435
|
name: 'MatchFiles',
|
|
@@ -395,80 +444,95 @@ A '*' matches zero or more arbitrary characters.
|
|
|
395
444
|
The character class '[...]' matches any single character specified within the brackets. The closing bracket is treated as a member of the character class if it immediately follows the opening bracket. i.e. '[]]' matches a single close bracket. Within the class '-' can be used to specify a range unless it is the first or last character. e.g. '[A-Cf-h]' is equivalent to '[ABCfgh]'.
|
|
396
445
|
A character class can be negated by specifying '^' as the first character. To match a literal '^' place it elsewhere within the class.
|
|
397
446
|
The characters '?', '*' and '[' lose their special meaning if preceded by a single '\\'. A single '\\' can be matched as '\\\\'.`,
|
|
398
|
-
type: new
|
|
447
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ArrayType_1.ArrayType(new StringType_1.StringType())),
|
|
399
448
|
file: exports.globalFile,
|
|
400
449
|
params: [{
|
|
401
450
|
name: 'path',
|
|
402
|
-
type: new StringType_1.StringType()
|
|
451
|
+
type: new StringType_1.StringType(),
|
|
452
|
+
isOptional: false
|
|
403
453
|
}, {
|
|
404
454
|
name: 'pattern_in',
|
|
405
|
-
type: new StringType_1.StringType()
|
|
455
|
+
type: new StringType_1.StringType(),
|
|
456
|
+
isOptional: false
|
|
406
457
|
}]
|
|
407
458
|
}, {
|
|
408
459
|
name: 'DeleteFile',
|
|
409
460
|
shortDescription: 'Delete the specified file.',
|
|
410
|
-
type: new
|
|
461
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
411
462
|
file: exports.globalFile,
|
|
412
463
|
params: [{
|
|
413
464
|
name: 'file',
|
|
414
|
-
type: new StringType_1.StringType()
|
|
465
|
+
type: new StringType_1.StringType(),
|
|
466
|
+
isOptional: false
|
|
415
467
|
}]
|
|
416
468
|
}, {
|
|
417
469
|
name: 'DeleteDirectory',
|
|
418
470
|
shortDescription: 'Deletes the specified directory. It is only possible to delete an empty directory.',
|
|
419
|
-
type: new
|
|
471
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
420
472
|
file: exports.globalFile,
|
|
421
473
|
params: [{
|
|
422
474
|
name: 'dir',
|
|
423
|
-
type: new StringType_1.StringType()
|
|
475
|
+
type: new StringType_1.StringType(),
|
|
476
|
+
isOptional: false
|
|
424
477
|
}]
|
|
425
478
|
}, {
|
|
426
479
|
name: 'CreateDirectory',
|
|
427
480
|
shortDescription: 'Creates the specified Directory. Only one directory can be created at a time',
|
|
428
|
-
type: new
|
|
481
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
429
482
|
file: exports.globalFile,
|
|
430
483
|
params: [{
|
|
431
484
|
name: 'dir',
|
|
432
|
-
type: new StringType_1.StringType()
|
|
485
|
+
type: new StringType_1.StringType(),
|
|
486
|
+
isOptional: false
|
|
433
487
|
}]
|
|
434
488
|
}, {
|
|
435
489
|
name: 'FormatDrive',
|
|
436
490
|
shortDescription: 'Formats a specified drive using the specified filesystem.',
|
|
437
|
-
type: new
|
|
491
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
438
492
|
file: exports.globalFile,
|
|
439
493
|
params: [{
|
|
440
494
|
name: 'drive',
|
|
441
|
-
type: new StringType_1.StringType()
|
|
495
|
+
type: new StringType_1.StringType(),
|
|
496
|
+
isOptional: false
|
|
442
497
|
}, {
|
|
443
498
|
name: 'fs_type',
|
|
444
|
-
type: new StringType_1.StringType()
|
|
499
|
+
type: new StringType_1.StringType(),
|
|
500
|
+
isOptional: false
|
|
445
501
|
}]
|
|
446
502
|
}, {
|
|
447
503
|
name: 'StrToI',
|
|
448
504
|
shortDescription: 'Return the integer value of the string, or 0 if nothing is parsed.',
|
|
449
|
-
type: new
|
|
505
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
450
506
|
file: exports.globalFile,
|
|
451
507
|
params: [{
|
|
452
508
|
name: 'str',
|
|
453
|
-
type: new StringType_1.StringType()
|
|
509
|
+
type: new StringType_1.StringType(),
|
|
510
|
+
isOptional: false
|
|
454
511
|
}]
|
|
455
512
|
}, {
|
|
456
513
|
name: 'RunGarbageCollector',
|
|
457
514
|
shortDescription: `This function runs the garbage collector. It returns and Associative Array with some statistics regarding the garbage collection. \nSee the Garbage Collection section of the manual for more detail. You don't normally need to call this function.`,
|
|
458
|
-
type: new
|
|
515
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
459
516
|
file: exports.globalFile,
|
|
460
517
|
params: []
|
|
461
518
|
}, {
|
|
462
519
|
name: 'ParseJson',
|
|
463
520
|
shortDescription: `This function will parse a string formatted according to RFC4627 and return an equivalent BrightScript object (consisting of booleans, integer and floating point numbers, strings, roArray, and roAssociativeArray objects). If the string is not syntactically correct, Invalid will be returned. A few other things to note:
|
|
464
521
|
|
|
465
|
-
Any roAssociativeArray objects in the returned objects will be case sensitive.
|
|
522
|
+
Any roAssociativeArray objects in the returned objects will be case sensitive. As of Roku OS 9.4, to return a case-insensitive structure, set the flags parameter to "i".
|
|
523
|
+
If the "i" option is used, and the jsonString includes multiple keys that match case-insensitively, duplicates are overwritten and only the last matching values are preserved.
|
|
466
524
|
An error will be returned if arrays/associative arrays are nested more than 256 levels deep.`,
|
|
467
|
-
type: new
|
|
525
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
468
526
|
file: exports.globalFile,
|
|
469
527
|
params: [{
|
|
470
528
|
name: 'jsonString',
|
|
471
|
-
type: new StringType_1.StringType()
|
|
529
|
+
type: new StringType_1.StringType(),
|
|
530
|
+
isOptional: false
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
name: 'flags',
|
|
534
|
+
type: new StringType_1.StringType(),
|
|
535
|
+
isOptional: true
|
|
472
536
|
}]
|
|
473
537
|
}, {
|
|
474
538
|
name: 'FormatJson',
|
|
@@ -481,11 +545,12 @@ An error will be returned if arrays/associative arrays are nested more than 256
|
|
|
481
545
|
If an error occurs an empty string will be returned.
|
|
482
546
|
|
|
483
547
|
Normally non-ASCII characters are escaped in the output string as "\\uXXXX" where XXXX is the hexadecimal representation of the Unicode character value. If flags=1, non-ASCII characters are not escaped.`,
|
|
484
|
-
type: new
|
|
548
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
485
549
|
file: exports.globalFile,
|
|
486
550
|
params: [{
|
|
487
551
|
name: 'object',
|
|
488
|
-
type: new ObjectType_1.ObjectType()
|
|
552
|
+
type: new ObjectType_1.ObjectType(),
|
|
553
|
+
isOptional: false
|
|
489
554
|
}, {
|
|
490
555
|
name: 'flags',
|
|
491
556
|
type: new StringType_1.StringType(),
|
|
@@ -497,11 +562,12 @@ Normally non-ASCII characters are escaped in the output string as "\\uXXXX" wher
|
|
|
497
562
|
|
|
498
563
|
In some cases you may want to include a placeholder marker in a localizable string that gets dynamically substituted with a value at runtime.
|
|
499
564
|
One way to accomplish that is to use the Replace method on the string value returned from the Tr() lookup.`,
|
|
500
|
-
type: new
|
|
565
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
501
566
|
file: exports.globalFile,
|
|
502
567
|
params: [{
|
|
503
568
|
name: 'source',
|
|
504
|
-
type: new StringType_1.StringType()
|
|
569
|
+
type: new StringType_1.StringType(),
|
|
570
|
+
isOptional: false
|
|
505
571
|
}]
|
|
506
572
|
}
|
|
507
573
|
];
|
|
@@ -509,29 +575,32 @@ let globalStringFunctions = [
|
|
|
509
575
|
{
|
|
510
576
|
name: 'UCase',
|
|
511
577
|
shortDescription: 'Converts the string to all upper case.',
|
|
512
|
-
type: new
|
|
578
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
513
579
|
file: exports.globalFile,
|
|
514
580
|
params: [{
|
|
515
581
|
name: 's',
|
|
516
|
-
type: new StringType_1.StringType()
|
|
582
|
+
type: new StringType_1.StringType(),
|
|
583
|
+
isOptional: false
|
|
517
584
|
}]
|
|
518
585
|
}, {
|
|
519
586
|
name: 'LCase',
|
|
520
587
|
shortDescription: 'Converts the string to all lower case.',
|
|
521
|
-
type: new
|
|
588
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
522
589
|
file: exports.globalFile,
|
|
523
590
|
params: [{
|
|
524
591
|
name: 's',
|
|
525
|
-
type: new StringType_1.StringType()
|
|
592
|
+
type: new StringType_1.StringType(),
|
|
593
|
+
isOptional: false
|
|
526
594
|
}]
|
|
527
595
|
}, {
|
|
528
596
|
name: 'Asc',
|
|
529
597
|
shortDescription: 'Returns the Unicode ("ASCII") value for the first character of the specified string\n An empty string argument will return 0.',
|
|
530
|
-
type: new
|
|
598
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
531
599
|
file: exports.globalFile,
|
|
532
600
|
params: [{
|
|
533
601
|
name: 'letter',
|
|
534
|
-
type: new StringType_1.StringType()
|
|
602
|
+
type: new StringType_1.StringType(),
|
|
603
|
+
isOptional: false
|
|
535
604
|
}]
|
|
536
605
|
}, {
|
|
537
606
|
name: 'Chr',
|
|
@@ -542,59 +611,68 @@ let globalStringFunctions = [
|
|
|
542
611
|
By using Chr, you can create strings containing characters which cannot be contained in quotes, such as newline or the quote character itself.
|
|
543
612
|
|
|
544
613
|
print (Chr(34) + "hello" + Chr(34)) ' prints: "hello"`,
|
|
545
|
-
type: new
|
|
614
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
546
615
|
file: exports.globalFile,
|
|
547
616
|
params: [{
|
|
548
617
|
name: 'ch',
|
|
549
|
-
type: new IntegerType_1.IntegerType()
|
|
618
|
+
type: new IntegerType_1.IntegerType(),
|
|
619
|
+
isOptional: false
|
|
550
620
|
}]
|
|
551
621
|
}, {
|
|
552
622
|
name: 'Instr',
|
|
553
623
|
shortDescription: 'Returns the position of the first instances of substring within text, starting at the specified start position.\nReturns 0 if the substring is not found. Unlike the ifString.Instr() method, the first position is 1.',
|
|
554
|
-
type: new
|
|
624
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
555
625
|
file: exports.globalFile,
|
|
556
626
|
params: [{
|
|
557
627
|
name: 'start',
|
|
558
|
-
type: new IntegerType_1.IntegerType()
|
|
628
|
+
type: new IntegerType_1.IntegerType(),
|
|
629
|
+
isOptional: false
|
|
559
630
|
}, {
|
|
560
631
|
name: 'text',
|
|
561
|
-
type: new StringType_1.StringType()
|
|
632
|
+
type: new StringType_1.StringType(),
|
|
633
|
+
isOptional: false
|
|
562
634
|
}, {
|
|
563
635
|
name: 'substring',
|
|
564
|
-
type: new StringType_1.StringType()
|
|
636
|
+
type: new StringType_1.StringType(),
|
|
637
|
+
isOptional: false
|
|
565
638
|
}]
|
|
566
639
|
}, {
|
|
567
640
|
name: 'Left',
|
|
568
641
|
shortDescription: 'Returns the first n characters of s. ',
|
|
569
|
-
type: new
|
|
642
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
570
643
|
file: exports.globalFile,
|
|
571
644
|
params: [{
|
|
572
645
|
name: 's',
|
|
573
|
-
type: new StringType_1.StringType()
|
|
646
|
+
type: new StringType_1.StringType(),
|
|
647
|
+
isOptional: false
|
|
574
648
|
}, {
|
|
575
649
|
name: 'n',
|
|
576
|
-
type: new IntegerType_1.IntegerType()
|
|
650
|
+
type: new IntegerType_1.IntegerType(),
|
|
651
|
+
isOptional: false
|
|
577
652
|
}]
|
|
578
653
|
}, {
|
|
579
654
|
name: 'Len',
|
|
580
655
|
shortDescription: 'Returns the number of characters in the specified string.',
|
|
581
|
-
type: new
|
|
656
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
582
657
|
file: exports.globalFile,
|
|
583
658
|
params: [{
|
|
584
659
|
name: 's',
|
|
585
|
-
type: new StringType_1.StringType()
|
|
660
|
+
type: new StringType_1.StringType(),
|
|
661
|
+
isOptional: false
|
|
586
662
|
}]
|
|
587
663
|
}, {
|
|
588
664
|
name: 'Mid',
|
|
589
665
|
shortDescription: 'Returns a substring of s with length n and starting at position p.\nn may be omitted, in which case the string starting at p and ending at the end of the string is returned.\nUnlike the ifString.Mid() method, the first character in the string is position 1.',
|
|
590
|
-
type: new
|
|
666
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
591
667
|
file: exports.globalFile,
|
|
592
668
|
params: [{
|
|
593
669
|
name: 's',
|
|
594
|
-
type: new StringType_1.StringType()
|
|
670
|
+
type: new StringType_1.StringType(),
|
|
671
|
+
isOptional: false
|
|
595
672
|
}, {
|
|
596
673
|
name: 'p',
|
|
597
|
-
description: '1-based position',
|
|
674
|
+
//description: '1-based position',
|
|
675
|
+
isOptional: false,
|
|
598
676
|
type: new IntegerType_1.IntegerType()
|
|
599
677
|
}, {
|
|
600
678
|
name: 'n',
|
|
@@ -604,92 +682,118 @@ By using Chr, you can create strings containing characters which cannot be conta
|
|
|
604
682
|
}, {
|
|
605
683
|
name: 'Right',
|
|
606
684
|
shortDescription: 'Returns the last n characters of s.',
|
|
607
|
-
type: new
|
|
685
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
608
686
|
file: exports.globalFile,
|
|
609
687
|
params: [{
|
|
610
688
|
name: 's',
|
|
611
|
-
type: new StringType_1.StringType()
|
|
689
|
+
type: new StringType_1.StringType(),
|
|
690
|
+
isOptional: false
|
|
612
691
|
}, {
|
|
613
692
|
name: 'n',
|
|
614
|
-
type: new IntegerType_1.IntegerType()
|
|
693
|
+
type: new IntegerType_1.IntegerType(),
|
|
694
|
+
isOptional: false
|
|
615
695
|
}]
|
|
616
696
|
}, {
|
|
617
697
|
name: 'Str',
|
|
618
698
|
shortDescription: 'Converts a value to a string. Str(A), for example, returns a string equal to the decimal representation of the numeric value of A.\nNote: for non-negative numbers, a leading blank is inserted before the value string as a sign placeholder.',
|
|
619
|
-
type: new
|
|
699
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
620
700
|
file: exports.globalFile,
|
|
621
701
|
params: [{
|
|
622
702
|
name: 'value',
|
|
623
|
-
type: new FloatType_1.FloatType()
|
|
703
|
+
type: new FloatType_1.FloatType(),
|
|
704
|
+
isOptional: false
|
|
624
705
|
}]
|
|
625
706
|
}, {
|
|
626
707
|
name: 'StrI',
|
|
627
|
-
shortDescription: 'Converts a value to a string. Str(A), for example, returns a string equal to the decimal representation of the numeric value of A.\nNote: for non-negative numbers, a leading blank is inserted before the value string as a sign placeholder
|
|
628
|
-
type: new
|
|
708
|
+
shortDescription: 'Converts a value to a string. Str(A), for example, returns a string equal to the decimal representation of the numeric value of A.\nNote: for non-negative numbers, a leading blank is inserted before the value string as a sign placeholder. If the radix parameter is provided, then converts the integer value into a string representation using the given radix.\nIf radix is not 2 .. 36 then an empty string is returned.\nNote that the returned string does not include a base prefix and uses lowercase letters to represent those digits in bases greater than 10.',
|
|
709
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
629
710
|
file: exports.globalFile,
|
|
630
711
|
params: [{
|
|
631
712
|
name: 'value',
|
|
632
|
-
type: new IntegerType_1.IntegerType()
|
|
713
|
+
type: new IntegerType_1.IntegerType(),
|
|
714
|
+
isOptional: false
|
|
633
715
|
}, {
|
|
634
716
|
name: 'radix',
|
|
635
|
-
type: new IntegerType_1.IntegerType()
|
|
717
|
+
type: new IntegerType_1.IntegerType(),
|
|
718
|
+
isOptional: true
|
|
636
719
|
}]
|
|
637
720
|
}, {
|
|
638
721
|
name: 'string',
|
|
639
722
|
shortDescription: 'Returns a string composed of n copies of the second argument concatenated together.',
|
|
640
|
-
type: new
|
|
723
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
641
724
|
file: exports.globalFile,
|
|
642
725
|
params: [{
|
|
643
726
|
name: 'n',
|
|
644
|
-
type: new IntegerType_1.IntegerType()
|
|
727
|
+
type: new IntegerType_1.IntegerType(),
|
|
728
|
+
isOptional: false
|
|
645
729
|
}, {
|
|
646
730
|
name: 'str',
|
|
647
|
-
type: new StringType_1.StringType()
|
|
731
|
+
type: new StringType_1.StringType(),
|
|
732
|
+
isOptional: false
|
|
648
733
|
}]
|
|
649
734
|
}, {
|
|
650
735
|
name: 'StringI',
|
|
651
736
|
shortDescription: 'Returns a string composed of n copies of the character whose Unicode value is the second argument.',
|
|
652
|
-
type: new
|
|
737
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
653
738
|
file: exports.globalFile,
|
|
654
739
|
params: [{
|
|
655
740
|
name: 'n',
|
|
656
|
-
type: new IntegerType_1.IntegerType()
|
|
741
|
+
type: new IntegerType_1.IntegerType(),
|
|
742
|
+
isOptional: false
|
|
657
743
|
}, {
|
|
658
744
|
name: 'ch',
|
|
659
|
-
type: new IntegerType_1.IntegerType()
|
|
745
|
+
type: new IntegerType_1.IntegerType(),
|
|
746
|
+
isOptional: false
|
|
747
|
+
}]
|
|
748
|
+
}, {
|
|
749
|
+
name: 'Val',
|
|
750
|
+
shortDescription: 'Performs the inverse of the STR function: returns the number represented by the characters in a string argument.\nFor example, if A$="12" and B$="34" then VAL(A$+ "."+B$) returns the number 12.34.',
|
|
751
|
+
type: new TypedFunctionType_1.TypedFunctionType(new FloatType_1.FloatType()),
|
|
752
|
+
file: exports.globalFile,
|
|
753
|
+
params: [{
|
|
754
|
+
name: 'str',
|
|
755
|
+
type: new StringType_1.StringType(),
|
|
756
|
+
isOptional: false
|
|
660
757
|
}]
|
|
661
758
|
}, {
|
|
662
759
|
name: 'Val',
|
|
663
|
-
shortDescription: '
|
|
664
|
-
type: new
|
|
760
|
+
shortDescription: 'Returns the integer value from parsing the string with the specified radix.\nRadix should be 2 .. 36 or the special value 0 (which automatically identified hexadecimal or octal numbers based on 0x or 0 prefixes respectively).\nLeading whitespace is ignored then as much of the rest of the string will be parsed as valid.',
|
|
761
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
665
762
|
file: exports.globalFile,
|
|
666
763
|
params: [{
|
|
667
764
|
name: 'str',
|
|
668
|
-
type: new StringType_1.StringType()
|
|
765
|
+
type: new StringType_1.StringType(),
|
|
766
|
+
isOptional: false
|
|
669
767
|
}, {
|
|
670
768
|
name: 'radix',
|
|
671
|
-
type: new IntegerType_1.IntegerType()
|
|
769
|
+
type: new IntegerType_1.IntegerType(),
|
|
770
|
+
isOptional: true
|
|
672
771
|
}]
|
|
673
772
|
}, {
|
|
674
773
|
name: 'Substitute',
|
|
675
774
|
shortDescription: 'Replaces all instances of {0} or ^0 in str with arg0. Similarly, replaces all instances of {1} or ^1 with arg1, {2} or ^2 with arg2, and {3} or ^3 with arg3.',
|
|
676
|
-
type: new
|
|
775
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
677
776
|
file: exports.globalFile,
|
|
678
777
|
params: [{
|
|
679
778
|
name: 'str',
|
|
680
|
-
type: new StringType_1.StringType()
|
|
779
|
+
type: new StringType_1.StringType(),
|
|
780
|
+
isOptional: false
|
|
681
781
|
}, {
|
|
682
782
|
name: 'arg0',
|
|
683
|
-
type: new StringType_1.StringType()
|
|
783
|
+
type: new StringType_1.StringType(),
|
|
784
|
+
isOptional: false
|
|
684
785
|
}, {
|
|
685
786
|
name: 'arg1',
|
|
686
|
-
type: new StringType_1.StringType()
|
|
787
|
+
type: new StringType_1.StringType(),
|
|
788
|
+
isOptional: true
|
|
687
789
|
}, {
|
|
688
790
|
name: 'arg2',
|
|
689
|
-
type: new StringType_1.StringType()
|
|
791
|
+
type: new StringType_1.StringType(),
|
|
792
|
+
isOptional: true
|
|
690
793
|
}, {
|
|
691
794
|
name: 'arg3',
|
|
692
|
-
type: new StringType_1.StringType()
|
|
795
|
+
type: new StringType_1.StringType(),
|
|
796
|
+
isOptional: true
|
|
693
797
|
}]
|
|
694
798
|
}
|
|
695
799
|
];
|
|
@@ -697,28 +801,196 @@ let programStatementFunctions = [
|
|
|
697
801
|
{
|
|
698
802
|
name: 'Tab',
|
|
699
803
|
shortDescription: 'Moves the cursor to the specified position on the current line (modulo the width of your console if you specify TAB positions greater than the console width). TAB may be used several times in a PRINT list. No punctuation is required after a TAB modifier. Numerical expressions may be used to specify a TAB position. TAB cannot be used to move the cursor to the left. If the cursor is beyond the specified position, the TAB is ignored.',
|
|
700
|
-
type: new
|
|
804
|
+
type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
|
|
701
805
|
file: exports.globalFile,
|
|
702
806
|
params: [{
|
|
703
807
|
name: 'expression',
|
|
704
|
-
type: new IntegerType_1.IntegerType()
|
|
808
|
+
type: new IntegerType_1.IntegerType(),
|
|
809
|
+
isOptional: false
|
|
705
810
|
}]
|
|
706
811
|
}, {
|
|
707
812
|
name: 'Pos',
|
|
708
813
|
shortDescription: 'Returns a number from 0 to window width, indicating the current cursor position on the cursor. Requires a "dummy argument" (any numeric expression).',
|
|
709
|
-
type: new
|
|
814
|
+
type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
|
|
710
815
|
file: exports.globalFile,
|
|
711
816
|
params: [{
|
|
712
817
|
name: 'x',
|
|
713
|
-
type: new IntegerType_1.IntegerType()
|
|
818
|
+
type: new IntegerType_1.IntegerType(),
|
|
819
|
+
isOptional: false
|
|
714
820
|
}]
|
|
715
821
|
//TODO this is a temporary fix for library imported files. Eventually this should be moved into `Roku_Ads.brs` and handled by the `Library` statement
|
|
716
822
|
}, {
|
|
717
823
|
name: 'Roku_Ads',
|
|
718
824
|
shortDescription: 'The main entry point for instantiating the ad interface. This object manages ad server requests, parses ad structure, schedules and renders ads, and triggers tracking beacons.\n\nThe Roku ad parser/renderer object returned has global scope because it is meant to represent interaction with external resources (the ad server and any tracking services) that have persistence and state independent of the ad rendering within a client application.',
|
|
719
|
-
type: new
|
|
825
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
826
|
+
file: exports.globalFile,
|
|
827
|
+
params: []
|
|
828
|
+
}, {
|
|
829
|
+
name: 'bslBrightScriptErrorCodes',
|
|
830
|
+
shortDescription: 'Returns an roAssociativeArray with name value pairs of the error name and corresponding integer value, for example ERR_OKAY = &hFF.',
|
|
831
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
832
|
+
file: exports.globalFile,
|
|
833
|
+
params: []
|
|
834
|
+
}, {
|
|
835
|
+
name: 'bslGeneralConstants',
|
|
836
|
+
shortDescription: 'Returns an roAssociativeArray with name value pairs of system constants, for example MAX_INT = 2147483647.',
|
|
837
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
720
838
|
file: exports.globalFile,
|
|
721
839
|
params: []
|
|
840
|
+
}, {
|
|
841
|
+
name: 'bslUniversalControlEventCodes',
|
|
842
|
+
shortDescription: 'Returns an roAssociativeArray with name value pairs of the remote key code (buttons) constants, for example BUTTON_SELECT_PRESSED = 6.',
|
|
843
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
844
|
+
file: exports.globalFile,
|
|
845
|
+
params: []
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
name: 'AsciiToHex',
|
|
849
|
+
shortDescription: 'Returns the hex encoded string, for example AsciiToHex("Hi!") = "486921".',
|
|
850
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
851
|
+
file: exports.globalFile,
|
|
852
|
+
params: [{
|
|
853
|
+
name: 'ascii',
|
|
854
|
+
type: new StringType_1.StringType(),
|
|
855
|
+
isOptional: false
|
|
856
|
+
}]
|
|
857
|
+
}, {
|
|
858
|
+
name: 'HexToAscii',
|
|
859
|
+
shortDescription: 'Returns a string that is the hex decoded string, for example HexToAscii("486921") = "Hi!".',
|
|
860
|
+
type: new TypedFunctionType_1.TypedFunctionType(new StringType_1.StringType()),
|
|
861
|
+
file: exports.globalFile,
|
|
862
|
+
params: [{
|
|
863
|
+
name: 'hex',
|
|
864
|
+
type: new StringType_1.StringType(),
|
|
865
|
+
isOptional: false
|
|
866
|
+
}]
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
name: 'HexToInteger',
|
|
870
|
+
shortDescription: 'Returns the integer value of the passed in hex string.',
|
|
871
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
872
|
+
file: exports.globalFile,
|
|
873
|
+
params: [{
|
|
874
|
+
name: 'hex',
|
|
875
|
+
type: new StringType_1.StringType(),
|
|
876
|
+
isOptional: false
|
|
877
|
+
}]
|
|
878
|
+
}, {
|
|
879
|
+
name: 'HexToInteger',
|
|
880
|
+
shortDescription: 'Returns a string that is the hex decoded string, for example HexToAscii("486921") = "Hi!".',
|
|
881
|
+
type: new TypedFunctionType_1.TypedFunctionType(new IntegerType_1.IntegerType()),
|
|
882
|
+
file: exports.globalFile,
|
|
883
|
+
params: [{
|
|
884
|
+
name: 'hex',
|
|
885
|
+
type: new StringType_1.StringType(),
|
|
886
|
+
isOptional: false
|
|
887
|
+
}]
|
|
888
|
+
}, {
|
|
889
|
+
name: 'dfNewBitmapSet',
|
|
890
|
+
shortDescription: `The goal is to enable simple xml descriptions of graphics resources like bitmaps, regions, sprites, animations, and layouts to be used in your games. The library handles parsing, loading, rendering, and animation of sprites sheets (multiple images in a single png file).
|
|
891
|
+
Filename is the path to an XML file that contains info about bitmap regions, animation frames, and ExtraInfo metadata (any fields you would like) about resources used in 2d games.
|
|
892
|
+
Returns an roAssociativeArray with the following name value pairs:
|
|
893
|
+
ExtraInfo: roAssociativeArray
|
|
894
|
+
Regions: roAssociativeArray of name, roRegions pairs
|
|
895
|
+
Animations: roAssociativeArray of name, roArray of roRegion pairs.
|
|
896
|
+
Backgrounds: roAssociativeArray of name, path pairs.`,
|
|
897
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
898
|
+
file: exports.globalFile,
|
|
899
|
+
params: [{
|
|
900
|
+
name: 'filename',
|
|
901
|
+
type: new StringType_1.StringType(),
|
|
902
|
+
isOptional: false
|
|
903
|
+
}]
|
|
904
|
+
}, {
|
|
905
|
+
name: 'dfDrawMessage',
|
|
906
|
+
shortDescription: 'dest is an roScreen/roBitmap/roRegion and region is an roRegion.\nGreys the entire dest region and draws it the region centered on the drawable dest.',
|
|
907
|
+
type: new TypedFunctionType_1.TypedFunctionType(new VoidType_1.VoidType()),
|
|
908
|
+
file: exports.globalFile,
|
|
909
|
+
params: [{
|
|
910
|
+
name: 'dest',
|
|
911
|
+
type: new ObjectType_1.ObjectType(),
|
|
912
|
+
isOptional: false
|
|
913
|
+
}, {
|
|
914
|
+
name: 'region',
|
|
915
|
+
type: new ObjectType_1.ObjectType(),
|
|
916
|
+
isOptional: false
|
|
917
|
+
}]
|
|
918
|
+
}, {
|
|
919
|
+
name: 'dfDrawImage',
|
|
920
|
+
shortDescription: 'Returns True if successful.\nCreates a bitmap out of the image stored in the filename "path" and draws it at position (x,y) of the drawable dest.',
|
|
921
|
+
type: new TypedFunctionType_1.TypedFunctionType(new BooleanType_1.BooleanType()),
|
|
922
|
+
file: exports.globalFile,
|
|
923
|
+
params: [{
|
|
924
|
+
name: 'dest',
|
|
925
|
+
type: new ObjectType_1.ObjectType(),
|
|
926
|
+
isOptional: false
|
|
927
|
+
}, {
|
|
928
|
+
name: 'path',
|
|
929
|
+
type: new StringType_1.StringType(),
|
|
930
|
+
isOptional: false
|
|
931
|
+
}, {
|
|
932
|
+
name: 'x',
|
|
933
|
+
type: new IntegerType_1.IntegerType(),
|
|
934
|
+
isOptional: false
|
|
935
|
+
}, {
|
|
936
|
+
name: 'y',
|
|
937
|
+
type: new IntegerType_1.IntegerType(),
|
|
938
|
+
isOptional: false
|
|
939
|
+
}]
|
|
940
|
+
}, {
|
|
941
|
+
name: 'dfSetupDisplayRegions',
|
|
942
|
+
shortDescription: `Helper function to setup screen scaling with supplied pillar box or letterbox images to fill the entire screen.
|
|
943
|
+
screen is an roScreen
|
|
944
|
+
topx and topy are the coordinates of the upper left hand corner of the main drawing region
|
|
945
|
+
Width and height is the size of the main drawing region
|
|
946
|
+
|
|
947
|
+
Returns an associative array containing the following roRegions
|
|
948
|
+
Main: main drawable region
|
|
949
|
+
Left: left region if there is pillar box area on the left
|
|
950
|
+
Right: right region if there is a pillar box area on the right
|
|
951
|
+
Upper: upper region if there is a letterbox area at thetop
|
|
952
|
+
Lower: lower region if there is a letterbox area at the bottom
|
|
953
|
+
When using these regions as drawables, your graphics will be translated and clipped to these regions.`,
|
|
954
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
955
|
+
file: exports.globalFile,
|
|
956
|
+
params: [{
|
|
957
|
+
name: 'screen',
|
|
958
|
+
type: new ObjectType_1.ObjectType(),
|
|
959
|
+
isOptional: false
|
|
960
|
+
}, {
|
|
961
|
+
name: 'topx',
|
|
962
|
+
type: new IntegerType_1.IntegerType(),
|
|
963
|
+
isOptional: false
|
|
964
|
+
}, {
|
|
965
|
+
name: 'topy',
|
|
966
|
+
type: new IntegerType_1.IntegerType(),
|
|
967
|
+
isOptional: false
|
|
968
|
+
}, {
|
|
969
|
+
name: 'width',
|
|
970
|
+
type: new IntegerType_1.IntegerType(),
|
|
971
|
+
isOptional: false
|
|
972
|
+
}, {
|
|
973
|
+
name: 'height',
|
|
974
|
+
type: new IntegerType_1.IntegerType(),
|
|
975
|
+
isOptional: false
|
|
976
|
+
}]
|
|
977
|
+
}, {
|
|
978
|
+
name: 'dfSetBackground',
|
|
979
|
+
shortDescription: `dfSetBackground helps manage the limited video memory. The video memory does not currently run a defragmenter, and is very limited. These constraints make it important that large bitmaps (like backgrounds that fill the entire screen) are only allocated when needed. It is also helpful if you set your first initial background very early in your program, and then immediately replace the background after it is no longer in use. This helper function supports this background management for your application.
|
|
980
|
+
backgroundName is a key for the Backgrounds roAssociative array of backgrounds.
|
|
981
|
+
Backgrounds is an roAssociative array of background name keys and file path string values
|
|
982
|
+
This function creates an roBitmap out of the background image file and returns a region the size of the entire roBitmap.`,
|
|
983
|
+
type: new TypedFunctionType_1.TypedFunctionType(new ObjectType_1.ObjectType()),
|
|
984
|
+
file: exports.globalFile,
|
|
985
|
+
params: [{
|
|
986
|
+
name: 'backgroundName',
|
|
987
|
+
type: new StringType_1.StringType(),
|
|
988
|
+
isOptional: false
|
|
989
|
+
}, {
|
|
990
|
+
name: 'backgrounds',
|
|
991
|
+
type: new ObjectType_1.ObjectType(),
|
|
992
|
+
isOptional: false
|
|
993
|
+
}]
|
|
722
994
|
}
|
|
723
995
|
];
|
|
724
996
|
exports.globalCallables = [...mathFunctions, ...runtimeFunctions, ...globalUtilityFunctions, ...globalStringFunctions, ...programStatementFunctions];
|
|
@@ -727,7 +999,7 @@ for (let callable of exports.globalCallables) {
|
|
|
727
999
|
callable.nameRange = util_1.default.createRange(0, 0, 0, callable.name.length);
|
|
728
1000
|
//add each parameter to the type
|
|
729
1001
|
for (let param of callable.params) {
|
|
730
|
-
callable.type.addParameter(param
|
|
1002
|
+
callable.type.addParameter(param);
|
|
731
1003
|
}
|
|
732
1004
|
//set name in type
|
|
733
1005
|
callable.type.setName(callable.name);
|