Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a horribly hacky Pod classes to the setting
- Loading branch information
Tadeusz Sośnierz
committed
Jul 1, 2011
1 parent
cb14279
commit 103b37b
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters