Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Unified Diff: pkg/dartdoc/block_parser.dart

Issue 10919146: Get rid of a lot of () for getters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/dartdoc/ast.dart ('k') | pkg/dartdoc/dartdoc.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dartdoc/block_parser.dart
diff --git a/pkg/dartdoc/block_parser.dart b/pkg/dartdoc/block_parser.dart
index e356fe8b4234eabd86e955f5f7d4e5d271127e9e..f53c1068ff6f207a9de9c181795678b00c23d63c 100644
--- a/pkg/dartdoc/block_parser.dart
+++ b/pkg/dartdoc/block_parser.dart
@@ -52,10 +52,10 @@ class BlockParser {
: pos = 0;
/// Gets the current line.
- String get current() => lines[pos];
+ String get current => lines[pos];
/// Gets the line after the current one or `null` if there is none.
- String get next() {
+ String get next {
// Don't read past the end.
if (pos >= lines.length - 1) return null;
return lines[pos + 1];
@@ -65,7 +65,7 @@ class BlockParser {
pos++;
}
- bool get isDone() => pos >= lines.length;
+ bool get isDone => pos >= lines.length;
/// Gets whether or not the current line matches the given pattern.
bool matches(RegExp regex) {
@@ -83,7 +83,7 @@ class BlockParser {
class BlockSyntax {
/// Gets the collection of built-in block parsers. To turn a series of lines
/// into blocks, each of these will be tried in turn. Order matters here.
- static List<BlockSyntax> get syntaxes() {
+ static List<BlockSyntax> get syntaxes {
// Lazy initialize.
if (_syntaxes == null) {
_syntaxes = [
@@ -106,9 +106,9 @@ class BlockSyntax {
static List<BlockSyntax> _syntaxes;
/// Gets the regex used to identify the beginning of this block, if any.
- RegExp get pattern() => null;
+ RegExp get pattern => null;
- bool get canEndBlock() => true;
+ bool get canEndBlock => true;
bool canParse(BlockParser parser) {
return pattern.firstMatch(parser.current) != null;
@@ -138,7 +138,7 @@ class BlockSyntax {
}
class EmptyBlockSyntax extends BlockSyntax {
- RegExp get pattern() => _RE_EMPTY;
+ RegExp get pattern => _RE_EMPTY;
Node parse(BlockParser parser) {
parser.advance();
@@ -170,7 +170,7 @@ class SetextHeaderSyntax extends BlockSyntax {
/// Parses atx-style headers: `## Header ##`.
class HeaderSyntax extends BlockSyntax {
- RegExp get pattern() => _RE_HEADER;
+ RegExp get pattern => _RE_HEADER;
Node parse(BlockParser parser) {
final match = pattern.firstMatch(parser.current);
@@ -183,7 +183,7 @@ class HeaderSyntax extends BlockSyntax {
/// Parses email-style blockquotes: `> quote`.
class BlockquoteSyntax extends BlockSyntax {
- RegExp get pattern() => _RE_BLOCKQUOTE;
+ RegExp get pattern => _RE_BLOCKQUOTE;
Node parse(BlockParser parser) {
final childLines = parseChildLines(parser);
@@ -197,7 +197,7 @@ class BlockquoteSyntax extends BlockSyntax {
/// Parses preformatted code blocks that are indented four spaces.
class CodeBlockSyntax extends BlockSyntax {
- RegExp get pattern() => _RE_INDENT;
+ RegExp get pattern => _RE_INDENT;
Node parse(BlockParser parser) {
final childLines = parseChildLines(parser);
@@ -214,7 +214,7 @@ class CodeBlockSyntax extends BlockSyntax {
/// Parses horizontal rules like `---`, `_ _ _`, `* * *`, etc.
class HorizontalRuleSyntax extends BlockSyntax {
- RegExp get pattern() => _RE_HR;
+ RegExp get pattern => _RE_HR;
Node parse(BlockParser parser) {
final match = pattern.firstMatch(parser.current);
@@ -234,9 +234,9 @@ class HorizontalRuleSyntax extends BlockSyntax {
/// 3. Absolutely no HTML parsing or validation is done. We're a markdown
/// parser not an HTML parser!
class BlockHtmlSyntax extends BlockSyntax {
- RegExp get pattern() => _RE_HTML;
+ RegExp get pattern => _RE_HTML;
- bool get canEndBlock() => false;
+ bool get canEndBlock => false;
Node parse(BlockParser parser) {
final childLines = [];
@@ -260,9 +260,9 @@ class ListItem {
/// Base class for both ordered and unordered lists.
class ListSyntax extends BlockSyntax {
- bool get canEndBlock() => false;
+ bool get canEndBlock => false;
- abstract String get listTag();
+ abstract String get listTag;
Node parse(BlockParser parser) {
final items = <ListItem>[];
@@ -404,19 +404,19 @@ class ListSyntax extends BlockSyntax {
/// Parses unordered lists.
class UnorderedListSyntax extends ListSyntax {
- RegExp get pattern() => _RE_UL;
- String get listTag() => 'ul';
+ RegExp get pattern => _RE_UL;
+ String get listTag => 'ul';
}
/// Parses ordered lists.
class OrderedListSyntax extends ListSyntax {
- RegExp get pattern() => _RE_OL;
- String get listTag() => 'ol';
+ RegExp get pattern => _RE_OL;
+ String get listTag => 'ol';
}
/// Parses paragraphs of regular text.
class ParagraphSyntax extends BlockSyntax {
- bool get canEndBlock() => false;
+ bool get canEndBlock => false;
bool canParse(BlockParser parser) => true;
« no previous file with comments | « pkg/dartdoc/ast.dart ('k') | pkg/dartdoc/dartdoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698