TerosTechnology / vscode-terosHDL

VHDL and Verilog/SV IDE: state machine viewer, linter, documentation, snippets... and more!
https://terostechnology.github.io/terosHDLdoc/
GNU General Public License v3.0
542 stars 45 forks source link

Fix parser tests #623

Closed gmartina closed 3 months ago

gmartina commented 3 months ago

Parser tests ported from deprecated test_imprfolder.

Test Check input multiple reg array 1 fails: packages/colibri/tests/parser/parser_verilog_entity.spec.ts

Port j is not properly parsed: input reg [7:0] i, j,

I believe the bug could potentially be in here: packages/colibri/src/parser/ts_verilog/utils.ts

export function search_multiple_in_tree(element: any, matching_title: string) {
    const arr_match: any[] = [];
    function recursive_searchTree(element: any, matching_title: string): any {
        const type = element.type;
        if (type === matching_title) {
            arr_match.push(element);
        } else if (element !== undefined) {
            let result = undefined;
            for (let i = 0; result === undefined && i < element.childCount; i++) {
                result = recursive_searchTree(element.child(i), matching_title);
            }
            return result;
        }
        return undefined;
    }
    recursive_searchTree(element, matching_title);
    return arr_match;
}

@qarlosalberto Could you advise me on this?

qarlosalberto commented 3 months ago

I remember that fail. For now we can skip that test. Not sure if it's possible to fix it with our tree-sitter version.

gmartina commented 3 months ago

I remember that fail. For now we can skip that test. Not sure if it's possible to fix it with our tree-sitter version.

Skipped. PR ready for review.

qarlosalberto commented 3 months ago

Thanks for that!