webassemblyjs icon indicating copy to clipboard operation
webassemblyjs copied to clipboard

refactor index

Open xtuc opened this issue 7 years ago • 1 comments

Attempt to fix https://github.com/xtuc/webassemblyjs/issues/405

The idea is to transform our Index that has either Identifier or NumerLiteral to a structure that contains both (the Identifier is optional tho).

Notes:

  • The naming is awful (indexOfIndex), any idea?
  • The tests are massively failing

xtuc avatar Jul 07 '18 11:07 xtuc

For the naming, it might be worth using the terminology from the specification:

image

They refer to identifiers as being either numeric or symbolic.

This suggests to me something like the following:

{
   type: "identifier",
   symbolic: "log",
   numeric: 23
}

Or the more verbose:

{
   type: "identifier",
   symbolicIdentifier: "log",
   numericIdentifier: 23
}

ColinEberhardt avatar Jul 07 '18 13:07 ColinEberhardt