pvdz / heatfiler

A JS profiler and code coverage tool that displays the result in a (live updating) heatmap
37 stars 4 forks source link

Syntax error with silly if/else #13

Open pvdz opened 10 years ago

pvdz commented 10 years ago
if (x);
else if (y) {
  haha
}
else ;

the transformation will cause unexpected token else

 { $statement$(0, 0); if ($expression$(0, 3, (x)))$statement$(0, 5); ;
else  { $statement$(0, 9); if ($expression$(0, 12, (y)))  { $statement$(0, 15); {
  $expression$(0, 19, (haha))

;$statement$(0, 22); } } 
else $statement$(0, 26); ; }  } 

floops

pvdz commented 10 years ago

Actually it's due to the semi statement :s

if (a);
else b;

=>

{ $statement$(0, 8); if ($expression$(0, 11, (a)))$statement$(0, 13); ;
else $expression$(0, 25, (b)); }