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

« back to all changes in this revision

Viewing changes to tagmanager/actionscript.c

  • Committer: Bazaar Package Importer
  • Author(s): Damián Viano
  • Date: 2009-05-29 21:22:54 UTC
  • mfrom: (1.3.1 upstream) (3.1.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: james.westby@ubuntu.com-20090529212254-cx6t2a7itgii3p5f
Tags: 0.17-1
* New upstream release
* 20_add_debdiff_as_diff_type.dpatch renamed as
  20_add_debian_specific_filetypes.dpatch, 
  - add .dpatch as a diff filetype
  - add control as a conf filetype
* 20_change_gpl_location.dpatch freshen
* add 20_debian_control_tags.dpatch better handling of debian/control files.
  Thanks to Enrico Tröger. (Closes: #520776)
* debian/copyright Add Frank Lanitz, update years

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*   $Id: actionscript.c,v 1.1 2004/01/03 03:59:19 svoisen Exp $
 
3
*
 
4
*   Original file copyright (c) 2004, Sean Voisen
 
5
*
 
6
*       Modified October 8, 2007 By Mike Fahy (VeryVito) of www.turdhead.com
 
7
*               - Added initial AS3 support
 
8
*               - Threw in some "TODO" and "NOTE" bits
 
9
*
 
10
*       Modified October 9, 2007 By Ali Rantakari of hasseg.org:
 
11
*               - Added more allowed AS3 attribute keywords (override, final, internal
 
12
*                 etc...) for classes, getters & setters, variables
 
13
*               - Allowed varying versions of "note" and "todo" spellings
 
14
*               - Allowed points (.) in package names so that they would display the
 
15
*                 whole package name instead of just the first level
 
16
*               - Added interfaces matching support
 
17
*               - Reformatted some name parameters:
 
18
*                       - Getters and setters: display either "get" or "set" in front
 
19
*                         of the property name
 
20
*                       - Todos & notes: made the name be the text that comes after the
 
21
*                         "todo" or "note" text
 
22
*                       - Variables: Moved the variable type after the name and separated
 
23
*                         them with " : " according to ActionScript syntax
 
24
*       Modified March 6, 2009 by Chris Macksey (cmacksey@users.sourceforge.net)
 
25
*           - Tweaked to work better with Geany
 
26
*
 
27
*   This source code is released for free distribution under the terms of the
 
28
*   GNU General Public License.
 
29
*
 
30
*   This module contains functions for generating tags for ActionScript language
 
31
*   files.
 
32
*/
 
33
 
 
34
/*
 
35
*   INCLUDE FILES
 
36
*/
 
37
#include "general.h"    /* must always come first */
 
38
#include "parse.h"
 
39
 
 
40
/*
 
41
*   FUNCTION DEFINITIONS
 
42
*
 
43
*/
 
44
 
 
45
static void installActionScriptRegex (const langType language)
 
46
{
 
47
        /* Functions */
 
48
    addTagRegex (language, "^[ \t]*[(private|public|static|protected|internal|final|override)( \t)]*function[ \t]+([A-Za-z0-9_]+)[ \t]*\\(([^\\{]*)",
 
49
            "\\1 (\\2", "f,function,functions,methods", NULL);
 
50
 
 
51
        /* Getters and setters */
 
52
        addTagRegex (language, "^[ \t]*[(public|static|internal|final|override)( \t)]*function[ \t]+(set|get)[ \t]+([A-Za-z0-9_]+)[ \t]*\\(",
 
53
                "\\2 \\1", "f,field,fields", NULL);
 
54
 
 
55
        /* Variables */
 
56
        addTagRegex (language, "^[ \t]*[(private|public|static|protected|internal)( \t)]*var[ \t]+([A-Za-z0-9_]+)([ \t]*\\:[ \t]*([A-Za-z0-9_]+))*[ \t]*",
 
57
                "\\1 \\: \\3", "v,variable,variables", NULL);
 
58
 
 
59
        /* Constants */
 
60
        addTagRegex (language, "^[ \t]*[(private|public|static|protected|internal)( \t)]*const[ \t]+([A-Za-z0-9_]+)([ \t]*\\:[ \t]*([A-Za-z0-9_]+))*[ \t]*",
 
61
                "\\1 : \\3", "m,macro,macros", NULL);
 
62
 
 
63
        /* Classes */
 
64
        addTagRegex (language, "^[ \t]*[(private|public|static|dynamic|final|internal)( \t)]*class[ \t]+([A-Za-z0-9_]+)[ \t]*([^\\{]*)",
 
65
                "\\1 (\\2)", "c,class,classes", NULL);
 
66
 
 
67
        /* Interfaces */
 
68
        addTagRegex (language, "^[ \t]*[(private|public|static|dynamic|final|internal)( \t)]*interface[ \t]+([A-Za-z0-9_]+)[ \t]*([^\\{]*)",
 
69
                "\\1 (\\2)", "i,interface,interfaces", NULL);
 
70
 
 
71
        /* Packages */
 
72
        addTagRegex (language, "^[ \t]*[(private|public|static)( \t)]*package[ \t]+([A-Za-z0-9_.]+)[ \t]*",
 
73
                "\\1", "p,package", NULL);
 
74
 
 
75
        /* Notes */
 
76
        addTagRegex (language, "\\/\\/[ \t]*(NOTE|note|Note)[ \t]*\\:*(.*)",
 
77
                "\\2", "o,other", NULL);
 
78
 
 
79
        /* Todos */
 
80
        addTagRegex (language, "\\/\\/[ \t]*(TODO|todo|ToDo|Todo)[ \t]*\\:*(.*)",
 
81
                "\\2", "o,other", NULL);
 
82
 
 
83
        /* Prototypes (Put this in for AS1 compatibility...) */
 
84
    addTagRegex (language, ".*\\.prototype\\.([A-Za-z0-9 ]+)[ \t]*\\=([ \t]*)function( [ \t]?)*\\(",
 
85
            "\\1", "p,prototype", NULL);
 
86
}
 
87
 
 
88
/* Create parser definition stucture */
 
89
extern parserDefinition* ActionScriptParser (void)
 
90
 
 
91
{
 
92
        static const char *const extensions [] = { "as", NULL };
 
93
        parserDefinition *const def = parserNew ("ActionScript");
 
94
        def->extensions = extensions;
 
95
        def->initialize = installActionScriptRegex;
 
96
        def->regex      = TRUE;
 
97
        return def;
 
98
}
 
99