Reference.from constructor

Reference.from(
  1. String input
)

Creates a Reference instance from a String input. The input string must start with a single character as specified via referencePrefix.

Implementation

factory Reference.from(String input) {
  final paths = input.substring(1).split(' ');

  final script = paths.first;
  final extra = paths.sublist(1).join(' ');

  return Reference(
    script: script.split(referenceNestingDelimiter).join(' '),
    extra: extra,
  );
}