Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: pkg/fletchc/lib/src/find_position_visitor.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/fletchc/lib/src/enqueuer_mixin.dart ('k') | pkg/fletchc/lib/src/fletch_backend.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
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.md file.
4
5 import 'package:compiler/src/elements/visitor.dart';
6 import 'package:compiler/src/parser/partial_elements.dart';
7 import 'package:compiler/src/elements/elements.dart';
8 import 'package:compiler/src/elements/modelx.dart';
9
10 class FindPositionVisitor extends BaseElementVisitor {
11 final int position;
12 Element element;
13
14 FindPositionVisitor(this.position, this.element);
15
16 visit(Element e, [arg]) => e.accept(this, arg);
17
18 visitElement(ElementX e, _) {
19 DeclarationSite site = e.declarationSite;
20 if (site is PartialElement) {
21 if (site.beginToken.charOffset <= position &&
22 position < site.endToken.next.charOffset) {
23 element = e;
24 }
25 }
26 }
27
28 visitClassElement(ClassElement e, _) {
29 if (e is PartialClassElement) {
30 if (e.beginToken.charOffset <= position &&
31 position < e.endToken.next.charOffset) {
32 element = e;
33 visitScopeContainerElement(e, null);
34 }
35 }
36 }
37
38 visitScopeContainerElement(ScopeContainerElement e, _) {
39 e.forEachLocalMember((Element element) => visit(element));
40 }
41
42 visitCompilationUnitElement(CompilationUnitElement e, _) {
43 e.forEachLocalMember((Element element) => visit(element));
44 }
45 }
OLDNEW
« no previous file with comments | « pkg/fletchc/lib/src/enqueuer_mixin.dart ('k') | pkg/fletchc/lib/src/fletch_backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698