27
27
import java .io .IOException ;
28
28
import java .util .ArrayList ;
29
29
30
- @ ExposedType (name = "_ast.Ellipsis" , base = slice .class )
31
- public class Ellipsis extends slice {
30
+ @ ExposedType (name = "_ast.Ellipsis" , base = expr .class )
31
+ public class Ellipsis extends expr {
32
32
public static final PyType TYPE = PyType .fromClass (Ellipsis .class );
33
33
34
34
private final static PyString [] fields = new PyString [0 ];
35
35
@ ExposedGet (name = "_fields" )
36
36
public PyString [] get_fields () { return fields ; }
37
37
38
- private final static PyString [] attributes = new PyString [0 ];
38
+ private final static PyString [] attributes =
39
+ new PyString [] {new PyString ("lineno" ), new PyString ("col_offset" )};
39
40
@ ExposedGet (name = "_attributes" )
40
41
public PyString [] get_attributes () { return attributes ; }
41
42
@@ -46,7 +47,17 @@ public Ellipsis(PyType subType) {
46
47
@ ExposedMethod
47
48
public void Ellipsis___init__ (PyObject [] args , String [] keywords ) {
48
49
ArgParser ap = new ArgParser ("Ellipsis" , args , keywords , new String []
49
- {}, 0 , true );
50
+ {"lineno" , "col_offset" }, 0 , true );
51
+ int lin = ap .getInt (0 , -1 );
52
+ if (lin != -1 ) {
53
+ setLineno (lin );
54
+ }
55
+
56
+ int col = ap .getInt (1 , -1 );
57
+ if (col != -1 ) {
58
+ setLineno (col );
59
+ }
60
+
50
61
}
51
62
52
63
public Ellipsis () {
@@ -101,4 +112,32 @@ private void ensureDict() {
101
112
}
102
113
}
103
114
115
+ private int lineno = -1 ;
116
+ @ ExposedGet (name = "lineno" )
117
+ public int getLineno () {
118
+ if (lineno != -1 ) {
119
+ return lineno ;
120
+ }
121
+ return getLine ();
122
+ }
123
+
124
+ @ ExposedSet (name = "lineno" )
125
+ public void setLineno (int num ) {
126
+ lineno = num ;
127
+ }
128
+
129
+ private int col_offset = -1 ;
130
+ @ ExposedGet (name = "col_offset" )
131
+ public int getCol_offset () {
132
+ if (col_offset != -1 ) {
133
+ return col_offset ;
134
+ }
135
+ return getCharPositionInLine ();
136
+ }
137
+
138
+ @ ExposedSet (name = "col_offset" )
139
+ public void setCol_offset (int num ) {
140
+ col_offset = num ;
141
+ }
142
+
104
143
}
0 commit comments