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

Declaration of invalid collections #305

Open
GreasySlug opened this issue Dec 20, 2022 · 0 comments
Open

Declaration of invalid collections #305

GreasySlug opened this issue Dec 20, 2022 · 0 comments
Labels

Comments

@GreasySlug
Copy link
Member

GreasySlug commented Dec 20, 2022

Describe the bug?

The following collections allow elements to be declared by using whitespace
Different error occurs instead of error due to delimitation

  • array
  • tuple
  • dict
  • set
  • record

But these are syntax error

Reproducible code

[1 2 3]
(1 2 3)
{"a": 1 "b": 2 "c": 3}
{1 2 3}
{name = "John" age = 21}

Expected result

syntax error
needs comma or semicolon

Actual result

Error[#0000]: File <stdin>, line 1, 

1 | [1 2 3]
  :       -

SyntaxError: invalid syntax

>>> (1 2 3)
Error[#0000]: File <stdin>, line 1, 

1 | (1 2 3)
  :       -

SyntaxError: invalid syntax

>>> {"a": 1 "b": 2}
Error[#3374]: File <stdin>, line 1, 

1 | {"a": 1 "b": 2}
  :              -

SyntaxError: invalid syntax

Error[#0000]: File <stdin>, line 1, 

1 | {"a": 1 "b": 2}
  :               -

SyntaxError: invalid syntax

>>> {name = "John" age = 21}
Record(name='John', age=21)

Additional context

When I look at how it is parsed using cargo dprs, we see that each syntax is parsed differently, and a patch is needed for each of them.

Erg version

Erg 0.6.0-beta.3

Python version

python3.10.8

OS

Windows 10

@GreasySlug GreasySlug added bug Something isn't working seems-hard labels Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants