/usr/share/jed/lib/pscript.sl is in jed-common 1:0.99.19-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | % This is a simple PostScript mode. It just implements a highlighting
% scheme.
% Note that PostScript considers any set of matched parentheses to be a
% valid string. This cannot easily be matched by DFA-based methods, so
% the highlighting scheme here simply deals with *one* set of inner
% parentheses. Hence (asd(df)df) is a valid string under these rules,
% but (sdf(df(sdf)sdf)sdf) contains more nested parentheses than we can
% cope with here.
$1 = "PostScript";
create_syntax_table ($1);
define_syntax ("%", "", '%', $1);
define_syntax ("([{", ")]}", '(', $1);
%define_syntax ('"', '"', $1); %ps
%define_syntax ('\'', '"', $1); %ps
define_syntax ('\\', '\\', $1);
define_syntax ("$0-9a-zA-Z_", 'w', $1); % words
define_syntax ("-+0-9a-fA-F.xXL", '0', $1); % Numbers
define_syntax (",.?:", ',', $1);
%define_syntax ("%-+/&*=<>|!~^", '+', $1); %
define_syntax ("%-+&*=<>|!~^", '+', $1); %ps
define_syntax ('/', '\\', $1); %ps
define_syntax ('@', '#', $1);
%set_syntax_flags ($1, 1); % case insensitive
set_syntax_flags ($1, 8); %?
#ifdef HAS_DFA_SYNTAX
%%% DFA_CACHE_BEGIN %%%
private define setup_dfa_callback (name)
{
dfa_enable_highlight_cache ("pscript.dfa", name);
dfa_define_highlight_rule("%.*$", "comment", name);
dfa_define_highlight_rule("[\\-\\+]?[0-9]*\\.?[0-9]+([Ee][\\-\\+]?[0-9]*)?",
"number", name);
dfa_define_highlight_rule("[0-9]+#[0-9A-Za-z]*", "number", name);
dfa_define_highlight_rule(strcat("\\((\\\\.|[^\\(\\)\\\\]|",
"\\(([^\\\\\\(\\)]|\\\\.)*\\))*\\)"),
"string", name);
dfa_define_highlight_rule(strcat("\\((\\\\.|[^\\(\\)\\\\]|\\(([^\\\\\\(\\)]|\\\\",
".)*\\))*(\\(([^\\\\\\(\\)]|\\\\.)*)?\\\\?$"),
"string", name);
dfa_define_highlight_rule(strcat("^(([^\\\\\\(\\)]|\\\\.)*\\))?(\\\\.|[^\\(\\)",
"\\\\]|\\(([^\\\\\\(\\)]|\\\\.)*\\))*\\)"),
"string", name);
dfa_define_highlight_rule("<[ \t0-9a-fA-F]*>", "string", name);
dfa_define_highlight_rule("<[ \t0-9a-fA-F]*$", "string", name);
dfa_define_highlight_rule("^[ \t0-9a-fA-F]*>", "Qstring", name);
dfa_define_highlight_rule("<~[ \t!-u]*~>", "string", name);
dfa_define_highlight_rule("<~[ \t!-u]*~?$", "string", name);
dfa_define_highlight_rule("^[ \t!-u]*~>", "Qstring", name);
dfa_define_highlight_rule("[!-\\$&'\\*-\\.0-;=\\?-Z\\\\\\^-z\\|~]+",
"Knormal", name);
dfa_define_highlight_rule("//?[!-\\$&'\\*-\\.0-;=\\?-Z\\\\\\^-z\\|~]+",
"normal", name);
dfa_define_highlight_rule("<<|>>|\\[|\\]|{|}", "Qdelimiter", name);
dfa_define_highlight_rule(".", "normal", name);
dfa_build_highlight_table (name);
}
dfa_set_init_callback (&setup_dfa_callback, "PostScript");
%%% DFA_CACHE_END %%%
#endif
% All words in PostScript are of course redefinable. So we will simply
% define as keywords the *really* basic ones. These are basic language
% operators.
()=define_keywords ($1, "=", 1);
()=define_keywords ($1, "==eqgegtiflelnltneor", 2);
()=define_keywords ($1, strcat("absaddandcoscvicvncvrcvscvxdefdivdupendexpfor",
"getlogmodmulnegnotpopputrunsinsrtsubxor"), 3);
()=define_keywords ($1, strcat("atancopycopycvrsdictexchexecexitfileidivload",
"loopmarkquitrandreadrollsavestoptruetype"), 4);
()=define_keywords ($1, strcat("aloadarraybeginclearcountcvlitfalsefloorindex",
"knownroundrrandsrandstackstoreundefwherewrite"),
5);
()=define_keywords ($1, "astoreforallgstateifelselengthpstackrepeatstring", 6);
()=define_keywords ($1, "ceilingrestore", 7);
()=define_keywords ($1, "truncate", 8);
()=define_keywords ($1, strcat("counttomarkcurrentfilegetintervalpackedarray",
"putinterval"), 11);
% And these are basic graphical operators.
()=define_keywords_n ($1, "arc", 3, 1);
()=define_keywords_n ($1, "arcnarctclipfillshow", 4, 1);
()=define_keywords_n ($1, "arctogsaveimagescale", 5, 1);
()=define_keywords_n ($1, "concateoclipeofilllinetomatrixmovetorotatestroke",
6, 1);
()=define_keywords_n ($1, "curvetonewpathrlinetormovetosetdashsetfontsetgray",
7, 1);
()=define_keywords_n ($1, "findfontgrestoremakefontrcurvetosetcolorshowpage",
8, 1);
()=define_keywords_n ($1, "closepathscalefontsetmatrixtransformtranslate", 9, 1);
()=define_keywords_n ($1, "definefontsetlinecapsetpattern", 10, 1);
()=define_keywords_n ($1, strcat("currentdashcurrentfontcurrentgraysethsbcolor",
"setlinejoinsetrgbcolor"), 11, 1);
()=define_keywords_n ($1, "currentcolorsetcmykcolorsetlinewidth", 12, 1);
()=define_keywords_n ($1, "currentmatrix", 13, 1);
()=define_keywords_n ($1, "currentlinecapcurrentpattern", 14, 1);
()=define_keywords_n ($1, "currenthsbcolorcurrentlinejoincurrentrgbcolor",
15, 1);
()=define_keywords_n ($1, "currentcmykcolorcurrentlinewidth", 16, 1);
define ps_mode ()
{
variable ps = "PostScript";
set_mode(ps, 0);
use_syntax_table (ps);
run_mode_hooks("ps_mode_hook");
}
|