| Index: pkg/kernel/lib/text/ast_to_text.dart
|
| diff --git a/pkg/kernel/lib/text/ast_to_text.dart b/pkg/kernel/lib/text/ast_to_text.dart
|
| index 18be9de8860b332563538e31d135145a2867ce16..4991490f3f2888a82cf4e1cc4cce639b667e0dc2 100644
|
| --- a/pkg/kernel/lib/text/ast_to_text.dart
|
| +++ b/pkg/kernel/lib/text/ast_to_text.dart
|
| @@ -181,6 +181,7 @@ class Printer extends Visitor<Null> {
|
| int indentation = 0;
|
| int column = 0;
|
| bool showExternal;
|
| + bool showOffsets;
|
|
|
| static int SPACE = 0;
|
| static int WORD = 1;
|
| @@ -190,6 +191,7 @@ class Printer extends Visitor<Null> {
|
| Printer(this.sink,
|
| {NameSystem syntheticNames,
|
| this.showExternal,
|
| + this.showOffsets,
|
| this.importTable,
|
| this.annotator: const InferredValueAnnotator()})
|
| : this.syntheticNames = syntheticNames ?? new NameSystem();
|
| @@ -198,7 +200,8 @@ class Printer extends Visitor<Null> {
|
| : sink = parent.sink,
|
| syntheticNames = parent.syntheticNames,
|
| annotator = parent.annotator,
|
| - showExternal = parent.showExternal;
|
| + showExternal = parent.showExternal,
|
| + showOffsets = parent.showOffsets;
|
|
|
| String getLibraryName(Library node) {
|
| return node.name ?? syntheticNames.nameLibrary(node);
|
| @@ -393,6 +396,9 @@ class Printer extends Visitor<Null> {
|
| }
|
|
|
| void writeNode(Node node) {
|
| + if (showOffsets && node is TreeNode) {
|
| + writeWord("[${node.fileOffset}]");
|
| + }
|
| node.accept(this);
|
| }
|
|
|
| @@ -486,6 +492,7 @@ class Printer extends Visitor<Null> {
|
| if (function.asyncMarker != AsyncMarker.Sync) {
|
| writeSpaced(getAsyncMarkerKeyword(function.asyncMarker));
|
| }
|
| + if (!function.debuggable) writeSpaced("/* not debuggable */");
|
| if (function.body != null) {
|
| writeFunctionBody(function.body, terminateLine: terminateLine);
|
| } else if (terminateLine) {
|
| @@ -626,6 +633,7 @@ class Printer extends Visitor<Null> {
|
| }
|
|
|
| void writeExpression(Expression node, [int minimumPrecedence]) {
|
| + if (showOffsets) writeWord("[${node.fileOffset}]");
|
| bool needsParenteses = false;
|
| if (minimumPrecedence != null && getPrecedence(node) < minimumPrecedence) {
|
| needsParenteses = true;
|
| @@ -1287,6 +1295,7 @@ class Printer extends Visitor<Null> {
|
|
|
| void writeVariableDeclaration(VariableDeclaration node,
|
| {bool useVarKeyword: false}) {
|
| + if (showOffsets) writeWord("[${node.fileOffset}]");
|
| writeModifier(node.isFinal, 'final');
|
| writeModifier(node.isConst, 'const');
|
| if (node.type != null) {
|
|
|