From 889203c8ba6366a7fdf863b57b79d3170e1bf890 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 10 Jul 1998 10:48:40 +0000 Subject: [PATCH] * fixed realnumber scanning * [] after asmblock was not uppercased anymore --- compiler/pstatmnt.pas | 8 ++++- compiler/scanner.pas | 77 +++++++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/compiler/pstatmnt.pas b/compiler/pstatmnt.pas index cbaecaf5d8..3b44c9ef08 100644 --- a/compiler/pstatmnt.pas +++ b/compiler/pstatmnt.pas @@ -631,6 +631,8 @@ unit pstatmnt; asmstat^.object_preserved:=true; if token<>RECKKLAMMER then repeat + { uppercase, because it's a CSTRING } + uppervar(pattern); {$ifdef i386} if pattern='EAX' then usedinproc:=usedinproc or ($80 shr byte(R_EAX)) @@ -1166,7 +1168,11 @@ unit pstatmnt; end. { $Log$ - Revision 1.23 1998-06-25 08:48:18 florian + Revision 1.24 1998-07-10 10:48:42 peter + * fixed realnumber scanning + * [] after asmblock was not uppercased anymore + + Revision 1.23 1998/06/25 08:48:18 florian * first version of rtti support Revision 1.22 1998/06/24 14:48:36 peter diff --git a/compiler/scanner.pas b/compiler/scanner.pas index 223ac0f9b4..c6dc38b706 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -1240,43 +1240,48 @@ implementation end; '0'..'9' : begin readnumber; - case c of - '.' : begin - readchar; - if not(c in ['0'..'9']) then - begin - s_point:=true; - yylex:=INTCONST; - goto exit_label; - end; - pattern:=pattern+'.'; - while c in ['0'..'9'] do - begin - pattern:=pattern+c; - readchar; - end; - yylex:=REALNUMBER; + if (c in ['.','e','E']) then + begin + { first check for a . } + if c='.' then + begin + readchar; + if not(c in ['0'..'9']) then + begin + s_point:=true; + yylex:=INTCONST; goto exit_label; end; - 'e','E' : begin - pattern:=pattern+'E'; + pattern:=pattern+'.'; + while c in ['0'..'9'] do + begin + pattern:=pattern+c; readchar; - if c in ['-','+'] then - begin - pattern:=pattern+c; - readchar; - end; - if not(c in ['0'..'9']) then - Message(scan_f_illegal_char); - while c in ['0'..'9'] do - begin - pattern:=pattern+c; - readchar; - end; - yylex:=REALNUMBER; - goto exit_label; end; - end; + end; + { E can also follow after a point is scanned } + + if c in ['e','E'] then + + begin + pattern:=pattern+'E'; + readchar; + if c in ['-','+'] then + begin + pattern:=pattern+c; + readchar; + end; + if not(c in ['0'..'9']) then + Message(scan_f_illegal_char); + while c in ['0'..'9'] do + begin + pattern:=pattern+c; + readchar; + end; + end; + yylex:=REALNUMBER; + goto exit_label; + end; yylex:=INTCONST; goto exit_label; end; @@ -1753,9 +1758,9 @@ exit_label: end. { $Log$ - Revision 1.32 1998-07-10 00:00:02 peter - * fixed ttypesym bug finally - * fileinfo in the symtable and better using for unused vars + Revision 1.33 1998-07-10 10:48:40 peter + * fixed realnumber scanning + * [] after asmblock was not uppercased anymore Revision 1.31 1998/07/07 17:39:38 peter * fixed $I with following eof