dart-sass/lib/src/value.dart

32 lines
853 B
Dart
Raw Normal View History

2016-05-24 20:56:53 +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-25 05:01:43 +02:00
import 'value/boolean.dart';
2016-05-25 05:04:14 +02:00
import 'value/identifier.dart';
2016-05-28 01:09:03 +02:00
import 'visitor/value.dart';
2016-05-25 02:04:16 +02:00
2016-05-25 05:01:43 +02:00
export 'value/boolean.dart';
2016-05-25 01:04:59 +02:00
export 'value/identifier.dart';
export 'value/list.dart';
2016-05-25 06:50:44 +02:00
export 'value/number.dart';
2016-05-25 01:04:59 +02:00
export 'value/string.dart';
2016-05-25 05:01:43 +02:00
abstract class Value {
2016-06-03 22:36:20 +02:00
/// Whether the value will be represented in CSS as the empty string.
bool get isBlank => false;
2016-05-25 05:01:43 +02:00
const Value();
2016-05-28 01:09:03 +02:00
/*=T*/ accept/*<T>*/(ValueVisitor/*<T>*/ visitor);
2016-05-25 02:04:16 +02:00
// TODO: call the proper stringifying method
2016-05-25 05:04:14 +02:00
Value unaryPlus() => new Identifier("+$this");
2016-05-25 02:04:16 +02:00
2016-05-25 05:04:14 +02:00
Value unaryMinus() => new Identifier("-$this");
2016-05-25 02:04:16 +02:00
2016-05-25 05:04:14 +02:00
Value unaryDivide() => new Identifier("/$this");
2016-05-25 05:01:43 +02:00
Value unaryNot() => Boolean.sassFalse;
2016-05-25 02:04:16 +02:00
}