This repository has been archived on 2024-06-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coffee.pygments/tests/examplefiles/maxima/foo.mac
Robert Dodier 2755398017
Lexer for new language Maxima (#1885)
* New lexer for Maxima computer algebra system

 * New lexer class MaximaLexer
 * Update _mapping.py to include Maxima lexer
 * New test input file maxima/foo.mac

I find that the commands

$ python3 -m pygments -O full -f html -o /tmp/foo.html tests/examplefiles/maxima/foo.mac

$ python3 -m pygments -x -l pygments/lexers/maxima.py:MaximaLexer tests/examplefiles/maxima/foo.mac

both produce expected output.

* Commit output from pytest --update-goldens for Maxima example file

Commit output from pytest tests/examplefiles/maxima --update-goldens
as obtained by Cameron Smith.

* Rename output file for test of Maxima lexer.

* In Maxima lexer, capture content of comment
all at once, instead of capturing each character separately.

Update expected output for example input file, as produce by:

$ pytest tests/examplefiles/maxima --update-goldens

* In lexer for Maxima language, identify whitespace characters as such
instead of just calling them Text.

* In lexer for Maxima language, identify comma, semicolon, and dollar sign
as Punctuation instead of Text.

* In lexer for Maxima language, cut encoding comment, and put in license statement.

* In lexer for Maxima language, identify keywords and other fixed strings such as operators
via the words function, instead of a long regex with alternation.

Incidentally update the example output, for which one symbol
(namely "done") has changed classification.

* In lexer for Maxima language, include additional test input and update output accordingly.

* In lexer for Maxima language, relax pattern for integers,
so integers are more accurately identified.

Update test example output accordingly.

* In lexer for Maxima language, adjust pattern for float numbers.
Include additional test input for floats and update expected output.

* In lexer for Maxima language, define analyse_text function.

* In lexer for Maxima language, correct errors identified by make check

(1) adjust package name underline
(2) put in copyright notice

Co-authored-by: Robert Dodier <robert_dodier@users.sourceforge.net>
2021-09-04 16:18:28 +02:00

40 lines
898 B
Text

/* SF bug #3826: "limit returns temp variable expression" */
(kill (q, a, x),
ctxt: newcontext (),
assume (q > 0),
limit(x^q/(a*x^q- 1),x,inf));
'limit(1/(a- 1/x^q),x,inf);
tlimit(x^q/(a*x^q- 1),x,inf);
'limit(1/(a- 1/x^q),x,inf);
(assume (a > 0),
declare (q, integer),
limit(x^q/(a*x^q- 1),x,inf));
1/a;
(remove (q, integer),
declare (q, noninteger),
limit(x^q/(a*x^q- 1),x,inf));
1/a;
(remove (q, noninteger),
killcontext (ctxt));
done;
/* additional code to test lexer */
xyz: expand ((u - h*v)^4);
print ("foo.mac: xyz =", xyz);
'integrate (xyz, u, minf, inf);
LL: [1234, 5678, 9012];
for x:2 thru n - 3
do while (L: readline (S)) # false
do push (L, LL);
if abc < 123 and (def > -123 or zyx < 234)
then X[k]: Y[j, k]*%pi - gamma;
print ("foo.mac: test different kinds of floats") $
blurf (a, b, c) :=
mumble (a*123.45/b, b*0.12345e6/c, c*1.2345b-8/a)) $