Skip to content

Commit

Permalink
Add a horribly hacky Pod classes to the setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeusz Sośnierz committed Jul 1, 2011
1 parent cb14279 commit 103b37b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
66 changes: 66 additions & 0 deletions src/core/Pod.pm
@@ -0,0 +1,66 @@
class Pod__Block {
has @.content;

method new(*%h) {
my $new = self.CREATE;
$new.BLOCKBUILD(%h);
return $new;
}

method BLOCKBUILD(%h) {
@!content = %h<content>;
}
}

class Pod__Block__Comment is Pod__Block { }

class Pod__Block__Code is Pod__Block {
has @.allowed;

method new(*%h) {
my $new = self.CREATE;
$new.BLOCKBUILD(%h);
$new.BUILD(%h);
return $new;
}


method BUILD(%h) {
@!allowed = %h<allowed>;
}
}

class Pod__Block__Named is Pod__Block {
has $.name;

method new(*%h) {
my $new = self.CREATE;
$new.BLOCKBUILD(%h);
$new.BUILD(%h);
return $new;
}


method BUILD(%h) {
$!name = %h<name>;
}
}

class Pod__Item is Pod__Block {
# a list item. There should be no List block
# or any other Item container
has $.level;

method new(*%h) {
my $new = self.CREATE;
$new.BLOCKBUILD(%h);
$new.BUILD(%h);
return $new;
}

method BUILD(%h) {
$!level = %h<level>;
}
}

# vim: ft=perl6
1 change: 1 addition & 0 deletions tools/build/Makefile.in
Expand Up @@ -164,6 +164,7 @@ CORE_SOURCES = \
src/core/Exception.pm \
src/core/Failure.pm \
src/core/Exceptions.pm \
src/core/Pod.pm \
src/core/EXPORTHOW.pm \
src/core/operators.pm \
src/core/metaops.pm \
Expand Down

0 comments on commit 103b37b

Please sign in to comment.