Skip to content

Instantly share code, notes, and snippets.

View ShimmerFairy's full-sized avatar

Faye ShimmerFairy

  • The Doctor's TARDIS
View GitHub Profile
@ShimmerFairy
ShimmerFairy / bingram.pod6
Last active October 2, 2015 09:26
My thoughts on possible binary grammars in P6 (incomplete)
=config C<> :allow<R>
=begin pod
=head1 Basics
Binary grammars, henceforth referred to as "formats" (taken from e.g. "file
format"), are in my mind sketched as follows:
=item Formats work on the byte level (which for sanity's sake we'll consider
@ShimmerFairy
ShimmerFairy / egc.p6
Created September 10, 2015 13:51
The Grapheme Cluster regexes, in P6 regex form
# the EGC rule, in P6 form (UAX#29, Table 1b)
use v6;
# note that | alternatives in the Unicode syntax is really || in P6 syntax
# ("Note that given alternates (X|Y), the first match is taken.")
my token CRLF { <:GCB<CR>> <:GCB<LF>> }
my token RI-Sequence { <:GCB<Regional_Indicator>>+ }
my token Hangul-Syllable {
@ShimmerFairy
ShimmerFairy / safequant.p6
Created June 23, 2015 13:55
Hopefully safe quantifiers
# safe quantifiers
use v6;
# you need to wrap your usage of the safe- calls in a <safe-start ...> call;
# this is so the dynvar works properly
my token safe-star($rx) {
[ <!{$*GOTNULL}> ($rx) [<?{$0[*-1] ~~ ""}> {$*GOTNULL = True}]? ]*
}
@ShimmerFairy
ShimmerFairy / table.p6
Created April 27, 2015 15:58
Broken table parsing in Perl 6
=begin pod
Before para
=table
+-----+----+---+
| a | b | c |
+-----+----+---+
| foo | 52 | Y |
| bar | 17 | N |
@ShimmerFairy
ShimmerFairy / text
Last active August 29, 2015 14:20
Thoughts on list items in Pod6
Currently, to specify a list item with a sublist, you use successive =itemN
blocks, where N is the next level of list:
=item These are some of Perl 6's number types:
=item2 Int
=item2 Rat
=item2 Num
=item2 Complex
In this format, it happens to work fine. However, when you use delimited item
@ShimmerFairy
ShimmerFairy / shelloutput
Created July 7, 2014 23:24
Deprecation warning for Pod::To::HTML
Saw 1 call to deprecated code during execution.
================================================================================
%head = { ... } called at:
/home/matthew/.perl6/2014.06-61-g25c5114/lib/Pod/To/HTML.pm, line 155
Please use %head = ... instead.
--------------------------------------------------------------------------------
Please contact the author to have these calls to deprecated code adapted,
so that this message will disappear!
@ShimmerFairy
ShimmerFairy / actor_list
Created June 1, 2014 00:16
OoT actor list, not guaranteed complete
ACTOR LIST
General layout:
ACTOR # <number> '<description>'
Using object(s) <objects>
Variable fields:
Field: <description> (Bitmask: <bits> / <nybbles>)
<Pre-shifted value> (<raw number, if different>) --- <description>
When adding up field values for the variable, use the pre-shifted values, NOT
@ShimmerFairy
ShimmerFairy / makelink.p6
Last active August 29, 2015 14:00
Simple link parser, for fun
@ShimmerFairy
ShimmerFairy / arrays.p6
Created April 18, 2014 23:15
Test of capturing things in Rakudo
use v6;
my regex atom { \N }
my regex foo { (<atom>)+ }
my regex bar { (<.atom>)+ }
my regex baz { ($<atom>=(\N))+ }
my regex quux { (\N)+ }
say "TEST 1: Many positional captures of capturing subrule";
"ABC" ~~ /<foo>/;
@ShimmerFairy
ShimmerFairy / output
Created April 5, 2014 06:02
Error on p-all
$ make p-all
/usr/bin/perl5.16.3 tools/build/gen-cat.pl parrot src/core/core_prologue.pm src/core/traits.pm src/core/Positional.pm src/core/Associative.pm src/core/Callable.pm src/core/natives.pm src/core/stubs.pm src/core/control.pm src/core/Mu.pm src/core/Stringy.pm src/core/Any.pm src/core/array_slice.pm src/core/hash_slice.pm src/core/Scalar.pm src/core/Code.pm src/core/WhateverCode.pm src/core/Block.pm src/core/Attribute.pm src/core/Variable.pm src/core/Routine.pm src/core/Sub.pm src/core/Macro.pm src/core/Method.pm src/core/Submethod.pm src/core/Junction.pm src/core/Cool.pm src/core/Enumeration.pm src/core/Whatever.pm src/core/Bool.pm src/core/Numeric.pm src/core/Real.pm src/core/Int.pm src/core/Order.pm src/core/UInt64.pm src/core/Num.pm src/core/Buf.pm src/core/Str.pm src/core/Capture.pm src/core/Parcel.pm src/core/Iterable.pm src/core/Iterator.pm src/core/Nil.pm src/core/Range.pm src/core/ListIter.pm src/core/MapIter.pm src/core/GatherIter.pm src/core/List.pm src/core/LoL.pm src/core/Array.pm src/cor