Open TharukaCkasthuri opened 1 month ago
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.
RecursionError: maximum recursion depth exceeded
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.
Basically, i think we shoudl just update the language grammar to support that optional trailing comma, may have to double check parser.py
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.The example code in python;
The code we are supposed to write in Jaclang;
it is good if the Trailing comma is made optional, similar to Python.