Skip to content

Commit

Permalink
Merge branch 'master' into lsp-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron authored Sep 27, 2024
2 parents 373852d + 3a2dc72 commit 668032f
Show file tree
Hide file tree
Showing 27 changed files with 2,462 additions and 55 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## [0.67.7](https://github.com/rokucommunity/brighterscript/compare/v0.67.6...v0.67.7) - 2024-09-25
### Changed
- Ast node clone ([#1281](https://github.com/rokucommunity/brighterscript/pull/1281))



## [0.67.6](https://github.com/rokucommunity/brighterscript/compare/v0.67.5...v0.67.6) - 2024-09-05
### Added
- support for `roIntrinsicDouble` ([#1291](https://github.com/rokucommunity/brighterscript/pull/1291))
Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "brighterscript",
"version": "0.67.6",
"version": "0.67.7",
"description": "A superset of Roku's BrightScript language.",
"scripts": {
"preversion": "npm run build && npm run lint && npm run test",
Expand Down Expand Up @@ -119,7 +119,7 @@
"rimraf": "^2.7.1",
"semver-extra": "^3.0.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.13",
"source-map-support": "^0.5.21",
"sync-request": "^6.1.0",
"testdouble": "^3.5.2",
"thenby": "^1.3.4",
Expand Down
13 changes: 11 additions & 2 deletions src/astUtils/reflection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Body, AssignmentStatement, Block, ExpressionStatement, CommentStatement, ExitForStatement, ExitWhileStatement, FunctionStatement, IfStatement, IncrementStatement, PrintStatement, GotoStatement, LabelStatement, ReturnStatement, EndStatement, StopStatement, ForStatement, ForEachStatement, WhileStatement, DottedSetStatement, IndexedSetStatement, LibraryStatement, NamespaceStatement, ImportStatement, ClassFieldStatement, ClassMethodStatement, ClassStatement, InterfaceFieldStatement, InterfaceMethodStatement, InterfaceStatement, EnumStatement, EnumMemberStatement, TryCatchStatement, CatchStatement, ThrowStatement, MethodStatement, FieldStatement, ConstStatement, ContinueStatement } from '../parser/Statement';
import type { LiteralExpression, BinaryExpression, CallExpression, FunctionExpression, NamespacedVariableNameExpression, DottedGetExpression, XmlAttributeGetExpression, IndexedGetExpression, GroupingExpression, EscapedCharCodeLiteralExpression, ArrayLiteralExpression, AALiteralExpression, UnaryExpression, VariableExpression, SourceLiteralExpression, NewExpression, CallfuncExpression, TemplateStringQuasiExpression, TemplateStringExpression, TaggedTemplateStringExpression, AnnotationExpression, FunctionParameterExpression, AAMemberExpression, TypeCastExpression } from '../parser/Expression';
import type { Body, AssignmentStatement, Block, ExpressionStatement, CommentStatement, ExitForStatement, ExitWhileStatement, FunctionStatement, IfStatement, IncrementStatement, PrintStatement, GotoStatement, LabelStatement, ReturnStatement, EndStatement, StopStatement, ForStatement, ForEachStatement, WhileStatement, DottedSetStatement, IndexedSetStatement, LibraryStatement, NamespaceStatement, ImportStatement, ClassFieldStatement, ClassMethodStatement, ClassStatement, InterfaceFieldStatement, InterfaceMethodStatement, InterfaceStatement, EnumStatement, EnumMemberStatement, TryCatchStatement, CatchStatement, ThrowStatement, MethodStatement, FieldStatement, ConstStatement, ContinueStatement, DimStatement } from '../parser/Statement';
import type { LiteralExpression, BinaryExpression, CallExpression, FunctionExpression, NamespacedVariableNameExpression, DottedGetExpression, XmlAttributeGetExpression, IndexedGetExpression, GroupingExpression, EscapedCharCodeLiteralExpression, ArrayLiteralExpression, AALiteralExpression, UnaryExpression, VariableExpression, SourceLiteralExpression, NewExpression, CallfuncExpression, TemplateStringQuasiExpression, TemplateStringExpression, TaggedTemplateStringExpression, AnnotationExpression, FunctionParameterExpression, AAMemberExpression, TypeCastExpression, TernaryExpression, NullCoalescingExpression } from '../parser/Expression';
import type { BrsFile } from '../files/BrsFile';
import type { XmlFile } from '../files/XmlFile';
import type { BscFile, File, TypedefProvider } from '../interfaces';
Expand Down Expand Up @@ -91,6 +91,12 @@ export function isLabelStatement(element: AstNode | undefined): element is Label
export function isReturnStatement(element: AstNode | undefined): element is ReturnStatement {
return element?.constructor?.name === 'ReturnStatement';
}
export function isTernaryExpression(element: AstNode | undefined): element is TernaryExpression {
return element?.constructor?.name === 'TernaryExpression';
}
export function isNullCoalescingExpression(element: AstNode | undefined): element is NullCoalescingExpression {
return element?.constructor?.name === 'NullCoalescingExpression';
}
export function isEndStatement(element: AstNode | undefined): element is EndStatement {
return element?.constructor?.name === 'EndStatement';
}
Expand All @@ -106,6 +112,9 @@ export function isForEachStatement(element: AstNode | undefined): element is For
export function isWhileStatement(element: AstNode | undefined): element is WhileStatement {
return element?.constructor?.name === 'WhileStatement';
}
export function isDimStatement(element: AstNode | undefined): element is DimStatement {
return element?.constructor?.name === 'DimStatement';
}
export function isDottedSetStatement(element: AstNode | undefined): element is DottedSetStatement {
return element?.constructor?.name === 'DottedSetStatement';
}
Expand Down
2 changes: 1 addition & 1 deletion src/astUtils/visitors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function walk<T>(owner: T, key: keyof T, visitor: WalkVisitor, options: W
* @param filter a function used to filter items from the array. return true if that item should be walked
*/
export function walkArray<T = AstNode>(array: Array<T>, visitor: WalkVisitor, options: WalkOptions, parent?: AstNode, filter?: <T>(element: T) => boolean) {
for (let i = 0; i < array.length; i++) {
for (let i = 0; i < array?.length; i++) {
if (!filter || filter(array[i])) {
const startLength = array.length;
walk(array, i, visitor, options, parent);
Expand Down
Loading

0 comments on commit 668032f

Please sign in to comment.