summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--pygments/cmdline.py8
-rw-r--r--pygments/lexers/_mapping.py4
-rw-r--r--pygments/lexers/_robotframeworklexer.py2
-rw-r--r--pygments/lexers/agile.py3
-rw-r--r--pygments/lexers/asm.py4
-rw-r--r--pygments/lexers/compiled.py19
-rw-r--r--pygments/lexers/foxpro.py150
-rw-r--r--pygments/lexers/jvm.py2
-rw-r--r--pygments/lexers/math.py3
-rw-r--r--pygments/lexers/other.py30
-rw-r--r--pygments/lexers/text.py4
-rw-r--r--pygments/lexers/web.py2
-rw-r--r--scripts/detect_missing_analyse_text.py2
-rw-r--r--tests/test_basic_api.py3
15 files changed, 125 insertions, 113 deletions
diff --git a/CHANGES b/CHANGES
index 03d38198..845105ba 100644
--- a/CHANGES
+++ b/CHANGES
@@ -15,6 +15,8 @@ Version 1.6
* Dylan console (PR#149)
* Logos (PR#150)
+- Fix guessed lexers not receiving lexer options (#838).
+
Version 1.6rc1
--------------
diff --git a/pygments/cmdline.py b/pygments/cmdline.py
index 3bf081d4..c25204bf 100644
--- a/pygments/cmdline.py
+++ b/pygments/cmdline.py
@@ -378,9 +378,9 @@ def main(args=sys.argv):
except ClassNotFound, err:
if '-g' in opts:
try:
- lexer = guess_lexer(code)
+ lexer = guess_lexer(code, **parsed_opts)
except ClassNotFound:
- lexer = TextLexer()
+ lexer = TextLexer(**parsed_opts)
else:
print >>sys.stderr, 'Error:', err
return 1
@@ -392,9 +392,9 @@ def main(args=sys.argv):
if '-g' in opts:
code = sys.stdin.read()
try:
- lexer = guess_lexer(code)
+ lexer = guess_lexer(code, **parsed_opts)
except ClassNotFound:
- lexer = TextLexer()
+ lexer = TextLexer(**parsed_opts)
elif not lexer:
print >>sys.stderr, 'Error: no lexer name given and reading ' + \
'from stdin (try using -g or -l <lexer>)'
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index 72d76a18..f2d676cd 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -242,9 +242,9 @@ LEXERS = {
'RdLexer': ('pygments.lexers.math', 'Rd', ('rd',), ('*.Rd',), ('text/x-r-doc',)),
'RebolLexer': ('pygments.lexers.other', 'REBOL', ('rebol',), ('*.r', '*.r3'), ('text/x-rebol',)),
'RedcodeLexer': ('pygments.lexers.other', 'Redcode', ('redcode',), ('*.cw',), ()),
- 'RegeditLexer': ('pygments.lexers.text', 'reg', (), ('*.reg',), ('text/x-windows-registry',)),
+ 'RegeditLexer': ('pygments.lexers.text', 'reg', ('registry',), ('*.reg',), ('text/x-windows-registry',)),
'RhtmlLexer': ('pygments.lexers.templates', 'RHTML', ('rhtml', 'html+erb', 'html+ruby'), ('*.rhtml',), ('text/html+ruby',)),
- 'RobotFrameworkLexer': ('pygments.lexers.other', 'RobotFramework', ('RobotFramework', 'robotframework'), ('*.txt',), ('text/x-robotframework',)),
+ 'RobotFrameworkLexer': ('pygments.lexers.other', 'RobotFramework', ('RobotFramework', 'robotframework'), ('*.txt', '*.robot'), ('text/x-robotframework',)),
'RstLexer': ('pygments.lexers.text', 'reStructuredText', ('rst', 'rest', 'restructuredtext'), ('*.rst', '*.rest'), ('text/x-rst', 'text/prs.fallenstein.rst')),
'RubyConsoleLexer': ('pygments.lexers.agile', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)),
'RubyLexer': ('pygments.lexers.agile', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby'), ('text/x-ruby', 'application/x-ruby')),
diff --git a/pygments/lexers/_robotframeworklexer.py b/pygments/lexers/_robotframeworklexer.py
index b32dbde2..0192d289 100644
--- a/pygments/lexers/_robotframeworklexer.py
+++ b/pygments/lexers/_robotframeworklexer.py
@@ -61,7 +61,7 @@ class RobotFrameworkLexer(Lexer):
"""
name = 'RobotFramework'
aliases = ['RobotFramework', 'robotframework']
- filenames = ['*.txt']
+ filenames = ['*.txt', '*.robot']
mimetypes = ['text/x-robotframework']
def __init__(self, **options):
diff --git a/pygments/lexers/agile.py b/pygments/lexers/agile.py
index 90f9ecd3..8bcb1d46 100644
--- a/pygments/lexers/agile.py
+++ b/pygments/lexers/agile.py
@@ -607,7 +607,8 @@ class RubyLexer(ExtendedRegexLexer):
r'rescue|raise|retry|return|super|then|undef|unless|until|when|'
r'while|yield)\b', Keyword),
# start of function, class and module names
- (r'(module)(\s+)([a-zA-Z_][a-zA-Z0-9_]*(::[a-zA-Z_][a-zA-Z0-9_]*)*)',
+ (r'(module)(\s+)([a-zA-Z_][a-zA-Z0-9_]*'
+ r'(?:::[a-zA-Z_][a-zA-Z0-9_]*)*)',
bygroups(Keyword, Text, Name.Namespace)),
(r'(def)(\s+)', bygroups(Keyword, Text), 'funcname'),
(r'def(?=[*%&^`~+-/\[<>=])', Keyword, 'funcname'),
diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py
index 5f1d808a..7ff64bcc 100644
--- a/pygments/lexers/asm.py
+++ b/pygments/lexers/asm.py
@@ -376,7 +376,7 @@ class Ca65Lexer(RegexLexer):
'root': [
(r';.*', Comment.Single),
(r'\s+', Text),
- (r'[\w.@$][\w.@$\d]*:', Name.Label),
+ (r'[a-z_.@$][\w.@$]*:', Name.Label),
(r'((ld|st)[axy]|(in|de)[cxy]|asl|lsr|ro[lr]|adc|sbc|cmp|cp[xy]'
r'|cl[cvdi]|se[cdi]|jmp|jsr|bne|beq|bpl|bmi|bvc|bvs|bcc|bcs'
r'|p[lh][ap]|rt[is]|brk|nop|ta[xy]|t[xy]a|txs|tsx|and|ora|eor'
@@ -388,7 +388,7 @@ class Ca65Lexer(RegexLexer):
(r'\$[0-9a-f]+|[0-9a-f]+h\b', Number.Hex),
(r'\d+|%[01]+', Number.Integer),
(r'[#,.:()=]', Punctuation),
- (r'[\w.@$][\w.@$\d]*', Name),
+ (r'[a-z_.@$][\w.@$]*', Name),
]
}
diff --git a/pygments/lexers/compiled.py b/pygments/lexers/compiled.py
index 65cf2778..7513a4e1 100644
--- a/pygments/lexers/compiled.py
+++ b/pygments/lexers/compiled.py
@@ -2190,10 +2190,12 @@ class AdaLexer(RegexLexer):
(r'(pragma)(\s+)([a-zA-Z0-9_]+)', bygroups(Keyword.Reserved, Text,
Comment.Preproc)),
(r'(true|false|null)\b', Keyword.Constant),
- (r'(Byte|Character|Float|Integer|Long_Float|Long_Integer|'
- r'Long_Long_Float|Long_Long_Integer|Natural|Positive|Short_Float|'
- r'Short_Integer|Short_Short_Float|Short_Short_Integer|String|'
- r'Wide_String|Duration)\b', Keyword.Type),
+ (r'(Address|Byte|Boolean|Character|Controlled|Count|Cursor|'
+ r'Duration|File_Mode|File_Type|Float|Generator|Integer|Long_Float|'
+ r'Long_Integer|Long_Long_Float|Long_Long_Integer|Natural|Positive|'
+ r'Reference_Type|Short_Float|Short_Integer|Short_Short_Float|'
+ r'Short_Short_Integer|String|Wide_Character|Wide_String)\b',
+ Keyword.Type),
(r'(and(\s+then)?|in|mod|not|or(\s+else)|rem)\b', Operator.Word),
(r'generic|private', Keyword.Declaration),
(r'package', Keyword.Declaration, 'package'),
@@ -2248,7 +2250,8 @@ class AdaLexer(RegexLexer):
(r'\(', Punctuation, 'formal_part'),
(r'with|and|use', Keyword.Reserved),
(r'array\b', Keyword.Reserved, ('#pop', 'array_def')),
- (r'record\b', Keyword.Reserved, ('formal_part')),
+ (r'record\b', Keyword.Reserved, ('record_def')),
+ (r'(null record)(;)', bygroups(Keyword.Reserved, Punctuation), '#pop'),
include('root'),
],
'array_def' : [
@@ -2257,6 +2260,10 @@ class AdaLexer(RegexLexer):
Keyword.Reserved)),
include('root'),
],
+ 'record_def' : [
+ (r'end record', Keyword.Reserved, '#pop'),
+ include('root'),
+ ],
'import': [
(r'[a-z0-9_.]+', Name.Namespace, '#pop'),
(r'', Text, '#pop'),
@@ -3356,7 +3363,7 @@ class CobolLexer(RegexLexer):
# Data Types
(r'(^|(?<=[^0-9a-z_\-]))'
r'(PIC\s+.+?(?=(\s|\.\s))|PICTURE\s+.+?(?=(\s|\.\s))|'
- r'(COMPUTATIONAL)([-][1-5X])?|(COMP)([-][1-5X])?|'
+ r'(COMPUTATIONAL)(-[1-5X])?|(COMP)(-[1-5X])?|'
r'BINARY-C-LONG|'
r'BINARY-CHAR|BINARY-DOUBLE|BINARY-LONG|BINARY-SHORT|'
r'BINARY)\s*($|(?=[^0-9a-z_\-]))', Keyword.Type),
diff --git a/pygments/lexers/foxpro.py b/pygments/lexers/foxpro.py
index 8973adba..51cd499b 100644
--- a/pygments/lexers/foxpro.py
+++ b/pygments/lexers/foxpro.py
@@ -127,15 +127,15 @@ class FoxProLexer(RegexLexer):
r'_THROTTLE|_TOOLBOX|_TOOLTIPTIMEOUT|_TRANSPORT|_TRIGGERLEVEL|'
r'_UNIX|_VFP|_WINDOWS|_WIZARD|_WRAP', Keyword.Pseudo),
- (r'THIS|THISFORM|THISFORMSET', Name.Builtin),
+ (r'THISFORMSET|THISFORM|THIS', Name.Builtin),
(r'Application|CheckBox|Collection|Column|ComboBox|'
- r'CommandButton|CommandGroup|Container|Control|Cursor|'
- r'CursorAdapter|Custom|DataEnvironment|DataObject|EditBox|'
- r'Empty|Exception|Fields|File|Files|Form|FormSet|FoxCode|'
+ r'CommandButton|CommandGroup|Container|Control|CursorAdapter|'
+ r'Cursor|Custom|DataEnvironment|DataObject|EditBox|'
+ r'Empty|Exception|Fields|Files|File|FormSet|Form|FoxCode|'
r'Grid|Header|Hyperlink|Image|Label|Line|ListBox|Objects|'
- r'OptionButton|OptionGroup|Page|PageFrame|Project|ProjectHook|'
- r'Projects|Relation|ReportListener|Separator|Server|Servers|'
+ r'OptionButton|OptionGroup|PageFrame|Page|ProjectHook|Projects|'
+ r'Project|Relation|ReportListener|Separator|Servers|Server|'
r'Session|Shape|Spinner|Tables|TextBox|Timer|ToolBar|'
r'XMLAdapter|XMLField|XMLTable', Name.Class),
@@ -144,7 +144,7 @@ class FoxProLexer(RegexLexer):
(r'\.(ActiveColumn|ActiveControl|ActiveForm|ActivePage|'
r'ActiveProject|ActiveRow|AddLineFeeds|ADOCodePage|Alias|'
- r'Align|Alignment|AllowAddNew|AllowAutoColumnFit|'
+ r'Alignment|Align|AllowAddNew|AllowAutoColumnFit|'
r'AllowCellSelection|AllowDelete|AllowHeaderSizing|'
r'AllowInsert|AllowModalMessages|AllowOutput|AllowRowSizing|'
r'AllowSimultaneousFetch|AllowTabs|AllowUpdate|'
@@ -154,11 +154,11 @@ class FoxProLexer(RegexLexer):
r'AutoIncrement|AutoOpenTables|AutoRelease|AutoSize|'
r'AutoVerbMenu|AutoYield|BackColor|ForeColor|BackStyle|'
r'BaseClass|BatchUpdateCount|BindControls|BorderColor|'
- r'BorderStyle|BorderWidth|Bound|BoundColumn|BoundTo|'
- r'BreakOnError|BufferMode|BufferModeOverride|'
+ r'BorderStyle|BorderWidth|BoundColumn|BoundTo|Bound|'
+ r'BreakOnError|BufferModeOverride|BufferMode|'
r'BuildDateTime|ButtonCount|Buttons|Cancel|Caption|'
r'Centered|Century|ChildAlias|ChildOrder|ChildTable|'
- r'Class|ClassLibrary|ClipControls|Closable|CLSID|CodePage|'
+ r'ClassLibrary|Class|ClipControls|Closable|CLSID|CodePage|'
r'ColorScheme|ColorSource|ColumnCount|ColumnLines|'
r'ColumnOrder|Columns|ColumnWidths|CommandClauses|'
r'Comment|CompareMemo|ConflictCheckCmd|ConflictCheckType|'
@@ -166,11 +166,11 @@ class FoxProLexer(RegexLexer):
r'ControlSource|ConversionFunc|Count|CurrentControl|'
r'CurrentDataSession|CurrentPass|CurrentX|CurrentY|'
r'CursorSchema|CursorSource|CursorStatus|Curvature|'
- r'Database|DataSession|DataSessionID|DataSource|'
- r'DataSourceType|DataType|DateFormat|DateMark|Debug|'
- r'DeclareXMLPrefix|DEClass|DEClassLibrary|Default|'
- r'DefaultFilePath|DefOLELCID|DeleteCmd|DeleteCmdDataSource|'
- r'DeleteCmdDataSourceType|DeleteMark|Description|Desktop|'
+ r'Database|DataSessionID|DataSession|DataSourceType|'
+ r'DataSource|DataType|DateFormat|DateMark|Debug|'
+ r'DeclareXMLPrefix|DEClassLibrary|DEClass|DefaultFilePath|'
+ r'Default|DefOLELCID|DeleteCmdDataSourceType|DeleteCmdDataSource|'
+ r'DeleteCmd|DeleteMark|Description|Desktop|'
r'Details|DisabledBackColor|DisabledForeColor|'
r'DisabledItemBackColor|DisabledItemForeColor|'
r'DisabledPicture|DisableEncode|DisplayCount|'
@@ -183,112 +183,112 @@ class FoxProLexer(RegexLexer):
r'DynamicFontShadow|DynamicFontSize|DynamicInputMask|'
r'DynamicLineHeight|EditorOptions|Enabled|'
r'EnableHyperlinks|Encrypted|ErrorNo|Exclude|Exclusive|'
- r'FetchAsNeeded|FetchMemo|FetchMemoCmdList|'
- r'FetchMemoDataSource|FetchMemoDataSourceType|FetchSize|'
- r'FileClass|FileClassLibrary|FillColor|FillStyle|Filter|'
+ r'FetchAsNeeded|FetchMemoCmdList|FetchMemoDataSourceType|'
+ r'FetchMemoDataSource|FetchMemo|FetchSize|'
+ r'FileClassLibrary|FileClass|FillColor|FillStyle|Filter|'
r'FirstElement|FirstNestedTable|Flags|FontBold|FontItalic|'
r'FontStrikethru|FontUnderline|FontCharSet|FontCondense|'
r'FontExtend|FontName|FontOutline|FontShadow|FontSize|'
r'ForceCloseTag|Format|FormCount|FormattedOutput|Forms|'
r'FractionDigits|FRXDataSession|FullName|GDIPlusGraphics|'
r'GridLineColor|GridLines|GridLineWidth|HalfHeightCaption|'
- r'HeaderClass|HeaderClassLibrary|HeaderHeight|Height|'
- r'HelpContextID|HideSelection|Highlight|HighlightBackColor|'
- r'HighlightForeColor|HighlightStyle|HighlightRow|'
- r'HighlightRowLineWidth|HomeDir|Hours|HostName|'
- r'HScrollSmallChange|hWnd|Icon|Increment|IncrementalSearch|'
- r'InitialSelectedAlias|InputMask|InsertCmd|'
- r'InsertCmdDataSource|InsertCmdDataSourceType|'
- r'InsertCmdRefreshCmd|InsertCmdRefreshFieldList|'
- r'InsertCmdRefreshKeyFieldList|Instancing|IntegralHeight|'
+ r'HeaderClassLibrary|HeaderClass|HeaderHeight|Height|'
+ r'HelpContextID|HideSelection|HighlightBackColor|'
+ r'HighlightForeColor|HighlightStyle|HighlightRowLineWidth|'
+ r'HighlightRow|Highlight|HomeDir|Hours|HostName|'
+ r'HScrollSmallChange|hWnd|Icon|IncrementalSearch|Increment|'
+ r'InitialSelectedAlias|InputMask|InsertCmdDataSourceType|'
+ r'InsertCmdDataSource|InsertCmdRefreshCmd|'
+ r'InsertCmdRefreshFieldList|InsertCmdRefreshKeyFieldList|'
+ r'InsertCmd|Instancing|IntegralHeight|'
r'Interval|IMEMode|IsAttribute|IsBase64|IsBinary|IsNull|'
r'IsDiffGram|IsLoaded|ItemBackColor,|ItemData|ItemIDData|'
r'ItemTips|IXMLDOMElement|KeyboardHighValue|KeyboardLowValue|'
r'Keyfield|KeyFieldList|KeyPreview|KeySort|LanguageOptions|'
- r'Left|LeftColumn|LineContents|LineNo|LineSlant|LinkMaster|'
- r'List|ListCount|ListenerType|ListIndex|ListItem|ListItemID|'
- r'LockColumns|LockColumnsLeft|LockScreen|MacDesktop|'
+ r'LeftColumn|Left|LineContents|LineNo|LineSlant|LinkMaster|'
+ r'ListCount|ListenerType|ListIndex|ListItemID|ListItem|'
+ r'List|LockColumnsLeft|LockColumns|LockScreen|MacDesktop|'
r'MainFile|MapN19_4ToCurrency|MapBinary|MapVarchar|Margin|'
r'MaxButton|MaxHeight|MaxLeft|MaxLength|MaxRecords|MaxTop|'
- r'MaxWidth|MDIForm|MemberClass|MemberClassLibrary|'
+ r'MaxWidth|MDIForm|MemberClassLibrary|MemberClass|'
r'MemoWindow|Message|MinButton|MinHeight|MinWidth|'
r'MouseIcon|MousePointer|Movable|MoverBars|MultiSelect|'
r'Name|NestedInto|NewIndex|NewItemID|NextSiblingTable|'
- r'NoCpTrans|NoData|NoDataOnLoad|NullDisplay|'
+ r'NoCpTrans|NoDataOnLoad|NoData|NullDisplay|'
r'NumberOfElements|Object|OLEClass|OLEDragMode|'
r'OLEDragPicture|OLEDropEffects|OLEDropHasData|'
r'OLEDropMode|OLEDropTextInsertion|OLELCID|'
r'OLERequestPendingTimeout|OLEServerBusyRaiseError|'
r'OLEServerBusyTimeout|OLETypeAllowed|OneToMany|'
- r'OpenViews|OpenWindow|Optimize|Order|OrderDirection|'
+ r'OpenViews|OpenWindow|Optimize|OrderDirection|Order|'
r'OutputPageCount|OutputType|PageCount|PageHeight|'
r'PageNo|PageOrder|Pages|PageTotal|PageWidth|'
- r'Panel|PanelLink|Parent|ParentAlias|ParentClass|'
- r'ParentTable|Partition|PasswordChar|Picture|'
- r'PictureMargin|PicturePosition|PictureSpacing|'
- r'PictureSelectionDisplay|PictureVal|Prepared|'
+ r'PanelLink|Panel|ParentAlias|ParentClass|ParentTable|'
+ r'Parent|Partition|PasswordChar|PictureMargin|'
+ r'PicturePosition|PictureSpacing|PictureSelectionDisplay|'
+ r'PictureVal|Picture|Prepared|'
r'PolyPoints|PreserveWhiteSpace|PreviewContainer|'
- r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHook|'
- r'ProjectHookClass|ProjectHookLibrary|QuietMode|'
+ r'PrintJobName|Procedure|PROCESSID|ProgID|ProjectHookClass|'
+ r'ProjectHookLibrary|ProjectHook|QuietMode|'
r'ReadCycle|ReadLock|ReadMouse|ReadObject|ReadOnly|'
- r'ReadSave|ReadTimeout|RecordMark|RecordSource|'
- r'RecordSourceType|RefreshAlias|RefreshCmd|'
- r'RefreshCmdDataSource|RefreshCmdDataSourceType|'
+ r'ReadSave|ReadTimeout|RecordMark|RecordSourceType|'
+ r'RecordSource|RefreshAlias|'
+ r'RefreshCmdDataSourceType|RefreshCmdDataSource|RefreshCmd|'
r'RefreshIgnoreFieldList|RefreshTimeStamp|RelationalExpr|'
r'RelativeColumn|RelativeRow|ReleaseType|Resizable|'
r'RespectCursorCP|RespectNesting|RightToLeft|RotateFlip|'
- r'Rotation|RowColChange|RowHeight|RowSource|'
- r'RowSourceType|ScaleMode|SCCProvider|SCCStatus|ScrollBars|'
- r'Seconds|SelectCmd|Selected|SelectedID|'
- r'SelectedItemBackColor|SelectedItemForeColor|'
+ r'Rotation|RowColChange|RowHeight|RowSourceType|'
+ r'RowSource|ScaleMode|SCCProvider|SCCStatus|ScrollBars|'
+ r'Seconds|SelectCmd|SelectedID|'
+ r'SelectedItemBackColor|SelectedItemForeColor|Selected|'
r'SelectionNamespaces|SelectOnEntry|SelLength|SelStart|'
- r'SelText|SendGDIPlusImage|SendUpdates|ServerClass|'
- r'ServerClassLibrary|ServerHelpFile|ServerName|'
+ r'SelText|SendGDIPlusImage|SendUpdates|ServerClassLibrary|'
+ r'ServerClass|ServerHelpFile|ServerName|'
r'ServerProject|ShowTips|ShowInTaskbar|ShowWindow|'
r'Sizable|SizeBox|SOM|Sorted|Sparse|SpecialEffect|'
r'SpinnerHighValue|SpinnerLowValue|SplitBar|StackLevel|'
- r'StartMode|StatusBar|StatusBarText|Stretch|StrictDateEntry|'
+ r'StartMode|StatusBarText|StatusBar|Stretch|StrictDateEntry|'
r'Style|TabIndex|Tables|TabOrientation|Tabs|TabStop|'
r'TabStretch|TabStyle|Tag|TerminateRead|Text|Themes|'
- r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|Top|'
- r'TopIndex|TopItemID|TwoPassProcess|Type|TypeLibCLSID|'
- r'TypeLibDesc|TypeLibName|Unicode|UpdatableFieldList|'
- r'UpdateCmd|UpdateCmdDataSource|UpdateCmdDataSourceType|'
+ r'ThreadID|TimestampFieldList|TitleBar|ToolTipText|'
+ r'TopIndex|TopItemID|Top|TwoPassProcess|TypeLibCLSID|'
+ r'TypeLibDesc|TypeLibName|Type|Unicode|UpdatableFieldList|'
+ r'UpdateCmdDataSourceType|UpdateCmdDataSource|'
r'UpdateCmdRefreshCmd|UpdateCmdRefreshFieldList|'
- r'UpdateCmdRefreshKeyFieldList|UpdateGram|'
- r'UpdateGramSchemaLocation|UpdateNameList|UpdateType|'
+ r'UpdateCmdRefreshKeyFieldList|UpdateCmd|'
+ r'UpdateGramSchemaLocation|UpdateGram|UpdateNameList|UpdateType|'
r'UseCodePage|UseCursorSchema|UseDeDataSource|UseMemoSize|'
- r'UserValue|UseTransactions|UTF8Encoded|Value|Version|'
- r'VersionComments|VersionCompany|VersionCopyright|'
- r'VersionDescription|VersionNumber|VersionProduct|'
- r'VersionTrademarks|VFPXMLProgID|ViewPortHeight|ViewPortLeft|'
+ r'UserValue|UseTransactions|UTF8Encoded|Value|VersionComments|'
+ r'VersionCompany|VersionCopyright|VersionDescription|'
+ r'VersionNumber|VersionProduct|VersionTrademarks|Version|'
+ r'VFPXMLProgID|ViewPortHeight|ViewPortLeft|'
r'ViewPortTop|ViewPortWidth|VScrollSmallChange|View|Visible|'
- r'VisualEffect|WhatsThisButton|WhatsThisHelp|WhatsThisHelpID|'
+ r'VisualEffect|WhatsThisButton|WhatsThisHelpID|WhatsThisHelp|'
r'WhereType|Width|WindowList|WindowState|WindowType|WordWrap|'
r'WrapCharInCDATA|WrapInCDATA|WrapMemoInCDATA|XMLAdapter|'
- r'XMLConstraints|XMLName|XMLNameIsXPath|XMLNamespace|'
+ r'XMLConstraints|XMLNameIsXPath|XMLNamespace|XMLName|'
r'XMLPrefix|XMLSchemaLocation|XMLTable|XMLType|'
r'XSDfractionDigits|XSDmaxLength|XSDtotalDigits|'
r'XSDtype|ZoomBox)', Name.Attribute),
- (r'\.(ActivateCell|Add|Add|AddColumn|AddItem|AddListItem|'
- r'AddObject|AddProperty|AddTableSchema|AddToSCC|'
+ (r'\.(ActivateCell|AddColumn|AddItem|AddListItem|AddObject|'
+ r'AddProperty|AddTableSchema|AddToSCC|Add|'
r'ApplyDiffgram|Attach|AutoFit|AutoOpen|Box|Build|'
r'CancelReport|ChangesToCursor|CheckIn|CheckOut|Circle|'
- r'CleanUp|Clear|ClearData|ClearStatus|CloneObject|Close|'
- r'CloseTables|Cls|CursorAttach|CursorDetach|CursorFill|'
+ r'CleanUp|ClearData|ClearStatus|Clear|CloneObject|CloseTables|'
+ r'Close|Cls|CursorAttach|CursorDetach|CursorFill|'
r'CursorRefresh|DataToClip|DelayedMemoFetch|DeleteColumn|'
r'Dock|DoMessage|DoScroll|DoStatus|DoVerb|Drag|Draw|Eval|'
r'GetData|GetDockState|GetFormat|GetKey|GetLatestVersion|'
r'GetPageHeight|GetPageWidth|Help|Hide|IncludePageInOutput|'
- r'IndexToItemID|Item|ItemIDToIndex|LoadXML|Line|Modify|'
- r'Move|MoveItem|Nest|OLEDrag|OnPreviewClose|OutputPage|'
+ r'IndexToItemID|ItemIDToIndex|Item|LoadXML|Line|Modify|'
+ r'MoveItem|Move|Nest|OLEDrag|OnPreviewClose|OutputPage|'
r'Point|Print|PSet|Quit|ReadExpression|ReadMethod|'
- r'RecordRefresh|Refresh|Release|ReleaseXML|Remove|'
- r'RemoveFromSCC|RemoveItem|RemoveListItem|RemoveObject|'
- r'Render|Requery|RequestData|Reset|ResetToDefault|Run|'
- r'SaveAs|SaveAsClass|SetAll|SetData|SetFocus|SetFormat|'
- r'SetMain|SetVar|SetViewPort|Show|ShowWhatsThis|'
+ r'RecordRefresh|Refresh|ReleaseXML|Release|RemoveFromSCC|'
+ r'RemoveItem|RemoveListItem|RemoveObject|Remove|'
+ r'Render|Requery|RequestData|ResetToDefault|Reset|Run|'
+ r'SaveAsClass|SaveAs|SetAll|SetData|SetFocus|SetFormat|'
+ r'SetMain|SetVar|SetViewPort|ShowWhatsThis|Show|'
r'SupportsListenerType|TextHeight|TextWidth|ToCursor|'
r'ToXML|UndoCheckOut|Unnest|UpdateStatus|WhatsThisMode|'
r'WriteExpression|WriteMethod|ZOrder)', Name.Function),
@@ -327,9 +327,9 @@ class FoxProLexer(RegexLexer):
r'dbc_BeforeRenameView|dbc_BeforeValidateData|'
r'dbc_CloseData|dbc_Deactivate|dbc_ModifyData|dbc_OpenData|'
r'dbc_PackData|DblClick|Deactivate|Deleted|Destroy|DoCmd|'
- r'DownClick|DragDrop|DragOver|DropDown|Error|ErrorMessage|'
+ r'DownClick|DragDrop|DragOver|DropDown|ErrorMessage|Error|'
r'EvaluateContents|GotFocus|Init|InteractiveChange|KeyPress|'
- r'Load|LoadReport|LostFocus|Message|MiddleClick|MouseDown|'
+ r'LoadReport|Load|LostFocus|Message|MiddleClick|MouseDown|'
r'MouseEnter|MouseLeave|MouseMove|MouseUp|MouseWheel|Moved|'
r'OLECompleteDrag|OLEDragOver|OLEGiveFeedback|OLESetData|'
r'OLEStartDrag|OnMoveItem|Paint|ProgrammaticChange|'
@@ -337,7 +337,7 @@ class FoxProLexer(RegexLexer):
r'QueryRunFile|QueryUnload|RangeHigh|RangeLow|ReadActivate|'
r'ReadDeactivate|ReadShow|ReadValid|ReadWhen|Resize|'
r'RightClick|SCCInit|SCCDestroy|Scrolled|Timer|UIEnable|'
- r'UnDock|Unload|UnloadReport|UpClick|Valid|When)', Name.Function),
+ r'UnDock|UnloadReport|Unload|UpClick|Valid|When)', Name.Function),
(r'\s+', Text),
# everything else is not colored
diff --git a/pygments/lexers/jvm.py b/pygments/lexers/jvm.py
index 6857cd7b..717621e9 100644
--- a/pygments/lexers/jvm.py
+++ b/pygments/lexers/jvm.py
@@ -355,7 +355,7 @@ class GosuLexer(RegexLexer):
(r'(var|delegate|construct|function|private|internal|protected|'
r'public|abstract|override|final|static|extends|transient|'
r'implements|represents|readonly)\b', Keyword.Declaration),
- (r'(property\s+)(get|set|)', Keyword.Declaration),
+ (r'(property\s+)(get|set)?', Keyword.Declaration),
(r'(boolean|byte|char|double|float|int|long|short|void|block)\b',
Keyword.Type),
(r'(package)(\s+)', bygroups(Keyword.Namespace, Text)),
diff --git a/pygments/lexers/math.py b/pygments/lexers/math.py
index 81d65d99..f4bb1127 100644
--- a/pygments/lexers/math.py
+++ b/pygments/lexers/math.py
@@ -819,8 +819,7 @@ class OctaveLexer(RegexLexer):
def analyse_text(text):
if re.match('^\s*[%#]', text, re.M): #Comment
- return 0.9
- return 0.1
+ return 0.1
class ScilabLexer(RegexLexer):
diff --git a/pygments/lexers/other.py b/pygments/lexers/other.py
index bd56e112..c8557922 100644
--- a/pygments/lexers/other.py
+++ b/pygments/lexers/other.py
@@ -1487,9 +1487,9 @@ class RebolLexer(RegexLexer):
(r'}', Comment, '#pop'),
],
'commentBlock': [
- (r'\[',Comment, '#push'),
- (r'\]',Comment, '#pop'),
- (r'[^(\[\])]*', Comment),
+ (r'\[', Comment, '#push'),
+ (r'\]', Comment, '#pop'),
+ (r'[^(\[\])]+', Comment),
],
}
@@ -2845,7 +2845,7 @@ class BroLexer(RegexLexer):
r'|pattern|port|record|set|string|subnet|table|time|timer'
r'|vector)\b', Keyword.Type),
(r'(T|F)\b', Keyword.Constant),
- (r'(&)((?:add|delete|expire)_func|attr|(create|read|write)_expire'
+ (r'(&)((?:add|delete|expire)_func|attr|(?:create|read|write)_expire'
r'|default|disable_print_hook|raw_output|encrypt|group|log'
r'|mergeable|optional|persistent|priority|redef'
r'|rotate_(?:interval|size)|synchronized)\b', bygroups(Punctuation,
@@ -3312,19 +3312,19 @@ class NSISLexer(RegexLexer):
include('macro'),
include('interpol'),
include('basic'),
- (r'\$\{[a-zA-Z_\|][a-zA-Z0-9_\|]*\}', Keyword.Pseudo),
- (r'\/[a-zA-Z_][a-zA-Z0-9_]*', Name.Attribute),
+ (r'\$\{[a-z_|][\w|]*\}', Keyword.Pseudo),
+ (r'/[a-z_]\w*', Name.Attribute),
('.', Text),
],
'basic': [
- (r'(\n)(Function)(\s+)([\.\_a-zA-Z][\.\_a-zA-Z0-9]*)\b',
+ (r'(\n)(Function)(\s+)([._a-z][.\w]*)\b',
bygroups(Text, Keyword, Text, Name.Function)),
- (r'\b([_a-zA-Z][_a-zA-Z0-9]*)(::)([a-zA-Z][a-zA-Z0-9]*)\b',
+ (r'\b([_a-z]\w*)(::)([a-z][a-z0-9]*)\b',
bygroups(Keyword.Namespace, Punctuation, Name.Function)),
- (r'\b([_a-zA-Z][_a-zA-Z0-9]*)(:)', bygroups(Name.Label, Punctuation)),
+ (r'\b([_a-z]\w*)(:)', bygroups(Name.Label, Punctuation)),
(r'(\b[ULS]|\B)([\!\<\>=]?=|\<\>?|\>)\B', Operator),
- (r'[\+\-\|]', Operator),
- (r'[\\]', Punctuation),
+ (r'[|+-]', Operator),
+ (r'\\', Punctuation),
(r'\b(Abort|Add(?:BrandingImage|Size)|'
r'Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|'
r'BG(?:Font|Gradient)|BrandingText|BringToFront|Call(?:InstDLL)?|'
@@ -3397,7 +3397,7 @@ class NSISLexer(RegexLexer):
r'STARTMENU|SYSDIR|TEMP(?:LATES)?|VIDEOS|WINDIR|\{NSISDIR\})',
Name.Builtin),
(r'\$(CMDLINE|INSTDIR|OUTDIR|LANGUAGE)', Name.Variable.Global),
- (r'\$[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable),
+ (r'\$[a-z_]\w*', Name.Variable),
],
'str_double': [
(r'"', String, '#pop'),
@@ -3457,8 +3457,8 @@ class RPMSpecLexer(RegexLexer):
include('macro'),
(r'(?i)^(Name|Version|Release|Epoch|Summary|Group|License|Packager|'
r'Vendor|Icon|URL|Distribution|Prefix|Patch[0-9]*|Source[0-9]*|'
- r'Requires\(?[a-z]*\)?|[A-Za-z]+Req|Obsoletes|Provides|Conflicts|'
- r'Build[A-Za-z]+|[A-Za-z]+Arch|Auto[A-Za-z]+)(:)(.*)$',
+ r'Requires\(?[a-z]*\)?|[a-z]+Req|Obsoletes|Provides|Conflicts|'
+ r'Build[a-z]+|[a-z]+Arch|Auto[a-z]+)(:)(.*)$',
bygroups(Generic.Heading, Punctuation, using(this))),
(r'^%description', Name.Decorator, 'description'),
(r'^%changelog', Name.Decorator, 'changelog'),
@@ -3641,7 +3641,7 @@ class AutoItLexer(RegexLexer):
],
'labels': [
# sendkeys
- (r'(^\s*)({[^\s]+?})', bygroups(Text, Name.Label)),
+ (r'(^\s*)({\S+?})', bygroups(Text, Name.Label)),
],
'numbers': [
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py
index 8709e43a..5e340893 100644
--- a/pygments/lexers/text.py
+++ b/pygments/lexers/text.py
@@ -65,7 +65,7 @@ class RegeditLexer(RegexLexer):
"""
name = 'reg'
- aliases = []
+ aliases = ['registry']
filenames = ['*.reg']
mimetypes = ['text/x-windows-registry']
@@ -616,7 +616,7 @@ class MoinWikiLexer(RegexLexer):
(r'(\'\'\'?|\|\||`|__|~~|\^|,,|::)', Comment), # Formatting
# Lists
(r'^( +)([.*-])( )', bygroups(Text, Name.Builtin, Text)),
- (r'^( +)([a-zivx]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)),
+ (r'^( +)([a-z]{1,5}\.)( )', bygroups(Text, Name.Builtin, Text)),
# Other Formatting
(r'\[\[\w+.*?\]\]', Keyword), # Macro
(r'(\[[^\s\]]+)(\s+[^\]]+?)?(\])',
diff --git a/pygments/lexers/web.py b/pygments/lexers/web.py
index 1f88e0fc..54783c69 100644
--- a/pygments/lexers/web.py
+++ b/pygments/lexers/web.py
@@ -3047,7 +3047,7 @@ class TypeScriptLexer(RegexLexer):
# Match stuff like: constructor
(r'\b(constructor|declare|interface|as|AS)\b', Keyword.Reserved),
# Match stuff like: super(argument, list)
- (r'(super)(\s*)\(([a-zA-Z0-9,_?.$\s]+\s*)\)',
+ (r'(super)(\s*)(\([a-zA-Z0-9,_?.$\s]+\s*\))',
bygroups(Keyword.Reserved, Text), 'slashstartsregex'),
# Match stuff like: function() {...}
(r'([a-zA-Z_?.$][\w?.$]*)\(\) \{', Name.Other, 'slashstartsregex'),
diff --git a/scripts/detect_missing_analyse_text.py b/scripts/detect_missing_analyse_text.py
index fc3fef71..1312648f 100644
--- a/scripts/detect_missing_analyse_text.py
+++ b/scripts/detect_missing_analyse_text.py
@@ -8,6 +8,8 @@ def main():
for name, aliases, filenames, mimetypes in get_all_lexers():
cls = find_lexer_class(name)
+ if not cls.aliases:
+ print cls, "has no aliases"
for f in filenames:
if f not in uses:
uses[f] = []
diff --git a/tests/test_basic_api.py b/tests/test_basic_api.py
index f6643308..64eeb29e 100644
--- a/tests/test_basic_api.py
+++ b/tests/test_basic_api.py
@@ -93,7 +93,8 @@ def test_lexer_options():
'PythonConsoleLexer', 'RConsoleLexer', 'RubyConsoleLexer',
'SqliteConsoleLexer', 'MatlabSessionLexer', 'ErlangShellLexer',
'BashSessionLexer', 'LiterateHaskellLexer', 'PostgresConsoleLexer',
- 'ElixirConsoleLexer', 'JuliaConsoleLexer', 'RobotFrameworkLexer'):
+ 'ElixirConsoleLexer', 'JuliaConsoleLexer', 'RobotFrameworkLexer',
+ 'DylanConsoleLexer'):
inst = cls(ensurenl=False)
ensure(inst.get_tokens('a\nb'), 'a\nb')
inst = cls(ensurenl=False, stripall=True)