1;; 2;; Copyright (c) 2002 by The XFree86 Project, Inc. 3;; 4;; Permission is hereby granted, free of charge, to any person obtaining a 5;; copy of this software and associated documentation files (the "Software"), 6;; to deal in the Software without restriction, including without limitation 7;; the rights to use, copy, modify, merge, publish, distribute, sublicense, 8;; and/or sell copies of the Software, and to permit persons to whom the 9;; Software is furnished to do so, subject to the following conditions: 10;; 11;; The above copyright notice and this permission notice shall be included in 12;; all copies or substantial portions of the Software. 13;; 14;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17;; THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 18;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 19;; OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20;; SOFTWARE. 21;; 22;; Except as contained in this notice, the name of the XFree86 Project shall 23;; not be used in advertising or otherwise to promote the sale, use or other 24;; dealings in this Software without prior written authorization from the 25;; XFree86 Project. 26;; 27;; Author: Paulo César Pereira de Andrade 28;; 29;; 30;; $XFree86: xc/programs/xedit/lisp/modules/progmodes/make.lsp,v 1.2 2002/10/06 17:11:48 paulo Exp $ 31;; 32 33(require "syntax") 34(in-package "XEDIT") 35 36(defsynprop *prop-shell* 37 "shell" 38 :font "*courier-bold-r*-12-*" 39 :foreground "Red4" 40) 41 42(defsynprop *prop-variable* 43 "variable" 44 :font "*courier-medium-r*-12-*" 45 :foreground "Red3" 46) 47 48;; The syntax-highlight definition does not try to flag errors, just show 49;; tabs in the start of lines for better visualization. 50(defsynprop *prop-tabulation* 51 "tabulation" 52 :font "*courier-medium-r*-12-*" 53 :background "Gray90" 54) 55 56 57(defsyntax *make-mode* :main nil nil nil 58 (syntoken "^\\t+" :property *prop-tabulation*) 59 60 (syntoken "^\\.\\w+" :property *prop-keyword*) 61 62 (syntoken "$(" 63 :nospec t 64 :begin :shell 65 :property *prop-shell*) 66 67 (syntoken "[][(){};$<=>&@/\\,.:~!|*?'`+-]" 68 :property *prop-shell*) 69 70 ;; Preprocessor start rule. 71 (syntoken "#.*" 72 :property *prop-comment*) 73 74 ;; String start rule. 75 (syntoken "\"" 76 :begin :string 77 :nospec t 78 :contained t) 79 80 ;; Quoted string start rule. 81 (syntoken "\\\"" 82 :begin :quoted-string 83 :nospec t 84 :contained t) 85 86 (syntable :shell *prop-variable* nil 87 (syntoken ")" 88 :nospec t 89 :property *prop-shell* 90 :switch -1) 91 ) 92 93 ;; Rules for strings. 94 (syntable :string *prop-string* nil 95 96 ;; Ignore escaped characters, this includes \". 97 (syntoken "\\\\.") 98 99 ;; Ignore continuation in the next line. 100 (syntoken "\\\\$") 101 102 ;; Rule to finish a string. 103 (syntoken "\"" 104 :nospec t 105 :switch -1) 106 107 ;; Don't allow strings continuing in the next line. 108 (syntoken ".?$" 109 :begin :error) 110 ) 111 112 ;; Rules for quoted strings. 113 (syntable :quoted-string *prop-constant* nil 114 115 ;; Rule to finish the quoted string. 116 (syntoken "\\\"" 117 :nospec t 118 :switch -1) 119 120 ;; Ignore escaped characters 121 (syntoken "\\\\.") 122 123 ;; Ignore continuation in the next line. 124 (syntoken "\\\\$") 125 126 ;; Don't allow strings continuing in the next line. 127 (syntoken ".?$" 128 :begin :error) 129 ) 130 131 (syntable :error *prop-error* nil 132 (syntoken "^.*$" 133 :switch -2) 134 ) 135) 136