This repository has been archived by the owner. It is now read-only.

Small fix for parsing type parameter declarations #83

merged 1 commit into from Aug 3, 2016


None yet
4 participants
Copy link

gabelevi commented Jul 29, 2016

When you eat a token, it looks like Babylon automatically lexes the next token. Setting this.state.inType changes the behavior of the lexer, so it needs to be set before eating the type. This was causing trouble, since

type Foo<T = void> = T;

wouldn't parse, since we would eat the = token before setting this.state.inType = true, which meant void was lexed as an expression instead as a type.

However, the whole type parameter declaration should be parsed with this.state.inType = true anyway. Sometimes it was, like for functions and arrow functions, but often it was not. This change makes all type parameter declarations be parsed with this.state.inType = true.


This comment has been minimized.

Copy link

codecov-io commented Jul 29, 2016

Current coverage is 96.91% (diff: 100%)

Merging #83 into master will decrease coverage by <.01%

@@             master        #83   diff @@
  Files            19         19          
  Lines          2923       2920     -3   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
- Hits           2833       2830     -3   
  Misses           90         90          
  Partials          0          0          

Powered by Codecov. Last update 4811d61...3f9265b

@kittens kittens merged commit c9a7bed into babel:master Aug 3, 2016

3 checks passed

codecov/patch 100% of diff hit (target 96.92%)
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +3.07% compared to 4811d61
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.