Giter Site home page Giter Site logo

brightscript-parser's Introduction

brightscript-parser

A lexer and parser for Roku's BrightScript language, written in JavaScript.

Build Status Coverage Status npm

Currently only the lexer has been implemented, but hopefully the parser is coming soon.

brightscript-parser's People

Contributors

dependabot[bot] avatar evgygor avatar greenkeeper[bot] avatar twitchbronbron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

brightscript-parser's Issues

Cannot pass the tests after adding new tokens

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.