1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-03-17 20:58:08 +02:00

Add Language Igor (#276)

* Add Language Igor

Igor is a scientific language developed by
[WaveMetrics](https://www.wavemetrics.com/).

This lexer was translated directly from the [pygments
lexer](http://pygments.org/docs/lexers/#lexers-for-igor-pro) without any
changes. The pygments lexer is very basic but working properly for most
of the cases.
This commit is contained in:
matthias 2019-09-23 01:35:48 +02:00 committed by Alec Thomas
parent d122d30d7b
commit 8eb6aa7fb6
3 changed files with 226 additions and 0 deletions

32
lexers/i/igor.go Normal file

File diff suppressed because one or more lines are too long

24
lexers/testdata/igor.actual vendored Normal file
View File

@ -0,0 +1,24 @@
#pragma rtGlobals=3
#include "someFile"
StrConstant myConstString="abcd"
// some comment
Constant myConst=123
static Structure struct1
string str
variable var
EndStructure
Function/WAVE myFunction(var)
Variable var
Make/N=(var) test
return test
End
#ifdef NOT_DEFINED
// conditional compilation
#endif

170
lexers/testdata/igor.expected vendored Normal file
View File

@ -0,0 +1,170 @@
[
{
"type": "NameDecorator",
"value": "#pragma"
},
{
"type": "Text",
"value": " rtGlobals=3\n\n"
},
{
"type": "NameDecorator",
"value": "#include"
},
{
"type": "Text",
"value": " "
},
{
"type": "LiteralString",
"value": "\"someFile\""
},
{
"type": "Text",
"value": "\n\n"
},
{
"type": "KeywordType",
"value": "StrConstant"
},
{
"type": "Text",
"value": " myConstString="
},
{
"type": "LiteralString",
"value": "\"abcd\""
},
{
"type": "Text",
"value": "\n"
},
{
"type": "CommentSingle",
"value": "// some comment"
},
{
"type": "Text",
"value": "\n"
},
{
"type": "KeywordType",
"value": "Constant"
},
{
"type": "Text",
"value": " myConst=123\n\n"
},
{
"type": "KeywordReserved",
"value": "static"
},
{
"type": "Text",
"value": " "
},
{
"type": "KeywordReserved",
"value": "Structure"
},
{
"type": "Text",
"value": " struct1\n\t"
},
{
"type": "KeywordType",
"value": "string"
},
{
"type": "Text",
"value": " str\n\t"
},
{
"type": "KeywordType",
"value": "variable"
},
{
"type": "Text",
"value": " var\n"
},
{
"type": "KeywordReserved",
"value": "EndStructure"
},
{
"type": "Text",
"value": "\n\n"
},
{
"type": "KeywordReserved",
"value": "Function"
},
{
"type": "Text",
"value": "/"
},
{
"type": "KeywordType",
"value": "WAVE"
},
{
"type": "Text",
"value": " myFunction(var)\n\t"
},
{
"type": "KeywordType",
"value": "Variable"
},
{
"type": "Text",
"value": " var\n\n\t"
},
{
"type": "NameClass",
"value": "Make"
},
{
"type": "Text",
"value": "/N=(var) test\n\n\t"
},
{
"type": "Keyword",
"value": "return"
},
{
"type": "Text",
"value": " test\n"
},
{
"type": "KeywordReserved",
"value": "End"
},
{
"type": "Text",
"value": "\n\n"
},
{
"type": "NameDecorator",
"value": "#ifdef"
},
{
"type": "Text",
"value": " NOT_DEFINED\n\t"
},
{
"type": "CommentSingle",
"value": "// conditional compilation"
},
{
"type": "Text",
"value": "\n"
},
{
"type": "NameDecorator",
"value": "#endif"
},
{
"type": "Text",
"value": "\n"
}
]