Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[lib/Druid] converted all modules block-decl -> file-decl
Less indentation needed that way. It looks better with the Pod comments.
- Loading branch information
Carl Masak
committed
Jun 7, 2009
1 parent
8bc9c1e
commit 4eddde6
Showing
9 changed files
with
436 additions
and
444 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 |
|---|---|---|
| @@ -1,30 +1,28 @@ | ||
| use v6; | ||
| class Druid::Base; | ||
|
|
||
| =begin SUMMARY | ||
| C<Druid::Base> is the base class of most other Druid classes, collecting | ||
| regexes, attributes and methods which most of these other classes need. | ||
| =end SUMMARY | ||
|
|
||
| class Druid::Base { | ||
| # RAKUDO: Cannot use dashes here. [perl #64464] | ||
| regex col_letter { <[a..z]> } | ||
| regex row_number { \d+ } | ||
| regex coords { <col_letter><row_number> } | ||
| # RAKUDO: Cannot use dashes here. [perl #64464] | ||
| regex col_letter { <[a..z]> } | ||
| regex row_number { \d+ } | ||
| regex coords { <col_letter><row_number> } | ||
|
|
||
| our $.sarsen-move = /^ <coords> $/; | ||
| our $.lintel-move = /^ <coords> '-' <coords> $/; | ||
| our $.pass = /^ ['pass' | 'p'] $/; | ||
| our $.swap = /^ ['swap' | 's'] $/; | ||
| our $.resign = /^ ['resign' | 'r'] $/; | ||
| our $.sarsen-move = /^ <coords> $/; | ||
| our $.lintel-move = /^ <coords> '-' <coords> $/; | ||
| our $.pass = /^ ['pass' | 'p'] $/; | ||
| our $.swap = /^ ['swap' | 's'] $/; | ||
| our $.resign = /^ ['resign' | 'r'] $/; | ||
|
|
||
| method extract-coords(Match $m) { | ||
| # RAKUDO: Hoping these explicit int(...) conversions won't be | ||
| # necessary in the long run. | ||
| my Int $row = int($m<row_number> - 1); | ||
| my Int $column = int(ord($m<col_letter>) - ord('a')); | ||
| method extract-coords(Match $m) { | ||
| # RAKUDO: Hoping these explicit int(...) conversions won't be | ||
| # necessary in the long run. | ||
| my Int $row = int($m<row_number> - 1); | ||
| my Int $column = int(ord($m<col_letter>) - ord('a')); | ||
|
|
||
| return ($row, $column); | ||
| } | ||
| return ($row, $column); | ||
| } | ||
|
|
||
| # vim: filetype=perl6 |
Oops, something went wrong.