Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some of the compilation errors.

There are still failures due to SymbolTable.nqp module becoming a class
somehow, which produces an error about undeclared self. Needs further
investigation.
  • Loading branch information...
commit 29e3d7e878d3070b2119996b385fd9397de79211 1 parent dc68184
@tadzik authored
View
5 build/Makefile.in
@@ -33,7 +33,7 @@ RM_RF := @rm_rf@
POD2MAN := pod2man
#IF(parrot_is_shared and not(cygwin or win32)):export LD_RUN_PATH := @blib_dir@:$(LD_RUN_PATH)
PARROT := $(BIN_DIR)/parrot@exe@
-PARROT_NQP := $(BIN_DIR)/parrot_nqp@exe@
+PARROT_NQP := $(BIN_DIR)/parrot-nqp@exe@
PBC_TO_EXE := $(BIN_DIR)/pbc_to_exe@exe@
STRIP_PIRA := grep -v '^.annotate'
#IF(darwin):
@@ -50,7 +50,6 @@ ACTIONS_PM := \
BUILTINS_PIR := \
src/builtins/grammar_utils.pir \
src/builtins/literals.pir \
- src/builtins/load_bytecode.pir \
src/builtins/optable.pir \
src/builtins/say.pir \
src/builtins/strings.pir
@@ -468,4 +467,4 @@ TEST_LIBS := \
src/Testcase.pir
tvalues: $(TEST_LIBS) t/Slam/Values.pir src/Slam/Value.pir
- $(PARROT) $(PARROT_ARGS) t/Slam/Values.pir
+ $(PARROT) $(PARROT_ARGS) t/Slam/Values.pir
View
4 src/Slam/Adverbs.nqp
@@ -6,12 +6,12 @@ module Slam::Adverb {
################################################################
-=sub _onload
+=begin sub _onload
This code runs at initload, and explicitly creates this class as a subclass of
Slam::Val.
-=cut
+=end sub
_ONLOAD();
View
8 src/Slam/IncludeFile.nqp
@@ -30,10 +30,10 @@ sub dump_stack() {
}
sub get_FILES() {
- NOTE("Getting open file info from $?FILES");
+ NOTE("Getting open file info from $*FILES");
my $filename := Q:PIR {
- %r = find_dynamic_lex '$?FILES'
+ %r = find_dynamic_lex '$*FILES'
};
my $info := Array::new($filename);
@@ -188,12 +188,12 @@ sub push($filename) {
sub set_FILES($value) {
Q:PIR {
- $P0 = find_dynamic_lex '$?FILES'
+ $P0 = find_dynamic_lex '$*FILES'
if null $P0 goto skip
$P0 = find_lex '$value'
$P1 = shift $P0
- store_dynamic_lex '$?FILES', $P1
+ store_dynamic_lex '$*FILES', $P1
$P1 = shift $P0
set_hll_global '$!ws', $P1
View
4 src/Slam/Literal.nqp
@@ -6,12 +6,12 @@ module Slam::Literal {
################################################################
-=sub _onload
+=begin sub _onload
This code runs at initload, and explicitly creates this class as a subclass of
Node.
-=cut
+=end sub
_ONLOAD();
View
4 src/Slam/Lookups.nqp
@@ -35,7 +35,7 @@ sub get_search_list_of($qualified_identifier) {
return @search_list;
}
-=sub Slam::Node[] lookup_qualified_identifier($ident)
+=begin sub Slam::Node[] lookup_qualified_identifier($ident)
Given a qualified identifier -- a name that may or may not be prefixed with type
or namespace names -- looks up the possible matches for the identifier using the
@@ -47,7 +47,7 @@ not share a namespace, any path, no matter how explicit, can potentially resolve
to both a namespace and a symbol. (Perl6 uses this to create a proto-object with
the same name as the namespace.)
-=cut
+=end sub
sub query_relative_scopes_matching_path($root, @path) {
NOTE("Querying scopes relative to ", $root.name(), " that match path ", @path.join('::'));
View
6 src/Slam/SymbolTable.nqp
@@ -6,11 +6,11 @@ module Slam::SymbolTable;
################################################################
-=sub _onload
+=begin sub _onload
This code runs at initload time, creating subclasses.
-=cut
+=end sub
_ONLOAD();
@@ -249,7 +249,7 @@ method stack(*@value) { self._ATTR('stack', @value); }
sub current_file() {
my $filename := Q:PIR {
- %r = find_dynamic_lex '$?FILES'
+ %r = find_dynamic_lex '$*FILES'
};
return $filename;
View
4 src/Slam/Symbols/Name.nqp
@@ -47,12 +47,12 @@ method is_namespace() { return 0; }
method is_rooted(*@value) { self._ATTR('is_rooted', @value); }
method parts(*@value) { return 'parts'; }
-=method path
+=begin method path
Returns an array containing the hll and namespace elements, for use by the
namespace functions.
-=cut
+=end method
method path(*@value) {
my @path := Array::clone(self.namespace);
View
20 src/Slam/Value.nqp
@@ -234,14 +234,14 @@ Thus: string s1, s2; s1 = s2; becomes:
Because rvalue and lvalue for basic types gets the same treatment.
-=cut
+=end notes
-=class Slam::Value
+=begin class Slam::Value
See L<t/Slam/Values.nqp> for documentation.
-=cut
+=end class
module Slam::Value {
@@ -263,16 +263,16 @@ sub _ONLOAD() {
NOTE("done");
}
-=method is_lvalue()
+=begin method is_lvalue()
Returns a boolean indicating whether this value can be used as an I<lvalue>.
This version always returns false. An lvalue-capable subclass may override this.
-=cut
+=end method
method is_lvalue() { return 0; }
-=method load()
+=begin method load()
Returns an array of ops that will cause the C<value()> to be correct. For
constants, this is generally nothing - value() will return an immediate value
@@ -281,11 +281,11 @@ may be necessary to fetch the value from storage. For expressions, it may be
necessary to compute the value. The steps returned by C<load()> must do
whatever is needed.
-=cut
+=end method
method load() { return Array::empty(); }
-=method value($value?)
+=begin method value($value?)
Returns, and may optionally set, the value of this node. A node's value is
either a literal usable directly in PIR, such as a quoted string or a number,
@@ -293,8 +293,8 @@ or it is a register name, like C<$P0> or C<foo>, that can be assigned.
C<value()> is always used in an I<rvalue> context.
-=cut
+=end method
method value(*@value) { self._ATTR('value', @value); }
-}
+}
View
12 src/Slam/Visitors/DeclarationCollectionVisitor.nqp
@@ -20,11 +20,11 @@ method name() {
return $Visitor_name;
}
-=method visit($node)
+=begin method visit($node)
Delegates to SUPER.visit. This method should be copied unchanged into the new code.
-=cut
+=end method
method visit($node) {
my @results := $SUPER.visit(self, $node);
@@ -36,9 +36,11 @@ method visit($node) {
################################################################
+=begin pod
+
=head3 Declaration Collection Visitor
-=cut
+=end pod
our @Child_attribute_names := (
'type',
@@ -77,11 +79,11 @@ method _collect_declarations_function_definition($node) {
################################################################
-=sub collect_declarations($past)
+=begin sub collect_declarations($past)
Visit all symbol declarations and record them in the backing namespace blocks.
-=cut
+=end sub
sub collect_declarations($past) {
NOTE("Collecting declarations in PAST tree");
View
20 src/Slam/Visitors/PastCleanupVisitor.nqp
@@ -1,5 +1,7 @@
# $Id$
+=begin pod
+
=head1 PastCleanupVisitor
Transforms the PAST tree into a shape suitable for PAST->POST compilation. This
@@ -13,7 +15,7 @@ an array of bits to be encapsulated. If a node does not directly represent such
a bit, it should pass back the result array of its children, otherwise append
itself to the child results.
-=cut
+=end pod
class Slam::PastCleanupVisitor;
@@ -95,11 +97,11 @@ method name() {
return $Visitor_name;
}
-=method visit($node)
+=begin method visit($node)
Delegates to SUPER.visit. This method should be copied unchanged into the new code.
-=cut
+=end method
method visit($node) {
my @results;
@@ -119,12 +121,12 @@ method visit($node) {
return @results;
}
-=method visit_children($node)
+=begin method visit_children($node)
Delegates to SUPER.visit_children. This method should be copied unchanged into
the new code.
-=cut
+=end method
method visit_children($node) {
NOTEold("Visiting ", +@($node), " children of ", NODE_TYPE($node), " node: ", $node.name());
@@ -148,11 +150,11 @@ method visit_child_syms($node) {
################################################################
-=method _cleanup_past_UNKNOWN($node)
+=begin method _cleanup_past_UNKNOWN($node)
Does nothing at all with the node.
-=cut
+=end method
our @Child_attribute_names := (
'alias_for',
@@ -201,12 +203,12 @@ method _cleanup_past_UNKNOWN($node) {
################################################################
-=sub cleanup_past($past)
+=begin sub cleanup_past($past)
The entry point. In general, you create a new object of this class, and use it
to visit the PAST node that is passed from the compiler.
-=cut
+=end sub
sub cleanup_past($past) {
NOTEold("Cleaning up PAST tree");
View
16 src/Slam/Visitors/ScopeAssignmentVisitor.nqp
@@ -1,10 +1,12 @@
# $Id$
+=begin pod
+
=head1 ScopeAssignmentVisitor
Sets identifier scopes in PAST.
-=cut
+=end pod
class Slam::ScopeAssignmentVisitor;
@@ -62,11 +64,11 @@ method name() {
return $Visitor_name;
}
-=method visit($node)
+=begin method visit($node)
Delegates to SUPER.visit. This method should be copied unchanged into the new code.
-=cut
+=end method
method visit($node) {
my @results := $SUPER.visit(self, $node);
@@ -79,7 +81,7 @@ method visit($node) {
################################################################
-=method _assign_scope_UNKNOWN($node)
+=begin method _assign_scope_UNKNOWN($node)
This method -- starting with the prefix returned by C<get_method_prefix()>,
above, and ending with 'UNKNOWN', is the default method invoked by
@@ -102,7 +104,7 @@ indent them, etc.
Figure out your own approach.
-=cut
+=end method
our @Child_attribute_names := (
'alias_for',
@@ -187,12 +189,12 @@ method _assign_scope_qualified_identifier($node) {
################################################################
-=sub assign_scopes($past)
+=begin sub assign_scopes($past)
The entry point. In general, you create a new object of this class, and use it
to visit the PAST node that is passed from the compiler.
-=cut
+=end sub
sub assign_scopes($past) {
NOTEold("Assigning scopes in PAST tree");
View
16 src/Slam/Visitors/TreeRewriteVisitor.nqp
@@ -1,5 +1,7 @@
# $Id$
+=begin pod
+
=head1 TreeRewriteVisitor
Transforms the PAST tree into a shape suitable for PAST->POST compilation. This
@@ -13,7 +15,7 @@ an array of bits to be encapsulated. If a node does not directly represent such
a bit, it should pass back the result array of its children, otherwise append
itself to the child results.
-=cut
+=end pod
class Slam::TreeRewriteVisitor;
@@ -51,11 +53,11 @@ method name() {
return $Visitor_name;
}
-=method visit($node)
+=begin method visit($node)
Delegates to SUPER.visit. This method should be copied unchanged into the new code.
-=cut
+=end method
method visit($node) {
my @results;
@@ -77,11 +79,11 @@ method visit($node) {
################################################################
-=method _rewrite_tree_UNKNOWN($node)
+=begin method _rewrite_tree_UNKNOWN($node)
Does nothing at all with the node.
-=cut
+=end method
our @Child_attribute_names := (
'alias_for',
@@ -117,12 +119,12 @@ method _rewrite_tree_initload_sub($node) {
################################################################
-=sub rewrite_tree($past)
+=begin sub rewrite_tree($past)
The entry point. In general, you create a new object of this class, and use it
to visit the PAST node that is passed from the compiler.
-=cut
+=end sub
sub rewrite_tree($past) {
NOTE("Rewriting PAST tree into POSTable shape");
View
8 src/Slam/parser/action_utils.nqp
@@ -61,12 +61,12 @@ sub PASSTHRU($/, $key, :$caller_level?) {
################################################################
-=sub ast_array($capture)
+=begin sub ast_array($capture)
Returns an array of the ast nodes associated with the elements of an array
capture. (As with a <subrule>* or <subrule>+ match.)
-=cut
+=end sub
sub ast_array($capture) {
my @results := Array::empty();
@@ -79,13 +79,13 @@ sub ast_array($capture) {
}
-=sub void clean_up_heredoc($past, @lines)
+=begin sub void clean_up_heredoc($past, @lines)
Chops off leading whitespace, as determined by the final line. Concatenates all
but the last line of C<@lines> and sets the C<value()> attribute of the C<$past>
value.
-=cut
+=end sub
sub clean_up_heredoc($past, @lines) {
my $closing := @lines.pop();
View
46 src/Slam/parser/declaration_actions.nqp
@@ -2,33 +2,33 @@
module Slam::Grammar::Actions;
-=method access_qualifier
+=begin method access_qualifier
Creates a type-specifier entry, to be attached to a declarator or specifier.
-=cut
+=end method
method access_qualifier($/, $key) { PASSTHRU($/, $key); }
method dclr_adverb($/, $key) { PASSTHRU($/, $key); }
-=method dclr_alias
+=begin method dclr_alias
Just another kind of declarator.
-=cut
+=end method
method dclr_alias($/) {
my $past := Slam::Type::new_dclr_alias($<alias>.ast);
DUMP($past);
make $past;
}
-=method dclr_array_or_hash
+=begin method dclr_array_or_hash
Constructs an immediate token to represent the type-declarator,
and attaches any attributes required (array #elements).
-=cut
+=end method
method dclr_array_or_hash($/, $key) {
my $past;
@@ -52,12 +52,12 @@ method dclr_array_or_hash($/, $key) {
method dclr_atom($/, $key) { PASSTHRU($/, $key); }
-=method dclr_pointer
+=begin method dclr_pointer
Creates a token around the '*' in the pointer declarator, and attaches
any qualifiers as children of the node.
-=cut
+=end method
method dclr_pointer($/) {
NOTE("Creating pointer declarator");
@@ -68,11 +68,11 @@ method dclr_pointer($/) {
make $past;
}
-=method dclr_postfix
+=begin method dclr_postfix
Passes through the array, hash, or function declarator.
-=cut
+=end method
method dclr_postfix($/, $key) { PASSTHRU($/, $key); }
@@ -196,12 +196,12 @@ our %_decl_part;
method declarator_part($/, $key) { self.DISPATCH($/, $key, %_decl_part); }
-=method namespace_alias_declaration
+=begin method namespace_alias_declaration
Edits the enclosing block of this node, creating an alias for the namespace
name given.
-=cut
+=end method
method namespace_alias_declaration($/) {
my $ns_name := $<namespace>.ast;
@@ -217,7 +217,7 @@ method namespace_alias_declaration($/) {
method param_adverb($/, $key) { PASSTHRU($/, $key); }
-=method parameter_declaration
+=begin method parameter_declaration
Matches the declaration of a I<single> declarator, with a limited set of
specifiers. When completed, pushes the declared symbol on to the current
@@ -228,7 +228,7 @@ constructed from the C<declarator> node returned by the C<declarator_name> rule.
Supports the adverbs appropriate to parameters, including C<named>, C<slurpy>,
and C<optional>.
-=cut
+=end method
method parameter_declaration($/) {
NOTE("Assembling parameter_declaration");
@@ -255,13 +255,13 @@ method parameter_declaration($/) {
make $past;
}
-=method parameter_list
+=begin method parameter_list
Creates a function-returning declarator, which is set as the PAST result of
the rule. The declarator contains a PAST::Block to represent the function's
parameter scope.
-=cut
+=end method
method _parameter_list_close($/) {
our $Symbols;
@@ -316,12 +316,12 @@ method specifier_list($/) {
MAKE($past);
}
-=method symbol_declaration_list
+=begin method symbol_declaration_list
Attaches specifier_list to each symbol's declarator. Declares symbols
within their respective scopes.
-=cut
+=end method
method symbol_declaration_list($/) {
my $past := Slam::Statement::SymbolDeclarationList.new();
@@ -374,11 +374,11 @@ method tspec_builtin($/) {
}
-=method tspec_function_attr
+=begin method tspec_function_attr
Creates a type specifier around the keyword.
-=cut
+=end method
method tspec_function_attr($/) {
my $name := ~ $<token>;
@@ -394,11 +394,11 @@ method tspec_function_attr($/) {
method tspec_not_type($/, $key) { PASSTHRU($/, $key); }
-=method tspec_storage_class
+=begin method tspec_storage_class
Creates a token around the keyword.
-=cut
+=end method
method tspec_storage_class($/) {
my $name := ~ $<token>;
@@ -434,4 +434,4 @@ method using_namespace_directive($/) {
);
make $past;
-}
+}
View
2  src/Slam/parser/expression_actions.nqp
@@ -160,7 +160,7 @@ method postfix_expr($/) {
sub postfixup($past) {
#say("Fixup: ", $past.WHAT, ": ", $past.name());
- if $past.isa('PAST::Op') and $past.pasttype() eq 'call' {
+ if $past.isa('PAST::Op') && $past.pasttype() eq 'call' {
#DUMP($past);
my $func := $past[0];
View
8 src/Slam/parser/grammar_actions.nqp
@@ -52,13 +52,13 @@ method TOP($/, $key) {
method declarative_statement($/, $key) { PASSTHRU($/, $key); }
-=sub faketree($past)
+=begin sub faketree($past)
Replaces the generated tree with a fake one, if a config switch is set. Used
to test arbitrary PAST structures, either because I'm bug-hunting or to
understand how they work. Not a "real" part of the compiler in any way.
-=cut
+=end sub
sub faketree($past) {
if Registry<CONFIG>.query('Compiler', 'faketree') {
@@ -84,12 +84,12 @@ sub faketree($past) {
return $past;
}
-=method include_file
+=begin method include_file
Processes an included file. The compiled PAST subtree is used as the result of
this expression.
-=cut
+=end method
method include_directive($/) {
NOTE("Processing include file: ", ~ $<file>);
View
4 src/Slam/parser/name_actions.nqp
@@ -1,12 +1,12 @@
# $Id$
module Slam::Grammar::Actions;
-=method declarator_name
+=begin method declarator_name
Creates a PAST::Var node, and sets whatever attributes are provided. The
resulting PAST::Var is not resolved.
-=cut
+=end method
method declarator_name($/) {
NOTE("Creating declarator_name for ", $<path>[-1].ast.value);
View
6 src/builtins/grammar_utils.pir
@@ -4,11 +4,11 @@
.return ()
.end
-=method ERROR
+=begin method ERROR
Inserts an <ERROR> token into the stream, so parser rules can recover from them.
-=cut
+=end method
.sub 'ERROR' :method
.param string message
@@ -33,4 +33,4 @@ Inserts an <ERROR> token into the stream, so parser rules can recover from them.
no_action:
die "Unable find action method 'ERROR'"
-.end
+.end
Please sign in to comment.
Something went wrong with that request. Please try again.