pike.git / src / language.yacc

version» Context lines:

pike.git/src/language.yacc:536:    {    /* This can be made more lenient in the future */       /* Ugly hack to make sure that $3 is optimized */    {    int tmp=Pike_compiler->compiler_pass;    $3=mknode(F_COMMA_EXPR,$3,0);    Pike_compiler->compiler_pass=tmp;    }    -  if (!TEST_COMPAT(7, 6) && (Pike_compiler->current_modifiers & ID_EXTERN)) { +  if (Pike_compiler->current_modifiers & ID_EXTERN) {    int depth = 0;    struct program_state *state = Pike_compiler;    node *n = $3;    while (((n->token == F_COMMA_EXPR) || (n->token == F_ARG_LIST)) &&    ((!CAR(n)) ^ (!CDR(n)))) {    if (CAR(n)) n = CAR(n);    else n = CDR(n);    }    if (n->token == F_EXTERNAL) {    while (state && (state->new_program->id != n->u.integer.a)) {
pike.git/src/language.yacc:564:    n->u.integer.b);    define_alias($1->u.sval.u.string, n->type,    Pike_compiler->current_modifiers & ~ID_EXTERN,    depth, id);    } else if (Pike_compiler->compiler_pass == 1) {    yyerror("Invalid extern declared constant.");    add_constant($1->u.sval.u.string, &svalue_undefined,    Pike_compiler->current_modifiers & ~ID_EXTERN);    }    } else { -  if (TEST_COMPAT(7, 6) && -  (Pike_compiler->current_modifiers & ID_EXTERN) && -  (Pike_compiler->compiler_pass == 1)) { -  yywarning("Extern declared constant."); -  } +     if(!is_const($3)) {    if (Pike_compiler->compiler_pass == 2) {    yyerror("Constant definition is not constant.");    }    add_constant($1->u.sval.u.string, 0,    Pike_compiler->current_modifiers & ~ID_EXTERN);    } else {    if(!Pike_compiler->num_parse_error)    {    ptrdiff_t tmp=eval_low($3,1);
pike.git/src/language.yacc:728:    TOK_IDENTIFIER push_compiler_frame0    '('    {    $<number>$ = 0;    /* Check for the (very special) case of create and create_args. */    if (Pike_compiler->num_create_args) {    struct pike_string *create_string = NULL;    int e;    MAKE_CONST_STRING(create_string, "create");    if ($6->u.sval.u.string == create_string) { -  if (TEST_COMPAT(7, 6)) { -  yywarning("Having both an implicit and an explicit create() " -  "was not supported in Pike 7.6 and before."); -  } +     /* Prepend the create arguments. */    if (Pike_compiler->num_create_args < 0) {    Pike_compiler->varargs = 1;    for (e = 0; e < -Pike_compiler->num_create_args; e++) {    struct identifier *id =    Pike_compiler->new_program->identifiers + e;    add_ref(id->type);    add_local_name(empty_pike_string, id->type, 0);    /* Note: add_local_name() above will return e. */    Pike_compiler->compiler_frame->variable[e].flags |=
pike.git/src/language.yacc:3526:    | expr4 open_paren_with_line_info error '}'    {    yyerror("Missing ')'.");    $$=mkapplynode($1, NULL);    free_node ($2);    }    ;      implicit_modifiers:    { -  if (TEST_COMPAT(7, 6)) { -  $$ = Pike_compiler->current_modifiers = -  (THIS_COMPILATION->lex.pragmas & ID_MODIFIER_MASK); -  } else { +     $$ = Pike_compiler->current_modifiers = ID_PROTECTED|ID_INLINE|ID_PRIVATE |    (THIS_COMPILATION->lex.pragmas & ID_MODIFIER_MASK);    } -  } +     ;      expr4: string    | TOK_NUMBER    | TOK_FLOAT { $$=mkfloatnode((FLOAT_TYPE)$1); }    | catch    | gauge    | typeof    | sscanf    | lambda