diff --git a/README.md b/README.md index df7e0f14c..9ddbcfe11 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ L | Lighttpd configuration file, LLVM, Lua M | Mako, markdown, Mason, Mathematica, Matlab, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL N | NASM, Newspeak, Nginx configuration file, Nim, Nix O | Objective-C, OCaml, Octave, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode -P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerShell, Prolog, PromQL, Properties, Protocol Buffer, Puppet, Python 2, Python +P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerShell, Prolog, PromQL, Properties, Protocol Buffer, PSL, Puppet, Python 2, Python Q | QBasic R | R, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Smalltalk, Smarty, Snobol, Solidity, SPARQL, SQL, SquidConf, Standard ML, Stylus, Svelte, Swift, SYSTEMD, systemverilog diff --git a/lexers/embedded/psl.xml b/lexers/embedded/psl.xml new file mode 100644 index 000000000..93b24d2e9 --- /dev/null +++ b/lexers/embedded/psl.xml @@ -0,0 +1,126 @@ + + + PSL + psl + *.psl + *.BATCH + *.TRIG + *.PROC + text/x-psl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/lexers/testdata/psl.actual b/lexers/testdata/psl.actual new file mode 100644 index 000000000..9d948f735 --- /dev/null +++ b/lexers/testdata/psl.actual @@ -0,0 +1,13 @@ +public Number SumMethod() { + // this is a comment + type public Number x + set x = 10.0 + type String thisIsAString = "this"_x_"conjoined" + type String i = "" + for set i = ^UTBL("test",i).order() quit:i.isNull() { + set x = x + i + } + set x = x + $$getMore^ProcedureName("AAA") + do finishTask(x, "AAA") + + quit \ No newline at end of file diff --git a/lexers/testdata/psl.expected b/lexers/testdata/psl.expected new file mode 100644 index 000000000..7e84b5c20 --- /dev/null +++ b/lexers/testdata/psl.expected @@ -0,0 +1,478 @@ +[ + { + "type": "KeywordDeclaration", + "value": "public" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "KeywordType", + "value": "Number" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "SumMethod" + }, + { + "type": "Punctuation", + "value": "()" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Punctuation", + "value": "{" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "CommentSingle", + "value": "// this is a comment" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "KeywordDeclaration", + "value": "type" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "KeywordDeclaration", + "value": "public" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "NameClass", + "value": "Number" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "Keyword", + "value": "set" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "=" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "LiteralNumber", + "value": "10.0" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "KeywordDeclaration", + "value": "type" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "NameClass", + "value": "String" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "thisIsAString" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "=" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "LiteralString", + "value": "\"this\"" + }, + { + "type": "Operator", + "value": "_" + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Operator", + "value": "_" + }, + { + "type": "LiteralString", + "value": "\"conjoined\"" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "KeywordDeclaration", + "value": "type" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "NameClass", + "value": "String" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "i" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "=" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "LiteralString", + "value": "\"\"" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "Keyword", + "value": "for" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Keyword", + "value": "set" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "i" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "=" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "^UTBL" + }, + { + "type": "Punctuation", + "value": "(" + }, + { + "type": "LiteralString", + "value": "\"test\"" + }, + { + "type": "Punctuation", + "value": "," + }, + { + "type": "Name", + "value": "i" + }, + { + "type": "Punctuation", + "value": ")" + }, + { + "type": "Operator", + "value": "." + }, + { + "type": "NameFunction", + "value": "order" + }, + { + "type": "Punctuation", + "value": "()" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Keyword", + "value": "quit" + }, + { + "type": "Operator", + "value": ":" + }, + { + "type": "Name", + "value": "i" + }, + { + "type": "Operator", + "value": "." + }, + { + "type": "NameFunction", + "value": "isNull" + }, + { + "type": "Punctuation", + "value": "()" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Punctuation", + "value": "{" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "Keyword", + "value": "set" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "=" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "+" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "i" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "Punctuation", + "value": "}" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "Keyword", + "value": "set" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "=" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "Operator", + "value": "+" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "NameFunction", + "value": "$$getMore" + }, + { + "type": "NameClass", + "value": "^ProcedureName" + }, + { + "type": "Punctuation", + "value": "(" + }, + { + "type": "LiteralString", + "value": "\"AAA\"" + }, + { + "type": "Punctuation", + "value": ")" + }, + { + "type": "Text", + "value": "\n " + }, + { + "type": "KeywordReserved", + "value": "do" + }, + { + "type": "Text", + "value": " " + }, + { + "type": "NameFunction", + "value": "finishTask" + }, + { + "type": "Punctuation", + "value": "(" + }, + { + "type": "Name", + "value": "x" + }, + { + "type": "Punctuation", + "value": "," + }, + { + "type": "Text", + "value": " " + }, + { + "type": "LiteralString", + "value": "\"AAA\"" + }, + { + "type": "Punctuation", + "value": ")" + }, + { + "type": "Text", + "value": "\n\n " + }, + { + "type": "Keyword", + "value": "quit" + } +] \ No newline at end of file