Raku / roast

🦋 Raku test suite
https://raku.org/
Artistic License 2.0
178 stars 135 forks source link

Investigate absence of tests for :dba adverb #238

Open Altai-man opened 7 years ago

Altai-man commented 7 years ago

This adverb can be found in specs and in rakudo(I'm not sure how to test it, but code like regex { :dba('array subscript') '[' ~ ']' <expression> } doesn't fail, but there is not tests in the roast. Is it a part of the language? We need to test it then.

JJ commented 4 years ago

Where is this defined? I can't see it here

Altai-man commented 4 years ago

No idea, but it is used at e.g. https://github.com/rakudo/rakudo/blob/master/src/Perl6/Actions.nqp#L1213 So maybe nqp?

vrurg commented 4 years ago

@Altai-man what you're referring to is purely internal thing. diessct_*longname methods return an instance of World's internal LongName class, .name is invoked upon the instance.

:dba in a grammar is different thing. As far as I know it is used by the core Grammar only. Despite being exposed to Raku Grammar at the syntax level (parsing of :dba doesn't fail) it does nothing but harm to a rule because it breaks the parsing itself. For example:

grammar TTT {
    token TOP {
        <bbb>
    }
    token bbb {
        #:dba('oops')
        "bbb"
    }
}

say TTT.parse("bbb");

Uncommenting :dba results in a failure.