Skip to content

Commit

Permalink
compilation should fail when name gets redefined in the same scope of…
Browse files Browse the repository at this point in the history
… do/let
  • Loading branch information
mo-xiaoming committed Sep 5, 2022
1 parent 02eae25 commit 9e0cfd0
Show file tree
Hide file tree
Showing 5 changed files with 929 additions and 869 deletions.
6 changes: 4 additions & 2 deletions include/hobbes/read/pgen/hexpr.parse.H
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 3.7.6. */
/* A Bison parser, made by GNU Bison 3.8.2. */

/* Bison interface for Yacc-like parsers in C
Expand Down Expand Up @@ -156,7 +156,7 @@ extern int yydebug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 295 "hexpr.y"
#line 319 "hexpr.y"

hobbes::Module* module;
hobbes::ModuleDefs* mdefs;
Expand Down Expand Up @@ -242,6 +242,8 @@ struct YYLTYPE

extern YYSTYPE yylval;
extern YYLTYPE yylloc;

int yyparse (void);


#endif /* !YY_YY_HEXPR_PARSE_H_INCLUDED */
22 changes: 11 additions & 11 deletions lib/hobbes/read/pgen/hexpr.lex.C
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#line 1 "hexpr.lex.C"
#line 2 "hexpr.lex.C"

#line 3 "hexpr.lex.C"
#line 4 "hexpr.lex.C"

#define YY_INT_ALIGNED short int

Expand Down Expand Up @@ -789,9 +789,9 @@ std::string* identifier(const char* b, const char* e) {
return hobbes::autorelease(new std::string(b, e));
}
}
#line 792 "hexpr.lex.C"
#line 793 "hexpr.lex.C"

#line 794 "hexpr.lex.C"
#line 795 "hexpr.lex.C"

#define INITIAL 0
#define BLOCK_COMMENT 1
Expand Down Expand Up @@ -990,11 +990,11 @@ YY_DECL
YY_USER_INIT;
#endif

/* Create the reject buffer large enough to save one state per allowed character. */
if ( ! (yy_state_buf) )
(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE );
if ( ! (yy_state_buf) )
YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
/* Create the reject buffer large enough to save one state per allowed character. */
if ( ! (yy_state_buf) )
(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE );
if ( ! (yy_state_buf) )
YY_FATAL_ERROR( "out of dynamic memory in yylex()" );

if ( ! (yy_start) )
(yy_start) = 1; /* first start state */
Expand Down Expand Up @@ -1028,7 +1028,7 @@ YY_DECL
}


#line 1031 "hexpr.lex.C"
#line 1032 "hexpr.lex.C"

while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
Expand Down Expand Up @@ -1730,7 +1730,7 @@ YY_RULE_SETUP
#line 214 "hexpr.l"
ECHO;
YY_BREAK
#line 1733 "hexpr.lex.C"
#line 1734 "hexpr.lex.C"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(BLOCK_COMMENT):
yyterminate();
Expand Down
Loading

0 comments on commit 9e0cfd0

Please sign in to comment.