SCompilationUnit class
A complete Dart compilation unit (file)
Constructors
-
SCompilationUnit({required int offset, required int length, String? scriptTag, List<
SDirective> directives = const [], List<SDeclaration> declarations = const [], List<SComment> comments = const [], bool hasParseErrors = false}) -
SCompilationUnit.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
comments
→ List<
SComment> -
Comments in the file
final
-
declarations
→ List<
SDeclaration> -
Declarations (classes, functions, variables, etc.)
final
-
directives
→ List<
SDirective> -
Directives (imports, exports, parts, library)
final
- end → int
-
Get the end offset
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasParseErrors → bool
-
Whether the source had parse errors (e.g., from error recovery).
Used by eval() to distinguish valid declarations from error recovery artifacts.
final
- length → int
-
Length of the source text
final
- nodeType → String
-
Unique node type identifier for serialization
no setteroverride
- offset → int
-
Source offset of the node
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scriptTag → String?
-
Script tag (e.g., #!/usr/bin/env dart)
final
Methods
-
accept<
T> (SAstVisitor< T> visitor) → T? -
Accept a visitor and return the result.
override
-
equals(
Object other, [List< String> ? log]) → bool -
Compares this node with
other. Iflogis provided, differences are appended in a human-readable format with JSON-style paths.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Convert to JSON-serializable map
override
-
toJsonString(
{bool pretty = false}) → String -
Serialize to JSON string
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
visitChildren(
SAstVisitor visitor) → void -
Visit all child nodes of this node.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited