foxpro.py 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. """
  2. pygments.lexers.foxpro
  3. ~~~~~~~~~~~~~~~~~~~~~~
  4. Simple lexer for Microsoft Visual FoxPro source code.
  5. :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
  6. :license: BSD, see LICENSE for details.
  7. """
  8. import re
  9. from pygments.lexer import RegexLexer
  10. from pygments.token import Punctuation, Text, Comment, Operator, Keyword, \
  11. Name, String
  12. __all__ = ['FoxProLexer']
  13. class FoxProLexer(RegexLexer):
  14. """Lexer for Microsoft Visual FoxPro language.
  15. FoxPro syntax allows to shorten all keywords and function names
  16. to 4 characters. Shortened forms are not recognized by this lexer.
  17. .. versionadded:: 1.6
  18. """
  19. name = 'FoxPro'
  20. aliases = ['foxpro', 'vfp', 'clipper', 'xbase']
  21. filenames = ['*.PRG', '*.prg']
  22. mimetype = []
  23. flags = re.IGNORECASE | re.MULTILINE
  24. tokens = {
  25. 'root': [
  26. (r';\s*\n', Punctuation), # consume newline
  27. (r'(^|\n)\s*', Text, 'newline'),
  28. # Square brackets may be used for array indices
  29. # and for string literal. Look for arrays
  30. # before matching string literals.
  31. (r'(?<=\w)\[[0-9, ]+\]', Text),
  32. (r'\'[^\'\n]*\'|"[^"\n]*"|\[[^]*]\]', String),
  33. (r'(^\s*\*|&&|&amp;&amp;).*?\n', Comment.Single),
  34. (r'(ABS|ACLASS|ACOPY|ACOS|ADATABASES|ADBOBJECTS|ADDBS|'
  35. r'ADDPROPERTY|ADEL|ADIR|ADLLS|ADOCKSTATE|AELEMENT|AERROR|'
  36. r'AEVENTS|AFIELDS|AFONT|AGETCLASS|AGETFILEVERSION|AINS|'
  37. r'AINSTANCE|ALANGUAGE|ALEN|ALIAS|ALINES|ALLTRIM|'
  38. r'AMEMBERS|AMOUSEOBJ|ANETRESOURCES|APRINTERS|APROCINFO|'
  39. r'ASC|ASCAN|ASELOBJ|ASESSIONS|ASIN|ASORT|ASQLHANDLES|'
  40. r'ASTACKINFO|ASUBSCRIPT|AT|AT_C|ATAGINFO|ATAN|ATC|ATCC|'
  41. r'ATCLINE|ATLINE|ATN2|AUSED|AVCXCLASSES|BAR|BARCOUNT|'
  42. r'BARPROMPT|BETWEEN|BINDEVENT|BINTOC|BITAND|BITCLEAR|'
  43. r'BITLSHIFT|BITNOT|BITOR|BITRSHIFT|BITSET|BITTEST|BITXOR|'
  44. r'BOF|CANDIDATE|CAPSLOCK|CAST|CDOW|CDX|CEILING|CHR|CHRSAW|'
  45. r'CHRTRAN|CHRTRANC|CLEARRESULTSET|CMONTH|CNTBAR|CNTPAD|COL|'
  46. r'COM|Functions|COMARRAY|COMCLASSINFO|COMPOBJ|COMPROP|'
  47. r'COMRETURNERROR|COS|CPCONVERT|CPCURRENT|CPDBF|CREATEBINARY|'
  48. r'CREATEOBJECT|CREATEOBJECTEX|CREATEOFFLINE|CTOBIN|CTOD|'
  49. r'CTOT|CURDIR|CURSORGETPROP|CURSORSETPROP|CURSORTOXML|'
  50. r'CURVAL|DATE|DATETIME|DAY|DBC|DBF|DBGETPROP|DBSETPROP|'
  51. r'DBUSED|DDEAbortTrans|DDEAdvise|DDEEnabled|DDEExecute|'
  52. r'DDEInitiate|DDELastError|DDEPoke|DDERequest|DDESetOption|'
  53. r'DDESetService|DDESetTopic|DDETerminate|DEFAULTEXT|'
  54. r'DELETED|DESCENDING|DIFFERENCE|DIRECTORY|DISKSPACE|'
  55. r'DisplayPath|DMY|DODEFAULT|DOW|DRIVETYPE|DROPOFFLINE|'
  56. r'DTOC|DTOR|DTOS|DTOT|EDITSOURCE|EMPTY|EOF|ERROR|EVAL(UATE)?|'
  57. r'EVENTHANDLER|EVL|EXECSCRIPT|EXP|FCHSIZE|FCLOSE|FCOUNT|'
  58. r'FCREATE|FDATE|FEOF|FERROR|FFLUSH|FGETS|FIELD|FILE|'
  59. r'FILETOSTR|FILTER|FKLABEL|FKMAX|FLDLIST|FLOCK|FLOOR|'
  60. r'FONTMETRIC|FOPEN|FOR|FORCEEXT|FORCEPATH|FOUND|FPUTS|'
  61. r'FREAD|FSEEK|FSIZE|FTIME|FULLPATH|FV|FWRITE|'
  62. r'GETAUTOINCVALUE|GETBAR|GETCOLOR|GETCP|GETDIR|GETENV|'
  63. r'GETFILE|GETFLDSTATE|GETFONT|GETINTERFACE|'
  64. r'GETNEXTMODIFIED|GETOBJECT|GETPAD|GETPEM|GETPICT|'
  65. r'GETPRINTER|GETRESULTSET|GETWORDCOUNT|GETWORDNUM|'
  66. r'GETCURSORADAPTER|GOMONTH|HEADER|HOME|HOUR|ICASE|'
  67. r'IDXCOLLATE|IIF|IMESTATUS|INDBC|INDEXSEEK|INKEY|INLIST|'
  68. r'INPUTBOX|INSMODE|INT|ISALPHA|ISBLANK|ISCOLOR|ISDIGIT|'
  69. r'ISEXCLUSIVE|ISFLOCKED|ISLEADBYTE|ISLOWER|ISMEMOFETCHED|'
  70. r'ISMOUSE|ISNULL|ISPEN|ISREADONLY|ISRLOCKED|'
  71. r'ISTRANSACTABLE|ISUPPER|JUSTDRIVE|JUSTEXT|JUSTFNAME|'
  72. r'JUSTPATH|JUSTSTEM|KEY|KEYMATCH|LASTKEY|LEFT|LEFTC|LEN|'
  73. r'LENC|LIKE|LIKEC|LINENO|LOADPICTURE|LOCFILE|LOCK|LOG|'
  74. r'LOG10|LOOKUP|LOWER|LTRIM|LUPDATE|MAKETRANSACTABLE|MAX|'
  75. r'MCOL|MDOWN|MDX|MDY|MEMLINES|MEMORY|MENU|MESSAGE|'
  76. r'MESSAGEBOX|MIN|MINUTE|MLINE|MOD|MONTH|MRKBAR|MRKPAD|'
  77. r'MROW|MTON|MWINDOW|NDX|NEWOBJECT|NORMALIZE|NTOM|NUMLOCK|'
  78. r'NVL|OBJNUM|OBJTOCLIENT|OBJVAR|OCCURS|OEMTOANSI|OLDVAL|'
  79. r'ON|ORDER|OS|PAD|PADL|PARAMETERS|PAYMENT|PCOL|PCOUNT|'
  80. r'PEMSTATUS|PI|POPUP|PRIMARY|PRINTSTATUS|PRMBAR|PRMPAD|'
  81. r'PROGRAM|PROMPT|PROPER|PROW|PRTINFO|PUTFILE|PV|QUARTER|'
  82. r'RAISEEVENT|RAND|RAT|RATC|RATLINE|RDLEVEL|READKEY|RECCOUNT|'
  83. r'RECNO|RECSIZE|REFRESH|RELATION|REPLICATE|REQUERY|RGB|'
  84. r'RGBSCHEME|RIGHT|RIGHTC|RLOCK|ROUND|ROW|RTOD|RTRIM|'
  85. r'SAVEPICTURE|SCHEME|SCOLS|SEC|SECONDS|SEEK|SELECT|SET|'
  86. r'SETFLDSTATE|SETRESULTSET|SIGN|SIN|SKPBAR|SKPPAD|SOUNDEX|'
  87. r'SPACE|SQLCANCEL|SQLCOLUMNS|SQLCOMMIT|SQLCONNECT|'
  88. r'SQLDISCONNECT|SQLEXEC|SQLGETPROP|SQLIDLEDISCONNECT|'
  89. r'SQLMORERESULTS|SQLPREPARE|SQLROLLBACK|SQLSETPROP|'
  90. r'SQLSTRINGCONNECT|SQLTABLES|SQRT|SROWS|STR|STRCONV|'
  91. r'STREXTRACT|STRTOFILE|STRTRAN|STUFF|STUFFC|SUBSTR|'
  92. r'SUBSTRC|SYS|SYSMETRIC|TABLEREVERT|TABLEUPDATE|TAG|'
  93. r'TAGCOUNT|TAGNO|TAN|TARGET|TEXTMERGE|TIME|TRANSFORM|'
  94. r'TRIM|TTOC|TTOD|TXNLEVEL|TXTWIDTH|TYPE|UNBINDEVENTS|'
  95. r'UNIQUE|UPDATED|UPPER|USED|VAL|VARREAD|VARTYPE|VERSION|'
  96. r'WBORDER|WCHILD|WCOLS|WDOCKABLE|WEEK|WEXIST|WFONT|WLAST|'
  97. r'WLCOL|WLROW|WMAXIMUM|WMINIMUM|WONTOP|WOUTPUT|WPARENT|'
  98. r'WREAD|WROWS|WTITLE|WVISIBLE|XMLTOCURSOR|XMLUPDATEGRAM|'
  99. r'YEAR)(?=\s*\()', Name.Function),
  100. (r'_ALIGNMENT|_ASCIICOLS|_ASCIIROWS|_ASSIST|_BEAUTIFY|_BOX|'
  101. r'_BROWSER|_BUILDER|_CALCMEM|_CALCVALUE|_CLIPTEXT|_CONVERTER|'
  102. r'_COVERAGE|_CUROBJ|_DBLCLICK|_DIARYDATE|_DOS|_FOXDOC|_FOXREF|'
  103. r'_GALLERY|_GENGRAPH|_GENHTML|_GENMENU|_GENPD|_GENSCRN|'
  104. r'_GENXTAB|_GETEXPR|_INCLUDE|_INCSEEK|_INDENT|_LMARGIN|_MAC|'
  105. r'_MENUDESIGNER|_MLINE|_PADVANCE|_PAGENO|_PAGETOTAL|_PBPAGE|'
  106. r'_PCOLNO|_PCOPIES|_PDRIVER|_PDSETUP|_PECODE|_PEJECT|_PEPAGE|'
  107. r'_PLENGTH|_PLINENO|_PLOFFSET|_PPITCH|_PQUALITY|_PRETEXT|'
  108. r'_PSCODE|_PSPACING|_PWAIT|_RMARGIN|_REPORTBUILDER|'
  109. r'_REPORTOUTPUT|_REPORTPREVIEW|_SAMPLES|_SCCTEXT|_SCREEN|'
  110. r'_SHELL|_SPELLCHK|_STARTUP|_TABS|_TALLY|_TASKPANE|_TEXT|'
  111. r'_THROTTLE|_TOOLBOX|_TOOLTIPTIMEOUT|_TRANSPORT|_TRIGGERLEVEL|'
  112. r'_UNIX|_VFP|_WINDOWS|_WIZARD|_WRAP', Keyword.Pseudo),
  113. (r'THISFORMSET|THISFORM|THIS', Name.Builtin),
  114. (r'Application|CheckBox|Collection|Column|ComboBox|'
  115. r'CommandButton|CommandGroup|Container|Control|CursorAdapter|'
  116. r'Cursor|Custom|DataEnvironment|DataObject|EditBox|'
  117. r'Empty|Exception|Fields|Files|File|FormSet|Form|FoxCode|'
  118. r'Grid|Header|Hyperlink|Image|Label|Line|ListBox|Objects|'
  119. r'OptionButton|OptionGroup|PageFrame|Page|ProjectHook|Projects|'
  120. r'Project|Relation|ReportListener|Separator|Servers|Server|'
  121. r'Session|Shape|Spinner|Tables|TextBox|Timer|ToolBar|'
  122. r'XMLAdapter|XMLField|XMLTable', Name.Class),
  123. (r'm\.[a-z_]\w*', Name.Variable),
  124. (r'\.(F|T|AND|OR|NOT|NULL)\.|\b(AND|OR|NOT|NULL)\b', Operator.Word),
  125. (r'\.(ActiveColumn|ActiveControl|ActiveForm|ActivePage|'
  126. r'ActiveProject|ActiveRow|AddLineFeeds|ADOCodePage|Alias|'
  127. r'Alignment|Align|AllowAddNew|AllowAutoColumnFit|'
  128. r'AllowCellSelection|AllowDelete|AllowHeaderSizing|'
  129. r'AllowInsert|AllowModalMessages|AllowOutput|AllowRowSizing|'
  130. r'AllowSimultaneousFetch|AllowTabs|AllowUpdate|'
  131. r'AlwaysOnBottom|AlwaysOnTop|Anchor|Application|'
  132. r'AutoActivate|AutoCenter|AutoCloseTables|AutoComplete|'
  133. r'AutoCompSource|AutoCompTable|AutoHideScrollBar|'
  134. r'AutoIncrement|AutoOpenTables|AutoRelease|AutoSize|'
  135. r'AutoVerbMenu|AutoYield|BackColor|ForeColor|BackStyle|'
  136. r'BaseClass|BatchUpdateCount|BindControls|BorderColor|'
  137. r'BorderStyle|BorderWidth|BoundColumn|BoundTo|Bound|'
  138. r'BreakOnError|BufferModeOverride|BufferMode|'
  139. r'BuildDateTime|ButtonCount|Buttons|Cancel|Caption|'
  140. r'Centered|Century|ChildAlias|ChildOrder|ChildTable|'
  141. r'ClassLibrary|Class|ClipControls|Closable|CLSID|CodePage|'
  142. r'ColorScheme|ColorSource|ColumnCount|ColumnLines|'
  143. r'ColumnOrder|Columns|ColumnWidths|CommandClauses|'
  144. r'Comment|CompareMemo|ConflictCheckCmd|ConflictCheckType|'
  145. r'ContinuousScroll|ControlBox|ControlCount|Controls|'
  146. r'ControlSource|ConversionFunc|Count|CurrentControl|'
  147. r'CurrentDataSession|CurrentPass|CurrentX|CurrentY|'
  148. r'CursorSchema|CursorSource|CursorStatus|Curvature|'
  149. r'Database|DataSessionID|DataSession|DataSourceType|'
  150. r'DataSource|DataType|DateFormat|DateMark|Debug|'
  151. r'DeclareXMLPrefix|DEClassLibrary|DEClass|DefaultFilePath|'
  152. r'Default|DefOLELCID|DeleteCmdDataSourceType|DeleteCmdDataSource|'
  153. r'DeleteCmd|DeleteMark|Description|Desktop|'
  154. r'Details|DisabledBackColor|DisabledForeColor|'
  155. r'DisabledItemBackColor|DisabledItemForeColor|'
  156. r'DisabledPicture|DisableEncode|DisplayCount|'
  157. r'DisplayValue|Dockable|Docked|DockPosition|'
  158. r'DocumentFile|DownPicture|DragIcon|DragMode|DrawMode|'
  159. r'DrawStyle|DrawWidth|DynamicAlignment|DynamicBackColor|'
  160. r'DynamicForeColor|DynamicCurrentControl|DynamicFontBold|'
  161. r'DynamicFontItalic|DynamicFontStrikethru|'
  162. r'DynamicFontUnderline|DynamicFontName|DynamicFontOutline|'
  163. r'DynamicFontShadow|DynamicFontSize|DynamicInputMask|'
  164. r'DynamicLineHeight|EditorOptions|Enabled|'
  165. r'EnableHyperlinks|Encrypted|ErrorNo|Exclude|Exclusive|'
  166. r'FetchAsNeeded|FetchMemoCmdList|FetchMemoDataSourceType|'
  167. r'FetchMemoDataSource|FetchMemo|FetchSize|'
  168. r'FileClassLibrary|FileClass|FillColor|FillStyle|Filter|'
  169. r'FirstElement|FirstNestedTable|Flags|FontBold|FontItalic|'
  170. r'FontStrikethru|FontUnderline|FontCharSet|FontCondense|'
  171. r'FontExtend|FontName|FontOutline|FontShadow|FontSize|'
  172. r'ForceCloseTag|Format|FormCount|FormattedOutput|Forms|'
  173. r'FractionDigits|FRXDataSession|FullName|GDIPlusGraphics|'
  174. r'GridLineColor|GridLines|GridLineWidth|HalfHeightCaption|'
  175. r'HeaderClassLibrary|HeaderClass|HeaderHeight|Height|'
  176. r'HelpContextID|HideSelection|HighlightBackColor|'
  177. r'HighlightForeColor|HighlightStyle|HighlightRowLineWidth|'
  178. r'HighlightRow|Highlight|HomeDir|Hours|HostName|'
  179. r'HScrollSmallChange|hWnd|Icon|IncrementalSearch|Increment|'
  180. r'InitialSelectedAlias|InputMask|InsertCmdDataSourceType|'
  181. r'InsertCmdDataSource|InsertCmdRefreshCmd|'
  182. r'InsertCmdRefreshFieldList|InsertCmdRefreshKeyFieldList|'
  183. r'InsertCmd|Instancing|IntegralHeight|'
  184. r'Interval|IMEMode|IsAttribute|IsBase64|IsBinary|IsNull|'
  185. r'IsDiffGram|IsLoaded|ItemBackColor,|ItemData|ItemIDData|'
  186. r'ItemTips|IXMLDOMElement|KeyboardHighValue|KeyboardLowValue|'
  187. r'Keyfield|KeyFieldList|KeyPreview|KeySort|LanguageOptions|'
  188. r'LeftColumn|Left|LineContents|LineNo|LineSlant|LinkMaster|'
  189. r'ListCount|ListenerType|ListIndex|ListItemID|ListItem|'
  190. r'List|LockColumnsLeft|LockColumns|LockScreen|MacDesktop|'
  191. r'MainFile|MapN19_4ToCurrency|MapBinary|MapVarchar|Margin|'
  192. r'MaxButton|MaxHeight|MaxLeft|MaxLength|MaxRecords|MaxTop|'
  193. r'MaxWidth|MDIForm|MemberClassLibrary|MemberClass|'
  194. r'MemoWindow|Message|MinButton|MinHeight|MinWidth|'
  195. r'MouseIcon|MousePointer|Movable|MoverBars|MultiSelect|'
  196. r'Name|NestedInto|NewIndex|NewItemID|NextSiblingTable|'
  197. r'NoCpTrans|NoDataOnLoad|NoData|NullDisplay|'
  198. r'NumberOfElements|Object|OLEClass|OLEDragMode|'
  199. r'OLEDragPicture|OLEDropEffects|OLEDropHasData|'
  200. r'OLEDropMode|OLEDropTextInsertion|OLELCID|'
  201. r'OLERequestPendingTimeout|OLEServerBusyRaiseError|'
  202. r'OLEServerBusyTimeout|OLETypeAllowed|OneToMany|'
  203. r'OpenViews|OpenWindow|Optimize|OrderDirection|Order|'
  204. r'OutputPageCount|OutputType|PageCount|PageHeight|'
  205. r'PageNo|PageOrder|Pages|PageTotal|PageWidth|'
  206. r'PanelLink|Panel|ParentAlias|ParentClass|ParentTable|'
  207. r'Parent|Partition|PasswordChar|PictureMargin|'
  208. r'PicturePosition|PictureSpacing|PictureSelectionDisplay|'
  209. r'PictureVal|Picture|Prepared|'
  210. r'PolyPoints|PreserveWhiteSpace|PreviewContainer|'
  211. r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHookClass|'
  212. r'ProjectHookLibrary|ProjectHook|QuietMode|'
  213. r'ReadCycle|ReadLock|ReadMouse|ReadObject|ReadOnly|'
  214. r'ReadSave|ReadTimeout|RecordMark|RecordSourceType|'
  215. r'RecordSource|RefreshAlias|'
  216. r'RefreshCmdDataSourceType|RefreshCmdDataSource|RefreshCmd|'
  217. r'RefreshIgnoreFieldList|RefreshTimeStamp|RelationalExpr|'
  218. r'RelativeColumn|RelativeRow|ReleaseType|Resizable|'
  219. r'RespectCursorCP|RespectNesting|RightToLeft|RotateFlip|'
  220. r'Rotation|RowColChange|RowHeight|RowSourceType|'
  221. r'RowSource|ScaleMode|SCCProvider|SCCStatus|ScrollBars|'
  222. r'Seconds|SelectCmd|SelectedID|'
  223. r'SelectedItemBackColor|SelectedItemForeColor|Selected|'
  224. r'SelectionNamespaces|SelectOnEntry|SelLength|SelStart|'
  225. r'SelText|SendGDIPlusImage|SendUpdates|ServerClassLibrary|'
  226. r'ServerClass|ServerHelpFile|ServerName|'
  227. r'ServerProject|ShowTips|ShowInTaskbar|ShowWindow|'
  228. r'Sizable|SizeBox|SOM|Sorted|Sparse|SpecialEffect|'
  229. r'SpinnerHighValue|SpinnerLowValue|SplitBar|StackLevel|'
  230. r'StartMode|StatusBarText|StatusBar|Stretch|StrictDateEntry|'
  231. r'Style|TabIndex|Tables|TabOrientation|Tabs|TabStop|'
  232. r'TabStretch|TabStyle|Tag|TerminateRead|Text|Themes|'
  233. r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|'
  234. r'TopIndex|TopItemID|Top|TwoPassProcess|TypeLibCLSID|'
  235. r'TypeLibDesc|TypeLibName|Type|Unicode|UpdatableFieldList|'
  236. r'UpdateCmdDataSourceType|UpdateCmdDataSource|'
  237. r'UpdateCmdRefreshCmd|UpdateCmdRefreshFieldList|'
  238. r'UpdateCmdRefreshKeyFieldList|UpdateCmd|'
  239. r'UpdateGramSchemaLocation|UpdateGram|UpdateNameList|UpdateType|'
  240. r'UseCodePage|UseCursorSchema|UseDeDataSource|UseMemoSize|'
  241. r'UserValue|UseTransactions|UTF8Encoded|Value|VersionComments|'
  242. r'VersionCompany|VersionCopyright|VersionDescription|'
  243. r'VersionNumber|VersionProduct|VersionTrademarks|Version|'
  244. r'VFPXMLProgID|ViewPortHeight|ViewPortLeft|'
  245. r'ViewPortTop|ViewPortWidth|VScrollSmallChange|View|Visible|'
  246. r'VisualEffect|WhatsThisButton|WhatsThisHelpID|WhatsThisHelp|'
  247. r'WhereType|Width|WindowList|WindowState|WindowType|WordWrap|'
  248. r'WrapCharInCDATA|WrapInCDATA|WrapMemoInCDATA|XMLAdapter|'
  249. r'XMLConstraints|XMLNameIsXPath|XMLNamespace|XMLName|'
  250. r'XMLPrefix|XMLSchemaLocation|XMLTable|XMLType|'
  251. r'XSDfractionDigits|XSDmaxLength|XSDtotalDigits|'
  252. r'XSDtype|ZoomBox)', Name.Attribute),
  253. (r'\.(ActivateCell|AddColumn|AddItem|AddListItem|AddObject|'
  254. r'AddProperty|AddTableSchema|AddToSCC|Add|'
  255. r'ApplyDiffgram|Attach|AutoFit|AutoOpen|Box|Build|'
  256. r'CancelReport|ChangesToCursor|CheckIn|CheckOut|Circle|'
  257. r'CleanUp|ClearData|ClearStatus|Clear|CloneObject|CloseTables|'
  258. r'Close|Cls|CursorAttach|CursorDetach|CursorFill|'
  259. r'CursorRefresh|DataToClip|DelayedMemoFetch|DeleteColumn|'
  260. r'Dock|DoMessage|DoScroll|DoStatus|DoVerb|Drag|Draw|Eval|'
  261. r'GetData|GetDockState|GetFormat|GetKey|GetLatestVersion|'
  262. r'GetPageHeight|GetPageWidth|Help|Hide|IncludePageInOutput|'
  263. r'IndexToItemID|ItemIDToIndex|Item|LoadXML|Line|Modify|'
  264. r'MoveItem|Move|Nest|OLEDrag|OnPreviewClose|OutputPage|'
  265. r'Point|Print|PSet|Quit|ReadExpression|ReadMethod|'
  266. r'RecordRefresh|Refresh|ReleaseXML|Release|RemoveFromSCC|'
  267. r'RemoveItem|RemoveListItem|RemoveObject|Remove|'
  268. r'Render|Requery|RequestData|ResetToDefault|Reset|Run|'
  269. r'SaveAsClass|SaveAs|SetAll|SetData|SetFocus|SetFormat|'
  270. r'SetMain|SetVar|SetViewPort|ShowWhatsThis|Show|'
  271. r'SupportsListenerType|TextHeight|TextWidth|ToCursor|'
  272. r'ToXML|UndoCheckOut|Unnest|UpdateStatus|WhatsThisMode|'
  273. r'WriteExpression|WriteMethod|ZOrder)', Name.Function),
  274. (r'\.(Activate|AdjustObjectSize|AfterBand|AfterBuild|'
  275. r'AfterCloseTables|AfterCursorAttach|AfterCursorClose|'
  276. r'AfterCursorDetach|AfterCursorFill|AfterCursorRefresh|'
  277. r'AfterCursorUpdate|AfterDelete|AfterInsert|'
  278. r'AfterRecordRefresh|AfterUpdate|AfterDock|AfterReport|'
  279. r'AfterRowColChange|BeforeBand|BeforeCursorAttach|'
  280. r'BeforeCursorClose|BeforeCursorDetach|BeforeCursorFill|'
  281. r'BeforeCursorRefresh|BeforeCursorUpdate|BeforeDelete|'
  282. r'BeforeInsert|BeforeDock|BeforeOpenTables|'
  283. r'BeforeRecordRefresh|BeforeReport|BeforeRowColChange|'
  284. r'BeforeUpdate|Click|dbc_Activate|dbc_AfterAddTable|'
  285. r'dbc_AfterAppendProc|dbc_AfterCloseTable|dbc_AfterCopyProc|'
  286. r'dbc_AfterCreateConnection|dbc_AfterCreateOffline|'
  287. r'dbc_AfterCreateTable|dbc_AfterCreateView|dbc_AfterDBGetProp|'
  288. r'dbc_AfterDBSetProp|dbc_AfterDeleteConnection|'
  289. r'dbc_AfterDropOffline|dbc_AfterDropTable|'
  290. r'dbc_AfterModifyConnection|dbc_AfterModifyProc|'
  291. r'dbc_AfterModifyTable|dbc_AfterModifyView|dbc_AfterOpenTable|'
  292. r'dbc_AfterRemoveTable|dbc_AfterRenameConnection|'
  293. r'dbc_AfterRenameTable|dbc_AfterRenameView|'
  294. r'dbc_AfterValidateData|dbc_BeforeAddTable|'
  295. r'dbc_BeforeAppendProc|dbc_BeforeCloseTable|'
  296. r'dbc_BeforeCopyProc|dbc_BeforeCreateConnection|'
  297. r'dbc_BeforeCreateOffline|dbc_BeforeCreateTable|'
  298. r'dbc_BeforeCreateView|dbc_BeforeDBGetProp|'
  299. r'dbc_BeforeDBSetProp|dbc_BeforeDeleteConnection|'
  300. r'dbc_BeforeDropOffline|dbc_BeforeDropTable|'
  301. r'dbc_BeforeModifyConnection|dbc_BeforeModifyProc|'
  302. r'dbc_BeforeModifyTable|dbc_BeforeModifyView|'
  303. r'dbc_BeforeOpenTable|dbc_BeforeRemoveTable|'
  304. r'dbc_BeforeRenameConnection|dbc_BeforeRenameTable|'
  305. r'dbc_BeforeRenameView|dbc_BeforeValidateData|'
  306. r'dbc_CloseData|dbc_Deactivate|dbc_ModifyData|dbc_OpenData|'
  307. r'dbc_PackData|DblClick|Deactivate|Deleted|Destroy|DoCmd|'
  308. r'DownClick|DragDrop|DragOver|DropDown|ErrorMessage|Error|'
  309. r'EvaluateContents|GotFocus|Init|InteractiveChange|KeyPress|'
  310. r'LoadReport|Load|LostFocus|Message|MiddleClick|MouseDown|'
  311. r'MouseEnter|MouseLeave|MouseMove|MouseUp|MouseWheel|Moved|'
  312. r'OLECompleteDrag|OLEDragOver|OLEGiveFeedback|OLESetData|'
  313. r'OLEStartDrag|OnMoveItem|Paint|ProgrammaticChange|'
  314. r'QueryAddFile|QueryModifyFile|QueryNewFile|QueryRemoveFile|'
  315. r'QueryRunFile|QueryUnload|RangeHigh|RangeLow|ReadActivate|'
  316. r'ReadDeactivate|ReadShow|ReadValid|ReadWhen|Resize|'
  317. r'RightClick|SCCInit|SCCDestroy|Scrolled|Timer|UIEnable|'
  318. r'UnDock|UnloadReport|Unload|UpClick|Valid|When)', Name.Function),
  319. (r'\s+', Text),
  320. # everything else is not colored
  321. (r'.', Text),
  322. ],
  323. 'newline': [
  324. (r'\*.*?$', Comment.Single, '#pop'),
  325. (r'(ACCEPT|ACTIVATE\s*MENU|ACTIVATE\s*POPUP|ACTIVATE\s*SCREEN|'
  326. r'ACTIVATE\s*WINDOW|APPEND|APPEND\s*FROM|APPEND\s*FROM\s*ARRAY|'
  327. r'APPEND\s*GENERAL|APPEND\s*MEMO|ASSIST|AVERAGE|BLANK|BROWSE|'
  328. r'BUILD\s*APP|BUILD\s*EXE|BUILD\s*PROJECT|CALCULATE|CALL|'
  329. r'CANCEL|CHANGE|CLEAR|CLOSE|CLOSE\s*MEMO|COMPILE|CONTINUE|'
  330. r'COPY\s*FILE|COPY\s*INDEXES|COPY\s*MEMO|COPY\s*STRUCTURE|'
  331. r'COPY\s*STRUCTURE\s*EXTENDED|COPY\s*TAG|COPY\s*TO|'
  332. r'COPY\s*TO\s*ARRAY|COUNT|CREATE|CREATE\s*COLOR\s*SET|'
  333. r'CREATE\s*CURSOR|CREATE\s*FROM|CREATE\s*LABEL|CREATE\s*MENU|'
  334. r'CREATE\s*PROJECT|CREATE\s*QUERY|CREATE\s*REPORT|'
  335. r'CREATE\s*SCREEN|CREATE\s*TABLE|CREATE\s*VIEW|DDE|'
  336. r'DEACTIVATE\s*MENU|DEACTIVATE\s*POPUP|DEACTIVATE\s*WINDOW|'
  337. r'DECLARE|DEFINE\s*BAR|DEFINE\s*BOX|DEFINE\s*MENU|'
  338. r'DEFINE\s*PAD|DEFINE\s*POPUP|DEFINE\s*WINDOW|DELETE|'
  339. r'DELETE\s*FILE|DELETE\s*TAG|DIMENSION|DIRECTORY|DISPLAY|'
  340. r'DISPLAY\s*FILES|DISPLAY\s*MEMORY|DISPLAY\s*STATUS|'
  341. r'DISPLAY\s*STRUCTURE|DO|EDIT|EJECT|EJECT\s*PAGE|ERASE|'
  342. r'EXIT|EXPORT|EXTERNAL|FILER|FIND|FLUSH|FUNCTION|GATHER|'
  343. r'GETEXPR|GO|GOTO|HELP|HIDE\s*MENU|HIDE\s*POPUP|'
  344. r'HIDE\s*WINDOW|IMPORT|INDEX|INPUT|INSERT|JOIN|KEYBOARD|'
  345. r'LABEL|LIST|LOAD|LOCATE|LOOP|MENU|MENU\s*TO|MODIFY\s*COMMAND|'
  346. r'MODIFY\s*FILE|MODIFY\s*GENERAL|MODIFY\s*LABEL|MODIFY\s*MEMO|'
  347. r'MODIFY\s*MENU|MODIFY\s*PROJECT|MODIFY\s*QUERY|'
  348. r'MODIFY\s*REPORT|MODIFY\s*SCREEN|MODIFY\s*STRUCTURE|'
  349. r'MODIFY\s*WINDOW|MOVE\s*POPUP|MOVE\s*WINDOW|NOTE|'
  350. r'ON\s*APLABOUT|ON\s*BAR|ON\s*ERROR|ON\s*ESCAPE|'
  351. r'ON\s*EXIT\s*BAR|ON\s*EXIT\s*MENU|ON\s*EXIT\s*PAD|'
  352. r'ON\s*EXIT\s*POPUP|ON\s*KEY|ON\s*KEY\s*=|ON\s*KEY\s*LABEL|'
  353. r'ON\s*MACHELP|ON\s*PAD|ON\s*PAGE|ON\s*READERROR|'
  354. r'ON\s*SELECTION\s*BAR|ON\s*SELECTION\s*MENU|'
  355. r'ON\s*SELECTION\s*PAD|ON\s*SELECTION\s*POPUP|ON\s*SHUTDOWN|'
  356. r'PACK|PARAMETERS|PLAY\s*MACRO|POP\s*KEY|POP\s*MENU|'
  357. r'POP\s*POPUP|PRIVATE|PROCEDURE|PUBLIC|PUSH\s*KEY|'
  358. r'PUSH\s*MENU|PUSH\s*POPUP|QUIT|READ|READ\s*MENU|RECALL|'
  359. r'REINDEX|RELEASE|RELEASE\s*MODULE|RENAME|REPLACE|'
  360. r'REPLACE\s*FROM\s*ARRAY|REPORT|RESTORE\s*FROM|'
  361. r'RESTORE\s*MACROS|RESTORE\s*SCREEN|RESTORE\s*WINDOW|'
  362. r'RESUME|RETRY|RETURN|RUN|RUN\s*\/N"|RUNSCRIPT|'
  363. r'SAVE\s*MACROS|SAVE\s*SCREEN|SAVE\s*TO|SAVE\s*WINDOWS|'
  364. r'SCATTER|SCROLL|SEEK|SELECT|SET|SET\s*ALTERNATE|'
  365. r'SET\s*ANSI|SET\s*APLABOUT|SET\s*AUTOSAVE|SET\s*BELL|'
  366. r'SET\s*BLINK|SET\s*BLOCKSIZE|SET\s*BORDER|SET\s*BRSTATUS|'
  367. r'SET\s*CARRY|SET\s*CENTURY|SET\s*CLEAR|SET\s*CLOCK|'
  368. r'SET\s*COLLATE|SET\s*COLOR\s*OF|SET\s*COLOR\s*OF\s*SCHEME|'
  369. r'SET\s*COLOR\s*SET|SET\s*COLOR\s*TO|SET\s*COMPATIBLE|'
  370. r'SET\s*CONFIRM|SET\s*CONSOLE|SET\s*CURRENCY|SET\s*CURSOR|'
  371. r'SET\s*DATE|SET\s*DEBUG|SET\s*DECIMALS|SET\s*DEFAULT|'
  372. r'SET\s*DELETED|SET\s*DELIMITERS|SET\s*DEVELOPMENT|'
  373. r'SET\s*DEVICE|SET\s*DISPLAY|SET\s*DOHISTORY|SET\s*ECHO|'
  374. r'SET\s*ESCAPE|SET\s*EXACT|SET\s*EXCLUSIVE|SET\s*FIELDS|'
  375. r'SET\s*FILTER|SET\s*FIXED|SET\s*FORMAT|SET\s*FULLPATH|'
  376. r'SET\s*FUNCTION|SET\s*HEADINGS|SET\s*HELP|SET\s*HELPFILTER|'
  377. r'SET\s*HOURS|SET\s*INDEX|SET\s*INTENSITY|SET\s*KEY|'
  378. r'SET\s*KEYCOMP|SET\s*LIBRARY|SET\s*LOCK|SET\s*LOGERRORS|'
  379. r'SET\s*MACDESKTOP|SET\s*MACHELP|SET\s*MACKEY|SET\s*MARGIN|'
  380. r'SET\s*MARK\s*OF|SET\s*MARK\s*TO|SET\s*MEMOWIDTH|'
  381. r'SET\s*MESSAGE|SET\s*MOUSE|SET\s*MULTILOCKS|SET\s*NEAR|'
  382. r'SET\s*NOCPTRANS|SET\s*NOTIFY|SET\s*ODOMETER|SET\s*OPTIMIZE|'
  383. r'SET\s*ORDER|SET\s*PALETTE|SET\s*PATH|SET\s*PDSETUP|'
  384. r'SET\s*POINT|SET\s*PRINTER|SET\s*PROCEDURE|SET\s*READBORDER|'
  385. r'SET\s*REFRESH|SET\s*RELATION|SET\s*RELATION\s*OFF|'
  386. r'SET\s*REPROCESS|SET\s*RESOURCE|SET\s*SAFETY|SET\s*SCOREBOARD|'
  387. r'SET\s*SEPARATOR|SET\s*SHADOWS|SET\s*SKIP|SET\s*SKIP\s*OF|'
  388. r'SET\s*SPACE|SET\s*STATUS|SET\s*STATUS\s*BAR|SET\s*STEP|'
  389. r'SET\s*STICKY|SET\s*SYSMENU|SET\s*TALK|SET\s*TEXTMERGE|'
  390. r'SET\s*TEXTMERGE\s*DELIMITERS|SET\s*TOPIC|SET\s*TRBETWEEN|'
  391. r'SET\s*TYPEAHEAD|SET\s*UDFPARMS|SET\s*UNIQUE|SET\s*VIEW|'
  392. r'SET\s*VOLUME|SET\s*WINDOW\s*OF\s*MEMO|SET\s*XCMDFILE|'
  393. r'SHOW\s*GET|SHOW\s*GETS|SHOW\s*MENU|SHOW\s*OBJECT|'
  394. r'SHOW\s*POPUP|SHOW\s*WINDOW|SIZE\s*POPUP|SKIP|SORT|'
  395. r'STORE|SUM|SUSPEND|TOTAL|TYPE|UNLOCK|UPDATE|USE|WAIT|'
  396. r'ZAP|ZOOM\s*WINDOW|DO\s*CASE|CASE|OTHERWISE|ENDCASE|'
  397. r'DO\s*WHILE|ENDDO|FOR|ENDFOR|NEXT|IF|ELSE|ENDIF|PRINTJOB|'
  398. r'ENDPRINTJOB|SCAN|ENDSCAN|TEXT|ENDTEXT|=)',
  399. Keyword.Reserved, '#pop'),
  400. (r'#\s*(IF|ELIF|ELSE|ENDIF|DEFINE|IFDEF|IFNDEF|INCLUDE)',
  401. Comment.Preproc, '#pop'),
  402. (r'(m\.)?[a-z_]\w*', Name.Variable, '#pop'),
  403. (r'.', Text, '#pop'),
  404. ],
  405. }