patchGNU nano - Patches: patch #6798, syntax highlighting for matlab

 
 

You are not allowed to post comments on this tracker with your current authentification level.

patch #6798: syntax highlighting for matlab

Submitted by:  Ati Sharma <atisharma>
Submitted on:  Fri 03 Apr 2009 12:44:44 PM UTC  
 
Category: NonePriority: 3 - Low
Status: PostponedPrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: None

Sat 25 Apr 2015 04:05:43 PM UTC, comment #3:

Since Matlab appears to be proprietary, I am not going to take the file as is.

But if you call the syntax "octave" instead and make sure the small Octave extensions are coloured properly too, and clean up the file a bit (remove unneeded lines/comments, and split some of the overly long lines), I will reconsider.

Benno Schulenberg <bens>
Project Member
Sat 06 Sep 2014 08:50:40 AM UTC, comment #2:

The following two lines will add additional Matlab/Octave commands to the syntax highlighting definition:

color brightgreen "\<(bsxfun|numel|lower|speye|svds|eig|eigs|chol|fminunc|cputime|lsode|sparse|sprand|sprandn|spdiags|deval|ode45|ode23|tic|toc)\>"
color brightred "\<(xlim|ylim|zlim|xlabel|ylabel|zlabel|title|surf|colorbar|caxis|imagesc|print|set)\>"

CH <atcl>
Fri 03 Apr 2009 12:46:25 PM UTC, comment #1:

nanorc file for matlab. Includes list of functions etc.
String highlighting can be flaky.

(file #17858)

Ati Sharma <atisharma>
Fri 03 Apr 2009 12:44:44 PM UTC, original submission:

syntax "matlab" "\.m?$"
color brightred "\b([0-9]+[Ee][-]?[0-9]+|([0-9]*\.[0-9]+|[0-9]+\.)([Ee][-]?[0-9]+)?)[fFlL]?"
color brightgreen "\<(size|zeros|ones|min|max|varargs|sqrt|atan2|asin|acos|log10|log|real|error|isscalar|isstr|strcmp|log2|Inf|isvector|strcat|fsolve|islogical|isempty|isnumeric|prod|round|dims|cumprod|ismatrix|floor|sort|ceil|linspace|isnan|isinf|nan_inf|repmat|colums|rows|sum|rem|reshape|conv|length|usage|log2|abs|setstr|printf|sprintf|fprintf|fread|fopen|fclose|system|unlink)\>"
color magenta "\<(function|endfunction|switch|case|endswitch|otherwise|unwind_protect|unwind_protect_cleanup|end_unwind_protect|try|catch|end_try_catch|end|if|else|elseif|endif|break|continue|for|endfor|return|do|until|while|endwhile|global|nargin|nargout|assert)\>"
color brightred "\<(function|endfunction|global|for|end|while|if|else|elseif|endif|break|switch|case|and|or|and)\>"
color brightyellow "\<(info|whatsnew|hostid|help|lookfor|what|which|type|edit|pcode|quit|exit|who|whos|save|load|memory|clear|pack|workspace|pathdef|path|addpath|echo|format|diary|pwd|cd|dir)\>"
color brightgreen "\<(logical|isnumeric|islogical|isempty|isequal|reshape|repmat|find|length|size|cross|kron|linspace|logspace|meshgrid|zeros|ones|rand|randn|end|ind2sub|sub2ind|repmat|cat|ndims|ndgrid|permute|ipermute|shiftdim|flipdim|squeeze|struct|fieldnames|getfield|setfield|rmfield|isfield|isstruct|cell|celldisp|cellplot|cellstr|deal|iscell|num2cell|cell2struct|struct2cell|lists|varargin|varargout|inline|argnames|formula|char|vectorsize|class|isa|isobject|methods|inferioto|superioto|horzcat|vertcat|subsref|subsasgn|subsindex)\>"
color brightgreen "\<(ans|inf|NaN|Pi|eps|log2|pow2|realmin|realmax|all|any|exist|bitset|bitget|bitmax|bitcmp|bitand|bitor|bitxor|bitshift|ismember|unique|union|intersect|setdiff|setxor|eval|feval|builtin|assignin|evalin|run|nargchk|nargin|nargout|inputname|input|pause|error|warning|lasterr|lastwarn|disp|fprintf|sprintf)\>"
color brightgreen "\<(abs|angle|real|imag|conj|cplxpair|ceil|fix|floor|round|mod|rem|sign|factor|primes|gcd|lcm|rat|rats|perms|nchoosek|sqrt|exp|log|pow2|nextpow|log2|log10|sin|sinh|asin|asinh|csc|csch|ascc|ascch|cos|cosh|acos|acosh|sec|sech|asec|asech|tan|tanh|atan|atan2|atanh|cot|coth|acot|acoth|cart2pol|cart2sph|pol2cartsph2cart|besselj|bessely|besseli|besselk|besselh|airy|beta|betainc|betaln|ellipj|ellipke|erf|erfc|erfcx|erfinv|gamma|gammainc|gammaln|expint|legendre)\>"
color brightgreen "\<(eye|diag|tril|triu|fliplr|flipud|rot90|compan|cond|normest|norm|det|see|rank|trace|null|orth|inv|lu|qr|svd|gsvd|roots|poly)\>"
color brightgreen "\<(sum|cumsum|prod|cumprod|sort|sortrows|max|min|median|mean|std|cov|corrcoef|diff|gradient|polyfit|interpft|spline|ppval|fft|ifft|fft2|ifft2|fftn|ifftn|filter|filter2)\>"
color brightred "\<(root|figure|axes|line|patch|surface|text|plot|fplot|ezplot|loglog|semilogx|semilogy|polar|piotyy|plot3|meshgrid|mesh|meshc|meshz|axis|hold|grid|bar|barh|pie|subplot|zoom|colormap|label|legend|errorbar|hist|stem|stairs|scatter|roze)\>"

##color red "\{[0-9:(end)-+]*?\}"
##color red "\([0-9:(end)-+\[\]]*?\)"
color red "[\{\}\(\)]"

##
##
## String highlighting. You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
##
## Comment highlighting
color cyan "%.*"
## string highlighting
color yellow "(\s|,|\[|\()'.*?'(\)|,|\s|\])"
##color yellow "'.*'"
color white "\[" "\]" "[\*+-=<>;\\/\.\^!&|,]"
icolor green "\\.|\\[A-Z]*"

## Trailing whitespace
color ,green "[[:space:]]+$"

Ati Sharma <atisharma>

 

Attached Files
file #17858:  matlab.nanorc added by atisharma (4kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by atcl (Posted a comment)
  • -unavailable- added by atisharma (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 25 Apr 2015 04:05:43 PM UTCbensStatusNone=>Postponed
      Summarynanorc for matlab=>syntax highlighting for matlab
    Sat 25 Apr 2015 04:05:42 PM UTCbensPriority5 - Normal=>3 - Low
    Fri 03 Apr 2009 12:46:25 PM UTCatisharmaAttached File-=>Added matlab.nanorc, #17858

    Back to the top


    Powered by Savane 3.1-cleanup