13514
|
1 /*
|
|
2 * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. This
|
|
3 * code is released under a tri EPL/GPL/LGPL license. You can use it,
|
|
4 * redistribute it and/or modify it under the terms of the:
|
|
5 *
|
|
6 * Eclipse Public License version 1.0
|
|
7 * GNU General Public License version 2
|
|
8 * GNU Lesser General Public License version 2.1
|
|
9 */
|
|
10 package com.oracle.truffle.ruby.nodes;
|
|
11
|
|
12 import com.oracle.truffle.api.*;
|
|
13
|
|
14 /**
|
|
15 * Singleton source section used for core method nodes.
|
|
16 */
|
|
17 public final class CoreSourceSection implements SourceSection {
|
|
18
|
|
19 private final String name;
|
|
20
|
|
21 public CoreSourceSection(String name) {
|
|
22 this.name = name;
|
|
23 }
|
|
24
|
|
25 public Source getSource() {
|
|
26 return new CoreSource(name);
|
|
27 }
|
|
28
|
|
29 public int getStartLine() {
|
|
30 return 0;
|
|
31 }
|
|
32
|
|
33 public int getStartColumn() {
|
|
34 return 0;
|
|
35 }
|
|
36
|
|
37 public int getCharIndex() {
|
|
38 return 0;
|
|
39 }
|
|
40
|
|
41 @Override
|
|
42 public int getCharLength() {
|
|
43 return 0;
|
|
44 }
|
|
45
|
|
46 public int getCharEndIndex() {
|
|
47 return 0;
|
|
48 }
|
|
49
|
|
50 public String getIdentifier() {
|
|
51 return null;
|
|
52 }
|
|
53
|
|
54 public String getCode() {
|
|
55 return name;
|
|
56 }
|
|
57
|
|
58 @Override
|
|
59 public String toString() {
|
|
60 return name;
|
|
61 }
|
|
62
|
|
63 }
|