Description:
A SyntaxError (unexpected OEF while parsing) is generated when creating a dictionary with a line break after the opening brace:

The syntax is valid, but Hydrogen will only execute the code properly if all the lines are selected first:

Steps to Reproduce:
Hydrogen:run.Versions:
Atom : 1.16.0
Electron: 1.3.13
Chrome : 52.0.2743.82
Node : 6.5.0
We rely on Atom's language-python package to determine code blocks depending on the code folding.
Unfortunately this needs to be fixed in the language-python package because Hydrogen is language agnostic. It would be great if you would open a issue there.
Interesting. I'll open an issue at language-python and MagicPython.
Thank you @lgeiger.
I'm a MagicPython developer. Could you be more specific in whether there's a particular scope that's missing or something like that, please?
I can reproduce this in an otherwise empty file, so I guess it's in the global scope.
@lgeiger could you please give a little more detail on what information Hydrogen is relying on when determining code block boundaries? Is there some specific name that is given to the code block by the language parser that should be there?
@vpetrovykh
To get code block boundaries in a language-portable way, hydrogen relies on Atom's code folding.
So for example here is some code:

And here is the same code after running the "Editor: Fold All" command

Hydrogen considers the block to range from the start of the current line to the end of the folded section, which misses the closing } delimiter.
Also if as a MagicPython developer you know a more targeted way of getting block information that is commonly supported by Atom grammars, please let us know.
@lgeiger considering that Atom seems to have an known issue with code folding (e.g. https://github.com/atom/first-mate/issues/48 and https://github.com/atom/atom/issues/1183) would it be viable for Hydrogen to try and check for some special syntax scope (e.g. meta.foldable... or maybe rely on some existing meta... scopes) and if present use it to fold the all contents marked by that scope? In case the scope is not present you could fall back on generic code-folding.
@vpetrovykh That's a good idea! We're very happy to accept a PR for this.
There's actually a setting named foldEndPattern that fixes this from the grammar side. Creating PRs for both language-python and MagicPython now.