summaryrefslogtreecommitdiff
path: root/pygments/lexers/matlab.py
Commit message (Collapse)AuthorAgeFilesLines
* Provide (all?) Matlab built-ins (#1705)Alex Povel2021-02-141-42/+2569
| | | | | | | * Add (all?) Matlab built-ins See also https://de.mathworks.com/help/matlab/referencelist.html * Adjust pytest goldens
* MATLAB parser cleanup & fix for parsing `1./x` (#1673)Antony Lee2021-02-061-5/+9
| | | | | | | | | * Clarify recognition of "command form" by MATLAB parser. Expand a bit the explanation; remove an unnecessary non-capturing group, replace \s+ by \s at the end (we just need to check for the presence of a space). * MATLAB: Correctly parse 1./x as (1)(./)(x).
* Matlab class properties (#1466)Dan2021-01-181-34/+64
| | | | | | | | | | | | | | | | | | | * WIP: Add failing test for a matlab class with properties. * Add some missing keywords * Add leading \s* matchers to things above the command form regex, as it tends to swallow keywords otherwise. * Add support for the special 'properties' block syntax. * Fix apparent infinite loop when given garbage input. * Use includes to clean up some of my copypasta. * Fix negative lookahead when there's more than one space between operators. * Use Whitespace not Text for spaces; combine adjacent whitespace. * Add support for declarative property constraints.
* Run pyupgrade across codebase to modernize syntax and patterns (#1622)Jon Dufresne2021-01-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | pyupgrade is a tool to automatically upgrade syntax for newer versions of the Python language. The project has been Python 3 only since 35544e2fc6eed0ce4a27ec7285aac71ff0ddc473, allowing for several cleanups: - Remove unnecessary "-*- coding: utf-8 -*-" cookie. Python 3 reads all source files as utf-8 by default. - Replace IOError/EnvironmentError with OSError. Python 3 unified these exceptions. The old names are aliases only. - Use the Python 3 shorter super() syntax. - Remove "utf8" argument form encode/decode. In Python 3, this value is the default. - Remove "r" from open() calls. In Python 3, this value is the default. - Remove u prefix from Unicode strings. In Python 3, all strings are Unicode. - Replace io.open() with builtin open(). In Python 3, these functions are functionally equivalent. Co-authored-by: Matthäus G. Chajdas <Anteru@users.noreply.github.com>
* Fix several exponential/cubic complexity regexes found by Ben Caller/DoyensecGeorg Brandl2021-01-111-3/+3
|
* Bump copyright year.Matthäus G. Chajdas2021-01-031-1/+1
|
* Add analyze_text to make make check happy. (#1549)Matthäus G. Chajdas2020-09-231-0/+4
| | | | | | | | | | | | | | | | | | | * Add analyze_text to make make check happy. This also fixes a few small bugs: * Slash uses *.sla as the file ending, not *.sl * IDL has endelse, not elseelse * Improve various analyse_text methods. * Improve various analyse_text methods. * Make Perl less confident in presence of :=. * Improve brainfuck check to not parse the whole input. * Improve Unicon by matching \self, /self * Fix Ezhil not matching against the input text * Simplify Modula2::analyse_text.
* all: use yield from (#1537)Georg Brandl2020-09-061-6/+4
|
* all: fixup remaining regexlint warningsGeorg Brandl2020-09-061-4/+6
|
* Update copyright year (fixes #1514.)Matthäus G. Chajdas2020-08-221-1/+1
|
* Matlabsession line continuation (#1399)Bryan W. Weber2020-05-061-16/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add explicit line continuation for Matlab session Matlab lines can be explicitly continued with the ... syntax at the end of a line. In the Session lexer, this requires continuing to the next line to add more text. Otherwise, the next line is marked as output. * The ellipses in Matlab should be a Keyword The built-in Matlab syntax highlighter highlights ... with the same formatting as a keyword. Everything after that on the line should be a comment. * Update Matlab functions and keywords from R2018a * Fix many spaces in assignment formatted as string In command mode, MATLAB allows mutiple space separated arguments to a function which are interpreted as char arrays, and are formatted as Strings. This check was also catching cases where there were multiple spaces following an assignment or comparison operation and formatting the rest of the line as a string. Now, if an = or operator is found, the commandargs state is popped and control returns to the root state. * Add tests for MATLAB formatting
* Multiline flag does not work with re.matchAlan Hamlett2020-02-081-2/+2
|
* More fixes to MATLAB lexer. (#1328)Georg Brandl2019-12-061-4/+5
|\ | | | | More fixes to MATLAB lexer.
| * More fixes to MATLAB lexer.Antony Lee2019-12-061-4/+5
| |
* | recognize escapes in Matlab double quoted stringsGeorg Brandl2019-11-271-1/+1
| |
* | Fixes #1124Jan Siqueira2019-11-271-0/+2
| |
* | MATLAB allows keywords to be used as field names.Antony Lee2019-11-271-5/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | ... so don't highlight them as keywords in that position. Example MATLAB session showcasing this "feature": >> x.for = 42 x = struct with fields: for: 42 >> x x = struct with fields: for: 42 >> x.for ans = 42
* MATLAB: Recognize command form.Antony Lee2019-11-251-8/+23
| | | | | | MATLAB treats a bare word followed by arguments such as `foo bar baz` as the function call `foo('bar', 'baz')`. As such, treat everything that follows the bare word as a string.
* MATLAB: improve detection and float boundaries.Antony Lee2019-11-251-6/+14
| | | | | | | - Detect `.m` files starting with a function definition as MATLAB, not ObjC (#1149). - Require word boundaries in regexes matching numbers and floats, to avoid mishighlighting `load 123file` as starting with a number.
* Matlab/etc: add missing word boundary to recognize function kw (bitbucket PR ↵Georg Brandl2019-11-241-3/+3
| | | | #795)
* Fixup all headers and some more minor problems.2.4.2Georg Brandl2019-05-281-1/+1
|
* Fix more instances of invalid string escapesGeorg Brandl2018-11-281-2/+2
| | | | Also, raise on warnings from Pygments only.
* Copyright update.Georg Brandl2017-01-221-1/+1
|
* Add support for partials and path segments for Handlebars.Christian Hammond2016-11-041-0/+663
This introduces support for some missing features to the Handlebars lexer: Partials and path segments. Partials mostly appeared to work before, but the `>` in `{{> ... }}` would appear as a syntax error, as could other components of the partial. This change introduces support for: * Standard partials: `{{> partialName}}` * Partials with parameters: `{{> partialName varname="value"}}` * Ddynamic partials: `{{> (partialFunc)}}` * Ddynamic partials with lookups: `{{> (lookup ../path "partialName")}}` * Partial blocks: `{{> @partial-block}}` * Inline partials: `{{#*inline}}..{{/inline}}` It also introduces support for path segments, which can reference content in the current context or in a parent context. For instance, `this.name`, `this/name`, `./name`, `../name`, `this/name`, etc. These are all now tracked as variables.