scilla icon indicating copy to clipboard operation
scilla copied to clipboard

Code formatting tool

Open as1ndu opened this issue 5 years ago • 3 comments

I have attempted to impliment a rudimentary code formatting tool for Scilla. However, due to the changing Scilla syntax & my limited knowledge on compiler design, It doesnt work as well.

It would be nice if code formatting could be done with "out of the box" tooling simmilar to how Golang & Rust do it. It would simply consume the unformatted Scilla string & output formatted Scilla code. This would make it easier to integrate in code editors.

This feature requires an AST to be implimented. However, it would also be great for someone to be able to view a raw (json based) AST as it can have several usecases.

as1ndu avatar Feb 27 '20 22:02 as1ndu

Looks like at least part of this issue is being handled by PR https://github.com/Zilliqa/scilla/pull/696

anton-trunov avatar Feb 29 '20 12:02 anton-trunov

Interesting @anton-trunov, thanks for letting me know.

as1ndu avatar Feb 29 '20 23:02 as1ndu

A note for the future code formatter implementation: there should be an option to strip comments and whitespace (see #485).

anton-trunov avatar Jun 17 '22 18:06 anton-trunov