cooklang / cooklang-swift

Cooklang parser implementation in Swift
https://cooklang.org
MIT License
38 stars 3 forks source link

Parsing issues #9

Closed BobChubby closed 3 years ago

BobChubby commented 3 years ago

Running v0.0.12 on Windows Subsystem for Linux Ubuntu I kept seeing the error Warning: expected '}' but got end of line when writing a recipe. Below is the a small snippet that still reproduces the issue on my end.


Cook rice for ~{15%minutes}

If I have an empty line before line including the timer, I see the following output which shows the timer was not parsed correctly:

Warning: expected '}' but got end of line
Ingredients:

Steps:
     1. Cook rice for
        [–]

Other observations:

If the timer is replaced with an ingredient, the last letter is cut off


Cook @rice

Becomes

Ingredients:
    ric                           1

Steps:
     1. Cook ric
        [ric: 1]

If instead I add the braces, so it becomes @rice{}, I get a fatal error:

woops
/src/.build/checkouts/CookInSwift/Sources/CookInSwift/Parser/Parser.swift:68: Fatal error: Syntax error, expected RBRACE, got EOF
[1]    3853 illegal hardware instruction  cook recipe read test.cook
dubadub commented 3 years ago

@BobChubby thanks for reporting! I'll look on priority, most likely its similar to https://github.com/cooklang/CookInSwift/issues/8.

dubadub commented 3 years ago

The issue was fixed. Changes are in CLI since v0.0.13.