lib/llvm-ast.js
// Link the AST lines with spans of source locations (lines+columns)
Link the AST lines with spans of source locations (lines+columns)
Link the AST lines with spans of source locations ( lines + columns )
parseAndSetSourceLines(astDump) {
        let lfrom = {line: null, loc: null},
            lto = {line: null, loc: null};
        for (const line of astDump) {
            const span = this.parseSpan(line.text, lfrom.line);
            switch (span.type) {
                case this.locTypes.NONE:
                    break;
                case this.locTypes.POINT:
                    lfrom = span.loc;
                    lto = span.loc;
                    break;
                case this.locTypes.SPAN:
                    lfrom = span.begin;
                    lto = span.end;
                    break;
            }
            if (span.type !== this.locTypes.NONE) {
                line.source = {from: lfrom, to: lto};
            }
        }
    }
parseAndSetSourceLines ( astDump ) { let lfrom = { line : null , loc : null } , lto = { line : null , loc : null } ; for ( const line of astDump ) { const span = this . parseSpan ( line . text , lfrom . line ) ; switch ( span . type ) { case this . locTypes . NONE : break ; case this . locTypes . POINT : lfrom = span . loc ; lto = span . loc ; break ; case this . locTypes . SPAN : lfrom = span . begin ; lto = span . end ; break ; } if ( span . type !== this . locTypes . NONE ) { line . source = { from : lfrom , to : lto } ; } } }
Link the AST lines with spans of source locations (lines+columns)
Link the AST lines with spans of source locations ( lines + columns )