cast 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -4
- data/doc/index.html +7 -15
- data/ext/cast.h +141 -0
- data/ext/cast_ext.c +10 -0
- data/ext/extconf.rb +2 -0
- data/ext/parser.c +287 -0
- data/ext/yylex.c +8189 -0
- data/ext/yylex.re +330 -0
- data/lib/cast.rb +15 -8
- data/lib/cast/c.tab.rb +3398 -0
- data/lib/{c.y → cast/c.y} +212 -270
- data/lib/{c_nodes.rb → cast/c_nodes.rb} +12 -7
- data/lib/{to_debug.rb → cast/inspect.rb} +12 -12
- data/lib/{node.rb → cast/node.rb} +0 -0
- data/lib/{node_list.rb → cast/node_list.rb} +10 -2
- data/lib/{parse.rb → cast/parse.rb} +0 -0
- data/lib/{to_s.rb → cast/to_s.rb} +12 -3
- data/test/run.rb +204 -2
- data/test/test_c_nodes.rb +5 -9
- data/test/test_node.rb +0 -10
- data/test/test_node_list.rb +20 -3
- data/test/test_parse.rb +623 -626
- data/test/test_parser.rb +80 -33
- metadata +44 -32
- data/install.rb +0 -14
- data/lib/c.tab.rb +0 -3433
- data/test/common.rb +0 -174
data/test/test_node_list.rb
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
require 'common'
|
2
|
-
require 'stringio'
|
3
|
-
|
4
1
|
###
|
5
2
|
### ##################################################################
|
6
3
|
###
|
@@ -1810,6 +1807,16 @@ module NodeListModifierTests
|
|
1810
1807
|
assert_nil(c.parent)
|
1811
1808
|
end
|
1812
1809
|
|
1810
|
+
def test_pop_bad
|
1811
|
+
## too many args
|
1812
|
+
a, b = 2.of{C::Int.new}
|
1813
|
+
list = _List[a, b]
|
1814
|
+
assert_raise(ArgumentError){list.pop(1, 2)}
|
1815
|
+
assert_same_list([a, b], list)
|
1816
|
+
assert_same(list, a.parent)
|
1817
|
+
assert_same(list, b.parent)
|
1818
|
+
end
|
1819
|
+
|
1813
1820
|
def test_shift
|
1814
1821
|
## empty
|
1815
1822
|
list = _List[]
|
@@ -1937,6 +1944,16 @@ module NodeListModifierTests
|
|
1937
1944
|
assert_nil(b.parent)
|
1938
1945
|
end
|
1939
1946
|
|
1947
|
+
def test_shift_bad
|
1948
|
+
## too many args
|
1949
|
+
a, b = 2.of{C::Int.new}
|
1950
|
+
list = _List[a, b]
|
1951
|
+
assert_raise(ArgumentError){list.shift(1, 2)}
|
1952
|
+
assert_same_list([a, b], list)
|
1953
|
+
assert_same(list, a.parent)
|
1954
|
+
assert_same(list, b.parent)
|
1955
|
+
end
|
1956
|
+
|
1940
1957
|
###
|
1941
1958
|
### ----------------------------------------------------------------
|
1942
1959
|
### insert
|
data/test/test_parse.rb
CHANGED
@@ -6,8 +6,6 @@
|
|
6
6
|
### ##################################################################
|
7
7
|
###
|
8
8
|
|
9
|
-
require 'common'
|
10
|
-
|
11
9
|
class MatchTest < Test::Unit::TestCase
|
12
10
|
def setup
|
13
11
|
C.default_parser = C::Parser.new
|
@@ -79,7 +77,6 @@ class MatchTest < Test::Unit::TestCase
|
|
79
77
|
end
|
80
78
|
|
81
79
|
class ParseTests < Test::Unit::TestCase
|
82
|
-
include CheckAst
|
83
80
|
def check klass, s
|
84
81
|
check_ast(s){|inp| klass.parse(inp)}
|
85
82
|
end
|
@@ -108,7 +105,7 @@ TranslationUnit
|
|
108
105
|
type: Void
|
109
106
|
name: "f"
|
110
107
|
EOS
|
111
|
-
assert_raise(ParseError){C::TranslationUnit.parse('')}
|
108
|
+
assert_raise(C::ParseError){C::TranslationUnit.parse('')}
|
112
109
|
end
|
113
110
|
|
114
111
|
def test_declaration
|
@@ -132,9 +129,9 @@ Declaration
|
|
132
129
|
- Declarator
|
133
130
|
name: "j"
|
134
131
|
EOS
|
135
|
-
assert_raise(ParseError){C::Declaration.parse('int i; int j;')}
|
136
|
-
assert_raise(ParseError){C::Declaration.parse('int f() {}')}
|
137
|
-
assert_raise(ParseError){C::Declaration.parse('')}
|
132
|
+
assert_raise(C::ParseError){C::Declaration.parse('int i; int j;')}
|
133
|
+
assert_raise(C::ParseError){C::Declaration.parse('int f() {}')}
|
134
|
+
assert_raise(C::ParseError){C::Declaration.parse('')}
|
138
135
|
end
|
139
136
|
|
140
137
|
def test_parameter
|
@@ -163,12 +160,12 @@ void
|
|
163
160
|
Parameter
|
164
161
|
type: Void
|
165
162
|
EOS
|
166
|
-
assert_raise(ParseError){C::Parameter.parse('...')}
|
167
|
-
assert_raise(ParseError){C::Parameter.parse(') {} void (')}
|
168
|
-
assert_raise(ParseError){C::Parameter.parse('); void(')}
|
169
|
-
assert_raise(ParseError){C::Parameter.parse('i,j')}
|
170
|
-
assert_raise(ParseError){C::Parameter.parse('int,float')}
|
171
|
-
assert_raise(ParseError){C::Parameter.parse('')}
|
163
|
+
assert_raise(C::ParseError){C::Parameter.parse('...')}
|
164
|
+
assert_raise(C::ParseError){C::Parameter.parse(') {} void (')}
|
165
|
+
assert_raise(C::ParseError){C::Parameter.parse('); void(')}
|
166
|
+
assert_raise(C::ParseError){C::Parameter.parse('i,j')}
|
167
|
+
assert_raise(C::ParseError){C::Parameter.parse('int,float')}
|
168
|
+
assert_raise(C::ParseError){C::Parameter.parse('')}
|
172
169
|
end
|
173
170
|
|
174
171
|
def test_declarator
|
@@ -211,10 +208,10 @@ Declarator
|
|
211
208
|
name: "argv"
|
212
209
|
name: "x"
|
213
210
|
EOS
|
214
|
-
assert_raise(ParseError){C::Declarator.parse('f; int f;')}
|
215
|
-
assert_raise(ParseError){C::Declarator.parse('i,j')}
|
216
|
-
assert_raise(ParseError){C::Declarator.parse(';')}
|
217
|
-
assert_raise(ParseError){C::Declarator.parse('')}
|
211
|
+
assert_raise(C::ParseError){C::Declarator.parse('f; int f;')}
|
212
|
+
assert_raise(C::ParseError){C::Declarator.parse('i,j')}
|
213
|
+
assert_raise(C::ParseError){C::Declarator.parse(';')}
|
214
|
+
assert_raise(C::ParseError){C::Declarator.parse('')}
|
218
215
|
end
|
219
216
|
|
220
217
|
def test_function_def
|
@@ -239,11 +236,11 @@ FunctionDef
|
|
239
236
|
type: Void
|
240
237
|
name: "f"
|
241
238
|
EOS
|
242
|
-
assert_raise(ParseError){C::FunctionDef.parse('void f(); void g();')}
|
243
|
-
assert_raise(ParseError){C::FunctionDef.parse('int i;')}
|
244
|
-
assert_raise(ParseError){C::FunctionDef.parse('void f();')}
|
245
|
-
assert_raise(ParseError){C::FunctionDef.parse(';')}
|
246
|
-
assert_raise(ParseError){C::FunctionDef.parse('')}
|
239
|
+
assert_raise(C::ParseError){C::FunctionDef.parse('void f(); void g();')}
|
240
|
+
assert_raise(C::ParseError){C::FunctionDef.parse('int i;')}
|
241
|
+
assert_raise(C::ParseError){C::FunctionDef.parse('void f();')}
|
242
|
+
assert_raise(C::ParseError){C::FunctionDef.parse(';')}
|
243
|
+
assert_raise(C::ParseError){C::FunctionDef.parse('')}
|
247
244
|
end
|
248
245
|
|
249
246
|
def test_enumerator
|
@@ -261,10 +258,10 @@ Enumerator
|
|
261
258
|
val: IntLiteral
|
262
259
|
val: 10
|
263
260
|
EOS
|
264
|
-
assert_raise(ParseError){C::Enumerator.parse('} enum {')}
|
265
|
-
assert_raise(ParseError){C::Enumerator.parse('} f() {')}
|
266
|
-
assert_raise(ParseError){C::Enumerator.parse('X, Y')}
|
267
|
-
assert_raise(ParseError){C::Enumerator.parse('')}
|
261
|
+
assert_raise(C::ParseError){C::Enumerator.parse('} enum {')}
|
262
|
+
assert_raise(C::ParseError){C::Enumerator.parse('} f() {')}
|
263
|
+
assert_raise(C::ParseError){C::Enumerator.parse('X, Y')}
|
264
|
+
assert_raise(C::ParseError){C::Enumerator.parse('')}
|
268
265
|
end
|
269
266
|
|
270
267
|
def test_member_initializer
|
@@ -311,12 +308,12 @@ MemberInit
|
|
311
308
|
init: FloatLiteral
|
312
309
|
val: 10.0
|
313
310
|
EOS
|
314
|
-
assert_raise(ParseError){C::MemberInit.parse('} int f() {')}
|
315
|
-
assert_raise(ParseError){C::MemberInit.parse('}} f() {{')}
|
316
|
-
assert_raise(ParseError){C::MemberInit.parse('1}; x = {1')}
|
317
|
-
assert_raise(ParseError){C::MemberInit.parse('1}, y')}
|
318
|
-
assert_raise(ParseError){C::MemberInit.parse('1, 2')}
|
319
|
-
assert_raise(ParseError){C::MemberInit.parse('')}
|
311
|
+
assert_raise(C::ParseError){C::MemberInit.parse('} int f() {')}
|
312
|
+
assert_raise(C::ParseError){C::MemberInit.parse('}} f() {{')}
|
313
|
+
assert_raise(C::ParseError){C::MemberInit.parse('1}; x = {1')}
|
314
|
+
assert_raise(C::ParseError){C::MemberInit.parse('1}, y')}
|
315
|
+
assert_raise(C::ParseError){C::MemberInit.parse('1, 2')}
|
316
|
+
assert_raise(C::ParseError){C::MemberInit.parse('')}
|
320
317
|
end
|
321
318
|
|
322
319
|
def test_block
|
@@ -332,11 +329,11 @@ Block
|
|
332
329
|
stmts:
|
333
330
|
- Block
|
334
331
|
EOS
|
335
|
-
assert_raise(ParseError){C::Block.parse('} void f() {')}
|
336
|
-
assert_raise(ParseError){C::Block.parse(';;')}
|
337
|
-
assert_raise(ParseError){C::Block.parse('int i;')}
|
338
|
-
assert_raise(ParseError){C::Block.parse(';')}
|
339
|
-
assert_raise(ParseError){C::Block.parse('')}
|
332
|
+
assert_raise(C::ParseError){C::Block.parse('} void f() {')}
|
333
|
+
assert_raise(C::ParseError){C::Block.parse(';;')}
|
334
|
+
assert_raise(C::ParseError){C::Block.parse('int i;')}
|
335
|
+
assert_raise(C::ParseError){C::Block.parse(';')}
|
336
|
+
assert_raise(C::ParseError){C::Block.parse('')}
|
340
337
|
end
|
341
338
|
|
342
339
|
def test_if
|
@@ -363,11 +360,11 @@ If
|
|
363
360
|
expr: IntLiteral
|
364
361
|
val: 20
|
365
362
|
EOS
|
366
|
-
assert_raise(ParseError){C::If.parse('} void f() {')}
|
367
|
-
assert_raise(ParseError){C::If.parse(';;')}
|
368
|
-
assert_raise(ParseError){C::If.parse('int i;')}
|
369
|
-
assert_raise(ParseError){C::If.parse(';')}
|
370
|
-
assert_raise(ParseError){C::If.parse('')}
|
363
|
+
assert_raise(C::ParseError){C::If.parse('} void f() {')}
|
364
|
+
assert_raise(C::ParseError){C::If.parse(';;')}
|
365
|
+
assert_raise(C::ParseError){C::If.parse('int i;')}
|
366
|
+
assert_raise(C::ParseError){C::If.parse(';')}
|
367
|
+
assert_raise(C::ParseError){C::If.parse('')}
|
371
368
|
end
|
372
369
|
|
373
370
|
def test_switch
|
@@ -379,11 +376,11 @@ Switch
|
|
379
376
|
name: "x"
|
380
377
|
stmt: ExpressionStatement
|
381
378
|
EOS
|
382
|
-
assert_raise(ParseError){C::Switch.parse('} void f() {')}
|
383
|
-
assert_raise(ParseError){C::Switch.parse(';;')}
|
384
|
-
assert_raise(ParseError){C::Switch.parse('int i;')}
|
385
|
-
assert_raise(ParseError){C::Switch.parse(';')}
|
386
|
-
assert_raise(ParseError){C::Switch.parse('')}
|
379
|
+
assert_raise(C::ParseError){C::Switch.parse('} void f() {')}
|
380
|
+
assert_raise(C::ParseError){C::Switch.parse(';;')}
|
381
|
+
assert_raise(C::ParseError){C::Switch.parse('int i;')}
|
382
|
+
assert_raise(C::ParseError){C::Switch.parse(';')}
|
383
|
+
assert_raise(C::ParseError){C::Switch.parse('')}
|
387
384
|
end
|
388
385
|
|
389
386
|
def test_while
|
@@ -403,11 +400,11 @@ While (do)
|
|
403
400
|
val: 1
|
404
401
|
stmt: ExpressionStatement
|
405
402
|
EOS
|
406
|
-
assert_raise(ParseError){C::While.parse('} void f() {')}
|
407
|
-
assert_raise(ParseError){C::While.parse(';;')}
|
408
|
-
assert_raise(ParseError){C::While.parse('int i;')}
|
409
|
-
assert_raise(ParseError){C::While.parse(';')}
|
410
|
-
assert_raise(ParseError){C::While.parse('')}
|
403
|
+
assert_raise(C::ParseError){C::While.parse('} void f() {')}
|
404
|
+
assert_raise(C::ParseError){C::While.parse(';;')}
|
405
|
+
assert_raise(C::ParseError){C::While.parse('int i;')}
|
406
|
+
assert_raise(C::ParseError){C::While.parse(';')}
|
407
|
+
assert_raise(C::ParseError){C::While.parse('')}
|
411
408
|
end
|
412
409
|
|
413
410
|
def test_for
|
@@ -428,11 +425,11 @@ For
|
|
428
425
|
name: "i"
|
429
426
|
stmt: ExpressionStatement
|
430
427
|
EOS
|
431
|
-
assert_raise(ParseError){C::For.parse('} void f() {')}
|
432
|
-
assert_raise(ParseError){C::For.parse(';;')}
|
433
|
-
assert_raise(ParseError){C::For.parse('int i;')}
|
434
|
-
assert_raise(ParseError){C::For.parse(';')}
|
435
|
-
assert_raise(ParseError){C::For.parse('')}
|
428
|
+
assert_raise(C::ParseError){C::For.parse('} void f() {')}
|
429
|
+
assert_raise(C::ParseError){C::For.parse(';;')}
|
430
|
+
assert_raise(C::ParseError){C::For.parse('int i;')}
|
431
|
+
assert_raise(C::ParseError){C::For.parse(';')}
|
432
|
+
assert_raise(C::ParseError){C::For.parse('')}
|
436
433
|
end
|
437
434
|
|
438
435
|
def test_goto
|
@@ -442,11 +439,11 @@ goto x;
|
|
442
439
|
Goto
|
443
440
|
target: "x"
|
444
441
|
EOS
|
445
|
-
assert_raise(ParseError){C::Goto.parse('} void f() {')}
|
446
|
-
assert_raise(ParseError){C::Goto.parse(';;')}
|
447
|
-
assert_raise(ParseError){C::Goto.parse('int i;')}
|
448
|
-
assert_raise(ParseError){C::Goto.parse(';')}
|
449
|
-
assert_raise(ParseError){C::Goto.parse('')}
|
442
|
+
assert_raise(C::ParseError){C::Goto.parse('} void f() {')}
|
443
|
+
assert_raise(C::ParseError){C::Goto.parse(';;')}
|
444
|
+
assert_raise(C::ParseError){C::Goto.parse('int i;')}
|
445
|
+
assert_raise(C::ParseError){C::Goto.parse(';')}
|
446
|
+
assert_raise(C::ParseError){C::Goto.parse('')}
|
450
447
|
end
|
451
448
|
|
452
449
|
def test_continue
|
@@ -455,11 +452,11 @@ continue;
|
|
455
452
|
----
|
456
453
|
Continue
|
457
454
|
EOS
|
458
|
-
assert_raise(ParseError){C::Continue.parse('} void f() {')}
|
459
|
-
assert_raise(ParseError){C::Continue.parse(';;')}
|
460
|
-
assert_raise(ParseError){C::Continue.parse('int i;')}
|
461
|
-
assert_raise(ParseError){C::Continue.parse(';')}
|
462
|
-
assert_raise(ParseError){C::Continue.parse('')}
|
455
|
+
assert_raise(C::ParseError){C::Continue.parse('} void f() {')}
|
456
|
+
assert_raise(C::ParseError){C::Continue.parse(';;')}
|
457
|
+
assert_raise(C::ParseError){C::Continue.parse('int i;')}
|
458
|
+
assert_raise(C::ParseError){C::Continue.parse(';')}
|
459
|
+
assert_raise(C::ParseError){C::Continue.parse('')}
|
463
460
|
end
|
464
461
|
|
465
462
|
def test_break
|
@@ -468,11 +465,11 @@ break;
|
|
468
465
|
----
|
469
466
|
Break
|
470
467
|
EOS
|
471
|
-
assert_raise(ParseError){C::Break.parse('} void f() {')}
|
472
|
-
assert_raise(ParseError){C::Break.parse(';;')}
|
473
|
-
assert_raise(ParseError){C::Break.parse('int i;')}
|
474
|
-
assert_raise(ParseError){C::Break.parse(';')}
|
475
|
-
assert_raise(ParseError){C::Break.parse('')}
|
468
|
+
assert_raise(C::ParseError){C::Break.parse('} void f() {')}
|
469
|
+
assert_raise(C::ParseError){C::Break.parse(';;')}
|
470
|
+
assert_raise(C::ParseError){C::Break.parse('int i;')}
|
471
|
+
assert_raise(C::ParseError){C::Break.parse(';')}
|
472
|
+
assert_raise(C::ParseError){C::Break.parse('')}
|
476
473
|
end
|
477
474
|
|
478
475
|
def test_return
|
@@ -488,11 +485,11 @@ Return
|
|
488
485
|
expr: IntLiteral
|
489
486
|
val: 10
|
490
487
|
EOS
|
491
|
-
assert_raise(ParseError){C::Return.parse('} void f() {')}
|
492
|
-
assert_raise(ParseError){C::Return.parse(';;')}
|
493
|
-
assert_raise(ParseError){C::Return.parse('int i;')}
|
494
|
-
assert_raise(ParseError){C::Return.parse(';')}
|
495
|
-
assert_raise(ParseError){C::Return.parse('')}
|
488
|
+
assert_raise(C::ParseError){C::Return.parse('} void f() {')}
|
489
|
+
assert_raise(C::ParseError){C::Return.parse(';;')}
|
490
|
+
assert_raise(C::ParseError){C::Return.parse('int i;')}
|
491
|
+
assert_raise(C::ParseError){C::Return.parse(';')}
|
492
|
+
assert_raise(C::ParseError){C::Return.parse('')}
|
496
493
|
end
|
497
494
|
|
498
495
|
def test_expression_statement
|
@@ -508,11 +505,11 @@ ExpressionStatement
|
|
508
505
|
expr: IntLiteral
|
509
506
|
val: 10
|
510
507
|
EOS
|
511
|
-
assert_raise(ParseError){C::ExpressionStatement.parse('} void f() {')}
|
512
|
-
assert_raise(ParseError){C::ExpressionStatement.parse(';;')}
|
513
|
-
assert_raise(ParseError){C::ExpressionStatement.parse('int i;')}
|
514
|
-
assert_raise(ParseError){C::ExpressionStatement.parse('return;')}
|
515
|
-
assert_raise(ParseError){C::ExpressionStatement.parse('')}
|
508
|
+
assert_raise(C::ParseError){C::ExpressionStatement.parse('} void f() {')}
|
509
|
+
assert_raise(C::ParseError){C::ExpressionStatement.parse(';;')}
|
510
|
+
assert_raise(C::ParseError){C::ExpressionStatement.parse('int i;')}
|
511
|
+
assert_raise(C::ParseError){C::ExpressionStatement.parse('return;')}
|
512
|
+
assert_raise(C::ParseError){C::ExpressionStatement.parse('')}
|
516
513
|
end
|
517
514
|
|
518
515
|
def test_statement
|
@@ -590,10 +587,10 @@ EOS
|
|
590
587
|
----
|
591
588
|
ExpressionStatement
|
592
589
|
EOS
|
593
|
-
assert_raise(ParseError){C::Statement.parse('} void f() {')}
|
594
|
-
assert_raise(ParseError){C::Statement.parse(';;')}
|
595
|
-
assert_raise(ParseError){C::Statement.parse('int i;')}
|
596
|
-
assert_raise(ParseError){C::Statement.parse('')}
|
590
|
+
assert_raise(C::ParseError){C::Statement.parse('} void f() {')}
|
591
|
+
assert_raise(C::ParseError){C::Statement.parse(';;')}
|
592
|
+
assert_raise(C::ParseError){C::Statement.parse('int i;')}
|
593
|
+
assert_raise(C::ParseError){C::Statement.parse('')}
|
597
594
|
end
|
598
595
|
|
599
596
|
def test_plain_label
|
@@ -603,12 +600,12 @@ x:
|
|
603
600
|
PlainLabel
|
604
601
|
name: "x"
|
605
602
|
EOS
|
606
|
-
assert_raise(ParseError){C::PlainLabel.parse('} void f() {')}
|
607
|
-
assert_raise(ParseError){C::PlainLabel.parse(';')}
|
608
|
-
assert_raise(ParseError){C::PlainLabel.parse('')}
|
609
|
-
assert_raise(ParseError){C::PlainLabel.parse('x')}
|
610
|
-
assert_raise(ParseError){C::PlainLabel.parse('case 1:')}
|
611
|
-
assert_raise(ParseError){C::PlainLabel.parse('default:')}
|
603
|
+
assert_raise(C::ParseError){C::PlainLabel.parse('} void f() {')}
|
604
|
+
assert_raise(C::ParseError){C::PlainLabel.parse(';')}
|
605
|
+
assert_raise(C::ParseError){C::PlainLabel.parse('')}
|
606
|
+
assert_raise(C::ParseError){C::PlainLabel.parse('x')}
|
607
|
+
assert_raise(C::ParseError){C::PlainLabel.parse('case 1:')}
|
608
|
+
assert_raise(C::ParseError){C::PlainLabel.parse('default:')}
|
612
609
|
end
|
613
610
|
|
614
611
|
def test_default
|
@@ -617,12 +614,12 @@ default:
|
|
617
614
|
----
|
618
615
|
Default
|
619
616
|
EOS
|
620
|
-
assert_raise(ParseError){C::Default.parse('} void f() {')}
|
621
|
-
assert_raise(ParseError){C::Default.parse(';')}
|
622
|
-
assert_raise(ParseError){C::Default.parse('')}
|
623
|
-
assert_raise(ParseError){C::Default.parse('x')}
|
624
|
-
assert_raise(ParseError){C::Default.parse('x:')}
|
625
|
-
assert_raise(ParseError){C::Default.parse('case 1:')}
|
617
|
+
assert_raise(C::ParseError){C::Default.parse('} void f() {')}
|
618
|
+
assert_raise(C::ParseError){C::Default.parse(';')}
|
619
|
+
assert_raise(C::ParseError){C::Default.parse('')}
|
620
|
+
assert_raise(C::ParseError){C::Default.parse('x')}
|
621
|
+
assert_raise(C::ParseError){C::Default.parse('x:')}
|
622
|
+
assert_raise(C::ParseError){C::Default.parse('case 1:')}
|
626
623
|
end
|
627
624
|
|
628
625
|
def test_case
|
@@ -633,11 +630,11 @@ Case
|
|
633
630
|
expr: IntLiteral
|
634
631
|
val: 1
|
635
632
|
EOS
|
636
|
-
assert_raise(ParseError){C::Case.parse('} void f() {')}
|
637
|
-
assert_raise(ParseError){C::Case.parse(';')}
|
638
|
-
assert_raise(ParseError){C::Case.parse('')}
|
639
|
-
assert_raise(ParseError){C::Case.parse('x:')}
|
640
|
-
assert_raise(ParseError){C::Case.parse('default:')}
|
633
|
+
assert_raise(C::ParseError){C::Case.parse('} void f() {')}
|
634
|
+
assert_raise(C::ParseError){C::Case.parse(';')}
|
635
|
+
assert_raise(C::ParseError){C::Case.parse('')}
|
636
|
+
assert_raise(C::ParseError){C::Case.parse('x:')}
|
637
|
+
assert_raise(C::ParseError){C::Case.parse('default:')}
|
641
638
|
end
|
642
639
|
|
643
640
|
def test_label
|
@@ -659,10 +656,10 @@ Case
|
|
659
656
|
expr: IntLiteral
|
660
657
|
val: 1
|
661
658
|
EOS
|
662
|
-
assert_raise(ParseError){C::Label.parse('} void f() {')}
|
663
|
-
assert_raise(ParseError){C::Label.parse(';')}
|
664
|
-
assert_raise(ParseError){C::Label.parse('')}
|
665
|
-
assert_raise(ParseError){C::Label.parse('x')}
|
659
|
+
assert_raise(C::ParseError){C::Label.parse('} void f() {')}
|
660
|
+
assert_raise(C::ParseError){C::Label.parse(';')}
|
661
|
+
assert_raise(C::ParseError){C::Label.parse('')}
|
662
|
+
assert_raise(C::ParseError){C::Label.parse('x')}
|
666
663
|
end
|
667
664
|
|
668
665
|
def test_comma
|
@@ -690,15 +687,15 @@ Comma
|
|
690
687
|
expr: Variable
|
691
688
|
name: "j"
|
692
689
|
EOS
|
693
|
-
assert_raise(ParseError){C::Comma.parse('} void f() {')}
|
694
|
-
assert_raise(ParseError){C::Comma.parse(';')}
|
695
|
-
assert_raise(ParseError){C::Comma.parse('int i')}
|
696
|
-
assert_raise(ParseError){C::Comma.parse('int')}
|
697
|
-
assert_raise(ParseError){C::Comma.parse('if (0)')}
|
698
|
-
assert_raise(ParseError){C::Comma.parse('switch (0)')}
|
699
|
-
assert_raise(ParseError){C::Comma.parse('for (;;)')}
|
700
|
-
assert_raise(ParseError){C::Comma.parse('goto')}
|
701
|
-
assert_raise(ParseError){C::Comma.parse('return')}
|
690
|
+
assert_raise(C::ParseError){C::Comma.parse('} void f() {')}
|
691
|
+
assert_raise(C::ParseError){C::Comma.parse(';')}
|
692
|
+
assert_raise(C::ParseError){C::Comma.parse('int i')}
|
693
|
+
assert_raise(C::ParseError){C::Comma.parse('int')}
|
694
|
+
assert_raise(C::ParseError){C::Comma.parse('if (0)')}
|
695
|
+
assert_raise(C::ParseError){C::Comma.parse('switch (0)')}
|
696
|
+
assert_raise(C::ParseError){C::Comma.parse('for (;;)')}
|
697
|
+
assert_raise(C::ParseError){C::Comma.parse('goto')}
|
698
|
+
assert_raise(C::ParseError){C::Comma.parse('return')}
|
702
699
|
end
|
703
700
|
|
704
701
|
def test_conditional
|
@@ -713,15 +710,15 @@ Conditional
|
|
713
710
|
else: IntLiteral
|
714
711
|
val: 20
|
715
712
|
EOS
|
716
|
-
assert_raise(ParseError){C::Conditional.parse('} void f() {')}
|
717
|
-
assert_raise(ParseError){C::Conditional.parse(';')}
|
718
|
-
assert_raise(ParseError){C::Conditional.parse('int i')}
|
719
|
-
assert_raise(ParseError){C::Conditional.parse('int')}
|
720
|
-
assert_raise(ParseError){C::Conditional.parse('if (0)')}
|
721
|
-
assert_raise(ParseError){C::Conditional.parse('switch (0)')}
|
722
|
-
assert_raise(ParseError){C::Conditional.parse('for (;;)')}
|
723
|
-
assert_raise(ParseError){C::Conditional.parse('goto')}
|
724
|
-
assert_raise(ParseError){C::Conditional.parse('return')}
|
713
|
+
assert_raise(C::ParseError){C::Conditional.parse('} void f() {')}
|
714
|
+
assert_raise(C::ParseError){C::Conditional.parse(';')}
|
715
|
+
assert_raise(C::ParseError){C::Conditional.parse('int i')}
|
716
|
+
assert_raise(C::ParseError){C::Conditional.parse('int')}
|
717
|
+
assert_raise(C::ParseError){C::Conditional.parse('if (0)')}
|
718
|
+
assert_raise(C::ParseError){C::Conditional.parse('switch (0)')}
|
719
|
+
assert_raise(C::ParseError){C::Conditional.parse('for (;;)')}
|
720
|
+
assert_raise(C::ParseError){C::Conditional.parse('goto')}
|
721
|
+
assert_raise(C::ParseError){C::Conditional.parse('return')}
|
725
722
|
end
|
726
723
|
|
727
724
|
def test_cast
|
@@ -733,15 +730,15 @@ Cast
|
|
733
730
|
expr: FloatLiteral
|
734
731
|
val: 10.0
|
735
732
|
EOS
|
736
|
-
assert_raise(ParseError){C::Cast.parse('} void f() {')}
|
737
|
-
assert_raise(ParseError){C::Cast.parse(';')}
|
738
|
-
assert_raise(ParseError){C::Cast.parse('int i')}
|
739
|
-
assert_raise(ParseError){C::Cast.parse('int')}
|
740
|
-
assert_raise(ParseError){C::Cast.parse('if (0)')}
|
741
|
-
assert_raise(ParseError){C::Cast.parse('switch (0)')}
|
742
|
-
assert_raise(ParseError){C::Cast.parse('for (;;)')}
|
743
|
-
assert_raise(ParseError){C::Cast.parse('goto')}
|
744
|
-
assert_raise(ParseError){C::Cast.parse('return')}
|
733
|
+
assert_raise(C::ParseError){C::Cast.parse('} void f() {')}
|
734
|
+
assert_raise(C::ParseError){C::Cast.parse(';')}
|
735
|
+
assert_raise(C::ParseError){C::Cast.parse('int i')}
|
736
|
+
assert_raise(C::ParseError){C::Cast.parse('int')}
|
737
|
+
assert_raise(C::ParseError){C::Cast.parse('if (0)')}
|
738
|
+
assert_raise(C::ParseError){C::Cast.parse('switch (0)')}
|
739
|
+
assert_raise(C::ParseError){C::Cast.parse('for (;;)')}
|
740
|
+
assert_raise(C::ParseError){C::Cast.parse('goto')}
|
741
|
+
assert_raise(C::ParseError){C::Cast.parse('return')}
|
745
742
|
end
|
746
743
|
|
747
744
|
def test_address
|
@@ -752,15 +749,15 @@ Address
|
|
752
749
|
expr: Variable
|
753
750
|
name: "x"
|
754
751
|
EOS
|
755
|
-
assert_raise(ParseError){C::Address.parse('} void f() {')}
|
756
|
-
assert_raise(ParseError){C::Address.parse(';')}
|
757
|
-
assert_raise(ParseError){C::Address.parse('int i')}
|
758
|
-
assert_raise(ParseError){C::Address.parse('int')}
|
759
|
-
assert_raise(ParseError){C::Address.parse('if (0)')}
|
760
|
-
assert_raise(ParseError){C::Address.parse('switch (0)')}
|
761
|
-
assert_raise(ParseError){C::Address.parse('for (;;)')}
|
762
|
-
assert_raise(ParseError){C::Address.parse('goto')}
|
763
|
-
assert_raise(ParseError){C::Address.parse('return')}
|
752
|
+
assert_raise(C::ParseError){C::Address.parse('} void f() {')}
|
753
|
+
assert_raise(C::ParseError){C::Address.parse(';')}
|
754
|
+
assert_raise(C::ParseError){C::Address.parse('int i')}
|
755
|
+
assert_raise(C::ParseError){C::Address.parse('int')}
|
756
|
+
assert_raise(C::ParseError){C::Address.parse('if (0)')}
|
757
|
+
assert_raise(C::ParseError){C::Address.parse('switch (0)')}
|
758
|
+
assert_raise(C::ParseError){C::Address.parse('for (;;)')}
|
759
|
+
assert_raise(C::ParseError){C::Address.parse('goto')}
|
760
|
+
assert_raise(C::ParseError){C::Address.parse('return')}
|
764
761
|
end
|
765
762
|
|
766
763
|
def test_dereference
|
@@ -771,15 +768,15 @@ Dereference
|
|
771
768
|
expr: Variable
|
772
769
|
name: "x"
|
773
770
|
EOS
|
774
|
-
assert_raise(ParseError){C::Dereference.parse('} void f() {')}
|
775
|
-
assert_raise(ParseError){C::Dereference.parse(';')}
|
776
|
-
assert_raise(ParseError){C::Dereference.parse('int i')}
|
777
|
-
assert_raise(ParseError){C::Dereference.parse('int')}
|
778
|
-
assert_raise(ParseError){C::Dereference.parse('if (0)')}
|
779
|
-
assert_raise(ParseError){C::Dereference.parse('switch (0)')}
|
780
|
-
assert_raise(ParseError){C::Dereference.parse('for (;;)')}
|
781
|
-
assert_raise(ParseError){C::Dereference.parse('goto')}
|
782
|
-
assert_raise(ParseError){C::Dereference.parse('return')}
|
771
|
+
assert_raise(C::ParseError){C::Dereference.parse('} void f() {')}
|
772
|
+
assert_raise(C::ParseError){C::Dereference.parse(';')}
|
773
|
+
assert_raise(C::ParseError){C::Dereference.parse('int i')}
|
774
|
+
assert_raise(C::ParseError){C::Dereference.parse('int')}
|
775
|
+
assert_raise(C::ParseError){C::Dereference.parse('if (0)')}
|
776
|
+
assert_raise(C::ParseError){C::Dereference.parse('switch (0)')}
|
777
|
+
assert_raise(C::ParseError){C::Dereference.parse('for (;;)')}
|
778
|
+
assert_raise(C::ParseError){C::Dereference.parse('goto')}
|
779
|
+
assert_raise(C::ParseError){C::Dereference.parse('return')}
|
783
780
|
end
|
784
781
|
|
785
782
|
def test_sizeof
|
@@ -796,15 +793,15 @@ sizeof(int)
|
|
796
793
|
Sizeof
|
797
794
|
expr: Int
|
798
795
|
EOS
|
799
|
-
assert_raise(ParseError){C::Sizeof.parse('} void f() {')}
|
800
|
-
assert_raise(ParseError){C::Sizeof.parse(';')}
|
801
|
-
assert_raise(ParseError){C::Sizeof.parse('int i')}
|
802
|
-
assert_raise(ParseError){C::Sizeof.parse('int')}
|
803
|
-
assert_raise(ParseError){C::Sizeof.parse('if (0)')}
|
804
|
-
assert_raise(ParseError){C::Sizeof.parse('switch (0)')}
|
805
|
-
assert_raise(ParseError){C::Sizeof.parse('for (;;)')}
|
806
|
-
assert_raise(ParseError){C::Sizeof.parse('goto')}
|
807
|
-
assert_raise(ParseError){C::Sizeof.parse('return')}
|
796
|
+
assert_raise(C::ParseError){C::Sizeof.parse('} void f() {')}
|
797
|
+
assert_raise(C::ParseError){C::Sizeof.parse(';')}
|
798
|
+
assert_raise(C::ParseError){C::Sizeof.parse('int i')}
|
799
|
+
assert_raise(C::ParseError){C::Sizeof.parse('int')}
|
800
|
+
assert_raise(C::ParseError){C::Sizeof.parse('if (0)')}
|
801
|
+
assert_raise(C::ParseError){C::Sizeof.parse('switch (0)')}
|
802
|
+
assert_raise(C::ParseError){C::Sizeof.parse('for (;;)')}
|
803
|
+
assert_raise(C::ParseError){C::Sizeof.parse('goto')}
|
804
|
+
assert_raise(C::ParseError){C::Sizeof.parse('return')}
|
808
805
|
end
|
809
806
|
|
810
807
|
def test_index
|
@@ -820,15 +817,15 @@ Index
|
|
820
817
|
index: IntLiteral
|
821
818
|
val: 20
|
822
819
|
EOS
|
823
|
-
assert_raise(ParseError){C::Index.parse('} void f() {')}
|
824
|
-
assert_raise(ParseError){C::Index.parse(';')}
|
825
|
-
assert_raise(ParseError){C::Index.parse('int i')}
|
826
|
-
assert_raise(ParseError){C::Index.parse('int')}
|
827
|
-
assert_raise(ParseError){C::Index.parse('if (0)')}
|
828
|
-
assert_raise(ParseError){C::Index.parse('switch (0)')}
|
829
|
-
assert_raise(ParseError){C::Index.parse('for (;;)')}
|
830
|
-
assert_raise(ParseError){C::Index.parse('goto')}
|
831
|
-
assert_raise(ParseError){C::Index.parse('return')}
|
820
|
+
assert_raise(C::ParseError){C::Index.parse('} void f() {')}
|
821
|
+
assert_raise(C::ParseError){C::Index.parse(';')}
|
822
|
+
assert_raise(C::ParseError){C::Index.parse('int i')}
|
823
|
+
assert_raise(C::ParseError){C::Index.parse('int')}
|
824
|
+
assert_raise(C::ParseError){C::Index.parse('if (0)')}
|
825
|
+
assert_raise(C::ParseError){C::Index.parse('switch (0)')}
|
826
|
+
assert_raise(C::ParseError){C::Index.parse('for (;;)')}
|
827
|
+
assert_raise(C::ParseError){C::Index.parse('goto')}
|
828
|
+
assert_raise(C::ParseError){C::Index.parse('return')}
|
832
829
|
end
|
833
830
|
|
834
831
|
def test_call
|
@@ -845,15 +842,15 @@ Call
|
|
845
842
|
- IntLiteral
|
846
843
|
val: 20
|
847
844
|
EOS
|
848
|
-
assert_raise(ParseError){C::Call.parse('} void f() {')}
|
849
|
-
assert_raise(ParseError){C::Call.parse(';')}
|
850
|
-
assert_raise(ParseError){C::Call.parse('int i')}
|
851
|
-
assert_raise(ParseError){C::Call.parse('int')}
|
852
|
-
assert_raise(ParseError){C::Call.parse('if (0)')}
|
853
|
-
assert_raise(ParseError){C::Call.parse('switch (0)')}
|
854
|
-
assert_raise(ParseError){C::Call.parse('for (;;)')}
|
855
|
-
assert_raise(ParseError){C::Call.parse('goto')}
|
856
|
-
assert_raise(ParseError){C::Call.parse('return')}
|
845
|
+
assert_raise(C::ParseError){C::Call.parse('} void f() {')}
|
846
|
+
assert_raise(C::ParseError){C::Call.parse(';')}
|
847
|
+
assert_raise(C::ParseError){C::Call.parse('int i')}
|
848
|
+
assert_raise(C::ParseError){C::Call.parse('int')}
|
849
|
+
assert_raise(C::ParseError){C::Call.parse('if (0)')}
|
850
|
+
assert_raise(C::ParseError){C::Call.parse('switch (0)')}
|
851
|
+
assert_raise(C::ParseError){C::Call.parse('for (;;)')}
|
852
|
+
assert_raise(C::ParseError){C::Call.parse('goto')}
|
853
|
+
assert_raise(C::ParseError){C::Call.parse('return')}
|
857
854
|
end
|
858
855
|
|
859
856
|
def test_arrow
|
@@ -866,15 +863,15 @@ Arrow
|
|
866
863
|
member: Member
|
867
864
|
name: "y"
|
868
865
|
EOS
|
869
|
-
assert_raise(ParseError){C::Arrow.parse('} void f() {')}
|
870
|
-
assert_raise(ParseError){C::Arrow.parse(';')}
|
871
|
-
assert_raise(ParseError){C::Arrow.parse('int i')}
|
872
|
-
assert_raise(ParseError){C::Arrow.parse('int')}
|
873
|
-
assert_raise(ParseError){C::Arrow.parse('if (0)')}
|
874
|
-
assert_raise(ParseError){C::Arrow.parse('switch (0)')}
|
875
|
-
assert_raise(ParseError){C::Arrow.parse('for (;;)')}
|
876
|
-
assert_raise(ParseError){C::Arrow.parse('goto')}
|
877
|
-
assert_raise(ParseError){C::Arrow.parse('return')}
|
866
|
+
assert_raise(C::ParseError){C::Arrow.parse('} void f() {')}
|
867
|
+
assert_raise(C::ParseError){C::Arrow.parse(';')}
|
868
|
+
assert_raise(C::ParseError){C::Arrow.parse('int i')}
|
869
|
+
assert_raise(C::ParseError){C::Arrow.parse('int')}
|
870
|
+
assert_raise(C::ParseError){C::Arrow.parse('if (0)')}
|
871
|
+
assert_raise(C::ParseError){C::Arrow.parse('switch (0)')}
|
872
|
+
assert_raise(C::ParseError){C::Arrow.parse('for (;;)')}
|
873
|
+
assert_raise(C::ParseError){C::Arrow.parse('goto')}
|
874
|
+
assert_raise(C::ParseError){C::Arrow.parse('return')}
|
878
875
|
end
|
879
876
|
|
880
877
|
def test_dot
|
@@ -887,15 +884,15 @@ Dot
|
|
887
884
|
member: Member
|
888
885
|
name: "y"
|
889
886
|
EOS
|
890
|
-
assert_raise(ParseError){C::Dot.parse('} void f() {')}
|
891
|
-
assert_raise(ParseError){C::Dot.parse(';')}
|
892
|
-
assert_raise(ParseError){C::Dot.parse('int i')}
|
893
|
-
assert_raise(ParseError){C::Dot.parse('int')}
|
894
|
-
assert_raise(ParseError){C::Dot.parse('if (0)')}
|
895
|
-
assert_raise(ParseError){C::Dot.parse('switch (0)')}
|
896
|
-
assert_raise(ParseError){C::Dot.parse('for (;;)')}
|
897
|
-
assert_raise(ParseError){C::Dot.parse('goto')}
|
898
|
-
assert_raise(ParseError){C::Dot.parse('return')}
|
887
|
+
assert_raise(C::ParseError){C::Dot.parse('} void f() {')}
|
888
|
+
assert_raise(C::ParseError){C::Dot.parse(';')}
|
889
|
+
assert_raise(C::ParseError){C::Dot.parse('int i')}
|
890
|
+
assert_raise(C::ParseError){C::Dot.parse('int')}
|
891
|
+
assert_raise(C::ParseError){C::Dot.parse('if (0)')}
|
892
|
+
assert_raise(C::ParseError){C::Dot.parse('switch (0)')}
|
893
|
+
assert_raise(C::ParseError){C::Dot.parse('for (;;)')}
|
894
|
+
assert_raise(C::ParseError){C::Dot.parse('goto')}
|
895
|
+
assert_raise(C::ParseError){C::Dot.parse('return')}
|
899
896
|
end
|
900
897
|
|
901
898
|
def test_positive
|
@@ -906,15 +903,15 @@ Positive
|
|
906
903
|
expr: IntLiteral
|
907
904
|
val: 1
|
908
905
|
EOS
|
909
|
-
assert_raise(ParseError){C::Positive.parse('} void f() {')}
|
910
|
-
assert_raise(ParseError){C::Positive.parse(';')}
|
911
|
-
assert_raise(ParseError){C::Positive.parse('int i')}
|
912
|
-
assert_raise(ParseError){C::Positive.parse('int')}
|
913
|
-
assert_raise(ParseError){C::Positive.parse('if (0)')}
|
914
|
-
assert_raise(ParseError){C::Positive.parse('switch (0)')}
|
915
|
-
assert_raise(ParseError){C::Positive.parse('for (;;)')}
|
916
|
-
assert_raise(ParseError){C::Positive.parse('goto')}
|
917
|
-
assert_raise(ParseError){C::Positive.parse('return')}
|
906
|
+
assert_raise(C::ParseError){C::Positive.parse('} void f() {')}
|
907
|
+
assert_raise(C::ParseError){C::Positive.parse(';')}
|
908
|
+
assert_raise(C::ParseError){C::Positive.parse('int i')}
|
909
|
+
assert_raise(C::ParseError){C::Positive.parse('int')}
|
910
|
+
assert_raise(C::ParseError){C::Positive.parse('if (0)')}
|
911
|
+
assert_raise(C::ParseError){C::Positive.parse('switch (0)')}
|
912
|
+
assert_raise(C::ParseError){C::Positive.parse('for (;;)')}
|
913
|
+
assert_raise(C::ParseError){C::Positive.parse('goto')}
|
914
|
+
assert_raise(C::ParseError){C::Positive.parse('return')}
|
918
915
|
end
|
919
916
|
|
920
917
|
def test_negative
|
@@ -925,15 +922,15 @@ Negative
|
|
925
922
|
expr: IntLiteral
|
926
923
|
val: 1
|
927
924
|
EOS
|
928
|
-
assert_raise(ParseError){C::Negative.parse('} void f() {')}
|
929
|
-
assert_raise(ParseError){C::Negative.parse(';')}
|
930
|
-
assert_raise(ParseError){C::Negative.parse('int i')}
|
931
|
-
assert_raise(ParseError){C::Negative.parse('int')}
|
932
|
-
assert_raise(ParseError){C::Negative.parse('if (0)')}
|
933
|
-
assert_raise(ParseError){C::Negative.parse('switch (0)')}
|
934
|
-
assert_raise(ParseError){C::Negative.parse('for (;;)')}
|
935
|
-
assert_raise(ParseError){C::Negative.parse('goto')}
|
936
|
-
assert_raise(ParseError){C::Negative.parse('return')}
|
925
|
+
assert_raise(C::ParseError){C::Negative.parse('} void f() {')}
|
926
|
+
assert_raise(C::ParseError){C::Negative.parse(';')}
|
927
|
+
assert_raise(C::ParseError){C::Negative.parse('int i')}
|
928
|
+
assert_raise(C::ParseError){C::Negative.parse('int')}
|
929
|
+
assert_raise(C::ParseError){C::Negative.parse('if (0)')}
|
930
|
+
assert_raise(C::ParseError){C::Negative.parse('switch (0)')}
|
931
|
+
assert_raise(C::ParseError){C::Negative.parse('for (;;)')}
|
932
|
+
assert_raise(C::ParseError){C::Negative.parse('goto')}
|
933
|
+
assert_raise(C::ParseError){C::Negative.parse('return')}
|
937
934
|
end
|
938
935
|
|
939
936
|
def test_add
|
@@ -946,15 +943,15 @@ Add
|
|
946
943
|
expr2: IntLiteral
|
947
944
|
val: 10
|
948
945
|
EOS
|
949
|
-
assert_raise(ParseError){C::Add.parse('} void f() {')}
|
950
|
-
assert_raise(ParseError){C::Add.parse(';')}
|
951
|
-
assert_raise(ParseError){C::Add.parse('int i')}
|
952
|
-
assert_raise(ParseError){C::Add.parse('int')}
|
953
|
-
assert_raise(ParseError){C::Add.parse('if (0)')}
|
954
|
-
assert_raise(ParseError){C::Add.parse('switch (0)')}
|
955
|
-
assert_raise(ParseError){C::Add.parse('for (;;)')}
|
956
|
-
assert_raise(ParseError){C::Add.parse('goto')}
|
957
|
-
assert_raise(ParseError){C::Add.parse('return')}
|
946
|
+
assert_raise(C::ParseError){C::Add.parse('} void f() {')}
|
947
|
+
assert_raise(C::ParseError){C::Add.parse(';')}
|
948
|
+
assert_raise(C::ParseError){C::Add.parse('int i')}
|
949
|
+
assert_raise(C::ParseError){C::Add.parse('int')}
|
950
|
+
assert_raise(C::ParseError){C::Add.parse('if (0)')}
|
951
|
+
assert_raise(C::ParseError){C::Add.parse('switch (0)')}
|
952
|
+
assert_raise(C::ParseError){C::Add.parse('for (;;)')}
|
953
|
+
assert_raise(C::ParseError){C::Add.parse('goto')}
|
954
|
+
assert_raise(C::ParseError){C::Add.parse('return')}
|
958
955
|
end
|
959
956
|
|
960
957
|
def test_subtract
|
@@ -967,15 +964,15 @@ Subtract
|
|
967
964
|
expr2: IntLiteral
|
968
965
|
val: 10
|
969
966
|
EOS
|
970
|
-
assert_raise(ParseError){C::Subtract.parse('} void f() {')}
|
971
|
-
assert_raise(ParseError){C::Subtract.parse(';')}
|
972
|
-
assert_raise(ParseError){C::Subtract.parse('int i')}
|
973
|
-
assert_raise(ParseError){C::Subtract.parse('int')}
|
974
|
-
assert_raise(ParseError){C::Subtract.parse('if (0)')}
|
975
|
-
assert_raise(ParseError){C::Subtract.parse('switch (0)')}
|
976
|
-
assert_raise(ParseError){C::Subtract.parse('for (;;)')}
|
977
|
-
assert_raise(ParseError){C::Subtract.parse('goto')}
|
978
|
-
assert_raise(ParseError){C::Subtract.parse('return')}
|
967
|
+
assert_raise(C::ParseError){C::Subtract.parse('} void f() {')}
|
968
|
+
assert_raise(C::ParseError){C::Subtract.parse(';')}
|
969
|
+
assert_raise(C::ParseError){C::Subtract.parse('int i')}
|
970
|
+
assert_raise(C::ParseError){C::Subtract.parse('int')}
|
971
|
+
assert_raise(C::ParseError){C::Subtract.parse('if (0)')}
|
972
|
+
assert_raise(C::ParseError){C::Subtract.parse('switch (0)')}
|
973
|
+
assert_raise(C::ParseError){C::Subtract.parse('for (;;)')}
|
974
|
+
assert_raise(C::ParseError){C::Subtract.parse('goto')}
|
975
|
+
assert_raise(C::ParseError){C::Subtract.parse('return')}
|
979
976
|
end
|
980
977
|
|
981
978
|
def test_multiply
|
@@ -988,15 +985,15 @@ Multiply
|
|
988
985
|
expr2: IntLiteral
|
989
986
|
val: 10
|
990
987
|
EOS
|
991
|
-
assert_raise(ParseError){C::Multiply.parse('} void f() {')}
|
992
|
-
assert_raise(ParseError){C::Multiply.parse(';')}
|
993
|
-
assert_raise(ParseError){C::Multiply.parse('int i')}
|
994
|
-
assert_raise(ParseError){C::Multiply.parse('int')}
|
995
|
-
assert_raise(ParseError){C::Multiply.parse('if (0)')}
|
996
|
-
assert_raise(ParseError){C::Multiply.parse('switch (0)')}
|
997
|
-
assert_raise(ParseError){C::Multiply.parse('for (;;)')}
|
998
|
-
assert_raise(ParseError){C::Multiply.parse('goto')}
|
999
|
-
assert_raise(ParseError){C::Multiply.parse('return')}
|
988
|
+
assert_raise(C::ParseError){C::Multiply.parse('} void f() {')}
|
989
|
+
assert_raise(C::ParseError){C::Multiply.parse(';')}
|
990
|
+
assert_raise(C::ParseError){C::Multiply.parse('int i')}
|
991
|
+
assert_raise(C::ParseError){C::Multiply.parse('int')}
|
992
|
+
assert_raise(C::ParseError){C::Multiply.parse('if (0)')}
|
993
|
+
assert_raise(C::ParseError){C::Multiply.parse('switch (0)')}
|
994
|
+
assert_raise(C::ParseError){C::Multiply.parse('for (;;)')}
|
995
|
+
assert_raise(C::ParseError){C::Multiply.parse('goto')}
|
996
|
+
assert_raise(C::ParseError){C::Multiply.parse('return')}
|
1000
997
|
end
|
1001
998
|
|
1002
999
|
def test_divide
|
@@ -1009,15 +1006,15 @@ Divide
|
|
1009
1006
|
expr2: IntLiteral
|
1010
1007
|
val: 10
|
1011
1008
|
EOS
|
1012
|
-
assert_raise(ParseError){C::Divide.parse('} void f() {')}
|
1013
|
-
assert_raise(ParseError){C::Divide.parse(';')}
|
1014
|
-
assert_raise(ParseError){C::Divide.parse('int i')}
|
1015
|
-
assert_raise(ParseError){C::Divide.parse('int')}
|
1016
|
-
assert_raise(ParseError){C::Divide.parse('if (0)')}
|
1017
|
-
assert_raise(ParseError){C::Divide.parse('switch (0)')}
|
1018
|
-
assert_raise(ParseError){C::Divide.parse('for (;;)')}
|
1019
|
-
assert_raise(ParseError){C::Divide.parse('goto')}
|
1020
|
-
assert_raise(ParseError){C::Divide.parse('return')}
|
1009
|
+
assert_raise(C::ParseError){C::Divide.parse('} void f() {')}
|
1010
|
+
assert_raise(C::ParseError){C::Divide.parse(';')}
|
1011
|
+
assert_raise(C::ParseError){C::Divide.parse('int i')}
|
1012
|
+
assert_raise(C::ParseError){C::Divide.parse('int')}
|
1013
|
+
assert_raise(C::ParseError){C::Divide.parse('if (0)')}
|
1014
|
+
assert_raise(C::ParseError){C::Divide.parse('switch (0)')}
|
1015
|
+
assert_raise(C::ParseError){C::Divide.parse('for (;;)')}
|
1016
|
+
assert_raise(C::ParseError){C::Divide.parse('goto')}
|
1017
|
+
assert_raise(C::ParseError){C::Divide.parse('return')}
|
1021
1018
|
end
|
1022
1019
|
|
1023
1020
|
def test_mod
|
@@ -1030,15 +1027,15 @@ Mod
|
|
1030
1027
|
expr2: IntLiteral
|
1031
1028
|
val: 10
|
1032
1029
|
EOS
|
1033
|
-
assert_raise(ParseError){C::Mod.parse('} void f() {')}
|
1034
|
-
assert_raise(ParseError){C::Mod.parse(';')}
|
1035
|
-
assert_raise(ParseError){C::Mod.parse('int i')}
|
1036
|
-
assert_raise(ParseError){C::Mod.parse('int')}
|
1037
|
-
assert_raise(ParseError){C::Mod.parse('if (0)')}
|
1038
|
-
assert_raise(ParseError){C::Mod.parse('switch (0)')}
|
1039
|
-
assert_raise(ParseError){C::Mod.parse('for (;;)')}
|
1040
|
-
assert_raise(ParseError){C::Mod.parse('goto')}
|
1041
|
-
assert_raise(ParseError){C::Mod.parse('return')}
|
1030
|
+
assert_raise(C::ParseError){C::Mod.parse('} void f() {')}
|
1031
|
+
assert_raise(C::ParseError){C::Mod.parse(';')}
|
1032
|
+
assert_raise(C::ParseError){C::Mod.parse('int i')}
|
1033
|
+
assert_raise(C::ParseError){C::Mod.parse('int')}
|
1034
|
+
assert_raise(C::ParseError){C::Mod.parse('if (0)')}
|
1035
|
+
assert_raise(C::ParseError){C::Mod.parse('switch (0)')}
|
1036
|
+
assert_raise(C::ParseError){C::Mod.parse('for (;;)')}
|
1037
|
+
assert_raise(C::ParseError){C::Mod.parse('goto')}
|
1038
|
+
assert_raise(C::ParseError){C::Mod.parse('return')}
|
1042
1039
|
end
|
1043
1040
|
|
1044
1041
|
def test_pre_inc
|
@@ -1049,15 +1046,15 @@ PreInc
|
|
1049
1046
|
expr: Variable
|
1050
1047
|
name: "i"
|
1051
1048
|
EOS
|
1052
|
-
assert_raise(ParseError){C::PreInc.parse('} void f() {')}
|
1053
|
-
assert_raise(ParseError){C::PreInc.parse(';')}
|
1054
|
-
assert_raise(ParseError){C::PreInc.parse('int i')}
|
1055
|
-
assert_raise(ParseError){C::PreInc.parse('int')}
|
1056
|
-
assert_raise(ParseError){C::PreInc.parse('if (0)')}
|
1057
|
-
assert_raise(ParseError){C::PreInc.parse('switch (0)')}
|
1058
|
-
assert_raise(ParseError){C::PreInc.parse('for (;;)')}
|
1059
|
-
assert_raise(ParseError){C::PreInc.parse('goto')}
|
1060
|
-
assert_raise(ParseError){C::PreInc.parse('return')}
|
1049
|
+
assert_raise(C::ParseError){C::PreInc.parse('} void f() {')}
|
1050
|
+
assert_raise(C::ParseError){C::PreInc.parse(';')}
|
1051
|
+
assert_raise(C::ParseError){C::PreInc.parse('int i')}
|
1052
|
+
assert_raise(C::ParseError){C::PreInc.parse('int')}
|
1053
|
+
assert_raise(C::ParseError){C::PreInc.parse('if (0)')}
|
1054
|
+
assert_raise(C::ParseError){C::PreInc.parse('switch (0)')}
|
1055
|
+
assert_raise(C::ParseError){C::PreInc.parse('for (;;)')}
|
1056
|
+
assert_raise(C::ParseError){C::PreInc.parse('goto')}
|
1057
|
+
assert_raise(C::ParseError){C::PreInc.parse('return')}
|
1061
1058
|
end
|
1062
1059
|
|
1063
1060
|
def test_post_inc
|
@@ -1068,15 +1065,15 @@ PostInc
|
|
1068
1065
|
expr: Variable
|
1069
1066
|
name: "i"
|
1070
1067
|
EOS
|
1071
|
-
assert_raise(ParseError){C::PostInc.parse('} void f() {')}
|
1072
|
-
assert_raise(ParseError){C::PostInc.parse(';')}
|
1073
|
-
assert_raise(ParseError){C::PostInc.parse('int i')}
|
1074
|
-
assert_raise(ParseError){C::PostInc.parse('int')}
|
1075
|
-
assert_raise(ParseError){C::PostInc.parse('if (0)')}
|
1076
|
-
assert_raise(ParseError){C::PostInc.parse('switch (0)')}
|
1077
|
-
assert_raise(ParseError){C::PostInc.parse('for (;;)')}
|
1078
|
-
assert_raise(ParseError){C::PostInc.parse('goto')}
|
1079
|
-
assert_raise(ParseError){C::PostInc.parse('return')}
|
1068
|
+
assert_raise(C::ParseError){C::PostInc.parse('} void f() {')}
|
1069
|
+
assert_raise(C::ParseError){C::PostInc.parse(';')}
|
1070
|
+
assert_raise(C::ParseError){C::PostInc.parse('int i')}
|
1071
|
+
assert_raise(C::ParseError){C::PostInc.parse('int')}
|
1072
|
+
assert_raise(C::ParseError){C::PostInc.parse('if (0)')}
|
1073
|
+
assert_raise(C::ParseError){C::PostInc.parse('switch (0)')}
|
1074
|
+
assert_raise(C::ParseError){C::PostInc.parse('for (;;)')}
|
1075
|
+
assert_raise(C::ParseError){C::PostInc.parse('goto')}
|
1076
|
+
assert_raise(C::ParseError){C::PostInc.parse('return')}
|
1080
1077
|
end
|
1081
1078
|
|
1082
1079
|
def test_pre_dec
|
@@ -1087,15 +1084,15 @@ PreDec
|
|
1087
1084
|
expr: Variable
|
1088
1085
|
name: "i"
|
1089
1086
|
EOS
|
1090
|
-
assert_raise(ParseError){C::PreDec.parse('} void f() {')}
|
1091
|
-
assert_raise(ParseError){C::PreDec.parse(';')}
|
1092
|
-
assert_raise(ParseError){C::PreDec.parse('int i')}
|
1093
|
-
assert_raise(ParseError){C::PreDec.parse('int')}
|
1094
|
-
assert_raise(ParseError){C::PreDec.parse('if (0)')}
|
1095
|
-
assert_raise(ParseError){C::PreDec.parse('switch (0)')}
|
1096
|
-
assert_raise(ParseError){C::PreDec.parse('for (;;)')}
|
1097
|
-
assert_raise(ParseError){C::PreDec.parse('goto')}
|
1098
|
-
assert_raise(ParseError){C::PreDec.parse('return')}
|
1087
|
+
assert_raise(C::ParseError){C::PreDec.parse('} void f() {')}
|
1088
|
+
assert_raise(C::ParseError){C::PreDec.parse(';')}
|
1089
|
+
assert_raise(C::ParseError){C::PreDec.parse('int i')}
|
1090
|
+
assert_raise(C::ParseError){C::PreDec.parse('int')}
|
1091
|
+
assert_raise(C::ParseError){C::PreDec.parse('if (0)')}
|
1092
|
+
assert_raise(C::ParseError){C::PreDec.parse('switch (0)')}
|
1093
|
+
assert_raise(C::ParseError){C::PreDec.parse('for (;;)')}
|
1094
|
+
assert_raise(C::ParseError){C::PreDec.parse('goto')}
|
1095
|
+
assert_raise(C::ParseError){C::PreDec.parse('return')}
|
1099
1096
|
end
|
1100
1097
|
|
1101
1098
|
def test_post_dec
|
@@ -1106,15 +1103,15 @@ PostDec
|
|
1106
1103
|
expr: Variable
|
1107
1104
|
name: "i"
|
1108
1105
|
EOS
|
1109
|
-
assert_raise(ParseError){C::PostDec.parse('} void f() {')}
|
1110
|
-
assert_raise(ParseError){C::PostDec.parse(';')}
|
1111
|
-
assert_raise(ParseError){C::PostDec.parse('int i')}
|
1112
|
-
assert_raise(ParseError){C::PostDec.parse('int')}
|
1113
|
-
assert_raise(ParseError){C::PostDec.parse('if (0)')}
|
1114
|
-
assert_raise(ParseError){C::PostDec.parse('switch (0)')}
|
1115
|
-
assert_raise(ParseError){C::PostDec.parse('for (;;)')}
|
1116
|
-
assert_raise(ParseError){C::PostDec.parse('goto')}
|
1117
|
-
assert_raise(ParseError){C::PostDec.parse('return')}
|
1106
|
+
assert_raise(C::ParseError){C::PostDec.parse('} void f() {')}
|
1107
|
+
assert_raise(C::ParseError){C::PostDec.parse(';')}
|
1108
|
+
assert_raise(C::ParseError){C::PostDec.parse('int i')}
|
1109
|
+
assert_raise(C::ParseError){C::PostDec.parse('int')}
|
1110
|
+
assert_raise(C::ParseError){C::PostDec.parse('if (0)')}
|
1111
|
+
assert_raise(C::ParseError){C::PostDec.parse('switch (0)')}
|
1112
|
+
assert_raise(C::ParseError){C::PostDec.parse('for (;;)')}
|
1113
|
+
assert_raise(C::ParseError){C::PostDec.parse('goto')}
|
1114
|
+
assert_raise(C::ParseError){C::PostDec.parse('return')}
|
1118
1115
|
end
|
1119
1116
|
|
1120
1117
|
def test_equal
|
@@ -1127,15 +1124,15 @@ Equal
|
|
1127
1124
|
expr2: IntLiteral
|
1128
1125
|
val: 10
|
1129
1126
|
EOS
|
1130
|
-
assert_raise(ParseError){C::Equal.parse('} void f() {')}
|
1131
|
-
assert_raise(ParseError){C::Equal.parse(';')}
|
1132
|
-
assert_raise(ParseError){C::Equal.parse('int i')}
|
1133
|
-
assert_raise(ParseError){C::Equal.parse('int')}
|
1134
|
-
assert_raise(ParseError){C::Equal.parse('if (0)')}
|
1135
|
-
assert_raise(ParseError){C::Equal.parse('switch (0)')}
|
1136
|
-
assert_raise(ParseError){C::Equal.parse('for (;;)')}
|
1137
|
-
assert_raise(ParseError){C::Equal.parse('goto')}
|
1138
|
-
assert_raise(ParseError){C::Equal.parse('return')}
|
1127
|
+
assert_raise(C::ParseError){C::Equal.parse('} void f() {')}
|
1128
|
+
assert_raise(C::ParseError){C::Equal.parse(';')}
|
1129
|
+
assert_raise(C::ParseError){C::Equal.parse('int i')}
|
1130
|
+
assert_raise(C::ParseError){C::Equal.parse('int')}
|
1131
|
+
assert_raise(C::ParseError){C::Equal.parse('if (0)')}
|
1132
|
+
assert_raise(C::ParseError){C::Equal.parse('switch (0)')}
|
1133
|
+
assert_raise(C::ParseError){C::Equal.parse('for (;;)')}
|
1134
|
+
assert_raise(C::ParseError){C::Equal.parse('goto')}
|
1135
|
+
assert_raise(C::ParseError){C::Equal.parse('return')}
|
1139
1136
|
end
|
1140
1137
|
|
1141
1138
|
def test_not_equal
|
@@ -1148,15 +1145,15 @@ NotEqual
|
|
1148
1145
|
expr2: IntLiteral
|
1149
1146
|
val: 10
|
1150
1147
|
EOS
|
1151
|
-
assert_raise(ParseError){C::NotEqual.parse('} void f() {')}
|
1152
|
-
assert_raise(ParseError){C::NotEqual.parse(';')}
|
1153
|
-
assert_raise(ParseError){C::NotEqual.parse('int i')}
|
1154
|
-
assert_raise(ParseError){C::NotEqual.parse('int')}
|
1155
|
-
assert_raise(ParseError){C::NotEqual.parse('if (0)')}
|
1156
|
-
assert_raise(ParseError){C::NotEqual.parse('switch (0)')}
|
1157
|
-
assert_raise(ParseError){C::NotEqual.parse('for (;;)')}
|
1158
|
-
assert_raise(ParseError){C::NotEqual.parse('goto')}
|
1159
|
-
assert_raise(ParseError){C::NotEqual.parse('return')}
|
1148
|
+
assert_raise(C::ParseError){C::NotEqual.parse('} void f() {')}
|
1149
|
+
assert_raise(C::ParseError){C::NotEqual.parse(';')}
|
1150
|
+
assert_raise(C::ParseError){C::NotEqual.parse('int i')}
|
1151
|
+
assert_raise(C::ParseError){C::NotEqual.parse('int')}
|
1152
|
+
assert_raise(C::ParseError){C::NotEqual.parse('if (0)')}
|
1153
|
+
assert_raise(C::ParseError){C::NotEqual.parse('switch (0)')}
|
1154
|
+
assert_raise(C::ParseError){C::NotEqual.parse('for (;;)')}
|
1155
|
+
assert_raise(C::ParseError){C::NotEqual.parse('goto')}
|
1156
|
+
assert_raise(C::ParseError){C::NotEqual.parse('return')}
|
1160
1157
|
end
|
1161
1158
|
|
1162
1159
|
def test_less
|
@@ -1169,15 +1166,15 @@ Less
|
|
1169
1166
|
expr2: IntLiteral
|
1170
1167
|
val: 10
|
1171
1168
|
EOS
|
1172
|
-
assert_raise(ParseError){C::Less.parse('} void f() {')}
|
1173
|
-
assert_raise(ParseError){C::Less.parse(';')}
|
1174
|
-
assert_raise(ParseError){C::Less.parse('int i')}
|
1175
|
-
assert_raise(ParseError){C::Less.parse('int')}
|
1176
|
-
assert_raise(ParseError){C::Less.parse('if (0)')}
|
1177
|
-
assert_raise(ParseError){C::Less.parse('switch (0)')}
|
1178
|
-
assert_raise(ParseError){C::Less.parse('for (;;)')}
|
1179
|
-
assert_raise(ParseError){C::Less.parse('goto')}
|
1180
|
-
assert_raise(ParseError){C::Less.parse('return')}
|
1169
|
+
assert_raise(C::ParseError){C::Less.parse('} void f() {')}
|
1170
|
+
assert_raise(C::ParseError){C::Less.parse(';')}
|
1171
|
+
assert_raise(C::ParseError){C::Less.parse('int i')}
|
1172
|
+
assert_raise(C::ParseError){C::Less.parse('int')}
|
1173
|
+
assert_raise(C::ParseError){C::Less.parse('if (0)')}
|
1174
|
+
assert_raise(C::ParseError){C::Less.parse('switch (0)')}
|
1175
|
+
assert_raise(C::ParseError){C::Less.parse('for (;;)')}
|
1176
|
+
assert_raise(C::ParseError){C::Less.parse('goto')}
|
1177
|
+
assert_raise(C::ParseError){C::Less.parse('return')}
|
1181
1178
|
end
|
1182
1179
|
|
1183
1180
|
def test_more
|
@@ -1190,15 +1187,15 @@ More
|
|
1190
1187
|
expr2: IntLiteral
|
1191
1188
|
val: 10
|
1192
1189
|
EOS
|
1193
|
-
assert_raise(ParseError){C::More.parse('} void f() {')}
|
1194
|
-
assert_raise(ParseError){C::More.parse(';')}
|
1195
|
-
assert_raise(ParseError){C::More.parse('int i')}
|
1196
|
-
assert_raise(ParseError){C::More.parse('int')}
|
1197
|
-
assert_raise(ParseError){C::More.parse('if (0)')}
|
1198
|
-
assert_raise(ParseError){C::More.parse('switch (0)')}
|
1199
|
-
assert_raise(ParseError){C::More.parse('for (;;)')}
|
1200
|
-
assert_raise(ParseError){C::More.parse('goto')}
|
1201
|
-
assert_raise(ParseError){C::More.parse('return')}
|
1190
|
+
assert_raise(C::ParseError){C::More.parse('} void f() {')}
|
1191
|
+
assert_raise(C::ParseError){C::More.parse(';')}
|
1192
|
+
assert_raise(C::ParseError){C::More.parse('int i')}
|
1193
|
+
assert_raise(C::ParseError){C::More.parse('int')}
|
1194
|
+
assert_raise(C::ParseError){C::More.parse('if (0)')}
|
1195
|
+
assert_raise(C::ParseError){C::More.parse('switch (0)')}
|
1196
|
+
assert_raise(C::ParseError){C::More.parse('for (;;)')}
|
1197
|
+
assert_raise(C::ParseError){C::More.parse('goto')}
|
1198
|
+
assert_raise(C::ParseError){C::More.parse('return')}
|
1202
1199
|
end
|
1203
1200
|
|
1204
1201
|
def test_less_or_equal
|
@@ -1211,15 +1208,15 @@ LessOrEqual
|
|
1211
1208
|
expr2: IntLiteral
|
1212
1209
|
val: 10
|
1213
1210
|
EOS
|
1214
|
-
assert_raise(ParseError){C::LessOrEqual.parse('} void f() {')}
|
1215
|
-
assert_raise(ParseError){C::LessOrEqual.parse(';')}
|
1216
|
-
assert_raise(ParseError){C::LessOrEqual.parse('int i')}
|
1217
|
-
assert_raise(ParseError){C::LessOrEqual.parse('int')}
|
1218
|
-
assert_raise(ParseError){C::LessOrEqual.parse('if (0)')}
|
1219
|
-
assert_raise(ParseError){C::LessOrEqual.parse('switch (0)')}
|
1220
|
-
assert_raise(ParseError){C::LessOrEqual.parse('for (;;)')}
|
1221
|
-
assert_raise(ParseError){C::LessOrEqual.parse('goto')}
|
1222
|
-
assert_raise(ParseError){C::LessOrEqual.parse('return')}
|
1211
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('} void f() {')}
|
1212
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse(';')}
|
1213
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('int i')}
|
1214
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('int')}
|
1215
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('if (0)')}
|
1216
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('switch (0)')}
|
1217
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('for (;;)')}
|
1218
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('goto')}
|
1219
|
+
assert_raise(C::ParseError){C::LessOrEqual.parse('return')}
|
1223
1220
|
end
|
1224
1221
|
|
1225
1222
|
def test_more_or_equal
|
@@ -1232,15 +1229,15 @@ MoreOrEqual
|
|
1232
1229
|
expr2: IntLiteral
|
1233
1230
|
val: 10
|
1234
1231
|
EOS
|
1235
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('} void f() {')}
|
1236
|
-
assert_raise(ParseError){C::MoreOrEqual.parse(';')}
|
1237
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('int i')}
|
1238
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('int')}
|
1239
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('if (0)')}
|
1240
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('switch (0)')}
|
1241
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('for (;;)')}
|
1242
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('goto')}
|
1243
|
-
assert_raise(ParseError){C::MoreOrEqual.parse('return')}
|
1232
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('} void f() {')}
|
1233
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse(';')}
|
1234
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('int i')}
|
1235
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('int')}
|
1236
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('if (0)')}
|
1237
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('switch (0)')}
|
1238
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('for (;;)')}
|
1239
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('goto')}
|
1240
|
+
assert_raise(C::ParseError){C::MoreOrEqual.parse('return')}
|
1244
1241
|
end
|
1245
1242
|
|
1246
1243
|
def test_bit_and
|
@@ -1253,15 +1250,15 @@ BitAnd
|
|
1253
1250
|
expr2: IntLiteral
|
1254
1251
|
val: 10
|
1255
1252
|
EOS
|
1256
|
-
assert_raise(ParseError){C::BitAnd.parse('} void f() {')}
|
1257
|
-
assert_raise(ParseError){C::BitAnd.parse(';')}
|
1258
|
-
assert_raise(ParseError){C::BitAnd.parse('int i')}
|
1259
|
-
assert_raise(ParseError){C::BitAnd.parse('int')}
|
1260
|
-
assert_raise(ParseError){C::BitAnd.parse('if (0)')}
|
1261
|
-
assert_raise(ParseError){C::BitAnd.parse('switch (0)')}
|
1262
|
-
assert_raise(ParseError){C::BitAnd.parse('for (;;)')}
|
1263
|
-
assert_raise(ParseError){C::BitAnd.parse('goto')}
|
1264
|
-
assert_raise(ParseError){C::BitAnd.parse('return')}
|
1253
|
+
assert_raise(C::ParseError){C::BitAnd.parse('} void f() {')}
|
1254
|
+
assert_raise(C::ParseError){C::BitAnd.parse(';')}
|
1255
|
+
assert_raise(C::ParseError){C::BitAnd.parse('int i')}
|
1256
|
+
assert_raise(C::ParseError){C::BitAnd.parse('int')}
|
1257
|
+
assert_raise(C::ParseError){C::BitAnd.parse('if (0)')}
|
1258
|
+
assert_raise(C::ParseError){C::BitAnd.parse('switch (0)')}
|
1259
|
+
assert_raise(C::ParseError){C::BitAnd.parse('for (;;)')}
|
1260
|
+
assert_raise(C::ParseError){C::BitAnd.parse('goto')}
|
1261
|
+
assert_raise(C::ParseError){C::BitAnd.parse('return')}
|
1265
1262
|
end
|
1266
1263
|
|
1267
1264
|
def test_bit_or
|
@@ -1274,15 +1271,15 @@ BitOr
|
|
1274
1271
|
expr2: IntLiteral
|
1275
1272
|
val: 10
|
1276
1273
|
EOS
|
1277
|
-
assert_raise(ParseError){C::BitOr.parse('} void f() {')}
|
1278
|
-
assert_raise(ParseError){C::BitOr.parse(';')}
|
1279
|
-
assert_raise(ParseError){C::BitOr.parse('int i')}
|
1280
|
-
assert_raise(ParseError){C::BitOr.parse('int')}
|
1281
|
-
assert_raise(ParseError){C::BitOr.parse('if (0)')}
|
1282
|
-
assert_raise(ParseError){C::BitOr.parse('switch (0)')}
|
1283
|
-
assert_raise(ParseError){C::BitOr.parse('for (;;)')}
|
1284
|
-
assert_raise(ParseError){C::BitOr.parse('goto')}
|
1285
|
-
assert_raise(ParseError){C::BitOr.parse('return')}
|
1274
|
+
assert_raise(C::ParseError){C::BitOr.parse('} void f() {')}
|
1275
|
+
assert_raise(C::ParseError){C::BitOr.parse(';')}
|
1276
|
+
assert_raise(C::ParseError){C::BitOr.parse('int i')}
|
1277
|
+
assert_raise(C::ParseError){C::BitOr.parse('int')}
|
1278
|
+
assert_raise(C::ParseError){C::BitOr.parse('if (0)')}
|
1279
|
+
assert_raise(C::ParseError){C::BitOr.parse('switch (0)')}
|
1280
|
+
assert_raise(C::ParseError){C::BitOr.parse('for (;;)')}
|
1281
|
+
assert_raise(C::ParseError){C::BitOr.parse('goto')}
|
1282
|
+
assert_raise(C::ParseError){C::BitOr.parse('return')}
|
1286
1283
|
end
|
1287
1284
|
|
1288
1285
|
def test_bit_xor
|
@@ -1295,15 +1292,15 @@ BitXor
|
|
1295
1292
|
expr2: IntLiteral
|
1296
1293
|
val: 10
|
1297
1294
|
EOS
|
1298
|
-
assert_raise(ParseError){C::BitXor.parse('} void f() {')}
|
1299
|
-
assert_raise(ParseError){C::BitXor.parse(';')}
|
1300
|
-
assert_raise(ParseError){C::BitXor.parse('int i')}
|
1301
|
-
assert_raise(ParseError){C::BitXor.parse('int')}
|
1302
|
-
assert_raise(ParseError){C::BitXor.parse('if (0)')}
|
1303
|
-
assert_raise(ParseError){C::BitXor.parse('switch (0)')}
|
1304
|
-
assert_raise(ParseError){C::BitXor.parse('for (;;)')}
|
1305
|
-
assert_raise(ParseError){C::BitXor.parse('goto')}
|
1306
|
-
assert_raise(ParseError){C::BitXor.parse('return')}
|
1295
|
+
assert_raise(C::ParseError){C::BitXor.parse('} void f() {')}
|
1296
|
+
assert_raise(C::ParseError){C::BitXor.parse(';')}
|
1297
|
+
assert_raise(C::ParseError){C::BitXor.parse('int i')}
|
1298
|
+
assert_raise(C::ParseError){C::BitXor.parse('int')}
|
1299
|
+
assert_raise(C::ParseError){C::BitXor.parse('if (0)')}
|
1300
|
+
assert_raise(C::ParseError){C::BitXor.parse('switch (0)')}
|
1301
|
+
assert_raise(C::ParseError){C::BitXor.parse('for (;;)')}
|
1302
|
+
assert_raise(C::ParseError){C::BitXor.parse('goto')}
|
1303
|
+
assert_raise(C::ParseError){C::BitXor.parse('return')}
|
1307
1304
|
end
|
1308
1305
|
|
1309
1306
|
def test_bit_not
|
@@ -1314,15 +1311,15 @@ BitNot
|
|
1314
1311
|
expr: Variable
|
1315
1312
|
name: "i"
|
1316
1313
|
EOS
|
1317
|
-
assert_raise(ParseError){C::BitNot.parse('} void f() {')}
|
1318
|
-
assert_raise(ParseError){C::BitNot.parse(';')}
|
1319
|
-
assert_raise(ParseError){C::BitNot.parse('int i')}
|
1320
|
-
assert_raise(ParseError){C::BitNot.parse('int')}
|
1321
|
-
assert_raise(ParseError){C::BitNot.parse('if (0)')}
|
1322
|
-
assert_raise(ParseError){C::BitNot.parse('switch (0)')}
|
1323
|
-
assert_raise(ParseError){C::BitNot.parse('for (;;)')}
|
1324
|
-
assert_raise(ParseError){C::BitNot.parse('goto')}
|
1325
|
-
assert_raise(ParseError){C::BitNot.parse('return')}
|
1314
|
+
assert_raise(C::ParseError){C::BitNot.parse('} void f() {')}
|
1315
|
+
assert_raise(C::ParseError){C::BitNot.parse(';')}
|
1316
|
+
assert_raise(C::ParseError){C::BitNot.parse('int i')}
|
1317
|
+
assert_raise(C::ParseError){C::BitNot.parse('int')}
|
1318
|
+
assert_raise(C::ParseError){C::BitNot.parse('if (0)')}
|
1319
|
+
assert_raise(C::ParseError){C::BitNot.parse('switch (0)')}
|
1320
|
+
assert_raise(C::ParseError){C::BitNot.parse('for (;;)')}
|
1321
|
+
assert_raise(C::ParseError){C::BitNot.parse('goto')}
|
1322
|
+
assert_raise(C::ParseError){C::BitNot.parse('return')}
|
1326
1323
|
end
|
1327
1324
|
|
1328
1325
|
def test_shift_left
|
@@ -1335,15 +1332,15 @@ ShiftLeft
|
|
1335
1332
|
expr2: IntLiteral
|
1336
1333
|
val: 10
|
1337
1334
|
EOS
|
1338
|
-
assert_raise(ParseError){C::ShiftLeft.parse('} void f() {')}
|
1339
|
-
assert_raise(ParseError){C::ShiftLeft.parse(';')}
|
1340
|
-
assert_raise(ParseError){C::ShiftLeft.parse('int i')}
|
1341
|
-
assert_raise(ParseError){C::ShiftLeft.parse('int')}
|
1342
|
-
assert_raise(ParseError){C::ShiftLeft.parse('if (0)')}
|
1343
|
-
assert_raise(ParseError){C::ShiftLeft.parse('switch (0)')}
|
1344
|
-
assert_raise(ParseError){C::ShiftLeft.parse('for (;;)')}
|
1345
|
-
assert_raise(ParseError){C::ShiftLeft.parse('goto')}
|
1346
|
-
assert_raise(ParseError){C::ShiftLeft.parse('return')}
|
1335
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('} void f() {')}
|
1336
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse(';')}
|
1337
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('int i')}
|
1338
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('int')}
|
1339
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('if (0)')}
|
1340
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('switch (0)')}
|
1341
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('for (;;)')}
|
1342
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('goto')}
|
1343
|
+
assert_raise(C::ParseError){C::ShiftLeft.parse('return')}
|
1347
1344
|
end
|
1348
1345
|
|
1349
1346
|
def test_shift_right
|
@@ -1356,15 +1353,15 @@ ShiftRight
|
|
1356
1353
|
expr2: IntLiteral
|
1357
1354
|
val: 10
|
1358
1355
|
EOS
|
1359
|
-
assert_raise(ParseError){C::ShiftRight.parse('} void f() {')}
|
1360
|
-
assert_raise(ParseError){C::ShiftRight.parse(';')}
|
1361
|
-
assert_raise(ParseError){C::ShiftRight.parse('int i')}
|
1362
|
-
assert_raise(ParseError){C::ShiftRight.parse('int')}
|
1363
|
-
assert_raise(ParseError){C::ShiftRight.parse('if (0)')}
|
1364
|
-
assert_raise(ParseError){C::ShiftRight.parse('switch (0)')}
|
1365
|
-
assert_raise(ParseError){C::ShiftRight.parse('for (;;)')}
|
1366
|
-
assert_raise(ParseError){C::ShiftRight.parse('goto')}
|
1367
|
-
assert_raise(ParseError){C::ShiftRight.parse('return')}
|
1356
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('} void f() {')}
|
1357
|
+
assert_raise(C::ParseError){C::ShiftRight.parse(';')}
|
1358
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('int i')}
|
1359
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('int')}
|
1360
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('if (0)')}
|
1361
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('switch (0)')}
|
1362
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('for (;;)')}
|
1363
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('goto')}
|
1364
|
+
assert_raise(C::ParseError){C::ShiftRight.parse('return')}
|
1368
1365
|
end
|
1369
1366
|
|
1370
1367
|
def test_and
|
@@ -1377,15 +1374,15 @@ And
|
|
1377
1374
|
expr2: IntLiteral
|
1378
1375
|
val: 10
|
1379
1376
|
EOS
|
1380
|
-
assert_raise(ParseError){C::And.parse('} void f() {')}
|
1381
|
-
assert_raise(ParseError){C::And.parse(';')}
|
1382
|
-
assert_raise(ParseError){C::And.parse('int i')}
|
1383
|
-
assert_raise(ParseError){C::And.parse('int')}
|
1384
|
-
assert_raise(ParseError){C::And.parse('if (0)')}
|
1385
|
-
assert_raise(ParseError){C::And.parse('switch (0)')}
|
1386
|
-
assert_raise(ParseError){C::And.parse('for (;;)')}
|
1387
|
-
assert_raise(ParseError){C::And.parse('goto')}
|
1388
|
-
assert_raise(ParseError){C::And.parse('return')}
|
1377
|
+
assert_raise(C::ParseError){C::And.parse('} void f() {')}
|
1378
|
+
assert_raise(C::ParseError){C::And.parse(';')}
|
1379
|
+
assert_raise(C::ParseError){C::And.parse('int i')}
|
1380
|
+
assert_raise(C::ParseError){C::And.parse('int')}
|
1381
|
+
assert_raise(C::ParseError){C::And.parse('if (0)')}
|
1382
|
+
assert_raise(C::ParseError){C::And.parse('switch (0)')}
|
1383
|
+
assert_raise(C::ParseError){C::And.parse('for (;;)')}
|
1384
|
+
assert_raise(C::ParseError){C::And.parse('goto')}
|
1385
|
+
assert_raise(C::ParseError){C::And.parse('return')}
|
1389
1386
|
end
|
1390
1387
|
|
1391
1388
|
def test_or
|
@@ -1398,15 +1395,15 @@ Or
|
|
1398
1395
|
expr2: IntLiteral
|
1399
1396
|
val: 10
|
1400
1397
|
EOS
|
1401
|
-
assert_raise(ParseError){C::Or.parse('} void f() {')}
|
1402
|
-
assert_raise(ParseError){C::Or.parse(';')}
|
1403
|
-
assert_raise(ParseError){C::Or.parse('int i')}
|
1404
|
-
assert_raise(ParseError){C::Or.parse('int')}
|
1405
|
-
assert_raise(ParseError){C::Or.parse('if (0)')}
|
1406
|
-
assert_raise(ParseError){C::Or.parse('switch (0)')}
|
1407
|
-
assert_raise(ParseError){C::Or.parse('for (;;)')}
|
1408
|
-
assert_raise(ParseError){C::Or.parse('goto')}
|
1409
|
-
assert_raise(ParseError){C::Or.parse('return')}
|
1398
|
+
assert_raise(C::ParseError){C::Or.parse('} void f() {')}
|
1399
|
+
assert_raise(C::ParseError){C::Or.parse(';')}
|
1400
|
+
assert_raise(C::ParseError){C::Or.parse('int i')}
|
1401
|
+
assert_raise(C::ParseError){C::Or.parse('int')}
|
1402
|
+
assert_raise(C::ParseError){C::Or.parse('if (0)')}
|
1403
|
+
assert_raise(C::ParseError){C::Or.parse('switch (0)')}
|
1404
|
+
assert_raise(C::ParseError){C::Or.parse('for (;;)')}
|
1405
|
+
assert_raise(C::ParseError){C::Or.parse('goto')}
|
1406
|
+
assert_raise(C::ParseError){C::Or.parse('return')}
|
1410
1407
|
end
|
1411
1408
|
|
1412
1409
|
def test_not
|
@@ -1417,15 +1414,15 @@ Not
|
|
1417
1414
|
expr: Variable
|
1418
1415
|
name: "i"
|
1419
1416
|
EOS
|
1420
|
-
assert_raise(ParseError){C::Not.parse('} void f() {')}
|
1421
|
-
assert_raise(ParseError){C::Not.parse(';')}
|
1422
|
-
assert_raise(ParseError){C::Not.parse('int i')}
|
1423
|
-
assert_raise(ParseError){C::Not.parse('int')}
|
1424
|
-
assert_raise(ParseError){C::Not.parse('if (0)')}
|
1425
|
-
assert_raise(ParseError){C::Not.parse('switch (0)')}
|
1426
|
-
assert_raise(ParseError){C::Not.parse('for (;;)')}
|
1427
|
-
assert_raise(ParseError){C::Not.parse('goto')}
|
1428
|
-
assert_raise(ParseError){C::Not.parse('return')}
|
1417
|
+
assert_raise(C::ParseError){C::Not.parse('} void f() {')}
|
1418
|
+
assert_raise(C::ParseError){C::Not.parse(';')}
|
1419
|
+
assert_raise(C::ParseError){C::Not.parse('int i')}
|
1420
|
+
assert_raise(C::ParseError){C::Not.parse('int')}
|
1421
|
+
assert_raise(C::ParseError){C::Not.parse('if (0)')}
|
1422
|
+
assert_raise(C::ParseError){C::Not.parse('switch (0)')}
|
1423
|
+
assert_raise(C::ParseError){C::Not.parse('for (;;)')}
|
1424
|
+
assert_raise(C::ParseError){C::Not.parse('goto')}
|
1425
|
+
assert_raise(C::ParseError){C::Not.parse('return')}
|
1429
1426
|
end
|
1430
1427
|
|
1431
1428
|
def test_assign
|
@@ -1438,15 +1435,15 @@ Assign
|
|
1438
1435
|
rval: IntLiteral
|
1439
1436
|
val: 10
|
1440
1437
|
EOS
|
1441
|
-
assert_raise(ParseError){C::Assign.parse('} void f() {')}
|
1442
|
-
assert_raise(ParseError){C::Assign.parse(';')}
|
1443
|
-
assert_raise(ParseError){C::Assign.parse('int i')}
|
1444
|
-
assert_raise(ParseError){C::Assign.parse('int')}
|
1445
|
-
assert_raise(ParseError){C::Assign.parse('if (0)')}
|
1446
|
-
assert_raise(ParseError){C::Assign.parse('switch (0)')}
|
1447
|
-
assert_raise(ParseError){C::Assign.parse('for (;;)')}
|
1448
|
-
assert_raise(ParseError){C::Assign.parse('goto')}
|
1449
|
-
assert_raise(ParseError){C::Assign.parse('return')}
|
1438
|
+
assert_raise(C::ParseError){C::Assign.parse('} void f() {')}
|
1439
|
+
assert_raise(C::ParseError){C::Assign.parse(';')}
|
1440
|
+
assert_raise(C::ParseError){C::Assign.parse('int i')}
|
1441
|
+
assert_raise(C::ParseError){C::Assign.parse('int')}
|
1442
|
+
assert_raise(C::ParseError){C::Assign.parse('if (0)')}
|
1443
|
+
assert_raise(C::ParseError){C::Assign.parse('switch (0)')}
|
1444
|
+
assert_raise(C::ParseError){C::Assign.parse('for (;;)')}
|
1445
|
+
assert_raise(C::ParseError){C::Assign.parse('goto')}
|
1446
|
+
assert_raise(C::ParseError){C::Assign.parse('return')}
|
1450
1447
|
end
|
1451
1448
|
|
1452
1449
|
def test_multiply_assign
|
@@ -1459,15 +1456,15 @@ MultiplyAssign
|
|
1459
1456
|
rval: IntLiteral
|
1460
1457
|
val: 10
|
1461
1458
|
EOS
|
1462
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('} void f() {')}
|
1463
|
-
assert_raise(ParseError){C::MultiplyAssign.parse(';')}
|
1464
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('int i')}
|
1465
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('int')}
|
1466
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('if (0)')}
|
1467
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('switch (0)')}
|
1468
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('for (;;)')}
|
1469
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('goto')}
|
1470
|
-
assert_raise(ParseError){C::MultiplyAssign.parse('return')}
|
1459
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('} void f() {')}
|
1460
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse(';')}
|
1461
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('int i')}
|
1462
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('int')}
|
1463
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('if (0)')}
|
1464
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('switch (0)')}
|
1465
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('for (;;)')}
|
1466
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('goto')}
|
1467
|
+
assert_raise(C::ParseError){C::MultiplyAssign.parse('return')}
|
1471
1468
|
end
|
1472
1469
|
|
1473
1470
|
def test_divide_assign
|
@@ -1480,15 +1477,15 @@ DivideAssign
|
|
1480
1477
|
rval: IntLiteral
|
1481
1478
|
val: 10
|
1482
1479
|
EOS
|
1483
|
-
assert_raise(ParseError){C::DivideAssign.parse('} void f() {')}
|
1484
|
-
assert_raise(ParseError){C::DivideAssign.parse(';')}
|
1485
|
-
assert_raise(ParseError){C::DivideAssign.parse('int i')}
|
1486
|
-
assert_raise(ParseError){C::DivideAssign.parse('int')}
|
1487
|
-
assert_raise(ParseError){C::DivideAssign.parse('if (0)')}
|
1488
|
-
assert_raise(ParseError){C::DivideAssign.parse('switch (0)')}
|
1489
|
-
assert_raise(ParseError){C::DivideAssign.parse('for (;;)')}
|
1490
|
-
assert_raise(ParseError){C::DivideAssign.parse('goto')}
|
1491
|
-
assert_raise(ParseError){C::DivideAssign.parse('return')}
|
1480
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('} void f() {')}
|
1481
|
+
assert_raise(C::ParseError){C::DivideAssign.parse(';')}
|
1482
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('int i')}
|
1483
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('int')}
|
1484
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('if (0)')}
|
1485
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('switch (0)')}
|
1486
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('for (;;)')}
|
1487
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('goto')}
|
1488
|
+
assert_raise(C::ParseError){C::DivideAssign.parse('return')}
|
1492
1489
|
end
|
1493
1490
|
|
1494
1491
|
def test_mod_assign
|
@@ -1501,15 +1498,15 @@ ModAssign
|
|
1501
1498
|
rval: IntLiteral
|
1502
1499
|
val: 10
|
1503
1500
|
EOS
|
1504
|
-
assert_raise(ParseError){C::ModAssign.parse('} void f() {')}
|
1505
|
-
assert_raise(ParseError){C::ModAssign.parse(';')}
|
1506
|
-
assert_raise(ParseError){C::ModAssign.parse('int i')}
|
1507
|
-
assert_raise(ParseError){C::ModAssign.parse('int')}
|
1508
|
-
assert_raise(ParseError){C::ModAssign.parse('if (0)')}
|
1509
|
-
assert_raise(ParseError){C::ModAssign.parse('switch (0)')}
|
1510
|
-
assert_raise(ParseError){C::ModAssign.parse('for (;;)')}
|
1511
|
-
assert_raise(ParseError){C::ModAssign.parse('goto')}
|
1512
|
-
assert_raise(ParseError){C::ModAssign.parse('return')}
|
1501
|
+
assert_raise(C::ParseError){C::ModAssign.parse('} void f() {')}
|
1502
|
+
assert_raise(C::ParseError){C::ModAssign.parse(';')}
|
1503
|
+
assert_raise(C::ParseError){C::ModAssign.parse('int i')}
|
1504
|
+
assert_raise(C::ParseError){C::ModAssign.parse('int')}
|
1505
|
+
assert_raise(C::ParseError){C::ModAssign.parse('if (0)')}
|
1506
|
+
assert_raise(C::ParseError){C::ModAssign.parse('switch (0)')}
|
1507
|
+
assert_raise(C::ParseError){C::ModAssign.parse('for (;;)')}
|
1508
|
+
assert_raise(C::ParseError){C::ModAssign.parse('goto')}
|
1509
|
+
assert_raise(C::ParseError){C::ModAssign.parse('return')}
|
1513
1510
|
end
|
1514
1511
|
|
1515
1512
|
def test_add_assign
|
@@ -1522,15 +1519,15 @@ AddAssign
|
|
1522
1519
|
rval: IntLiteral
|
1523
1520
|
val: 10
|
1524
1521
|
EOS
|
1525
|
-
assert_raise(ParseError){C::AddAssign.parse('} void f() {')}
|
1526
|
-
assert_raise(ParseError){C::AddAssign.parse(';')}
|
1527
|
-
assert_raise(ParseError){C::AddAssign.parse('int i')}
|
1528
|
-
assert_raise(ParseError){C::AddAssign.parse('int')}
|
1529
|
-
assert_raise(ParseError){C::AddAssign.parse('if (0)')}
|
1530
|
-
assert_raise(ParseError){C::AddAssign.parse('switch (0)')}
|
1531
|
-
assert_raise(ParseError){C::AddAssign.parse('for (;;)')}
|
1532
|
-
assert_raise(ParseError){C::AddAssign.parse('goto')}
|
1533
|
-
assert_raise(ParseError){C::AddAssign.parse('return')}
|
1522
|
+
assert_raise(C::ParseError){C::AddAssign.parse('} void f() {')}
|
1523
|
+
assert_raise(C::ParseError){C::AddAssign.parse(';')}
|
1524
|
+
assert_raise(C::ParseError){C::AddAssign.parse('int i')}
|
1525
|
+
assert_raise(C::ParseError){C::AddAssign.parse('int')}
|
1526
|
+
assert_raise(C::ParseError){C::AddAssign.parse('if (0)')}
|
1527
|
+
assert_raise(C::ParseError){C::AddAssign.parse('switch (0)')}
|
1528
|
+
assert_raise(C::ParseError){C::AddAssign.parse('for (;;)')}
|
1529
|
+
assert_raise(C::ParseError){C::AddAssign.parse('goto')}
|
1530
|
+
assert_raise(C::ParseError){C::AddAssign.parse('return')}
|
1534
1531
|
end
|
1535
1532
|
|
1536
1533
|
def test_subtract_assign
|
@@ -1543,15 +1540,15 @@ SubtractAssign
|
|
1543
1540
|
rval: IntLiteral
|
1544
1541
|
val: 10
|
1545
1542
|
EOS
|
1546
|
-
assert_raise(ParseError){C::SubtractAssign.parse('} void f() {')}
|
1547
|
-
assert_raise(ParseError){C::SubtractAssign.parse(';')}
|
1548
|
-
assert_raise(ParseError){C::SubtractAssign.parse('int i')}
|
1549
|
-
assert_raise(ParseError){C::SubtractAssign.parse('int')}
|
1550
|
-
assert_raise(ParseError){C::SubtractAssign.parse('if (0)')}
|
1551
|
-
assert_raise(ParseError){C::SubtractAssign.parse('switch (0)')}
|
1552
|
-
assert_raise(ParseError){C::SubtractAssign.parse('for (;;)')}
|
1553
|
-
assert_raise(ParseError){C::SubtractAssign.parse('goto')}
|
1554
|
-
assert_raise(ParseError){C::SubtractAssign.parse('return')}
|
1543
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('} void f() {')}
|
1544
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse(';')}
|
1545
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('int i')}
|
1546
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('int')}
|
1547
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('if (0)')}
|
1548
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('switch (0)')}
|
1549
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('for (;;)')}
|
1550
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('goto')}
|
1551
|
+
assert_raise(C::ParseError){C::SubtractAssign.parse('return')}
|
1555
1552
|
end
|
1556
1553
|
|
1557
1554
|
def test_shift_left_assign
|
@@ -1564,15 +1561,15 @@ ShiftLeftAssign
|
|
1564
1561
|
rval: IntLiteral
|
1565
1562
|
val: 10
|
1566
1563
|
EOS
|
1567
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('} void f() {')}
|
1568
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse(';')}
|
1569
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('int i')}
|
1570
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('int')}
|
1571
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('if (0)')}
|
1572
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('switch (0)')}
|
1573
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('for (;;)')}
|
1574
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('goto')}
|
1575
|
-
assert_raise(ParseError){C::ShiftLeftAssign.parse('return')}
|
1564
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('} void f() {')}
|
1565
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse(';')}
|
1566
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('int i')}
|
1567
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('int')}
|
1568
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('if (0)')}
|
1569
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('switch (0)')}
|
1570
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('for (;;)')}
|
1571
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('goto')}
|
1572
|
+
assert_raise(C::ParseError){C::ShiftLeftAssign.parse('return')}
|
1576
1573
|
end
|
1577
1574
|
|
1578
1575
|
def test_shift_right_assign
|
@@ -1585,15 +1582,15 @@ ShiftRightAssign
|
|
1585
1582
|
rval: IntLiteral
|
1586
1583
|
val: 10
|
1587
1584
|
EOS
|
1588
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('} void f() {')}
|
1589
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse(';')}
|
1590
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('int i')}
|
1591
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('int')}
|
1592
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('if (0)')}
|
1593
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('switch (0)')}
|
1594
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('for (;;)')}
|
1595
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('goto')}
|
1596
|
-
assert_raise(ParseError){C::ShiftRightAssign.parse('return')}
|
1585
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('} void f() {')}
|
1586
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse(';')}
|
1587
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('int i')}
|
1588
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('int')}
|
1589
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('if (0)')}
|
1590
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('switch (0)')}
|
1591
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('for (;;)')}
|
1592
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('goto')}
|
1593
|
+
assert_raise(C::ParseError){C::ShiftRightAssign.parse('return')}
|
1597
1594
|
end
|
1598
1595
|
|
1599
1596
|
def test_bit_and_assign
|
@@ -1606,15 +1603,15 @@ BitAndAssign
|
|
1606
1603
|
rval: IntLiteral
|
1607
1604
|
val: 10
|
1608
1605
|
EOS
|
1609
|
-
assert_raise(ParseError){C::BitAndAssign.parse('} void f() {')}
|
1610
|
-
assert_raise(ParseError){C::BitAndAssign.parse(';')}
|
1611
|
-
assert_raise(ParseError){C::BitAndAssign.parse('int i')}
|
1612
|
-
assert_raise(ParseError){C::BitAndAssign.parse('int')}
|
1613
|
-
assert_raise(ParseError){C::BitAndAssign.parse('if (0)')}
|
1614
|
-
assert_raise(ParseError){C::BitAndAssign.parse('switch (0)')}
|
1615
|
-
assert_raise(ParseError){C::BitAndAssign.parse('for (;;)')}
|
1616
|
-
assert_raise(ParseError){C::BitAndAssign.parse('goto')}
|
1617
|
-
assert_raise(ParseError){C::BitAndAssign.parse('return')}
|
1606
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('} void f() {')}
|
1607
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse(';')}
|
1608
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('int i')}
|
1609
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('int')}
|
1610
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('if (0)')}
|
1611
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('switch (0)')}
|
1612
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('for (;;)')}
|
1613
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('goto')}
|
1614
|
+
assert_raise(C::ParseError){C::BitAndAssign.parse('return')}
|
1618
1615
|
end
|
1619
1616
|
|
1620
1617
|
def test_bit_xor_assign
|
@@ -1627,15 +1624,15 @@ BitXorAssign
|
|
1627
1624
|
rval: IntLiteral
|
1628
1625
|
val: 10
|
1629
1626
|
EOS
|
1630
|
-
assert_raise(ParseError){C::BitXorAssign.parse('} void f() {')}
|
1631
|
-
assert_raise(ParseError){C::BitXorAssign.parse(';')}
|
1632
|
-
assert_raise(ParseError){C::BitXorAssign.parse('int i')}
|
1633
|
-
assert_raise(ParseError){C::BitXorAssign.parse('int')}
|
1634
|
-
assert_raise(ParseError){C::BitXorAssign.parse('if (0)')}
|
1635
|
-
assert_raise(ParseError){C::BitXorAssign.parse('switch (0)')}
|
1636
|
-
assert_raise(ParseError){C::BitXorAssign.parse('for (;;)')}
|
1637
|
-
assert_raise(ParseError){C::BitXorAssign.parse('goto')}
|
1638
|
-
assert_raise(ParseError){C::BitXorAssign.parse('return')}
|
1627
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('} void f() {')}
|
1628
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse(';')}
|
1629
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('int i')}
|
1630
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('int')}
|
1631
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('if (0)')}
|
1632
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('switch (0)')}
|
1633
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('for (;;)')}
|
1634
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('goto')}
|
1635
|
+
assert_raise(C::ParseError){C::BitXorAssign.parse('return')}
|
1639
1636
|
end
|
1640
1637
|
|
1641
1638
|
def test_bit_or_assign
|
@@ -1648,15 +1645,15 @@ BitOrAssign
|
|
1648
1645
|
rval: IntLiteral
|
1649
1646
|
val: 10
|
1650
1647
|
EOS
|
1651
|
-
assert_raise(ParseError){C::BitOrAssign.parse('} void f() {')}
|
1652
|
-
assert_raise(ParseError){C::BitOrAssign.parse(';')}
|
1653
|
-
assert_raise(ParseError){C::BitOrAssign.parse('int i')}
|
1654
|
-
assert_raise(ParseError){C::BitOrAssign.parse('int')}
|
1655
|
-
assert_raise(ParseError){C::BitOrAssign.parse('if (0)')}
|
1656
|
-
assert_raise(ParseError){C::BitOrAssign.parse('switch (0)')}
|
1657
|
-
assert_raise(ParseError){C::BitOrAssign.parse('for (;;)')}
|
1658
|
-
assert_raise(ParseError){C::BitOrAssign.parse('goto')}
|
1659
|
-
assert_raise(ParseError){C::BitOrAssign.parse('return')}
|
1648
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('} void f() {')}
|
1649
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse(';')}
|
1650
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('int i')}
|
1651
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('int')}
|
1652
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('if (0)')}
|
1653
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('switch (0)')}
|
1654
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('for (;;)')}
|
1655
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('goto')}
|
1656
|
+
assert_raise(C::ParseError){C::BitOrAssign.parse('return')}
|
1660
1657
|
end
|
1661
1658
|
|
1662
1659
|
def test_pointer
|
@@ -1672,9 +1669,9 @@ const volatile unsigned int*
|
|
1672
1669
|
Pointer
|
1673
1670
|
type: Int (const volatile unsigned)
|
1674
1671
|
EOS
|
1675
|
-
assert_raise(ParseError){C::Pointer.parse('1);} void f() {(int')}
|
1676
|
-
assert_raise(ParseError){C::Pointer.parse('1); (int')}
|
1677
|
-
assert_raise(ParseError){C::Pointer.parse('void')}
|
1672
|
+
assert_raise(C::ParseError){C::Pointer.parse('1);} void f() {(int')}
|
1673
|
+
assert_raise(C::ParseError){C::Pointer.parse('1); (int')}
|
1674
|
+
assert_raise(C::ParseError){C::Pointer.parse('void')}
|
1678
1675
|
end
|
1679
1676
|
|
1680
1677
|
def test_array
|
@@ -1692,9 +1689,9 @@ Array
|
|
1692
1689
|
length: IntLiteral
|
1693
1690
|
val: 10
|
1694
1691
|
EOS
|
1695
|
-
assert_raise(ParseError){C::Array.parse('1);} void f() {(int')}
|
1696
|
-
assert_raise(ParseError){C::Array.parse('1); (int')}
|
1697
|
-
assert_raise(ParseError){C::Array.parse('void')}
|
1692
|
+
assert_raise(C::ParseError){C::Array.parse('1);} void f() {(int')}
|
1693
|
+
assert_raise(C::ParseError){C::Array.parse('1); (int')}
|
1694
|
+
assert_raise(C::ParseError){C::Array.parse('void')}
|
1698
1695
|
end
|
1699
1696
|
|
1700
1697
|
def test_function
|
@@ -1717,9 +1714,9 @@ Function
|
|
1717
1714
|
type: Int
|
1718
1715
|
name: "y"
|
1719
1716
|
EOS
|
1720
|
-
assert_raise(ParseError){C::Function.parse('1);} void f() {(int')}
|
1721
|
-
assert_raise(ParseError){C::Function.parse('1); (int')}
|
1722
|
-
assert_raise(ParseError){C::Function.parse('void')}
|
1717
|
+
assert_raise(C::ParseError){C::Function.parse('1);} void f() {(int')}
|
1718
|
+
assert_raise(C::ParseError){C::Function.parse('1); (int')}
|
1719
|
+
assert_raise(C::ParseError){C::Function.parse('void')}
|
1723
1720
|
end
|
1724
1721
|
|
1725
1722
|
def test_struct
|
@@ -1744,9 +1741,9 @@ Struct (const)
|
|
1744
1741
|
num_bits: IntLiteral
|
1745
1742
|
val: 4
|
1746
1743
|
EOS
|
1747
|
-
assert_raise(ParseError){C::Struct.parse('1);} void f() {(int')}
|
1748
|
-
assert_raise(ParseError){C::Struct.parse('1); (int')}
|
1749
|
-
assert_raise(ParseError){C::Struct.parse('void')}
|
1744
|
+
assert_raise(C::ParseError){C::Struct.parse('1);} void f() {(int')}
|
1745
|
+
assert_raise(C::ParseError){C::Struct.parse('1); (int')}
|
1746
|
+
assert_raise(C::ParseError){C::Struct.parse('void')}
|
1750
1747
|
end
|
1751
1748
|
|
1752
1749
|
def test_union
|
@@ -1771,9 +1768,9 @@ Union (const)
|
|
1771
1768
|
num_bits: IntLiteral
|
1772
1769
|
val: 4
|
1773
1770
|
EOS
|
1774
|
-
assert_raise(ParseError){C::Union.parse('1);} void f() {(int')}
|
1775
|
-
assert_raise(ParseError){C::Union.parse('1); (int')}
|
1776
|
-
assert_raise(ParseError){C::Union.parse('void')}
|
1771
|
+
assert_raise(C::ParseError){C::Union.parse('1);} void f() {(int')}
|
1772
|
+
assert_raise(C::ParseError){C::Union.parse('1); (int')}
|
1773
|
+
assert_raise(C::ParseError){C::Union.parse('void')}
|
1777
1774
|
end
|
1778
1775
|
|
1779
1776
|
def test_enum
|
@@ -1797,15 +1794,15 @@ Enum (const)
|
|
1797
1794
|
- Enumerator
|
1798
1795
|
name: "Z"
|
1799
1796
|
EOS
|
1800
|
-
assert_raise(ParseError){C::Enum.parse('1);} void f() {(int')}
|
1801
|
-
assert_raise(ParseError){C::Enum.parse('1); (int')}
|
1802
|
-
assert_raise(ParseError){C::Enum.parse('void')}
|
1797
|
+
assert_raise(C::ParseError){C::Enum.parse('1);} void f() {(int')}
|
1798
|
+
assert_raise(C::ParseError){C::Enum.parse('1); (int')}
|
1799
|
+
assert_raise(C::ParseError){C::Enum.parse('void')}
|
1803
1800
|
end
|
1804
1801
|
|
1805
1802
|
def test_custom_type
|
1806
|
-
assert_raise(ParseError){C::CustomType.parse('1);} void f() {(int')}
|
1807
|
-
assert_raise(ParseError){C::CustomType.parse('1); (int')}
|
1808
|
-
assert_raise(ParseError){C::CustomType.parse('void')}
|
1803
|
+
assert_raise(C::ParseError){C::CustomType.parse('1);} void f() {(int')}
|
1804
|
+
assert_raise(C::ParseError){C::CustomType.parse('1); (int')}
|
1805
|
+
assert_raise(C::ParseError){C::CustomType.parse('void')}
|
1809
1806
|
end
|
1810
1807
|
|
1811
1808
|
def test_void
|
@@ -1814,9 +1811,9 @@ const void
|
|
1814
1811
|
----
|
1815
1812
|
Void (const)
|
1816
1813
|
EOS
|
1817
|
-
assert_raise(ParseError){C::Void.parse('1);} void f() {(int')}
|
1818
|
-
assert_raise(ParseError){C::Void.parse('1); (int')}
|
1819
|
-
assert_raise(ParseError){C::Void.parse('int')}
|
1814
|
+
assert_raise(C::ParseError){C::Void.parse('1);} void f() {(int')}
|
1815
|
+
assert_raise(C::ParseError){C::Void.parse('1); (int')}
|
1816
|
+
assert_raise(C::ParseError){C::Void.parse('int')}
|
1820
1817
|
end
|
1821
1818
|
|
1822
1819
|
def test_int
|
@@ -1825,9 +1822,9 @@ const int
|
|
1825
1822
|
----
|
1826
1823
|
Int (const)
|
1827
1824
|
EOS
|
1828
|
-
assert_raise(ParseError){C::Int.parse('1);} void f() {(int')}
|
1829
|
-
assert_raise(ParseError){C::Int.parse('1); (int')}
|
1830
|
-
assert_raise(ParseError){C::Int.parse('void')}
|
1825
|
+
assert_raise(C::ParseError){C::Int.parse('1);} void f() {(int')}
|
1826
|
+
assert_raise(C::ParseError){C::Int.parse('1); (int')}
|
1827
|
+
assert_raise(C::ParseError){C::Int.parse('void')}
|
1831
1828
|
end
|
1832
1829
|
|
1833
1830
|
def test_float
|
@@ -1836,9 +1833,9 @@ const float
|
|
1836
1833
|
----
|
1837
1834
|
Float (const)
|
1838
1835
|
EOS
|
1839
|
-
assert_raise(ParseError){C::Float.parse('1);} void f() {(int')}
|
1840
|
-
assert_raise(ParseError){C::Float.parse('1); (int')}
|
1841
|
-
assert_raise(ParseError){C::Float.parse('void')}
|
1836
|
+
assert_raise(C::ParseError){C::Float.parse('1);} void f() {(int')}
|
1837
|
+
assert_raise(C::ParseError){C::Float.parse('1); (int')}
|
1838
|
+
assert_raise(C::ParseError){C::Float.parse('void')}
|
1842
1839
|
end
|
1843
1840
|
|
1844
1841
|
def test_char
|
@@ -1847,9 +1844,9 @@ const char
|
|
1847
1844
|
----
|
1848
1845
|
Char (const)
|
1849
1846
|
EOS
|
1850
|
-
assert_raise(ParseError){C::Char.parse('1);} void f() {(int')}
|
1851
|
-
assert_raise(ParseError){C::Char.parse('1); (int')}
|
1852
|
-
assert_raise(ParseError){C::Char.parse('void')}
|
1847
|
+
assert_raise(C::ParseError){C::Char.parse('1);} void f() {(int')}
|
1848
|
+
assert_raise(C::ParseError){C::Char.parse('1); (int')}
|
1849
|
+
assert_raise(C::ParseError){C::Char.parse('void')}
|
1853
1850
|
end
|
1854
1851
|
|
1855
1852
|
def test_bool
|
@@ -1858,9 +1855,9 @@ const _Bool
|
|
1858
1855
|
----
|
1859
1856
|
Bool (const)
|
1860
1857
|
EOS
|
1861
|
-
assert_raise(ParseError){C::Bool.parse('1);} void f() {(int')}
|
1862
|
-
assert_raise(ParseError){C::Bool.parse('1); (int')}
|
1863
|
-
assert_raise(ParseError){C::Bool.parse('void')}
|
1858
|
+
assert_raise(C::ParseError){C::Bool.parse('1);} void f() {(int')}
|
1859
|
+
assert_raise(C::ParseError){C::Bool.parse('1); (int')}
|
1860
|
+
assert_raise(C::ParseError){C::Bool.parse('void')}
|
1864
1861
|
end
|
1865
1862
|
|
1866
1863
|
def test_complex
|
@@ -1869,9 +1866,9 @@ const _Complex float
|
|
1869
1866
|
----
|
1870
1867
|
Complex (const)
|
1871
1868
|
EOS
|
1872
|
-
assert_raise(ParseError){C::Complex.parse('1);} void f() {(int')}
|
1873
|
-
assert_raise(ParseError){C::Complex.parse('1); (int')}
|
1874
|
-
assert_raise(ParseError){C::Complex.parse('void')}
|
1869
|
+
assert_raise(C::ParseError){C::Complex.parse('1);} void f() {(int')}
|
1870
|
+
assert_raise(C::ParseError){C::Complex.parse('1); (int')}
|
1871
|
+
assert_raise(C::ParseError){C::Complex.parse('void')}
|
1875
1872
|
end
|
1876
1873
|
|
1877
1874
|
def test_imaginary
|
@@ -1880,9 +1877,9 @@ const _Imaginary float
|
|
1880
1877
|
----
|
1881
1878
|
Imaginary (const)
|
1882
1879
|
EOS
|
1883
|
-
assert_raise(ParseError){C::Imaginary.parse('1);} void f() {(int')}
|
1884
|
-
assert_raise(ParseError){C::Imaginary.parse('1); (int')}
|
1885
|
-
assert_raise(ParseError){C::Imaginary.parse('void')}
|
1880
|
+
assert_raise(C::ParseError){C::Imaginary.parse('1);} void f() {(int')}
|
1881
|
+
assert_raise(C::ParseError){C::Imaginary.parse('1); (int')}
|
1882
|
+
assert_raise(C::ParseError){C::Imaginary.parse('void')}
|
1886
1883
|
end
|
1887
1884
|
|
1888
1885
|
def test_string_literal
|
@@ -1892,15 +1889,15 @@ EOS
|
|
1892
1889
|
StringLiteral
|
1893
1890
|
val: "hello"
|
1894
1891
|
EOS
|
1895
|
-
assert_raise(ParseError){C::StringLiteral.parse('} void f() {')}
|
1896
|
-
assert_raise(ParseError){C::StringLiteral.parse(';')}
|
1897
|
-
assert_raise(ParseError){C::StringLiteral.parse('int i')}
|
1898
|
-
assert_raise(ParseError){C::StringLiteral.parse('int')}
|
1899
|
-
assert_raise(ParseError){C::StringLiteral.parse('if (0)')}
|
1900
|
-
assert_raise(ParseError){C::StringLiteral.parse('switch (0)')}
|
1901
|
-
assert_raise(ParseError){C::StringLiteral.parse('for (;;)')}
|
1902
|
-
assert_raise(ParseError){C::StringLiteral.parse('goto')}
|
1903
|
-
assert_raise(ParseError){C::StringLiteral.parse('return')}
|
1892
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('} void f() {')}
|
1893
|
+
assert_raise(C::ParseError){C::StringLiteral.parse(';')}
|
1894
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('int i')}
|
1895
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('int')}
|
1896
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('if (0)')}
|
1897
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('switch (0)')}
|
1898
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('for (;;)')}
|
1899
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('goto')}
|
1900
|
+
assert_raise(C::ParseError){C::StringLiteral.parse('return')}
|
1904
1901
|
end
|
1905
1902
|
|
1906
1903
|
def test_char_literal
|
@@ -1910,15 +1907,15 @@ EOS
|
|
1910
1907
|
CharLiteral
|
1911
1908
|
val: "x"
|
1912
1909
|
EOS
|
1913
|
-
assert_raise(ParseError){C::CharLiteral.parse('} void f() {')}
|
1914
|
-
assert_raise(ParseError){C::CharLiteral.parse(';')}
|
1915
|
-
assert_raise(ParseError){C::CharLiteral.parse('int i')}
|
1916
|
-
assert_raise(ParseError){C::CharLiteral.parse('int')}
|
1917
|
-
assert_raise(ParseError){C::CharLiteral.parse('if (0)')}
|
1918
|
-
assert_raise(ParseError){C::CharLiteral.parse('switch (0)')}
|
1919
|
-
assert_raise(ParseError){C::CharLiteral.parse('for (;;)')}
|
1920
|
-
assert_raise(ParseError){C::CharLiteral.parse('goto')}
|
1921
|
-
assert_raise(ParseError){C::CharLiteral.parse('return')}
|
1910
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('} void f() {')}
|
1911
|
+
assert_raise(C::ParseError){C::CharLiteral.parse(';')}
|
1912
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('int i')}
|
1913
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('int')}
|
1914
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('if (0)')}
|
1915
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('switch (0)')}
|
1916
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('for (;;)')}
|
1917
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('goto')}
|
1918
|
+
assert_raise(C::ParseError){C::CharLiteral.parse('return')}
|
1922
1919
|
end
|
1923
1920
|
|
1924
1921
|
def test_compound_literal
|
@@ -1947,15 +1944,15 @@ CompoundLiteral
|
|
1947
1944
|
init: IntLiteral
|
1948
1945
|
val: 30
|
1949
1946
|
EOS
|
1950
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('} void f() {')}
|
1951
|
-
assert_raise(ParseError){C::CompoundLiteral.parse(';')}
|
1952
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('int i')}
|
1953
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('int')}
|
1954
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('if (0)')}
|
1955
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('switch (0)')}
|
1956
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('for (;;)')}
|
1957
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('goto')}
|
1958
|
-
assert_raise(ParseError){C::CompoundLiteral.parse('return')}
|
1947
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('} void f() {')}
|
1948
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse(';')}
|
1949
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('int i')}
|
1950
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('int')}
|
1951
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('if (0)')}
|
1952
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('switch (0)')}
|
1953
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('for (;;)')}
|
1954
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('goto')}
|
1955
|
+
assert_raise(C::ParseError){C::CompoundLiteral.parse('return')}
|
1959
1956
|
end
|
1960
1957
|
|
1961
1958
|
def test_int_literal
|
@@ -1965,15 +1962,15 @@ EOS
|
|
1965
1962
|
IntLiteral
|
1966
1963
|
val: 1
|
1967
1964
|
EOS
|
1968
|
-
assert_raise(ParseError){C::IntLiteral.parse('} void f() {')}
|
1969
|
-
assert_raise(ParseError){C::IntLiteral.parse(';')}
|
1970
|
-
assert_raise(ParseError){C::IntLiteral.parse('int i')}
|
1971
|
-
assert_raise(ParseError){C::IntLiteral.parse('int')}
|
1972
|
-
assert_raise(ParseError){C::IntLiteral.parse('if (0)')}
|
1973
|
-
assert_raise(ParseError){C::IntLiteral.parse('switch (0)')}
|
1974
|
-
assert_raise(ParseError){C::IntLiteral.parse('for (;;)')}
|
1975
|
-
assert_raise(ParseError){C::IntLiteral.parse('goto')}
|
1976
|
-
assert_raise(ParseError){C::IntLiteral.parse('return')}
|
1965
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('} void f() {')}
|
1966
|
+
assert_raise(C::ParseError){C::IntLiteral.parse(';')}
|
1967
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('int i')}
|
1968
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('int')}
|
1969
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('if (0)')}
|
1970
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('switch (0)')}
|
1971
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('for (;;)')}
|
1972
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('goto')}
|
1973
|
+
assert_raise(C::ParseError){C::IntLiteral.parse('return')}
|
1977
1974
|
end
|
1978
1975
|
|
1979
1976
|
def test_float_literal
|
@@ -1983,15 +1980,15 @@ EOS
|
|
1983
1980
|
FloatLiteral
|
1984
1981
|
val: 1.0
|
1985
1982
|
EOS
|
1986
|
-
assert_raise(ParseError){C::FloatLiteral.parse('} void f() {')}
|
1987
|
-
assert_raise(ParseError){C::FloatLiteral.parse(';')}
|
1988
|
-
assert_raise(ParseError){C::FloatLiteral.parse('int i')}
|
1989
|
-
assert_raise(ParseError){C::FloatLiteral.parse('int')}
|
1990
|
-
assert_raise(ParseError){C::FloatLiteral.parse('if (0)')}
|
1991
|
-
assert_raise(ParseError){C::FloatLiteral.parse('switch (0)')}
|
1992
|
-
assert_raise(ParseError){C::FloatLiteral.parse('for (;;)')}
|
1993
|
-
assert_raise(ParseError){C::FloatLiteral.parse('goto')}
|
1994
|
-
assert_raise(ParseError){C::FloatLiteral.parse('return')}
|
1983
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('} void f() {')}
|
1984
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse(';')}
|
1985
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('int i')}
|
1986
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('int')}
|
1987
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('if (0)')}
|
1988
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('switch (0)')}
|
1989
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('for (;;)')}
|
1990
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('goto')}
|
1991
|
+
assert_raise(C::ParseError){C::FloatLiteral.parse('return')}
|
1995
1992
|
end
|
1996
1993
|
|
1997
1994
|
def test_variable
|
@@ -2001,14 +1998,14 @@ x
|
|
2001
1998
|
Variable
|
2002
1999
|
name: "x"
|
2003
2000
|
EOS
|
2004
|
-
assert_raise(ParseError){C::Variable.parse('} void f() {')}
|
2005
|
-
assert_raise(ParseError){C::Variable.parse(';')}
|
2006
|
-
assert_raise(ParseError){C::Variable.parse('int i')}
|
2007
|
-
assert_raise(ParseError){C::Variable.parse('int')}
|
2008
|
-
assert_raise(ParseError){C::Variable.parse('if (0)')}
|
2009
|
-
assert_raise(ParseError){C::Variable.parse('switch (0)')}
|
2010
|
-
assert_raise(ParseError){C::Variable.parse('for (;;)')}
|
2011
|
-
assert_raise(ParseError){C::Variable.parse('goto')}
|
2012
|
-
assert_raise(ParseError){C::Variable.parse('return')}
|
2001
|
+
assert_raise(C::ParseError){C::Variable.parse('} void f() {')}
|
2002
|
+
assert_raise(C::ParseError){C::Variable.parse(';')}
|
2003
|
+
assert_raise(C::ParseError){C::Variable.parse('int i')}
|
2004
|
+
assert_raise(C::ParseError){C::Variable.parse('int')}
|
2005
|
+
assert_raise(C::ParseError){C::Variable.parse('if (0)')}
|
2006
|
+
assert_raise(C::ParseError){C::Variable.parse('switch (0)')}
|
2007
|
+
assert_raise(C::ParseError){C::Variable.parse('for (;;)')}
|
2008
|
+
assert_raise(C::ParseError){C::Variable.parse('goto')}
|
2009
|
+
assert_raise(C::ParseError){C::Variable.parse('return')}
|
2013
2010
|
end
|
2014
2011
|
end
|