PageRenderTime 65ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/pygments/lexers/other.py

https://bitbucket.org/birkenfeld/pygments-main/
Python | 1390 lines | 1193 code | 53 blank | 144 comment | 14 complexity | c14fd0f30191228040912a7d5c867e26 MD5 | raw file
Possible License(s): BSD-2-Clause

Large files files are truncated, but you can click here to view the full file

  1. # -*- coding: utf-8 -*-
  2. """
  3. pygments.lexers.other
  4. ~~~~~~~~~~~~~~~~~~~~~
  5. Lexers for other languages.
  6. :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
  7. :license: BSD, see LICENSE for details.
  8. """
  9. import re
  10. from pygments.lexer import RegexLexer, include, bygroups, using, \
  11. this, combined, ExtendedRegexLexer
  12. from pygments.token import Error, Punctuation, Literal, Token, \
  13. Text, Comment, Operator, Keyword, Name, String, Number, Generic
  14. from pygments.lexers.web import HtmlLexer
  15. # backwards compatibility
  16. from pygments.lexers.sql import SqlLexer, MySqlLexer, SqliteConsoleLexer
  17. from pygments.lexers.shell import BashLexer, BashSessionLexer, BatchLexer, \
  18. TcshLexer
  19. __all__ = ['BrainfuckLexer', 'BefungeLexer', 'RedcodeLexer', 'MOOCodeLexer',
  20. 'SmalltalkLexer', 'LogtalkLexer', 'GnuplotLexer', 'PovrayLexer',
  21. 'AppleScriptLexer', 'ModelicaLexer', 'RebolLexer', 'ABAPLexer',
  22. 'NewspeakLexer', 'GherkinLexer', 'AsymptoteLexer', 'PostScriptLexer',
  23. 'AutohotkeyLexer', 'GoodDataCLLexer', 'MaqlLexer', 'ProtoBufLexer',
  24. 'HybrisLexer', 'AwkLexer', 'Cfengine3Lexer', 'SnobolLexer',
  25. 'ECLLexer', 'UrbiscriptLexer', 'OpenEdgeLexer', 'BroLexer']
  26. class ECLLexer(RegexLexer):
  27. """
  28. Lexer for the declarative big-data `ECL
  29. <http://hpccsystems.com/community/docs/ecl-language-reference/html>`_
  30. language.
  31. *New in Pygments 1.5.*
  32. """
  33. name = 'ECL'
  34. aliases = ['ecl']
  35. filenames = ['*.ecl']
  36. mimetypes = ['application/x-ecl']
  37. flags = re.IGNORECASE | re.MULTILINE
  38. tokens = {
  39. 'root': [
  40. include('whitespace'),
  41. include('statements'),
  42. ],
  43. 'whitespace': [
  44. (r'\s+', Text),
  45. (r'\/\/.*', Comment.Single),
  46. (r'/(\\\n)?[*](.|\n)*?[*](\\\n)?/', Comment.Multiline),
  47. ],
  48. 'statements': [
  49. include('types'),
  50. include('keywords'),
  51. include('functions'),
  52. include('hash'),
  53. (r'"', String, 'string'),
  54. (r'\'', String, 'string'),
  55. (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+[LlUu]*', Number.Float),
  56. (r'(\d+\.\d*|\.\d+|\d+[fF])[fF]?', Number.Float),
  57. (r'0x[0-9a-fA-F]+[LlUu]*', Number.Hex),
  58. (r'0[0-7]+[LlUu]*', Number.Oct),
  59. (r'\d+[LlUu]*', Number.Integer),
  60. (r'\*/', Error),
  61. (r'[~!%^&*+=|?:<>/-]+', Operator),
  62. (r'[{}()\[\],.;]', Punctuation),
  63. (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
  64. ],
  65. 'hash': [
  66. (r'^#.*$', Comment.Preproc),
  67. ],
  68. 'types': [
  69. (r'(RECORD|END)[^\d]', Keyword.Declaration),
  70. (r'((?:ASCII|BIG_ENDIAN|BOOLEAN|DATA|DECIMAL|EBCDIC|INTEGER|PATTERN|'
  71. r'QSTRING|REAL|RECORD|RULE|SET OF|STRING|TOKEN|UDECIMAL|UNICODE|'
  72. r'UNSIGNED|VARSTRING|VARUNICODE)\d*)(\s+)',
  73. bygroups(Keyword.Type, Text)),
  74. ],
  75. 'keywords': [
  76. (r'(APPLY|ASSERT|BUILD|BUILDINDEX|EVALUATE|FAIL|KEYDIFF|KEYPATCH|'
  77. r'LOADXML|NOTHOR|NOTIFY|OUTPUT|PARALLEL|SEQUENTIAL|SOAPCALL|WAIT'
  78. r'CHECKPOINT|DEPRECATED|FAILCODE|FAILMESSAGE|FAILURE|GLOBAL|'
  79. r'INDEPENDENT|ONWARNING|PERSIST|PRIORITY|RECOVERY|STORED|SUCCESS|'
  80. r'WAIT|WHEN)\b', Keyword.Reserved),
  81. # These are classed differently, check later
  82. (r'(ALL|AND|ANY|AS|ATMOST|BEFORE|BEGINC\+\+|BEST|BETWEEN|CASE|CONST|'
  83. r'COUNTER|CSV|DESCEND|ENCRYPT|ENDC\+\+|ENDMACRO|EXCEPT|EXCLUSIVE|'
  84. r'EXPIRE|EXPORT|EXTEND|FALSE|FEW|FIRST|FLAT|FULL|FUNCTION|GROUP|'
  85. r'HEADER|HEADING|HOLE|IFBLOCK|IMPORT|IN|JOINED|KEEP|KEYED|LAST|'
  86. r'LEFT|LIMIT|LOAD|LOCAL|LOCALE|LOOKUP|MACRO|MANY|MAXCOUNT|'
  87. r'MAXLENGTH|MIN SKEW|MODULE|INTERFACE|NAMED|NOCASE|NOROOT|NOSCAN|'
  88. r'NOSORT|NOT|OF|ONLY|OPT|OR|OUTER|OVERWRITE|PACKED|PARTITION|'
  89. r'PENALTY|PHYSICALLENGTH|PIPE|QUOTE|RELATIONSHIP|REPEAT|RETURN|'
  90. r'RIGHT|SCAN|SELF|SEPARATOR|SERVICE|SHARED|SKEW|SKIP|SQL|STORE|'
  91. r'TERMINATOR|THOR|THRESHOLD|TOKEN|TRANSFORM|TRIM|TRUE|TYPE|'
  92. r'UNICODEORDER|UNSORTED|VALIDATE|VIRTUAL|WHOLE|WILD|WITHIN|XML|'
  93. r'XPATH|__COMPRESSED__)\b', Keyword.Reserved),
  94. ],
  95. 'functions': [
  96. (r'(ABS|ACOS|ALLNODES|ASCII|ASIN|ASSTRING|ATAN|ATAN2|AVE|CASE|'
  97. r'CHOOSE|CHOOSEN|CHOOSESETS|CLUSTERSIZE|COMBINE|CORRELATION|COS|'
  98. r'COSH|COUNT|COVARIANCE|CRON|DATASET|DEDUP|DEFINE|DENORMALIZE|'
  99. r'DISTRIBUTE|DISTRIBUTED|DISTRIBUTION|EBCDIC|ENTH|ERROR|EVALUATE|'
  100. r'EVENT|EVENTEXTRA|EVENTNAME|EXISTS|EXP|FAILCODE|FAILMESSAGE|'
  101. r'FETCH|FROMUNICODE|GETISVALID|GLOBAL|GRAPH|GROUP|HASH|HASH32|'
  102. r'HASH64|HASHCRC|HASHMD5|HAVING|IF|INDEX|INTFORMAT|ISVALID|'
  103. r'ITERATE|JOIN|KEYUNICODE|LENGTH|LIBRARY|LIMIT|LN|LOCAL|LOG|LOOP|'
  104. r'MAP|MATCHED|MATCHLENGTH|MATCHPOSITION|MATCHTEXT|MATCHUNICODE|'
  105. r'MAX|MERGE|MERGEJOIN|MIN|NOLOCAL|NONEMPTY|NORMALIZE|PARSE|PIPE|'
  106. r'POWER|PRELOAD|PROCESS|PROJECT|PULL|RANDOM|RANGE|RANK|RANKED|'
  107. r'REALFORMAT|RECORDOF|REGEXFIND|REGEXREPLACE|REGROUP|REJECTED|'
  108. r'ROLLUP|ROUND|ROUNDUP|ROW|ROWDIFF|SAMPLE|SET|SIN|SINH|SIZEOF|'
  109. r'SOAPCALL|SORT|SORTED|SQRT|STEPPED|STORED|SUM|TABLE|TAN|TANH|'
  110. r'THISNODE|TOPN|TOUNICODE|TRANSFER|TRIM|TRUNCATE|TYPEOF|UNGROUP|'
  111. r'UNICODEORDER|VARIANCE|WHICH|WORKUNIT|XMLDECODE|XMLENCODE|'
  112. r'XMLTEXT|XMLUNICODE)\b', Name.Function),
  113. ],
  114. 'string': [
  115. (r'"', String, '#pop'),
  116. (r'\'', String, '#pop'),
  117. (r'[^"\']+', String),
  118. ],
  119. }
  120. class BrainfuckLexer(RegexLexer):
  121. """
  122. Lexer for the esoteric `BrainFuck <http://www.muppetlabs.com/~breadbox/bf/>`_
  123. language.
  124. """
  125. name = 'Brainfuck'
  126. aliases = ['brainfuck', 'bf']
  127. filenames = ['*.bf', '*.b']
  128. mimetypes = ['application/x-brainfuck']
  129. tokens = {
  130. 'common': [
  131. # use different colors for different instruction types
  132. (r'[.,]+', Name.Tag),
  133. (r'[+-]+', Name.Builtin),
  134. (r'[<>]+', Name.Variable),
  135. (r'[^.,+\-<>\[\]]+', Comment),
  136. ],
  137. 'root': [
  138. (r'\[', Keyword, 'loop'),
  139. (r'\]', Error),
  140. include('common'),
  141. ],
  142. 'loop': [
  143. (r'\[', Keyword, '#push'),
  144. (r'\]', Keyword, '#pop'),
  145. include('common'),
  146. ]
  147. }
  148. class BefungeLexer(RegexLexer):
  149. """
  150. Lexer for the esoteric `Befunge <http://en.wikipedia.org/wiki/Befunge>`_
  151. language.
  152. *New in Pygments 0.7.*
  153. """
  154. name = 'Befunge'
  155. aliases = ['befunge']
  156. filenames = ['*.befunge']
  157. mimetypes = ['application/x-befunge']
  158. tokens = {
  159. 'root': [
  160. (r'[0-9a-f]', Number),
  161. (r'[\+\*/%!`-]', Operator), # Traditional math
  162. (r'[<>^v?\[\]rxjk]', Name.Variable), # Move, imperatives
  163. (r'[:\\$.,n]', Name.Builtin), # Stack ops, imperatives
  164. (r'[|_mw]', Keyword),
  165. (r'[{}]', Name.Tag), # Befunge-98 stack ops
  166. (r'".*?"', String.Double), # Strings don't appear to allow escapes
  167. (r'\'.', String.Single), # Single character
  168. (r'[#;]', Comment), # Trampoline... depends on direction hit
  169. (r'[pg&~=@iotsy]', Keyword), # Misc
  170. (r'[()A-Z]', Comment), # Fingerprints
  171. (r'\s+', Text), # Whitespace doesn't matter
  172. ],
  173. }
  174. class RedcodeLexer(RegexLexer):
  175. """
  176. A simple Redcode lexer based on ICWS'94.
  177. Contributed by Adam Blinkinsop <blinks@acm.org>.
  178. *New in Pygments 0.8.*
  179. """
  180. name = 'Redcode'
  181. aliases = ['redcode']
  182. filenames = ['*.cw']
  183. opcodes = ['DAT','MOV','ADD','SUB','MUL','DIV','MOD',
  184. 'JMP','JMZ','JMN','DJN','CMP','SLT','SPL',
  185. 'ORG','EQU','END']
  186. modifiers = ['A','B','AB','BA','F','X','I']
  187. tokens = {
  188. 'root': [
  189. # Whitespace:
  190. (r'\s+', Text),
  191. (r';.*$', Comment.Single),
  192. # Lexemes:
  193. # Identifiers
  194. (r'\b(%s)\b' % '|'.join(opcodes), Name.Function),
  195. (r'\b(%s)\b' % '|'.join(modifiers), Name.Decorator),
  196. (r'[A-Za-z_][A-Za-z_0-9]+', Name),
  197. # Operators
  198. (r'[-+*/%]', Operator),
  199. (r'[#$@<>]', Operator), # mode
  200. (r'[.,]', Punctuation), # mode
  201. # Numbers
  202. (r'[-+]?\d+', Number.Integer),
  203. ],
  204. }
  205. class MOOCodeLexer(RegexLexer):
  206. """
  207. For `MOOCode <http://www.moo.mud.org/>`_ (the MOO scripting
  208. language).
  209. *New in Pygments 0.9.*
  210. """
  211. name = 'MOOCode'
  212. filenames = ['*.moo']
  213. aliases = ['moocode']
  214. mimetypes = ['text/x-moocode']
  215. tokens = {
  216. 'root' : [
  217. # Numbers
  218. (r'(0|[1-9][0-9_]*)', Number.Integer),
  219. # Strings
  220. (r'"(\\\\|\\"|[^"])*"', String),
  221. # exceptions
  222. (r'(E_PERM|E_DIV)', Name.Exception),
  223. # db-refs
  224. (r'((#[-0-9]+)|(\$[a-z_A-Z0-9]+))', Name.Entity),
  225. # Keywords
  226. (r'\b(if|else|elseif|endif|for|endfor|fork|endfork|while'
  227. r'|endwhile|break|continue|return|try'
  228. r'|except|endtry|finally|in)\b', Keyword),
  229. # builtins
  230. (r'(random|length)', Name.Builtin),
  231. # special variables
  232. (r'(player|caller|this|args)', Name.Variable.Instance),
  233. # skip whitespace
  234. (r'\s+', Text),
  235. (r'\n', Text),
  236. # other operators
  237. (r'([!;=,{}&\|:\.\[\]@\(\)\<\>\?]+)', Operator),
  238. # function call
  239. (r'([a-z_A-Z0-9]+)(\()', bygroups(Name.Function, Operator)),
  240. # variables
  241. (r'([a-zA-Z_0-9]+)', Text),
  242. ]
  243. }
  244. class SmalltalkLexer(RegexLexer):
  245. """
  246. For `Smalltalk <http://www.smalltalk.org/>`_ syntax.
  247. Contributed by Stefan Matthias Aust.
  248. Rewritten by Nils Winter.
  249. *New in Pygments 0.10.*
  250. """
  251. name = 'Smalltalk'
  252. filenames = ['*.st']
  253. aliases = ['smalltalk', 'squeak']
  254. mimetypes = ['text/x-smalltalk']
  255. tokens = {
  256. 'root' : [
  257. (r'(<)(\w+:)(.*?)(>)', bygroups(Text, Keyword, Text, Text)),
  258. include('squeak fileout'),
  259. include('whitespaces'),
  260. include('method definition'),
  261. (r'(\|)([\w\s]*)(\|)', bygroups(Operator, Name.Variable, Operator)),
  262. include('objects'),
  263. (r'\^|\:=|\_', Operator),
  264. # temporaries
  265. (r'[\]({}.;!]', Text),
  266. ],
  267. 'method definition' : [
  268. # Not perfect can't allow whitespaces at the beginning and the
  269. # without breaking everything
  270. (r'([a-zA-Z]+\w*:)(\s*)(\w+)',
  271. bygroups(Name.Function, Text, Name.Variable)),
  272. (r'^(\b[a-zA-Z]+\w*\b)(\s*)$', bygroups(Name.Function, Text)),
  273. (r'^([-+*/\\~<>=|&!?,@%]+)(\s*)(\w+)(\s*)$',
  274. bygroups(Name.Function, Text, Name.Variable, Text)),
  275. ],
  276. 'blockvariables' : [
  277. include('whitespaces'),
  278. (r'(:)(\s*)([A-Za-z\w]+)',
  279. bygroups(Operator, Text, Name.Variable)),
  280. (r'\|', Operator, '#pop'),
  281. (r'', Text, '#pop'), # else pop
  282. ],
  283. 'literals' : [
  284. (r'\'[^\']*\'', String, 'afterobject'),
  285. (r'\$.', String.Char, 'afterobject'),
  286. (r'#\(', String.Symbol, 'parenth'),
  287. (r'\)', Text, 'afterobject'),
  288. (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number, 'afterobject'),
  289. ],
  290. '_parenth_helper' : [
  291. include('whitespaces'),
  292. (r'(\d+r)?-?\d+(\.\d+)?(e-?\d+)?', Number),
  293. (r'[-+*/\\~<>=|&#!?,@%\w+:]+', String.Symbol),
  294. # literals
  295. (r'\'[^\']*\'', String),
  296. (r'\$.', String.Char),
  297. (r'#*\(', String.Symbol, 'inner_parenth'),
  298. ],
  299. 'parenth' : [
  300. # This state is a bit tricky since
  301. # we can't just pop this state
  302. (r'\)', String.Symbol, ('root','afterobject')),
  303. include('_parenth_helper'),
  304. ],
  305. 'inner_parenth': [
  306. (r'\)', String.Symbol, '#pop'),
  307. include('_parenth_helper'),
  308. ],
  309. 'whitespaces' : [
  310. # skip whitespace and comments
  311. (r'\s+', Text),
  312. (r'"[^"]*"', Comment),
  313. ],
  314. 'objects' : [
  315. (r'\[', Text, 'blockvariables'),
  316. (r'\]', Text, 'afterobject'),
  317. (r'\b(self|super|true|false|nil|thisContext)\b',
  318. Name.Builtin.Pseudo, 'afterobject'),
  319. (r'\b[A-Z]\w*(?!:)\b', Name.Class, 'afterobject'),
  320. (r'\b[a-z]\w*(?!:)\b', Name.Variable, 'afterobject'),
  321. (r'#("[^"]*"|[-+*/\\~<>=|&!?,@%]+|[\w:]+)',
  322. String.Symbol, 'afterobject'),
  323. include('literals'),
  324. ],
  325. 'afterobject' : [
  326. (r'! !$', Keyword , '#pop'), # squeak chunk delimeter
  327. include('whitespaces'),
  328. (r'\b(ifTrue:|ifFalse:|whileTrue:|whileFalse:|timesRepeat:)',
  329. Name.Builtin, '#pop'),
  330. (r'\b(new\b(?!:))', Name.Builtin),
  331. (r'\:=|\_', Operator, '#pop'),
  332. (r'\b[a-zA-Z]+\w*:', Name.Function, '#pop'),
  333. (r'\b[a-zA-Z]+\w*', Name.Function),
  334. (r'\w+:?|[-+*/\\~<>=|&!?,@%]+', Name.Function, '#pop'),
  335. (r'\.', Punctuation, '#pop'),
  336. (r';', Punctuation),
  337. (r'[\])}]', Text),
  338. (r'[\[({]', Text, '#pop'),
  339. ],
  340. 'squeak fileout' : [
  341. # Squeak fileout format (optional)
  342. (r'^"[^"]*"!', Keyword),
  343. (r"^'[^']*'!", Keyword),
  344. (r'^(!)(\w+)( commentStamp: )(.*?)( prior: .*?!\n)(.*?)(!)',
  345. bygroups(Keyword, Name.Class, Keyword, String, Keyword, Text, Keyword)),
  346. (r'^(!)(\w+(?: class)?)( methodsFor: )(\'[^\']*\')(.*?!)',
  347. bygroups(Keyword, Name.Class, Keyword, String, Keyword)),
  348. (r'^(\w+)( subclass: )(#\w+)'
  349. r'(\s+instanceVariableNames: )(.*?)'
  350. r'(\s+classVariableNames: )(.*?)'
  351. r'(\s+poolDictionaries: )(.*?)'
  352. r'(\s+category: )(.*?)(!)',
  353. bygroups(Name.Class, Keyword, String.Symbol, Keyword, String, Keyword,
  354. String, Keyword, String, Keyword, String, Keyword)),
  355. (r'^(\w+(?: class)?)(\s+instanceVariableNames: )(.*?)(!)',
  356. bygroups(Name.Class, Keyword, String, Keyword)),
  357. (r'(!\n)(\].*)(! !)$', bygroups(Keyword, Text, Keyword)),
  358. (r'! !$', Keyword),
  359. ],
  360. }
  361. class LogtalkLexer(RegexLexer):
  362. """
  363. For `Logtalk <http://logtalk.org/>`_ source code.
  364. *New in Pygments 0.10.*
  365. """
  366. name = 'Logtalk'
  367. aliases = ['logtalk']
  368. filenames = ['*.lgt']
  369. mimetypes = ['text/x-logtalk']
  370. tokens = {
  371. 'root': [
  372. # Directives
  373. (r'^\s*:-\s',Punctuation,'directive'),
  374. # Comments
  375. (r'%.*?\n', Comment),
  376. (r'/\*(.|\n)*?\*/',Comment),
  377. # Whitespace
  378. (r'\n', Text),
  379. (r'\s+', Text),
  380. # Numbers
  381. (r"0'.", Number),
  382. (r'0b[01]+', Number),
  383. (r'0o[0-7]+', Number),
  384. (r'0x[0-9a-fA-F]+', Number),
  385. (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
  386. # Variables
  387. (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable),
  388. # Event handlers
  389. (r'(after|before)(?=[(])', Keyword),
  390. # Execution-context methods
  391. (r'(parameter|this|se(lf|nder))(?=[(])', Keyword),
  392. # Reflection
  393. (r'(current_predicate|predicate_property)(?=[(])', Keyword),
  394. # DCGs and term expansion
  395. (r'(expand_(goal|term)|(goal|term)_expansion|phrase)(?=[(])',
  396. Keyword),
  397. # Entity
  398. (r'(abolish|c(reate|urrent))_(object|protocol|category)(?=[(])',
  399. Keyword),
  400. (r'(object|protocol|category)_property(?=[(])', Keyword),
  401. # Entity relations
  402. (r'co(mplements_object|nforms_to_protocol)(?=[(])', Keyword),
  403. (r'extends_(object|protocol|category)(?=[(])', Keyword),
  404. (r'imp(lements_protocol|orts_category)(?=[(])', Keyword),
  405. (r'(instantiat|specializ)es_class(?=[(])', Keyword),
  406. # Events
  407. (r'(current_event|(abolish|define)_events)(?=[(])', Keyword),
  408. # Flags
  409. (r'(current|set)_logtalk_flag(?=[(])', Keyword),
  410. # Compiling, loading, and library paths
  411. (r'logtalk_(compile|l(ibrary_path|oad_context|oad))(?=[(])',
  412. Keyword),
  413. # Database
  414. (r'(clause|retract(all)?)(?=[(])', Keyword),
  415. (r'a(bolish|ssert(a|z))(?=[(])', Keyword),
  416. # Control constructs
  417. (r'(ca(ll|tch)|throw)(?=[(])', Keyword),
  418. (r'(fail|true)\b', Keyword),
  419. # All solutions
  420. (r'((bag|set)of|f(ind|or)all)(?=[(])', Keyword),
  421. # Multi-threading meta-predicates
  422. (r'threaded(_(call|once|ignore|exit|peek|wait|notify))?(?=[(])',
  423. Keyword),
  424. # Term unification
  425. (r'unify_with_occurs_check(?=[(])', Keyword),
  426. # Term creation and decomposition
  427. (r'(functor|arg|copy_term|numbervars)(?=[(])', Keyword),
  428. # Evaluable functors
  429. (r'(rem|mod|abs|sign)(?=[(])', Keyword),
  430. (r'float(_(integer|fractional)_part)?(?=[(])', Keyword),
  431. (r'(floor|truncate|round|ceiling)(?=[(])', Keyword),
  432. # Other arithmetic functors
  433. (r'(cos|atan|exp|log|s(in|qrt))(?=[(])', Keyword),
  434. # Term testing
  435. (r'(var|atom(ic)?|integer|float|c(allable|ompound)|n(onvar|umber)|'
  436. r'ground)(?=[(])', Keyword),
  437. # Term comparison
  438. (r'compare(?=[(])', Keyword),
  439. # Stream selection and control
  440. (r'(curren|se)t_(in|out)put(?=[(])', Keyword),
  441. (r'(open|close)(?=[(])', Keyword),
  442. (r'flush_output(?=[(])', Keyword),
  443. (r'(at_end_of_stream|flush_output)\b', Keyword),
  444. (r'(stream_property|at_end_of_stream|set_stream_position)(?=[(])',
  445. Keyword),
  446. # Character and byte input/output
  447. (r'(nl|(get|peek|put)_(byte|c(har|ode)))(?=[(])', Keyword),
  448. (r'\bnl\b', Keyword),
  449. # Term input/output
  450. (r'read(_term)?(?=[(])', Keyword),
  451. (r'write(q|_(canonical|term))?(?=[(])', Keyword),
  452. (r'(current_)?op(?=[(])', Keyword),
  453. (r'(current_)?char_conversion(?=[(])', Keyword),
  454. # Atomic term processing
  455. (r'atom_(length|c(hars|o(ncat|des)))(?=[(])', Keyword),
  456. (r'(char_code|sub_atom)(?=[(])', Keyword),
  457. (r'number_c(har|ode)s(?=[(])', Keyword),
  458. # Implementation defined hooks functions
  459. (r'(se|curren)t_prolog_flag(?=[(])', Keyword),
  460. (r'\bhalt\b', Keyword),
  461. (r'halt(?=[(])', Keyword),
  462. # Message sending operators
  463. (r'(::|:|\^\^)', Operator),
  464. # External call
  465. (r'[{}]', Keyword),
  466. # Logic and control
  467. (r'\b(ignore|once)(?=[(])', Keyword),
  468. (r'\brepeat\b', Keyword),
  469. # Sorting
  470. (r'(key)?sort(?=[(])', Keyword),
  471. # Bitwise functors
  472. (r'(>>|<<|/\\|\\\\|\\)', Operator),
  473. # Arithemtic evaluation
  474. (r'\bis\b', Keyword),
  475. # Arithemtic comparison
  476. (r'(=:=|=\\=|<|=<|>=|>)', Operator),
  477. # Term creation and decomposition
  478. (r'=\.\.', Operator),
  479. # Term unification
  480. (r'(=|\\=)', Operator),
  481. # Term comparison
  482. (r'(==|\\==|@=<|@<|@>=|@>)', Operator),
  483. # Evaluable functors
  484. (r'(//|[-+*/])', Operator),
  485. (r'\b(e|pi|mod|rem)\b', Operator),
  486. # Other arithemtic functors
  487. (r'\b\*\*\b', Operator),
  488. # DCG rules
  489. (r'-->', Operator),
  490. # Control constructs
  491. (r'([!;]|->)', Operator),
  492. # Logic and control
  493. (r'\\+', Operator),
  494. # Mode operators
  495. (r'[?@]', Operator),
  496. # Existential quantifier
  497. (r'\^', Operator),
  498. # Strings
  499. (r'"(\\\\|\\"|[^"])*"', String),
  500. # Ponctuation
  501. (r'[()\[\],.|]', Text),
  502. # Atoms
  503. (r"[a-z][a-zA-Z0-9_]*", Text),
  504. (r"[']", String, 'quoted_atom'),
  505. ],
  506. 'quoted_atom': [
  507. (r"['][']", String),
  508. (r"[']", String, '#pop'),
  509. (r'\\([\\abfnrtv"\']|(x[a-fA-F0-9]+|[0-7]+)\\)', String.Escape),
  510. (r"[^\\'\n]+", String),
  511. (r'\\', String),
  512. ],
  513. 'directive': [
  514. # Conditional compilation directives
  515. (r'(el)?if(?=[(])', Keyword, 'root'),
  516. (r'(e(lse|ndif))[.]', Keyword, 'root'),
  517. # Entity directives
  518. (r'(category|object|protocol)(?=[(])', Keyword, 'entityrelations'),
  519. (r'(end_(category|object|protocol))[.]',Keyword, 'root'),
  520. # Predicate scope directives
  521. (r'(public|protected|private)(?=[(])', Keyword, 'root'),
  522. # Other directives
  523. (r'e(n(coding|sure_loaded)|xport)(?=[(])', Keyword, 'root'),
  524. (r'in(fo|itialization)(?=[(])', Keyword, 'root'),
  525. (r'(dynamic|synchronized|threaded)[.]', Keyword, 'root'),
  526. (r'(alias|d(ynamic|iscontiguous)|m(eta_predicate|ode|ultifile)|'
  527. r's(et_(logtalk|prolog)_flag|ynchronized))(?=[(])',
  528. Keyword, 'root'),
  529. (r'op(?=[(])', Keyword, 'root'),
  530. (r'(c(alls|oinductive)|reexport|use(s|_module))(?=[(])',
  531. Keyword, 'root'),
  532. (r'[a-z][a-zA-Z0-9_]*(?=[(])', Text, 'root'),
  533. (r'[a-z][a-zA-Z0-9_]*[.]', Text, 'root'),
  534. ],
  535. 'entityrelations': [
  536. (r'(complements|extends|i(nstantiates|mp(lements|orts))|specializes)'
  537. r'(?=[(])', Keyword),
  538. # Numbers
  539. (r"0'.", Number),
  540. (r'0b[01]+', Number),
  541. (r'0o[0-7]+', Number),
  542. (r'0x[0-9a-fA-F]+', Number),
  543. (r'\d+\.?\d*((e|E)(\+|-)?\d+)?', Number),
  544. # Variables
  545. (r'([A-Z_][a-zA-Z0-9_]*)', Name.Variable),
  546. # Atoms
  547. (r"[a-z][a-zA-Z0-9_]*", Text),
  548. (r"[']", String, 'quoted_atom'),
  549. # Strings
  550. (r'"(\\\\|\\"|[^"])*"', String),
  551. # End of entity-opening directive
  552. (r'([)]\.)', Text, 'root'),
  553. # Scope operator
  554. (r'(::)', Operator),
  555. # Ponctuation
  556. (r'[()\[\],.|]', Text),
  557. # Comments
  558. (r'%.*?\n', Comment),
  559. (r'/\*(.|\n)*?\*/',Comment),
  560. # Whitespace
  561. (r'\n', Text),
  562. (r'\s+', Text),
  563. ]
  564. }
  565. def analyse_text(text):
  566. if ':- object(' in text:
  567. return True
  568. if ':- protocol(' in text:
  569. return True
  570. if ':- category(' in text:
  571. return True
  572. return False
  573. def _shortened(word):
  574. dpos = word.find('$')
  575. return '|'.join([word[:dpos] + word[dpos+1:i] + r'\b'
  576. for i in range(len(word), dpos, -1)])
  577. def _shortened_many(*words):
  578. return '|'.join(map(_shortened, words))
  579. class GnuplotLexer(RegexLexer):
  580. """
  581. For `Gnuplot <http://gnuplot.info/>`_ plotting scripts.
  582. *New in Pygments 0.11.*
  583. """
  584. name = 'Gnuplot'
  585. aliases = ['gnuplot']
  586. filenames = ['*.plot', '*.plt']
  587. mimetypes = ['text/x-gnuplot']
  588. tokens = {
  589. 'root': [
  590. include('whitespace'),
  591. (_shortened('bi$nd'), Keyword, 'bind'),
  592. (_shortened_many('ex$it', 'q$uit'), Keyword, 'quit'),
  593. (_shortened('f$it'), Keyword, 'fit'),
  594. (r'(if)(\s*)(\()', bygroups(Keyword, Text, Punctuation), 'if'),
  595. (r'else\b', Keyword),
  596. (_shortened('pa$use'), Keyword, 'pause'),
  597. (_shortened_many('p$lot', 'rep$lot', 'sp$lot'), Keyword, 'plot'),
  598. (_shortened('sa$ve'), Keyword, 'save'),
  599. (_shortened('se$t'), Keyword, ('genericargs', 'optionarg')),
  600. (_shortened_many('sh$ow', 'uns$et'),
  601. Keyword, ('noargs', 'optionarg')),
  602. (_shortened_many('low$er', 'ra$ise', 'ca$ll', 'cd$', 'cl$ear',
  603. 'h$elp', '\\?$', 'hi$story', 'l$oad', 'pr$int',
  604. 'pwd$', 're$read', 'res$et', 'scr$eendump',
  605. 'she$ll', 'sy$stem', 'up$date'),
  606. Keyword, 'genericargs'),
  607. (_shortened_many('pwd$', 're$read', 'res$et', 'scr$eendump',
  608. 'she$ll', 'test$'),
  609. Keyword, 'noargs'),
  610. ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(=)',
  611. bygroups(Name.Variable, Text, Operator), 'genericargs'),
  612. ('([a-zA-Z_][a-zA-Z0-9_]*)(\s*\(.*?\)\s*)(=)',
  613. bygroups(Name.Function, Text, Operator), 'genericargs'),
  614. (r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Constant), # macros
  615. (r';', Keyword),
  616. ],
  617. 'comment': [
  618. (r'[^\\\n]', Comment),
  619. (r'\\\n', Comment),
  620. (r'\\', Comment),
  621. # don't add the newline to the Comment token
  622. ('', Comment, '#pop'),
  623. ],
  624. 'whitespace': [
  625. ('#', Comment, 'comment'),
  626. (r'[ \t\v\f]+', Text),
  627. ],
  628. 'noargs': [
  629. include('whitespace'),
  630. # semicolon and newline end the argument list
  631. (r';', Punctuation, '#pop'),
  632. (r'\n', Text, '#pop'),
  633. ],
  634. 'dqstring': [
  635. (r'"', String, '#pop'),
  636. (r'\\([\\abfnrtv"\']|x[a-fA-F0-9]{2,4}|[0-7]{1,3})', String.Escape),
  637. (r'[^\\"\n]+', String), # all other characters
  638. (r'\\\n', String), # line continuation
  639. (r'\\', String), # stray backslash
  640. (r'\n', String, '#pop'), # newline ends the string too
  641. ],
  642. 'sqstring': [
  643. (r"''", String), # escaped single quote
  644. (r"'", String, '#pop'),
  645. (r"[^\\'\n]+", String), # all other characters
  646. (r'\\\n', String), # line continuation
  647. (r'\\', String), # normal backslash
  648. (r'\n', String, '#pop'), # newline ends the string too
  649. ],
  650. 'genericargs': [
  651. include('noargs'),
  652. (r'"', String, 'dqstring'),
  653. (r"'", String, 'sqstring'),
  654. (r'(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+', Number.Float),
  655. (r'(\d+\.\d*|\.\d+)', Number.Float),
  656. (r'-?\d+', Number.Integer),
  657. ('[,.~!%^&*+=|?:<>/-]', Operator),
  658. ('[{}()\[\]]', Punctuation),
  659. (r'(eq|ne)\b', Operator.Word),
  660. (r'([a-zA-Z_][a-zA-Z0-9_]*)(\s*)(\()',
  661. bygroups(Name.Function, Text, Punctuation)),
  662. (r'[a-zA-Z_][a-zA-Z0-9_]*', Name),
  663. (r'@[a-zA-Z_][a-zA-Z0-9_]*', Name.Constant), # macros
  664. (r'\\\n', Text),
  665. ],
  666. 'optionarg': [
  667. include('whitespace'),
  668. (_shortened_many(
  669. "a$ll","an$gles","ar$row","au$toscale","b$ars","bor$der",
  670. "box$width","cl$abel","c$lip","cn$trparam","co$ntour","da$ta",
  671. "data$file","dg$rid3d","du$mmy","enc$oding","dec$imalsign",
  672. "fit$","font$path","fo$rmat","fu$nction","fu$nctions","g$rid",
  673. "hid$den3d","his$torysize","is$osamples","k$ey","keyt$itle",
  674. "la$bel","li$nestyle","ls$","loa$dpath","loc$ale","log$scale",
  675. "mac$ros","map$ping","map$ping3d","mar$gin","lmar$gin",
  676. "rmar$gin","tmar$gin","bmar$gin","mo$use","multi$plot",
  677. "mxt$ics","nomxt$ics","mx2t$ics","nomx2t$ics","myt$ics",
  678. "nomyt$ics","my2t$ics","nomy2t$ics","mzt$ics","nomzt$ics",
  679. "mcbt$ics","nomcbt$ics","of$fsets","or$igin","o$utput",
  680. "pa$rametric","pm$3d","pal$ette","colorb$ox","p$lot",
  681. "poi$ntsize","pol$ar","pr$int","obj$ect","sa$mples","si$ze",
  682. "st$yle","su$rface","table$","t$erminal","termo$ptions","ti$cs",
  683. "ticsc$ale","ticsl$evel","timef$mt","tim$estamp","tit$le",
  684. "v$ariables","ve$rsion","vi$ew","xyp$lane","xda$ta","x2da$ta",
  685. "yda$ta","y2da$ta","zda$ta","cbda$ta","xl$abel","x2l$abel",
  686. "yl$abel","y2l$abel","zl$abel","cbl$abel","xti$cs","noxti$cs",
  687. "x2ti$cs","nox2ti$cs","yti$cs","noyti$cs","y2ti$cs","noy2ti$cs",
  688. "zti$cs","nozti$cs","cbti$cs","nocbti$cs","xdti$cs","noxdti$cs",
  689. "x2dti$cs","nox2dti$cs","ydti$cs","noydti$cs","y2dti$cs",
  690. "noy2dti$cs","zdti$cs","nozdti$cs","cbdti$cs","nocbdti$cs",
  691. "xmti$cs","noxmti$cs","x2mti$cs","nox2mti$cs","ymti$cs",
  692. "noymti$cs","y2mti$cs","noy2mti$cs","zmti$cs","nozmti$cs",
  693. "cbmti$cs","nocbmti$cs","xr$ange","x2r$ange","yr$ange",
  694. "y2r$ange","zr$ange","cbr$ange","rr$ange","tr$ange","ur$ange",
  695. "vr$ange","xzeroa$xis","x2zeroa$xis","yzeroa$xis","y2zeroa$xis",
  696. "zzeroa$xis","zeroa$xis","z$ero"), Name.Builtin, '#pop'),
  697. ],
  698. 'bind': [
  699. ('!', Keyword, '#pop'),
  700. (_shortened('all$windows'), Name.Builtin),
  701. include('genericargs'),
  702. ],
  703. 'quit': [
  704. (r'gnuplot\b', Keyword),
  705. include('noargs'),
  706. ],
  707. 'fit': [
  708. (r'via\b', Name.Builtin),
  709. include('plot'),
  710. ],
  711. 'if': [
  712. (r'\)', Punctuation, '#pop'),
  713. include('genericargs'),
  714. ],
  715. 'pause': [
  716. (r'(mouse|any|button1|button2|button3)\b', Name.Builtin),
  717. (_shortened('key$press'), Name.Builtin),
  718. include('genericargs'),
  719. ],
  720. 'plot': [
  721. (_shortened_many('ax$es', 'axi$s', 'bin$ary', 'ev$ery', 'i$ndex',
  722. 'mat$rix', 's$mooth', 'thru$', 't$itle',
  723. 'not$itle', 'u$sing', 'w$ith'),
  724. Name.Builtin),
  725. include('genericargs'),
  726. ],
  727. 'save': [
  728. (_shortened_many('f$unctions', 's$et', 't$erminal', 'v$ariables'),
  729. Name.Builtin),
  730. include('genericargs'),
  731. ],
  732. }
  733. class PovrayLexer(RegexLexer):
  734. """
  735. For `Persistence of Vision Raytracer <http://www.povray.org/>`_ files.
  736. *New in Pygments 0.11.*
  737. """
  738. name = 'POVRay'
  739. aliases = ['pov']
  740. filenames = ['*.pov', '*.inc']
  741. mimetypes = ['text/x-povray']
  742. tokens = {
  743. 'root': [
  744. (r'/\*[\w\W]*?\*/', Comment.Multiline),
  745. (r'//.*\n', Comment.Single),
  746. (r'(?s)"(?:\\.|[^"\\])+"', String.Double),
  747. (r'#(debug|default|else|end|error|fclose|fopen|if|ifdef|ifndef|'
  748. r'include|range|read|render|statistics|switch|undef|version|'
  749. r'warning|while|write|define|macro|local|declare)',
  750. Comment.Preproc),
  751. (r'\b(aa_level|aa_threshold|abs|acos|acosh|adaptive|adc_bailout|'
  752. r'agate|agate_turb|all|alpha|ambient|ambient_light|angle|'
  753. r'aperture|arc_angle|area_light|asc|asin|asinh|assumed_gamma|'
  754. r'atan|atan2|atanh|atmosphere|atmospheric_attenuation|'
  755. r'attenuating|average|background|black_hole|blue|blur_samples|'
  756. r'bounded_by|box_mapping|bozo|break|brick|brick_size|'
  757. r'brightness|brilliance|bumps|bumpy1|bumpy2|bumpy3|bump_map|'
  758. r'bump_size|case|caustics|ceil|checker|chr|clipped_by|clock|'
  759. r'color|color_map|colour|colour_map|component|composite|concat|'
  760. r'confidence|conic_sweep|constant|control0|control1|cos|cosh|'
  761. r'count|crackle|crand|cube|cubic_spline|cylindrical_mapping|'
  762. r'debug|declare|default|degrees|dents|diffuse|direction|'
  763. r'distance|distance_maximum|div|dust|dust_type|eccentricity|'
  764. r'else|emitting|end|error|error_bound|exp|exponent|'
  765. r'fade_distance|fade_power|falloff|falloff_angle|false|'
  766. r'file_exists|filter|finish|fisheye|flatness|flip|floor|'
  767. r'focal_point|fog|fog_alt|fog_offset|fog_type|frequency|gif|'
  768. r'global_settings|glowing|gradient|granite|gray_threshold|'
  769. r'green|halo|hexagon|hf_gray_16|hierarchy|hollow|hypercomplex|'
  770. r'if|ifdef|iff|image_map|incidence|include|int|interpolate|'
  771. r'inverse|ior|irid|irid_wavelength|jitter|lambda|leopard|'
  772. r'linear|linear_spline|linear_sweep|location|log|looks_like|'
  773. r'look_at|low_error_factor|mandel|map_type|marble|material_map|'
  774. r'matrix|max|max_intersections|max_iteration|max_trace_level|'
  775. r'max_value|metallic|min|minimum_reuse|mod|mortar|'
  776. r'nearest_count|no|normal|normal_map|no_shadow|number_of_waves|'
  777. r'octaves|off|offset|omega|omnimax|on|once|onion|open|'
  778. r'orthographic|panoramic|pattern1|pattern2|pattern3|'
  779. r'perspective|pgm|phase|phong|phong_size|pi|pigment|'
  780. r'pigment_map|planar_mapping|png|point_at|pot|pow|ppm|'
  781. r'precision|pwr|quadratic_spline|quaternion|quick_color|'
  782. r'quick_colour|quilted|radial|radians|radiosity|radius|rainbow|'
  783. r'ramp_wave|rand|range|reciprocal|recursion_limit|red|'
  784. r'reflection|refraction|render|repeat|rgb|rgbf|rgbft|rgbt|'
  785. r'right|ripples|rotate|roughness|samples|scale|scallop_wave|'
  786. r'scattering|seed|shadowless|sin|sine_wave|sinh|sky|sky_sphere|'
  787. r'slice|slope_map|smooth|specular|spherical_mapping|spiral|'
  788. r'spiral1|spiral2|spotlight|spotted|sqr|sqrt|statistics|str|'
  789. r'strcmp|strength|strlen|strlwr|strupr|sturm|substr|switch|sys|'
  790. r't|tan|tanh|test_camera_1|test_camera_2|test_camera_3|'
  791. r'test_camera_4|texture|texture_map|tga|thickness|threshold|'
  792. r'tightness|tile2|tiles|track|transform|translate|transmit|'
  793. r'triangle_wave|true|ttf|turbulence|turb_depth|type|'
  794. r'ultra_wide_angle|up|use_color|use_colour|use_index|u_steps|'
  795. r'val|variance|vaxis_rotate|vcross|vdot|version|vlength|'
  796. r'vnormalize|volume_object|volume_rendered|vol_with_light|'
  797. r'vrotate|v_steps|warning|warp|water_level|waves|while|width|'
  798. r'wood|wrinkles|yes)\b', Keyword),
  799. (r'bicubic_patch|blob|box|camera|cone|cubic|cylinder|difference|'
  800. r'disc|height_field|intersection|julia_fractal|lathe|'
  801. r'light_source|merge|mesh|object|plane|poly|polygon|prism|'
  802. r'quadric|quartic|smooth_triangle|sor|sphere|superellipsoid|'
  803. r'text|torus|triangle|union', Name.Builtin),
  804. # TODO: <=, etc
  805. (r'[\[\](){}<>;,]', Punctuation),
  806. (r'[-+*/=]', Operator),
  807. (r'\b(x|y|z|u|v)\b', Name.Builtin.Pseudo),
  808. (r'[a-zA-Z_][a-zA-Z_0-9]*', Name),
  809. (r'[0-9]+\.[0-9]*', Number.Float),
  810. (r'\.[0-9]+', Number.Float),
  811. (r'[0-9]+', Number.Integer),
  812. (r'\s+', Text),
  813. ]
  814. }
  815. class AppleScriptLexer(RegexLexer):
  816. """
  817. For `AppleScript source code
  818. <http://developer.apple.com/documentation/AppleScript/
  819. Conceptual/AppleScriptLangGuide>`_,
  820. including `AppleScript Studio
  821. <http://developer.apple.com/documentation/AppleScript/
  822. Reference/StudioReference>`_.
  823. Contributed by Andreas Amann <aamann@mac.com>.
  824. """
  825. name = 'AppleScript'
  826. aliases = ['applescript']
  827. filenames = ['*.applescript']
  828. flags = re.MULTILINE | re.DOTALL
  829. Identifiers = r'[a-zA-Z]\w*'
  830. Literals = ['AppleScript', 'current application', 'false', 'linefeed',
  831. 'missing value', 'pi','quote', 'result', 'return', 'space',
  832. 'tab', 'text item delimiters', 'true', 'version']
  833. Classes = ['alias ', 'application ', 'boolean ', 'class ', 'constant ',
  834. 'date ', 'file ', 'integer ', 'list ', 'number ', 'POSIX file ',
  835. 'real ', 'record ', 'reference ', 'RGB color ', 'script ',
  836. 'text ', 'unit types', '(Unicode )?text', 'string']
  837. BuiltIn = ['attachment', 'attribute run', 'character', 'day', 'month',
  838. 'paragraph', 'word', 'year']
  839. HandlerParams = ['about', 'above', 'against', 'apart from', 'around',
  840. 'aside from', 'at', 'below', 'beneath', 'beside',
  841. 'between', 'for', 'given', 'instead of', 'on', 'onto',
  842. 'out of', 'over', 'since']
  843. Commands = ['ASCII (character|number)', 'activate', 'beep', 'choose URL',
  844. 'choose application', 'choose color', 'choose file( name)?',
  845. 'choose folder', 'choose from list',
  846. 'choose remote application', 'clipboard info',
  847. 'close( access)?', 'copy', 'count', 'current date', 'delay',
  848. 'delete', 'display (alert|dialog)', 'do shell script',
  849. 'duplicate', 'exists', 'get eof', 'get volume settings',
  850. 'info for', 'launch', 'list (disks|folder)', 'load script',
  851. 'log', 'make', 'mount volume', 'new', 'offset',
  852. 'open( (for access|location))?', 'path to', 'print', 'quit',
  853. 'random number', 'read', 'round', 'run( script)?',
  854. 'say', 'scripting components',
  855. 'set (eof|the clipboard to|volume)', 'store script',
  856. 'summarize', 'system attribute', 'system info',
  857. 'the clipboard', 'time to GMT', 'write', 'quoted form']
  858. References = ['(in )?back of', '(in )?front of', '[0-9]+(st|nd|rd|th)',
  859. 'first', 'second', 'third', 'fourth', 'fifth', 'sixth',
  860. 'seventh', 'eighth', 'ninth', 'tenth', 'after', 'back',
  861. 'before', 'behind', 'every', 'front', 'index', 'last',
  862. 'middle', 'some', 'that', 'through', 'thru', 'where', 'whose']
  863. Operators = ["and", "or", "is equal", "equals", "(is )?equal to", "is not",
  864. "isn't", "isn't equal( to)?", "is not equal( to)?",
  865. "doesn't equal", "does not equal", "(is )?greater than",
  866. "comes after", "is not less than or equal( to)?",
  867. "isn't less than or equal( to)?", "(is )?less than",
  868. "comes before", "is not greater than or equal( to)?",
  869. "isn't greater than or equal( to)?",
  870. "(is )?greater than or equal( to)?", "is not less than",
  871. "isn't less than", "does not come before",
  872. "doesn't come before", "(is )?less than or equal( to)?",
  873. "is not greater than", "isn't greater than",
  874. "does not come after", "doesn't come after", "starts? with",
  875. "begins? with", "ends? with", "contains?", "does not contain",
  876. "doesn't contain", "is in", "is contained by", "is not in",
  877. "is not contained by", "isn't contained by", "div", "mod",
  878. "not", "(a )?(ref( to)?|reference to)", "is", "does"]
  879. Control = ['considering', 'else', 'error', 'exit', 'from', 'if',
  880. 'ignoring', 'in', 'repeat', 'tell', 'then', 'times', 'to',
  881. 'try', 'until', 'using terms from', 'while', 'whith',
  882. 'with timeout( of)?', 'with transaction', 'by', 'continue',
  883. 'end', 'its?', 'me', 'my', 'return', 'of' , 'as']
  884. Declarations = ['global', 'local', 'prop(erty)?', 'set', 'get']
  885. Reserved = ['but', 'put', 'returning', 'the']
  886. StudioClasses = ['action cell', 'alert reply', 'application', 'box',
  887. 'browser( cell)?', 'bundle', 'button( cell)?', 'cell',
  888. 'clip view', 'color well', 'color-panel',
  889. 'combo box( item)?', 'control',
  890. 'data( (cell|column|item|row|source))?', 'default entry',
  891. 'dialog reply', 'document', 'drag info', 'drawer',
  892. 'event', 'font(-panel)?', 'formatter',
  893. 'image( (cell|view))?', 'matrix', 'menu( item)?', 'item',
  894. 'movie( view)?', 'open-panel', 'outline view', 'panel',
  895. 'pasteboard', 'plugin', 'popup button',
  896. 'progress indicator', 'responder', 'save-panel',
  897. 'scroll view', 'secure text field( cell)?', 'slider',
  898. 'sound', 'split view', 'stepper', 'tab view( item)?',
  899. 'table( (column|header cell|header view|view))',
  900. 'text( (field( cell)?|view))?', 'toolbar( item)?',
  901. 'user-defaults', 'view', 'window']
  902. StudioEvents = ['accept outline drop', 'accept table drop', 'action',
  903. 'activated', 'alert ended', 'awake from nib', 'became key',
  904. 'became main', 'begin editing', 'bounds changed',
  905. 'cell value', 'cell value changed', 'change cell value',
  906. 'change item value', 'changed', 'child of item',
  907. 'choose menu item', 'clicked', 'clicked toolbar item',
  908. 'closed', 'column clicked', 'column moved',
  909. 'column resized', 'conclude drop', 'data representation',
  910. 'deminiaturized', 'dialog ended', 'document nib name',
  911. 'double clicked', 'drag( (entered|exited|updated))?',
  912. 'drop', 'end editing', 'exposed', 'idle', 'item expandable',
  913. 'item value', 'item value changed', 'items changed',
  914. 'keyboard down', 'keyboard up', 'launched',
  915. 'load data representation', 'miniaturized', 'mouse down',
  916. 'mouse dragged', 'mouse entered', 'mouse exited',
  917. 'mouse moved', 'mouse up', 'moved',
  918. 'number of browser rows', 'number of items',
  919. 'number of rows', 'open untitled', 'opened', 'panel ended',
  920. 'parameters updated', 'plugin loaded', 'prepare drop',
  921. 'prepare outline drag', 'prepare outline drop',
  922. 'prepare table drag', 'prepare table drop',
  923. 'read from file', 'resigned active', 'resigned key',
  924. 'resigned main', 'resized( sub views)?',
  925. 'right mouse down', 'right mouse dragged',
  926. 'right mouse up', 'rows changed', 'scroll wheel',
  927. 'selected tab view item', 'selection changed',
  928. 'selection changing', 'should begin editing',
  929. 'should close', 'should collapse item',
  930. 'should end editing', 'should expand item',
  931. 'should open( untitled)?',
  932. 'should quit( after last window closed)?',
  933. 'should select column', 'should select item',
  934. 'should select row', 'should select tab view item',
  935. 'should selection change', 'should zoom', 'shown',
  936. 'update menu item', 'update parameters',
  937. 'update toolbar item', 'was hidden', 'was miniaturized',
  938. 'will become active', 'will close', 'will dismiss',
  939. 'will display browser cell', 'will display cell',
  940. 'will display item cell', 'will display outline cell',
  941. 'will finish launching', 'will hide', 'will miniaturize',
  942. 'will move', 'will open', 'will pop up', 'will quit',
  943. 'will resign active', 'will resize( sub views)?',
  944. 'will select tab view item', 'will show', 'will zoom',
  945. 'write to file', 'zoomed']
  946. StudioCommands = ['animate', 'append', 'call method', 'center',
  947. 'close drawer', 'close panel', 'display',
  948. 'display alert', 'display dialog', 'display panel', 'go',
  949. 'hide', 'highlight', 'increment', 'item for',
  950. 'load image', 'load movie', 'load nib', 'load panel',
  951. 'load sound', 'localized string', 'lock focus', 'log',
  952. 'open drawer', 'path for', 'pause', 'perform action',
  953. 'play', 'register', 'resume', 'scroll', 'select( all)?',
  954. 'show', 'size to fit', 'start', 'step back',
  955. 'step forward', 'stop', 'synchronize', 'unlock focus',
  956. 'update']
  957. StudioProperties = ['accepts arrow key', 'action method', 'active',
  958. 'alignment', 'allowed identifiers',
  959. 'allows branch selection', 'allows column reordering',
  960. 'allows column resizing', 'allows column selection',
  961. 'allows customization',
  962. 'allows editing text attributes',
  963. 'allows empty selection', 'allows mixed state',
  964. 'allows multiple selection', 'allows reordering',
  965. 'allows undo', 'alpha( value)?', 'alternate image',
  966. 'alternate increment value', 'alternate title',
  967. 'animation delay', 'associated file name',
  968. 'associated object', 'auto completes', 'auto display',
  969. 'auto enables items', 'auto repeat',
  970. 'auto resizes( outline column)?',
  971. 'auto save expanded items', 'auto save name',
  972. 'auto save table columns', 'auto saves configuration',
  973. 'auto scroll', 'auto sizes all columns to fit',
  974. 'auto sizes cells', 'background color', 'bezel state',
  975. 'bezel style', 'bezeled', 'border rect', 'border type',
  976. 'bordered', 'bounds( rotation)?', 'box type',
  977. 'button returned', 'button type',
  978. 'can choose directories', 'can choose files',
  979. 'can draw', 'can hide',
  980. 'cell( (background color|size|type))?', 'characters',
  981. 'class', 'click count', 'clicked( data)? column',
  982. 'clicked data item', 'clicked( data)? row',
  983. 'closeable', 'collating', 'color( (mode|panel))',
  984. 'command key down', 'configuration',
  985. 'content(s| (size|view( margins)?))?', 'context',
  986. 'continuous', 'control key down', 'control size',
  987. 'control tint', 'control view',
  988. 'controller visible', 'coordinate system',
  989. 'copies( on scroll)?', 'corner view', 'current cell',
  990. 'current column', 'current( field)? editor',
  991. 'current( menu)? item', 'current row',
  992. 'current tab view item', 'data source',
  993. 'default identifiers', 'delta (x|y|z)',
  994. 'destination window', 'directory', 'display mode',
  995. 'displayed cell', 'document( (edited|rect|view))?',
  996. 'double value', 'dragged column', 'dragged distance',
  997. 'dragged items', 'draws( cell)? background',
  998. 'draws grid', 'dynamically scrolls', 'echos bullets',
  999. 'edge', 'editable', 'edited( data)? column',
  1000. 'edited data item', 'edited( data)? row', 'enabled',
  1001. 'enclosing scroll view', 'ending page',
  1002. 'error handling', 'event number', 'event type',
  1003. 'excluded from windows menu', 'executable path',
  1004. 'expanded', 'fax number', 'field editor', 'file kind',
  1005. 'file name', 'file type', 'first responder',
  1006. 'first visible column', 'flipped', 'floating',
  1007. 'font( panel)?', 'formatter', 'frameworks path',
  1008. 'frontmost', 'gave up', 'grid color', 'has data items',
  1009. 'has horizontal ruler', 'has horizontal scroller',
  1010. 'has parent data item', 'has resize indicator',
  1011. 'has shadow', 'has sub menu', 'has vertical ruler',
  1012. 'has vertical scroller', 'header cell', 'header view',
  1013. 'hidden', 'hides when deactivated', 'highlights by',
  1014. 'horizontal line scroll', 'horizontal page scroll',
  1015. 'horizontal ruler view', 'horizontally resizable',
  1016. 'icon image', 'id', 'identifier',
  1017. 'ignores multiple clicks',
  1018. 'image( (alignment|dims when disabled|frame style|'
  1019. 'scaling))?',
  1020. 'imports graphics', 'increment value',
  1021. 'indentation per level', 'indeterminate', 'index',
  1022. 'integer value', 'intercell spacing', 'item height',
  1023. 'key( (code|equivalent( modifier)?|window))?',
  1024. 'knob thickness', 'label', 'last( visible)? column',
  1025. 'leading offset', 'leaf', 'level', 'lineā€¦

Large files files are truncated, but you can click here to view the full file