From 4913cfd81bb68d18de31cbe20591535880758172 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sun, 28 Feb 2016 20:02:20 -0800 Subject: Bash lexer: letter from "g" to "z" should also be treated as part of a variable name. Fixes #1214 --- pygments/lexers/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index 4145939e..6a3b3815 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -50,7 +50,7 @@ class BashLexer(RegexLexer): (r'\$\(\(', Keyword, 'math'), (r'\$\(', Keyword, 'paren'), (r'\$\{#?', String.Interpol, 'curly'), - (r'\$[a-fA-F_][a-fA-F0-9_]*', Name.Variable), # user variable + (r'\$[a-zA-Z_][a-zA-Z0-9_]*', Name.Variable), # user variable (r'\$(?:\d+|[#$?!_*@-])', Name.Variable), # builtin (r'\$', Text), ], -- cgit v1.2.1 From 1b34e42de6686b996f244fadab0783533eacebbc Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 29 Feb 2016 16:03:53 +0100 Subject: Bump to 2.1.2 --- CHANGES | 3 ++- pygments/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ca921fc7..aacfef88 100644 --- a/CHANGES +++ b/CHANGES @@ -8,9 +8,10 @@ pull request numbers to the requests at Version 2.1.2 ------------- -(in development) +(released Feb 29, 2016) - Fixed Python 3 regression in image formatter (#1215) +- Fixed regression in Bash lexer (PR#562) Version 2.1.1 diff --git a/pygments/__init__.py b/pygments/__init__.py index 0c17500e..45c53b87 100644 --- a/pygments/__init__.py +++ b/pygments/__init__.py @@ -26,7 +26,7 @@ :license: BSD, see LICENSE for details. """ -__version__ = '2.1.1' +__version__ = '2.1.2' __docformat__ = 'restructuredtext' __all__ = ['lex', 'format', 'highlight'] diff --git a/setup.py b/setup.py index b15e0bc9..03dcffb8 100755 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ else: setup( name = 'Pygments', - version = '2.1.1', + version = '2.1.2', url = 'http://pygments.org/', license = 'BSD License', author = 'Georg Brandl', -- cgit v1.2.1 -- cgit v1.2.1 From e01c1606567c139e72ed98ab9bf39e1c9f6f857f Mon Sep 17 00:00:00 2001 From: David Corbett Date: Tue, 1 Mar 2016 20:09:08 -0500 Subject: Fix Batch strings --- pygments/lexers/shell.py | 8 ++++---- tests/examplefiles/example.bat | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index 6a3b3815..ad2e2d7a 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -214,16 +214,16 @@ class BatchLexer(RegexLexer): (_nl, _punct, _ws, _nl)) _number = r'(?:-?(?:0[0-7]+|0x[\da-f]+|\d+)%s)' % _token_terminator _opword = r'(?:equ|geq|gtr|leq|lss|neq)' - _string = r'(?:"[^%s"]*"?)' % _nl + _string = r'(?:"[^%s"]*(?:"|(?=[%s])))' % (_nl, _nl) _variable = (r'(?:(?:%%(?:\*|(?:~[a-z]*(?:\$[^:]+:)?)?\d|' r'[^%%:%s]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:[^%%%s^]|' r'\^[^%%%s])[^=%s]*=(?:[^%%%s^]|\^[^%%%s])*)?)?%%))|' r'(?:\^?![^!:%s]+(?::(?:~(?:-?\d+)?(?:,(?:-?\d+)?)?|(?:' r'[^!%s^]|\^[^!%s])[^=%s]*=(?:[^!%s^]|\^[^!%s])*)?)?\^?!))' % (_nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl, _nl)) - _core_token = r'(?:(?:(?:\^[%s]?)?[^%s%s%s])+)' % (_nl, _nl, _punct, _ws) - _core_token_compound = r'(?:(?:(?:\^[%s]?)?[^%s%s%s)])+)' % (_nl, _nl, - _punct, _ws) + _core_token = r'(?:(?:(?:\^[%s]?)?[^"%s%s%s])+)' % (_nl, _nl, _punct, _ws) + _core_token_compound = r'(?:(?:(?:\^[%s]?)?[^"%s%s%s)])+)' % (_nl, _nl, + _punct, _ws) _token = r'(?:[%s]+|%s)' % (_punct, _core_token) _token_compound = r'(?:[%s]+|%s)' % (_punct, _core_token_compound) _stoken = (r'(?:[%s]+|(?:%s|%s|%s)+)' % diff --git a/tests/examplefiles/example.bat b/tests/examplefiles/example.bat index bf27673c..596f65de 100644 --- a/tests/examplefiles/example.bat +++ b/tests/examplefiles/example.bat @@ -99,6 +99,10 @@ goto fail rem "comment comment"^ goto fail rem comment comment^ +if "1==1" equ "1==1" goto comments4 +goto fail +:comments4 +rem comment"comment^ set /a _passed+=1 GOTO :EOF goto :fail -- cgit v1.2.1 From f1ccccae15579d7886fdcdf6f1ff251ca574d829 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 2 Mar 2016 08:12:33 +0100 Subject: Bump, 2.1.3 --- CHANGES | 7 +++++++ pygments/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index aacfef88..478970dd 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,13 @@ Issue numbers refer to the tracker at pull request numbers to the requests at . +Version 2.1.3 +------------- +(released Mar 2, 2016) + +- Fixed regression in Bash lexer (PR#563) + + Version 2.1.2 ------------- (released Feb 29, 2016) diff --git a/pygments/__init__.py b/pygments/__init__.py index 45c53b87..c6234404 100644 --- a/pygments/__init__.py +++ b/pygments/__init__.py @@ -26,7 +26,7 @@ :license: BSD, see LICENSE for details. """ -__version__ = '2.1.2' +__version__ = '2.1.3' __docformat__ = 'restructuredtext' __all__ = ['lex', 'format', 'highlight'] diff --git a/setup.py b/setup.py index 03dcffb8..39499090 100755 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ else: setup( name = 'Pygments', - version = '2.1.2', + version = '2.1.3', url = 'http://pygments.org/', license = 'BSD License', author = 'Georg Brandl', -- cgit v1.2.1 -- cgit v1.2.1 From 6fb29e92d2ad882bbcb9141e5b59f02682b75ca5 Mon Sep 17 00:00:00 2001 From: Kurt Neufeld Date: Fri, 3 Jun 2016 17:06:40 -0700 Subject: ResourceLexer.analyse_text must return float or None --- pygments/lexers/resource.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pygments/lexers/resource.py b/pygments/lexers/resource.py index 4647bef8..40429a3c 100644 --- a/pygments/lexers/resource.py +++ b/pygments/lexers/resource.py @@ -81,4 +81,5 @@ class ResourceLexer(RegexLexer): } def analyse_text(text): - return text.startswith('root:table') + if text.startswith('root:table'): + return 1.0 -- cgit v1.2.1 From 2b59bbffe13cf51b8ddf3c3492a0c181783065b3 Mon Sep 17 00:00:00 2001 From: Kurt Neufeld Date: Fri, 3 Jun 2016 17:08:15 -0700 Subject: TextLexer has no priority and comes late in alphabet so therefore it will never be selected as default for *.txt files --- pygments/lexers/special.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pygments/lexers/special.py b/pygments/lexers/special.py index d3a168e7..e66a01cf 100644 --- a/pygments/lexers/special.py +++ b/pygments/lexers/special.py @@ -27,10 +27,13 @@ class TextLexer(Lexer): aliases = ['text'] filenames = ['*.txt'] mimetypes = ['text/plain'] + priority = 0.01 def get_tokens_unprocessed(self, text): yield 0, Text, text + def analyse_text(text): + return TextLexer.priority _ttype_cache = {} -- cgit v1.2.1 From 1632edd8fbb7d824252bd12e52fe275234f45ec9 Mon Sep 17 00:00:00 2001 From: rrt Date: Tue, 7 Jun 2016 22:32:42 +0100 Subject: autopygmentize: put MIME types back in sorted order text/x-crystal was added out of order. Also bump the copyright year. --- external/autopygmentize | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/autopygmentize b/external/autopygmentize index f18cac09..07cfdaa9 100755 --- a/external/autopygmentize +++ b/external/autopygmentize @@ -1,6 +1,6 @@ #!/bin/bash # Best effort auto-pygmentization with transparent decompression -# by Reuben Thomas 2008-2015 +# by Reuben Thomas 2008-2016 # This program is in the public domain. # Strategy: first see if pygmentize can find a lexer; if not, ask file; if that finds nothing, fail @@ -25,6 +25,7 @@ if [[ "$lexer" == text ]]; then text/x-awk) lexer=awk;; text/x-c) lexer=c;; text/x-c++) lexer=cpp;; + text/x-crystal) lexer=crystal;; text/x-diff) lexer=diff;; text/x-fortran) lexer=fortran;; text/x-gawk) lexer=gawk;; @@ -40,7 +41,6 @@ if [[ "$lexer" == text ]]; then text/x-po) lexer=po;; text/x-python) lexer=python;; text/x-ruby) lexer=ruby;; - text/x-crystal) lexer=crystal;; text/x-shellscript) lexer=sh;; text/x-tcl) lexer=tcl;; text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer -- cgit v1.2.1 From 1996fd14d14b71a0cc336b3fed83c905fc63467c Mon Sep 17 00:00:00 2001 From: rrt Date: Tue, 7 Jun 2016 22:54:32 +0100 Subject: autopygmentize: use hexdump on binary files Not strictly using autopygmentize, but makes things more legible. --- external/autopygmentize | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/external/autopygmentize b/external/autopygmentize index 07cfdaa9..9b030fac 100755 --- a/external/autopygmentize +++ b/external/autopygmentize @@ -66,19 +66,26 @@ if [[ "$lexer" == text ]]; then esac fi +# Find a preprocessor for compressed files +concat=cat +case $(file $file_common_opts --mime-type "$file") in + application/x-gzip) concat=zcat;; + application/x-bzip2) concat=bzcat;; + application/x-xz) concat=xzcat;; +esac + +# Find a reader: either a suitable lexer, or hd for binary files +reader="" encoding=$(file --mime-encoding --uncompress $file_common_opts "$file") if [[ $encoding == "binary" ]]; then - encoding="latin1" + reader=hd +elif [[ -n "$lexer" ]]; then + reader="pygmentize -O inencoding=$encoding $PYGMENTIZE_OPTS $options -l $lexer" fi -if [[ -n "$lexer" ]]; then - concat=cat - case $(file $file_common_opts --mime-type "$file") in - application/x-gzip) concat=zcat;; - application/x-bzip2) concat=bzcat;; - application/x-xz) concat=xzcat;; - esac - exec $concat "$file" | pygmentize -O inencoding=$encoding $PYGMENTIZE_OPTS $options -l $lexer +# If we found a reader, run it +if [[ -n "$reader" ]]; then + exec $concat "$file" | $reader fi exit 1 -- cgit v1.2.1 From b3955bae9598a60a51dacd0b637f6006ae6afff7 Mon Sep 17 00:00:00 2001 From: SHEN Wenqiang Date: Mon, 13 Jun 2016 01:19:16 +0000 Subject: ncl.py edited online with Bitbucket some punctuations have added --- pygments/lexers/ncl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py index 23eba786..f3324b09 100644 --- a/pygments/lexers/ncl.py +++ b/pygments/lexers/ncl.py @@ -35,7 +35,7 @@ class NCLLexer(RegexLexer): (r';.*\n', Comment), include('strings'), include('core'), - (r'[a-z][\w$]*', Name), + (r'[a-zA-Z_]\w*', Name), include('nums'), (r'[\s]+', Text), ], @@ -62,7 +62,7 @@ class NCLLexer(RegexLexer): (r'[\^*+\-/<>]', Operator), # punctuation: - (r'[\[\]():@$.,]', Punctuation), + (r'[\[\]():@$.,]\\{}', Punctuation), (r'[=:]', Punctuation), # Intrinsics -- cgit v1.2.1 From 7b15190ff900c719eee1ac497f966709462fe912 Mon Sep 17 00:00:00 2001 From: SHEN Wenqiang Date: Mon, 13 Jun 2016 01:36:12 +0000 Subject: remove some invalid built-in resource. --- pygments/lexers/ncl.py | 318 ++++++++++++------------------------------------- 1 file changed, 79 insertions(+), 239 deletions(-) diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py index f3324b09..00850c66 100644 --- a/pygments/lexers/ncl.py +++ b/pygments/lexers/ncl.py @@ -62,7 +62,7 @@ class NCLLexer(RegexLexer): (r'[\^*+\-/<>]', Operator), # punctuation: - (r'[\[\]():@$.,]\\{}', Punctuation), + (r'[\[\]():@$.,\\{}]', Punctuation), (r'[=:]', Punctuation), # Intrinsics @@ -589,149 +589,60 @@ class NCLLexer(RegexLexer): 'lgTitleFontQuality', 'lgTitleFontThicknessF', 'lgTitleFuncCode', 'lgTitleJust', 'lgTitleOffsetF', 'lgTitleOn', 'lgTitlePosition', 'lgTitleString', 'lgTopMarginF', 'mpAreaGroupCount', - 'mpAreaGroupCount_MapPlot', 'mpAreaMaskingOn', - 'mpAreaMaskingOn_MapPlot', 'mpAreaNames', 'mpAreaNames_MapPlot', - 'mpAreaTypes', 'mpAreaTypes_MapPlot', 'mpBottomAngleF', - 'mpBottomAngleF_MapTransformation', 'mpBottomMapPosF', - 'mpBottomMapPosF_MapTransformation', 'mpBottomNDCF', - 'mpBottomNDCF_MapTransformation', 'mpBottomNPCF', - 'mpBottomNPCF_MapTransformation', 'mpBottomPointLatF', - 'mpBottomPointLatF_MapTransformation', 'mpBottomPointLonF', - 'mpBottomPointLonF_MapTransformation', 'mpBottomWindowF', - 'mpBottomWindowF_MapTransformation', 'mpCenterLatF', - 'mpCenterLatF_MapTransformation', 'mpCenterLonF', - 'mpCenterLonF_MapTransformation', 'mpCenterRotF', - 'mpCenterRotF_MapTransformation', 'mpCountyLineColor', - 'mpCountyLineColor_MapPlot', 'mpCountyLineDashPattern', - 'mpCountyLineDashPattern_MapPlot', 'mpCountyLineDashSegLenF', - 'mpCountyLineDashSegLenF_MapPlot', 'mpCountyLineThicknessF', - 'mpCountyLineThicknessF_MapPlot', 'mpDataBaseVersion', - 'mpDataBaseVersion_MapPlot', 'mpDataResolution', - 'mpDataResolution_MapPlot', 'mpDataSetName', 'mpDataSetName_MapPlot', - 'mpDefaultFillColor', 'mpDefaultFillColor_MapPlot', - 'mpDefaultFillPattern', 'mpDefaultFillPattern_MapPlot', - 'mpDefaultFillScaleF', 'mpDefaultFillScaleF_MapPlot', - 'mpDynamicAreaGroups', 'mpDynamicAreaGroups_MapPlot', - 'mpEllipticalBoundary', 'mpEllipticalBoundary_MapTransformation', - 'mpFillAreaSpecifiers', 'mpFillAreaSpecifiers_MapPlot', - 'mpFillBoundarySets', 'mpFillBoundarySets_MapPlot', 'mpFillColor', - 'mpFillColor_MapPlot', 'mpFillColors', 'mpFillColors_MapPlot', - 'mpFillColors-default', 'mpFillDotSizeF', 'mpFillDotSizeF_MapPlot', - 'mpFillDrawOrder', 'mpFillDrawOrder_MapPlot', 'mpFillOn', - 'mpFillOn_MapPlot', 'mpFillPatternBackground', - 'mpFillPatternBackground_MapPlot', 'mpFillPattern', - 'mpFillPattern_MapPlot', 'mpFillPatterns', 'mpFillPatterns_MapPlot', - 'mpFillPatterns-default', 'mpFillScaleF', 'mpFillScaleF_MapPlot', - 'mpFillScales', 'mpFillScales_MapPlot', 'mpFillScales-default', - 'mpFixedAreaGroups', 'mpFixedAreaGroups_MapPlot', - 'mpGeophysicalLineColor', 'mpGeophysicalLineColor_MapPlot', - 'mpGeophysicalLineDashPattern', - 'mpGeophysicalLineDashPattern_MapPlot', - 'mpGeophysicalLineDashSegLenF', - 'mpGeophysicalLineDashSegLenF_MapPlot', 'mpGeophysicalLineThicknessF', - 'mpGeophysicalLineThicknessF_MapPlot', 'mpGreatCircleLinesOn', - 'mpGreatCircleLinesOn_MapTransformation', 'mpGridAndLimbDrawOrder', - 'mpGridAndLimbDrawOrder_MapPlot', 'mpGridAndLimbOn', - 'mpGridAndLimbOn_MapPlot', 'mpGridLatSpacingF', - 'mpGridLatSpacingF_MapPlot', 'mpGridLineColor', - 'mpGridLineColor_MapPlot', 'mpGridLineDashPattern', - 'mpGridLineDashPattern_MapPlot', 'mpGridLineDashSegLenF', - 'mpGridLineDashSegLenF_MapPlot', 'mpGridLineThicknessF', - 'mpGridLineThicknessF_MapPlot', 'mpGridLonSpacingF', - 'mpGridLonSpacingF_MapPlot', 'mpGridMaskMode', - 'mpGridMaskMode_MapPlot', 'mpGridMaxLatF', 'mpGridMaxLatF_MapPlot', - 'mpGridPolarLonSpacingF', 'mpGridPolarLonSpacingF_MapPlot', - 'mpGridSpacingF', 'mpGridSpacingF_MapPlot', 'mpInlandWaterFillColor', - 'mpInlandWaterFillColor_MapPlot', 'mpInlandWaterFillPattern', - 'mpInlandWaterFillPattern_MapPlot', 'mpInlandWaterFillScaleF', - 'mpInlandWaterFillScaleF_MapPlot', 'mpLabelDrawOrder', - 'mpLabelDrawOrder_MapPlot', 'mpLabelFontColor', - 'mpLabelFontColor_MapPlot', 'mpLabelFontHeightF', - 'mpLabelFontHeightF_MapPlot', 'mpLabelsOn', 'mpLabelsOn_MapPlot', - 'mpLambertMeridianF', 'mpLambertMeridianF_MapTransformation', - 'mpLambertParallel1F', 'mpLambertParallel1F_MapTransformation', - 'mpLambertParallel2F', 'mpLambertParallel2F_MapTransformation', - 'mpLandFillColor', 'mpLandFillColor_MapPlot', 'mpLandFillPattern', - 'mpLandFillPattern_MapPlot', 'mpLandFillScaleF', - 'mpLandFillScaleF_MapPlot', 'mpLeftAngleF', - 'mpLeftAngleF_MapTransformation', 'mpLeftCornerLatF', - 'mpLeftCornerLatF_MapTransformation', 'mpLeftCornerLonF', - 'mpLeftCornerLonF_MapTransformation', 'mpLeftMapPosF', - 'mpLeftMapPosF_MapTransformation', 'mpLeftNDCF', - 'mpLeftNDCF_MapTransformation', 'mpLeftNPCF', - 'mpLeftNPCF_MapTransformation', 'mpLeftPointLatF', - 'mpLeftPointLatF_MapTransformation', 'mpLeftPointLonF', - 'mpLeftPointLonF_MapTransformation', 'mpLeftWindowF', - 'mpLeftWindowF_MapTransformation', 'mpLimbLineColor', - 'mpLimbLineColor_MapPlot', 'mpLimbLineDashPattern', - 'mpLimbLineDashPattern_MapPlot', 'mpLimbLineDashSegLenF', - 'mpLimbLineDashSegLenF_MapPlot', 'mpLimbLineThicknessF', - 'mpLimbLineThicknessF_MapPlot', 'mpLimitMode', - 'mpLimitMode_MapTransformation', 'Angle_projection_limits', - 'mpMaskAreaSpecifiers', 'mpMaskAreaSpecifiers_MapPlot', - 'mpMaskOutlineSpecifiers', 'mpMaskOutlineSpecifiers_MapPlot', - 'mpMaxLatF', 'mpMaxLatF_MapTransformation', 'mpMaxLonF', - 'mpMaxLonF_MapTransformation', 'mpMinLatF', - 'mpMinLatF_MapTransformation', 'mpMinLonF', - 'mpMinLonF_MapTransformation', 'mpMonoFillColor', - 'mpMonoFillColor_MapPlot', 'mpMonoFillPattern', - 'mpMonoFillPattern_MapPlot', 'mpMonoFillScale', - 'mpMonoFillScale_MapPlot', 'mpNationalLineColor', - 'mpNationalLineColor_MapPlot', 'mpNationalLineDashPattern', - 'mpNationalLineDashPattern_MapPlot', - 'mpNationalLineDashSegLenF_MapPlot', 'mpNationalLineThicknessF', - 'mpNationalLineThicknessF_MapPlot', 'mpOceanFillColor', - 'mpOceanFillColor_MapPlot', 'mpOceanFillPattern', - 'mpOceanFillPattern_MapPlot', 'mpOceanFillScaleF', - 'mpOceanFillScaleF_MapPlot', 'mpOutlineBoundarySets', - 'mpOutlineBoundarySets_MapPlot', 'mpOutlineDrawOrder', - 'mpOutlineDrawOrder_MapPlot', 'mpOutlineMaskingOn', - 'mpOutlineMaskingOn_MapPlot', 'mpOutlineOn', 'mpOutlineOn_MapPlot', - 'mpOutlineSpecifiers', 'mpOutlineSpecifiers_MapPlot', - 'mpPerimDrawOrder', 'mpPerimDrawOrder_MapPlot', 'mpPerimLineColor', - 'mpPerimLineColor_MapPlot', 'mpPerimLineDashPattern', - 'mpPerimLineDashPattern_MapPlot', 'mpPerimLineDashSegLenF', - 'mpPerimLineDashSegLenF_MapPlot', 'mpPerimLineThicknessF', - 'mpPerimLineThicknessF_MapPlot', 'mpPerimOn', 'mpPerimOn_MapPlot', - 'mpPolyMode', 'mpPolyMode_MapTransformation', 'mpProjection', - 'mpProjection_MapTransformation', 'mpProvincialLineColor', - 'mpProvincialLineColor_MapPlot', 'mpProvincialLineDashPattern', - 'mpProvincialLineDashPattern_MapPlot', 'mpProvincialLineDashSegLenF', - 'mpProvincialLineDashSegLenF_MapPlot', 'mpProvincialLineThicknessF', - 'mpProvincialLineThicknessF_MapPlot', 'mpRelativeCenterLat', - 'mpRelativeCenterLat_MapTransformation', 'mpRelativeCenterLon', - 'mpRelativeCenterLon_MapTransformation', 'mpRightAngleF', - 'mpRightAngleF_MapTransformation', 'mpRightCornerLatF', - 'mpRightCornerLatF_MapTransformation', 'mpRightCornerLonF', - 'mpRightCornerLonF_MapTransformation', 'mpRightMapPosF', - 'mpRightMapPosF_MapTransformation', 'mpRightNDCF', - 'mpRightNDCF_MapTransformation', 'mpRightNPCF', - 'mpRightNPCF_MapTransformation', 'mpRightPointLatF', - 'mpRightPointLatF_MapTransformation', 'mpRightPointLonF', - 'mpRightPointLonF_MapTransformation', 'mpRightWindowF', - 'mpRightWindowF_MapTransformation', 'mpSatelliteAngle1F', - 'mpSatelliteAngle1F_MapTransformation', 'mpSatelliteAngle2F', - 'mpSatelliteAngle2F_MapTransformation', 'mpSatelliteDistF', - 'mpSatelliteDistF_MapTransformation', 'mpShapeMode', - 'mpShapeMode_MapPlot', 'mpSpecifiedFillColors', - 'mpSpecifiedFillColors_MapPlot', 'mpSpecifiedFillDirectIndexing', - 'mpSpecifiedFillDirectIndexing_MapPlot', 'mpSpecifiedFillPatterns', - 'mpSpecifiedFillPatterns_MapPlot', 'mpSpecifiedFillPriority', - 'mpSpecifiedFillPriority_MapPlot', 'mpSpecifiedFillScales', - 'mpSpecifiedFillScales_MapPlot', 'mpTopAngleF', - 'mpTopAngleF_MapTransformation', 'mpTopMapPosF', - 'mpTopMapPosF_MapTransformation', 'mpTopNDCF', - 'mpTopNDCF_MapTransformation', 'mpTopNPCF', - 'mpTopNPCF_MapTransformation', 'mpTopPointLatF', - 'mpTopPointLatF_MapTransformation', 'mpTopPointLonF', - 'mpTopPointLonF_MapTransformation', 'mpTopWindowF', - 'mpTopWindowF_MapTransformation', 'mpUSStateLineColor', - 'mpUSStateLineColor_MapPlot', 'mpUSStateLineDashPattern', - 'mpUSStateLineDashPattern_MapPlot', 'mpUSStateLineDashSegLenF', - 'mpUSStateLineDashSegLenF_MapPlot', 'mpUSStateLineThicknessF', - 'mpUSStateLineThicknessF_MapPlot', 'pmAnnoManagers', - 'pmAnnoViews', 'pmLabelBarDisplayMode', 'pmLabelBarHeightF', - 'pmLabelBarKeepAspect', 'pmLabelBarOrthogonalPosF', + 'mpAreaMaskingOn', 'mpAreaNames', 'mpAreaTypes', 'mpBottomAngleF', + 'mpBottomMapPosF', 'mpBottomNDCF', 'mpBottomNPCF', + 'mpBottomPointLatF', 'mpBottomPointLonF', 'mpBottomWindowF', + 'mpCenterLatF', 'mpCenterLonF', 'mpCenterRotF', 'mpCountyLineColor', + 'mpCountyLineDashPattern', 'mpCountyLineDashSegLenF', + 'mpCountyLineThicknessF', 'mpDataBaseVersion', 'mpDataResolution', + 'mpDataSetName', 'mpDefaultFillColor', 'mpDefaultFillPattern', + 'mpDefaultFillScaleF', 'mpDynamicAreaGroups', 'mpEllipticalBoundary', + 'mpFillAreaSpecifiers', 'mpFillBoundarySets', 'mpFillColor', + 'mpFillColors', 'mpFillColors-default', 'mpFillDotSizeF', + 'mpFillDrawOrder', 'mpFillOn', 'mpFillPatternBackground', + 'mpFillPattern', 'mpFillPatterns', 'mpFillPatterns-default', + 'mpFillScaleF', 'mpFillScales', 'mpFillScales-default', + 'mpFixedAreaGroups', 'mpGeophysicalLineColor', + 'mpGeophysicalLineDashPattern', 'mpGeophysicalLineDashSegLenF', + 'mpGeophysicalLineThicknessF', 'mpGreatCircleLinesOn', + 'mpGridAndLimbDrawOrder', 'mpGridAndLimbOn', 'mpGridLatSpacingF', + 'mpGridLineColor', 'mpGridLineDashPattern', 'mpGridLineDashSegLenF', + 'mpGridLineThicknessF', 'mpGridLonSpacingF', 'mpGridMaskMode', + 'mpGridMaxLatF', 'mpGridPolarLonSpacingF', 'mpGridSpacingF', + 'mpInlandWaterFillColor', 'mpInlandWaterFillPattern', + 'mpInlandWaterFillScaleF', 'mpLabelDrawOrder', 'mpLabelFontColor', + 'mpLabelFontHeightF', 'mpLabelsOn', 'mpLambertMeridianF', + 'mpLambertParallel1F', 'mpLambertParallel2F', 'mpLandFillColor', + 'mpLandFillPattern', 'mpLandFillScaleF', 'mpLeftAngleF', + 'mpLeftCornerLatF', 'mpLeftCornerLonF', 'mpLeftMapPosF', + 'mpLeftNDCF', 'mpLeftNPCF', 'mpLeftPointLatF', + 'mpLeftPointLonF', 'mpLeftWindowF', 'mpLimbLineColor', + 'mpLimbLineDashPattern', 'mpLimbLineDashSegLenF', + 'mpLimbLineThicknessF', 'mpLimitMode', 'mpMaskAreaSpecifiers', + 'mpMaskOutlineSpecifiers', 'mpMaxLatF', 'mpMaxLonF', + 'mpMinLatF', 'mpMinLonF', 'mpMonoFillColor', 'mpMonoFillPattern', + 'mpMonoFillScale', 'mpNationalLineColor', 'mpNationalLineDashPattern', + 'mpNationalLineThicknessF', 'mpOceanFillColor', 'mpOceanFillPattern', + 'mpOceanFillScaleF', 'mpOutlineBoundarySets', 'mpOutlineDrawOrder', + 'mpOutlineMaskingOn', 'mpOutlineOn', 'mpOutlineSpecifiers', + 'mpPerimDrawOrder', 'mpPerimLineColor', 'mpPerimLineDashPattern', + 'mpPerimLineDashSegLenF', 'mpPerimLineThicknessF', 'mpPerimOn', + 'mpPolyMode', 'mpProjection', 'mpProvincialLineColor', + 'mpProvincialLineDashPattern', 'mpProvincialLineDashSegLenF', + 'mpProvincialLineThicknessF', 'mpRelativeCenterLat', + 'mpRelativeCenterLon', 'mpRightAngleF', 'mpRightCornerLatF', + 'mpRightCornerLonF', 'mpRightMapPosF', 'mpRightNDCF', + 'mpRightNPCF', 'mpRightPointLatF', 'mpRightPointLonF', + 'mpRightWindowF', 'mpSatelliteAngle1F', 'mpSatelliteAngle2F', + 'mpSatelliteDistF', 'mpShapeMode', 'mpSpecifiedFillColors', + 'mpSpecifiedFillDirectIndexing', 'mpSpecifiedFillPatterns', + 'mpSpecifiedFillPriority', 'mpSpecifiedFillScales', + 'mpTopAngleF', 'mpTopMapPosF', 'mpTopNDCF', 'mpTopNPCF', + 'mpTopPointLatF', 'mpTopPointLonF', 'mpTopWindowF', + 'mpUSStateLineColor', 'mpUSStateLineDashPattern', + 'mpUSStateLineDashSegLenF', 'mpUSStateLineThicknessF', + 'pmAnnoManagers', 'pmAnnoViews', 'pmLabelBarDisplayMode', + 'pmLabelBarHeightF', 'pmLabelBarKeepAspect', 'pmLabelBarOrthogonalPosF', 'pmLabelBarParallelPosF', 'pmLabelBarSide', 'pmLabelBarWidthF', 'pmLabelBarZone', 'pmLegendDisplayMode', 'pmLegendHeightF', 'pmLegendKeepAspect', 'pmLegendOrthogonalPosF', @@ -739,35 +650,14 @@ class NCLLexer(RegexLexer): 'pmLegendZone', 'pmOverlaySequenceIds', 'pmTickMarkDisplayMode', 'pmTickMarkZone', 'pmTitleDisplayMode', 'pmTitleZone', 'prGraphicStyle', 'prPolyType', 'prXArray', 'prYArray', - 'sfCopyData_MeshScalarField', 'sfCopyData', 'sfCopyData_ScalarField', - 'sfDataArray_MeshScalarField', 'sfDataArray', - 'sfDataArray_ScalarField', 'sfDataMaxV_MeshScalarField', 'sfDataMaxV', - 'sfDataMaxV_ScalarField', 'sfDataMinV_MeshScalarField', 'sfDataMinV', - 'sfDataMinV_ScalarField', 'sfElementNodes', - 'sfElementNodes_MeshScalarField', 'sfExchangeDimensions', - 'sfExchangeDimensions_ScalarField', 'sfFirstNodeIndex', - 'sfFirstNodeIndex_MeshScalarField', 'sfMissingValueV_MeshScalarField', - 'sfMissingValueV', 'sfMissingValueV_ScalarField', - 'sfXArray_MeshScalarField', 'sfXArray', 'sfXArray_ScalarField', - 'sfXCActualEndF_MeshScalarField', 'sfXCActualEndF', - 'sfXCActualEndF_ScalarField', 'sfXCActualStartF_MeshScalarField', - 'sfXCActualStartF', 'sfXCActualStartF_ScalarField', 'sfXCEndIndex', - 'sfXCEndIndex_ScalarField', 'sfXCEndSubsetV', - 'sfXCEndSubsetV_ScalarField', 'sfXCEndV', 'sfXCEndV_ScalarField', - 'sfXCStartIndex', 'sfXCStartIndex_ScalarField', 'sfXCStartSubsetV', - 'sfXCStartSubsetV_ScalarField', 'sfXCStartV', - 'sfXCStartV_ScalarField', 'sfXCStride', 'sfXCStride_ScalarField', - 'sfXCellBounds', 'sfXCellBounds_MeshScalarField', - 'sfYArray_MeshScalarField', 'sfYArray', 'sfYArray_ScalarField', - 'sfYCActualEndF_MeshScalarField', 'sfYCActualEndF', - 'sfYCActualEndF_ScalarField', 'sfYCActualStartF_MeshScalarField', - 'sfYCActualStartF', 'sfYCActualStartF_ScalarField', 'sfYCEndIndex', - 'sfYCEndIndex_ScalarField', 'sfYCEndSubsetV', - 'sfYCEndSubsetV_ScalarField', 'sfYCEndV', 'sfYCEndV_ScalarField', - 'sfYCStartIndex', 'sfYCStartIndex_ScalarField', 'sfYCStartSubsetV', - 'sfYCStartSubsetV_ScalarField', 'sfYCStartV', - 'sfYCStartV_ScalarField', 'sfYCStride', 'sfYCStride_ScalarField', - 'sfYCellBounds', 'sfYCellBounds_MeshScalarField', 'stArrowLengthF', + 'sfCopyData', 'sfDataArray', 'sfDataMaxV', 'sfDataMinV', + 'sfElementNodes', 'sfExchangeDimensions', 'sfFirstNodeIndex', + 'sfMissingValueV', 'sfXArray', 'sfXCActualEndF', 'sfXCActualStartF', + 'sfXCEndIndex', 'sfXCEndSubsetV', 'sfXCEndV', 'sfXCStartIndex', + 'sfXCStartSubsetV', 'sfXCStartV', 'sfXCStride', 'sfXCellBounds', + 'sfYArray', 'sfYCActualEndF', 'sfYCActualStartF', 'sfYCEndIndex', + 'sfYCEndSubsetV', 'sfYCEndV', 'sfYCStartIndex', 'sfYCStartSubsetV', + 'sfYCStartV', 'sfYCStride', 'sfYCellBounds', 'stArrowLengthF', 'stArrowStride', 'stCrossoverCheckCount', 'stExplicitLabelBarLabelsOn', 'stLabelBarEndLabelsOn', 'stLabelFormat', 'stLengthCheckCount', 'stLevelColors', @@ -870,25 +760,12 @@ class NCLLexer(RegexLexer): 'tmYRMinorPerMajor', 'tmYRMinorThicknessF', 'tmYRMinorValues', 'tmYRMode', 'tmYROn', 'tmYRPrecision', 'tmYRStyle', 'tmYRTickEndF', 'tmYRTickSpacingF', 'tmYRTickStartF', 'tmYRValues', 'tmYUseLeft', - 'trGridType', 'trGridType_Transformation', 'trLineInterpolationOn', - 'trLineInterpolationOn_Transformation', 'trXAxisType', - 'trXAxisType_IrregularTransformation', 'trXCoordPoints', - 'trXCoordPoints_IrregularTransformation', 'trXInterPoints', - 'trXInterPoints_IrregularTransformation', 'trXLog', - 'trXLog_LogLinTransformation', 'trXMaxF', 'trXMaxF_Transformation', - 'trXMinF', 'trXMinF_Transformation', 'trXReverse', - 'trXReverse_Transformation', 'trXSamples', - 'trXSamples_IrregularTransformation', 'trXTensionF', - 'trXTensionF_IrregularTransformation', 'trYAxisType', - 'trYAxisType_IrregularTransformation', 'trYCoordPoints', - 'trYCoordPoints_IrregularTransformation', 'trYInterPoints', - 'trYInterPoints_IrregularTransformation', 'trYLog', - 'trYLog_LogLinTransformation', 'trYMaxF', 'trYMaxF_Transformation', - 'trYMinF', 'trYMinF_Transformation', 'trYReverse', - 'trYReverse_Transformation', 'trYSamples', - 'trYSamples_IrregularTransformation', 'trYTensionF', - 'trYTensionF_IrregularTransformation', 'txAngleF', - 'txBackgroundFillColor', 'txConstantSpacingF', 'txDirection', + 'trGridType', 'trLineInterpolationOn', + 'trXAxisType', 'trXCoordPoints', 'trXInterPoints', 'trXLog', + 'trXMaxF', 'trXMinF', 'trXReverse', 'trXSamples', 'trXTensionF', + 'trYAxisType', 'trYCoordPoints', 'trYInterPoints', 'trYLog', + 'trYMaxF', 'trYMinF', 'trYReverse', 'trYSamples', 'trYTensionF', + 'txAngleF', 'txBackgroundFillColor', 'txConstantSpacingF', 'txDirection', 'txFont', 'HLU-Fonts', 'txFontAspectF', 'txFontColor', 'txFontHeightF', 'txFontOpacityF', 'txFontQuality', 'txFontThicknessF', 'txFuncCode', 'txJust', 'txPerimColor', @@ -969,53 +846,16 @@ class NCLLexer(RegexLexer): 'vfYCEndSubsetV', 'vfYCEndV', 'vfYCStartIndex', 'vfYCStartSubsetV', 'vfYCStartV', 'vfYCStride', 'vpAnnoManagerId', 'vpClipOn', 'vpHeightF', 'vpKeepAspect', 'vpOn', 'vpUseSegments', 'vpWidthF', - 'vpXF', 'vpYF', 'wkAntiAlias', 'wkAntiAlias_DocumentWorkstation', - 'wkAntiAlias_ImageWorkstation', 'wkAntiAlias_XWorkstation', - 'wkBackgroundColor', 'wkBackgroundColor_Workstation', - 'wkBackgroundOpacityF', 'wkBackgroundOpacityF_DocumentWorkstation', - 'wkBackgroundOpacityF_ImageWorkstation', - 'wkBackgroundOpacityF_XWorkstation', 'wkColorMapLen', - 'wkColorMapLen_Workstation', 'wkColorMap', 'wkColorMap_Workstation', - 'wkColorModel', 'wkColorModel_PDFWorkstation', - 'wkColorModel_PSWorkstation', 'wkDashTableLength', - 'wkDashTableLength_Workstation', 'wkDefGraphicStyleId', - 'wkDefGraphicStyleId_Workstation', 'wkDeviceLowerX', - 'wkDeviceLowerX_DocumentWorkstation', 'wkDeviceLowerX_PDFWorkstation', - 'wkDeviceLowerX_PSWorkstation', 'wkDeviceLowerY', - 'wkDeviceLowerY_DocumentWorkstation', 'wkDeviceLowerY_PDFWorkstation', - 'wkDeviceLowerY_PSWorkstation', 'wkDeviceUpperX', - 'wkDeviceUpperX_DocumentWorkstation', 'wkDeviceUpperX_PDFWorkstation', - 'wkDeviceUpperX_PSWorkstation', 'wkDeviceUpperY', - 'wkDeviceUpperY_DocumentWorkstation', 'wkDeviceUpperY_PDFWorkstation', - 'wkDeviceUpperY_PSWorkstation', 'wkFileName', - 'wkFileName_DocumentWorkstation', 'wkFileName_ImageWorkstation', - 'wkFillTableLength', 'wkFillTableLength_Workstation', - 'wkForegroundColor', 'wkForegroundColor_Workstation', 'wkFormat', - 'wkFormat_DocumentWorkstation', 'wkFormat_ImageWorkstation', - 'wkFullBackground', 'wkFullBackground_PDFWorkstation', - 'wkFullBackground_PSWorkstation', 'wkGksWorkId', - 'wkGksWorkId_Workstation', 'wkHeight', 'wkHeight_ImageWorkstation', - 'wkHeight_XWorkstation', 'wkMarkerTableLength', - 'wkMarkerTableLength_Workstation', 'wkMetaName', - 'wkMetaName_NcgmWorkstation', 'wkOrientation', - 'wkOrientation_PDFWorkstation', 'wkOrientation_PSWorkstation', - 'wkPDFFileName', 'wkPDFFileName_PDFWorkstation', 'wkPDFFormat', - 'wkPDFFormat_PDFWorkstation', 'wkPDFResolution', - 'wkPDFResolution_PDFWorkstation', 'wkPSFileName', - 'wkPSFileName_PSWorkstation', 'wkPSFormat', - 'wkPSFormat_PSWorkstation', 'wkPSResolution', - 'wkPSResolution_PSWorkstation', 'wkPaperHeightF', - 'wkPaperHeightF_DocumentWorkstation', 'wkPaperHeightF_PDFWorkstation', - 'wkPaperHeightF_PSWorkstation', 'wkPaperSize', - 'wkPaperSize_DocumentWorkstation', 'wkPaperSize_PDFWorkstation', - 'wkPaperSize_PSWorkstation', 'wkPaperWidthF', - 'wkPaperWidthF_DocumentWorkstation', 'wkPaperWidthF_PDFWorkstation', - 'wkPaperWidthF_PSWorkstation', 'wkPause', 'wkPause_XWorkstation', - 'wkTopLevelViews', 'wkTopLevelViews_Workstation', 'wkViews', - 'wkViews_Workstation', 'wkVisualType', 'wkVisualType_PDFWorkstation', - 'wkVisualType_PSWorkstation', 'wkWidth', 'wkWidth_ImageWorkstation', - 'wkWidth_XWorkstation', 'wkWindowId', 'wkWindowId_XWorkstation', - 'wkXColorMode', 'wkXColorMode_XWorkstation', 'wsCurrentSize', + 'vpXF', 'vpYF', 'wkAntiAlias', 'wkBackgroundColor', 'wkBackgroundOpacityF', + 'wkColorMapLen', 'wkColorMap', 'wkColorModel', 'wkDashTableLength', + 'wkDefGraphicStyleId', 'wkDeviceLowerX', 'wkDeviceLowerY', + 'wkDeviceUpperX', 'wkDeviceUpperY', 'wkFileName', 'wkFillTableLength', + 'wkForegroundColor', 'wkFormat', 'wkFullBackground', 'wkGksWorkId', + 'wkHeight', 'wkMarkerTableLength', 'wkMetaName', 'wkOrientation', + 'wkPDFFileName', 'wkPDFFormat', 'wkPDFResolution', 'wkPSFileName', + 'wkPSFormat', 'wkPSResolution', 'wkPaperHeightF', 'wkPaperSize', + 'wkPaperWidthF', 'wkPause', 'wkTopLevelViews', 'wkViews', + 'wkVisualType', 'wkWidth', 'wkWindowId', 'wkXColorMode', 'wsCurrentSize', 'wsMaximumSize', 'wsThresholdSize', 'xyComputeXMax', 'xyComputeXMin', 'xyComputeYMax', 'xyComputeYMin', 'xyCoordData', 'xyCoordDataSpec', 'xyCurveDrawOrder', 'xyDashPattern', -- cgit v1.2.1 From bdb202da36e80a9bc549d8609835ef3ec1d3fb19 Mon Sep 17 00:00:00 2001 From: SHEN Wenqiang Date: Mon, 13 Jun 2016 01:50:13 +0000 Subject: add some punctuation --- pygments/lexers/ncl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py index 00850c66..19668579 100644 --- a/pygments/lexers/ncl.py +++ b/pygments/lexers/ncl.py @@ -59,10 +59,10 @@ class NCLLexer(RegexLexer): Keyword.Type), # Operators - (r'[\^*+\-/<>]', Operator), + (r'[\%^*+\-/<>]', Operator), # punctuation: - (r'[\[\]():@$.,\\{}]', Punctuation), + (r'[\[\]():@$!&.,\\{}]', Punctuation), (r'[=:]', Punctuation), # Intrinsics -- cgit v1.2.1 From e601f288aebcbd7a8ca204d70a65140339dab2f7 Mon Sep 17 00:00:00 2001 From: SHEN Wenqiang Date: Mon, 13 Jun 2016 02:01:46 +0000 Subject: ncl.py edited online with Bitbucket add some punctuation --- pygments/lexers/ncl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py index 19668579..1cc8a3f5 100644 --- a/pygments/lexers/ncl.py +++ b/pygments/lexers/ncl.py @@ -62,7 +62,7 @@ class NCLLexer(RegexLexer): (r'[\%^*+\-/<>]', Operator), # punctuation: - (r'[\[\]():@$!&.,\\{}]', Punctuation), + (r'[\[\]():@$!&\|.,\\{}]', Punctuation), (r'[=:]', Punctuation), # Intrinsics -- cgit v1.2.1 From ab715a0e3393c8baa0843265cc8e30ff0a136e9b Mon Sep 17 00:00:00 2001 From: SHEN Wenqiang Date: Mon, 13 Jun 2016 04:46:12 +0000 Subject: revise bool value --- pygments/lexers/ncl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py index 1cc8a3f5..2c6812bb 100644 --- a/pygments/lexers/ncl.py +++ b/pygments/lexers/ncl.py @@ -877,7 +877,8 @@ class NCLLexer(RegexLexer): Name.Builtin), # Booleans - (r'True|False', Name.Builtin), # Comparing Operators + (r'\.(True|False)\.', Name.Builtin), + # Comparing Operators (r'\.(eq|ne|lt|le|gt|ge|not|and|or|xor)\.', Operator.Word), ], -- cgit v1.2.1 From 68a3d955b35f041b6f320e2f68eee5e10f45bed4 Mon Sep 17 00:00:00 2001 From: SHEN Wenqiang Date: Mon, 13 Jun 2016 04:57:22 +0000 Subject: add 'True' in keywords --- pygments/lexers/ncl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygments/lexers/ncl.py b/pygments/lexers/ncl.py index 2c6812bb..405c203b 100644 --- a/pygments/lexers/ncl.py +++ b/pygments/lexers/ncl.py @@ -43,7 +43,7 @@ class NCLLexer(RegexLexer): # Statements (words(( 'begin', 'break', 'continue', 'create', 'defaultapp', 'do', - 'else', 'end', 'external', 'exit', 'False', 'file', 'function', + 'else', 'end', 'external', 'exit', 'True', 'False', 'file', 'function', 'getvalues', 'graphic', 'group', 'if', 'list', 'load', 'local', 'new', '_Missing', 'Missing', 'new', 'noparent', 'procedure', 'quit', 'QUIT', 'Quit', 'record', 'return', 'setvalues', 'stop', -- cgit v1.2.1 From e10e63b7cdb19e95bf7cef3502268521cfc81235 Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Tue, 14 Jun 2016 01:33:42 +0900 Subject: Insert a missing argument "self" --- doc/docs/lexerdevelopment.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst index fd6e76b9..9109180d 100644 --- a/doc/docs/lexerdevelopment.rst +++ b/doc/docs/lexerdevelopment.rst @@ -361,7 +361,7 @@ There are a few more things you can do with states: tokens = {...} def get_tokens_unprocessed(self, text, stack=('root', 'otherstate')): - for item in RegexLexer.get_tokens_unprocessed(text, stack): + for item in RegexLexer.get_tokens_unprocessed(self, text, stack): yield item Some lexers like the `PhpLexer` use this to make the leading `` Date: Thu, 16 Jun 2016 07:07:56 +0200 Subject: Fixes #1246 --- pygments/lexers/shell.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index ae790b9e..f8d8194e 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -69,6 +69,8 @@ class BashLexer(RegexLexer): (r'#.*\n', Comment.Single), (r'\\[\w\W]', String.Escape), (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)), + (r'(\b\w+)(\s*)([+*/%-&|\^]|<<|>>)(=)', + bygroups(Name.Variable, Text, Operator, Operator)), (r'[\[\]{}()=]', Operator), (r'<<<', Operator), # here-string (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String), -- cgit v1.2.1 From 3e9eb40c753b808e4f23f27764bfe49965e04df5 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 16 Jun 2016 09:07:08 +0200 Subject: Only += is an operator --- pygments/lexers/shell.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index f8d8194e..a5933afb 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -68,9 +68,7 @@ class BashLexer(RegexLexer): (r'\A#!.+\n', Comment.Hashbang), (r'#.*\n', Comment.Single), (r'\\[\w\W]', String.Escape), - (r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)), - (r'(\b\w+)(\s*)([+*/%-&|\^]|<<|>>)(=)', - bygroups(Name.Variable, Text, Operator, Operator)), + (r'(\b\w+)(\s*)(\+?=)', bygroups(Name.Variable, Text, Operator)), (r'[\[\]{}()=]', Operator), (r'<<<', Operator), # here-string (r'<<-?\s*(\'?)\\?(\w+)[\w\W]+?\2', String), -- cgit v1.2.1 From cbdb7c8bc35ed8d2d6599722246c6929217ed26e Mon Sep 17 00:00:00 2001 From: rrt Date: Mon, 20 Jun 2016 23:10:46 +0100 Subject: Fall back to od -x, and use hexdump lexer --- external/autopygmentize | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/external/autopygmentize b/external/autopygmentize index 9b030fac..26fe365c 100755 --- a/external/autopygmentize +++ b/external/autopygmentize @@ -74,14 +74,22 @@ case $(file $file_common_opts --mime-type "$file") in application/x-xz) concat=xzcat;; esac -# Find a reader: either a suitable lexer, or hd for binary files -reader="" +# Find a suitable lexer, preceded by a hex dump for binary files +prereader="" encoding=$(file --mime-encoding --uncompress $file_common_opts "$file") if [[ $encoding == "binary" ]]; then - reader=hd -elif [[ -n "$lexer" ]]; then + prereader="od -x" # POSIX fallback + if [[ -n $(which hd) ]]; then + prereader="hd" # preferred + fi + lexer=hexdump +fi +if [[ -n "$lexer" ]]; then reader="pygmentize -O inencoding=$encoding $PYGMENTIZE_OPTS $options -l $lexer" fi +if [[ -n "$prereader" ]]; then + reader="$prereader | $reader" +fi # If we found a reader, run it if [[ -n "$reader" ]]; then -- cgit v1.2.1 From 4564fe0139b6fb5cac8f0c6faf5c977c6accf739 Mon Sep 17 00:00:00 2001 From: rrt Date: Mon, 20 Jun 2016 23:13:33 +0100 Subject: Fix a couple of errors in the previous commit --- external/autopygmentize | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/external/autopygmentize b/external/autopygmentize index 26fe365c..d2d05970 100755 --- a/external/autopygmentize +++ b/external/autopygmentize @@ -83,17 +83,19 @@ if [[ $encoding == "binary" ]]; then prereader="hd" # preferred fi lexer=hexdump + encoding=latin1 fi if [[ -n "$lexer" ]]; then reader="pygmentize -O inencoding=$encoding $PYGMENTIZE_OPTS $options -l $lexer" fi -if [[ -n "$prereader" ]]; then - reader="$prereader | $reader" -fi # If we found a reader, run it if [[ -n "$reader" ]]; then - exec $concat "$file" | $reader + if [[ -n "$prereader" ]]; then + exec $concat "$file" | $prereader | $reader + else + exec $concat "$file" | $reader + fi fi exit 1 -- cgit v1.2.1 From 346229c9c36d45086db283f1c5612355e55d6efe Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Tue, 12 Jul 2016 20:00:52 +0100 Subject: Add '1e6' as float token for Python3Lexer The parent class (PythonLexer) has this, but it's missing from the subclass. 1e6 is a valid float token in Python 3 as well. --- pygments/lexers/python.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygments/lexers/python.py b/pygments/lexers/python.py index 35635ed1..d41dd08d 100644 --- a/pygments/lexers/python.py +++ b/pygments/lexers/python.py @@ -362,6 +362,7 @@ class Python3Lexer(RegexLexer): ] tokens['numbers'] = [ (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), + (r'\d+[eE][+-]?[0-9]+j?', Number.Float), (r'0[oO][0-7]+', Number.Oct), (r'0[bB][01]+', Number.Bin), (r'0[xX][a-fA-F0-9]+', Number.Hex), -- cgit v1.2.1 From e425a9405f1fc05937a06df6b25815156c5a592d Mon Sep 17 00:00:00 2001 From: David Corbett Date: Wed, 13 Jul 2016 21:24:07 -0400 Subject: Fix Batch variables after IF --- pygments/lexers/shell.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index a5933afb..e9a7595b 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -478,13 +478,16 @@ class BatchLexer(RegexLexer): using(this, state='variable')), '#pop'), (r'(exist%s)(%s%s)' % (_token_terminator, _space, _stoken), bygroups(Keyword, using(this, state='text')), '#pop'), - (r'(%s%s?)(==)(%s?%s)' % (_stoken, _space, _space, _stoken), - bygroups(using(this, state='text'), Operator, - using(this, state='text')), '#pop'), (r'(%s%s)(%s)(%s%s)' % (_number, _space, _opword, _space, _number), bygroups(using(this, state='arithmetic'), Operator.Word, using(this, state='arithmetic')), '#pop'), - (r'(%s%s)(%s)(%s%s)' % (_stoken, _space, _opword, _space, _stoken), + (_stoken, using(this, state='text'), ('#pop', 'if2')), + ], + 'if2': [ + (r'(%s?)(==)(%s?%s)' % (_space, _space, _stoken), + bygroups(using(this, state='text'), Operator, + using(this, state='text')), '#pop'), + (r'(%s)(%s)(%s%s)' % (_space, _opword, _space, _stoken), bygroups(using(this, state='text'), Operator.Word, using(this, state='text')), '#pop') ], -- cgit v1.2.1 From 8e0c2365df9bbb51c3f17b935eb864b1b8e23c86 Mon Sep 17 00:00:00 2001 From: Ren? Schwaiger Date: Mon, 18 Jul 2016 15:44:15 +0200 Subject: Add ?Rainbow Dash? syntax highlighting style This bright and colorful style is a port of my TextMate theme [1]. It is based on ?Mac Classic? by Chris Thomas. [1]: http://sanssecours.github.io/Rainbow-Dash.tmbundle --- AUTHORS | 1 + pygments/styles/__init__.py | 3 +- pygments/styles/rainbow_dash.py | 89 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 pygments/styles/rainbow_dash.py diff --git a/AUTHORS b/AUTHORS index 66377ead..efbad179 100644 --- a/AUTHORS +++ b/AUTHORS @@ -173,6 +173,7 @@ Other contributors, listed alphabetically, are: * Matteo Sasso -- Common Lisp lexer * Joe Schafer -- Ada lexer * Ken Schutte -- Matlab lexers +* René Schwaiger -- Rainbow Dash style * Sebastian Schweizer -- Whiley lexer * Tassilo Schweyer -- Io, MOOCode lexers * Ted Shaw -- AutoIt lexer diff --git a/pygments/styles/__init__.py b/pygments/styles/__init__.py index 4efd196e..d1e7bb50 100644 --- a/pygments/styles/__init__.py +++ b/pygments/styles/__init__.py @@ -41,7 +41,8 @@ STYLE_MAP = { 'lovelace': 'lovelace::LovelaceStyle', 'algol': 'algol::AlgolStyle', 'algol_nu': 'algol_nu::Algol_NuStyle', - 'arduino': 'arduino::ArduinoStyle' + 'arduino': 'arduino::ArduinoStyle', + 'rainbow_dash': 'rainbow_dash::RainbowDashStyle' } diff --git a/pygments/styles/rainbow_dash.py b/pygments/styles/rainbow_dash.py new file mode 100644 index 00000000..ac8d56d2 --- /dev/null +++ b/pygments/styles/rainbow_dash.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +""" + pygments.styles.rainbow_dash + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + A bright and colorful syntax highlighting `theme`. + + .. _theme: http://sanssecours.github.io/Rainbow-Dash.tmbundle + + :copyright: Copyright 2006-2016 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from pygments.style import Style +from pygments.token import (Comment, Error, Generic, Name, Number, Operator, + String, Text, Whitespace, Keyword) + +BLUE_LIGHT = '#0080ff' +BLUE = '#2c5dcd' +GREEN = '#00cc66' +GREEN_LIGHT = '#ccffcc' +GREEN_NEON = '#00cc00' +GREY = '#aaaaaa' +GREY_LIGHT = '#cbcbcb' +GREY_DARK = '#4d4d4d' +PURPLE = '#5918bb' +RED = '#cc0000' +RED_DARK = '#c5060b' +RED_LIGHT = '#ffcccc' +RED_BRIGHT = '#ff0000' +WHITE = '#ffffff' +TURQUOISE = '#318495' +ORANGE = '#ff8000' + + +class RainbowDashStyle(Style): + """ + A bright and colorful syntax highlighting theme. + """ + + background_color = WHITE + + styles = { + Comment: 'italic {}'.format(BLUE_LIGHT), + Comment.Preproc: 'noitalic', + Comment.Special: 'bold', + + Error: 'bg:{} {}'.format(RED, WHITE), + + Generic.Deleted: 'border:{} bg:{}'.format(RED_DARK, RED_LIGHT), + Generic.Emph: 'italic', + Generic.Error: RED_BRIGHT, + Generic.Heading: 'bold {}'.format(BLUE), + Generic.Inserted: 'border:{} bg:{}'.format(GREEN_NEON, GREEN_LIGHT), + Generic.Output: GREY, + Generic.Prompt: 'bold {}'.format(BLUE), + Generic.Strong: 'bold', + Generic.Subheading: 'bold {}'.format(BLUE), + Generic.Traceback: RED_DARK, + + Keyword: 'bold {}'.format(BLUE), + Keyword.Pseudo: 'nobold', + Keyword.Type: PURPLE, + + Name.Attribute: 'italic {}'.format(BLUE), + Name.Builtin: 'bold {}'.format(PURPLE), + Name.Class: 'underline', + Name.Constant: TURQUOISE, + Name.Decorator: 'bold {}'.format(ORANGE), + Name.Entity: 'bold {}'.format(PURPLE), + Name.Exception: 'bold {}'.format(PURPLE), + Name.Function: 'bold {}'.format(ORANGE), + Name.Tag: 'bold {}'.format(BLUE), + + Number: 'bold {}'.format(PURPLE), + + Operator: BLUE, + Operator.Word: 'bold', + + String: GREEN, + String.Doc: 'italic', + String.Escape: 'bold {}'.format(RED_DARK), + String.Other: TURQUOISE, + String.Symbol: 'bold {}'.format(RED_DARK), + + Text: GREY_DARK, + + Whitespace: GREY_LIGHT + } -- cgit v1.2.1 From c933a129986292e3ab8ec0a9ec97f114c03db366 Mon Sep 17 00:00:00 2001 From: Gor Nishanov Date: Tue, 26 Jul 2016 15:34:51 -0700 Subject: LLVMLexer: added 58 keywords and 'token' type to match LLVM 4.0 --- pygments/lexers/asm.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pygments/lexers/asm.py b/pygments/lexers/asm.py index 2bb3eac9..f2d87c6f 100644 --- a/pygments/lexers/asm.py +++ b/pygments/lexers/asm.py @@ -412,12 +412,24 @@ class LlvmLexer(RegexLexer): 'unwind', 'unreachable', 'indirectbr', 'landingpad', 'resume', 'malloc', 'alloca', 'free', 'load', 'store', 'getelementptr', 'extractelement', 'insertelement', 'shufflevector', 'getresult', - 'extractvalue', 'insertvalue', 'atomicrmw', 'cmpxchg', 'fence'), + 'extractvalue', 'insertvalue', 'atomicrmw', 'cmpxchg', 'fence', + 'allocsize', 'amdgpu_cs', 'amdgpu_gs', 'amdgpu_kernel', 'amdgpu_ps', + 'amdgpu_vs', 'any', 'anyregcc', 'argmemonly', 'avr_intrcc', + 'avr_signalcc', 'caller', 'catchpad', 'catchret', 'catchswitch', + 'cleanuppad', 'cleanupret', 'comdat', 'convergent', 'cxx_fast_tlscc', + 'deplibs', 'dereferenceable', 'dereferenceable_or_null', 'distinct', + 'exactmatch', 'externally_initialized', 'from', 'ghccc', 'hhvm_ccc', + 'hhvmcc', 'ifunc', 'inaccessiblemem_or_argmemonly', 'inaccessiblememonly', + 'inalloca', 'jumptable', 'largest', 'local_unnamed_addr', 'minsize', + 'musttail', 'noduplicates', 'none', 'nonnull', 'norecurse', 'notail', + 'preserve_allcc', 'preserve_mostcc', 'prologue', 'safestack', 'samesize', + 'source_filename', 'swiftcc', 'swifterror', 'swiftself', 'webkit_jscc', + 'within', 'writeonly', 'x86_intrcc', 'x86_vectorcallcc'), suffix=r'\b'), Keyword), # Types (words(('void', 'half', 'float', 'double', 'x86_fp80', 'fp128', - 'ppc_fp128', 'label', 'metadata')), Keyword.Type), + 'ppc_fp128', 'label', 'metadata', 'token')), Keyword.Type), # Integer types (r'i[1-9]\d*', Keyword) -- cgit v1.2.1 From 4b40a6445cbb7aae8a04321f1a8b394e9fcff363 Mon Sep 17 00:00:00 2001 From: daisuzu Date: Sat, 30 Jul 2016 21:17:05 +0900 Subject: Add map support to ProtoBufLexer --- pygments/lexers/dsls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygments/lexers/dsls.py b/pygments/lexers/dsls.py index 312d5f5e..4044b7c5 100644 --- a/pygments/lexers/dsls.py +++ b/pygments/lexers/dsls.py @@ -36,7 +36,7 @@ class ProtoBufLexer(RegexLexer): tokens = { 'root': [ (r'[ \t]+', Text), - (r'[,;{}\[\]()]', Punctuation), + (r'[,;{}\[\]()<>]', Punctuation), (r'/(\\\n)?/(\n|(.|\n)*?[^\\]\n)', Comment.Single), (r'/(\\\n)?\*(.|\n)*?\*(\\\n)?/', Comment.Multiline), (words(( -- cgit v1.2.1 From 045732d3501cdb693537145393bc25411a4eeb84 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Thu, 18 Aug 2016 16:17:33 -0700 Subject: Match .dpr files as Delphi --- pygments/lexers/_mapping.py | 2 +- pygments/lexers/pascal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index a6097b1c..00a4a919 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -121,7 +121,7 @@ LEXERS = { 'DarcsPatchLexer': ('pygments.lexers.diff', 'Darcs Patch', ('dpatch',), ('*.dpatch', '*.darcspatch'), ()), 'DartLexer': ('pygments.lexers.javascript', 'Dart', ('dart',), ('*.dart',), ('text/x-dart',)), 'DebianControlLexer': ('pygments.lexers.installers', 'Debian Control file', ('control', 'debcontrol'), ('control',), ()), - 'DelphiLexer': ('pygments.lexers.pascal', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas',), ('text/x-pascal',)), + 'DelphiLexer': ('pygments.lexers.pascal', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas', '*.dpr'), ('text/x-pascal',)), 'DgLexer': ('pygments.lexers.python', 'dg', ('dg',), ('*.dg',), ('text/x-dg',)), 'DiffLexer': ('pygments.lexers.diff', 'Diff', ('diff', 'udiff'), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')), 'DjangoLexer': ('pygments.lexers.templates', 'Django/Jinja', ('django', 'jinja'), (), ('application/x-django-templating', 'application/x-jinja')), diff --git a/pygments/lexers/pascal.py b/pygments/lexers/pascal.py index ce991a77..a3965a45 100644 --- a/pygments/lexers/pascal.py +++ b/pygments/lexers/pascal.py @@ -44,7 +44,7 @@ class DelphiLexer(Lexer): """ name = 'Delphi' aliases = ['delphi', 'pas', 'pascal', 'objectpascal'] - filenames = ['*.pas'] + filenames = ['*.pas', '*.dpr'] mimetypes = ['text/x-pascal'] TURBO_PASCAL_KEYWORDS = ( -- cgit v1.2.1 From 8e05673f8986144087bc7a280308929327e88641 Mon Sep 17 00:00:00 2001 From: Kaleb Elwert Date: Thu, 18 Aug 2016 16:21:09 -0700 Subject: Highlight zsh files using the BashLexer --- pygments/lexers/_mapping.py | 2 +- pygments/lexers/shell.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index a6097b1c..49a87c7b 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -51,7 +51,7 @@ LEXERS = { 'BCLexer': ('pygments.lexers.algebra', 'BC', ('bc',), ('*.bc',), ()), 'BSTLexer': ('pygments.lexers.bibtex', 'BST', ('bst', 'bst-pybtex'), ('*.bst',), ()), 'BaseMakefileLexer': ('pygments.lexers.make', 'Base Makefile', ('basemake',), (), ()), - 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript')), + 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'zsh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '*.zsh', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript')), 'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console', 'shell-session'), ('*.sh-session', '*.shell-session'), ('application/x-shell-session', 'application/x-sh-session')), 'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('bat', 'batch', 'dosbatch', 'winbatch'), ('*.bat', '*.cmd'), ('application/x-dos-batch',)), 'BefungeLexer': ('pygments.lexers.esoteric', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)), diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py index a5933afb..752e71a7 100644 --- a/pygments/lexers/shell.py +++ b/pygments/lexers/shell.py @@ -27,16 +27,17 @@ line_re = re.compile('.*?\n') class BashLexer(RegexLexer): """ - Lexer for (ba|k|)sh shell scripts. + Lexer for (ba|k|z|)sh shell scripts. .. versionadded:: 0.6 """ name = 'Bash' - aliases = ['bash', 'sh', 'ksh', 'shell'] + aliases = ['bash', 'sh', 'ksh', 'zsh', 'shell'] filenames = ['*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', - '*.exheres-0', '*.exlib', - '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'PKGBUILD'] + '*.exheres-0', '*.exlib', '*.zsh', + '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', + 'PKGBUILD'] mimetypes = ['application/x-sh', 'application/x-shellscript'] tokens = { -- cgit v1.2.1 -- cgit v1.2.1 From e9a803bbaf3fee217f64f7bf32a18278770dfe36 Mon Sep 17 00:00:00 2001 From: Josiah Schwab Date: Thu, 18 Aug 2016 18:44:44 -0700 Subject: Add exponent-letter D to Fortran lexer In the Fortran specification, the exponent-letter within a signed-real-literal-constant is E or D. Therefore, both 3.14159e0 and 3.14159d0 should be classified as a Number.Float. The current behavior is >>> print(highlight("3.14159d0", FortranLexer(), HtmlFormatter()))
3.14159d0
where the only the significand is classified as a Number.Float while the exponent-letter and exponent are classified as Name.Variable. After this patch the behavior is >>> print(highlight("3.14159d0", FortranLexer(), HtmlFormatter()))
3.14159d0
which is the expected behavior. --- pygments/lexers/fortran.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygments/lexers/fortran.py b/pygments/lexers/fortran.py index e2f95b11..6cc8f2c8 100644 --- a/pygments/lexers/fortran.py +++ b/pygments/lexers/fortran.py @@ -156,8 +156,8 @@ class FortranLexer(RegexLexer): 'nums': [ (r'\d+(?![.e])(_[a-z]\w+)?', Number.Integer), - (r'[+-]?\d*\.\d+(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float), - (r'[+-]?\d+\.\d*(e[-+]?\d+)?(_[a-z]\w+)?', Number.Float), + (r'[+-]?\d*\.\d+([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float), + (r'[+-]?\d+\.\d*([ed][-+]?\d+)?(_[a-z]\w+)?', Number.Float), ], } -- cgit v1.2.1 From b0b0ff2a0c3dc3990c409501d1ca38596d031939 Mon Sep 17 00:00:00 2001 From: devoncarew1 Date: Sun, 28 Aug 2016 03:30:42 +0000 Subject: javascript.py edited online with Bitbucket --- pygments/lexers/javascript.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index a23ba184..6bd97dbe 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -366,9 +366,10 @@ class DartLexer(RegexLexer): (r'\b(assert|break|case|catch|continue|default|do|else|finally|for|' r'if|in|is|new|return|super|switch|this|throw|try|while)\b', Keyword), - (r'\b(abstract|const|extends|factory|final|get|implements|' - r'native|operator|set|static|typedef|var)\b', Keyword.Declaration), - (r'\b(bool|double|Dynamic|int|num|Object|String|void)\b', Keyword.Type), + (r'\b(abstract|async|await|const|extends|factory|final|get|' + r'implements|native|operator|set|static|sync|typedef|var|with|' + r'yield)\b', Keyword.Declaration), + (r'\b(bool|double|dynamic|int|num|Object|String|void)\b', Keyword.Type), (r'\b(false|null|true)\b', Keyword.Constant), (r'[~!%^&*+=|?:<>/-]|as\b', Operator), (r'[a-zA-Z_$]\w*:', Name.Label), -- cgit v1.2.1 From fc88fabbffb273f0109a52a74d600d2ae567fe4b Mon Sep 17 00:00:00 2001 From: Ash Searle Date: Thu, 1 Sep 2016 20:39:24 +0100 Subject: Fix for floats with leading/trailing ., reclassify es2015 arrow notation as punctuation and add new es2015 regex flags (sticky and unicode) --- pygments/lexers/javascript.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py index a23ba184..4b47b15a 100644 --- a/pygments/lexers/javascript.py +++ b/pygments/lexers/javascript.py @@ -53,7 +53,7 @@ class JavascriptLexer(RegexLexer): 'slashstartsregex': [ include('commentsandwhitespace'), (r'/(\\.|[^[/\\\n]|\[(\\.|[^\]\\\n])*])+/' - r'([gim]+\b|\B)', String.Regex, '#pop'), + r'([gimuy]+\b|\B)', String.Regex, '#pop'), (r'(?=/)', Text, ('#pop', 'badregex')), default('#pop') ], @@ -64,9 +64,14 @@ class JavascriptLexer(RegexLexer): (r'\A#! ?/.*?\n', Comment.Hashbang), # recognized by node.js (r'^(?=\s|/|