parseFileSync function
Parses the contents of the given file following the Gura configuration format, synchronously.
Can be given an optional Map<String, String>
env
named argument containing
key/value pairs to inject into the parser's environment variable snapshot
for use within the file to be parsed.
Returns a Map<String, dynamic>
containing all key/value pairs from the parsed
Gura input.
Example:
File guraFile = File("foo_bar.ura");
Map<String, dynamic> gura = parseFileSync(guraFile, env: { 'foo': 'bar' });
Note: If a key in the given env
Map already exists in the parser's env
snapshot, it will be overwritten with the given Map's key/value
Implementation
Map<String, dynamic> parseFileSync(File guraFile, {Map<String, String>? env}) =>
parse(guraFile.readAsStringSync(), env: env);