Skip to content

Instantly share code, notes, and snippets.

View tbrowder's full-sized avatar

Tom Browder tbrowder

  • Retired from: USAF and ManTech International Corporation
  • Gulf Breeze, Florida USA
  • 12:34 (UTC -05:00)
View GitHub Profile

Proposal for Rakudo NQP reorganization for Pod

This is a proposal for reorganizing some of the current Rakudo NQP code in order to ease maintenance by separating, to the extent possible, grammar and actions pod-only code handling from the rest of the code. The proposal is an interim step toward a future step of a separate slang (sublang) for pod.

The current organization of pertinent parts of the code in the Rakudo repo directory src/Perl6/ looks like this

$ ls -1
Actions.nqp
Grammar.nqp
@tbrowder
tbrowder / assertion-example.txt
Last active October 4, 2018 11:30
grammar assertions
# code fragment in rakudo's src/Perl6/Grammar.nqp
token numbered-alias { '#' }
my $*USE-HASH-MARK := 1; # default, means we're free to extract the first '#' in a pod block's data
# inside a pod block, e.g., abbreviated, paragraph, or delimited
# following the configuration, if any
{
@tbrowder
tbrowder / fails.txt
Created September 13, 2018 21:31
spectest failures
/usr/bin/perl tools/build/check-nqp-version.pl /usr/local/people/tbrowde/mydata/tbrowde-home-bzr/perl6/perl6-repo-forks/rakudo/install/bin/nqp-m
rm -f -- perl6
cp -- perl6-m perl6
chmod -- 755 perl6
/usr/bin/perl t/harness5 --fudge --moar --keep-exit-code --verbosity=1 t/spec/S32-list/seq.t
t/spec/S32-list/seq.rakudo.moar ..
1..41
ok 1 - seq => array works 1
ok 2 - We didn't flatten the RHS because it's no single argument
ok 3 - Seq stayed intact
@tbrowder
tbrowder / gram.txt
Last active September 13, 2018 11:20
Modernize grammar syntax
There are several instances of some old regex syntax in the current rakudo grammar.
From a brief answer by @timotimo, I'm assuming those instances can be changed to:
<tok>**1 [1 use; require one instance of the token?; change to =>] <tok>
<tok>**0..1 [17 uses; require none or one?; change to =>] <tok>?
@tbrowder
tbrowder / 15-numbered-alias-pod.t
Created August 31, 2018 16:23
S26 :numbered-alias'#'
```
use v6;
use Test;
plan 46;
my $o;
my $p = -1;
# These tests validate a new specification for S26's abbreviated
@tbrowder
tbrowder / scalar-ref.txt
Last active June 25, 2018 13:40
scalar ref as hash value
Given this Perl 5 script which allows a scalar reference
as a hash value:
#!/usr/bin/env perl
my $b = 0;
my %h = ( a => \$b );
my $b1 = ${$h{a}};
print "\$b1 = $b1\n"; # output: 0
$b = 1;
$b1 = ${$h{a}};
example-vim.p6:
#!/usr/bin/env perl6
say qq:to/HERE/;
Usage: $*PROGRAM-NAME go
Options (this text overhangs desired left margin):
a - something
HERE
#|(
This sub does everything including
filling the kitchen sink. It includes:
+ knives
+ forks
and all kinds of other things.
)
@tbrowder
tbrowder / my-toaster.txt
Last active March 12, 2018 19:20
my toaster
goal:
periodically test all perl6 modules on linux and windows
against latest stable rakudo
against current master branch of rakudo
the modules will be the latest version only
besides running each module's defined tests, each
will be checked for:
a valid and complete META6.json
a travis setup
@tbrowder
tbrowder / grammar.txt
Last active February 6, 2018 21:15
grammar test
# cat file: lib/Presenters.pm6
unit module Presenters;
use Grammar::Tracer;
grammar Presenters::PGrammar {
token TOP {
[
| <entry>
| <blank>
]+
}