roast icon indicating copy to clipboard operation
roast copied to clipboard

Investigate absence of tests for :dba adverb

Open Altai-man opened this issue 8 years ago • 3 comments

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.

Altai-man avatar Feb 19 '17 10:02 Altai-man

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

JJ avatar May 26 '20 07:05 JJ

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

Altai-man avatar May 26 '20 09:05 Altai-man

@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.

vrurg avatar May 26 '20 14:05 vrurg