[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [Git][tpo/applications/tor-browser][base-browser-102.7.0esr-12.5-1] Bug 1799982 - Remove uses of inline flags from XPIDL regexps. r=xpcom-reviewers, kmag a=RyanVM



Title: GitLab

Pier Angelo Vendrame pushed to branch base-browser-102.7.0esr-12.5-1 at The Tor Project / Applications / Tor Browser

Commits:

  • a0bbe6fa
    by Andrew McCreight at 2023-01-30T18:02:35+01:00
    Bug 1799982 - Remove uses of inline flags from XPIDL regexps. r=xpcom-reviewers,kmag a=RyanVM
    
    Apparently the use of these is being turned into an error in Python 3.11.
    Fortunately, our uses appears to be rather trivial.
    
    For t_multilinecomment and t_LCDATA, I dropped the (?s) flag and just
    replaced the one use of . with (\n|.). (?s) means DOTALL, which means
    that dot includes any character, including a newline. Otherwise it means
    dot includes any character except a newline.
    
    I took the new t_singlelinecomment from IPDL's parser.py, so I assume
    it is reasonable enough. t_multilinecomment is also now the same as
    in IPDL.
    
    Differential Revision: https://phabricator.services.mozilla.com/D161738

1 changed file:

Changes:

  • xpcom/idl-parser/xpidl/xpidl.py
    ... ... @@ -1572,13 +1572,13 @@ class IDLParser(object):
    1572 1572
         t_ignore = " \t"
    
    1573 1573
     
    
    1574 1574
         def t_multilinecomment(self, t):
    
    1575
    -        r"/\*(?s).*?\*/"
    
    1575
    +        r"/\*(\n|.)*?\*/"
    
    1576 1576
             t.lexer.lineno += t.value.count("\n")
    
    1577 1577
             if t.value.startswith("/**"):
    
    1578 1578
                 self._doccomments.append(t.value)
    
    1579 1579
     
    
    1580 1580
         def t_singlelinecomment(self, t):
    
    1581
    -        r"(?m)//.*?$"
    
    1581
    +        r"//[^\n]*"
    
    1582 1582
     
    
    1583 1583
         def t_IID(self, t):
    
    1584 1584
             return t
    
    ... ... @@ -1591,7 +1591,7 @@ class IDLParser(object):
    1591 1591
             return t
    
    1592 1592
     
    
    1593 1593
         def t_LCDATA(self, t):
    
    1594
    -        r"(?s)%\{[ ]*C\+\+[ ]*\n(?P<cdata>.*?\n?)%\}[ ]*(C\+\+)?"
    
    1594
    +        r"%\{[ ]*C\+\+[ ]*\n(?P<cdata>(\n|.)*?\n?)%\}[ ]*(C\+\+)?"
    
    1595 1595
             t.type = "CDATA"
    
    1596 1596
             t.value = t.lexer.lexmatch.group("cdata")
    
    1597 1597
             t.lexer.lineno += t.value.count("\n")
    

  • _______________________________________________
    tor-commits mailing list
    tor-commits@xxxxxxxxxxxxxxxxxxxx
    https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits