pascal.jsf (3858B)
1 # PASCAL highlighter for JOE 2 # With support for Delphi and FPC by Michael Van Canneyt 3 4 =Idle 5 =Comment 6 =Constant 7 =String +Constant 8 =Number +Constant 9 =Type 10 =Keyword 11 =Statement +Keyword 12 =Operator +Keyword 13 =Loop +Statement 14 =Conditional +Statement 15 =DefinedFunction +DefinedIdent 16 =Builtin +DefinedFunction 17 =Structure +Type 18 =Bad 19 20 :idle Idle 21 * idle 22 "\i" ident buffer 23 "(" maybe_comment 24 "/" maybe_linecomment 25 "{" comment recolor=-1 26 "'" string recolor=-1 27 "$" maybe_hex_number 28 "%" maybe_bin_number 29 "&" maybe_oct_number 30 "0-9" number recolor=-1 31 32 # Comments 33 34 :maybe_comment Idle 35 * idle noeat 36 "*" comment recolor=-2 37 38 :maybe_linecomment Idle 39 * idle noeat 40 "/" line_comment recolor=-2 41 42 :line_comment Comment comment 43 * line_comment 44 "BFHNTX" line_comment noeat call=comment_todo.comment_todo() 45 "\n" reset 46 47 :comment Comment comment 48 * comment 49 "BFHNTX" comment noeat call=comment_todo.comment_todo() 50 "*" maybe_end_comment 51 "}" idle 52 53 :maybe_end_comment Comment comment 54 * comment noeat 55 ")" idle 56 57 # String constant 58 59 :string String string 60 * string 61 "\n" idle 62 "'" maybe_end_string 63 64 :maybe_end_string String string 65 * idle recolor=-1 noeat 66 "'" string 67 68 # Numeric constant 69 70 :maybe_hex_number Idle 71 * idle noeat 72 "0-9A-Fa-f" hex_number recolor=-2 73 74 :maybe_bin_number Idle 75 * idle noeat 76 "01" bin_number recolor=-2 77 78 :maybe_oct_number Idle 79 * idle noeat 80 "0-7" oct_number recolor=-2 81 82 :bad Bad 83 * idle noeat 84 85 :hex_number Number 86 * idle noeat 87 "0-9" hex_number 88 "a-fA-F" hex_number 89 90 :bin_number Number 91 * idle noeat 92 "01" bin_number 93 "2-9" bad recolor=-1 94 95 :oct_number Number 96 * idle noeat 97 "0-7" oct_number 98 "89" bad recolor=-1 99 100 :number Number 101 * idle noeat 102 "0-9" number 103 "eE" epart 104 "." dot 105 106 :dot Number 107 * idle noeat 108 "0-9" float 109 110 :float Number 111 * idle noeat 112 "eE" epart 113 "0-9" float 114 115 :epart Number 116 * idle noeat 117 "0-9+\-" enum 118 119 :enum Number 120 * idle noeat 121 "0-9" enum 122 123 124 # Keywords 125 126 :ident Idle 127 * idle noeat istrings 128 "and" operator 129 "array" type 130 "begin" kw 131 "case" cond 132 "const" kw 133 "div" operator 134 "do" kw 135 "downto" kw 136 "else" cond 137 "end" kw 138 "file" kw 139 "for" loop 140 "function" kw 141 "goto" loop 142 "if" cond 143 "in" kw 144 "label" kw 145 "mod" operator 146 "nil" word_constant 147 "not" operator 148 "of" kw 149 "or" operator 150 "packed" kw 151 "procedure" kw 152 "program" kw 153 "record" kw 154 "repeat" loop 155 "set" kw 156 "then" kw 157 "type" kw 158 "until" loop 159 "var" kw 160 "while" loop 161 "with" kw 162 # Delphi keywords 163 "to" kw 164 "try" kw 165 "finally" kw 166 "raise" kw 167 "absolute" kw 168 "cdecl" kw 169 "stdcall" kw 170 "register" kw 171 "interface" struct 172 "library" kw 173 "constructor" kw 174 "destructor" kw 175 "dispinterface" kw 176 "inherited" kw 177 "public" kw 178 "private" kw 179 "published" kw 180 "protected" kw 181 "initialization" kw 182 "finalization" kw 183 "class" struct 184 "object" kw 185 "resourcestring" kw 186 "property" kw 187 "threadvar" kw 188 "integer" type 189 "boolean" type 190 "real" type 191 "char" type 192 "string" type 193 "text" type 194 "abs" function 195 "atan" function 196 "arctan" function 197 "concat" function 198 "cos" function 199 "eof" function 200 "eoln" function 201 "exp" function 202 "insert" function 203 "length" function 204 "ln" function 205 "log" function 206 "odd" function 207 "ord" function 208 "page" function 209 "pred" function 210 "round" function 211 "sin" function 212 "sqr" function 213 "sqrt" function 214 "succ" function 215 "trun" function 216 done 217 "\c" ident 218 219 :kw Keyword 220 * idle noeat 221 222 :type Type 223 * idle noeat 224 225 :loop Loop 226 * idle noeat 227 228 :cond Conditional 229 * idle noeat 230 231 :struct Structure 232 * idle noeat 233 234 :operator Operator 235 * idle noeat 236 237 :word_constant Constant 238 * idle noeat 239 240 :function Builtin 241 * idle noeat