Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Trailing comma isn't supported in Jaclang #613

Open
TharukaCkasthuri opened this issue Sep 9, 2024 · 1 comment
Open

Trailing comma isn't supported in Jaclang #613

TharukaCkasthuri opened this issue Sep 9, 2024 · 1 comment

Comments

@TharukaCkasthuri
Copy link
Collaborator

The Trailing comma isn't supported in Jaclang, and in some cases, when we mistakenly add a trailing comma, it throws a recursion error (RecursionError: maximum recursion depth exceeded) as in the screenshot.
Screenshot 2024-09-09 at 16 05 11

The example code in python;

ft.Column(
                spacing=25,
                controls=[
                    self.filter,
                    self.tasks,
                    ft.Row(
                        alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
                        vertical_alignment=ft.CrossAxisAlignment.CENTER,
                        controls=[
                            self.items_left,
                            ft.OutlinedButton(
                                text="Clear completed", on_click=self.clear_clicked
                            ),
                        ],
                    ),
                ],
            )

The code we are supposed to write in Jaclang;

   ft.Column(
               spacing=25,
               controls=[
                   self.filter,
                   self.tasks,
                   ft.Row(
                       alignment=ft.MainAxisAlignment.SPACE_BETWEEN,
                       vertical_alignment=ft.CrossAxisAlignment.CENTER,
                       controls=[
                           self.items_left,
                           ft.OutlinedButton(
                               text="Clear completed", on_click=self.clear_clicked
                           )
                       ]
                   )
               ]
           );

it is good if the Trailing comma is made optional, similar to Python.

@TharukaCkasthuri TharukaCkasthuri changed the title [Bug] Trailing comma isn't supported in Jaclang Sep 9, 2024
@marsninja
Copy link
Contributor

Basically, i think we shoudl just update the language grammar to support that optional trailing comma, may have to double check parser.py

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

No branches or pull requests

2 participants