~ubuntu-branches/ubuntu/precise/gle-graphics/precise

« back to all changes in this revision

Viewing changes to src/gle/pass.cpp

  • Committer: Package Import Robot
  • Author(s): Christian T. Steigies
  • Date: 2011-10-20 22:15:27 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111020221527-sv27lrowdd221npi
Tags: 4.2.3b-1
* new upstream version
* switch from cdbs to debhelper 8
* update copyright file
* do no rely on proc on non-linux systems (closes: #644588)
* do not ship glebtool, which is a helper used only during build
* add libqt4-opengl-dev to build-depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
        multi->setEndToken(';');
249
249
        multi->setEndToken(',');
250
250
        multi->setEndToken(')');
 
251
   multi->setEndToken(']');
251
252
        lang->setMulti(multi);
252
253
}
253
254
 
289
290
        return x;
290
291
}
291
292
 
 
293
void GLEParser::evalTokenToString(string* str) throw(ParserError) {
 
294
        GLEPcodeList pc_list;
 
295
        GLEPcode pcode(&pc_list);
 
296
        Tokenizer* tokens = getTokens();
 
297
        string& expr = tokens->next_multilevel_token();
 
298
        int pos = tokens->token_pos_col();
 
299
        try {
 
300
                m_polish->internalEvalString(expr.c_str(), str);
 
301
        } catch (ParserError err) {
 
302
                err.incColumn(pos-1);
 
303
                throw err;
 
304
        }
 
305
}
 
306
 
 
307
void GLEParser::evalTokenToFileName(string* str) throw(ParserError) {
 
308
        Tokenizer* tokens = getTokens();
 
309
   const string& token = tokens->next_continuous_string_excluding("\"$+");
 
310
   if (token != "") {
 
311
      *str = token;
 
312
   } else {
 
313
      evalTokenToString(str);
 
314
   }
 
315
}
 
316
 
292
317
void GLEParser::polish(GLEPcode& pcode, int *rtype) throw(ParserError) {
293
318
        Tokenizer* tokens = getTokens();
294
319
        string& expr = tokens->next_multilevel_token();
2320
2345
        }
2321
2346
}
2322
2347
 
2323
 
int pass_marker(char *s) throw(ParserError) {
2324
 
        int i;
2325
 
        int f=0;
 
2348
int pass_marker(char *name) throw(ParserError) {
 
2349
        int f = 0;
 
2350
        string marker;
 
2351
        polish_eval_string(name, &marker);
2326
2352
        /* if 0, maybe its a user defined marker, ie a subroutine */
2327
2353
        /* Use -ve to signify subroutine instead of normal marker */
2328
 
        for (i=0; i<nmark; i++) {
2329
 
                if (str_i_equals(mark_name[i],s)) {
 
2354
        for (int i = 0; i < nmark; i++) {
 
2355
                if (str_i_equals(mark_name[i], marker.c_str())) {
2330
2356
                        f = -(++i);
2331
2357
                        break;
2332
2358
                }
2333
2359
        }
2334
 
        if (f==0)  {
2335
 
                for (i=nmrk-1; i>=0; i--) {
2336
 
                        if (str_i_equals(mrk_name[i],s)) {
 
2360
        if (f == 0)  {
 
2361
                for (int i = nmrk-1; i >= 0; i--) {
 
2362
                        if (str_i_equals(mrk_name[i], marker.c_str())) {
2337
2363
                                f = ++i;
2338
2364
                                break;
2339
2365
                        }
2340
2366
                }
2341
2367
        }
2342
2368
        if (f == 0) {
2343
 
                g_throw_parser_error("invalid marker name '", s, "'");
 
2369
                g_throw_parser_error("invalid marker name '", marker.c_str(), "'");
2344
2370
        }
2345
2371
        return f;
2346
2372
}