mathialo / bython

Python with braces. Because python is awesome, but whitespace is awful.
MIT License
2.05k stars 49 forks source link

Bython modifies braces within strings. #30

Open stormfish-sci opened 5 years ago

stormfish-sci commented 5 years ago

Bython v0.8 exhibits a problem in which it modifies braces within single and double quotation strings.

Code to reproduce:

test.by: print('Hello, world! I have braces {} here.'); print("Hello, world! I have braces {} here, too.");

The output produced is: Hello, world! I have braces:here. Hello, world! I have braces:here, too.

The expected output is, of course: Hello, world! I have braces {} here. Hello, world! I have braces {} here, too.

Thanks!

lqforgithub commented 5 years ago

From the issue I can tell no good grammar tree is build for braces analysis, it's no good to rely on the project.

kkevlar commented 3 years ago

+1

xXCrash2BomberXx commented 2 years ago

Old issue but I wrote this and maybe it will work better for you, if you still want it Bython

MZH-Amr commented 6 months ago

++

(i.e +1) It happens when using f-strings which makes using them impossible, also it raises an error when inside functions

def example_fn(param) {
    print(f"text from function, {param}")
}

Raises this error:

  File "/home/mzh/python_file.py", line 4
    print(f"text from function,:param")
    ^
IndentationError: expected an indented block after function definition on line 3