Skip to content
  • Sven/Sarah Barth's avatar
    Move the handling of "misstyled" floating point constants like "2." or "2.e10"... · b5827ce3
    Sven/Sarah Barth authored
    Move the handling of "misstyled" floating point constants like "2." or "2.e10" from the scanner to the parser. This way type helpers calls for integer constants can be parsed correctly in the future.
    
    Note: the error messages for incorrect "misstyled" floating point numbers (e.g. "2e10foo") have changed because of this.
    
    scanner.pas, tscannerfile.readtoken:
      instead of tokenizing "2.", "2.e10", "2.e+10" and "2.e-10" as "_REALNUMBER" tokenize them as "_INTCONST _POINT", "_INTCONST _POINT _ID", "_INTCONST _POINT _ID _PLUS _INTCONST" "_INTCONST _POINT _ID _PLUS _INTCONST"; tokenizing of normal floating constants is not changed
    
    pexpr.pas:
      factor: 
        * extract the code for creating a new constant floating point from "factor" into a new function "real_const_node_from_pattern"
        + allow the parsing of postfixoperators for integer constants if a "." is encountered
      + postfixoperators: check for a "misstyled" floating point number if an ordinal const (not an enum and not a boolean) is encountered (the code is already partially prepared for type helper support)
      
    + Added tests
    
    git-svn-id: trunk@23356 -
    b5827ce3