02:24 frost joined 03:29 Guest35 left 04:22 frost left 06:26 kueppo joined 06:32 kueppo left 06:51 Manifest joined, sivoais_ joined 06:56 Manifest0 left, TempIRCLogger left 07:01 TempIRCLogger joined 07:06 dakkar joined 07:21 frost joined
lizmat m: dd "foobar".substr(*-1) # Nemokosch 07:23
camelia "r"
lizmat m: dd "foobar".substr(*-2) # the last 2 chars 07:24
camelia "ar"
07:26 frost left 07:31 frost joined 07:37 Manifest left 07:48 frost95 joined 07:49 frost95 left 07:52 frost left 07:54 frost joined
Nemokosch oh okay makes sense 08:14
thankies
09:50 frost left 09:58 Kaiepi left 10:18 frost joined 10:24 razetime joined 10:26 kueppo joined 10:40 kueppo left 10:43 Kaiepi joined 10:45 kueppo joined 10:56 kueppo left 11:23 razetime left 11:26 razetime joined 12:12 jaguart joined 13:31 Guest35_ joined 14:19 frost left 15:43 dakkar left 15:49 jaguart left 16:20 razetime left 16:49 jaguart joined 19:18 jaguart left 20:44 n1to joined 21:12 discord-raku-bot left, discord-raku-bot joined 21:31 n1to left 21:32 Summer joined
Summer class HTML { 21:33
regex identifier { <[ a..z 0..9 ]> <[ a..z 0..9 - ]> * };
method AT-KEY($key) { ??? };
}
How would I use the regex within AT-KEY
MasterDuke m: my regex f { <[a b]> }; say "a" ~~ &f    # Summer 21:36
camelia 「a」
gfldex m: class C is Match { regex identifier { <[ a..z 0..9 ]> <[ a..z 0..9 - ]> * }; method m() { self.identifier } } my $foo = 'abc'; say C.new(:orig($foo)).m(); 21:43
camelia ===SORRY!=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> ]> * }; method m() { self.identifier } }⏏ my $foo = 'abc'; say C.new(:orig($foo))
expecting any of:
Summer thats lexical scoped though, right? not class scoped la `has`
gfldex m: class C is Match { regex identifier { <[ a..z 0..9 ]> <[ a..z 0..9 - ]> * }; method m() { self.identifier } }; my $foo = 'abc'; say C.new(:orig($foo)).m();
camelia 「abc」
gfldex Summer: ^^^ 21:44
Summer dunno if I can conjole that to work with what I'm aiming for, 21:48
class HTML {
method !identifier { / <[ a..z 0..9 ]> <[ a..z 0..9 - ]> * / };
method AT-KEY($key) { $key ~~ self!identifier; };
}
my \H = HTML.new( #`[sub to produce dom node goes here] );
say H<div>; #`[splits out name#id.class and calls prior sub]
I probs should have posted this fuller code beforehand
but I want a regexy method so I can use `[ <name=ident> ]? [ \# <id=ident> ]? [ \. <class=ident> ]*` 21:49
and "regexes are just methods or something" according to the docs and type graph 21:50
gfldex of grammars
Summer docs also say that they can go into classes iirc 21:52
so I wanna use violence to make this work
> Attribute '&!identifier' not available inside of a regex, since regexes are methods on the Cursor class. Consider storing the attribute in a lexical, and using that in the regex. 21:59
ok now I'm understanding "of grammars" part, also thats out-of-date error, should be Match class now, yes? 22:00
token TOP {^ [ <name=.identifier> ]? [ \# <id=.identifier> ]? [ \. <class=.identifier> ]* $}; 22:29
is there a regexy way of providing a default value for $<name> ?