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

Comments in middle of parethesed code raising errors (jupyterlab - coconut kernel). #851

Closed
vanheck opened this issue Aug 20, 2024 · 1 comment

Comments

@vanheck
Copy link

vanheck commented Aug 20, 2024

I run jupyterlab coconut kernel, and get error if I comment any code in parentheses.

Example 1:

data = [
    "hey",
    # "there", # dont want this value now
    "is comment"
]

raises:

CoconutSyntaxError: unclosed open '[' (line 1)
  data = [    "hey",  # "there",    "is comment"]
         ^
  File <string>:1
SyntaxError: unclosed open '['
  data = [    "hey",  # "there",    "is comment"]

Example 2 - comment function call parameters:

def foo(x, y=1):
    return x + y

foo(
    x=1,
    y=2, # any description - e.g. why this value is 2
)

raises:

CoconutSyntaxError: unclosed open '(' (line 3)
  foo(    x=1,    y=2,  # any description - e.g. why this value is 2)
     ^
  File <string>:3
SyntaxError: unclosed open '('
  foo(    x=1,    y=2,  # any description - e.g. why this value is 2)
@vanheck vanheck changed the title Comments in middle of parethesed code raising errors (jupyterlab). Comments in middle of parethesed code raising errors (jupyterlab - coconut kernel). Aug 20, 2024
@evhub evhub added the bug label Aug 21, 2024
@evhub evhub added this to the v3.1.2 milestone Aug 21, 2024
evhub added a commit that referenced this issue Aug 21, 2024
@evhub evhub added the resolved label Aug 21, 2024
@evhub
Copy link
Owner

evhub commented Aug 21, 2024

Thanks for the report—should be fixed as of coconut-develop>=3.1.1-post_dev4 (pip install -U coconut-develop>=3.1.1-post_dev4).

@evhub evhub closed this as completed Aug 21, 2024
@evhub evhub mentioned this issue Sep 1, 2024
evhub added a commit that referenced this issue Sep 1, 2024
See Coconut's
[documentation](http://coconut.readthedocs.io/en/develop/DOCS.html) for
more information on all of the features listed below.

Bugfixes:
* #851, #852: Fixed comments inside of parentheses in the Jupyter
kernel.

Language features:
* #846: `reduce`, `takewhile`, and `dropwhile` now support keyword
arguments.
* #848: Class and data patterns now support keyword argument name
elision.
* #847: New pattern-matching syntax for matching anonymous named tuples.

Compiler features:
* #843: Added compiler warnings for (some cases of) undefined variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants