MCPcopy Create free account
hub / github.com/HarmonicLabs/pebble / parseFile

Function parseFile

packages/pebble/src/parser/parseFile.ts:16–31  ·  view source on GitHub ↗
(
    path: string,
    src: string,
    getUid: () => string = defaultSymbolForge.getUid.bind( defaultSymbolForge ),
    isEntry: boolean = false
)

Source from the content-addressed store, hash-verified

14}
15
16export function parseFile(
17 path: string,
18 src: string,
19 getUid: () => string = defaultSymbolForge.getUid.bind( defaultSymbolForge ),
20 isEntry: boolean = false
21): Source
22{
23 const [ source, diagnostics ] = Parser.parseFile( path, src, getUid, isEntry );
24 if( diagnostics.length > 0 )
25 {
26 throw new Error(
27 `Parsing errors:\n${ diagnostics.map( d => d.toString() ).join( "\n" ) }`
28 );
29 }
30 return source;
31}
32
33export function parseSource( src: Source )
34{

Callers 4

testParseFunction · 0.90
parse.main.test.tsFile · 0.90
testParseFunction · 0.90
testParseFailureFunction · 0.90

Calls 3

parseFileMethod · 0.80
joinMethod · 0.80
toStringMethod · 0.65

Tested by 3

testParseFunction · 0.72
testParseFunction · 0.72
testParseFailureFunction · 0.72