Beispiel #1
0
char *
parse_expression(char *s, struct lacy_env *env)
{
    int t = next_token(&s);
    switch (t) {
        case FOR:
            tree_push(FOR, NULL);
            s = parse_foreach(s, env);
            break;
        case DONE:
            tree_push(DONE, NULL);
            break;
        case INCLUDE:
            tree_push(INCLUDE, NULL);
            s = parse_include(s, env);
            break;
        default:
            fatal("excepted for\n");
    }
    t = next_token(&s);
    switch (t) {
        case EXP_END:
            break;
        default:
            fatal("excepted expression end\n");
    }
    return s;
}
Beispiel #2
0
static CMD_FUNC(cmd_part)
{
    struct part_desc desc;

    if (argc < 2)
        return 0;
    desc.user = GetUserH(origin);
    if (!desc.user)
        return 0;
    desc.text = (argc > 2) ? argv[argc - 1] : NULL;
    parse_foreach(argv[1], part_helper, NULL, NULL, NULL, &desc);
    return 1;
}