SnippetDartdocParser class
Parses CodeSamples from the source file given to one of the parsing routines.
-
parseFromDartdocToolFile parses the output of the dartdoc
@tool
directive, which contains the dartdoc comment lines (with comment markers stripped) contained between the tool markers. -
parseAndAddAssumptions parses the assumptions in the "Examples can assume:" block at the top of the file and adds them to the code samples contained in the given SourceElement iterable.
Constructors
- SnippetDartdocParser(FileSystem filesystem)
Properties
- filesystem → FileSystem
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseAndAddAssumptions(
Iterable< SourceElement> elements, File assumptionsFile, {bool silent = true}) → void -
Parses the assumptions in the "Examples can assume:" block at the top of
the
assumptionsFile
and adds them to the code samples contained in the givenelements
iterable. -
parseAssumptions(
File file) → List< SourceLine> -
This parses the assumptions in the "Examples can assume:" block from the
given
file
. -
parseComment(
SourceElement element) → void -
This parses the documentation comment on a single SourceElement and
assigns the resulting samples to the
samples
member of the givenelement
. -
parseFromComments(
Iterable< SourceElement> elements, {bool silent = true}) → void -
This parses the code snippets from the documentation comments in the given
elements
, and sets the resulting samples as thesamples
member of each element in the supplied iterable. -
parseFromDartdocToolFile(
File input, {int? startLine, String? element, required File sourceFile, String template = '', String type = '', bool silent = true}) → SourceElement -
Parses a file containing the output of the dartdoc
@tool
directive, which contains the dartdoc comment lines (with comment markers stripped) between the tool markers. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited