diff options
author | paul <paul@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-08-29 08:45:23 +0000 |
---|---|---|
committer | paul <paul@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2011-08-29 08:45:23 +0000 |
commit | 001a6c6ad58bb0673dd07b869ee4ff85a9c83dc2 (patch) | |
tree | c77ebe3cd339074bda761693f723c9f77ea3cc98 | |
parent | 6565a9df3781e80a4db7b0f0f47ab8525fb6644c (diff) | |
download | fpc-paul.tar.gz |
compiler: also parse dots in package name and in units which package contains (although package support is not implemented yet in FPC it can parse packages)paul
git-svn-id: http://svn.freepascal.org/svn/fpc/branches/paul@18890 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r-- | namespaces/compiler/pmodules.pas | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/namespaces/compiler/pmodules.pas b/namespaces/compiler/pmodules.pas index 7773b2f89c..ec214208f7 100644 --- a/namespaces/compiler/pmodules.pas +++ b/namespaces/compiler/pmodules.pas @@ -1781,6 +1781,7 @@ implementation main_procinfo : tcgprocinfo;} force_init_final : boolean; uu : tused_unit; + module_name: ansistring; begin Status.IsPackage:=true; Status.IsExe:=true; @@ -1818,15 +1819,25 @@ implementation current_module.SetFileName(main_file.path^+main_file.name^,true); + { consume _PACKAGE word } consume(_ID); - current_module.setmodulename(orgpattern); + + module_name:=orgpattern; + consume(_ID); + while token=_POINT do + begin + consume(_POINT); + module_name:=module_name+'.'+orgpattern; + consume(_ID); + end; + + current_module.setmodulename(module_name); current_module.ispackage:=true; - exportlib.preparelib(orgpattern); + exportlib.preparelib(module_name); if tf_library_needs_pic in target_info.flags then include(current_settings.moduleswitches,cs_create_pic); - consume(_ID); consume(_SEMICOLON); { global switches are read, so further changes aren't allowed } @@ -1851,12 +1862,24 @@ implementation {Load the units used by the program we compile.} if (token=_ID) and (idtoken=_CONTAINS) then begin + { consume _CONTAINS word } consume(_ID); while true do begin if token=_ID then - AddUnit(pattern); - consume(_ID); + begin + module_name:=pattern; + consume(_ID); + while token=_POINT do + begin + consume(_POINT); + module_name:=module_name+'.'+orgpattern; + consume(_ID); + end; + AddUnit(module_name); + end + else + consume(_ID); if token=_COMMA then consume(_COMMA) else break; |