id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,lang,patch,platform
1307,NQP-rx doesn't handle comments correctly?,Austin_Hastings,pmichaud,"The code below, compiled via ""parrot-nqp bad.nqp"", fails. Moving the line comment `# Subs carry their name` to a separate line causes the parse to succeed.
{{{
module Foo;

sub inject_symbol($object, :$namespace, :$as?, :$force?) {
# Injects a PMC C< $object > into a C< $namespace >, optionally C< $as > a certain name. For C< Sub > and 
# C< MultiSub > PMCs, the name is not a requirement since they know their own names. For other PMC types,
# including injecting variable rather than functions, the C< $as > name must be provided by the caller. If 
# C< $force > is specified, any pre-existing symbol is overwritten. Otherwise, if a name collision occurs
# FIXME: an exception should be thrown, but currently isn't.

        unless Opcode::defined($as) { $as := ~ $object; } # Subs carry their name

        if !Opcode::isa($namespace, 'NameSpace') {
                $namespace := Opcode::get_hll_namespace($namespace);
        }

        # NB: find_var searches for *anything*, while find_sub requires isa(sub). In this case,
        # any collision is bad.
        if !$force && Opcode::defined($namespace.find_var($as)) {
                return 0;
        }

        $namespace.add_var($as, $object);
}
}}}",bug,closed,normal,,nqp,1.8.0,medium,fixed,,,,,
