compilationUnitFor abstract method
Returns a parsed AST structor representing the file defined in assetId.
- If the
assetIdhas syntax errors, andallowSyntaxErrorsis set tofalse(the default), throws a SyntaxErrorInAssetException.
This is a much cheaper api compared to libraryFor, because it will only parse a single file and does not give you a resolved element model.
Implementation
Future<CompilationUnit> compilationUnitFor(AssetId assetId,
{bool allowSyntaxErrors = false});