YamlScalar.wrap constructor

YamlScalar.wrap(
  1. dynamic value, {
  2. dynamic sourceUrl,
  3. ScalarStyle style = ScalarStyle.ANY,
})

Wraps a Dart value in a YamlScalar.

This scalar's span won't have useful location information. However, it will have a reasonable implementation of SourceSpan.message. If sourceUrl is passed, it's used as the SourceSpan.sourceUrl.

sourceUrl may be either a String, a Uri, or null.

Implementation

YamlScalar.wrap(this.value, {sourceUrl, this.style = ScalarStyle.ANY})
    : super._(NullSpan(sourceUrl)) {
  ArgumentError.checkNotNull(style, 'style');
}