Fixing transpilation PascaLIGO to JsLIGO
Motivation and Context
Description
Feedback from Crunchy about the CST-to-CST transpilation from PascaLIGO to JsLIGO revealed a host of issues.
- The recent rewrite of the JsLIGO pretty-printer to preserve comments revealed hidden problems;
- The integration was badly done. The standalone binary
pascaligo/ParserMain.exe --jsligoshould behave exactly the same asligo transpile contractbut it does not. For example, the latter called the preprocessor, and not once, but twice (!). Also, some (or all?) self-passes on the lexical units or tokens are not performed and some comments are lost (at the start of the file). - There was a regression in a nanopass handling attributes (comment-attributes were missing).
Component
-
compiler -
website -
webide -
vscode-plugin -
debugger
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to not work as expected) -
Performance improvement (non-breaking change that improves performance) -
None (change with no changelog)
Changelog
Transpilation from PascaLIGO to JsLIGO was fixed. Pretty-printing of JsLIGO was fixed.
Checklist:
-
If a new syntax has been introduced, put a message on slack ligo-lsp -
Changes follow the existing coding style (use dune @fmtto check). -
Tests for the changes have been added (for bug fixes / feature). -
Documentation has been updated. -
Changelog description has been added (if appropriate). -
Start titles under ## Changelogsection with #### (if appropriate). -
There is no image or uploaded file in changelog -
Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by Ghost User