Projects
openEuler:Mainline
python-pygments
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
_service:tar_scm:python-pygments.spec
Changed
@@ -17,11 +17,14 @@ Name: python-pygments Summary: Syntax highlighting engine written in Python Version: 2.10.0 -Release: 3 +Release: 5 License: BSD-2-Clause URL: http://pygments.org/ Source0: https://pypi.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz +Patch0: 0001-fixed-typo.patch +Patch1: 0001-Fix-do-concurrent-and-go-to-keywords-in-the-Fortran-.patch + BuildArch: noarch %description @@ -78,6 +81,12 @@ %endif %changelog +* Tue Jan 17 2023 caofei <caofei@xfusion.com> - 2.10.0-5 +- Fix "do concurrent" and "go to" keywords in the Fortran + +* Fri Jan 13 2023 caofei <caofei@xfusion.com> - 2.10.0-4 +- fixed typo + * Wed May 11 2022 wulei <wulei80@h-partners.com> - 2.10.0-3 - License compliance rectification
View file
_service:tar_scm:0001-Fix-do-concurrent-and-go-to-keywords-in-the-Fortran-.patch
Added
@@ -0,0 +1,543 @@ +From a049b539113d20be25df41b65aa0c8981d835511 Mon Sep 17 00:00:00 2001 +From: ecasglez <29178639+ecasglez@users.noreply.github.com> +Date: Sat, 2 Oct 2021 13:16:49 +0200 +Subject: PATCH Fix "do concurrent" and "go to" keywords in the Fortran + lexer. (#1877) + +* Fix "do concurrent" and "go to" keywords in the Fortran lexer. + +* "Go to" statement was only highlighted if there was no space between "go" and "to". +* "Concurrent" keyword in the "Do Concurrent" statement was never highlighted because of a typo. It has been fixed. In addition, it now highlights them only if "Concurrent" is right after the "Do" keyword. +* I had to put the "do concurrent" changes before the already available list of keywords. Otherwise it won't highlight "Concurrent" because it finds first the "Do" keyword in the other list and stops searching for more keywords. + +* Fix a bug while parsing Fortran files with go to and do concurrent statements causing wrong highlighting. + +* For example, in the variable name "gotoErr", "goto" was highlighted but it shouldn't. + +* Update Fortran tests to the changes for the "go to statements" + +* Use Text.Whitespace to distinguish Fortran multiword keywords + +Co-authored-by: ecasglez <ecasglez@protonmail.com> +--- + pygments/lexers/fortran.py | 8 +- + tests/examplefiles/fortran/zmlrpc.f90.output | 168 +++++++++++++----- + .../examplefiles/fortranfixed/ahcon.f.output | 6 +- + 3 files changed, 135 insertions(+), 47 deletions(-) + +diff --git a/pygments/lexers/fortran.py b/pygments/lexers/fortran.py +index 6c6b8f8c..049a57cd 100644 +--- a/pygments/lexers/fortran.py ++++ b/pygments/lexers/fortran.py +@@ -48,11 +48,15 @@ class FortranLexer(RegexLexer): + , + 'core': + # Statements ++ ++ (r'\b(DO)(\s+)(CONCURRENT)\b', bygroups(Keyword, Text.Whitespace, Keyword)), ++ (r'\b(GO)(\s*)(TO)\b', bygroups(Keyword, Text.Whitespace, Keyword)), ++ + (words(( + 'ABSTRACT', 'ACCEPT', 'ALL', 'ALLSTOP', 'ALLOCATABLE', 'ALLOCATE', + 'ARRAY', 'ASSIGN', 'ASSOCIATE', 'ASYNCHRONOUS', 'BACKSPACE', 'BIND', + 'BLOCK', 'BLOCKDATA', 'BYTE', 'CALL', 'CASE', 'CLASS', 'CLOSE', +- 'CODIMENSION', 'COMMON', 'CONCURRRENT', 'CONTIGUOUS', 'CONTAINS', ++ 'CODIMENSION', 'COMMON', 'CONTIGUOUS', 'CONTAINS', + 'CONTINUE', 'CRITICAL', 'CYCLE', 'DATA', 'DEALLOCATE', 'DECODE', + 'DEFERRED', 'DIMENSION', 'DO', 'ELEMENTAL', 'ELSE', 'ENCODE', 'END', + 'ENDASSOCIATE', 'ENDBLOCK', 'ENDDO', 'ENDENUM', 'ENDFORALL', +@@ -60,7 +64,7 @@ class FortranLexer(RegexLexer): + 'ENDSELECT', 'ENDSUBMODULE', 'ENDSUBROUTINE', 'ENDTYPE', 'ENDWHERE', + 'ENTRY', 'ENUM', 'ENUMERATOR', 'EQUIVALENCE', 'ERROR STOP', 'EXIT', + 'EXTENDS', 'EXTERNAL', 'EXTRINSIC', 'FILE', 'FINAL', 'FORALL', 'FORMAT', +- 'FUNCTION', 'GENERIC', 'GOTO', 'IF', 'IMAGES', 'IMPLICIT', ++ 'FUNCTION', 'GENERIC', 'IF', 'IMAGES', 'IMPLICIT', + 'IMPORT', 'IMPURE', 'INCLUDE', 'INQUIRE', 'INTENT', 'INTERFACE', + 'INTRINSIC', 'IS', 'LOCK', 'MEMORY', 'MODULE', 'NAMELIST', 'NULLIFY', + 'NONE', 'NON_INTRINSIC', 'NON_OVERRIDABLE', 'NOPASS', 'ONLY', 'OPEN', +diff --git a/tests/examplefiles/fortran/zmlrpc.f90.output b/tests/examplefiles/fortran/zmlrpc.f90.output +index ff27ddb2..64daf0c0 100644 +--- a/tests/examplefiles/fortran/zmlrpc.f90.output ++++ b/tests/examplefiles/fortran/zmlrpc.f90.output +@@ -908,7 +908,9 @@ + "'Allocate'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'end ' Keyword +@@ -947,7 +949,9 @@ + "'no_ml_ in mlprc_aply?'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n\n ' Text + 'case' Keyword +@@ -1034,7 +1038,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'allocate' Keyword +@@ -1251,7 +1257,9 @@ + "'Allocate'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'end ' Keyword +@@ -1442,7 +1450,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'else\n ' Keyword +@@ -1522,7 +1532,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else' Keyword +@@ -1889,7 +1901,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else\n\n ' Keyword +@@ -1991,7 +2005,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n\n ' Text + 'case' Keyword +@@ -2409,7 +2425,9 @@ + "'Allocate'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'end ' Keyword +@@ -2537,7 +2555,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'else\n ' Keyword +@@ -2618,7 +2638,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else' Keyword +@@ -2827,7 +2849,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'enddo\n\n\n ' Keyword +@@ -2886,7 +2910,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n\n ' Text + 'do ' Keyword +@@ -3028,7 +3054,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else\n ' Keyword +@@ -3179,7 +3207,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'call ' Keyword +@@ -3237,7 +3267,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'enddo\n\n ' Keyword +@@ -3276,7 +3308,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n\n ' Text + 'case' Keyword +@@ -3429,7 +3463,9 @@ + "'Allocate'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'end ' Keyword +@@ -3523,7 +3559,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'mlprec_wrk' Name +@@ -3598,7 +3636,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'do ' Keyword +@@ -3759,7 +3799,9 @@ + "'Allocate'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'end ' Keyword +@@ -3887,7 +3929,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'else\n ' Keyword +@@ -3967,7 +4011,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else' Keyword +@@ -4197,7 +4243,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'if' Keyword +@@ -4282,7 +4330,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'endif\n\n ' Keyword +@@ -4426,7 +4476,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else\n\n ' Keyword +@@ -4549,7 +4601,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n\n\n ' Text + 'case' Keyword +@@ -4772,7 +4826,9 @@ + "'Allocate'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'end ' Keyword +@@ -4898,7 +4954,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'mlprec_wrk' Name +@@ -4973,7 +5031,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'do ' Keyword +@@ -5188,7 +5248,9 @@ + "'Allocate'" Literal.String.Single + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'end ' Keyword +@@ -5274,7 +5336,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'else\n ' Keyword +@@ -5354,7 +5418,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else' Keyword +@@ -5574,7 +5640,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'call ' Keyword +@@ -5631,7 +5699,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'if' Keyword +@@ -5716,7 +5786,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n ' Text + 'endif\n\n ' Keyword +@@ -5858,7 +5930,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'else\n ' Keyword +@@ -5995,7 +6069,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'call ' Keyword +@@ -6053,7 +6129,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'enddo\n\n ' Keyword +@@ -6096,7 +6174,9 @@ + '0' Literal.Number.Integer + ')' Punctuation + ' ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n\n ' Text + 'case ' Keyword +@@ -6142,7 +6222,9 @@ + ')' Punctuation + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'end ' Keyword +@@ -6190,7 +6272,9 @@ + ')' Punctuation + ')' Punctuation + '\n ' Text +-'goto ' Keyword ++'go' Keyword ++'to' Keyword ++' ' Text + '9999' Literal.Number.Integer + '\n\n ' Text + 'end ' Keyword +diff --git a/tests/examplefiles/fortranfixed/ahcon.f.output b/tests/examplefiles/fortranfixed/ahcon.f.output +index bb1e3839..26a015a8 100644 +--- a/tests/examplefiles/fortranfixed/ahcon.f.output ++++ b/tests/examplefiles/fortranfixed/ahcon.f.output +@@ -681,9 +681,9 @@ + '1.D0' Literal.Number.Float + ')' Punctuation + ' ' Text +-'GO' Name +-' ' Text +-'TO' Name ++'GO' Keyword ++' ' Text.Whitespace ++'TO' Keyword + ' ' Text + '100' Literal.Number.Integer + '\n' Text +-- +2.33.0 +
View file
_service:tar_scm:0001-fixed-typo.patch
Added
@@ -0,0 +1,25 @@ +From 8eb17ae0541cfaa1140f75358251450bd41c8dfb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cl=C3=A9ment=20Saccoccio?= <clem.saccoccio@protonmail.com> +Date: Thu, 13 May 2021 12:08:41 +0200 +Subject: PATCH fixed typo + +--- + pygments/lexers/grammar_notation.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pygments/lexers/grammar_notation.py b/pygments/lexers/grammar_notation.py +index 79c02e38..910201cd 100644 +--- a/pygments/lexers/grammar_notation.py ++++ b/pygments/lexers/grammar_notation.py +@@ -117,7 +117,7 @@ class AbnfLexer(RegexLexer): + (words(_core_rules, suffix=r'\b'), Keyword), + + # nonterminals (ALPHA *(ALPHA / DIGIT / "-")) +- (r'a-zA-Za-zA-Z0-9-+\b', Name.Class), ++ (r'a-zA-Za-zA-Z0-9-*\b', Name.Class), + + # operators + (r'(=/|=|/)', Operator), +-- +2.33.0 +
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/python-pygments.git</param> - <param name="revision">8fead11da95546c256c6fee13a30888940398e1e</param> + <param name="revision">master</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2