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

Analyzer: Determine number of statements #94

Open
KieranKaelin opened this issue Jun 12, 2023 · 0 comments
Open

Analyzer: Determine number of statements #94

KieranKaelin opened this issue Jun 12, 2023 · 0 comments
Labels
analyzer Analyzing of PL/SQL code enhancement New feature or request wasm WASM interface changes

Comments

@KieranKaelin
Copy link
Contributor

Goal

Given a function, procedure or trigger, the analyzer should determine the number of statements.

Notes

  • Nested statements should also be counted
  • Expressions in the control flow should also be counted as their own statements (since they may pose a significant migration effort)

Example

CREATE PROCEDURE showcase
    IS
DECLARE
    formatted_output VARCHAR2(100);
BEGIN
    SELECT 'name: ' || dummy || ', last login: '  INTO formatted_output FROM DUAL;

    IF (formatted_output != '') THEN
        DBMS_OUTPUT.PUT_LINE(formatted_output);
    ELSIF TRUE != FALSE THEN
        NULL;
    ELSE
        NULL;
    END IF;
END;

Number of statements: 6

  • 1 for the first SELECT INTO
  • 2 for the expressions in the IF construct ((formatted_output != "") and TRUE != FALSE)
  • 3 for all nested statements inside the IF branches

How to demo

Rust and TS tests demonstrate the new analyzer statistics.

@KieranKaelin KieranKaelin added enhancement New feature or request analyzer Analyzing of PL/SQL code wasm WASM interface changes labels Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer Analyzing of PL/SQL code enhancement New feature or request wasm WASM interface changes
Projects
None yet
Development

No branches or pull requests

1 participant