Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement component roList #688

Closed
wants to merge 37 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d786413
refactor in preparation for adoption the project
TwitchBronBron Apr 19, 2023
fbaaed7
fix build script name
TwitchBronBron Apr 19, 2023
2ccec94
install node modules first
TwitchBronBron Apr 19, 2023
53c1aeb
break out tasks to view nicer failure spot
TwitchBronBron Apr 19, 2023
817c651
Add coverage reporting
TwitchBronBron Apr 19, 2023
e31226b
Actually add coverage reporting
TwitchBronBron Apr 19, 2023
b2d223a
fix coverage reporting
TwitchBronBron Apr 19, 2023
f1546e3
Merge pull request #1 from rokucommunity/adoption
TwitchBronBron Apr 24, 2023
94304cd
Fixed `val()` edge cases: hex without radix and `NaN`
lvcabral Sep 7, 2023
a223c2a
Fixed prettier and replaced deprecated `substr()` method
lvcabral Sep 7, 2023
ec82a06
Update README.md
TwitchBronBron Sep 8, 2023
afca557
Merge pull request #3 from rokucommunity/bugfix/string-val-function-n…
lvcabral Sep 8, 2023
f72f2dc
Add changelog
TwitchBronBron Sep 8, 2023
af0c223
Add note about the project fork.
TwitchBronBron Sep 8, 2023
202cc9f
Make tests import relative path to lib/index.js
TwitchBronBron Sep 8, 2023
ab5322a
0.45.1
TwitchBronBron Sep 9, 2023
7569e86
add logic for optional chaining (#21)
nadiapadalka Oct 25, 2023
e6c98ae
fix(interp): Preventing multiple calls for dot-chained methods (#22)
lvcabral Oct 31, 2023
98dcee2
fix(parser): Wrong negative sign precedence was causing math errors (…
lvcabral Nov 1, 2023
d8878a9
update changelog for v0.45.2
TwitchBronBron Nov 8, 2023
7ef68bb
0.45.2
TwitchBronBron Nov 8, 2023
5f13b59
fix(components): Replacing package luxon by day.js on `roDateTime` an…
lvcabral Nov 21, 2023
e98151c
fix(parser,lexer) Optional chaining implementation side effect #30 (#31)
lvcabral Dec 1, 2023
6e5b422
feat(components): Implemented missing `ifEnum` methods in `roArray` a…
lvcabral Dec 1, 2023
b8e459a
feat(lex,parse): Add stub try/catch implementation (#34)
lvcabral Dec 1, 2023
a5e0217
Adds create-package CI build for quicker iteration (#36)
TwitchBronBron Dec 1, 2023
bcda693
fix(lib): Component XML path parsing was failing on edge case (#37)
lvcabral Dec 1, 2023
60abf73
Update changelog for v0.45.3
TwitchBronBron Dec 1, 2023
6a59ad8
0.45.3
TwitchBronBron Dec 1, 2023
d66a0ed
Fixed #16 Print leading space before positive numbers (#39)
lvcabral Dec 11, 2023
7cdd4a3
Fixed #38 Improved context handling for Callables (#40)
lvcabral Dec 11, 2023
bcf6142
Fixed #41 - Global functions `GetInterface()` and `FindMemberFunction…
lvcabral Jan 18, 2024
90f0df1
Update changelog for v0.45.4
TwitchBronBron Jan 18, 2024
b5f9d5c
0.45.4
TwitchBronBron Jan 18, 2024
91af226
Fixed #43 - Implemented `roString` methods `startsWith()` and `endsWi…
lvcabral Feb 7, 2024
88627e7
Fixed Arithmetic Operator Modulo behavior to match Roku (#46)
lvcabral Mar 25, 2024
d766e37
Implemented component `roList`
lvcabral Mar 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(parser,lexer) Optional chaining implementation side effect #30 (#31)
  • Loading branch information
lvcabral authored Dec 1, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit e98151c1da71175df74baaec8cb7362787a8eb3f
20 changes: 18 additions & 2 deletions src/lexer/Lexer.ts
Original file line number Diff line number Diff line change
@@ -239,7 +239,23 @@ export class Lexer {
addToken(Lexeme.Semicolon);
break;
case "?":
addToken(Lexeme.Print);
switch (peek()) {
case ".":
advance();
addToken(Lexeme.Dot);
break;
case "(":
advance();
addToken(Lexeme.LeftParen);
break;
case "[":
advance();
addToken(Lexeme.LeftBrace);
break;
default:
addToken(Lexeme.Print);
break;
}
break;
case "<":
switch (peek()) {
@@ -302,7 +318,7 @@ export class Lexer {
case " ":
case "\r":
case "\t":
// ignore whitespace; indentation isn't signficant in BrightScript
// ignore whitespace; indentation isn't significant in BrightScript
break;
case "\n":
// consecutive newlines aren't significant, because they're just blank lines
3 changes: 0 additions & 3 deletions src/parser/Parser.ts
Original file line number Diff line number Diff line change
@@ -534,7 +534,6 @@ export class Parser {
Lexeme.Newline,
Lexeme.Colon,
Lexeme.Eof,
Lexeme.Identifier,
...additionalterminators
);
}
@@ -1420,8 +1419,6 @@ export class Parser {
while (true) {
if (match(Lexeme.LeftParen)) {
expr = finishCall(expr);
} else if (match(Lexeme.Print)) {
// doing nothing as invalid check was before
} else if (match(Lexeme.LeftSquare)) {
indexedGet();
} else if (match(Lexeme.Dot)) {
2 changes: 2 additions & 0 deletions test/e2e/Syntax.test.js
Original file line number Diff line number Diff line change
@@ -131,6 +131,8 @@ describe("end to end syntax", () => {
"foo is not < 2",
"foo is not < 2 and not > 2",
"#481 fixed",
"2",
"5",
]);
});

15 changes: 12 additions & 3 deletions test/e2e/resources/conditionals.brs
Original file line number Diff line number Diff line change
@@ -123,13 +123,22 @@ sub main()
print "foo is not < 2 and not > 2"
end if

test_481()
test_issue_481()
test_issue_30()
end sub

' MWE from https://github.com/rokucommunity/brs/issues/481
sub test_481()
' MWE from https://github.com/sjbarag/brs/issues/481
sub test_issue_481()
nop = sub() : end sub

if false then nop(): print "#481 still repro's": return
print "#481 fixed"
end sub

' Test for https://github.com/rokucommunity/brs/issues/30
function test_issue_30()
testA = ["apple", 2, "banana", "orange", 5, "grape", "pear"]
for fruit = 0 to testA.count()-1
if type(testA[fruit]).inStr(0,"String") = -1 ? testA[fruit]
next
end function
6 changes: 2 additions & 4 deletions test/parser/expression/Indexing.test.js
Original file line number Diff line number Diff line change
@@ -33,8 +33,7 @@ describe("parser indexing", () => {
identifier("_"),
token(Lexeme.Equal, "="),
identifier("bar"),
token(Lexeme.Print, "?"),
token(Lexeme.Dot, "."),
token(Lexeme.Dot, "?."),
identifier("foo"),
EOF,
]);
@@ -48,8 +47,7 @@ describe("parser indexing", () => {
identifier("_"),
token(Lexeme.Equal, "="),
token(Lexeme.Invalid, "invalid", BrsInvalid.Instance),
token(Lexeme.Print, "?"),
token(Lexeme.Dot, "."),
token(Lexeme.Dot, "?."),
identifier("bar"),
EOF,
]);