View Issue Details

IDProjectCategoryView StatusLast Update
0034119FPCPackagespublic2018-08-12 19:10
ReporterAlexey Tor.Assigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.1.1Product Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0034119: RegExpr: add IsDigitChar
Description
        ANYDIGIT: begin
            if (reginput^ = #0) or (reginput^ < '0') or (reginput^ > '9')
             then EXIT;
            inc (reginput);
           end;
         NOTDIGIT: begin
            if (reginput^ = #0) or ((reginput^ >= '0') and (reginput^ <= '9'))
             then EXIT;
            inc (reginput);
           end;

      
we have 4 places where code checks '0'..'9'.
pls, add function (inline) IsDigitChar.
like we did before for IsSpaceChar/IsWordChar.

TagsNo tags attached.
Fixed in Revision39609
FPCOldBugId
FPCTarget
Attached Files

Activities

Alexey Tor.

2018-08-11 21:11

reporter   ~0109981

another place where IsDigitChar will be used
 function ParseVarName (var APtr : PRegExprChar) : PtrInt;
  // extract name of variable (digits, may be enclosed with
  // curly braces) from APtr^, uses TemplateEnd !!!
  const
   Digits = ['0' .. '9'];


here code checks "if ch in Digits".

Michael Van Canneyt

2018-08-12 11:14

administrator   ~0109990

Done, thanks for suggestion!

Alexey Tor.

2018-08-12 17:50

reporter   ~0110002

You didnt see last comment.
5th place exists where IsDigit must be used:

  function ParseVarName (var APtr : PRegExprChar) : PtrInt;
  // extract name of variable (digits, may be enclosed with
  // curly braces) from APtr^, uses TemplateEnd !!!
  const
   Digits = ['0' .. '9'];


here N checks "if ch in Digits".

Michael Van Canneyt

2018-08-12 19:10

administrator   ~0110003

Indeed, missed a comment. Fixed in 39611. Thanks !

Issue History

Date Modified Username Field Change
2018-08-11 21:02 Alexey Tor. New Issue
2018-08-11 21:11 Alexey Tor. Note Added: 0109981
2018-08-12 01:29 Michael Van Canneyt Assigned To => Michael Van Canneyt
2018-08-12 01:29 Michael Van Canneyt Status new => assigned
2018-08-12 11:14 Michael Van Canneyt Fixed in Revision => 39609
2018-08-12 11:14 Michael Van Canneyt Note Added: 0109990
2018-08-12 11:14 Michael Van Canneyt Status assigned => resolved
2018-08-12 11:14 Michael Van Canneyt Fixed in Version => 3.1.1
2018-08-12 11:14 Michael Van Canneyt Resolution open => fixed
2018-08-12 11:14 Michael Van Canneyt Target Version => 3.2.0
2018-08-12 17:50 Alexey Tor. Note Added: 0110002
2018-08-12 17:50 Alexey Tor. Status resolved => feedback
2018-08-12 17:50 Alexey Tor. Resolution fixed => reopened
2018-08-12 19:10 Michael Van Canneyt Note Added: 0110003
2018-08-12 19:10 Michael Van Canneyt Status feedback => resolved
2018-08-12 19:10 Michael Van Canneyt Resolution reopened => fixed