Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:typed_data'; | 5 import 'dart:typed_data'; |
| 6 | 6 |
| 7 import 'package:front_end/src/base/api_signature.dart'; | 7 import 'package:front_end/src/base/api_signature.dart'; |
| 8 import 'package:front_end/src/fasta/parser.dart' | 8 import 'package:front_end/src/fasta/parser.dart' |
| 9 show Listener, Parser, optional; | 9 show Listener, Parser, optional; |
| 10 import 'package:front_end/src/fasta/parser/top_level_parser.dart'; | 10 import 'package:front_end/src/fasta/parser/top_level_parser.dart'; |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 bool hasMixin = false; | 107 bool hasMixin = false; |
| 108 final List<_BodyRange> bodyRanges = []; | 108 final List<_BodyRange> bodyRanges = []; |
| 109 | 109 |
| 110 _BodySkippingParser() : super(new Listener()); | 110 _BodySkippingParser() : super(new Listener()); |
| 111 | 111 |
| 112 @override | 112 @override |
| 113 Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) { | 113 Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) { |
| 114 if (identical('{', token.lexeme)) { | 114 if (identical('{', token.lexeme)) { |
| 115 Token close = skipBlock(token); | 115 Token close = skipBlock(token); |
| 116 bodyRanges.add(new _BodyRange(token.charOffset, close.charOffset)); | 116 bodyRanges.add(new _BodyRange(token.charOffset, close.charOffset)); |
| 117 return close; | 117 return isExpression ? close.next : close; |
|
scheglov
2017/08/08 01:42:27
I don't understand this change.
How could it be an
ahe
2017/08/08 08:13:30
[isExpression] is true if the function is in expre
scheglov
2017/08/08 15:54:57
Now I understand.
Thank you.
ahe
2017/08/08 16:03:33
Great. Would it have been less confusing initially
scheglov
2017/08/08 16:06:03
Even better would be "ofFunctionExpression", becau
| |
| 118 } | 118 } |
| 119 return super.parseFunctionBody(token, isExpression, allowAbstract); | 119 return super.parseFunctionBody(token, isExpression, allowAbstract); |
| 120 } | 120 } |
| 121 | 121 |
| 122 Token parseMixinApplicationRest(Token token) { | 122 Token parseMixinApplicationRest(Token token) { |
| 123 hasMixin = true; | 123 hasMixin = true; |
| 124 return super.parseMixinApplicationRest(token); | 124 return super.parseMixinApplicationRest(token); |
| 125 } | 125 } |
| 126 } | 126 } |
| OLD | NEW |