Skip to content

Review annotationChunk in DRL10Parser.g4 #6237

Open
@tkobayas

Description

@tkobayas

chunk in DRL10Parser.g4 may eat greedy and doesn't provide an appropriate error.

for example) a test case candidate

    @Test
    void annotationChunk() {
        final String drl = "rule sales\n" +
                "@department('sales')\n" +
                "wrongattribute \"hey\"\n" +
                "when\n" +
                "    $s : String( this == 'fireRules' )\n" +
                "then\n" +
                "    list.add(kcontext.getRule().getName());\n" +
                "end";
        final PackageDescr pkg = parseAndGetPackageDescrWithoutErrorCheck(drl);
        assertThat(parser.hasErrors()).isTrue();
        assertThat(parser.getErrors().get(0).getMessage()).contains("'wrongattribute'");
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions