User:CRGreathouse: Difference between revisions

From Rosetta Code
Content added Content deleted
(GeSHi tester)
(explain)
Line 37: Line 37:


==GeSHi tester==
==GeSHi tester==
So far (2011-07-11), comments and keywords work just fine (though the 2.6 ones have not been added and the two comment types are highlighted differently). gp2c types work except :real which conflicts with the function of the same name. GP types do not work. Default keywords work except the two that conflict with functions, <code>simplify</code> and <code>log.</code>. Embedded quotes and even string context work just fine. Operators are not highlighted, which means I don't have to care about special ones like <code>\/</code>.
<lang parigp>fibonacci(9) \\ Is it working at all?

Default keywords and types are highlighted outside their proper context, though this is probably not a big deal.

<lang parigp>fibonacci(9) /* Is it working at all? */
ellheegner(ellinit([0, -1, 1, -33, 93])) \\ Do the 2.6.x functions work?
ellheegner(ellinit([0, -1, 1, -33, 93])) \\ Do the 2.6.x functions work?
myFunc(x:real, y:mp, z:int)=[x,y,z]; \\ gp2c types, including one that conflicts with a function
myFunc(x:real, y:mp, z:int)=[x,y,z]; \\ gp2c types, including one that conflicts with a function
realprecision=mp+7; \\ should not be highlighted
whatType(x)=if(type(x)=="t_INT", "integer", "something else") \\ GP types
whatType(x)=if(type(x)=="t_INT", "integer", "something else") \\ GP types
default(realprecision, 29); \\ defaults
default(realprecision, 29); \\ defaults
default(simplify, 1) \\ default that conflicts with a function
default(simplify, 1) \\ default that conflicts with a function
trap(gdiver, "tried to divide by 0", 1/0) \\ error type
trap(gdiver, "tried to divide by 0", 1/0) \\ error type
"this is a string with embedded \"quotes\""
"this is a string with embedded \"quotes\""andavariable" in the middle" \\ string context, embedded "
100 \ 9 *4 / 3 + 1 - 2 \\ are operators highlighted equally, even integer division?
100 \ 9 *4 / 3 + 1 - 2 \\ are operators highlighted equally, even integer division?
100\9\/3 \/ 1 \\ what about without spaces, or the unusual \/ operator?
100\9\/3 \/ 1 \\ what about without spaces, or the unusual \/ operator?
n=[1,2][9^9%2+1] \\ other operators
n=[1,2][9^9%2+1] \\ other operators
(a && b) || (c && d);
(a && b) || (c && d);
for(i=1,9,);</lang>
for(i=1,9,variable_with_underscore);
Mod(3,9).mod \\ member function</lang>

Revision as of 06:52, 11 July 2011

My Favorite Languages
Language Proficiency
BASIC out of practice
C advanced
C++ out of practice
C# advanced
Forth beginner
Java out of practice
JavaScript advanced
LabVIEW beginner
LaTeX advanced
Mathematica beginner
MATLAB out of practice
MySQL intemediate
PARI/GP advanced
Perl intermediate
PHP beginner
Scheme beginner
UNIX Shell intermediate
VBScript out of practice
Visual Basic out of practice

My tasks

I occasionally create tasks, usually with some reference implementation in a reasonably-common language like C, Perl, or JavaScript.

GeSHi tester

So far (2011-07-11), comments and keywords work just fine (though the 2.6 ones have not been added and the two comment types are highlighted differently). gp2c types work except :real which conflicts with the function of the same name. GP types do not work. Default keywords work except the two that conflict with functions, simplify and log.. Embedded quotes and even string context work just fine. Operators are not highlighted, which means I don't have to care about special ones like \/.

Default keywords and types are highlighted outside their proper context, though this is probably not a big deal.

<lang parigp>fibonacci(9) /* Is it working at all? */ ellheegner(ellinit([0, -1, 1, -33, 93])) \\ Do the 2.6.x functions work? myFunc(x:real, y:mp, z:int)=[x,y,z]; \\ gp2c types, including one that conflicts with a function realprecision=mp+7; \\ should not be highlighted whatType(x)=if(type(x)=="t_INT", "integer", "something else") \\ GP types default(realprecision, 29); \\ defaults default(simplify, 1) \\ default that conflicts with a function trap(gdiver, "tried to divide by 0", 1/0) \\ error type "this is a string with embedded \"quotes\""andavariable" in the middle" \\ string context, embedded " 100 \ 9 *4 / 3 + 1 - 2 \\ are operators highlighted equally, even integer division? 100\9\/3 \/ 1 \\ what about without spaces, or the unusual \/ operator? n=[1,2][9^9%2+1] \\ other operators (a && b) || (c && d); for(i=1,9,variable_with_underscore); Mod(3,9).mod \\ member function</lang>