Skip to content

JsLigo switch statement tree abstraction

Melwyn Saldanha requested to merge melwyn95/jsligo-switch-tree-abstraction into dev
  • has a changelog entry

Syntax errors (expect tests)

  • 0 case 0 default
  • default as in between case
  • more than one default
  • errors.msg.in for break jsligo

Test cases

  • 1 case 0 default
  • 0 case 1 default
  • 1 case 1 default
  • 2 case 0 default
  • 3 case 1 default (54 scenarios)
  • 2 case 1 default (18 scenarios)
  • 4 case 1 default (basic cases)
  • nested switch (if-switch, switch-if, if-switch-if, switch-if-switch, switch-switch
  • fix unused variable in case of only default & only case with no statements
  • case fallthrough with no statements & default break with no statements

Documentation

  • docs

Refactor code

  • get rid of failwith "not possible"
  • make impossible cases non representable using better types
Edited by Sander

Merge request reports