Commit Graph

118 Commits

Author SHA1 Message Date
Uwe Brauer f66183a5fe Add GPLvs3+ header to all files in tests directory 2023-07-25 18:44:32 +02:00
Eric Ludlam 083a5e9e05 matlab-syntax.el:
(matlab-block-comment-start-re, matlab-block-comment-end-re)
(matlab-ltype-block-comment-start, matlab-ltype-block-comment-end)
(matlab-block-comment-bounds):
DELETED - no longer used.

matlab.el:
(matlab-mode-map): Re-arrange the map.
Delete bindings for return and c-j (use default)
Add comments and build sections.
(matlab-mode): Update comments.
Add electric-indent-functions setting.
Remove matlab-comment-indent as a setting (use nil)
(matlab-return-function, matlab-return, matlab-plain-ret)
(matlab-indent-after-ret, matlab-indent-end-before-ret)
(matlab-semicolon-on-return, matlab-indent-before-ret)
(matlab-linefeed):
DELETED - use default 'newline' and electric indents instead.
(matlab-electric-indent-function):
NEW - auto-reindent when finishing typing end,
else, case, and a few other things.
(matlab-electric-comment):
Re-write to use new APIs from matlab-scan.el.
This enabled deletion of block comment stuff from matlab-syntax.el.
(matlab-comment-line-break-function):
Remove use of 'matlab-indent-line'.
(matlab-comment-indent): Delete (see change in matlab-mode)

tests/metest.el:
Stop using `matlab-block-comment-bounds'.  Replace with new API call.
2021-04-09 21:31:53 -04:00
Eric Ludlam 6d28272cfc matlab.el:
(matlab-font-lock-anchor-variable-match): . is ok in arguments variable names.

tests/blocks.m:
Added sample argument block using variable name as struct with . in it.
2021-04-09 17:28:09 -04:00
Eric Ludlam 4d261a86a2 matlab-scan.el:
(matlab--valid-arguments-keyword-point):
Argument keywords are ok after an 'end' as well - assuming the 'end' is
another argument block - but we don't check that part, just hope for the best.

tests/blocks.m:
Add example with two argument blocks in a row.
2021-04-09 17:19:37 -04:00
Eric Ludlam 84dab231ea matlab.el:
(matlab-indent-function-body, matlab-functions-have-end):
Make safe local variable (needed in tests.)

(matlab-line-count-open-blocks, matlab-line-count-closed-blocks):
DELETE - replaced by ...
(matlab-line-count-block-change):  New.
Return + or - num based on num of opened or closed blocks that
don't cancel eachother out.  Cuts keyword search on line in half.

(matlab-next-line-indentation): Use `matlab-line-count-block-change'
replacing old calls.
Simplify how functions w/ no indent works.
Simplify indent based on indenting block starts and ends.
Simplify number of local variables.

tests/metest.el:
Add new test file for detect and indent.

tests/mfuncnofuncindent.m:
New file with functions with ends but no indent.
Setting w/ local variable.
Verify this mode works.
2021-04-02 22:28:15 -04:00
Eric Ludlam 61b24bec94 matlab.el:
(matlab--previous-line-indent-recommendation):
If scanning backwards finds empty line @ beginning of buffer,
then just return 0.

tests/indents.m:
Add blank first line to exercise above.
2021-04-02 20:55:46 -04:00
Eric Ludlam c934a0c0f9 matlab.el:
(matlab-indent-past-arg1-functions): Wrap expression
to only be whole-symbols.
(matlab-function-font-lock-keywords): Accomodate change
to above.

tests/indents.el:
Add test that used to indent as if it were a fcn that
indents past arg1, but shouldn't.
2021-04-02 20:43:01 -04:00
Eric Ludlam 9438d95d55 matlab.el:
(matlab-fl-opt-continuation, matlab-fl-opt-whitespace)
(matlab-fl-fcn-key, matlab-fl-return-args)
(matlab-fl-fcn-name, matlab-fl-fcn-args):
New regex parts for building font lock keywords.
(matlab-function-font-lock-keywords):
Revamp using above keyword parts.
Now handles continuations between different parts of
the function declaration.

tests/fontlock.m:
New tests for various function declaration flavors with
and without ellipsis between differentparts.
2021-04-02 20:31:55 -04:00
Eric Ludlam 398667e53f matlab-scan.el:
(matlab-scan-comment-help-p): After finding prev code line,
move to beginning of that command before detecting the declaration.
(matlab-scan-beginning-of-command): Add a code-only
input to skip comment scanning.

tests/continuations.m:
Add tests with continuations in function declarations to better
test new fcn comment scanning.
2021-04-02 20:29:53 -04:00
Eric Ludlam 4e35f8bf85 matlab.el:
(matlab-indent-region, matlab-indent-line):
Remove use of matlab-navigation-syntax.
I don't think we need this anymore - and it messes
up optimzations w/ syntax-ppss anyway.
(matlab-next-line-indentation):
When checking for block-middle or block-case, pass
in the correct lvl1 context for analysis.
Fixes bug w/ indentaion after a middle or case that
has a continuation.

tests/continuations.m:
Add new test cases for elsif and case with continuation.
2021-04-01 21:23:00 -04:00
Eric Ludlam 41f3206733 matlab.el:
(matlab-calculate-indentation):
For continued from previous non-continued line, no arrays:
Include indent recommendation from the previous line to account for
indentation under ctrl blocks.
(matlab-next-line-indentation):
While computing startpt, be sure to move pt to the line that was
passed in.
2021-03-31 13:07:11 -04:00
Eric Ludlam e6e362a5a4 tests/indents.m, tests/mclass_cont.m:
Change indentation expecatations of some lines to match bug fix.
2021-03-30 22:17:39 -04:00
Eric Ludlam 21b33abd51 matlab-complete.el:
(matlab-find-recent-variable-list): Use new search APIs for keyword
searches.
Fix some misc bugs.
(matlab--complete-compute-search-functions):
New - pulled from below:
(matlab-complete-symbol-local):
Remove code for deriving which functions to use.
Pulled out to support testing.

matlab.el:
(matlab-mcos-innerblock-regexp, matlab-mcos-regexp, matlab-block-beg-pre-if)
(matlab-block-beg-pre-no-if, matlab-block-beg-pre): DELETED

tests/metest.el:
(matlab-complete): New require
(metest-all-syntax-tests): Move stuff around.  Add metest-complete-test.
(met-complete-files, met-complete-tools, metest-complete-test): NEW

tests/complete.m:
New file for testing local completion stuff.
2021-03-27 13:58:07 -04:00
Eric Ludlam 67eb90e872 matlab-scan.el:
(matlab-line-declaration-p): Fix doc.
(matlab-line-first-word-text): New.

matlab.el:
(matlab-defun-regex): DELETED.
(matlab-guess-script-type): Replace use of matlab-defun-regex
with new api style navigation.
(matlab-guess-function-indentation): New way to guess
if a file should have indentation in function body.
(matlab-really-gaudy-font-lock-keywords): for tranpose,
use builtin-face like other operators.
(matlab-mode): When matlab-indent-function-body is 'guess
use new function above.
(matlab-find-prev-code-line, matlab-find-prev-line)
(matlab-prev-line, matlab-valid-end-construct-p): DELETED.
(matlab-mode-vf-block-matches-backward): DELETED

mlint.el:
(mlint-fix-entry): Use new api instead of
matlab-find-prev-code-line.

tests/metest.el:
In end detect test, turn `matlab-indent-function-body' to 'guess.
In test, also validate what the indent value is.
Put value for indent-function-body back to mw standard when done.

tests/empty.m, tests/mclass.m, tests/mfuncends.m
tests/mfuncnoends.m, tests/mfuncnoendblock.m:
Add indent exptect value to file

tests/mfuncnoendindent.m:
New file for testing endless function that should be indented.
2021-03-26 21:05:11 -04:00
Eric Ludlam 4c389c08fa matlab.el:
(matlab-math-face): New
(matlab-simulink-keyword-face): Inherit from builtin, not type.
(matlab-ignored-comment-face): Remove height change, too disruptive.
(matlab-keyword-list, matlab-keyword-first-on-line-list):
DELETED (now in matlab-scan.el)
(matlab-hg-primitives-list): New name, many new words.
(matlab-constants-keyword-list): Add flintmax.
(matlab-font-lock-regexp-opt): Use symbol ends.
(matlab-font-lock-mcos-keyword-match):
After match, skip over attribute list.  Needed for anchored matchers.
(matlab-font-lock-anchor-set-end-limit): Don't change match data.
(matlab-font-lock-anchor-variable-match):
Update regex to be more robust.
Always move endpoint to EOL.
(matlab-basic-font-lock-keywords):
Use symbol end matchers \\_< and \\_> where needed.
Delete crufty old comments.
(matlab-really-gaudy-font-lock-keywords):
Add more logical things and use built-in face on them.

tests/metest.el:
Add new instrumentation options for new faces used by font lockers.

tests/blocks.m, tests/mclass.m:
Fixup for changes in font lock faces used.
2021-03-26 18:52:45 -04:00
Eric Ludlam 2435bf1000 matlab-syntax.el:
(matlab-syntax-commanddual-functions): Add cd and colormap.
(matlab--scan-line-for-command-dual): Make sure case-fold-search set
so we don't match cmd dual if user messes w/ capitalization.
(matlab--font-lock-syntactic-face): Add support for ignored comment face.
(matlab-cursor-comment-string-context): Improve help.

matlab.el:
(matlab-ignored-comment-face): New

tests/metest.el:
(metest-comment-string-syntax-test):
Add ignored comment support.
Add 'regular' code support (ie - not string or comment)
(met-kw-font-alist):
Add ignored comment support.

tests/fontlock.m:
Add tests for ignored comment face.

tests/stringtest.m:
Add ignored cmd dual cases.
Add ignored comment detection and tests.
2021-03-26 12:46:34 -04:00
Eric Ludlam 9a8784af2a matlab-scan.el:
(matlab-previous-code-line): In case of no comments, also
hand skip over whitespace charts.

tests/metest.el:
Force empty lines to have no spaces, other lines stay the same.
This will exercise bug found above.

tests/indents.m:
Fix mlint error.
2021-03-25 19:02:27 -04:00
Eric Ludlam 7b49b6f447 matlab-syntax.el:
(matlab-syntax-support-command-dual): Default to t
(matlab-syntax-commanddual-functions): List of functions
commonly used with command line dual.
(matlab--scan-line-for-command-dual): Use above lists
instead of anti-keyword detection.

tests/fontlock.m, tests/indents.m:
Add tests for command dual.

tests/stringtest.m:
Command dual test updated to use 'disp'
2021-03-24 22:08:52 -04:00
Eric Ludlam 5c6ef4b9c5 matlab-scan.el:
(matlab-kwt-*): New regex caches.
(matlab-keyword-regex): Update to use new caches.
(matlab-compute-line-context-lvl-1): Support %^ ignore comment type
(matlab--scan-next-keyword): New helper fcn.
(matlab-re-search-keyword-forward): Add extra BONUSTEST input.
Used to filter out some kinds of hints by matlab--scan-next-keyword.

matlab.el:
(matlab-font-lock-basic-keyword-match)
(matlab-font-lock-vardecl-keyword-match)
(matlab-fl-anchor-keyword)
(matlab-font-lock-args-keyword-match)
(matlab-font-lock-extend-region)
(matlab-font-lock-anchor-set-end-limit)
(matlab-font-lock-anchor-clear-end-limit)
(matlab-font-lock-anchor-variable-match):
New font lock support features.
(matlab-basic-font-lock-keywords)
(matlab-file-basic-font-lock-keywords)
(matlab-function-font-lock-keywords)
(matlab-file-class-font-lock-keywords):
Use above new font lock keyword matchers.
(matlab-mode): Setup font lock extend region feature.

tests/metest.m:
(met-fontlock-files): Add blocks.m

tests/blocks.m, tests/fontlock.m, tests/mclass.m:
Add new font lock testing instrumentation.
2021-03-24 21:43:56 -04:00
Eric Ludlam 3df48a0b24 matlab.el:
(matlab-file-class-font-lock-keywords): classdef keywords
work when no space between fn and paren.

tests/fontlock.m:
Add test for above.
2021-03-24 17:24:36 -04:00
Eric Ludlam d7d0766937 matlab-syntax.el:
(matlab--font-lock-syntactic-face): Add pragma face support.

matlab.el:
(matlab-string-start-regexp): Delete (unused)
(matlab-font-lock-extend-region): Delete.
block comments now supported natively.
(matlab-pragma-face): New
(matlab-basic-font-lock-keywords):
Delete pragma face support
end & ref keyword regex tweak to use \\_>
(matlab-mode): Don't setup font-lock-extend-region

tests/metest.el:
(met-kw-font-alist):
Add some new face keys to test.
(met-fontlock-files): Add fontlock.m
(metest-fontlock-test): Tweak how multi-fonts on one spot test.

tests/fontlock.m:
New suite of tests.
tests/mclass.m:
Add some more font lock tests.
2021-03-23 19:23:08 -04:00
Eric Ludlam fb674c7430 matlab.el:
(matlab-array-continuation-indent-level): New config variable.
(matlab-calculate-indentation-1):
When selecting indentation for within parens, add logic for 2 indent styles
depending on what kind of array continuation we find ourselves in.
Use new array-continuation indent level for inside arrays.
functions, arrays w/ open paren on a line by itself,
and nested arrays indent under their parens.

tests/indents.m:
Add examples of differnet kinds of array continuations.
2021-03-22 21:11:50 -04:00
Eric Ludlam a29adf40af matlab-scan.el:
(matlab--valid-mcos-keyword-point):
When verifying an mcos keyword, be sure to travel to beginning of
command before identifying if it is a class or end.

tests/mclass_cont.m:
New test for above.

tests/metest.el:
Add mclass_cont.m as an indentation test.
2021-03-22 14:10:55 -04:00
Eric Ludlam daa3569bc7 tests/metest.el:
(met-kw-font-alist): New
(metest-fontlock-test): Add implementation

tests/mpclass.m:
Instrument with font lock testing cookies.
2021-03-21 11:29:23 -04:00
Eric Ludlam 276e813831 matlab.el:
(matlab-mode-vf-block-matches-forward): If this buffer has bad
list syntax, don't bother doing any work.

metest.el:
(metest-comment-string-syntax-test):
Add font lock testing to all found comments and strings.

(met-fontlock-files, metest-fontlock-test):
New but empty - TODO to impl this.
2021-03-21 10:19:10 -04:00
Eric Ludlam d24178e015 matlab-scan.el:
(mlf-paren-inner-point): New var.
Renumbered all the other vars.
(matlab-compute-line-context-lvl-1):
Add paren inner point into list.
(matlab-line-close-paren-inner-point): New

matlab.el:
(matlab-calculate-indentation-1):
Update blockendless to use new apis
Update plain code continuations to use new apis
when inside parens.
2021-03-20 19:53:01 -04:00
Eric Ludlam ef7894cea5 matlab-syntax.el:
(matlab--scan-line-for-unterminated-string): When comment found,
disable all quote chars in the comment.
(matlab--scan-line-comment-disable-strings):
Find all syntax " chars and disable as whitespace.

tests/indents.m:
Add tests with ' in comments that impact indent.
2021-03-20 12:11:39 -04:00
Eric Ludlam 12d9cfbfe3 matlab-scan.el:
(matlab--valid-mcos-keyword-point, matlab--valid-arguments-keyword-point):
Require these special keywords to be first on the line.

tests/mclass.m:
Add a bunch of badly named methods.
2021-03-20 12:02:28 -04:00
Eric Ludlam 74a4c1f724 tests/continuations.m:
Clean up mlint warnings.
2021-03-20 08:32:47 -04:00
Eric Ludlam b4f10db9b9 matlab.el:
(matlab-next-line-indentation): Add special code for multi-end lines
to find originating line and use that indentation.

tests/continuations.m:
Set the indentation for section previous broken.
2021-03-20 01:27:16 -04:00
Eric Ludlam 099433517c matlab.el:
(matlab-lattr-block-close):
Stop decrementing for else type keywords.
(matlab-calculate-indentation-1):
Allow block comments to be help comments.

tests/continuations.m:
Add suite of previously failing tests.

tests/indents.m:
Block comments can now be help.
2021-03-20 01:15:00 -04:00
Eric Ludlam b1d720eff5 matlab-scan.el:
(matlab-scan-block-start-context): New

matlab.el:
(matlab-lattr-block-cont): Rename to
(matlab-lattr-block-open): New name, return 0 not nil.
(matlab--calc-indent, matlab-show-line-info): Call matlab-next-line-indent w/ new inputs.
(matlab-calculate-indentation-1):
Replace old END indent logic with call to `matlab-scan-block-start-context'
and then stabilize dedent to match block start.
(matlab-next-line-indentation): Better inputs based on what's used.
Delete dead code and commented out code.

tests/continuations.m:
Enabled test that now 'works'.
2021-03-20 00:41:42 -04:00
Eric Ludlam 81cc7718eb matlab-scane.el:
(matlab--buffer-block-tree): Delete
(matlab--scan-block-forward):
Handle case when `matlab-functions-have-end' is false.
(matlab-re-search-keyword-forward,matlab-re-search-keyword-backward):
Handle bounds correctly before restarting a scan.
(matlab-scan-before-change-fcn):
Only clear cached items AFTER the change.

matlab.el:
(matlab-in-command-restriction, matlab-with-current-command)
(matlab-lattr-local-end): DELETE
(matlab-backward-sexp, matlab-forward-sexp):
Reimplement using matlab--scan-block-forward/backward.
(matlab-lattr-block-cont, matlab-lattr-block-close):
Remove narrowing to current command, and use new search utils with bounds.
(matlab-lattr-middle-block-cont): Comment out

tests/metest.m:
(metest-sexp-traversal-test variable): better name.
(metest-sexp-traversal-test): Use new `matlab--scan-block-forward' / backward
instead of orig fcns.

tests/blocks.m:
Tweak a few test points to make them more challenging.
tests/continuations.m:
Added test with continuation, but disabled the problem.
tests/indents.m:
Brought in problem lines that break array sexp w/ ' in continuation
tests/mfuncnoend.m:
Fix whitespace.
tests/mfuncnoendblock.m:
Fix mlint warnings.
2021-03-19 23:28:51 -04:00
Eric Ludlam e0a7d52385 matlab-scan.el:
(matlab-compute-line-context): Don't change the match data.
(matlab-scan-end-of-command): New

matlab-syntax.el:
Doc string fixes.

matalb.el:
(matlab-find-prev-code-line): Now uses matlab-scan-beginning-of-command
instead of old version.
(matlab-with-current-command): Now uses matlab-scan-beginning-of-command AND
matlab-scan-end-of-command to build the narrowed region.
(matlab-cursor-on-valid-block-start): Make this immune to changes in
match-data from various conditions in the cond statement.
Use new matlab-scan-beginning-of-command instead of old version.
(matlab-beginning-of-command): Now use matlab-scan-beginning-of-command
as default impl.  Delete this fcn later.
(matlab-lattr-block-close):
Track original starting pos better, grab line context  after moving to start.

tests/metest.el:
Include new continuations.m test file.

tests/continuations.m:
New test file

tests/indents.m:
Move a couple tests into continuations.m
2021-03-18 21:48:16 -04:00
Eric Ludlam 3730fb360e matlab-syntax.el:
(matlab-syntax-support-command-dual): New way to control
handling command dual syntax in the syntax table.
(matlab--syntax-propertize): Obey above config by
skipping command dual scanning if nil.

tests/stringtest.m:
Add local variables to enable matlab-syntax-support-command-dual for
this file
2021-03-16 19:09:58 -04:00
Eric Ludlam dbb6fc6757 matlab-scan.el:
(matlab-block-keyword-list): Add more keywords.
(matlab-compute-line-context-lvl-1): improve keyword detection
to handle the new types of keywords that don't start blocks.
Improve end of line detection to distinguish command dual from ellipsis.
(matlab-line-commanddual-p): New
(matlab-scan-previous-line-ellipsis-p): Improve how ellipsis is found
to be more explicit.
(matlab-describe-line-indent-context): Show command dual in output.

matlab.el:
(matlab-lattr-cont): Improve how ellipsis is found to be more
explicit.

indents.el:
Add more keyword styles around to deal with command dual problems.
2021-03-15 23:31:17 -04:00
Eric Ludlam 9d41e46c98 matlab-scan.el:
Make accessing keywords easier.
(matlab-keyword-p): New
(matlab-compute-line-context-lvl-1): Use above.

matlab-syntax.el:
Support command dual as a string in the syntax tabe.
(matlab--command-dual-syntax): New syntax type
(matlab--syntax-propertize): Call scanner for command-dual.
(matlab--scan-line-for-command-dual): New.
(matlab--font-lock-syntactic-face):
Detect command dual and provide that face.
Detect cellbreak comments and provide that face.
(matlab-cursor-comment-string-context):
Also detect commanddual strings, and return that status.

matlab.el:
Revamp font lock keywords to take advantage of updates in
`matlab--font-lock-syntactic-face' updates, and to just
lean into use of defface.
(matlab-show-mlint-warnings, matlab-highlight-cross-function-variables):
Make safe local variables.
(matlab-commanddual-string-face): New variable.
(matlab-font-lock-adjustments): Delete as a function and hook setup.
Replace with just the classic defface calls, but cleaned up to
also :inherit from base faces.
(matlab-file-basic-font-lock-keywords): Remove cell break code.

tests/metest.el:
Add tests for commanddual strings.
(metest-comment-string-syntax-test):
Add ability to test for commanddual strings.

tests/stringtest.m:
Add some command dual examples.
2021-03-15 21:52:54 -04:00
Eric Ludlam 39f1178516 metest.el:
(metest-indents-randomize-files):
Force matlab-mode to re-run so script type is recomputed after
extra indent added.

mfunspacey.m:
New file for script type detection tests.
2021-03-15 13:52:16 -04:00
Eric Ludlam 880e1837b1 matlab.el:
(matlab-calculate-indentation-1):
when inside parentheticals; capture indentation
of start as our previous indentation.
Later, ignore all that and just use paren column.
Left notes about what else to fix.

tests/indents.m:
Updated to match new indentation logic.
2021-03-14 19:54:46 -04:00
Eric Ludlam 6fe7da0a62 tests/metest.el
(metest-all-syntax-tests): Force files used for intenting to be
pre-spaced incorrectly.
(metest-condition-case-error-msg): Fix how caught errors are thrown.
(met-indents-files): Add mfuncnoendblock.m
(metest-indents-randomize-files): New
Not really random.
(metest-error): Add a buffer excerpt before throwing an error.

tests/indents.m, tests/mfuncends:
Added more indent tests.
tests/mfuncnoendblock.m:
Add more content.
Enable for use in indentation test.
2021-03-14 19:28:48 -04:00
Eric Ludlam fb136a19f2 tests/metest.el:
(matlab-all-syntax-tests):
Reset the scanner cache hit stats and print when done.
(metest-test-error): Var flag.
(mecondition-case-error-msg):
When test flag set, forward the error along.
(metest-error): Set metest-test-error flag to pass errors through.

(metest-indent-counts): New
(metest-indents-test): Remove core test into new fcn.
Now set matlab--change-indentation-override to our fcn for tracking.
Now call matlab-indent-region with flags for testing.
(metest-indents-test-hook-fcn): New fcn that does the test
on each line from indent-region after indentation is compuated.
2021-03-14 00:12:36 -05:00
Eric Ludlam 6fecb01874 tests/blocks.m:
Indented blank lines.
tests/indents.m:
Indent blank lines.
Added sample for fcn with very long name that
uses array continuation in the argument list.
2021-03-12 22:09:44 -05:00
Eric Ludlam cf945dedd1 tests/metest.el:
Improve control of debugging output by enabling for test script code,
but disabling while running individual tests.
Tests will catch the error, and show the line in the file where
the test failed.
2021-03-12 22:08:41 -05:00
Eric Ludlam ba7df01197 tests/metest.el:
Revise to move all message output outside what is being timed.
Move looping over files outside the test functions.
Combine timings from one test point to one number to be recorded.
Reduce # of lines output during test running.
2021-03-12 19:43:05 -05:00
Eric Ludlam 0fb21cfebf matlab.el:
(matlab-calculate-indentation-1):
Replace old -ltype- API calls with new API from matlab-scan.el.
Delete chunks of block comment handlers, replaced with simpler
code using matlab-scan stuff.

matlab-scan.el:
(matlab-compute-line-context-lvl-1):
Rename block comment stype values.
When a keyword is found, only enable iff not in parens.
Trailing comment section, if line starts with a comment,
assume it ends with a comment, and compute key values.
(matlab-line-comment-style, matlab-line-end-comment-column)
(matlab-line-ellipsis-p):
New
(matlab-line-end-p, matlab-line-block-middle-p)
(matlab-line-block-case-p):
New
(matlab-line-close-paren-p, matlab-line-close-paren-char)
(matlab-line-close-paren-col):
New
(matlab-describe-line-indent-context):
Fixup for various changes.
2021-03-10 21:37:51 -05:00
Eric Ludlam e57ff3e005 metest.el:
(metest-error): Convert back to error.
2021-03-10 19:54:04 -05:00
Eric Ludlam 27e654c9c0 tests/metest.el:
(metest-all-syntax-tests): Add timing instrumentation.
(metest-condition-case-error-msg): New utility.
(metest-indents-test): Wrap indent computation
in `metest-condition-case-error-msg'.
(metest-log-file): New cofig
(metest-log-init, metest-shorten, metest-log-write)
(metest-log-report, metest-timeint): New.
2021-03-10 19:50:50 -05:00
Eric Ludlam 7f6f729fd3 matlab.el:
(matlab-calc-indent):
If current line detects we are in an array continuation, then
it is not necessary to compute next-line indentation from it's context
since you can't have if/end type code in there.
Also, array continuation detection is now very fast.
tests/indents.m:
Added a bunch of misc indenttion tests around nested arrays, cell arrays, etc.
2021-03-09 12:50:59 -05:00
Eric Ludlam b450fe1685 matlab.el:
(matlab-ltype-comm): Make robust to block comment start,
where bounds returns false when on start.  Need to also check
for the start of a block comment.
(matlab--maybe-yes-or-no-p): New
(matlab-calcuate-indentation-1):
Use above instead of yes-or-no-p.

metest.el:
(met-end-detect-files): Add mfuncnoendblock.m
mfuncends.m:
Fix expected indentation numbers for continued arrays.
mfuncnoendblock.m:
New.
2021-03-08 08:09:06 -05:00
Eric Ludlam 6126f39548 tests/indents.m:
(array_constant-decls): Add a bunch of ways to have arrays be indented.
2021-03-07 11:55:13 -05:00