gem5-dev@gem5.org

The gem5 Developer List

View all threads

[XS] Change in gem5/gem5[develop]: fastmodel: only support single line literal when paring project file

YW
Yu-hsin Wang (Gerrit)
Thu, Jun 15, 2023 10:03 AM

Yu-hsin Wang has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/71018?usp=email )

Change subject: fastmodel: only support single line literal when paring
project file
......................................................................

fastmodel: only support single line literal when paring project file

In python3.11, it requires the global specifier should be the first
token of regex. However it's not possible when using ply library. In
fastmodel case, we actually don't need to support multiline string
literal. We fix this issue by just making the string literal single
line.

Ref: https://github.com/dabeaz/ply/issues/282

Change-Id: I746b628db7ad4c1d7834f1a1b2c1243cef68aa01
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71018
Tested-by: kokoro noreply+kokoro@google.com
Maintainer: Bobby Bruce bbruce@ucdavis.edu
Reviewed-by: Bobby Bruce bbruce@ucdavis.edu

M src/arch/arm/fastmodel/SConscript
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
Bobby Bruce: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass

diff --git a/src/arch/arm/fastmodel/SConscript
b/src/arch/arm/fastmodel/SConscript
index 3bc9aa5..7c6019e 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -218,10 +218,9 @@
t_ID = r'[A-Za-z_]\w*'

  def t_STRLIT(self, t):
  •    r'(?m)"([^"])*"'
    
  •    r'"([^"])*"'
        # strip off quotes
        t.value = t.value[1:-1]
    
  •    t.lexer.lineno += t.value.count('\n')
        return t
    
    t_EQUALS = r'='
    

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/71018?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I746b628db7ad4c1d7834f1a1b2c1243cef68aa01
Gerrit-Change-Number: 71018
Gerrit-PatchSet: 3
Gerrit-Owner: Yu-hsin Wang yuhsingw@google.com
Gerrit-Reviewer: Bobby Bruce bbruce@ucdavis.edu
Gerrit-Reviewer: Gabe Black gabe.black@gmail.com
Gerrit-Reviewer: Gabe Black gabeblack@google.com
Gerrit-Reviewer: Yu-hsin Wang yuhsingw@google.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com
Gerrit-CC: Earl Ou shunhsingou@google.com
Gerrit-CC: kokoro noreply+kokoro@google.com

Yu-hsin Wang has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/71018?usp=email ) Change subject: fastmodel: only support single line literal when paring project file ...................................................................... fastmodel: only support single line literal when paring project file In python3.11, it requires the global specifier should be the first token of regex. However it's not possible when using ply library. In fastmodel case, we actually don't need to support multiline string literal. We fix this issue by just making the string literal single line. Ref: https://github.com/dabeaz/ply/issues/282 Change-Id: I746b628db7ad4c1d7834f1a1b2c1243cef68aa01 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/71018 Tested-by: kokoro <noreply+kokoro@google.com> Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu> --- M src/arch/arm/fastmodel/SConscript 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/arm/fastmodel/SConscript b/src/arch/arm/fastmodel/SConscript index 3bc9aa5..7c6019e 100644 --- a/src/arch/arm/fastmodel/SConscript +++ b/src/arch/arm/fastmodel/SConscript @@ -218,10 +218,9 @@ t_ID = r'[A-Za-z_]\w*' def t_STRLIT(self, t): - r'(?m)"([^"])*"' + r'"([^"])*"' # strip off quotes t.value = t.value[1:-1] - t.lexer.lineno += t.value.count('\n') return t t_EQUALS = r'=' -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/71018?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I746b628db7ad4c1d7834f1a1b2c1243cef68aa01 Gerrit-Change-Number: 71018 Gerrit-PatchSet: 3 Gerrit-Owner: Yu-hsin Wang <yuhsingw@google.com> Gerrit-Reviewer: Bobby Bruce <bbruce@ucdavis.edu> Gerrit-Reviewer: Gabe Black <gabe.black@gmail.com> Gerrit-Reviewer: Gabe Black <gabeblack@google.com> Gerrit-Reviewer: Yu-hsin Wang <yuhsingw@google.com> Gerrit-Reviewer: kokoro <noreply+kokoro@google.com> Gerrit-CC: Earl Ou <shunhsingou@google.com> Gerrit-CC: kokoro <noreply+kokoro@google.com>