diff options
author | TUeSET <TUeSET@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2006-10-23 21:00:44 +0000 |
---|---|---|
committer | TUeSET <TUeSET@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2006-10-23 21:00:44 +0000 |
commit | 3dff3d5197f4505af758c26bb2213d670da98a07 (patch) | |
tree | 6c4a1e8f199847f93684d1f9657798d511ee4aca | |
parent | 70dae09b2d8fd504cf14471378c474a1f4cfa6a1 (diff) | |
download | fpc-3dff3d5197f4505af758c26bb2213d670da98a07.tar.gz |
* Some minor code cleanups (corrections of annotation, and adding FORMAL
directive to the list of directives instead of treating it like a
separate case).
(Jochem Berndsen)
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/tue@5013 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | compiler/pdecformal.pas | 2 | ||||
-rw-r--r-- | compiler/scandir.pas | 6 | ||||
-rw-r--r-- | compiler/scanner.pas | 17 |
3 files changed, 7 insertions, 18 deletions
diff --git a/compiler/pdecformal.pas b/compiler/pdecformal.pas index f8981de75b..db1f253fa8 100644 --- a/compiler/pdecformal.pas +++ b/compiler/pdecformal.pas @@ -85,7 +85,7 @@ implementation try repeat - { expect "def", "specvar", "pre" or "post" } + { expect "def", "specvar", "pre", "post" or "ret" } if (token<>_ID) then consume(_ID); diff --git a/compiler/scandir.pas b/compiler/scandir.pas index dba3709fa6..808da4b54c 100644 --- a/compiler/scandir.pas +++ b/compiler/scandir.pas @@ -374,6 +374,11 @@ implementation do_message(scan_f_user_defined); end; + procedure dir_formal; + begin + do_localswitch(cs_formal_annotation); + end; + procedure dir_fputype; begin current_scanner.skipspace; @@ -1177,6 +1182,7 @@ implementation AddDirective('EXTENDEDSYNTAX',directive_all, @dir_extendedsyntax); AddDirective('EXTERNALSYM',directive_all, @dir_externalsym); AddDirective('FATAL',directive_all, @dir_fatal); + AddDirective('FORMAL',directive_all, @dir_formal); AddDirective('FPUTYPE',directive_all, @dir_fputype); AddDirective('GOTO',directive_all, @dir_goto); AddDirective('HINT',directive_all, @dir_hint); diff --git a/compiler/scanner.pas b/compiler/scanner.pas index d7212768cb..ac6fbe300a 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -1422,22 +1422,6 @@ In case not, the value returned can be arbitrary. mac.is_used:=true; end; - procedure dir_formal; - (* Parse comments of the form {$FORMAL+} and {$FORMAL-} - *) - var - s : string; - begin - s:=current_scanner.readcomment; - if (s='+') then - include(aktlocalswitches,cs_formal_annotation) - else if (s='-') then - exclude(aktlocalswitches,cs_formal_annotation) - else - Message1(scan_w_illegal_switch,'$FORMAL '+s); - - end; - procedure dir_include; function findincludefile(const path,name,ext:string;var foundfile:string):boolean; @@ -3830,7 +3814,6 @@ exit_label: AddDirective('I',directive_all, @dir_include); AddDirective('DEFINE',directive_all, @dir_define); AddDirective('UNDEF',directive_all, @dir_undef); - AddDirective('FORMAL',directive_all, @dir_formal); AddConditional('IF',directive_all, @dir_if); AddConditional('IFDEF',directive_all, @dir_ifdef); |