~ubuntu-branches/ubuntu/precise/rakudo/precise

« back to all changes in this revision

Viewing changes to src/Perl6/Compiler/Module.pm

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghedini
  • Date: 2011-05-17 11:31:09 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110517113109-rmfir654u1axbpt4
Tags: 0.1~2011.04-1
* New upstream release (Closes: #601862, #585762, #577502)
* New maintainer
* Switch to 3.0 (quilt) format
* Update dependencies (Closes: #584498)
* Update debian/copyright to lastest DEP5 revision
* Do not generate/install perl6 manpage (now done by the build system)
* Enable tests
* Bump Standards-Version to 3.9.2 (no changes needed)
* Do not install extra LICENSE files and duplicated docs
* Remove debian/clean (no more needed)
* Add Vcs-* fields in debian/control
* Rewrite (short) description
* Update upstream copyright years
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class Perl6::Compiler::Module is Perl6::Compiler::Package;
 
2
 
 
3
has %!dummy;
 
4
 
 
5
# Modules don't support methods; just give back some dummy table.
 
6
method methods() {
 
7
    if $*SCOPE eq '' || $*SCOPE eq 'has' {
 
8
        pir::printerr("Useless declaration of has-scoped " ~ $*METHODTYPE ~
 
9
            " in a module; add our or my to install it in the lexpad or namespace\n");
 
10
    }
 
11
    %!dummy
 
12
}
 
13
 
 
14
# Accessor for attributes hash.
 
15
method attributes() {
 
16
    pir::die('You can not add an attribute to a module; use a class or role');
 
17
}
 
18
 
 
19
# This method drives the code generation and fixes up the block.
 
20
method finish($block) {
 
21
    if $!scope eq 'our' || $!scope eq '' {
 
22
        $block.blocktype('immediate');
 
23
        $block.namespace(Perl6::Grammar::parse_name(~$!name));
 
24
    }
 
25
    else {
 
26
        pir::die("Cannot handle scope declarator " ~ $!scope ~ " on modules yet");
 
27
    }
 
28
    return $block;
 
29
}