diff --git a/Modes/PostScript.seemode/Contents/Info.plist b/Modes/PostScript.seemode/Contents/Info.plist new file mode 100644 index 00000000..0c3a1530 --- /dev/null +++ b/Modes/PostScript.seemode/Contents/Info.plist @@ -0,0 +1,20 @@ + + + + + CFBundleIdentifier + SEEMode.PostScript + CFBundleName + PostScript + NSHumanReadableCopyright + © 2025 seriot.ch + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1.0 + SEEMinimumEngineVersion + 4.0 + CFBundleInfoDictionaryVersion + 6.0 + + diff --git a/Modes/PostScript.seemode/Contents/Resources/AutocompleteAdditions.txt b/Modes/PostScript.seemode/Contents/Resources/AutocompleteAdditions.txt new file mode 100644 index 00000000..e69de29b diff --git a/Modes/PostScript.seemode/Contents/Resources/ExampleSyntax.txt b/Modes/PostScript.seemode/Contents/Resources/ExampleSyntax.txt new file mode 100644 index 00000000..88c198b8 --- /dev/null +++ b/Modes/PostScript.seemode/Contents/Resources/ExampleSyntax.txt @@ -0,0 +1,11 @@ +% A Brainfuck interpreter written in PostScript +% 2023-12-05 Nicolas Seriot https://github.com/nst/bfps + +/P (+[-[<<[+[--->]-[<<<]]]>>>-]>-.-- -.>..>.<<<<-.<+.>>>>>.>.<<.<-.) def + +/d{def}def/p 0 d/_{/p p 1 add d}d/C{P p 1 getinterval}d/M 30000 string d/m 0 d +/V{M m get}d{p P length ge{exit}if C(+)eq{M m V 1 add 255 and put}if C(-)eq{M m +V 1 sub 255 and put}if C(>)eq{/m m 1 add d}if C(<)eq{/m m 1 sub d}if C([)eq{p V +0 eq{mark{C([)eq{0}if C(])eq{pop}if counttomark 0 eq{pop exit}if _}loop}if}if C +(])eq{/x exch d V 0 ne{/p x d p}if}if C(.)eq{/s 1 string d s 0 V put s ==}if +C(,)eq{/f(%lineedit)(r)file d f read pop M m 3 -1 roll put}if _}loop diff --git a/Modes/PostScript.seemode/Contents/Resources/ModeSettings.xml b/Modes/PostScript.seemode/Contents/Resources/ModeSettings.xml new file mode 100644 index 00000000..36548aa2 --- /dev/null +++ b/Modes/PostScript.seemode/Contents/Resources/ModeSettings.xml @@ -0,0 +1,13 @@ + + + + ps + \A%PS\! + + + + + + + + diff --git a/Modes/PostScript.seemode/Contents/Resources/PostScript.sss b/Modes/PostScript.seemode/Contents/Resources/PostScript.sss new file mode 100644 index 00000000..64b606c7 --- /dev/null +++ b/Modes/PostScript.seemode/Contents/Resources/PostScript.sss @@ -0,0 +1,523 @@ +/* Nicolas Seriot https://seriot.ch/ */ + +/* Comments */ +/* +comment.block +comment.block.documentation.tag +comment.line +comment.line.double-dash +comment.line.double-slash +comment.line.number-sign +*/ + +comment { + color:#236e25; + font-style:italic; +} + + +comment.line { +} + +comment.block.documentation { + color:#236e25; + font-weight:bold; +} + +comment.block.documentation.tag { + color:#123a13; +} + +/* Keywords */ +/* +keyword.class +keyword.control.definition +keyword.directive +keyword.variable.global +*/ + +keyword { + color:#5b2a96; + font-weight:bold; +} + +keyword.constant { + color:#0000ff; + font-style:italic; +} + +keyword.control { + color:#a71790; + font-weight:bold; +} + +keyword.property-key.css { + color:#881350; + font-style:italic; + font-weight:normal; +} + +keyword.type { + font-weight:normal; +} + +/* Language */ +/* +language.constant.numeric +language.constant.numeric.preprocessor +language.operator +language.operator.special +language.preprocessor +language.property +language.record +language.variable.string +*/ + +language.constant { + color:#0000ff; +} + +language.operator { + color:#AA3E9D; +} + + +language.constant.numeric.character { + color:#0000ff; + font-style:italic; + font-underline:none; + font-weight:bold; +} + +language.preprocessor { + color:#78492A; +} + +language.subroutine { + color:#003668; +} + +language.subroutine.method { + color:#2d136c; +} + +language.struct.record { + color:#2d136c; + font-weight:bold; +} + +language.variable { + color:#9c5300; +} + +language.variable.class { + color:#008c8c; +} + +language.variable.global { + color:#8a578f; +} + +language.variable.instance { + color:#c94b16; +} + +language.declaration.subroutine { + font-style:italic; +} + + +/* Markup */ +/* +markup.declaration.string.double +markup.declaration.string.single +markup.tag.attribute.value +*/ + +markup.comment { + color:#236e25; +} + +markup.constant.entity { + color:#227799; +} + +markup.declaration { + color:#236e25; +} + +markup.declaration.string { + font-underline:underline; +} + +markup.inline.cdata { + color:#ff0300; +} + +markup.processing { + color:#236e25; + font-style:italic; +} + +markup.processing.attribute.value { + font-underline:underline; +} + +markup.processing.languageswitch { + color:#ff0000; + font-weight:bold; +} + +markup.tag { + color:#89237f; +} + +markup.tag.attribute.name { + color:#9d4503; +} + +markup.tag.attribute.value.string { + color:#022aa5; +} + +/* Meta Scopes */ +/* +meta.block +meta.block.attribute +meta.block.begin +meta.block.create-table +meta.block.css +meta.block.curly +meta.block.directives +meta.block.percentagestring.unescapedbracketrecursive.angle +meta.block.percentagestring.unescapedbracketrecursive.bracket +meta.block.percentagestring.unescapedbracketrecursive.curly +meta.block.percentagestring.unescapedbracketrecursive.parentheses +meta.block.square +meta.block.tag.php +meta.block.tag.php.no-content +meta.important.memorymanagement +meta.invalid.ampersand +meta.invalid.sgmlcomment +meta.link.email +meta.link.portion +meta.state +meta.tag.erbstart +meta.tag.preprocessor +*/ + +meta.block.interpolation { + color:#3e5f5e; +} + +meta.default { + background-color:#ffffff; + color:#000000; + font-weight : normal; + font-style : normal; +} + +meta.highlight.currentline { + background-color:#fbffb2; +} + +meta.important { + color:#ff1800; +} + +meta.invalid { + color:#ff0000; + font-weight:bold; +} + +meta.invisible.character { + color:#aaaaaa; + font-style:normal; + font-weight:normal; +} + +meta.link { + color:#0000ff; + font-underline:underline; +} + +meta.preprocessor.nowiki { + color : #4b4b4b; + font-weight : bold; +} + +/* Strings */ +/* +string.angle +string.array.percent +string.array.percent.angle +string.array.percent.bracket +string.array.percent.curly +string.array.percent.parentheses +string.double +string.double.openstep +string.exec.backtick +string.exec.percentx +string.exec.percentx.angle +string.exec.percentx.bracket +string.exec.percentx.curly +string.exec.percentx.parentheses +string.here-doc +string.here-doc.intended +string.percentage +string.percentage.angle +string.percentage.bracket +string.percentage.curly +string.percentage.parentheses +string.regex.percentage +string.regex.percentage.angle +string.regex.percentage.bracket +string.regex.percentage.curly +string.regex.percentage.parentheses +string.single +string.single.backtick +string.symbol.percent +string.symbol.percent.angle +string.symbol.percent.bracket +string.symbol.percent.curly +string.symbol.percent.parentheses +*/ + +string { + color:#f4181b; +} + +string.exec { + color:#bd1814; +} + +string.regex { + color:#c607d3; +} + +string.symbol { + color:#d6771c; +} + +/* Structured */ +/* +structured.comment +structured.quote +structured.anchor +structured.math +*/ + +structured.bold { + font-weight : bold; + font-style : normal; +} + +structured.changes.added { + color : #549a18; + font-weight : normal; + font-style : italic; +} + +structured.changes.deleted { + color : #b82314; + font-weight : normal; + font-style : italic; +} + +structured.changes.modified { + color : #a57e24; + font-weight : normal; + font-style : italic; +} + +structured.changes.replaced { + color : #c16024; + font-weight : bold; + font-style : italic; +} + +structured.changes.revision { + color : #001bbb; + font-weight : bold; + font-style : normal; +} + +structured.changes.user { + color : #1444b4; + font-weight : bold; + font-style : normal; +} + +structured.emphasis { + color : #000; + font-weight : bold; + font-style : italic; +} + +structured.event { + color : #333; + font-style : italic; +} + +structured.footnote { + color : #236e25; +} + +structured.heading { + color : #8f6d00; + font-weight : bold; + font-style : normal; +} + +structured.heading.1 { + color : #881350; + font-weight : bold; +} + +structured.heading.2 { + color : #970058; + font-weight : bold; +} + +structured.heading.3 { + color : #a70062; + font-weight : bold; +} + +structured.heading.4 { + color : #b20068; + font-weight : bold; +} + +structured.heading.5 { + color : #be006f; + font-weight : bold; +} + +structured.italic { + font-weight : normal; + font-style : italic; +} + +structured.italicbold { + font-weight : bold; + font-style : italic; +} + +structured.list.numbered { + color : #7a4022; +} + +structured.list.unnumbered { + color : #683821; +} + +structured.quote.even { + color : #1b5414; +} + +structured.quote.odd { + color : #7b1e20; +} + +structured.raw.code { + color : #4b4b4b; +} + +structured.raw.indented { + color : #4b4b4b; +} + +structured.reference { + color : #222255; +} + +structured.section { + color : #a61a1a; + font-weight : bold; +} + +structured.separator.horizontal { + color : #555555; + font-weight : bold; + font-style : normal; +} + +structured.separator.vertical { + color : #696969; + font-weight : normal; + font-style : normal; +} + +structured.tool-tip { + color : #076e09; + font-weight : normal; + font-style : italic; +} + +structured.variable { + color : #881280; +} + +/* Styles */ +/* +style.comment +style.comment.block.documentation +style.property.name +style.value +style.value.color.rgb-value +style.value.string.double +style.value.string.single +*/ + +style.at-rule { + color:#6a3820; + font-style:italic; + font-weight:bold; +} + +style.comment.block { + color:#216a26; +} + +style.property.name { + color:#88134f; +} + +style.value.color { + color:#791314; +} + +style.value.keyword { + color:#9e4403; +} + +style.value.numeric { + color:#0000ff; +} + +style.value.string { + color:#791314; +} + +/* Language Support */ +/* +support.accessor +support.class +support.class.standard +support.class.standard.cocoa +support.constant.cocoa +support.type.cocoa +*/ + +support { + color:#5b2a96; +} + +support.constant { + font-style:italic; +} + +support.type { + font-style:italic; +} diff --git a/Modes/PostScript.seemode/Contents/Resources/RegexSymbols.xml b/Modes/PostScript.seemode/Contents/Resources/RegexSymbols.xml new file mode 100644 index 00000000..3e22c339 --- /dev/null +++ b/Modes/PostScript.seemode/Contents/Resources/RegexSymbols.xml @@ -0,0 +1,30 @@ + + + + + + { + } + + + + .*?/([A-Za-z0-9_!=]+)\s*\{ + + + + (% TODO:.*) + + % TODO:(.*) + \1 + + + + + (% FIXME:.*) + + % FIXME:(.*) + \1 + + + + diff --git a/Modes/PostScript.seemode/Contents/Resources/SyntaxDefinition.xml b/Modes/PostScript.seemode/Contents/Resources/SyntaxDefinition.xml new file mode 100644 index 00000000..341b410d --- /dev/null +++ b/Modes/PostScript.seemode/Contents/Resources/SyntaxDefinition.xml @@ -0,0 +1,449 @@ + + + + PostScript + + + + + + + + + + (?<![\w\d_])((?:[+-]?(?:(?:[0-9]+\.[0-9]*)|(?:\.[0-9]+))(?:[eE][+\-]?[0-9]+)?[fFlL]?)|(?:(?:(?:[1-9][0-9]*)|0[0-7]*|(?:0[xX][0-9a-fA-F]+))(?:(?:[uU][lL]?)|(?:[lL][uU]?))?))(?![\w\d_]) + + + + + % + [\n\r] + + + + + + \( + \) + + + + + + + + (/[A-Za-z0-9_!=\-]+)\s* + + + + {} + } + + + + + + = + == + flushpage= + + + + + + << + >> + + exec + if + ifelse + repeat + for + forall + loop + exit + stop + put + putinterval + def + + + + + abs + add + aload + anchorsearch + and + arc + arcn + arct + arcto + array + ashow + astore + atan + awidthshow + begin + bind + bitshift + bytesavailable + cachestatus + ceiling + charpath + clear + cleartomark + cleardictstack + clip + clippath + closefile + closepath + colorimage + concat + concatmatrix + condition + configurationerror + copy + copypage + cos + count + countdictstack + countexecstack + counttomark + cshow + currentblackgeneration + currentcacheparams + currentcmykcolor + currentcolor + currentcolorrendering + currentcolorscreen + currentcolorspace + currentcolortransfer + currentcontext + currentdash + currentdevparams + currentdict + currentfile + currentflat + currentfont + currentglobal + currentgray + currentgstate + currenthalftone + currenthalftonephase + currenthsbcolor + currentlinecap + currentlinejoin + currentlinewidth + currentmatrix + currentmiterlimit + currentobjectformat + currentpacking + currentpagedevice + currentpoint + currentrgbcolor + currentscreen + currentshared + currentstrokeadjust + currentsystemparams + currenttransfer + currentundercolorremoval + currentuserparams + curveto + cvi + cvlit + cvn + cvr + cvrs + cvs + cvx + defaultmatrix + definefont + defineresource + defineusername + defineuserobject + deletefile + detach + deviceinfo + dict + dictfull + dictstack + dictstackoverflow + dictstackunderflow + div + dtransform + dup + echo + eexec + end + eoclip + eofill + eoviewclip + eq + erasepage + errordict + exch + execform + execstack + execstackoverflow + execuserobject + executeonly + executive + exp + false + file + filenameforall + fileposition + fill + filter + findencoding + findfont + findresource + flattenpath + floor + flush + flushfile + flushpage + FontDirectory + fork + ge + get + getinterval + globaldict + GlobalFontDirectory + glyphshow + grestore + grestoreall + gsave + gstate + gt + handleerror + identmatrix + idiv + idtransform + image + imagemask + index + ineofill + infill + initclip + initgraphics + initmatrix + initviewclip + instroke + internaldict + interrupt + inueofill + inufill + inustroke + invalidaccess + invalidcontext + invalidexit + invalidfileaccess + invalidfont + invalidid + invalidrestore + invertmatrix + ioerror + ISOLatin1Encoding + itransform + join + kshow + known + languagelevel + le + length + limitcheck + lineto + ln + load + lock + log + lt + makefont + makepattern + mark + matrix + maxlength + mod + monitor + moveto + mul + ne + neg + newpath + noaccess + nocurrentpoint + not + notify + null + nulldevice + or + packedarray + pathbbox + pathforall + pop + print + printobject + product + prompt + pstack + quit + rand + rangecheck + rcurveto + read + readhexstring + readline + readonly + readstring + realtime + rectclip + rectfill + rectstroke + rectviewclip + renamefile + resetfile + resourceforall + resourcestatus + restore + reversepath + revision + rlineto + rmoveto + roll + rootfont + rotate + round + rrand + run + save + scale + scalefont + scheck + search + selectfont + serialnumber + setbbox + setblackgeneration + setcachedevice + setcachedevice2 + setcachelimit + setcacheparams + setcharwidth + setcmykcolor + setcolor + setcolorrendering + setcolorscreen + setcolorspace + setcolortransfer + setdash + setdevparams + setfileposition + setflat + setfont + setglobal + setgray + setgstate + sethalftone + sethalftonephase + sethsbcolor + setlinecap + setlinejoin + setlinewidth + setmatrix + setmiterlimit + setobjectformat + setoverprint + setpacking + setpagedevice + setpattern + setrgbcolor + setscreen + setshared + setstrokeadjust + setsystemparams + settransfer + setucacheparams + setundercolorremoval + setuserparams + setvmthreshold + shareddict + show + showpage + sin + sqrt + srand + stack + stackoverflow + stackunderflow + StandardEncoding + start + startjob + status + statusdict + stopped + store + string + stringwidth + stroke + strokepath + sub + syntaxerror + systemdict + timeout + transform + translate + true + truncate + type + typecheck + token + uappend + ucache + ucachestatus + ueofill + ufill + undef + undefined + undefinedfilename + undefineresource + undefinedresult + undefinefont + undefineresource + undefinedresource + undefineuserobject + unmatchedmark + unregistered + upath + userdict + UserObjects + usertime + ustroke + ustrokepath + version + viewclip + viewclippath + VMerror + vmreclaim + vmstatus + wait + wcheck + where + widthshow + write + writehexstring + writeobject + writestring + wtranslation + xcheck + xor + xshow + xyshow + yield + yshow + + + + + diff --git a/Modes/PostScript.seemode/Contents/Resources/readme.txt b/Modes/PostScript.seemode/Contents/Resources/readme.txt new file mode 100644 index 00000000..da45dbe7 --- /dev/null +++ b/Modes/PostScript.seemode/Contents/Resources/readme.txt @@ -0,0 +1,22 @@ +PostScript mode for SubEthaEdit +------------------------------- + +To install the mode, copy: + + PostScript.seemode + +into + + ~/Library/Containers/SubEthaEdit/Data/Library/Application\ Support/de.codingmonkeys.SubEthaEdit.Mac/Modes/ + +To install the optional stylesheet, copy: + + PostScript.sss + +into + + ~/Library/Containers/SubEthaEdit/Data/Library/Application\ Support/de.codingmonkeys.SubEthaEdit.Mac/Styles/ + +Nicolas Seriot +http://seriot.ch +February 2025 diff --git a/Modes/README.md b/Modes/README.md index 1d42c3ad..121336b2 100644 --- a/Modes/README.md +++ b/Modes/README.md @@ -7,6 +7,7 @@ Language | Version | Update Date | Comment | Author Dtrace ([zip](../../../raw/master/Modes/zipped/Dtrace.seemode.zip)) | 1.0.1 | 2014-06-24 | Mode for DTrace scripts | [tbartelmess](https://github.com/tbartelmess) SQL ([zip](../../../raw/master/Modes/zipped/SQL.seemode.zip)) | 4.0 | 2014-07-09 | SQL Mode - ported from built-in SEE 3 Mode | [ellduin](https://github.com/ellduin) Thrift ([zip](../../../raw/master/Modes/zipped/Thrift.seemode.zip)) | 1.0 | 2014-06-22 | Mode for Apache thrift | [tbartelmess](https://github.com/tbartelmess) + PostScript ([zip](../../../raw/master/Modes/zipped/PostScript.seemode.zip)) | 1.0 | 2025-04-05 | Mode for PostScript | [nst](https://github.com/nst) # SubEthaEdit 4 Modes (probably outdated) diff --git a/Modes/zipped/PostScript.seemode.zip b/Modes/zipped/PostScript.seemode.zip new file mode 100644 index 00000000..10d716ef Binary files /dev/null and b/Modes/zipped/PostScript.seemode.zip differ