Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed mode #21

Closed
ole-tange opened this issue Jun 6, 2018 · 1 comment
Closed

Mixed mode #21

ole-tange opened this issue Jun 6, 2018 · 1 comment

Comments

@ole-tange
Copy link

I want this to work:

#!/usr/bin/env bython

def a():
  print("a")

def b() {
if 4<5:
  print("b")
}

a()
b()

The situation here is: I get a Python script that I edit. Most of it is white-space indented correctly. But parts of it use braces.

In particular I need braces to paste-in a section. In the above I got the if and print statements from another source with different indention. So I simply wrapped it with {} and this should then be understood correctly.

So I am asking for a mixed mode, where indention matters if there are no braces overriding it.

@mathialo
Copy link
Owner

This was a registered issue a while back too.

Since then, the python-to-bython translator has been improved quite a bit. You should now be able to convert the python code to bython, and then use only braces for block definitions. That would be a much cleaner solution than allowing the mix (which in my opinion would be an inconsistent and bad language design)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants