ohm-editor icon indicating copy to clipboard operation
ohm-editor copied to clipboard

Conflicting state of the UI in the editor

Open mlajtos opened this issue 7 years ago • 3 comments

It seems that the visualizer and the test case list do not agree on whether parsing succeded or not. The parse tree is valid but the test case is color-coded with red.

screenshot 2018-04-26 20 05 27

mlajtos avatar Apr 26 '18 18:04 mlajtos

Thanks for reporting. Can you boil this down to a simple case that I can reproduce? Or at least give me the full grammar and example that you are using?

Also, please open the dev tools and see if there are any errors in the JavaScript console.

pdubroy avatar Apr 28 '18 08:04 pdubroy

Ok I shaved it down to this:

Mu {
    Expression
        = Addition
    Addition
        = (Addition "+" PrimitiveExpression) -- binary
        | PrimitiveExpression -- fallthrough
    
    PrimitiveExpression
        = FunctionApplication -- function_application
        | number -- literal
        
    FunctionApplication
        =  Expression "->" Expression

    number
        = digit+
}

Test case I am using: 1 + 1

When I remove FunctionApplication from PrimitiveExpression the test case goes green.

There are no errors in the console.

mlajtos avatar Apr 28 '18 08:04 mlajtos

It seems, that the parser really did not succeeded to match the input.

However the visualizer is showing a parse tree that I would consider a match. Weird is that the test runner does not show the error message from the parser, which can be seen here...

Is there something wrong with the language definition? Or Ohm? Or the editor?

mlajtos avatar May 07 '18 16:05 mlajtos