Skip to content

Python runtime is inconsistent with Java #3236

@Vladimir-Chan

Description

@Vladimir-Chan

Hello, I am analyzing c# source code with the grammar files in grammar repository by Python target. I converted the grammar actions to Python source. When I tested the grammar by a simple example, I got ParseCancellationException. After debugging, I find that the method nextTokenOnChannel in class BufferedTokenStream is inconsistent with Java. In Python, the comment says

Return -1 if there are no tokens on channel between i and EOF.

While in Java, it says

Return the index of the EOF token if there are no tokens on channel between {@code i} and EOF.

So, which is correct? Please give a consistent version, thx.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions