Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for closure record parameters/variables #198

Open
devhawk opened this issue Jul 3, 2023 · 0 comments
Open

Add support for closure record parameters/variables #198

devhawk opened this issue Jul 3, 2023 · 0 comments

Comments

@devhawk
Copy link
Contributor

devhawk commented Jul 3, 2023

In the TS compiler, closure variables/parameters can live inside a NeoVM array. In order to display them correctly in the debugger, the TS compiler is adopting a dotted index syntax to provide enough details to the debugger. This change will be documented in NEP-19 when it has been implemented / tested in both the TS compiler and debugger.

A DebugInfo Variable has three fields: name, type and index. Index is an optional field - if not specified, the index of the variable instance inside the containing array is used as the index. current, Index is a numeric field indicating the index of the collection in question (parameters, variables, staticVariables) is associated with the specified name/type.

With this change, the index field will support a dotted syntax such as 0.1. The values before and after the dot MUST be integers. The value before the dot represents the index into the specified collection, similar to how the index is specified today. The value after the dot represents the index into the array at the location specified by the first dot. If the value in the specified collection is not an array, the debugger will fail to resolve the variable.

Note, this scheme is potentially extensible to support nested collections (i.e. 0.1.2) and maps (i.e. 0.somekey). It is not expected this will be needed for the TS compiler, so we are constraining the design to a single numeric value after the dot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant