~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/prism/tests/languages/bison/c_feature.test

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%{
 
2
        #include <stdio.h>
 
3
%}
 
4
%code {
 
5
        if(foo) {
 
6
 
 
7
        }
 
8
}
 
9
%%
 
10
exp:
 
11
        NUM {
 
12
                $$ = f($3, $4);
 
13
                @$.first_column = @1.first_column;
 
14
                $result = $left + $<itype>1;
 
15
        }
 
16
%%
 
17
 
 
18
----------------------------------------------------
 
19
 
 
20
[
 
21
        ["bison", [
 
22
                ["c", [
 
23
                        ["delimiter", "%{"],
 
24
                        ["macro", ["#", ["directive", "include"], ["string", "<stdio.h>"]]],
 
25
                        ["delimiter", "%}"]
 
26
                ]],
 
27
                ["keyword", "%code"],
 
28
                ["c", [
 
29
                        ["delimiter", "{"],
 
30
                        ["keyword", "if"], ["punctuation", "("], "foo", ["punctuation", ")"],
 
31
                        ["punctuation", "{"], ["punctuation", "}"],
 
32
                        ["delimiter", "}"]
 
33
                ]],
 
34
                ["punctuation", "%%"],
 
35
                ["property", "exp"], ["punctuation", ":"],
 
36
                "\r\n\tNUM ",
 
37
                ["c", [
 
38
                        ["delimiter", "{"],
 
39
                        ["bison-variable", ["$$"]], ["operator", "="],
 
40
                        ["function", "f"], ["punctuation", "("],
 
41
                        ["bison-variable", ["$3"]], ["punctuation", ","],
 
42
                        ["bison-variable", ["$4"]], ["punctuation", ")"], ["punctuation", ";"],
 
43
                        ["bison-variable", ["@$"]], ["punctuation", "."], "first_column ", ["operator", "="],
 
44
                        ["bison-variable", ["@1"]], ["punctuation", "."], "first_column", ["punctuation", ";"],
 
45
                        ["bison-variable", ["$result"]], ["operator", "="],
 
46
                        ["bison-variable", ["$left"]], ["operator", "+"],
 
47
                        ["bison-variable", ["$", ["punctuation", "<"], "itype", ["punctuation", ">"], "1"]], ["punctuation", ";"],
 
48
                        ["delimiter", "}"]
 
49
                ]],
 
50
                ["punctuation", "%%"]
 
51
        ]]
 
52
]
 
53
 
 
54
----------------------------------------------------
 
55
 
 
56
Checks for C inside Bison, along with special Bison variables.
 
 
b'\\ No newline at end of file'