### ----------------------------------------------------
### -- Perl6::Parser
### -- Licenses: Artistic-2.0
### -- Authors: Jeffrey Goff <drforr@pobox.com>
### -- File: t/16-quote.t
### ----------------------------------------------------
### -- Chunk 3 of 4
             Q{correct type};
    is $node.quote, Q{qq}, Q{quote name};
    is $node.delimiter-start, Q{<}, Q{start delimiter};
    is $node.delimiter-end, Q{>}, Q{end delimiter};
    
    done-testing;
  }, Q{no ws, no adverbs};
  
  done-testing;
}, Q{qq<>};

subtest {
  # qw:q is illegal
  
  subtest {
    subtest {
      my $source = Q{qw :to <END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{qw :to<END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{qw:to <END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{qw:to<END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :to};

  subtest {
    subtest {
      my $source = Q{qw :w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{qw :w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{qw:w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{qw:w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :w};

  subtest {
    subtest {
      my $source = Q{qw :x <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{qw :x<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{qw:x <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{qw:x<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
      is $node.quote, Q{qw}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :x};

  subtest {
    my $source = Q{qw <pi>};
    my $tree = $pp.to-tree( $source );
    my $node = $tree.child.[0].child.[0];

    is $pp.to-string( $tree ), $source, Q{formatted};
    isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
    is $node.quote, Q{qw}, Q{quote name};
    is $node.delimiter-start, Q{<}, Q{start delimiter};
    is $node.delimiter-end, Q{>}, Q{end delimiter};

    done-testing;
  }, Q{ws, no adverbs};

  subtest {
    my $source = Q{qw<pi>};
    my $tree = $pp.to-tree( $source );
    my $node = $tree.child.[0].child.[0];

    is $pp.to-string( $tree ), $source, Q{formatted};
    isa-ok $node, Perl6::String::WordQuoting,
             Q{correct type};
    is $node.quote, Q{qw}, Q{quote name};
    is $node.delimiter-start, Q{<}, Q{start delimiter};
    is $node.delimiter-end, Q{>}, Q{end delimiter};

    done-testing;
  }, Q{no ws, no adverbs};

  done-testing;
}, Q{qw<>};

subtest {
  # qx:q is illegal

  subtest {
    subtest {
      my $source = Q{qx :to <END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{qx :to<END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{qx:to <END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{qx:to<END>
pi
END};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :to};

  subtest {
    subtest {
      my $source = Q{qx :w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{qx :w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{qx:w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{qx:w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :w};

  subtest {
    subtest {
      my $source = Q{qx :x <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{qx :x<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{qx:x <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{qx:x<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Shell,
             Q{correct type};
      is $node.quote, Q{qx}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :x};

  subtest {
    my $source = Q{qx <pi>};
    my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

    is $pp.to-string( $tree ), $source, Q{formatted};
    isa-ok $node, Perl6::String::Shell,
             Q{correct type};
    is $node.quote, Q{qx}, Q{quote name};
    is $node.delimiter-start, Q{<}, Q{start delimiter};
    is $node.delimiter-end, Q{>}, Q{end delimiter};

    done-testing;
  }, Q{ws, no adverbs};

  subtest {
    my $source = Q{qx<pi>};
    my $tree = $pp.to-tree( $source );
    my $node = $tree.child.[0].child.[0];

    is $pp.to-string( $tree ), $source, Q{formatted};
    isa-ok $node, Perl6::String::Shell,
             Q{correct type};
    is $node.quote, Q{qx}, Q{quote name};
    is $node.delimiter-start, Q{<}, Q{start delimiter};
    is $node.delimiter-end, Q{>}, Q{end delimiter};

    done-testing;
  }, Q{no ws, no adverbs};

  done-testing;
}, Q{qx<>};

subtest {
  subtest {
    subtest {
      my $source = Q{Q :q <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{Q :q<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{Q:q <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{Q:q<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :q};

  subtest {
    subtest {
      my $source = Q{Q :to <END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{Q :to<END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{Q:to <END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{Q:to<END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :to};

  subtest {
    subtest {
      my $source = Q{Q :w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{Q :w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{Q:w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{Q:w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :w};

  subtest {
    subtest {
      my $source = Q{Q :x <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{Q :x<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{Q:x <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{Q:x<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Literal,
             Q{correct type};
      is $node.quote, Q{Q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :x};

  subtest {
    my $source = Q{Q <pi>};
    my $tree = $pp.to-tree( $source );
    my $node = $tree.child.[0].child.[0];

    is $pp.to-string( $tree ), $source, Q{formatted};
    isa-ok $node, Perl6::String::Literal,
             Q{correct type};
    is $node.quote, Q{Q}, Q{quote name};
    is $node.delimiter-start, Q{<}, Q{start delimiter};
    is $node.delimiter-end, Q{>}, Q{end delimiter};

    done-testing;
  }, Q{ws, no adverbs};

  subtest {
    my $source = Q{Q<pi>};
    my $tree = $pp.to-tree( $source );
    my $node = $tree.child.[0].child.[0];

    is $pp.to-string( $tree ), $source, Q{formatted};
    isa-ok $node, Perl6::String::Literal,
             Q{correct type};
    is $node.quote, Q{Q}, Q{quote name};
    is $node.delimiter-start, Q{<}, Q{start delimiter};
    is $node.delimiter-end, Q{>}, Q{end delimiter};

    done-testing;
  }, Q{no ws, no adverbs};

  done-testing;
}, Q{Q<>};

subtest {
  # q:q<> is illegal

  subtest {
    subtest {
      my $source = Q{q :to <END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{q :to<END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{q:to <END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{q:to<END>
pi
END
};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{no intervening ws};

    done-testing;
  }, Q{adverb :to};

  subtest {
    subtest {
      my $source = Q{q :w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{all intervening ws};

    subtest {
      my $source = Q{q :w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{leading intervening ws};

    subtest {
      my $source = Q{q:w <pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.delimiter-end, Q{>}, Q{end delimiter};

      done-testing;
    }, Q{trailing intervening ws};

    subtest {
      my $source = Q{q:w<pi>};
      my $tree = $pp.to-tree( $source );
      my $node = $tree.child.[0].child.[0];

      is $pp.to-string( $tree ), $source, Q{formatted};
      isa-ok $node, Perl6::String::Escaping,
             Q{correct type};
      is $node.quote, Q{q}, Q{quote name};
      is $node.delimiter-start, Q{<}, Q{start delimiter};
      is $node.del