summaryrefslogtreecommitdiff
path: root/test/test.ref
blob: bf7ec115fb67d65849d677ca77fc95d2675f4313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# 1 "test.cppo"
(* comment *)

# 4 "test.cppo"
f(1)
# 6 "test.cppo"
 2+ 3.14  
# 8 "test.cppo"
 3+ 3.14  

# 13 "test.cppo"
"g" is not defined

# 18 "test.cppo"
 b() 

# 20 "test.cppo"
debug("a")
debug("b")




# 33 "test.cppo"
success

# 45 "test.cppo"
 
"abc\
 xyz
 def" 
(* 123 \
   789
   456 *) 

# 48 "test.cppo"
 "a" "b" 

# 51 "test.cppo"
 aa ,bb   123   

# 54 "test.cppo"
  , ) ( 

# 56 "test.cppo"
blah #define xyz

# 63 "test.cppo"
  _ _ (* the 2 underscores should be space-separated *) 

# 67 "test.cppo"
 + + (* there should be some space between the pluses *) 

# 69 "test.cppo"
(* (* nested comment with single single quote: ' *) "*)" *)

# 72 "test.cppo"
obj
   # define 
# 73 "test.cppo"
             

# 75 "test.cppo"
'  (* lone single quote *)

# 78 "test.cppo"
 1  
# 78 "test.cppo"
    = 1

# 82 "test.cppo"
 #  
# 82 "test.cppo"
  is #

# 98 "test.cppo"
good maths




# 117 "test.cppo"
 
let g x = 
  printf "call %s\n%!" "g"; 
  let y = g x in 
  printf "return %s\n%!" "g"; 
  y 
;; 


# 124 "test.cppo"
class foo () =
object
  
# 126 "test.cppo"
   
  val mutable field_1 :  int option 
  method  get_field_1  = field_1 
  method  set_field_1  x = field_1 <- Some x 
  
# 127 "test.cppo"
   
  val mutable field_2 :  string option 
  method  get_field_2  = field_2 
  method  set_field_2  x = field_2 <- Some x 
# 128 "test.cppo"
end

# 135 "test.cppo"
 
  (if !debug then 
    eprintf "[debug] %s %i: "  "test.cppo"   135 ; 
    eprintf "test1 %i %i" x y; 
    eprintf "\n") 
# 136 "test.cppo"
 
  (if !debug then 
    eprintf "[debug] %s %i: "  "test.cppo"   136 ; 
    eprintf "test2 %i" x; 
    eprintf "\n") 

# 1 "incl.cppo"
included

# 1 "incl2.cppo"
ok
# 139 "test.cppo"

# 123456


# 789 "test"
# 1 "incl.cppo"
included

# 1 "incl2.cppo"
ok


# 793 "test"
end