Browse files

Remove trailing spaces from a lot of files, to make Parrot happier.

  • Loading branch information...
1 parent 7b4f3e7 commit 0b3c754824bfc2ec0ddd604ec7c3c0dd44c25dd5 @pmichaud pmichaud committed Nov 12, 2009
View
8 Configure.pl
@@ -57,8 +57,8 @@
my %config = read_parrot_config(@parrot_config_exe);
my $parrot_errors = '';
- if (!%config) {
- $parrot_errors .= "Unable to locate parrot_config\n";
+ if (!%config) {
+ $parrot_errors .= "Unable to locate parrot_config\n";
}
elsif ($reqsvn > $config{'revision'} &&
($reqpar eq '' || version_int($reqpar) > version_int($config{'VERSION'}))) {
@@ -87,9 +87,9 @@ END
{
no warnings;
print "Cleaning up ...\n";
- if (open my $CLEAN, '-|', "$make clean") {
+ if (open my $CLEAN, '-|', "$make clean") {
my @slurp = <$CLEAN>;
- close $CLEAN;
+ close $CLEAN;
}
}
View
12 LICENSE
@@ -17,7 +17,7 @@ You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
-a different licensing arrangement.
+a different licensing arrangement.
Definitions
@@ -50,7 +50,7 @@ Definitions
"Modified Version" means the Package, if it has been changed, and
such changes were not explicitly requested by the Copyright
- Holder.
+ Holder.
"Original License" means this Artistic License as Distributed with
the Standard Version of the Package, in its current version or as
@@ -86,7 +86,7 @@ Package will still be considered the Standard Version, and as such
will be subject to the Original License.
-Distribution of Modified Versions of the Package as Source
+Distribution of Modified Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
@@ -120,7 +120,7 @@ you do at least ONE of the following:
Fees are allowed.
-Distribution of Compiled Forms of the Standard Version
+Distribution of Compiled Forms of the Standard Version
or Modified Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
@@ -138,7 +138,7 @@ the Source, provided that you comply with Section 4 with respect to
the Source of the Modified Version.
-Aggregating or Linking the Package
+Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
@@ -155,7 +155,7 @@ include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
-Items That are Not Considered Part of a Modified Version
+Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
View
8 README
@@ -36,7 +36,7 @@ Once you have a copy of NQP, build it as follows:
$ perl Configure.pl --gen-parrot
$ make
-This will create a "nqp" or "nqp.exe" executable in the
+This will create a "nqp" or "nqp.exe" executable in the
current (nqp-rx) directory. Programs can then be run from
the build directory using a command like:
@@ -46,9 +46,9 @@ The C<--gen-parrot> option above tells Configure.pl to automatically
download and build the most appropriate version of Parrot into a
local "parrot/" subdirectory, install that Parrot into the
"parrot_install/" subdirectory, and use that for building NQP.
-It's okay to use the C<--gen-parrot> option on later invocations
-of Configure.pl; the configure system will re-build Parrot only
-if a newer version is needed for whatever version of Rakudo you're
+It's okay to use the C<--gen-parrot> option on later invocations
+of Configure.pl; the configure system will re-build Parrot only
+if a newer version is needed for whatever version of Rakudo you're
working with.
You can use C<--parrot-config=/path/to/parrot_config> instead
View
2 STATUS
@@ -1,4 +1,4 @@
-2009-10-09:
+2009-10-09:
At the moment, nqp-rx is configured to build an executable called
"p6regex", which is a Perl 6 regular expression compiler for Parrot.
View
8 build/gen_bootstrap.pl
@@ -16,16 +16,16 @@ sub make_bootstrap {
open my $fh, '<', $filename or die "Unable to read $filename\n";
while (<$fh>) {
- if (m{^\.include '(src/[^']*)'}) {
+ if (m{^\.include '(src/[^']*)'}) {
print "### $_";
- make_bootstrap($1);
+ make_bootstrap($1);
}
elsif (m{^\.include '(gen/[^']*)'}) {
print "### $_";
- make_bootstrap("src/stage2/$1");
+ make_bootstrap("src/stage2/$1");
}
else { print; }
}
}
-
+
View
2 build/gen_parrot.pl
@@ -83,4 +83,4 @@ sub read_parrot_config {
}
%config;
}
-
+
View
12 src/HLL/Actions.pm
@@ -69,7 +69,7 @@ our sub isaPAST($x) {
method EXPR($/, $key?) {
unless $key { return 0; }
my $past := $/.peek_ast // $<OPER>.peek_ast;
- unless $past {
+ unless $past {
$past := PAST::Op.new( :node($/) );
if $<OPER><O><pasttype> { $past.pasttype( ~$<OPER><O><pasttype> ); }
elsif $<OPER><O><pirop> { $past.pirop( ~$<OPER><O><pirop> ); }
@@ -98,11 +98,11 @@ method termish($/) {
method term:sym<circumfix>($/) { make $<circumfix>.ast }
method integer($/) {
- make $<decint>
+ make $<decint>
?? string_to_int( $<decint>, 10)
- !! ( $<hexint>
+ !! ( $<hexint>
?? $<hexint>.ast
- !! ( $<octint>
+ !! ( $<octint>
?? $<octint>.ast
!! string_to_int( $<binint>, 2)
)
@@ -122,7 +122,7 @@ method octint($/) {
method quote_EXPR($/) {
my $past := $<quote_delimited>.ast;
if HLL::Grammar::quotemod_check($/, 'w') {
- if isaPAST($past) {
+ if isaPAST($past) {
$/.CURSOR.panic("Can't form :w list from non-constant strings (yet)");
}
else {
@@ -170,7 +170,7 @@ method quote_atom($/) {
method quote_escape:sym<backslash>($/) { make "\\"; }
method quote_escape:sym<stopper>($/) { make ~$<stopper> }
-
+
method quote_escape:sym<bs>($/) { make "\b"; }
method quote_escape:sym<nl>($/) { make "\n"; }
method quote_escape:sym<cr>($/) { make "\r"; }
View
18 src/HLL/Grammar.pm
@@ -21,8 +21,8 @@ grammar HLL::Grammar;
token infixish { <OPER=infix=infix> }
token prefixish { <OPER=prefix=prefix> <.ws> }
- token postfixish {
- | <OPER=postfix=postfix>
+ token postfixish {
+ | <OPER=postfix=postfix>
| <OPER=postcircumfix=postcircumfix>
}
@@ -72,19 +72,19 @@ grammar HLL::Grammar;
token quote_escape:sym<nl> { \\ n <?quotemod_check('b')> }
token quote_escape:sym<cr> { \\ r <?quotemod_check('b')> }
token quote_escape:sym<tab> { \\ t <?quotemod_check('b')> }
- token quote_escape:sym<hex> {
- \\ x <?quotemod_check('b')>
- [ <hexint> | '[' <hexints> ']' ]
+ token quote_escape:sym<hex> {
+ \\ x <?quotemod_check('b')>
+ [ <hexint> | '[' <hexints> ']' ]
}
- token quote_escape:sym<oct> {
- \\ o <?quotemod_check('b')>
- [ <octint> | '[' <octints> ']' ]
+ token quote_escape:sym<oct> {
+ \\ o <?quotemod_check('b')>
+ [ <octint> | '[' <octints> ']' ]
}
token quote_escape:sym<chr> { \\ c <?quotemod_check('b')> <charspec> }
token charname {
|| <integer>
- || <[a..z A..Z]> <-[ \] , # ]>*? <[a..z A..Z ) ]>
+ || <[a..z A..Z]> <-[ \] , # ]>*? <[a..z A..Z ) ]>
<?before \s* <[ \] , # ]> >
}
token charnames { [<.ws><charname><.ws>] ** ',' }
View
74 src/NQP/Actions.pm
@@ -22,8 +22,8 @@ sub block_immediate($block) {
}
sub sigiltype($sigil) {
- $sigil eq '%'
- ?? 'Hash'
+ $sigil eq '%'
+ ?? 'Hash'
!! ($sigil eq '@' ?? 'ResizablePMCArray' !! 'Undef');
}
@@ -44,18 +44,18 @@ method comp_unit($/) {
method statementlist($/) {
my $past := PAST::Stmts.new( :node($/) );
if $<statement> {
- for $<statement> {
+ for $<statement> {
my $ast := $_.ast;
if $ast.isa(PAST::Block) && !$ast.blocktype {
$ast := block_immediate($ast);
}
- $past.push( $ast );
+ $past.push( $ast );
}
}
make $past;
}
-method statement($/) {
+method statement($/) {
my $past;
if $<EXPR> { $past := $<EXPR>.ast; }
elsif $<statement_control> { $past := $<statement_control>.ast; }
@@ -121,7 +121,7 @@ method statement_control:sym<while>($/) {
method statement_control:sym<repeat>($/) {
my $pasttype := 'repeat_' ~ ~$<wu>;
my $past;
- if $<xblock> {
+ if $<xblock> {
$past := xblock_immediate( $<xblock>.ast );
$past.pasttype($pasttype);
}
@@ -182,8 +182,8 @@ method term:sym<statement_prefix>($/) { make $<statement_prefix>.ast; }
method term:sym<lambda>($/) { make $<pblock>.ast; }
method colonpair($/) {
- my $past := $<circumfix>
- ?? $<circumfix>[0].ast
+ my $past := $<circumfix>
+ ?? $<circumfix>[0].ast
!! PAST::Val.new( :value( !$<not> ) );
$past.named( ~$<identifier> );
make $past;
@@ -197,9 +197,9 @@ method variable($/) {
}
else {
$past := PAST::Var.new( :name(~$/) );
- if $<twigil>[0] eq '*' {
- $past.scope('contextual');
- $past.viviself( PAST::Op.new( 'Contextual ' ~ ~$/ ~ ' not found',
+ if $<twigil>[0] eq '*' {
+ $past.scope('contextual');
+ $past.viviself( PAST::Op.new( 'Contextual ' ~ ~$/ ~ ' not found',
:pirop('die') )
);
}
@@ -216,7 +216,7 @@ method package_declarator:sym<class>($/) {
my $past := $<package_def>.ast;
my $classinit :=
PAST::Op.new(
- PAST::Op.new(
+ PAST::Op.new(
:inline( ' %r = get_root_global ["parrot"], "P6metaclass"')
),
~$<package_def><name>,
@@ -263,16 +263,16 @@ method variable_declarator($/) {
if $*SCOPE eq 'has' {
$BLOCK.symbol($name, :scope('attribute') );
unless $BLOCK<attributes> {
- $BLOCK<attributes> :=
+ $BLOCK<attributes> :=
PAST::Op.new( :pasttype('list'), :named('attr') );
}
$BLOCK<attributes>.push( $name );
$past := PAST::Stmts.new();
}
- else {
+ else {
my $scope := $*SCOPE eq 'our' ?? 'package' !! 'lexical';
- my $decl := PAST::Var.new( :name($name), :scope($scope), :isdecl(1),
- :lvalue(1), :viviself( sigiltype($sigil) ),
+ my $decl := PAST::Var.new( :name($name), :scope($scope), :isdecl(1),
+ :lvalue(1), :viviself( sigiltype($sigil) ),
:node($/) );
$BLOCK.symbol($name, :scope($scope) );
$BLOCK[0].push($decl);
@@ -291,7 +291,7 @@ method routine_def($/) {
my $name := ~$<deflongname>[0].ast;
$past.name($name);
if $*SCOPE ne 'our' {
- @BLOCK[0][0].push(PAST::Var.new( :name($name), :isdecl(1),
+ @BLOCK[0][0].push(PAST::Var.new( :name($name), :isdecl(1),
:viviself($past), :scope('lexical') ) );
@BLOCK[0].symbol($name, :scope('lexical') );
$past := PAST::Var.new( :name($name) );
@@ -320,12 +320,12 @@ method signature($/) {
for $<parameter> { $BLOCKINIT.push($_.ast); }
}
-method parameter($/) {
+method parameter($/) {
my $quant := $<quant>;
my $past;
if $<named_param> {
$past := $<named_param>.ast;
- if $quant ne '!' {
+ if $quant ne '!' {
$past.viviself( sigiltype($<named_param><param_var><sigil>) );
}
}
@@ -339,22 +339,22 @@ method parameter($/) {
$past.viviself( sigiltype($<param_var><sigil>) );
}
}
- if $<default_value> {
- if $quant eq '*' {
+ if $<default_value> {
+ if $quant eq '*' {
$/.CURSOR.panic("Can't put default on slurpy parameter");
}
- if $quant eq '!' {
+ if $quant eq '!' {
$/.CURSOR.panic("Can't put default on required parameter");
}
- $past.viviself( $<default_value>[0]<EXPR>.ast );
+ $past.viviself( $<default_value>[0]<EXPR>.ast );
}
unless $past.viviself { @BLOCK[0].arity( +@BLOCK[0].arity + 1 ); }
- make $past;
+ make $past;
}
method param_var($/) {
my $name := ~$/;
- my $past := PAST::Var.new( :name($name), :scope('parameter'),
+ my $past := PAST::Var.new( :name($name), :scope('parameter'),
:isdecl(1), :node($/) );
@BLOCK[0].symbol($name, :scope('lexical') );
make $past;
@@ -453,12 +453,12 @@ method term:sym<identifier>($/) {
method term:sym<name>($/) {
my $ns := $<name><identifier>;
- $ns := Q:PIR {
+ $ns := Q:PIR {
$P0 = find_lex '$ns'
%r = clone $P0
};
my $name := $ns.pop;
- my $var :=
+ my $var :=
PAST::Var.new( :name(~$name), :namespace($ns), :scope('package') );
my $past := $var;
if $<args> {
@@ -509,9 +509,9 @@ method arglist($/) {
method term:sym<value>($/) { make $<value>.ast; }
-method circumfix:sym<( )>($/) {
- make $<EXPR>
- ?? $<EXPR>[0].ast
+method circumfix:sym<( )>($/) {
+ make $<EXPR>
+ ?? $<EXPR>[0].ast
!! PAST::Op.new( :pasttype('list'), :node($/) );
}
@@ -532,10 +532,10 @@ method circumfix:sym<[ ]>($/) {
method circumfix:sym<ang>($/) { make $<quote_EXPR>.ast; }
-method circumfix:sym<{ }>($/) {
+method circumfix:sym<{ }>($/) {
make +$<pblock><blockoid><statementlist><statement> > 0
?? $<pblock>.ast
- !! PAST::Op.new( :inline(' %r = new ["Hash"]'), :node($/) );
+ !! PAST::Op.new( :inline(' %r = new ["Hash"]'), :node($/) );
}
method circumfix:sym<sigil>($/) {
@@ -572,10 +572,10 @@ method postcircumfix:sym<( )>($/) {
method value($/) {
my $past := $<quote>
?? $<quote>.ast
- !! PAST::Val.new(
+ !! PAST::Val.new(
:value($<dec_number>
?? $<dec_number>.ast
- !! $<integer>.ast)
+ !! $<integer>.ast)
);
make $past;
}
@@ -593,8 +593,8 @@ method quote:sym<Q:PIR>($/) {
method quote_escape:sym<$>($/) { make $<variable>.ast; }
method quote_escape:sym<{ }>($/) {
- make PAST::Op.new(
- :pirop('set S*'), block_immediate($<block>.ast), :node($/)
+ make PAST::Op.new(
+ :pirop('set S*'), block_immediate($<block>.ast), :node($/)
);
}
@@ -633,7 +633,7 @@ class NQP::RegexActions is Regex::P6Regex::Actions {
method codeblock($/) {
my $block := $<block>.ast;
$block.blocktype('immediate');
- my $past :=
+ my $past :=
PAST::Regex.new(
PAST::Stmts.new(
PAST::Op.new(
View
88 src/NQP/Grammar.pm
@@ -17,17 +17,17 @@ token identifier { <ident> }
token name { <identifier> ** '::' }
-token deflongname {
- <identifier>
+token deflongname {
+ <identifier>
[ ':sym<' $<sym>=[<-[>]>*] '>' | ':sym«' $<sym>=[<-[»]>*] '»' ]?
}
token ENDSTMT {
[ \h* $$ <.ws> <?MARKER('endstmt')> ]?
}
-token ws {
- || <?MARKED('ws')>
+token ws {
+ || <?MARKED('ws')>
|| <!ww>
[ \s+
| '#' \N*
@@ -37,7 +37,7 @@ token ws {
}
token pod_comment {
- ^^ \h* '='
+ ^^ \h* '='
[
| 'begin' \h+ 'END' >>
[ .*? \n '=' 'end' \h+ 'END' » \N* || .* ]
@@ -46,27 +46,27 @@ token pod_comment {
|| .*? \n '=' 'end' \h+ $<identifier> » \N*
|| <.panic: '=begin without matching =end'>
]
- | 'begin' » \h*
+ | 'begin' » \h*
[ $$ || '#' || <.panic: 'Unrecognized token after =begin'> ]
- [
+ [
|| .*? \n \h* '=' 'end' » \N*
- || <.panic: '=begin without matching =end'>
+ || <.panic: '=begin without matching =end'>
]
- |
- [ <?before .*? ^^ '=cut' » >
+ |
+ [ <?before .*? ^^ '=cut' » >
<.panic: 'Obsolete pod format, please use =begin/=end instead'> ]?
[ <alpha> || \s || <.panic: 'Illegal pod directive'> ]
\N*
]
}
-
+
## Top-level rules
-token comp_unit {
+token comp_unit {
<.newpad>
- <statementlist>
- [ $ || <.panic: 'Confused'> ]
+ <statementlist>
+ [ $ || <.panic: 'Confused'> ]
}
rule statementlist {
@@ -98,7 +98,7 @@ token pblock {
<.newpad>
<signature>
<blockoid>
- | <?[{]>
+ | <?[{]>
<.newpad>
<blockoid>
| <.panic: 'Missing block'>
@@ -150,9 +150,9 @@ token statement_control:sym<while> {
token statement_control:sym<repeat> {
<sym> :s
- [
+ [
| $<wu>=[while|until]\s <xblock>
- | <pblock> $<wu>=[while|until]\s <EXPR>
+ | <pblock> $<wu>=[while|until]\s <EXPR>
]
}
@@ -162,12 +162,12 @@ token statement_control:sym<for> {
}
token statement_control:sym<return> {
- <sym> :s
+ <sym> :s
[ <EXPR> || <.panic: 'return requires an expression argument'> ]
}
token statement_control:sym<make> {
- <sym> :s
+ <sym> :s
[ <EXPR> || <.panic: 'make requires an expression argument'> ]
}
@@ -190,8 +190,8 @@ token term:sym<statement_prefix> { <statement_prefix> }
token term:sym<lambda> { <?lambda> <pblock> }
token colonpair {
- ':'
- [
+ ':'
+ [
| $<not>='!' <identifier>
| <identifier> <circumfix>?
]
@@ -211,10 +211,10 @@ proto token package_declarator { <...> }
token package_declarator:sym<module> { <sym> <package_def> }
token package_declarator:sym<class> { $<sym>=[class|grammar] <package_def> }
-rule package_def {
- <name>
- [ 'is' <parent=name> ]?
- [
+rule package_def {
+ <name>
+ [ 'is' <parent=name> ]?
+ [
|| ';' <comp_unit>
|| <?[{]> <block>
|| <.panic: 'Malformed package declaration'>
@@ -255,15 +255,15 @@ rule method_def {
token signature { [ [<.ws><parameter><.ws>] ** ',' ]? }
-token parameter {
+token parameter {
[
| $<quant>=['*'] <param_var>
| [ <param_var> | <named_param> ] $<quant>=['?'|'!'|<?>]
]
<default_value>?
}
-token param_var {
+token param_var {
<sigil> <twigil>?
[ <name=ident> | $<name>=[<[/!]>] ]
}
@@ -276,8 +276,8 @@ rule default_value { '=' <EXPR('i=')> }
rule regex_declarator {
[
- | $<proto>=[proto] [regex|token|rule]
- <deflongname>
+ | $<proto>=[proto] [regex|token|rule]
+ <deflongname>
'{' '<...>' '}'<?ENDSTMT>
| $<sym>=[regex|token|rule]
<deflongname>
@@ -290,12 +290,12 @@ rule regex_declarator {
token dotty {
'.' <identifier>
- [
+ [
| <?[(]> <args>
| ':' \s <args=arglist>
]?
}
-
+
proto token term { <...> }
@@ -318,8 +318,8 @@ token args {
}
token arglist {
- <.ws>
- [
+ <.ws>
+ [
| <EXPR('f=')>
| <?>
]
@@ -373,16 +373,16 @@ INIT {
}
-token nulltermish {
- | <OPER=term=termish>
+token nulltermish {
+ | <OPER=term=termish>
| <?>
}
token infixish { <!infixstopper> <OPER=infix=infix> }
token infixstopper { <?lambda> }
-token postcircumfix:sym<[ ]> {
- '[' <.ws> <EXPR> ']'
+token postcircumfix:sym<[ ]> {
+ '[' <.ws> <EXPR> ']'
<O('%methodop')>
}
@@ -396,8 +396,8 @@ token postcircumfix:sym<ang> {
<O('%methodop')>
}
-token postcircumfix:sym<( )> {
- '(' <.ws> <arglist> ')'
+token postcircumfix:sym<( )> {
+ '(' <.ws> <arglist> ')'
<O('%methodop')>
}
@@ -447,15 +447,15 @@ token infix:sym<&&> { <sym> <O('%tight_and, :pasttype<if>')> }
token infix:sym<||> { <sym> <O('%tight_or, :pasttype<unless>')> }
token infix:sym<//> { <sym> <O('%tight_or, :pasttype<def_or>')> }
-token infix:sym<?? !!> {
+token infix:sym<?? !!> {
'??'
<.ws>
<EXPR('i=')>
'!!'
- <O('%conditional, :reducecheck<ternary>, :pasttype<if>')>
+ <O('%conditional, :reducecheck<ternary>, :pasttype<if>')>
}
-token infix:sym<=> {
+token infix:sym<=> {
<sym> <.panic: 'Assignment ("=") not supported in NQP, use ":=" instead'>
}
token infix:sym<:=> { <sym> <O('%assignment, :pasttype<bind>')> }
@@ -465,8 +465,8 @@ token infix:sym<,> { <sym> <O('%comma, :pasttype<list>')> }
grammar NQP::Regex is Regex::P6Regex::Grammar {
- token metachar:sym<:my> {
- ':' <?before 'my'> <statement=LANG('MAIN', 'statement')> <.ws> ';'
+ token metachar:sym<:my> {
+ ':' <?before 'my'> <statement=LANG('MAIN', 'statement')> <.ws> ';'
}
token metachar:sym<{ }> {
View
26 src/PAST/Compiler-Regex.pir
@@ -6,7 +6,7 @@ PAST::Compiler-Regex - Compiler for PAST::Regex nodes
=head1 DESCRIPTION
-PAST::Compiler-Regex implements the transformations to convert
+PAST::Compiler-Regex implements the transformations to convert
PAST::Regex nodes into POST. It's still a part of PAST::Compiler;
we've separated out the regex-specific transformations here for
better code management and debugging.
@@ -121,7 +121,7 @@ Return the POST representation of the regex AST rooted by C<node>.
concat $S0, tgt
concat $S0, ', $I10)'
ops.'push_pirop'('callmethod', '"!cursor_start"', 'self', 'result'=>$S0)
- self.'!cursorop'(ops, '!cursor_debug', 0, '"START "', regexname_esc)
+ self.'!cursorop'(ops, '!cursor_debug', 0, '"START "', regexname_esc)
unless caparray goto caparray_skip
self.'!cursorop'(ops, '!cursor_caparray', 0, caparray :flat)
caparray_skip:
@@ -131,16 +131,16 @@ Return the POST representation of the regex AST rooted by C<node>.
ops.'push_pirop'('.lex', '"$/"', 'match')
ops.'push_pirop'('length', eos, tgt, 'result'=>eos)
- # On Parrot, indexing into variable-width encoded strings
+ # On Parrot, indexing into variable-width encoded strings
# (such as utf8) becomes much more expensive as we move
# farther away from the beginning of the string (via calls
- # to utf8_skip_forward). For regexes that are starting a match
+ # to utf8_skip_forward). For regexes that are starting a match
# at a position other than the beginning of the string (e.g.,
# a subrule call), we can save a lot of useless scanning work
- # in utf8_skip_forward by removing the first C<off = from-1>
+ # in utf8_skip_forward by removing the first C<off = from-1>
# characters from the target and then performing all indexed
# operations on the resulting target relative to C<off>.
-
+
ops.'push_pirop'('set', off, 0)
ops.'push_pirop'('lt', '$I10', 2, startlabel)
ops.'push_pirop'('sub', off, '$I10', 1, 'result'=>off)
@@ -206,7 +206,7 @@ are passed to the function as input arguments.
done:
.return (ops)
.end
-
+
=item !rxregs(keystr)
@@ -576,7 +576,7 @@ standard quantifier code will handle it.
null ops
.return (ops)
.end
-
+
=item concat(PAST::Regex node)
@@ -649,7 +649,7 @@ character list.
zerowidth = iseq subtype, 'zerowidth'
ops.'push_pirop'('inline', negate, subtype, 'inline'=>' # rx enumcharlist negate=%0 %1')
-
+
ops.'push_pirop'('ge', pos, eos, fail)
ops.'push_pirop'('sub', '$I10', pos, off)
ops.'push_pirop'('substr', '$S10', tgt, '$I10', 1)
@@ -660,7 +660,7 @@ character list.
skip_zero_2:
.return (ops)
.end
-
+
=item literal(PAST::Regex node)
@@ -1017,7 +1017,7 @@ Perform a subcapture (capture of a portion of a regex).
$P0 = node.'name'()
name = self.'as_post'($P0, 'rtype'=>'*')
- .local string rxname
+ .local string rxname
rxname = self.'unique'('rxcap_')
.local pmc caplabel, donelabel
@@ -1110,7 +1110,7 @@ Helper method to create a new POST node of C<type>.
=item ??!!(test, trueval, falseval)
-Helper method to perform ternary operation -- returns C<trueval>
+Helper method to perform ternary operation -- returns C<trueval>
if C<test> is true, C<falseval> otherwise.
=cut
@@ -1125,7 +1125,7 @@ if C<test> is true, C<falseval> otherwise.
true:
.return (trueval)
.end
-
+
=back
View
4 src/PAST/Regex.pir
@@ -7,7 +7,7 @@ PAST::Regex - Regex nodes for PAST
=head1 DESCRIPTION
This file implements the various abstract syntax tree nodes
-for regular expressions.
+for regular expressions.
=cut
@@ -179,7 +179,7 @@ at this node.
lpast = self[0]
$I0 = isa lpast, ['String']
unless $I0 goto done
-
+
.local string subtype
subtype = self.'subtype'()
if subtype == 'ignorecase' goto done
View
8 src/Regex/Cursor-builtins.pir
@@ -135,11 +135,11 @@ Regex::Cursor-builtins - builtin regexes for Cursor objects
.sub 'upper' :method
.tailcall '!cclass'(self, 'upper', .CCLASS_UPPERCASE)
.end
-
+
.sub 'lower' :method
.tailcall '!cclass'(self, 'lower', .CCLASS_LOWERCASE)
.end
-
+
.sub 'digit' :method
.tailcall '!cclass'(self, 'digit', .CCLASS_NUMERIC)
.end
@@ -159,7 +159,7 @@ Regex::Cursor-builtins - builtin regexes for Cursor objects
.sub 'cntrl' :method
.tailcall '!cclass'(self, 'cntrl', .CCLASS_CONTROL)
.end
-
+
.sub 'punct' :method
.tailcall '!cclass'(self, 'punct', .CCLASS_PUNCTUATION)
.end
@@ -211,7 +211,7 @@ Regex::Cursor-builtins - builtin regexes for Cursor objects
setattribute self, '$!debug', arg
.return (1)
.end
-
+
=head1 AUTHORS
Patrick Michaud <pmichaud@pobox.com> is the author and maintainer.
View
10 src/Regex/Cursor-protoregex-peek.pir
@@ -44,7 +44,7 @@ Perform a match for protoregex C<name>.
self.'!cursor_debug'(' token1="', $S1, '", token="', $S0, '"')
# Create a hash to keep track of the methods we've already called,
- # so that we don't end up calling it twice.
+ # so that we don't end up calling it twice.
.local pmc mcalled
mcalled = new ['Hash']
@@ -98,7 +98,7 @@ Perform a match for protoregex C<name>.
=item !protoregex_generation()
-Reset the C<$!generation> flag to indicate that protoregexes
+Reset the C<$!generation> flag to indicate that protoregexes
need to be recalculated (because new protoregexes have been
added).
@@ -176,7 +176,7 @@ create a new one and return it.
push methodlist, methodname
goto proto_loop
proto_done:
-
+
# Now, walk through all of the methods, building the
# tokrx and toklen tables as we go.
.local pmc sorttok
@@ -223,7 +223,7 @@ create a new one and return it.
token_item:
tkey = $P0
- # If we've already processed this token for this rule,
+ # If we've already processed this token for this rule,
# don't enter it twice into tokrx.
$I0 = exists seentok[tkey]
if $I0 goto tokens_loop
@@ -331,7 +331,7 @@ recreating it on future calls.
setprop parrotclass, '%!prototable', prototable
.return (prototable)
.end
-
+
=item !PREFIX__!protoregex(name)
View
2 src/Regex/Cursor.pir
@@ -524,7 +524,7 @@ values of repetition count, cursor position, and mark (address).
=item !mark_commit(mark)
Like C<!mark_fail> above this backtracks the cursor to C<mark>
-(releasing any intermediate marks), but preserves the current
+(releasing any intermediate marks), but preserves the current
capture states.
=cut
View
4 src/Regex/Match.pir
@@ -182,7 +182,7 @@ Returns the string value of the match
$S0 = self.'Str'()
.return ($S0)
.end
-
+
=item !make(obj)
@@ -195,7 +195,7 @@ Set the "ast object" for the invocant.
setattribute self, '$!ast', obj
.return (obj)
.end
-
+
=back
View
52 src/Regex/P6Regex/Actions.pm
@@ -4,8 +4,8 @@ class Regex::P6Regex::Actions is HLL::Actions;
our @MODIFIERS;
sub INIT() {
- @MODIFIERS := Q:PIR {
- %r = new ['ResizablePMCArray']
+ @MODIFIERS := Q:PIR {
+ %r = new ['ResizablePMCArray']
$P0 = new ['Hash']
push %r, $P0
};
@@ -42,8 +42,8 @@ method nibbler($/, $key?) {
my $past;
if +$<termish> > 1 {
$past := PAST::Regex.new( :pasttype('alt'), :node($/) );
- for $<termish> {
- $past.push($_.ast);
+ for $<termish> {
+ $past.push($_.ast);
}
}
else {
@@ -124,12 +124,12 @@ method quantifier:sym<**>($/) {
make backmod($past, $<backmod>);
}
-method metachar:sym<ws>($/) {
+method metachar:sym<ws>($/) {
my $past := @MODIFIERS[0]<s>
- ?? PAST::Regex.new( 'ws', :pasttype('subrule'),
+ ?? PAST::Regex.new( 'ws', :pasttype('subrule'),
:subtype('method'), :node($/) )
!! 0;
- make $past;
+ make $past;
}
@@ -204,9 +204,9 @@ method metachar:sym<assert>($/) {
method metachar:sym<~>($/) {
make PAST::Regex.new(
$<EXPR>.ast,
- PAST::Regex.new(
+ PAST::Regex.new(
$<GOAL>.ast,
- PAST::Regex.new( 'FAILGOAL', ~$<GOAL>, :pasttype('subrule'),
+ PAST::Regex.new( 'FAILGOAL', ~$<GOAL>, :pasttype('subrule'),
:subtype('method') ),
:pasttype('alt')
),
@@ -244,10 +244,10 @@ method metachar:sym<var>($/) {
method metachar:sym<PIR>($/) {
make PAST::Regex.new(
PAST::Op.new( :inline(~$<pir>), :pasttype('inline'), ),
- :pasttype('pastnode'), :node($/)
+ :pasttype('pastnode'), :node($/)
);
}
-
+
method backslash:sym<w>($/) {
my $subtype := ~$<sym> eq 'n' ?? 'nl' !! ~$<sym>;
@@ -268,7 +268,7 @@ method backslash:sym<e>($/) {
}
method backslash:sym<f>($/) {
- my $past := PAST::Regex.new( "\f", :pasttype('enumcharlist'),
+ my $past := PAST::Regex.new( "\f", :pasttype('enumcharlist'),
:negate($<sym> eq 'F'), :node($/) );
make $past;
}
@@ -280,26 +280,26 @@ method backslash:sym<h>($/) {
}
method backslash:sym<r>($/) {
- my $past := PAST::Regex.new( "\r", :pasttype('enumcharlist'),
+ my $past := PAST::Regex.new( "\r", :pasttype('enumcharlist'),
:negate($<sym> eq 'R'), :node($/) );
make $past;
}
method backslash:sym<t>($/) {
- my $past := PAST::Regex.new( "\t", :pasttype('enumcharlist'),
+ my $past := PAST::Regex.new( "\t", :pasttype('enumcharlist'),
:negate($<sym> eq 'T'), :node($/) );
make $past;
}
method backslash:sym<v>($/) {
- my $past := PAST::Regex.new( "\x[0a,0b,0c,0d,85,2028,2029]",
+ my $past := PAST::Regex.new( "\x[0a,0b,0c,0d,85,2028,2029]",
:pasttype('enumcharlist'),
:negate($<sym> eq 'V'), :node($/) );
make $past;
}
method backslash:sym<o>($/) {
- my $octlit :=
+ my $octlit :=
HLL::Actions::ints_to_string( $<octint> || $<octints><octint> );
make $<sym> eq 'O'
?? PAST::Regex.new( $octlit, :pasttype('enumcharlist'),
@@ -308,7 +308,7 @@ method backslash:sym<o>($/) {
}
method backslash:sym<x>($/) {
- my $hexlit :=
+ my $hexlit :=
HLL::Actions::ints_to_string( $<hexint> || $<hexints><hexint> );
make $<sym> eq 'X'
?? PAST::Regex.new( $hexlit, :pasttype('enumcharlist'),
@@ -339,7 +339,7 @@ method assertion:sym<!>($/) {
$past.negate( !$past.negate );
$past.subtype('zerowidth');
}
- else {
+ else {
$past := PAST::Regex.new( :pasttype('anchor'), :subtype('fail'), :node($/) );
}
make $past;
@@ -368,9 +368,9 @@ method assertion:sym<name>($/) {
chopn $S0, 1
%r = box $S0
};
- $past := PAST::Regex.new(
+ $past := PAST::Regex.new(
PAST::Regex.new( $regexsym, :pasttype('literal') ),
- :name($name), :pasttype('subcapture'), :node($/)
+ :name($name), :pasttype('subcapture'), :node($/)
);
}
else {
@@ -391,9 +391,9 @@ method assertion:sym<[>($/) {
my $past := $clist[0].ast;
if $past.negate && $past.pasttype eq 'subrule' {
$past.subtype('zerowidth');
- $past := PAST::Regex.new(
- $past,
- PAST::Regex.new( :pasttype('charclass'), :subtype('.') ),
+ $past := PAST::Regex.new(
+ $past,
+ PAST::Regex.new( :pasttype('charclass'), :subtype('.') ),
:node($/)
);
}
@@ -412,7 +412,7 @@ method assertion:sym<[>($/) {
}
make $past;
}
-
+
method cclass_elem($/) {
my $str := '';
my $past;
@@ -441,7 +441,7 @@ method cclass_elem($/) {
cclass_done:
%r = box $S2
};
- $str := $str ~ $c;
+ $str := $str ~ $c;
}
else { $str := $str ~ $_[0]; }
}
@@ -466,7 +466,7 @@ sub buildsub($rpast) {
$rpast,
PAST::Regex.new( :pasttype('pass') ),
:pasttype('concat'),
- :capnames(%capnames)
+ :capnames(%capnames)
);
PAST::Block.new( $rpast, :blocktype('method'));
}
View
34 src/Regex/P6Regex/Grammar.pm
@@ -1,7 +1,7 @@
grammar Regex::P6Regex::Grammar is HLL::Grammar;
method obs ($old, $new, $when = 'in Perl 6') {
- self.panic('Obsolete use of ' ~ ~$old ~ ';'
+ self.panic('Obsolete use of ' ~ ~$old ~ ';'
~ ~$when ~ ' please use ' ~ ~$new ~ 'instead');
}
@@ -11,7 +11,7 @@ grammar Regex::P6Regex::Grammar is HLL::Grammar;
token quote { \' $<val>=[<-[']>*] \' }
- token arg {
+ token arg {
[
| <quote>
| $<val>=[\d+]
@@ -28,8 +28,8 @@ grammar Regex::P6Regex::Grammar is HLL::Grammar;
token nibbler {
{*} #= open
[ <.ws> ['||'|'|'|'&&'|'&'] ]?
- <termish>
- [ ['||'|'|']
+ <termish>
+ [ ['||'|'|']
[ <termish> || <.panic: 'Null pattern not allowed'> ]
]*
}
@@ -54,7 +54,7 @@ grammar Regex::P6Regex::Grammar is HLL::Grammar;
token quantifier:sym<*> { <sym> <backmod> }
token quantifier:sym<+> { <sym> <backmod> }
token quantifier:sym<?> { <sym> <backmod> }
- token quantifier:sym<**> {
+ token quantifier:sym<**> {
<sym> \s* <backmod> \s*
[
|| $<min>=[\d+] [ '..' $<max>=[\d+|'*'] ]?
@@ -82,24 +82,24 @@ grammar Regex::P6Regex::Grammar is HLL::Grammar;
token metachar:sym<mod> { <mod_internal> }
## we cheat here, really should be regex_infix:sym<~>
- token metachar:sym<~> {
- <sym>
- <.ws> <GOAL=quantified_atom>
+ token metachar:sym<~> {
+ <sym>
+ <.ws> <GOAL=quantified_atom>
<.ws> <EXPR=quantified_atom>
}
- token metachar:sym<{*}> {
- <sym>
+ token metachar:sym<{*}> {
+ <sym>
[ \h* '#= ' \h* $<key>=[\S+ [\h+ \S+]*] ]?
}
- token metachar:sym<assert> {
- '<' <assertion>
+ token metachar:sym<assert> {
+ '<' <assertion>
[ '>' || <.panic: 'regex assertion not terminated by angle bracket'> ]
}
token metachar:sym<var> {
- [
- | '$<' $<name>=[<-[>]>+] '>'
+ [
+ | '$<' $<name>=[<-[>]>+] '>'
| '$' $<pos>=[\d+]
]
@@ -134,7 +134,7 @@ grammar Regex::P6Regex::Grammar is HLL::Grammar;
token assertion:sym<!> { '!' [ <?before '>' > | <assertion> ] }
token assertion:sym<method> {
- '.' <assertion>
+ '.' <assertion>
}
token assertion:sym<name> {
@@ -164,9 +164,9 @@ grammar Regex::P6Regex::Grammar is HLL::Grammar;
<.normspace>?
}
- token mod_internal {
+ token mod_internal {
[
- | ':' $<n>=('!' | \d+)**1 <mod_ident> »
+ | ':' $<n>=('!' | \d+)**1 <mod_ident> »
| ':' <mod_ident> [ '(' $<n>=[\d+] ')' ]?
]
}
View
4 src/cheats/hll-compiler.pir
@@ -9,7 +9,7 @@
p6meta = get_hll_global 'P6metaclass'
p6meta.'new_class'('HLL::Compiler', 'parent'=>'PCT::HLLCompiler')
.end
-
+
.sub 'parse' :method
.param pmc source
@@ -74,4 +74,4 @@
$S0 = $P0.'to_pir'(source, adverbs :flat :named)
.return ($S0)
.end
-
+
View
14 src/cheats/hll-grammar.pir
@@ -160,9 +160,9 @@ C< :!pair >, and C<< :pair<strval> >>.
value = box $S0
pos = lpos + 1
have_value:
- # Done processing the pair, store it in the hash.
+ # Done processing the pair, store it in the hash.
hash[name] = value
- goto spec_loop
+ goto spec_loop
spec_done:
# Done processing the spec string, cache the hash for later.
ohash[spec] = hash
@@ -180,7 +180,7 @@ C< :!pair >, and C<< :pair<strval> >>.
save_hash:
ohash[save] = hash
.return (self)
-
+
err_lookup:
self.'panic'('Unknown operator precedence specification "', lookup, '"')
.end
@@ -258,7 +258,7 @@ position C<pos>.
inc $I0
stop = substr brackets, $I0, 1
- # see if the opening bracket is repeated
+ # see if the opening bracket is repeated
.local int len
len = 0
bracket_loop:
@@ -291,7 +291,7 @@ position C<pos>.
quotemod = new ['Hash']
true = box 1
-
+
args_loop:
unless args goto args_done
@@ -321,7 +321,7 @@ position C<pos>.
(cur, pos, target) = self.'!cursor_start'()
.local pmc start, stop
- (start, stop) = self.'peek_delimiters'(target, pos)
+ (start, stop) = self.'peek_delimiters'(target, pos)
.lex '$*QUOTE_START', start
.lex '$*QUOTE_STOP', stop
@@ -654,7 +654,7 @@ An operator precedence parser.
markhash = new ['Hash']
set_global '%!MARKHASH', markhash
have_markhash:
- markhash[markname] = pos
+ markhash[markname] = pos
self.'!cursor_debug'('PASS MARKER')
.return (1)
.end
View
2 src/cheats/nqp-builtins.pir
@@ -16,7 +16,7 @@
.sub 'say'
.param pmc list :slurpy
.tailcall 'print'(list :flat, "\n")
-.end
+.end
.sub 'ok'
.param pmc condition
View
2 t/nqp/10-cmp.t
@@ -82,7 +82,7 @@ unless @a =:= @b {
print("not ");
}
say("ok 17 # container equality, named arrays");
-
+
my $x := 'foo';
my $y := $x;
my $z := 'foo';
View
2 t/nqp/11-sub.t
@@ -73,4 +73,4 @@ say("ok 10 # subroutines that operate on args do not affect the original arg out
sub eleven ($arg) {
say("ok 11 # parameter with a trailing comma");
}
-eleven( 'dummy', );
+eleven( 'dummy', );
View
4 t/nqp/21-contextual.t
@@ -15,9 +15,9 @@ sub foo() { $*VAR }
ok(bar() eq 'abc', 'called subroutine sees caller $*VAR');
-
- {
+
+ {
my $*VAR := 'def';
ok( $*VAR eq 'def', 'basic nested contextual works');
ok( foo() eq 'def', 'called subroutine sees caller $*VAR');
View
4 t/nqp/27-self.t
@@ -8,13 +8,13 @@ class Foo {
method uno() {
self.foo();
};
-
+
method des() {
if 1 {
self.foo();
}
};
-
+
method tres($a) {
if 1 {
self.foo();
View
2 t/nqp/33-init.t
@@ -8,7 +8,7 @@ our $foo;
ok($foo == 2, 'after second INIT block');
-INIT {
+INIT {
our $foo;
ok($foo == 0, 'first INIT');
$foo := 1;
View
4 t/p6regex/rx_charclass
@@ -73,9 +73,9 @@
# todo :pugs<feature> :pge<feature>
(ab)"x$0" abxab y literal match with interpolation
'?' ab<? y literal match with question mark
-'<' ab<? y literal match with lt
+'<' ab<? y literal match with lt
'<?' ab<? y literal match with lt and question mark
-'<?' ab<x? n non-matching literal match
+'<?' ab<x? n non-matching literal match
<[A..Z0..9]> abcdef n two enumerated ranges
<[A..Z0..9]> abcDef y two enumerated ranges

0 comments on commit 0b3c754

Please sign in to comment.