|
From: <ch...@us...> - 2004-02-19 22:18:07
|
Update of /cvsroot/fte/fte/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11156 Modified Files: global.fte main.fte m_c.fte m_diff.fte m_perl.fte m_tcl.fte Added Files: m_gawk.fte Log Message: Applied patch #740805. This updates several configuration files and adds gawk support. --- NEW FILE: m_gawk.fte --- # # FTE highlighting rules for GAWK/AWK scripts # # Contributor: Wirawan Purwanto <wir...@so...> # Created: 4-Mar-2002 # Updated: 20-May-2002 # # The syntax highlighting is heavily biased toward GNU AWK. # # CAVEAT: The syntax highlighting for REGEX is not perfect at all: # ordinary divisions WILL be misunderstood as regex. Unless you have # divisions in your awk scripts (which is a kind of unlikely for typical # scripts), this should not be a big trouble. # # The original source code is m_gawk.src.fte. DO NOT EDIT FILE m_gawk.fte! # colorize GAWK { SyntaxParser = 'SIMPLE'; color { { 'Normal', 'Editor_Default' }, { 'Keyword', 'Editor_Keywords' }, { 'Number', 'Lang_DecimalNumber' }, { 'HexNumber', 'Lang_HexNumber' }, { 'Punctuation', 'Lang_Punctuation' }, { 'String', 'Lang_String' }, { 'Regexp', 'Lang_Regexp' }, { 'Comment', 'Lang_Comment' }, { 'CPreprocessor', 'Lang_Preprocessor' }, { 'Function', 'Lang_Function' }, { 'Label', 'Lang_Label' }, { 'Tag', 'Markup_Tag' }, }; keyword 'Editor_Keywords' { # any missing ? 'BEGIN', 'END', 'print', 'printf', 'delete', 'if', 'else', 'for', 'in', 'while', 'do', 'break', 'continue', 'next', 'nextfile', 'function', 'return', 'exit', 'getline', }; # Standard functions supplied bu AWK keyword 'Lang_Function' { # any missing ? # math-oriented: 'int', 'sqrt', 'exp', 'log', 'sin', 'cos', 'atan2', 'rand', 'srand', # string-oriented: 'index', 'length', 'match', 'split', 'sprintf', 'strtonum', 'sub', 'gsub', 'gensub', 'substr', 'tolower', 'toupper', # file i/o: 'open', 'close', 'fflush', 'system', # GAWK-specific extensions --------- # string-oriented: 'asort', # bit oriented: (AWK/GAWK???) 'and', 'or', 'xor', 'compl', 'lshift', 'rshift', # timestamp functions: 'systime', 'mktime', 'strftime', # internationalization 'dcgettext', 'bindtextdomain', }; # standard library procedure/function names # Standard variables supplied by AWK keyword 'Lang_Variable' { # built-in/special-meaning variables 'CONVFMT', 'FS', 'OFMT', 'OFS', 'ORS', 'RS', 'SUBSEB', 'ARGC', 'ARGV', 'ENVIRON', 'ERRNO', 'FILENAME', 'FNR', 'NF', 'NR', 'PROCINFO', 'RLENGTH', 'RSTART', # gawk specific 'BINMODE', 'FIELDWIDTH', 'IGNORECASE', 'LINT', 'TEXTDOMAIN', 'ARGIND', 'RT', }; # default state h_state 0 { 'Punctuation' } h_trans { 2, '-s', '_a-zA-Z', 'Normal' } h_trans { 6, '-s', '0-9', 'Normal' } h_trans { 3, '<', '#', 'Comment' } h_trans { 4, '<', '"', 'String' } # h_trans { 5, '<', '\'', 'String' } # metachar (except tab -- how to include it?) h_trans { 0, '', '$', 'CPreprocessor' } h_trans { 0, '$', '\\', 'Punctuation' } # literal char # h_trans { 1, '', '\\', 'Punctuation' } -- this is not recognized here! h_trans { 7, '<', '/', 'Keyword' } # h_trans { 0, 'S', '_a-zA-Z0-9', 'Punctuation' } # quote h_state 1 { 'String' } h_trans { 0, 'S', '', 'String' } h_trans { 0, '$', '', 'Normal' } # word h_state 2 { 'Normal' } h_wtype { -1, -1, -1, '', '_a-zA-Z0-9' } # end of a word h_trans { 0, '$', '', 'Normal' } h_trans { 0, '-S', '_a-zA-Z0-9', 'Normal' } # comment h_state 3 { 'Comment' } h_trans { 0, '$<', '', 'Normal' } # string ("-quoted) h_state 4 { 'String' } h_trans { 0, '>', '"', 'String' } h_trans { 4, '', '\\"', 'String' } h_trans { 4, '', '\\\\', 'String' } h_trans { 4, '$', '\\', 'Punctuation' } # not allowed in gawk/awk: ## string ('-quoted) h_state 5 { 'String' } h_trans { 0, '>', '\'', 'String' } h_trans { 5, '>', '\\\'', 'String' } h_trans { 5, '$', '\\', 'Punctuation' } # number h_state 6 { 'Number' } h_trans { 0, '-S', '.0-9', 'Normal' } h_trans { 0, '$', '', 'Normal' } # The regular-expression part: # regexp h_state 7 { 'Regexp' } h_trans { 8, '', '\\', 'Punctuation' } # regexp operators: h_trans { 7, 's', '^$.+*|()?', 'Punctuation' } h_trans { 9, '<', '[', 'Punctuation' } h_trans { 11,'<', '{', 'Punctuation' } h_trans { 0, '', '/', 'Keyword' } # h_trans { 12, '$>', '', 'Normal' } # literal quotation h_state 8 { 'Regexp' } h_trans { 7, 's', 'abfnrtv', 'Punctuation' } h_trans { 7, 'S', '', 'Regexp' } h_trans { 12, '$', '', 'Normal' } # grouping using [ ] h_state 9 { 'Regexp' } h_trans { 10, '', '\\', 'Punctuation' } h_trans { 9, '', '^', 'Punctuation' } h_trans { 9, '', '-', 'Punctuation' } h_trans { 7, '>', ']', 'Punctuation' } h_trans { 12, '$', '', 'Normal' } # regexpgroupquote h_state 10 { 'Regexp' } h_trans { 9, 's', 'abfnrtv', 'Punctuation' } h_trans { 9, 'S', '', 'Regexp' } h_trans { 12, '$', '', 'Normal' } # repeat count h_state 11 { 'Number' } h_trans { 11,'s', '0-9', 'Number' } h_trans { 11,'', ',', 'Punctuation' } h_trans { 7, '>', '}', 'Punctuation' } h_trans { 12, 'S', '', 'Normal' } h_trans { 12, '$', '', 'Normal' } # error h_state 12 { 'Tag' } # all the way to the end :-) } mode GAWK: PLAIN { # AWK mode with GNU extensions FirstLineRx = /^\#\![ ]*[^ ]*awk>/; FileNameRx = /\.\c{{AWK}|{GAWK}}$/; HilitOn = 1; Colorizer = 'GAWK'; AutoIndent = 1; IndentMode = 'PLAIN'; MatchCase = 1; Trim = 1; MultiLineHilit = 1; AutoHilitParen = 1; RoutineRegexp = /^\s*function\s+[A-Za-z_][A-Za-z_0-9]*\s*\(.*/; # RoutineRx ^\w[\w_:*&]+[\w\s_:*&]@\( # RoutineRx ^{[a-zA-Z0-9_:*&]#\s*}+\( SaveFolds = 2; # save fold info at end of line CommentStart = ' #'; CommentEnd = ''; } Index: global.fte =================================================================== RCS file: /cvsroot/fte/fte/config/global.fte,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- global.fte 3 Jun 2003 20:37:47 -0000 1.8 +++ global.fte 19 Feb 2004 22:07:21 -0000 1.9 @@ -84,6 +84,8 @@ CompileRx = { 1, 2, 3, /^([\w:._\-\+\/\\]+):(\d+):\s(.*)$/ }; # Borland C++ CompileRx = { 1, 2, 3, /^{Error}|{Warning}\s(\S+)\s(\d+):\s(.*)$/ }; +# Borland C++ 5.5 command line <wirawan0> + CompileRx = { 1, 2, 3, /^{Error E}|{Warning W}\d+\s(\S+)\s(\d+):\s(.*)$/ }; # CSet++ CompileRx = { 1, 2, 3, /^([\w:._\-\+\/\\]+)\((\d+):\d+\)(.*)$/ }; # Watcom C++ @@ -105,7 +107,12 @@ # Python interpreter tracebacks CompileRx = { 1, 2, 3, /^\s*File\s+"([\w:._\-\+\/\\]+)",\s+line\s+(\d+)(.*)$/ }; - + +# bash: <wirawan0> + CompileRx = { 1, 2, 3, /^([\w:._\-\/\\]+): line (\d+):\s(.*)$/ }; +# perl: <wirawan0> + CompileRx = { 2, 3, 1, /^(.*) at ([^ ]+) line ([0-9]+)/ }; + CvsIgnoreRx = /^cvs update: Updating /; CvsIgnoreRx = /^cvs server: Updating /; } Index: main.fte =================================================================== RCS file: /cvsroot/fte/fte/config/main.fte,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- main.fte 19 Feb 2004 21:27:10 -0000 1.15 +++ main.fte 19 Feb 2004 22:07:21 -0000 1.16 @@ -173,6 +173,7 @@ include 'm_ebnf.fte'; include 'm_fort90.fte'; include 'm_fte.fte'; +include 'm_gawk.fte'; include 'm_html.fte'; include 'm_idl.fte'; include 'm_ipf.fte'; Index: m_c.fte =================================================================== RCS file: /cvsroot/fte/fte/config/m_c.fte,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- m_c.fte 8 Jul 2003 13:29:53 -0000 1.5 +++ m_c.fte 19 Feb 2004 22:07:21 -0000 1.6 @@ -33,6 +33,11 @@ '__cdecl', '_export', '__pascal', '_stdcall', '_syscall', '__stdcall', '__syscall', '_fastcall', '__fastcall', '__export', 'bool', 'true', 'false', + # more C++ keywords + 'reinterpret_cast', 'static_cast', 'dynamic_cast', + 'const_cast', 'typeid', + # wide char (from new C/C++ 1998/1999 standards): + 'wchar_t', }; } Index: m_diff.fte =================================================================== RCS file: /cvsroot/fte/fte/config/m_diff.fte,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- m_diff.fte 20 Aug 2002 19:41:42 -0000 1.3 +++ m_diff.fte 19 Feb 2004 22:07:21 -0000 1.4 @@ -6,12 +6,15 @@ { 'Old', 'DIFF_Old' }, { 'New', 'DIFF_New' }, { 'Changed', 'DIFF_Changed' }, + { 'CPreprocessor', 'Lang_Preprocessor' }, }; h_state 0 { 'Normal' } h_trans { 1, '^<s', '+>', 'New' } h_trans { 2, '^<s', '-<', 'Old' } h_trans { 3, '^<', '!', 'Changed' } + # Unified diff line markers: <wirawan0> + h_trans { 4, '^<', '@@', 'CPreprocessor' } h_state 1 { 'New' } h_trans { 0, '$', '', 'Normal' } @@ -21,10 +24,14 @@ h_state 3 { 'Changed' } h_trans { 0, '$', '', 'Normal' } + + # just to mark the hunk boundaries (unified diff) + h_state 4 { 'CPreprocessor' } + h_trans { 0, '$', '', 'Normal' } } mode DIFF: PLAIN { # unix/gnu diff - FileNameRx = /\c{DIFF?}$/; + FileNameRx = /\.\c{{DIFF?}|{D?PATCH}}$/; FirstLineRx = /^diff /; HilitOn = 1; Colorizer = 'DIFF'; Index: m_perl.fte =================================================================== RCS file: /cvsroot/fte/fte/config/m_perl.fte,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- m_perl.fte 30 Oct 2002 19:33:49 -0000 1.7 +++ m_perl.fte 19 Feb 2004 22:07:21 -0000 1.8 @@ -21,6 +21,7 @@ 'q', 'qq', 'qw', 'qx', 'qr', 'm', 's', 'y', 'tr', 'if', 'sub', 'return', 'while', 'for', 'elsif', 'foreach', 'else', 'unless', 'eq', 'not', 'and', 'or', 'ne', 'until', 'abs', 'accept', + 'lt', 'gt', 'le', 'ge', 'cmp', 'alarm', 'atan2', 'bind', 'binmode', 'bless', 'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr', 'chroot', 'close', 'closedir', 'connect', 'cos', 'crypt', 'dbmclose', 'dbmopen', Index: m_tcl.fte =================================================================== RCS file: /cvsroot/fte/fte/config/m_tcl.fte,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- m_tcl.fte 20 Aug 2002 19:41:43 -0000 1.2 +++ m_tcl.fte 19 Feb 2004 22:07:21 -0000 1.3 @@ -1,3 +1,14 @@ +# +# TCL keyword highlighting (initial version) +# +# Contributor: Wirawan Purwanto <wir...@so...> [2003-01-22] +# Submitted to FTE community: 2003-05-20 +# +# NOTE: +# All the keywords originally listed in this file were deleted: they +# were 100% WRONG! They were SH keywords! +# + colorize TCL { SyntaxParser = 'SIMPLE'; @@ -12,8 +23,35 @@ }; keyword 'Editor_Keywords' { - 'case', 'do', 'done', 'elif', 'else', 'esac', 'fi', 'for', - 'function', 'if', 'in', 'then', 'until', 'while', + # These keywords were taken from Tcl/Tk 8.03 electronic reference + # (as compiled by Charles Todd, October 1998): only TCL keywords + # are included here + + 'after', 'append', 'array', 'binary', 'break', 'catch', 'cd', + 'clock', 'close', 'concat', 'continue', 'eof', 'error', 'eval', + 'exec', 'exit', 'expr', 'fblocked', 'fconfigure', 'fcopy', 'file', + 'fileevent', 'filename', 'flush', 'for', 'foreach', 'format', + 'gets', 'glob', 'global', 'history', 'if', 'incr', 'info', + 'interp', 'join', 'lappend', 'lindex', 'linsert', 'list', + 'llength', 'load', 'lrange', 'lreplace', 'lsearch', 'lsort', + 'namespace', 'open', 'package', 'pid', 'pkg_mkIndex', 'proc', + 'puts', 'pwd', 'read', 'regexp', 'regsub', 'rename', 'resource', + 'return', 'scan', 'seek', 'set', 'socket', 'source', 'split', + 'string', 'subst', 'switch', 'tell', 'time', 'trace', 'unset', + 'update', 'uplevel', 'upvar', 'variable', 'vwait', 'while', + +# Built-ins that require package: + #'registry', # on Windows only + +# Special commands that must be provided (or can be overridden) by +# the user: + 'bgerror', 'unknown', + +# Obsoleted commands + 'case', + +# Not a command: don't highlight them! + #'Http', 'Safe Base', 'Tcl', 'library', }; h_state 0 { 'Normal' } @@ -56,7 +94,7 @@ mode TCL: PLAIN { # *sh FileNameRx = /\.\ctcl$/; - FirstLineRx = /^\#\![^ ]*{wish>}/; + FirstLineRx = /^\#\![^ ]*{{wish>}|{tclsh>}}/; HilitOn = 1; Colorizer = 'TCL'; MultiLineHilit = 1; |