-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start stubbing Actions and Grammar ASTs
- Loading branch information
Showing
6 changed files
with
44 additions
and
24 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 +1,17 @@ | ||
unit role CSS::Compiler::RakuAST::Actions; | ||
|
||
use CSS::Compiler::RakuAST; | ||
|
||
use experimental :rakuast; | ||
|
||
method actions { ... } | ||
method defs { ... } | ||
|
||
method actions-package(@actions-id) { | ||
# stub | ||
my RakuAST::Name $name .= from-identifier-parts(|@actions-id); | ||
RakuAST::Class.new( | ||
:$name, | ||
:scope<unit>, | ||
); | ||
} |
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,25 +1,17 @@ | ||
unit role CSS::Compiler::RakuAST::Grammars; | ||
|
||
method actions { ... } | ||
method defs { ... } | ||
|
||
method actions-raku(@actions-id) { | ||
my %references = $.actions.rule-refs; | ||
use CSS::Compiler::RakuAST; | ||
|
||
for @.defs -> $def { | ||
use experimental :rakuast; | ||
|
||
my $synopsis = $def<synopsis>; | ||
|
||
with $def<props> -> @props { | ||
for @props -> $prop { | ||
method actions { ... } | ||
method defs { ... } | ||
|
||
say "method expr-{$prop}(\$/) \{ make \$.build.list(\$/) \}" | ||
if %references{'expr-' ~ $prop}:exists; | ||
} | ||
} | ||
else { | ||
my $rule = $def<rule>; | ||
say "method $rule\(\$/\) \{ make \$.build.rule(\$/) \}" | ||
} | ||
} | ||
method grammar-package(@grammar-id) { | ||
# stub | ||
my RakuAST::Name $name .= from-identifier-parts(|@grammar-id); | ||
RakuAST::Grammar.new( | ||
:$name, | ||
:scope<unit>, | ||
); | ||
} |
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
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
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 @@ | ||
unit class Test::CSS::Aural::Spec::Actions; |
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 @@ | ||
unit grammar Test::CSS::Aural::Spec::Grammar; |