Fix warnings.
Some dead code, missing returns, and an unused private field.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 15e2911..8567408 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.13.2+2
+
+* Fix static warnings.
+
## 0.13.2+1
* Fix new strong mode error.
diff --git a/lib/parser.dart b/lib/parser.dart
index 3a48929..d1a5af1 100644
--- a/lib/parser.dart
+++ b/lib/parser.dart
@@ -158,8 +158,9 @@
final _Parser _parser;
// TODO(jmesserly): having file and text is redundant.
+ // TODO(rnystrom): baseUrl isn't used. Remove from API.
Parser(SourceFile file, String text, {int start: 0, String baseUrl})
- : _parser = new _Parser(file, text, start: start, baseUrl: baseUrl);
+ : _parser = new _Parser(file, text, start: start);
StyleSheet parse() => _parser.parse();
}
@@ -168,9 +169,6 @@
class _Parser {
final Tokenizer tokenizer;
- /** Base url of CSS file. */
- final String _baseUrl;
-
/**
* File containing the source being parsed, used to report errors with
* source-span locations.
@@ -180,9 +178,8 @@
Token _previousToken;
Token _peekToken;
- _Parser(SourceFile file, String text, {int start: 0, String baseUrl})
+ _Parser(SourceFile file, String text, {int start: 0})
: this.file = file,
- _baseUrl = baseUrl,
tokenizer = new Tokenizer(file, text, true, start) {
_peekToken = tokenizer.next();
}
@@ -1203,7 +1200,7 @@
var start = _peekToken.span;
while (true) {
// First item is never descendant make sure it's COMBINATOR_NONE.
- var selectorItem = simpleSelectorSequence(simpleSequences.length == 0);
+ var selectorItem = simpleSelectorSequence(simpleSequences.isEmpty);
if (selectorItem != null) {
simpleSequences.add(selectorItem);
} else {
@@ -1211,9 +1208,9 @@
}
}
- if (simpleSequences.length > 0) {
- return new Selector(simpleSequences, _makeSpan(start));
- }
+ if (simpleSequences.isEmpty) return null;
+
+ return new Selector(simpleSequences, _makeSpan(start));
}
simpleSelectorSequence(bool forceCombinatorNone) {
@@ -2509,7 +2506,6 @@
//
processFunction(Identifier func) {
var start = _peekToken.span;
-
var name = func.name;
switch (name) {
@@ -2517,7 +2513,7 @@
// URI term sucks up everything inside of quotes(' or ") or between parens
var urlParam = processQuotedString(true);
- // TODO(terry): Better error messge and checking for mismatched quotes.
+ // TODO(terry): Better error message and checking for mismatched quotes.
if (_peek() == TokenKind.END_OF_FILE) {
_error("problem parsing URI", _peekToken.span);
}
@@ -2558,8 +2554,6 @@
return new FunctionTerm(name, name, expr, _makeSpan(start));
}
-
- return null;
}
Identifier identifier() {
diff --git a/lib/src/tokenizer.dart b/lib/src/tokenizer.dart
index bc00fee..a972590 100644
--- a/lib/src/tokenizer.dart
+++ b/lib/src/tokenizer.dart
@@ -414,7 +414,6 @@
}
}
}
- return _errorToken();
}
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 3b13c66..422849e 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: csslib
-version: 0.13.2+1
+version: 0.13.2+2
author: Dart Team <misc@dartlang.org>
description: A library for parsing CSS.
homepage: https://github.com/dart-lang/csslib