~ubuntu-branches/ubuntu/raring/geany/raring-proposed

« back to all changes in this revision

Viewing changes to tagmanager/python.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: python.c 5224 2010-09-13 15:03:18Z ntrel $
 
2
*   $Id: python.c 5851 2011-06-15 21:01:23Z eht16 $
3
3
*
4
4
*   Copyright (c) 2000-2003, Darren Hiebert
5
5
*
195
195
/* Skip everything up to an identifier start. */
196
196
static const char *skipEverything (const char *cp)
197
197
{
 
198
        int match;
198
199
        for (; *cp; cp++)
199
200
        {
 
201
                match = 0;
200
202
                if (*cp == '"' || *cp == '\'' || *cp == '#')
 
203
                        match = 1;
 
204
 
 
205
                /* these checks find unicode, binary (Python 3) and raw strings */
 
206
                if (!match && (
 
207
                        !strncasecmp(cp, "u'", 2) || !strncasecmp(cp, "u\"", 2) ||
 
208
                        !strncasecmp(cp, "r'", 2) || !strncasecmp(cp, "r\"", 2) ||
 
209
                        !strncasecmp(cp, "b'", 2) || !strncasecmp(cp, "b\"", 2)))
 
210
                {
 
211
                        match = 1;
 
212
                        cp += 1;
 
213
                }
 
214
                if (!match && (
 
215
                        !strncasecmp(cp, "ur'", 3) || !strncasecmp(cp, "ur\"", 3) ||
 
216
                        !strncasecmp(cp, "br'", 3) || !strncasecmp(cp, "br\"", 3)))
 
217
                {
 
218
                        match = 1;
 
219
                        cp += 2;
 
220
                }
 
221
                if (match)
201
222
                {
202
223
                        cp = skipString(cp);
203
224
                        if (!*cp) break;
457
478
 
458
479
        for (; *cp; cp++)
459
480
        {
 
481
                if (*cp == '#')
 
482
                        break;
 
483
 
460
484
                if (*cp == '"' || *cp == '\'')
461
485
                {
462
486
                        if (strncmp(cp, doubletriple, 3) == 0)
653
677
                indent = cp - line;
654
678
                line_skip = 0;
655
679
 
656
 
                checkParent(nesting_levels, indent, parent);
657
 
 
658
680
                /* Deal with multiline string ending. */
659
681
                if (longStringLiteral)
660
682
                {
661
683
                        find_triple_end(cp, &longStringLiteral);
662
684
                        continue;
663
685
                }
 
686
                
 
687
                checkParent(nesting_levels, indent, parent);
664
688
 
665
689
                /* Deal with multiline string start. */
666
690
                longstring = find_triple_start(cp, &longStringLiteral);