Skip to content

Commit 24adf0e

Browse files
committed
Updated *Derived.java classes as generated by src/templates/gderived.py.
Fixes bug 2119.
1 parent 09d9612 commit 24adf0e

File tree

143 files changed

+2960
-1947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+2960
-1947
lines changed

src/org/python/antlr/ast/AssertDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/AssignDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/AttributeDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/AugAssignDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/BinOpDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/BoolOpDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/BreakDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/CallDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/ClassDefDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

src/org/python/antlr/ast/CompareDerived.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,18 @@ public PyObject __ne__(PyObject other) {
561561
return super.__ne__(other);
562562
}
563563

564+
public PyObject __format__(PyObject other) {
565+
PyType self_type=getType();
566+
PyObject impl=self_type.lookup("__format__");
567+
if (impl!=null) {
568+
PyObject res=impl.__get__(this,self_type).__call__(other);
569+
if (res==Py.NotImplemented)
570+
return null;
571+
return res;
572+
}
573+
return super.__format__(other);
574+
}
575+
564576
public PyObject __iadd__(PyObject other) {
565577
PyType self_type=getType();
566578
PyObject impl=self_type.lookup("__iadd__");

0 commit comments

Comments
 (0)