Welcome the channel on the development of Cro, a set of libraries for building reactive distributed systems, lovingly crafted to take advantage of all the Raku Programming Language has to offer (cro.services). This channel is being logged for historical purposes. Set by lizmat on 24 May 2021. |
|||
13:10
jgaz joined
18:20
Xliff joined
|
|||
Xliff | \o | 18:20 | |
I have reworked the Cro::Webapp::Boostrap::Template layout.crotmp file to add a parameter to :bs-container like so: | |||
<:macro bs-container(:$fluid, :$id)> | 18:21 | ||
However when I go to call the macro: | |||
<|bs-container :$id = 'container-id'> | |||
I get the following error: | |||
Template parse failed: malformed macro application tag at line 2 near 'bs-container :$id = 'container-id'> | |||
Looks like token arglist does not parse named parameters. | 18:23 | ||
japhb | Or parameters with defaults? | 18:27 | |
Xliff | Nope. Just named parameters. | 18:59 | |
Cro::WebApp::Template::Parser.subparse("(1, 2, 3 )", rule => "arglist") # Works | |||
use Cro::WebApp::Template::Parser; Cro::WebApp::Template::Parser.subparse("( :\$id = 4 )", rule => "arglist").gist.say # Does not | 19:00 | ||
use Cro::WebApp::Template::Parser; Cro::WebApp::Template::Parser.subparse("( :\$id = 'domain-container' )", rule => "arglist") # Does not | |||
use Cro::WebApp::Template::Parser; Cro::WebApp::Template::Parser.subparse("( :\$id = 'domain-container' )", rule => "arglist") # Works | |||
use Cro::WebApp::Template::Parser; Cro::WebApp::Template::Parser.subparse("( :\$id = 4, :\$dummy=2 )", rule => "arglist").gist.say # Does not | 19:01 | ||
use Cro::WebApp::Template::Parser; Cro::WebApp::Template::Parser.subparse("(1, :\$id = 4, :\$dummy=2 )", rule => "arglist").gist.say # Does not | |||
use Cro::WebApp::Template::Parser; Cro::WebApp::Template::Parser.subparse("( 4, :\$id = 2 )", rule => "arglist").gist.say # Does not | 19:02 | ||
japhb | What was the difference with the case that worked (the third one you sent that had a 'use' at the front)? I can's see the difference between that line and the line above it | 20:14 | |
21:05
jgaz left
|
|||
jnthn | The syntax is <|bs-container(:id('container-id'))> like in a normal Raku argument list | 21:23 | |
Xliff | jnthn: Oh. OK, then. | 23:45 | |
Thanks. |