perl11 / cperl

A perl5 with classes, types, compilable, company friendly, security
http://perl11.org/
Other
142 stars 17 forks source link

improve regen_perly #47

Closed rurban closed 9 years ago

rurban commented 9 years ago

use better bison error and debugging reporting facilities. do not throw away the useful perlytmp.output and tmp files when regenerating.

    Reducing stack by rule 19 (line 218), stmtseq fullstmt -> stmtseq
    Entering state 103

=> Entering state 103 stmtseq

bulk88 commented 9 years ago

commit f2d0ac81390504bc0b0676067a6e1ded8d2b9922 "perly: improve regen_perly" breaks win32 build

        cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONS
OLE -DNO_STRICT -DPERLDLL -DPERL_CORE   -O1 -MD -Zi -DNDEBUG -GL -DPERL_EXTERNAL
_GLOB -DPERL_IS_MINIPERL -Fo.\mini\pad.obj ..\pad.c
pad.c
        cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONS
OLE -DNO_STRICT -DPERLDLL -DPERL_CORE   -O1 -MD -Zi -DNDEBUG -GL -DPERL_EXTERNAL
_GLOB -DPERL_IS_MINIPERL -Fo.\mini\perl.obj ..\perl.c
perl.c
perl.c(2321) : error C2065: 'GRAMPROG' : undeclared identifier
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
rurban commented 9 years ago

Thanks. Thats what those duplicate defines were for On Sep 19, 2015 4:47 PM, "bulk88" notifications@github.com wrote:

commit f2d0ac8 https://github.com/perl11/cperl/commit/f2d0ac81390504bc0b0676067a6e1ded8d2b9922 "perly: improve regen_perly" breaks win32 build

    cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONS

OLE -DNO_STRICT -DPERLDLL -DPERL_CORE -O1 -MD -Zi -DNDEBUG -GL -DPERL_EXTERNAL _GLOB -DPERL_IS_MINIPERL -Fo.\mini\pad.obj ..\pad.c pad.c cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONS OLE -DNO_STRICT -DPERLDLL -DPERL_CORE -O1 -MD -Zi -DNDEBUG -GL -DPERL_EXTERNAL _GLOB -DPERL_IS_MINIPERL -Fo.\mini\perl.obj ..\perl.c perl.c perl.c(2321) : error C2065: 'GRAMPROG' : undeclared identifier NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop.

— Reply to this email directly or view it on GitHub https://github.com/perl11/cperl/issues/47#issuecomment-141709968.

rurban commented 9 years ago

I see why: perly.h contains the enum yytokentype { GRAMPROG = 258, ..} but this is left out on win32 because of a conflict with WORD in perl.h

/* Win32 defines a type 'WORD' in windef.h. This conflicts with the enumerator
 * 'WORD' defined in perly.h. The yytokentype enum is only a debugging aid, so
 * it's not really needed.
 */
#if defined(WIN32)
#  define YYTOKENTYPE
#endif

Furthermore the comment is wrong. I do not like having the tokentypes being declared twice. Once as define and once again as enum. It is a debugging aid, and it is needed for perl.c

Ok, I'll bite the bullet here, as I don't want to rename WORD in the parser and lexer. cpan Keyword::Simple users (PL_keyword_plugin) would need a change then, if they use the WORD token.