Closed crwecker closed 6 years ago
Oh, just spotted another that is possibly related to item 1. Indentation messed up.
if (m.externalAuth) then
jsonData["Access Type"] = "Accessible"
else
jsonData["Access Type"] = "Link Required"
end if
Sorry, didn't mean to close the issue, I clicked on the close button thinking it would close the window (:
Haha. I was confused there for a second.
I'll take a look at these tonight and see what I come up with. Great finds again. This just just goes to show how valuable the whole open source concept is. It only makes the product better. I love it!
Thanks for your help! I'll let you know what I find.
Probably the same issue: new indents after each of these lines:
lineups_index["audio"] = CreateObject("roAssociativeArray")
lineups_index["video"] = CreateObject("roAssociativeArray")
ci = 0
I fixed these issues. Fun stuff! The way that I implemented the formatter, I'm not doing any type of code validation (i.e. parsing). It's much more primitive.
The brightscript spec says that the "then" in an if statement is optional. https://sdkdocs.roku.com/display/sdkdoc/Program+Statements#ProgramStatements-IFexpressionTHENstatements[ELSEstatements]
For the one-line if statements, I don't have a nice way of figuring out when the logical expression ends and the operation begins. So things like this will probably still cause issues
sub test()
if 1=1 and 2=2 return 12
end sub
Until I can write a full brightscript parser, I'll probably not be able to support that particular format.
Anyway, try out the latest npm package and let me know if that solves your issue.
Worked great. Thanks!
So, ran the rest of my code through the formatter this morning, and two more issues cropped up (both in obsolete code, but thought I'd make you aware).
Something in this breaks the keyword count. Seems like it has to do with the "] at the end of the statement
A single line if statement, like this from the documentation, messes up the indentation after it
Regards! -Carl