es-meta / esmeta

ECMAScript Specification (ECMA-262) Metalanguage
BSD 3-Clause "New" or "Revised" License
175 stars 12 forks source link

Extract tymodel to json #180

Closed doehyunbaek closed 10 months ago

doehyunbaek commented 11 months ago

Currently has two problems.

  1. TyModel is not version dendent.

Currently, TyModel is hardcode into TyModel.scala and is being used globally.

Usages of global TyModel is as follows:

  1. Hack in NameTy

This is also related to hack in NameTy, as there are circular dependencies between NameTy functions and TyModel, before you just hardcoded TyModel and as it was provided from the start it did not cause problem. Now, as TyModel itself should also be parsed out of json and NameTy functions are invoked when parsing, it causes problem.

It seems that to resolve above two problems, you should make above three usage sites not to use global TyModel but version-dependent TyModel as parameter, currently working on this solution.

doehyunbaek commented 11 months ago

I tried to solve the first problem with https://github.com/es-meta/esmeta/pull/180/commits/7ccad177a77bb5e2ef23f254068886b4dff07a36

doehyunbaek commented 11 months ago

Currently checking e2e test failing.

doehyunbaek commented 11 months ago

a8d0643 fixes the e2e test.

jhnaldo commented 10 months ago

I merged this PR after refactoring the code. Thanks! Because of the dependency issue, I dropped the feature for version-dependent support of the type model. This PR only supports the JSON-based management of the type model.