Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Eliminate leftover quoting code; unused since Q.

  • Loading branch information...
commit 4925c91d7bdc94c473e72b60cc7fb2752cf1e662 1 parent 203f97e
Jonathan Worthington jnthn authored

Showing 2 changed files with 0 additions and 125 deletions. Show diff stats Hide diff stats

  1. +0 98 src/Perl6/Actions.pm
  2. +0 27 src/Perl6/Grammar.pm
98 src/Perl6/Actions.pm
@@ -4893,104 +4893,6 @@ class Perl6::Actions is HLL::Actions does STDActions {
4893 4893 QAST::Op.new( :op('list'), |@*UNQUOTE_ASTS ));
4894 4894 }
4895 4895
4896   - method quote_escape:sym<$>($/) {
4897   - make steal_back_spaces($/, $<EXPR>.ast);
4898   - }
4899   -
4900   - method quote_escape:sym<array>($/) {
4901   - make steal_back_spaces($/, $<EXPR>.ast);
4902   - }
4903   -
4904   - method quote_escape:sym<%>($/) {
4905   - make steal_back_spaces($/, $<EXPR>.ast);
4906   - }
4907   -
4908   - method quote_escape:sym<&>($/) {
4909   - make steal_back_spaces($/, $<EXPR>.ast);
4910   - }
4911   -
4912   - # Unfortunately, the operator precedence parser (probably correctly)
4913   - # steals spaces after a postfixish. Thus "$a $b" would get messed up.
4914   - # Here we take them back again. Hacky, better solutions welcome.
4915   - sub steal_back_spaces($/, $expr) {
4916   - my $pos := nqp::chars($/) - 1;
4917   - while nqp::iscclass(32, $/, $pos) {
4918   - $pos--;
4919   - }
4920   - my $nab_back := nqp::substr($/, $pos + 1);
4921   - if $nab_back {
4922   - QAST::Op.new( :op('call'), :name('&infix:<~>'), $expr, $*W.add_string_constant(~$nab_back) )
4923   - }
4924   - else {
4925   - $expr
4926   - }
4927   - }
4928   -
4929   - method quote_escape:sym<{ }>($/) {
4930   - make QAST::Op.new(
4931   - :op('callmethod'), :name('Stringy'),
4932   - QAST::Op.new(
4933   - :op('call'),
4934   - QAST::Op.new( :op('p6capturelex'), $<block>.ast ),
4935   - :node($/)));
4936   - }
4937   -
4938   - # overrides versions from HLL::Actions to use Perl 6 Str type
4939   - # and use &infix:<,> to build the parcel
4940   - method quote_EXPR($/) {
4941   - if %*QUOTEMOD<ww> {
4942   - make quote_words($/<quote_delimited>);
4943   - }
4944   - else {
4945   - my $past := $<quote_delimited>.ast;
4946   - if %*QUOTEMOD<w> {
4947   - my @words := HLL::Grammar::split_words($/,
4948   - compile_time_value_str($past, ":w list", $/));
4949   - if +@words != 1 {
4950   - $past := QAST::Op.new( :op('call'), :name('&infix:<,>'), :node($/) );
4951   - for @words { $past.push($*W.add_string_constant(~$_)); }
4952   - $past := QAST::Stmts.new($past);
4953   - }
4954   - else {
4955   - $past := $*W.add_string_constant(~@words[0]);
4956   - }
4957   - }
4958   - make $past;
4959   - }
4960   - }
4961   -
4962   - method quote_delimited($/) {
4963   - my @parts;
4964   - my str $lastlit := '';
4965   - for $<quote_atom> {
4966   - my $ast := $_.ast;
4967   - if !($ast ~~ QAST::Node) {
4968   - $lastlit := $lastlit ~ $ast;
4969   - }
4970   - elsif $ast.isa(QAST::SVal) {
4971   - $lastlit := $lastlit ~ $ast.value;
4972   - }
4973   - else {
4974   - if $lastlit gt '' {
4975   - @parts.push($*W.add_string_constant($lastlit));
4976   - }
4977   - @parts.push(QAST::Op.new( :op('callmethod'), :name('Stringy'), $ast ));
4978   - $lastlit := '';
4979   - }
4980   - }
4981   - if $lastlit gt '' || !@parts {
4982   - @parts.push($*W.add_string_constant($lastlit));
4983   - }
4984   - my $past := @parts ?? @parts.shift !! $*W.add_string_constant('');
4985   - while @parts {
4986   - $past := QAST::Op.new(
4987   - :op('call'), :name('&infix:<~>'),
4988   - $past, @parts.shift
4989   - );
4990   - }
4991   - make $past;
4992   - }
4993   -
4994 4896 # Adds code to do the signature binding.
4995 4897 sub add_signature_binding_code($block, $sig_obj, @params) {
4996 4898 # Set arity.
27 src/Perl6/Grammar.pm
@@ -2585,33 +2585,6 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
2585 2585 <block>
2586 2586 }
2587 2587
2588   - token quote_escape:sym<$> {
2589   - <?[$]>
2590   - :my $*QSIGIL := '$';
2591   - <?quotemod_check('s')>
2592   - [ <EXPR('y=')> || <.panic: "Non-variable \$ must be backslashed"> ]
2593   - }
2594   -
2595   - token quote_escape:sym<array> {
2596   - <?[@]>
2597   - :my $*QSIGIL := '@';
2598   - <?quotemod_check('a')> <EXPR('y=')>
2599   - }
2600   -
2601   - token quote_escape:sym<%> {
2602   - <?[%]>
2603   - :my $*QSIGIL := '%';
2604   - <?quotemod_check('h')> <EXPR('y=')>
2605   - }
2606   -
2607   - token quote_escape:sym<&> {
2608   - <?[&]>
2609   - :my $*QSIGIL := '&';
2610   - <?quotemod_check('f')> <EXPR('y=')>
2611   - }
2612   -
2613   - token quote_escape:sym<{ }> { <?[{]> <?quotemod_check('c')> <block> }
2614   -
2615 2588 token circumfix:sym<( )> { :dba('parenthesized expression') '(' ~ ')' <semilist> }
2616 2589 token circumfix:sym<[ ]> { :dba('array composer') '[' ~ ']' <semilist> }
2617 2590 token circumfix:sym<ang> {

0 comments on commit 4925c91

Please sign in to comment.
Something went wrong with that request. Please try again.