A lexer and parser for Roku's BrightScript language, written in JavaScript.
Currently only the lexer has been implemented, but hopefully the parser is coming soon.
A lexer for brightscript written in JavaScript
License: MIT License
Could you please publish the latest changes?
Thanks
Hi, I created the fork of brightscript-parser
and I added support for conditional compile if/else statements:
#if, #else, #else if, #end if.
I named the tokens: condIf, condElse, condElseIf, condEndIf.
When I run the tests, its failed with the following errors:
nyc mocha src/**/*.spec.ts --full-trace --bail
√ all tokens are placed into a bucket
√ all tokens have a token definition
BrightscriptLexer
getMatch() works for --
√ endFunction
√ endIf
√ endSub
√ endWhile
√ exitWhile
√ exitFor
√ endFor
√ elseIf
1) condElseIf
10 passing (73ms)
1 failing
1) BrightscriptLexer
getMatch() works for --
condElseIf:
Expected 'identifier' to equal 'condElseIf' for 'condelseif'
+ expected - actual
-identifier
+condElseIf
at matchMany (C:\Git_works\brightscript-parser\src\BrightscriptLexer.spec.ts:17:49)
at Context.<anonymous> (C:\Git_works\brightscript-parser\src\BrightscriptLexer.spec.ts:39:9)
at callFn (C:\Git_works\brightscript-parser\node_modules\mocha\lib\runnable.js:372:21)
at Test.Runnable.run (C:\Git_works\brightscript-parser\node_modules\mocha\lib\runnable.js:364:7)
at Runner.runTest (C:\Git_works\brightscript-parser\node_modules\mocha\lib\runner.js:455:10)
at C:\Git_works\brightscript-parser\node_modules\mocha\lib\runner.js:573:12
at next (C:\Git_works\brightscript-parser\node_modules\mocha\lib\runner.js:369:14)
at C:\Git_works\brightscript-parser\node_modules\mocha\lib\runner.js:379:7
at next (C:\Git_works\brightscript-parser\node_modules\mocha\lib\runner.js:303:14)
at Immediate._onImmediate (C:\Git_works\brightscript-parser\node_modules\mocha\lib\runner.js:347:5)
at runCallback (timers.js:696:18)
at tryOnImmediate (timers.js:667:5)
at processImmediate (timers.js:649:5)
ERROR: Coverage for lines (86.47%) does not meet global threshold (100%)
ERROR: Coverage for functions (81.82%) does not meet global threshold (100%)
ERROR: Coverage for branches (28.57%) does not meet global threshold (100%)
ERROR: Coverage for statements (86.67%) does not meet global threshold (100%)
=================== Coverage summary ==================
Statements : 86.67% ( 182/210 )
Branches : 28.57% ( 4/14 )
Functions : 81.82% ( 9/11 )
Lines : 86.47% ( 179/207 )
==================================================
I implemented it in the forked formatter and in forked vscode-brightscript-language extension.
I installed this extension in vscode and its works very well regardless failed tests in brightscript-parser.
Could you please advice about described issue?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.