| OLD | NEW |
| 1 Prism.languages.matlab = { | 1 Prism.languages.matlab = { |
| 2 // We put string before comment, because of printf() patterns that conta
in "%" | 2 // We put string before comment, because of printf() patterns that conta
in "%" |
| 3 » 'string': { | 3 » 'string': /\B'(?:''|[^'\n])*'/, |
| 4 » » pattern: /(^|\W)'(?:''|[^'\n])*'/, | |
| 5 » » lookbehind: true | |
| 6 » }, | |
| 7 'comment': [ | 4 'comment': [ |
| 8 /%\{[\s\S]*?\}%/, | 5 /%\{[\s\S]*?\}%/, |
| 9 /%.+/ | 6 /%.+/ |
| 10 ], | 7 ], |
| 11 // FIXME We could handle imaginary numbers as a whole | 8 // FIXME We could handle imaginary numbers as a whole |
| 12 'number': /\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/, | 9 'number': /\b-?(?:\d*\.?\d+(?:[eE][+-]?\d+)?(?:[ij])?|[ij])\b/, |
| 13 'keyword': /\b(?:break|case|catch|continue|else|elseif|end|for|function|
if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/, | 10 'keyword': /\b(?:break|case|catch|continue|else|elseif|end|for|function|
if|inf|NaN|otherwise|parfor|pause|pi|return|switch|try|while)\b/, |
| 14 'function': /(?!\d)\w+(?=\s*\()/, | 11 'function': /(?!\d)\w+(?=\s*\()/, |
| 15 'operator': /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/, | 12 'operator': /\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/, |
| 16 'punctuation': /\.{3}|[.,;\[\](){}!]/ | 13 'punctuation': /\.{3}|[.,;\[\](){}!]/ |
| 17 }; | 14 }; |
| OLD | NEW |