cjohansson / emacs-phps-mode

Emacs major mode for PHP with code intelligence
GNU General Public License v3.0
35 stars 2 forks source link

Parse errors with fall-though switch cases #41

Closed phil-s closed 2 years ago

phil-s commented 2 years ago

If you have this:

    switch ($condition) {
      case 'one':
      case 'two':

Then the remainder of the file from case 'two': onwards is highlighted red.

Comments here are interesting too...

  switch ($condition) {
    case 'zero':
      // Comment 0
      $code1;
      break;
    case 'one':
      // Comment 1
    case 'two':

Here // Comment 1 is the first line highlighted red (plus everything that follows).

cjohansson commented 2 years ago

Strange I didn't see this issue until now, I found the issues myself too but recently, need to dig into the grammar to understand how the kind of code is valid

cjohansson commented 2 years ago

Fixed in this commit