Skip to content

Fixing transpilation PascaLIGO to JsLIGO

Christian Rinderknecht requested to merge rinderknecht@fix_transpilation into dev

Motivation and Context


Feedback from Crunchy about the CST-to-CST transpilation from PascaLIGO to JsLIGO revealed a host of issues.

  1. The recent rewrite of the JsLIGO pretty-printer to preserve comments revealed hidden problems;
  2. The integration was badly done. The standalone binary pascaligo/ParserMain.exe --jsligo should behave exactly the same as ligo transpile contract but 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).
  3. There was a regression in a nanopass handling attributes (comment-attributes were missing).


  • 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)


Transpilation from PascaLIGO to JsLIGO was fixed. Pretty-printing of JsLIGO was fixed.


  • If a new syntax has been introduced, put a message on slack ligo-lsp
  • Changes follow the existing coding style (use dune @fmt to 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 ## Changelog section 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 Christian Rinderknecht

Merge request reports