~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to languages/haml/src/org/netbeans/modules/languages/haml/Haml.nbs

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
ImportĀ upstreamĀ versionĀ 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# The contents of this file are subject to the terms of the Common Development
 
2
# and Distribution License (the License). You may not use this file except in
 
3
# compliance with the License.
 
4
#
 
5
# You can obtain a copy of the License at http://www.netbeans.org/cddl.html
 
6
# or http://www.netbeans.org/cddl.txt.
 
7
#
 
8
# When distributing Covered Code, include this CDDL Header Notice in each file
 
9
# and include the License file at http://www.netbeans.org/cddl.txt.
 
10
# If applicable, add the following below the CDDL Header, with the fields
 
11
# enclosed by brackets [] replaced by your own identifying information:
 
12
# "Portions Copyrighted [year] [name of copyright owner]"
 
13
#
 
14
# The Original Software is NetBeans. The Initial Developer of the Original
 
15
# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
 
16
# Microsystems, Inc. All Rights Reserved.
 
17
 
 
18
########### tokens #############################################################
 
19
 
 
20
TOKEN:vm_comment:( "#*" - "*#" )
 
21
TOKEN:vm_comment:( "##" [^ "\n" "\r"]+ )
 
22
TOKEN:vm_keyword:( 
 
23
    "#set" |
 
24
    "#foreach" |
 
25
    "#if" |
 
26
    "#elseif" |
 
27
    "#parse" |
 
28
    "#macro" |
 
29
    "#include"
 
30
):<IN_VM>
 
31
TOKEN:vm_keyword:( 
 
32
    "#end" |
 
33
    "#else" |
 
34
    "#stop"
 
35
)
 
36
TOKEN:vm_identifier:( 
 
37
    "$" "!"? "{"?
 
38
    ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "-" "_"]* "}"?
 
39
)
 
40
TOKEN:vm_identifier:( 
 
41
    "$" "{"?
 
42
    ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "-" "_"]* 
 
43
    "." ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "-" "_"]* "}"?
 
44
)
 
45
TOKEN:vm_identifier:( 
 
46
    "$"  "{"?
 
47
    ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "-" "_"]* 
 
48
    "." ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "-" "_"]* 
 
49
    "("
 
50
):<IN_PARAMS>
 
51
<IN_PARAMS> {
 
52
    TOKEN:vm_string: (
 
53
        "\"" ( 
 
54
            [^ "\\" "\"" "\n" "\r"] |
 
55
            ("\\" (
 
56
                . |
 
57
                (["0"-"7"] ["0"-"7"] ["0"-"7"]) |
 
58
                ("x" ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"]) |
 
59
                ("u" ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"])
 
60
            ))
 
61
        )* 
 
62
        "\""
 
63
    )
 
64
    TOKEN:vm_number: (
 
65
        ["0"-"9"] ['l' 'L']? |
 
66
        ["1"-"9"] ["0"-"9"]* ['l' 'L']? |
 
67
        "0" ["0"-"7"]+ ['l' 'L']? |
 
68
        "0" ["x" "X"] ["0"-"9" "a"-"f" "A"-"F"]+ ['l' 'L']? |
 
69
        ["0"-"9"]+ "." ["0"-"9"]* (["e" "E"] ["+" "-"]? ["0"-"9"]+)? ["f" "F" "d" "D"]? |
 
70
        "." ["0"-"9"]+ (["e" "E"] ["+" "-"]? ["0"-"9"]+)? ["f" "F" "d" "D"]? |
 
71
        ["0"-"9"]+ ["e" "E"] ["+" "-"]? ["0"-"9"]+ ["f" "F" "d" "D"]? |
 
72
        ["0"-"9"]+ (["e" "E"] ["+" "-"]? ["0"-"9"]+)? ["f" "F" "d" "D"]
 
73
    )
 
74
    TOKEN:vm_identifier:( "$"? ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "-" "_"]* )
 
75
    TOKEN:vm_operator:( "," )
 
76
    TOKEN:vm_operator:( ")" "}"? ):<DEFAULT>
 
77
}
 
78
<IN_VM> {
 
79
    TOKEN:vm_whitespace:( [" " "\t" "\n" "\r"]+ )
 
80
    TOKEN:vm_operator {
 
81
        pattern:( "(" );
 
82
        end_state:"IN_VM2";
 
83
        counter:"i++";
 
84
    }
 
85
}
 
86
<IN_VM2> {
 
87
    TOKEN:vm_identifier:( "$"? ["a"-"z" "A"-"Z"] ["a"-"z" "A"-"Z" "0"-"9" "-" "_"]* )
 
88
    TOKEN:vm_operator:( "." | "(" | ")" | "[" | "]" | "=" | "," )
 
89
    TOKEN:vm_operator {
 
90
        pattern:( "(" );
 
91
        end_state:"IN_VM2";
 
92
        counter:"i++";
 
93
    }
 
94
    TOKEN:vm_operator {
 
95
        pattern:( ")" );
 
96
        end_state:"IN_VM2";
 
97
        end_state2:"DEFAULT";
 
98
        counter:"i--";
 
99
    }
 
100
    TOKEN:vm_whitespace:( " " | "\t" )
 
101
    TOKEN:vm_eol:( ["\n" "\r"]+ ):<DEFAULT>
 
102
    TOKEN:vm_string: (
 
103
        "\"" ( 
 
104
            [^ "\\" "\"" "\n" "\r"] |
 
105
            ("\\" (
 
106
                . |
 
107
                (["0"-"7"] ["0"-"7"] ["0"-"7"]) |
 
108
                ("x" ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"]) |
 
109
                ("u" ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"] ["0"-"9" "a"-"f" "A"-"F"])
 
110
            ))
 
111
        )* 
 
112
        "\""
 
113
    )
 
114
    TOKEN:vm_number: (
 
115
        ["0"-"9"] ['l' 'L']? |
 
116
        ["1"-"9"] ["0"-"9"]* ['l' 'L']? |
 
117
        "0" ["0"-"7"]+ ['l' 'L']? |
 
118
        "0" ["x" "X"] ["0"-"9" "a"-"f" "A"-"F"]+ ['l' 'L']? |
 
119
        ["0"-"9"]+ "." ["0"-"9"]* (["e" "E"] ["+" "-"]? ["0"-"9"]+)? ["f" "F" "d" "D"]? |
 
120
        "." ["0"-"9"]+ (["e" "E"] ["+" "-"]? ["0"-"9"]+)? ["f" "F" "d" "D"]? |
 
121
        ["0"-"9"]+ ["e" "E"] ["+" "-"]? ["0"-"9"]+ ["f" "F" "d" "D"]? |
 
122
        ["0"-"9"]+ (["e" "E"] ["+" "-"]? ["0"-"9"]+)? ["f" "F" "d" "D"]
 
123
    )
 
124
    TOKEN:vm_comment:( "##" [^ " " "\t" "\n" "\r"]+ ):<DEFAULT>
 
125
}
 
126
 
 
127
TOKEN:text:( [^ "#" "$"]+ )
 
128
TOKEN:text:( "#" )
 
129
TOKEN:text:( "$" )
 
130
 
 
131
COLOR:vm_comment: {
 
132
    background_color:"#e6ffe6";
 
133
}
 
134
COLOR:vm_keyword: {
 
135
    background_color:"#e6ffe6";
 
136
}
 
137
COLOR:vm_number: {
 
138
    background_color:"#e6ffe6";
 
139
}
 
140
COLOR:vm_string: {
 
141
    background_color:"#e6ffe6";
 
142
}
 
143
COLOR:vm_whitespace: {
 
144
    background_color:"#e6ffe6";
 
145
}
 
146
COLOR:vm_identifier: {
 
147
    background_color:"#e6ffe6";
 
148
}
 
149
COLOR:vm_operator: {
 
150
    background_color:"#e6ffe6";
 
151
}
 
152
 
 
153
#IMPORT:html: {
 
154
#    mimeType:"text/html2";
 
155
#    state: "DEFAULT";
 
156
#}
 
157
 
 
158