~ubuntu-branches/ubuntu/wily/geany/wily

« back to all changes in this revision

Viewing changes to tagmanager/js.c

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2011-12-10 07:43:26 UTC
  • mfrom: (3.3.7 sid)
  • Revision ID: package-import@ubuntu.com-20111210074326-s8yqbew5i20h33tf
Tags: 0.21-1ubuntu1
* Merge from Debian Unstable, remaining changes:
  - debian/patches/20_use_evince_viewer.patch:
     + use evince as viewer for pdf and dvi files
  - debian/patches/20_use_x_terminal_emulator.patch:
     + use x-terminal-emulator as terminal
  - debian/control
     + Add breaks on geany-plugins-common << 0.20
* Also fixes bugs:
  - Filter for MATLAB/Octave files filters everythign (LP: 885505)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *       $Id: js.c 3184 2008-11-07 14:37:17Z eht16 $
 
2
 *       $Id: js.c 5555 2011-03-05 22:40:50Z colombanw $
3
3
 *
4
4
 *       Copyright (c) 2003, Darren Hiebert
5
5
 *
21
21
#include "general.h"    /* must always come first */
22
22
#include <ctype.h>      /* to define isalpha () */
23
23
#include <setjmp.h>
 
24
#include <mio/mio.h>
24
25
#ifdef DEBUG
25
26
#include <stdio.h>
26
27
#endif
107
108
        vString *               string;
108
109
        vString *               scope;
109
110
        unsigned long   lineNumber;
110
 
        fpos_t                  filePosition;
 
111
        MIOPos                  filePosition;
111
112
        int                             nestLevel;
112
113
        boolean                 ignoreTag;
113
 
    int bufferPosition; /* buffer position of line containing name */
114
114
} tokenInfo;
115
115
 
116
116
/*
198
198
        token->nestLevel        = 0;
199
199
        token->ignoreTag        = FALSE;
200
200
        token->lineNumber   = getSourceLineNumber ();
201
 
    if (useFile())
202
 
                token->filePosition = getInputFilePosition ();
203
 
    else
204
 
                token->bufferPosition = getInputBufferPosition ();
 
201
        token->filePosition = getInputFilePosition ();
205
202
 
206
203
        return token;
207
204
}
357
354
        {
358
355
                c = fileGetc ();
359
356
                token->lineNumber   = getSourceLineNumber ();
360
 
                if (useFile())
361
 
                        token->filePosition = getInputFilePosition ();
362
 
                else
363
 
                        token->bufferPosition = getInputBufferPosition ();
364
 
                }
 
357
                token->filePosition = getInputFilePosition ();
 
358
        }
365
359
        while (c == '\t'  ||  c == ' ' ||  c == '\n');
366
360
 
367
361
        switch (c)
384
378
                                  token->type = TOKEN_STRING;
385
379
                                  parseString (token->string, c);
386
380
                                  token->lineNumber = getSourceLineNumber ();
387
 
                                  if (useFile())
388
 
                                        token->filePosition = getInputFilePosition ();
389
 
                                  else
390
 
                                        token->bufferPosition = getInputBufferPosition ();
 
381
                                  token->filePosition = getInputFilePosition ();
391
382
                                  break;
392
383
 
393
384
                case '\\':
396
387
                                          fileUngetc (c);
397
388
                                  token->type = TOKEN_CHARACTER;
398
389
                                  token->lineNumber = getSourceLineNumber ();
399
 
                                  if (useFile())
400
 
                                        token->filePosition = getInputFilePosition ();
401
 
                                  else
402
 
                                        token->bufferPosition = getInputBufferPosition ();
 
390
                                  token->filePosition = getInputFilePosition ();
403
391
                                  break;
404
392
 
405
393
                case '/':
442
430
                                  {
443
431
                                          parseIdentifier (token->string, c);
444
432
                                          token->lineNumber = getSourceLineNumber ();
445
 
                                          if (useFile())
446
 
                                                token->filePosition = getInputFilePosition ();
447
 
                                          else
448
 
                                                token->bufferPosition = getInputBufferPosition ();
 
433
                                          token->filePosition = getInputFilePosition ();
449
434
                                          token->keyword = analyzeToken (token->string);
450
435
                                          if (isKeyword (token, KEYWORD_NONE))
451
436
                                                  token->type = TOKEN_IDENTIFIER;
460
445
{
461
446
        dest->nestLevel = src->nestLevel;
462
447
        dest->lineNumber = src->lineNumber;
463
 
    if (useFile())
464
 
                dest->filePosition = src->filePosition;
465
 
    else
466
 
                dest->bufferPosition = src->bufferPosition;
 
448
        dest->filePosition = src->filePosition;
467
449
        dest->type = src->type;
468
450
        dest->keyword = src->keyword;
469
451
        vStringCopy(dest->string, src->string);