~ubuntu-branches/ubuntu/natty/geany/natty

« back to all changes in this revision

Viewing changes to tagmanager/get.c

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2011-01-08 17:29:46 UTC
  • mfrom: (1.1.15 upstream)
  • Revision ID: james.westby@ubuntu.com-20110108172946-mm7j881jlozn0vt8
Tags: 0.20-0ubuntu1
* New upstream release
* Refresh 20_add_debian_specific_filetypes.dpatch
* Bump Breaks version for geany-plugins-common

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
*   $Id: get.c 5136 2010-08-11 14:19:57Z ntrel $
 
2
*   $Id: get.c 5295 2010-10-15 12:17:22Z ntrel $
3
3
*
4
4
*   Copyright (c) 1996-2002, Darren Hiebert
5
5
*
33
33
/*
34
34
*   DATA DECLARATIONS
35
35
*/
36
 
typedef enum { COMMENT_NONE, COMMENT_C, COMMENT_CPLUS } Comment;
 
36
typedef enum { COMMENT_NONE, COMMENT_C, COMMENT_CPLUS, COMMENT_D } Comment;
37
37
 
38
38
enum eCppLimits {
39
39
        MaxCppNestingLevel = 20,
444
444
                comment = COMMENT_C;
445
445
        else if (next == '/')
446
446
                comment = COMMENT_CPLUS;
 
447
        else if (next == '+')
 
448
                comment = COMMENT_D;
447
449
        else
448
450
        {
449
451
                fileUngetc (next);
495
497
        return c;
496
498
}
497
499
 
 
500
/* Skips over a D style comment.
 
501
 * Really we should match nested /+ comments. At least they're less common.
 
502
 */
 
503
int skipOverDComment (void)
 
504
{
 
505
        int c = fileGetc ();
 
506
 
 
507
        while (c != EOF)
 
508
        {
 
509
                if (c != '+')
 
510
                        c = fileGetc ();
 
511
                else
 
512
                {
 
513
                        const int next = fileGetc ();
 
514
 
 
515
                        if (next != '/')
 
516
                                c = next;
 
517
                        else
 
518
                        {
 
519
                                c = SPACE;  /* replace comment with space */
 
520
                                break;
 
521
                        }
 
522
                }
 
523
        }
 
524
        return c;
 
525
}
 
526
 
498
527
/*  Skips to the end of a string, returning a special character to
499
528
 *  symbolically represent a generic string.
500
529
 */
614
643
                                        if (c == NEWLINE)
615
644
                                                fileUngetc (c);
616
645
                                }
 
646
                                else if (comment == COMMENT_D)
 
647
                                        c = skipOverDComment ();
617
648
                                else
618
649
                                        Cpp.directive.accept = FALSE;
619
650
                                break;