JamesRitchie / language-matlab

MATLAB/Octave language support for Atom
15 stars 9 forks source link

Commenting error with matlab package #10

Open jalexcole opened 8 years ago

jalexcole commented 8 years ago

fprintf(" %d" , decimal) comments everything after % so d" , decimal) looks commented out

bradybus commented 7 years ago

Try that command with single, rather than double, quotes. MATLAB treats them differently, and I believe the correct syntax for the fprintf() function uses single quotes.

fprintf( '%d' , decimal )

rlivings39 commented 4 years ago

This is fixed in the package https://atom.io/packages/language-matlab-octave. That's still being maintained for MATLAB syntax highlighting fixes. It uses the shared highlighting grammar: https://github.com/mathworks/MATLAB-Language-grammar/

The same grammar is used here on GitHub and handles it properly:

fprintf(" %d" , decimal) % a comment