File: cram.t

package info (click to toggle)
js-of-ocaml 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 37,932 kB
  • sloc: ml: 135,957; javascript: 58,364; ansic: 437; makefile: 422; sh: 12; perl: 4
file content (211 lines) | stat: -rw-r--r-- 4,848 bytes parent folder | download | duplicates (2)
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
Too many parentheses

  $ echo '())' | wasm_of_ocaml pp
  File "-", line 1, characters 2-3:
  Unexpected closing parenthesis.
  [1]

  $ echo '();)' | wasm_of_ocaml pp
  File "-", line 1, characters 2-4:
  Unmatched closing comment.
  [1]

Missing parenthesis

  $ echo '(()' | wasm_of_ocaml pp
  File "-", line 1, characters 0-1:
  Unclosed parenthesis.
  [1]

  $ echo '(; ()' | wasm_of_ocaml pp
  File "-", line 1, characters 0-2:
  Unclosed comment.
  [1]

  $ echo '(; (; ()' | wasm_of_ocaml pp
  File "-", line 1, characters 3-5:
  Unclosed comment.
  [1]

Unterminated string (we point at the newline)

  $ echo '"abcd' | wasm_of_ocaml pp
  File "-", line 1, characters 5-5:
  Malformed string.
  [1]

Bad conditional

  $ echo '(@if)' | wasm_of_ocaml pp
  File "-", line 1, characters 4-5:
  Expecting condition.
  [1]

  $ echo '(@if a)' | wasm_of_ocaml pp
  File "-", line 1, characters 6-7:
  Expecting @then clause.
  [1]

  $ echo '(@if a xxx)' | wasm_of_ocaml pp
  File "-", line 1, characters 7-10:
  Expecting @then clause.
  [1]

  $ echo '(@if a (@then) xx)' | wasm_of_ocaml pp
  File "-", line 1, characters 15-17:
  Expecting @else clause or closing parenthesis.
  [1]

  $ echo '(@if a (@then) (@else) xx)' | wasm_of_ocaml pp
  File "-", line 1, characters 23-25:
  Expecting closing parenthesis.
  [1]

Syntax error in condition

  $ echo '(@if () (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 5-7:
  Syntax error.
  [1]

  $ echo '(@if (not) (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 5-10:
  Syntax error.
  [1]

  $ echo '(@if (not (and) (or)) (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 5-21:
  Syntax error.
  [1]

  $ echo '(@if (= "a") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 5-12:
  Syntax error.
  [1]

  $ echo '(@if (= "a" "b" "c") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 5-20:
  Syntax error.
  [1]

Unicode escape sequences

  $ echo '(@if (= "\u{1F600}" "b") (@then))' | wasm_of_ocaml pp
                                   

  $ echo '(@if (= "\u{D800}" "b") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 8-18:
  Invalid Unicode escape sequences.
  [1]

  $ echo '(@if (= "\u{110000}" "b") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 8-20:
  Invalid Unicode escape sequences.
  [1]

Lonely @then or @else

  $ echo '(@then)' | wasm_of_ocaml pp
  File "-", line 1, characters 1-6:
  Unexpected @then clause. Maybe you forgot a parenthesis.
  [1]

  $ echo '(@else)' | wasm_of_ocaml pp
  File "-", line 1, characters 1-6:
  Unexpected @else clause. Maybe you forgot a parenthesis.
  [1]

  $ echo '(@if (and) (@then (@else)))' | wasm_of_ocaml pp
  File "-", line 1, characters 19-24:
  Unexpected @else clause. Maybe you forgot a parenthesis.
  [1]

Undefined variable

  $ echo '(@if a (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 5-6:
  Unknown variable 'a'.
  [1]

Wrong type
  $ echo '(@if "" (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 5-7:
  Expected a boolean but this is a string.
  [1]

  $ echo '(@if (not "") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 10-12:
  Expected a boolean but this is a string.
  [1]

  $ echo '(@if (and "") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 10-12:
  Expected a boolean but this is a string.
  [1]

  $ echo '(@if (or "") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 9-11:
  Expected a boolean but this is a string.
  [1]

  $ echo '(@if (= (and) "") (@then))' | wasm_of_ocaml pp
  File "-", line 1, characters 14-16:
  Expected a boolean but this is a string.
  [1]

Bad strings

  $ echo '(@string)' | wasm_of_ocaml pp
  File "-", line 1, characters 8-9:
  Expecting an id or a string.
  [1]

  $ echo '(@string a "b")' | wasm_of_ocaml pp
  File "-", line 1, characters 9-10:
  Expecting an id
  [1]

  $ echo '(@string $a b)' | wasm_of_ocaml pp
  File "-", line 1, characters 12-13:
  Expecting a string
  [1]

  $ echo '(@string $bad "\u{D800}")' | wasm_of_ocaml pp
  File "-", line 1, characters 14-24:
  Invalid Unicode escape sequences.
  [1]

  $ echo '(@string a)' | wasm_of_ocaml pp
  File "-", line 1, characters 9-10:
  Expecting a string
  [1]

  $ echo '(@string a b c)' | wasm_of_ocaml pp
  File "-", line 1, characters 13-14:
  Expecting a closing parenthesis.
  [1]

Bad characters

  $ echo '(@char "")' | wasm_of_ocaml pp
  File "-", line 1, characters 7-9:
  Expecting an ASCII character
  [1]


  $ echo '(@char "aa")' | wasm_of_ocaml pp
  File "-", line 1, characters 7-11:
  Expecting an ASCII character
  [1]


  $ echo '(@char "é")' | wasm_of_ocaml pp
  File "-", line 1, characters 7-10:
  Expecting an ASCII character
  [1]


  $ echo '(@char "\80")' | wasm_of_ocaml pp
  File "-", line 1, characters 7-12:
  Expecting an ASCII character
  [1]