Conversation
Introduce two new helper functions for dealing with ucode values: - `ucv_is_strictly_equal(v1, v2, treat_nan_equal)` This function implements strict value comparison rules as defined for the `===`, `!==` and `in` operators. This is useful for code dealing with uc values outside of the VM execution context. - `ucv_contains(haystack, needle)` This function implements the semantics of the `in` operator, it checks whether a given array or object contains a given value or key string respectively. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Drop the VM specific implementation in favor to the generic types.c helper functions. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Factor out the core arithmetic operations from `vm.c`, move them into a separate `arith.c` compilation unit and expose two new helper functions `ucv_arith_unary()` and `ucv_arith_binary()` allowing the computation of numeric operations on ucode values outside of the VM context. This is intended for use-cases where evaluation of simple ucode expressions is required, e.g. within a debugger module or a code intelligence context within a language server. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Use the factored out `arith.c` routines to implement arithmetic operations for ucode values and remove the local implementations from the VM. As a result, the instruction handling is slightly simplified and the amount of code reduced. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit introduces a vscode extension for improved ucode support within the IDE. It features auto complete suggestions as well as semantic syntax highlighting, compile time error reporting and support for JSDoc type annotations in variable or function declarations. As part of the vscode extensions, a new ucode library "uscope" is introduced which provides facilities for static ucode source analysis, e.g. to determine the validity scope of variable declarations or to properly tokenize ucode sources. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a vscode extension for improved ucode support
within the IDE. It features auto complete suggestions as well as
semantic syntax highlighting, compile time error reporting and support
for JSDoc type annotations in variable or function declarations.
As part of the vscode extensions, a new ucode library "uscope" is
introduced which provides facilities for static ucode source analysis,
e.g. to determine the validity scope of variable declarations or to
properly tokenize ucode sources.
This is work in progress, as various kinks need to be sorted out still.