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

Unified Diff: sdk/lib/_internal/dartdoc/lib/src/markdown/ast.dart

Issue 140303009: Remove dartdoc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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
Index: sdk/lib/_internal/dartdoc/lib/src/markdown/ast.dart
===================================================================
--- sdk/lib/_internal/dartdoc/lib/src/markdown/ast.dart (revision 32349)
+++ sdk/lib/_internal/dartdoc/lib/src/markdown/ast.dart (working copy)
@@ -1,65 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of markdown;
-
-/// Base class for any AST item. Roughly corresponds to Node in the DOM. Will
-/// be either an Element or Text.
-abstract class Node {
- void accept(NodeVisitor visitor);
-}
-
-/// A named tag that can contain other nodes.
-class Element implements Node {
- final String tag;
- final List<Node> children;
- final Map<String, String> attributes;
-
- Element(this.tag, this.children)
- : attributes = <String, String>{};
-
- Element.empty(this.tag)
- : children = null,
- attributes = <String, String>{};
-
- Element.withTag(this.tag)
- : children = [],
- attributes = <String, String>{};
-
- Element.text(this.tag, String text)
- : children = [new Text(text)],
- attributes = <String, String>{};
-
- bool get isEmpty => children == null;
-
- void accept(NodeVisitor visitor) {
- if (visitor.visitElementBefore(this)) {
- for (final child in children) child.accept(visitor);
- visitor.visitElementAfter(this);
- }
- }
-}
-
-/// A plain text element.
-class Text implements Node {
- final String text;
- Text(this.text);
-
- void accept(NodeVisitor visitor) => visitor.visitText(this);
-}
-
-/// Visitor pattern for the AST. Renderers or other AST transformers should
-/// implement this.
-abstract class NodeVisitor {
- /// Called when a Text node has been reached.
- void visitText(Text text);
-
- /// Called when an Element has been reached, before its children have been
- /// visited. Return `false` to skip its children.
- bool visitElementBefore(Element element);
-
- /// Called when an Element has been reached, after its children have been
- /// visited. Will not be called if [visitElementBefore] returns `false`.
- void visitElementAfter(Element element);
-}
« no previous file with comments | « sdk/lib/_internal/dartdoc/lib/src/json_serializer.dart ('k') | sdk/lib/_internal/dartdoc/lib/src/markdown/block_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698