The parser doesn't need its own implementation of assert, and having its · pythoncapi/cpython@1ca1296 · GitHub
Skip to content

Commit 1ca1296

Browse files
committed
The parser doesn't need its own implementation of assert, and having its
own interfered with including Python.h. Remove Python's assert.h.
1 parent db5a93c commit 1ca1296

8 files changed

Lines changed: 18 additions & 38 deletions

File tree

Makefile.pre.in

Lines changed: 0 additions & 1 deletion

PC/os2vacpp/makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ md5module.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\clas
792792
$(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
793793
$(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
794794

795-
mpzmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_PARSER)\assert.h $(PY_INCLUDE)\ceval.h \
795+
mpzmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
796796
$(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
797797
pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
798798
$(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
@@ -972,7 +972,7 @@ regexmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
972972
$(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
973973
$(PY_INCLUDE)\tupleobject.h
974974

975-
regexpr.obj: $(PY_INCLUDE)\abstract.h $(PY_PARSER)\assert.h $(PY_INCLUDE)\ceval.h \
975+
regexpr.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
976976
$(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
977977
pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
978978
$(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
@@ -1415,7 +1415,7 @@ listobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\cla
14151415
$(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
14161416
$(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
14171417

1418-
longobject.obj: $(PY_INCLUDE)\abstract.h $(PY_PARSER)\assert.h $(PY_INCLUDE)\ceval.h \
1418+
longobject.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
14191419
$(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
14201420
pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
14211421
$(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
@@ -1565,11 +1565,11 @@ firstsets.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
15651565
$(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\pgenheaders.h \
15661566
$(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
15671567

1568-
grammar.obj: $(PY_PARSER)\assert.h $(PY_INCLUDE)\bitset.h pyconfig.h \
1568+
grammar.obj: $(PY_INCLUDE)\bitset.h pyconfig.h \
15691569
$(PY_INCLUDE)\grammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
15701570
$(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
15711571

1572-
grammar1.obj: $(PY_PARSER)\assert.h $(PY_INCLUDE)\bitset.h pyconfig.h \
1572+
grammar1.obj: $(PY_INCLUDE)\bitset.h pyconfig.h \
15731573
$(PY_INCLUDE)\grammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
15741574
$(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
15751575

@@ -1590,7 +1590,7 @@ myreadline.obj: pyconfig.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\mymalloc.h \
15901590
node.obj: pyconfig.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\node.h \
15911591
$(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h
15921592

1593-
parser.obj: $(PY_PARSER)\assert.h $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\errcode.h \
1593+
parser.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\errcode.h \
15941594
$(PY_INCLUDE)\grammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
15951595
$(PY_INCLUDE)\node.h $(PY_PARSER)\parser.h $(PY_INCLUDE)\pgenheaders.h \
15961596
$(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h
@@ -1601,7 +1601,7 @@ parsetok.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\errcode.h \
16011601
$(PY_INCLUDE)\pgenheaders.h $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h \
16021602
$(PY_PARSER)\tokenizer.h
16031603

1604-
pgen.obj: $(PY_PARSER)\assert.h $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
1604+
pgen.obj: $(PY_INCLUDE)\bitset.h pyconfig.h $(PY_INCLUDE)\grammar.h \
16051605
$(PY_INCLUDE)\metagrammar.h $(PY_INCLUDE)\mymalloc.h $(PY_INCLUDE)\myproto.h \
16061606
$(PY_INCLUDE)\node.h $(PY_PARSER)\pgen.h $(PY_INCLUDE)\pgenheaders.h \
16071607
$(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\token.h

PC/os2vacpp/makefile.omk

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ md5module.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
611611
pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
612612
traceback.h tupleobject.h
613613

614-
mpzmodule.obj: abstract.h assert.h ceval.h classobject.h cobject.h \
614+
mpzmodule.obj: abstract.h ceval.h classobject.h cobject.h \
615615
complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
616616
funcobject.h import.h intobject.h intrcheck.h listobject.h \
617617
longintrepr.h longobject.h methodobject.h modsupport.h \
@@ -716,7 +716,7 @@ regexmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
716716
pythonrun.h rangeobject.h regexpr.h sliceobject.h stringobject.h \
717717
sysmodule.h traceback.h tupleobject.h
718718

719-
regexpr.obj: abstract.h assert.h ceval.h classobject.h cobject.h \
719+
regexpr.obj: abstract.h ceval.h classobject.h cobject.h \
720720
complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
721721
funcobject.h import.h intobject.h intrcheck.h listobject.h \
722722
longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
@@ -987,7 +987,7 @@ listobject.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
987987
pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
988988
traceback.h tupleobject.h
989989

990-
longobject.obj: abstract.h assert.h ceval.h classobject.h cobject.h \
990+
longobject.obj: abstract.h ceval.h classobject.h cobject.h \
991991
complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
992992
funcobject.h import.h intobject.h intrcheck.h listobject.h \
993993
longintrepr.h longobject.h methodobject.h modsupport.h \
@@ -1076,10 +1076,10 @@ bitset.obj: bitset.h pyconfig.h mymalloc.h myproto.h pgenheaders.h pydebug.h
10761076
firstsets.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
10771077
pgenheaders.h pydebug.h token.h
10781078

1079-
grammar.obj: assert.h bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
1079+
grammar.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
10801080
pgenheaders.h pydebug.h token.h
10811081

1082-
grammar1.obj: assert.h bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
1082+
grammar1.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h \
10831083
pgenheaders.h pydebug.h token.h
10841084

10851085
intrcheck.obj: pyconfig.h intrcheck.h mymalloc.h myproto.h
@@ -1094,14 +1094,14 @@ myreadline.obj: pyconfig.h intrcheck.h mymalloc.h myproto.h
10941094

10951095
node.obj: pyconfig.h mymalloc.h myproto.h node.h pgenheaders.h pydebug.h
10961096

1097-
parser.obj: assert.h bitset.h pyconfig.h errcode.h grammar.h mymalloc.h \
1097+
parser.obj: bitset.h pyconfig.h errcode.h grammar.h mymalloc.h \
10981098
myproto.h node.h parser.h pgenheaders.h pydebug.h token.h
10991099

11001100
parsetok.obj: bitset.h pyconfig.h errcode.h grammar.h mymalloc.h myproto.h \
11011101
node.h parser.h parsetok.h pgenheaders.h pydebug.h token.h \
11021102
tokenizer.h
11031103

1104-
pgen.obj: assert.h bitset.h pyconfig.h grammar.h metagrammar.h mymalloc.h \
1104+
pgen.obj: bitset.h pyconfig.h grammar.h metagrammar.h mymalloc.h \
11051105
myproto.h node.h pgen.h pgenheaders.h pydebug.h token.h
11061106

11071107
pgenmain.obj: bitset.h pyconfig.h grammar.h mymalloc.h myproto.h node.h \

Parser/assert.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

Parser/grammar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11

22
/* Grammar implementation */
33

4+
#include "Python.h"
45
#include "pgenheaders.h"
56

67
#include <ctype.h>
78

8-
#include "assert.h"
99
#include "token.h"
1010
#include "grammar.h"
1111

Parser/grammar1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
/* Grammar subroutines needed by parser */
33

4+
#include "Python.h"
45
#include "pgenheaders.h"
5-
#include "assert.h"
66
#include "grammar.h"
77
#include "token.h"
88

Parser/parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
/* XXX To do: error recovery */
77

8+
#include "Python.h"
89
#include "pgenheaders.h"
9-
#include "assert.h"
1010
#include "token.h"
1111
#include "grammar.h"
1212
#include "node.h"

Parser/pgen.c

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)