Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context filter for MATLAB / GNU Octave codes #621

Open
grisuthedragon opened this issue Mar 24, 2022 · 0 comments
Open

Context filter for MATLAB / GNU Octave codes #621

grisuthedragon opened this issue Mar 24, 2022 · 0 comments

Comments

@grisuthedragon
Copy link

I am integrating aspell it into my GNU Octave/Matlab development and release workflow in order to check comments and string literals for errors. Therefore, I define the following mode file

MODE octave

ASPELL >=0.60.1

MAGIC /<noregex>/m

DESCRIPTION mode for checking MATLAB/Octave comments and string literals

FILTER url
FILTER context
OPTION clear-context-delimiters
OPTION add-context-delimiters % \0
OPTION add-context-delimiters ' '
OPTION add-context-delimiters " "
OPTION disable-context-visible-first

In general this works fine, but I ran into trouble with the following MATLAB/GNU Octave file:

% This is a comment, which works fine.
% Even with an ' inside this is not a problem.

str = 'erors in strings are not a problem as well'

A = QBE'*X; % But this eror is a problem.

In the last case ' denotes the transpose of an object (which is a part of the MATLAB/GNU Octave language), but not the beginning of a valid context. How can a context be constructed, such that the last case works properly as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant