dart-sass/lib/src/utils.dart

24 lines
622 B
Dart
Raw Normal View History

2016-05-24 03:01:15 +02:00
// Copyright 2016 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
2016-05-24 23:01:41 +02:00
import 'dart:collection';
2016-05-24 03:01:15 +02:00
import 'package:source_span/source_span.dart';
import 'ast/node.dart';
SourceSpan spanForList(List<AstNode> nodes) {
if (nodes.isEmpty) return null;
var first = nodes.first.span;
var last = nodes.last.span;
return first is FileSpan && last is FileSpan ? first.expand(last) : null;
}
2016-05-24 23:01:41 +02:00
class LinkedListValue<T> extends LinkedListEntry<LinkedListValue<T>> {
final T value;
LinkedListValue(this.value);
}