Branch: Tag:

2003-08-22

2003-08-22 14:26:26 by Martin Nilsson <mani@lysator.liu.se>

Don't pretend return is a function.

Rev: lib/modules/Graphics.pmod/Graph.pmod/polyline.pike:1.5
Rev: lib/modules/Parser.pmod/LR.pmod/GrammarParser.pmod:1.5
Rev: lib/modules/Parser.pmod/LR.pmod/lr.pike:1.5
Rev: lib/modules/Parser.pmod/LR.pmod/module.pmod:1.11
Rev: lib/modules/Protocols.pmod/DNS.pmod:1.80
Rev: lib/modules/SSL.pmod/sslfile.pike:1.56
Rev: lib/modules/Sql.pmod/mysql.pike:1.18
Rev: lib/modules/Sql.pmod/sql_result.pike:1.12
Rev: lib/modules/Sql.pmod/sql_util.pmod:1.12
Rev: lib/modules/Stdio.pmod/module.pmod:1.181

1:   /* -  * $Id: module.pmod,v 1.10 2002/06/14 14:32:04 nilsson Exp $ +  * $Id: module.pmod,v 1.11 2003/08/22 14:25:57 nilsson Exp $    *    * A BNF-grammar in Pike.    * Compiles to a LALR(1) state-machine.
431:       report(NOTICE, "goto_set", "=> (< %s >)",    map(indices(set), symbol_to_string) * ", "); -  return (set); +  return set;    }       //! Generates the state reached when doing goto on the specified symbol.
621:    }    res += ({ "\n" });    } -  return (res * ""); +  return res * "";    }       string cast_to_string()
635:    //! Type to cast to.    mixed cast(string type)    { -  if (type == "string") { -  return(_sprintf()); +  if (type == "string") +  return _sprintf(); +  error("Cast to %s not supported\n", type);    } -  throw(({ sprintf("Cast to %s not supported\n", type), backtrace() })); -  } +        /* Here come the functions that actually do some work */   
1017:    master->relation[current_item] = 1;    }    } -  return(nullable[i->r->symbols[i->offset]]); +  return nullable[i->r->symbols[i->offset]]; +  } else +  return 0; /* Not nullable */    } else { -  return (0); /* Not nullable */ -  } -  } else { +     /* At end of rule */    master->relation[current_item] = 1; -  return (1); /* Always nullable */ +  return 1; /* Always nullable */    }    }   
1283:    "on symbols (< %s >)",    state_to_string(state),    map(indices(conflict_set), symbol_to_string) * ", "); -  return (ERROR_CONFLICTS); +  return ERROR_CONFLICTS;    } else {    report(WARNING, "repair",    "All conflicts removed!"); -  return (0); +  return 0;    }    }   
1555:    report(NOTICE, "compile", "DONE\n");   #endif /* LR_PROFILE */    -  return (lr_error); +  return lr_error;    }       //! Parse the input according to the compiled grammar.
1593:    !(objectp(scanner) && functionp(scanner->`()))) {    report(ERROR, "parse", "parser->parse(): scanner not set!\n");    lr_error = ERROR_NO_SCANNER; -  return(0); +  return 0;    }       while (1) {
1677:    if (input == "") {    /* Only the final state is allowed to shift on ""(EOF) */    /* ACCEPT */ -  return(value_stack->pop()); +  return value_stack->pop();    }    /* SHIFT */    report(NOTICE, "parse",
1699:    continue;    } else {    report(ERROR, "parse", "Empty stack at EOF!"); -  return (0); +  return 0;    }    } else {    report(ERROR, "parse", "Bad state at EOF"); -  return(value_stack->pop()); +  return value_stack->pop();    }    } else {    lr_error |= ERROR_SYNTAX;