From 098b014e2975ff973b56b5443f4213853ef0ca8f Mon Sep 17 00:00:00 2001 From: Tom Browder Date: Tue, 30 Jan 2018 17:12:39 -0600 Subject: [PATCH] convert tabs to 4 spaces, correct obvious code misalignment --- src/HLL/Compiler.nqp | 16 +-- src/HLL/Grammar.nqp | 16 +-- src/NQP/Actions.nqp | 22 +-- src/NQP/Grammar.nqp | 158 ++++++++++----------- src/NQP/World.nqp | 14 +- src/QAST/Children.nqp | 2 +- src/QAST/Node.nqp | 24 ++-- src/QAST/WVal.nqp | 2 +- src/QRegex/Cursor.nqp | 8 +- src/QRegex/P5Regex/Actions.nqp | 2 +- src/QRegex/P6Regex/Actions.nqp | 18 +-- src/QRegex/P6Regex/Grammar.nqp | 11 +- src/vm/jvm/QAST/Compiler.nqp | 28 ++-- src/vm/moar/HLL/Backend.nqp | 8 +- src/vm/moar/QAST/QASTRegexCompilerMAST.nqp | 32 ++--- 15 files changed, 181 insertions(+), 180 deletions(-) diff --git a/src/HLL/Compiler.nqp b/src/HLL/Compiler.nqp index f326c8b5bb..694fee4418 100644 --- a/src/HLL/Compiler.nqp +++ b/src/HLL/Compiler.nqp @@ -519,15 +519,15 @@ class HLL::Compiler does HLL::Backend::Default { if %adverbs { $s := $!backend.apply_transcodings($s, %adverbs); } - my $outer_ctx := %adverbs; + my $outer_ctx := %adverbs; if nqp::existskey(%adverbs, 'grammar') { - $grammar := %adverbs; - $actions := %adverbs; - } - else { - $grammar := self.parsegrammar; - $actions := self.parseactions; - } + $grammar := %adverbs; + $actions := %adverbs; + } + else { + $grammar := self.parsegrammar; + $actions := self.parseactions; + } $grammar.HOW.trace-on($grammar) if %adverbs; my $match := $grammar.parse($s, p => 0, actions => $actions); $grammar.HOW.trace-off($grammar) if %adverbs; diff --git a/src/HLL/Grammar.nqp b/src/HLL/Grammar.nqp index 5c8932263c..c22f989a07 100644 --- a/src/HLL/Grammar.nqp +++ b/src/HLL/Grammar.nqp @@ -530,10 +530,10 @@ An operator precedence parser. self.EXPR_reduce(@termstack, @opstack) while @opstack; - self.'!clone_match_at'( - nqp::pop(@termstack), - nqp::getattr_i($here, NQPMatch, '$!pos') - ).'!reduce'('EXPR') + self.'!clone_match_at'( + nqp::pop(@termstack), + nqp::getattr_i($here, NQPMatch, '$!pos') + ).'!reduce'('EXPR') } method EXPR_reduce(@termstack, @opstack) { @@ -603,7 +603,7 @@ An operator precedence parser. nqp::bindkey(%markhash, $markname, $cur); } else { - nqp::bindattr_i($cur, NQPMatch, '$!from', self.from); + nqp::bindattr_i($cur, NQPMatch, '$!from', self.from); $cur."!cursor_pos"(self.pos()); $cur } @@ -621,7 +621,7 @@ An operator precedence parser. } method LANG($lang, $regex, *@args) { - self.check_PACKAGE_oopsies('LANG1'); + self.check_PACKAGE_oopsies('LANG1'); my $actions := self.slang_actions($lang); my $lang_cursor := self.slang_grammar($lang).'!cursor_init'(self.orig(), :p(self.pos()), :shared(self.'!shared'())); $lang_cursor.clone_braid_from(self); @@ -629,8 +629,8 @@ An operator precedence parser. if self.HOW.traced(self) { $lang_cursor.HOW.trace-on($lang_cursor, self.HOW.trace_depth(self)); } - $lang_cursor.check_PACKAGE_oopsies('LANG2'); + $lang_cursor.check_PACKAGE_oopsies('LANG2'); my $result := $lang_cursor."$regex"(|@args); - $result.set_braid_from(self) + $result.set_braid_from(self) } } diff --git a/src/NQP/Actions.nqp b/src/NQP/Actions.nqp index c3c53ef1f2..c3d4aedb2b 100644 --- a/src/NQP/Actions.nqp +++ b/src/NQP/Actions.nqp @@ -254,7 +254,7 @@ class NQP::Actions is HLL::Actions { # See if we've exported any HOWs. if nqp::existskey($UNIT, 'EXPORTHOW') { for $UNIT.WHO { - $*LANG.set_how($_.key, $_.value); + $*LANG.set_how($_.key, $_.value); } } } @@ -392,7 +392,7 @@ class NQP::Actions is HLL::Actions { default_for('$')); } - method statement_prefix:sym($/) { + method statement_prefix:sym($/) { make $*W.run_begin_block($.ast); $/.prune(); } @@ -507,7 +507,7 @@ class NQP::Actions is HLL::Actions { elsif $ eq '!' { my $name := ~@name.pop; my $ch; - my $package := $/.package; + my $package := $/.package; if $*PKGDECL eq 'role' { $ch := QAST::Var.new( :name('$?CLASS'), :scope('typevar') ); $ch.set_compile_time_value($package); @@ -607,7 +607,7 @@ class NQP::Actions is HLL::Actions { my @ns := nqp::clone($); my $name := ~@ns.pop; my $how := $/.how($*PKGDECL); - my $package := $/.package; + my $package := $/.package; # Get the body code. my $ast; @@ -909,7 +909,7 @@ class NQP::Actions is HLL::Actions { } # Set up dispatch routine in this scope. - nqp::die("Dispatcher derivation NYI"); + nqp::die("Dispatcher derivation NYI"); } # Create a code object and attach the signature. @@ -925,7 +925,7 @@ class NQP::Actions is HLL::Actions { # as the multi may be nested in another sub. $ast.blocktype('declaration_static'); my $BLOCK := $*W.cur_lexpad(); - $BLOCK[0].push($ast); + $BLOCK[0].push($ast); } elsif $*MULTINESS eq 'proto' { # Create a candidate list holder for the dispatchees @@ -934,7 +934,7 @@ class NQP::Actions is HLL::Actions { if $*SCOPE eq 'our' { nqp::die('our-scoped protos not yet implemented') } my $code := $*W.create_code($ast, $name, 1, :$onlystar); my $BLOCK := $*W.cur_lexpad(); - $BLOCK[0].push(QAST::Op.new( + $BLOCK[0].push(QAST::Op.new( :op('bind'), QAST::Var.new( :name('&' ~ $name), :scope('lexical'), :decl('var') ), $ast @@ -956,7 +956,7 @@ class NQP::Actions is HLL::Actions { } else { my $BLOCK := $*W.cur_lexpad(); - $BLOCK[0].push(QAST::Op.new( + $BLOCK[0].push(QAST::Op.new( :op('bind'), QAST::Var.new( :name('&' ~ $name), :scope('lexical'), :decl('var') ), $ast @@ -1014,7 +1014,7 @@ class NQP::Actions is HLL::Actions { # Otherwise, build method block QAST. my $ast; my int $onlystar; - my $package := $/.package; + my $package := $/.package; if $ { $ast := only_star_block(); $onlystar := 1; @@ -1143,7 +1143,7 @@ class NQP::Actions is HLL::Actions { } method signature($/) { - my $BLOCK := $*W.cur_lexpad(); + my $BLOCK := $*W.cur_lexpad(); my $BLOCKINIT := $BLOCK[0]; if $ { my $inv := $.ast; @@ -1271,7 +1271,7 @@ class NQP::Actions is HLL::Actions { method regex_declarator($/, $key?) { my $name; - my $package := $/.package; + my $package := $/.package; if $ { $name := ~$.ast; } diff --git a/src/NQP/Grammar.nqp b/src/NQP/Grammar.nqp index 92e5678715..e5bb6fce45 100644 --- a/src/NQP/Grammar.nqp +++ b/src/NQP/Grammar.nqp @@ -1,9 +1,9 @@ grammar NQP::Grammar is HLL::Grammar { method TOP() { - # Language braid. - my $*LANG := self; - self.define_slang('MAIN', self, self.actions); - self.define_slang('Regex', NQP::Regex, NQP::RegexActions); + # Language braid. + my $*LANG := self; + self.define_slang('MAIN', self, self.actions); + self.define_slang('Regex', NQP::Regex, NQP::RegexActions); # Old language braids, going away. my %*LANG; @@ -15,8 +15,8 @@ grammar NQP::Grammar is HLL::Grammar { # Package declarator to meta-package mapping. Note that there is # one universal KnowHOW from the 6model core, and an attribute # meta-object to go with it. - self.set_how('knowhow', nqp::knowhow()); - self.set_how('knowhow-attr', nqp::knowhowattr()); + self.set_how('knowhow', nqp::knowhow()); + self.set_how('knowhow-attr', nqp::knowhowattr()); # Serialization context builder - keeps track of objects that # cross the compile-time/run-time boundary that are associated @@ -143,13 +143,13 @@ grammar NQP::Grammar is HLL::Grammar { <.outerctx> - <.set_braid_from(self)> - <.check_PACKAGE_oopsies('comp_unit')> + <.set_braid_from(self)> + <.check_PACKAGE_oopsies('comp_unit')> [ $ || <.panic: 'Confused'> ] } rule statementlist { - :my $*LANG := self; + :my $*LANG := self; '' [ | $ @@ -321,7 +321,7 @@ grammar NQP::Grammar is HLL::Grammar { } token term:sym { } - + token term:sym { } token term:sym { } token term:sym { [<.ws> ) }>]? { $*CONTROL_USED := 1 } } @@ -358,42 +358,42 @@ grammar NQP::Grammar is HLL::Grammar { :my $*OUTERPACKAGE := self.package; :my $*PKGDECL := 'module'; - <.set_braid_from(self)> - <.check_PACKAGE_oopsies('package_declarator_module')> + <.set_braid_from(self)> + <.check_PACKAGE_oopsies('package_declarator_module')> } token package_declarator:sym { :my $*OUTERPACKAGE := self.package; :my $*PKGDECL := 'knowhow'; - <.set_braid_from(self)> - <.check_PACKAGE_oopsies('package_declarator_knowhow')> + <.set_braid_from(self)> + <.check_PACKAGE_oopsies('package_declarator_knowhow')> } token package_declarator:sym { :my $*OUTERPACKAGE := self.package; :my $*PKGDECL := 'class'; - <.set_braid_from(self)> - <.check_PACKAGE_oopsies('package_declarator_class')> + <.set_braid_from(self)> + <.check_PACKAGE_oopsies('package_declarator_class')> } token package_declarator:sym { :my $*OUTERPACKAGE := self.package; :my $*PKGDECL := 'grammar'; - <.set_braid_from(self)> - <.check_PACKAGE_oopsies('package_declarator_grammar')> + <.set_braid_from(self)> + <.check_PACKAGE_oopsies('package_declarator_grammar')> } token package_declarator:sym { :my $*OUTERPACKAGE := self.package; :my $*PKGDECL := 'role'; - <.set_braid_from(self)> - <.check_PACKAGE_oopsies('package_declarator_role')> + <.set_braid_from(self)> + <.check_PACKAGE_oopsies('package_declarator_role')> } token package_declarator:sym { :my $*OUTERPACKAGE := self.package; :my $*PKGDECL := 'native'; - <.set_braid_from(self)> + <.set_braid_from(self)> } rule package_declarator:sym { :my $*OUTERPACKAGE := self.package; @@ -405,74 +405,74 @@ grammar NQP::Grammar is HLL::Grammar { rule package_def { :my $*PACKAGE; # The type object for this package. - :my $*LANG := self; + :my $*LANG := self; :my $OUTER := $*W.cur_lexpad(); - + '' [ - - <.newpad> - [ '[' ~ ']' ]? - [ 'is' 'repr(' ')' ]? - - { - # Construct meta-object for this package, adding it to the - # serialization context for this compilation unit. - my %args; - %args := ~$; - if $ { - %args := ~$[0]; - } - my $how := self.how($*PKGDECL); - my $INNER := $*W.cur_lexpad(); - my $package := $*W.pkg_create_mo($how, |%args); - $*PACKAGE := $package; - $/.set_package($package); - $/.check_PACKAGE_oopsies('package_def1'); - $*LANG := $/; - - # these need to be installed early so that they may be referenced from subs in the block - if nqp::can($how, 'parametric') && $how.parametric($how) { - $*W.install_lexical_symbol($INNER, '$?PACKAGE', $package); - $*W.install_lexical_symbol($INNER, '$?ROLE', $package); - } - else { - $*W.install_lexical_symbol($INNER, '$?PACKAGE', $package); - $*W.install_lexical_symbol($INNER, '$?CLASS', $package); - } + + <.newpad> + [ '[' ~ ']' ]? + [ 'is' 'repr(' ')' ]? + + { + # Construct meta-object for this package, adding it to the + # serialization context for this compilation unit. + my %args; + %args := ~$; + if $ { + %args := ~$[0]; + } + my $how := self.how($*PKGDECL); + my $INNER := $*W.cur_lexpad(); + my $package := $*W.pkg_create_mo($how, |%args); + $*PACKAGE := $package; + $/.set_package($package); + $/.check_PACKAGE_oopsies('package_def1'); + $*LANG := $/; + + # these need to be installed early so that they may be referenced from subs in the block + if nqp::can($how, 'parametric') && $how.parametric($how) { + $*W.install_lexical_symbol($INNER, '$?PACKAGE', $package); + $*W.install_lexical_symbol($INNER, '$?ROLE', $package); + } + else { + $*W.install_lexical_symbol($INNER, '$?PACKAGE', $package); + $*W.install_lexical_symbol($INNER, '$?CLASS', $package); + } - # Install it in the current package or current lexpad as needed. - if $*SCOPE eq 'our' || $*SCOPE eq '' { - $*W.install_package_symbol($*OUTERPACKAGE, $, $package); - if +$ == 1 { + # Install it in the current package or current lexpad as needed. + if $*SCOPE eq 'our' || $*SCOPE eq '' { + $*W.install_package_symbol($*OUTERPACKAGE, $, $package); + if +$ == 1 { + $*W.install_lexical_symbol($OUTER, ~$[0], $package); + } + } + elsif $*SCOPE eq 'my' { + if +$ != 1 { + $.panic("A my scoped package cannot have a multi-part name yet"); + } $*W.install_lexical_symbol($OUTER, ~$[0], $package); } - } - elsif $*SCOPE eq 'my' { - if +$ != 1 { - $.panic("A my scoped package cannot have a multi-part name yet"); + else { + $/.panic("$*SCOPE scoped packages are not supported"); } - $*W.install_lexical_symbol($OUTER, ~$[0], $package); } - else { - $/.panic("$*SCOPE scoped packages are not supported"); - } - } - <.check_PACKAGE_oopsies('package_def2')> - [ $=['is export'] ]? - [ $=['is nativesize(' $=[\d+] ')' ] ]? - [ $=['is unsigned'] ]? - [ 'is' ]? - [ 'does' ]* - <.check_PACKAGE_oopsies('package_def2')> - [ - || ';' <.check_PACKAGE_oopsies('package_defu')> [ $ || <.panic: 'Confused'> ] - || <.check_PACKAGE_oopsies('package_defb')> - || <.panic: 'Malformed package declaration'> - ] + <.check_PACKAGE_oopsies('package_def2')> + [ $=['is export'] ]? + [ $=['is nativesize(' $=[\d+] ')' ] ]? + [ $=['is unsigned'] ]? + [ 'is' ]? + [ 'does' ]* + <.check_PACKAGE_oopsies('package_def2')> + [ + || ';' <.check_PACKAGE_oopsies('package_defu')> [ $ || <.panic: 'Confused'> ] + || <.check_PACKAGE_oopsies('package_defb')> + || <.panic: 'Malformed package declaration'> + ] ] - <.check_PACKAGE_oopsies('package_defx')> + <.check_PACKAGE_oopsies('package_defx')> } rule role_params { diff --git a/src/NQP/World.nqp b/src/NQP/World.nqp index e0e04d6fd7..bc9a094e63 100644 --- a/src/NQP/World.nqp +++ b/src/NQP/World.nqp @@ -198,9 +198,9 @@ class NQP::World is HLL::World { # See if NQPRoutine is available to wrap this up in. my $code_type; my $have_code_type := 0; - my $cursor := $*LANG; - my $package := $cursor.package; - $cursor.check_PACKAGE_oopsies('create_code'); + my $cursor := $*LANG; + my $package := $cursor.package; + $cursor.check_PACKAGE_oopsies('create_code'); try { $code_type := self.find_sym([$code_type_name]); $have_code_type := $package.HOW.name($package) ne $code_type_name; @@ -611,10 +611,10 @@ class NQP::World is HLL::World { if nqp::existskey($result.WHO, ~$_) { $result := ($result.WHO){$_}; } - # XXX temp shim to avoid bootstrapping funniness - elsif nqp::elems(@name) == 1 && @name[0] eq 'NQPCursor' { - return self.find_sym(['NQPMatch']); - } + # XXX temp shim to avoid bootstrapping funniness + elsif nqp::elems(@name) == 1 && @name[0] eq 'NQPCursor' { + return self.find_sym(['NQPMatch']); + } else { nqp::die("Could not locate compile-time value for symbol " ~ join('::', @name)); diff --git a/src/QAST/Children.nqp b/src/QAST/Children.nqp index a38092f0be..9a50647ba0 100644 --- a/src/QAST/Children.nqp +++ b/src/QAST/Children.nqp @@ -29,7 +29,7 @@ role QAST::Children { nqp::push(@onto, "\n"); } } - CATCH { nqp::push(@onto, "Oops!!! {nqp::getmessage($_)}\n") } + CATCH { nqp::push(@onto, "Oops!!! {nqp::getmessage($_)}\n") } } method extra_children() { diff --git a/src/QAST/Node.nqp b/src/QAST/Node.nqp index 4cd0adc514..55ab80353c 100644 --- a/src/QAST/Node.nqp +++ b/src/QAST/Node.nqp @@ -62,16 +62,16 @@ class QAST::Node { method okifnil($value = NO_VALUE) { $value =:= NO_VALUE ?? self.isflag(0x20) !! $value ?? self.setflag(0x20) !! self.clearflag(0x20) } method dump_flags() { - my @flags; - if $!flags { - nqp::push(@flags, 'wanted') if self.wanted; - nqp::push(@flags, 'sunk') if self.sunk; - nqp::push(@flags, 'nosink') if self.nosink; - nqp::push(@flags, 'sinkok') if self.sinkok; - nqp::push(@flags, 'final') if self.final; - nqp::push(@flags, 'okifnil') if self.okifnil; - } - @flags ?? '<' ~ nqp::join(' ',@flags) ~ '>' !! ''; + my @flags; + if $!flags { + nqp::push(@flags, 'wanted') if self.wanted; + nqp::push(@flags, 'sunk') if self.sunk; + nqp::push(@flags, 'nosink') if self.nosink; + nqp::push(@flags, 'sinkok') if self.sinkok; + nqp::push(@flags, 'final') if self.final; + nqp::push(@flags, 'okifnil') if self.okifnil; + } + @flags ?? '<' ~ nqp::join(' ',@flags) ~ '>' !! ''; } method has_compile_time_value() { @@ -139,8 +139,8 @@ class QAST::Node { if nqp::chars($extra) { nqp::push(@chunks, "($extra)"); } - nqp::push(@chunks, ' '); - nqp::push(@chunks, self.dump_annotations); + nqp::push(@chunks, ' '); + nqp::push(@chunks, self.dump_annotations); if (self.node) { nqp::push(@chunks, ' '); my $escaped_node := nqp::escape(self.node); diff --git a/src/QAST/WVal.nqp b/src/QAST/WVal.nqp index 05ad507b35..011bd9647f 100644 --- a/src/QAST/WVal.nqp +++ b/src/QAST/WVal.nqp @@ -24,7 +24,7 @@ class QAST::WVal is QAST::Node does QAST::CompileTimeValue { } method dump_extra_node_info() { - CATCH { return "?" } + CATCH { return "?" } my $v := self.compile_time_value(); my $info := $v.HOW.name($v); if self.ann('past_block') -> $qast { diff --git a/src/QRegex/Cursor.nqp b/src/QRegex/Cursor.nqp index d78350a06e..a6aba104f7 100644 --- a/src/QRegex/Cursor.nqp +++ b/src/QRegex/Cursor.nqp @@ -219,14 +219,14 @@ role NQPMatchRole is export { } method refine_slang($name,$grole,$arole = nqp::null) { # nqp::die("No braid in define_slang!") unless $!braid; - my $slangs := nqp::getattr($!braid, Braid, '$!slangs'); - my $tmp := nqp::atkey($slangs,$name); + my $slangs := nqp::getattr($!braid, Braid, '$!slangs'); + my $tmp := nqp::atkey($slangs,$name); nqp::bindkey($slangs,$name, $tmp.HOW.mixin($tmp, $grole)); unless nqp::isnull($arole) { $name := $name ~ '-actions'; - $tmp := nqp::atkey($slangs,$name); - nqp::bindkey($slangs,$name, $tmp.HOW.mixin($tmp, $arole)); + $tmp := nqp::atkey($slangs,$name); + nqp::bindkey($slangs,$name, $tmp.HOW.mixin($tmp, $arole)); } self } diff --git a/src/QRegex/P5Regex/Actions.nqp b/src/QRegex/P5Regex/Actions.nqp index 45edcc3604..2419b23c20 100644 --- a/src/QRegex/P5Regex/Actions.nqp +++ b/src/QRegex/P5Regex/Actions.nqp @@ -364,7 +364,7 @@ class QRegex::P5Regex::Actions is HLL::Actions { } method qbuildsub($qast, $block = QAST::Block.new(), :$anon, :$addself, *%rest) { - my $*LANG := $qast.node; + my $*LANG := $qast.node; my $code_obj := nqp::existskey(%rest, 'code_obj') ?? %rest !! self.create_regex_code_object($block); diff --git a/src/QRegex/P6Regex/Actions.nqp b/src/QRegex/P6Regex/Actions.nqp index 70bc97f3ca..127e289d85 100644 --- a/src/QRegex/P6Regex/Actions.nqp +++ b/src/QRegex/P6Regex/Actions.nqp @@ -580,7 +580,7 @@ class QRegex::P6Regex::Actions is HLL::Actions { else { $loc := nqp::index(%*RX, ':'); my $angleloc := nqp::index(%*RX, '<', $loc); - $angleloc := nqp::index(%*RX, '«', $loc) if $angleloc < 0; + $angleloc := nqp::index(%*RX, '«', $loc) if $angleloc < 0; $rxname := nqp::substr(%*RX, $loc + 1, $angleloc - $loc - 1) unless $loc < 0; } if $loc >= 0 { @@ -631,17 +631,17 @@ class QRegex::P6Regex::Actions is HLL::Actions { my int $i := 1; my int $n := nqp::elems($clist); while $i < $n { - unless ~$clist[$i] { - my $curse := $clist[$i]; - $curse."!clear_highwater"(); - $curse.panic('Missing + or - between character class elements') - } + unless ~$clist[$i] { + my $curse := $clist[$i]; + $curse."!clear_highwater"(); + $curse.panic('Missing + or - between character class elements') + } my $ast := $clist[$i].ast; if $ast.negate || $ast.rxtype eq 'cclass' && ~$ast.node le 'Z' { $ast.subtype('zerowidth'); $qast := QAST::Regex.new( :rxtype, :node($/), :subtype, :negate(1), - QAST::Regex.new( :rxtype, :subtype, $ast ), - $qast ); + QAST::Regex.new( :rxtype, :subtype, $ast ), + $qast ); } else { $qast := QAST::Regex.new( $qast, $ast, :rxtype, :node($/)); @@ -812,7 +812,7 @@ class QRegex::P6Regex::Actions is HLL::Actions { } method qbuildsub($qast, $block = QAST::Block.new(), :$anon, :$addself, *%rest) { - my $*LANG := $qast.node; + my $*LANG := $qast.node; my $code_obj := nqp::existskey(%rest, 'code_obj') ?? %rest !! self.create_regex_code_object($block); diff --git a/src/QRegex/P6Regex/Grammar.nqp b/src/QRegex/P6Regex/Grammar.nqp index b936f42c75..2f017f282c 100644 --- a/src/QRegex/P6Regex/Grammar.nqp +++ b/src/QRegex/P6Regex/Grammar.nqp @@ -247,9 +247,10 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar { proto token quantifier { <...> } token quantifier:sym<%> { - ('%''%'?) { - $/.panic("Missing quantifier on the left argument of " ~ $/[0]); - } + ('%''%'?) + { + $/.panic("Missing quantifier on the left argument of " ~ $/[0]); + } } token quantifier:sym<*> { } token quantifier:sym<+> { } @@ -315,7 +316,7 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar { ## we cheat here, really should be regex_infix:sym<~> token metachar:sym<~> { - :my $*HAS_GOAL := 1; + :my $*HAS_GOAL := 1; <.ws> <.ws> @@ -462,7 +463,7 @@ grammar QRegex::P6Regex::Grammar is HLL::Grammar { } token mod_internal { - ':' + ':' [ | $=('!')**1 » | $=(\d+)**1 » diff --git a/src/vm/jvm/QAST/Compiler.nqp b/src/vm/jvm/QAST/Compiler.nqp index 957ea51845..794e241c72 100644 --- a/src/vm/jvm/QAST/Compiler.nqp +++ b/src/vm/jvm/QAST/Compiler.nqp @@ -4828,7 +4828,7 @@ class QAST::CompilerJAST { result($il, $RT_OBJ) } - multi method as_jast(QAST::WVal $node, :$want) { + multi method as_jast(QAST::WVal $node, :$want) { my $val := $node.value; my $sc := nqp::getobjsc($val); my $handle := nqp::scgethandle($sc); @@ -5638,17 +5638,17 @@ class QAST::CompilerJAST { my $il := JAST::InstructionList.new(); my $donelabel; - $il.append(JAST::Instruction.new( :op('lload'), %*REG )); - $il.append(JAST::Instruction.new( :op('lload'), %*REG )); - $il.append($LCMP); + $il.append(JAST::Instruction.new( :op('lload'), %*REG )); + $il.append(JAST::Instruction.new( :op('lload'), %*REG )); + $il.append($LCMP); if $node.subtype eq 'zerowidth' && $node.negate { - my $prefix := self.unique('enumcharlist'); - $donelabel := JAST::Label.new( :name($prefix ~ '_done') ); - $il.append(JAST::Instruction.new( :op('ifge'), $donelabel )); - } - else { - $il.append(JAST::Instruction.new( :op('ifge'), %*REG )); - } + my $prefix := self.unique('enumcharlist'); + $donelabel := JAST::Label.new( :name($prefix ~ '_done') ); + $il.append(JAST::Instruction.new( :op('ifge'), $donelabel )); + } + else { + $il.append(JAST::Instruction.new( :op('ifge'), %*REG )); + } $il.append(JAST::Instruction.new( :op('lload'), %*REG )); $il.append($IVAL_ZERO); @@ -5671,7 +5671,7 @@ class QAST::CompilerJAST { $il.append($LADD); $il.append(JAST::Instruction.new( :op('lstore'), %*REG )); } - $il.append($donelabel) if $donelabel; + $il.append($donelabel) if $donelabel; $il; } @@ -6186,7 +6186,7 @@ class QAST::CompilerJAST { $il.append(JAST::PushSVal.new( :value('$!from') )); $il.append($ALOAD_1); $il.append(JAST::Instruction.new( :op('invokestatic'), $TYPE_OPS, - "getattr_i", 'Long', $TYPE_SMO, $TYPE_SMO, $TYPE_STR, $TYPE_TC )); + "getattr_i", 'Long', $TYPE_SMO, $TYPE_SMO, $TYPE_STR, $TYPE_TC )); $il.append($IVAL_MINUSONE); $il.append($LCMP); $il.append(JAST::Instruction.new( :op('ifne'), $donelabel )); @@ -6222,7 +6222,7 @@ class QAST::CompilerJAST { $il.append(JAST::Instruction.new( :op('lload'), %*REG )); $il.append($ALOAD_1); $il.append(JAST::Instruction.new( :op('invokestatic'), $TYPE_OPS, - "bindattr_i", 'Long', $TYPE_SMO, $TYPE_SMO, $TYPE_STR, 'Long', $TYPE_TC )); + "bindattr_i", 'Long', $TYPE_SMO, $TYPE_SMO, $TYPE_STR, 'Long', $TYPE_TC )); $il.append($POP2); $il.append($scanlabel); diff --git a/src/vm/moar/HLL/Backend.nqp b/src/vm/moar/HLL/Backend.nqp index 04835d2997..bead9c34f9 100644 --- a/src/vm/moar/HLL/Backend.nqp +++ b/src/vm/moar/HLL/Backend.nqp @@ -197,10 +197,10 @@ class HLL::Backend::MoarVM { } # Usually only a small number of keys are seen, - # so a bubble sort would be fine. However, the - # number can get much larger (e.g., when profiling - # a build of the Rakudo settings), so use a heapsort - # instead. + # so a bubble sort would be fine. However, the + # number can get much larger (e.g., when profiling + # a build of the Rakudo settings), so use a heapsort + # instead. sub sorted_keys($hash) { my @keys; for $hash { diff --git a/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp b/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp index 561cf62e0d..3c1cd0dbe4 100644 --- a/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp +++ b/src/vm/moar/QAST/QASTRegexCompilerMAST.nqp @@ -531,18 +531,18 @@ class QAST::MASTRegexCompiler { method enumcharlist($node) { my @ins; my $op := $node.negate ?? 'indexnat' !! 'indexat'; - my $i0 := $!regalloc.fresh_i(); - my $donelabel := label(); - # The indexat and indexnat opcodes assume <+[]>/<-[]> semantics, and don't return true at EOS, - # so we compensate here by checking for EOS explicitly in the negative case, and succeeding. - # (If instead we fix indexnat, we'd have to put the EOS check on the non-zerowidth branches, - # but that makes the compiler loop for some reason, hence this approach.) - if $node.subtype eq 'zerowidth' && $node.negate { - merge_ins(@ins, [ - op('ge_i', $i0, %!reg, %!reg), - op('if_i', $i0, $donelabel), - ]); - } + my $i0 := $!regalloc.fresh_i(); + my $donelabel := label(); + # The indexat and indexnat opcodes assume <+[]>/<-[]> semantics, and don't return true at EOS, + # so we compensate here by checking for EOS explicitly in the negative case, and succeeding. + # (If instead we fix indexnat, we'd have to put the EOS check on the non-zerowidth branches, + # but that makes the compiler loop for some reason, hence this approach.) + if $node.subtype eq 'zerowidth' && $node.negate { + merge_ins(@ins, [ + op('ge_i', $i0, %!reg, %!reg), + op('if_i', $i0, $donelabel), + ]); + } if $node.subtype eq 'ignoremark' || $node.subtype eq 'ignorecase+ignoremark' { my $s0 := $!regalloc.fresh_s(); my $i1 := $!regalloc.fresh_i(); @@ -558,9 +558,9 @@ class QAST::MASTRegexCompiler { else { nqp::push(@ins, op($op, %!reg, %!reg, sval($node[0]), %!reg)); } - nqp::push(@ins, op('inc_i', %!reg)) - unless $node.subtype eq 'zerowidth'; - nqp::push(@ins, $donelabel) if $donelabel; + nqp::push(@ins, op('inc_i', %!reg)) + unless $node.subtype eq 'zerowidth'; + nqp::push(@ins, $donelabel) if $donelabel; @ins } @@ -1081,7 +1081,7 @@ class QAST::MASTRegexCompiler { $Arg::obj # $MVM_reg_obj := 8; ]; - method children($node) { + method children($node) { my @masts := nqp::list(); my @results := nqp::list(); my @result_kinds := nqp::list();