diff options
author | peter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2007-01-20 21:06:54 +0000 |
---|---|---|
committer | peter <peter@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2007-01-20 21:06:54 +0000 |
commit | 901ad17c7ab0a57b5d4e6d22ca2006d8b28c5098 (patch) | |
tree | 8eaa3278de0c8ad0bb450666eda49212ecdc6d28 /compiler/scanner.pas | |
parent | c12288e1163a98f00983703cf59be9f074755807 (diff) | |
download | fpc-901ad17c7ab0a57b5d4e6d22ca2006d8b28c5098.tar.gz |
* minor fixes from mantis 8132
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@6091 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/scanner.pas')
-rw-r--r-- | compiler/scanner.pas | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/compiler/scanner.pas b/compiler/scanner.pas index f349958a40..0cbcf425c7 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -2374,6 +2374,12 @@ In case not, the value returned can be arbitrary. gettokenpos; readchar; {Remove the $} hs:=readid; + { handle empty directive } + if hs='' then + begin + Message1(scan_w_illegal_switch,'$'); + exit; + end; {$ifdef PREPROCWRITE} if parapreprocess then begin @@ -2395,9 +2401,7 @@ In case not, the value returned can be arbitrary. aktcommentstyle:=comment_none; exit; end; - if hs='' then - Message1(scan_w_illegal_switch,'$'+hs); - { Check for compiler switches } + { Check for compiler switches } while (length(hs)=1) and (c in ['-','+']) do begin HandleSwitch(hs[1],c); @@ -2405,7 +2409,7 @@ In case not, the value returned can be arbitrary. if c=',' then begin current_scanner.readchar; {Remove , } - { read next switch, support $v+,$+} + { read next switch, support $v+,$+} hs:=current_scanner.readid; if (hs='') then begin @@ -2423,7 +2427,7 @@ In case not, the value returned can be arbitrary. else hs:=''; end; - { directives may follow switches after a , } + { directives may follow switches after a , } if hs<>'' then begin if not (m_mac in current_settings.modeswitches) then @@ -2446,7 +2450,7 @@ In case not, the value returned can be arbitrary. current_scanner.ignoredirectives.Add(hs,nil); Message1(scan_w_illegal_directive,'$'+hs); end; - { conditionals already read the comment } + { conditionals already read the comment } if (current_scanner.comment_level>0) then current_scanner.readcomment; { we've read the whole comment } @@ -2643,7 +2647,7 @@ In case not, the value returned can be arbitrary. if (i<255) then begin inc(i); - readcomment[i]:='*'; + readcomment[i]:=c; end; end; end |