finitio 0.7.0.pre.rc1 → 0.7.0.pre.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62428c8d4da07e87d6941a239e5d7f068dcbfbe5
4
- data.tar.gz: e20902929ec496b6ea231b5c66a63b7ef59432af
3
+ metadata.gz: 4b4c180986cc7160e2b3f76c23e37d23237cbaaf
4
+ data.tar.gz: b26dd47b86792ad28524e5e8f8df0ab5d56d0071
5
5
  SHA512:
6
- metadata.gz: c75b78277e39efebb52b2ba293f336953deb0c59f5b9eaa248e5c4645ae8ca078783466a8352f8a1ad98570d2fb2286a3ad2d3dadf0a6560b76ec336f311fc18
7
- data.tar.gz: b3cba6dc70482fb8b780c72ff500c37c13968f61ea2f8293fd263d1423261e1a482e9df296a6165cd71a787fdea5bfb696b91b3b944af006cf10a23e56121ac7
6
+ metadata.gz: b19ef54ca53c5e463aa6b4557d0ecd6ea537e6cdaa9349f960356b1b31525908be7d1a196cc2be9ab4985f70eea4133d2c54c03d3ee57b14cf48175efe7aaf02
7
+ data.tar.gz: 14d1db5a7285d522ce1ab093a5dc712f52b0c846b84e582e86fedbdfbd1320e6eafa7741b907f553aabdb29094bc7ebecf0b1a54a6358cc2ac9b761ae2289238
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- finitio (0.7.0.pre.rc1)
4
+ finitio (0.7.0.pre.rc2)
5
5
  citrus (>= 2.4, < 4.0)
6
6
 
7
7
  GEM
@@ -26,6 +26,16 @@ module Finitio
26
26
  @types[type.name] = type
27
27
  end
28
28
 
29
+ def each_type(&bl)
30
+ @types.values.each(&bl)
31
+ end
32
+ private :each_type
33
+
34
+ def each_import(&bl)
35
+ @imports.each(&bl)
36
+ end
37
+ private :each_import
38
+
29
39
  def get_type(name)
30
40
  fetch(name){|_|
31
41
  fetch(name.to_s){ nil }
@@ -87,5 +97,20 @@ module Finitio
87
97
  System.new(@types.dup, @imports.dup)
88
98
  end
89
99
 
100
+ def check_and_warn(io = STDERR)
101
+ each_type do |t|
102
+ next unless t.named?
103
+ each_import do |i|
104
+ next unless found = i.get_type(t.name)
105
+ if found == t
106
+ STDERR.puts "WARN: duplicate type def `#{t.name}`"
107
+ else
108
+ STDERR.puts "NOTICE: Type erasure `#{t.name}`"
109
+ end
110
+ end
111
+ end
112
+ self
113
+ end
114
+
90
115
  end # class System
91
116
  end # module Finitio
@@ -3,7 +3,7 @@ module Finitio
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 7
6
- TINY = "0-rc1"
6
+ TINY = "0-rc2"
7
7
 
8
8
  def self.to_s
9
9
  [ MAJOR, MINOR, TINY ].join('.')
@@ -29,4 +29,12 @@ describe Finitio, "system" do
29
29
  end
30
30
  end
31
31
 
32
+ context "feedback about duplicate types" do
33
+ subject{
34
+ Finitio.system(Path.dir/"with-duplicates.fio")
35
+ }
36
+
37
+ it{ should be_a(Finitio::System) }
38
+ end
39
+
32
40
  end
@@ -0,0 +1,3 @@
1
+ @import finitio/data
2
+
3
+ NilClass = .NilClass
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finitio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.pre.rc1
4
+ version: 0.7.0.pre.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-05 00:00:00.000000000 Z
11
+ date: 2019-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: citrus
@@ -152,6 +152,7 @@ files:
152
152
  - spec/finitio/test_ast.rb
153
153
  - spec/finitio/test_parse.rb
154
154
  - spec/finitio/test_system.rb
155
+ - spec/finitio/with-duplicates.fio
155
156
  - spec/heading/test_allow_extra.rb
156
157
  - spec/heading/test_each.rb
157
158
  - spec/heading/test_equality.rb
@@ -316,166 +317,167 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
317
  version: 1.3.1
317
318
  requirements: []
318
319
  rubyforge_project:
319
- rubygems_version: 2.6.11
320
+ rubygems_version: 2.5.2
320
321
  signing_key:
321
322
  specification_version: 4
322
323
  summary: Finitio - in Ruby
323
324
  test_files:
325
+ - spec/spec_helper.rb
326
+ - spec/type_factory/factory/test_tuple_type.rb
327
+ - spec/type_factory/factory/test_builtin.rb
328
+ - spec/type_factory/factory/test_set_type.rb
329
+ - spec/type_factory/factory/test_struct_type.rb
330
+ - spec/type_factory/factory/test_sub_type.rb
331
+ - spec/type_factory/factory/test_seq_type.rb
332
+ - spec/type_factory/dsl/test_attributes.rb
333
+ - spec/type_factory/dsl/test_builtin.rb
334
+ - spec/type_factory/dsl/test_adt.rb
335
+ - spec/type_factory/dsl/test_multi_tuple.rb
336
+ - spec/type_factory/dsl/test_seq.rb
337
+ - spec/type_factory/dsl/test_multi_relation.rb
338
+ - spec/type_factory/dsl/test_tuple.rb
339
+ - spec/type_factory/dsl/test_set.rb
340
+ - spec/type_factory/dsl/test_attribute.rb
341
+ - spec/type_factory/dsl/test_any.rb
342
+ - spec/type_factory/dsl/test_union.rb
343
+ - spec/type_factory/dsl/test_struct.rb
344
+ - spec/type_factory/dsl/test_relation.rb
345
+ - spec/type_factory/dsl/test_subtype.rb
346
+ - spec/attribute/test_initialize.rb
324
347
  - spec/attribute/test_equality.rb
348
+ - spec/attribute/test_to_name.rb
325
349
  - spec/attribute/test_fetch_on.rb
326
- - spec/attribute/test_initialize.rb
327
350
  - spec/attribute/test_optional.rb
328
351
  - spec/attribute/test_required.rb
329
- - spec/attribute/test_to_name.rb
330
- - spec/constraint/test_anonymous.rb
331
- - spec/constraint/test_equality.rb
332
- - spec/constraint/test_name.rb
333
- - spec/constraint/test_named.rb
334
- - spec/constraint/test_triple_equal.rb
335
- - spec/finitio/system.fio
336
- - spec/finitio/test_ast.rb
337
- - spec/finitio/test_parse.rb
338
- - spec/finitio/test_system.rb
339
- - spec/heading/test_allow_extra.rb
340
- - spec/heading/test_each.rb
341
- - spec/heading/test_equality.rb
342
- - spec/heading/test_hash.rb
343
352
  - spec/heading/test_hash_get.rb
344
353
  - spec/heading/test_initialize.rb
354
+ - spec/heading/test_equality.rb
355
+ - spec/heading/test_to_name.rb
345
356
  - spec/heading/test_multi.rb
357
+ - spec/heading/test_hash.rb
358
+ - spec/heading/test_allow_extra.rb
346
359
  - spec/heading/test_size.rb
347
- - spec/heading/test_to_name.rb
348
- - spec/spec_helper.rb
349
- - spec/syntax/expr/test_free_variables.rb
350
- - spec/syntax/expr/test_to_proc_source.rb
351
- - spec/syntax/nodes/imported.fio
352
- - spec/syntax/nodes/test_ad_type.rb
353
- - spec/syntax/nodes/test_any_type.rb
354
- - spec/syntax/nodes/test_attribute.rb
355
- - spec/syntax/nodes/test_builtin_type.rb
356
- - spec/syntax/nodes/test_comment.rb
357
- - spec/syntax/nodes/test_constraint_def.rb
358
- - spec/syntax/nodes/test_constraints.rb
359
- - spec/syntax/nodes/test_contract.rb
360
- - spec/syntax/nodes/test_expression.rb
361
- - spec/syntax/nodes/test_heading.rb
362
- - spec/syntax/nodes/test_import.rb
363
- - spec/syntax/nodes/test_metadata.rb
364
- - spec/syntax/nodes/test_named_constraint.rb
365
- - spec/syntax/nodes/test_relation_type.rb
366
- - spec/syntax/nodes/test_seq_type.rb
367
- - spec/syntax/nodes/test_set_type.rb
368
- - spec/syntax/nodes/test_spacing.rb
369
- - spec/syntax/nodes/test_struct_type.rb
370
- - spec/syntax/nodes/test_sub_type.rb
371
- - spec/syntax/nodes/test_system.rb
372
- - spec/syntax/nodes/test_tuple_type.rb
373
- - spec/syntax/nodes/test_type_def.rb
374
- - spec/syntax/nodes/test_type_ref.rb
375
- - spec/syntax/nodes/test_union_type.rb
376
- - spec/syntax/nodes/test_unnamed_constraint.rb
377
- - spec/syntax/test_compile.rb
378
- - spec/syntax/test_compile_type.rb
360
+ - spec/heading/test_each.rb
361
+ - spec/test_finitio.rb
362
+ - spec/finitio/test_ast.rb
363
+ - spec/finitio/with-duplicates.fio
364
+ - spec/finitio/system.fio
365
+ - spec/finitio/test_system.rb
366
+ - spec/finitio/test_parse.rb
367
+ - spec/system/test_initialize.rb
368
+ - spec/system/test_get_type.rb
369
+ - spec/system/test_fetch.rb
370
+ - spec/system/test_dup.rb
379
371
  - spec/system/test_add_type.rb
380
372
  - spec/system/test_dsl.rb
381
- - spec/system/test_dup.rb
382
- - spec/system/test_fetch.rb
383
- - spec/system/test_get_type.rb
384
- - spec/system/test_initialize.rb
385
- - spec/test_finitio.rb
373
+ - spec/type/multi_relation_type/test_name.rb
374
+ - spec/type/multi_relation_type/test_initialize.rb
375
+ - spec/type/multi_relation_type/test_equality.rb
376
+ - spec/type/multi_relation_type/test_include.rb
377
+ - spec/type/multi_relation_type/test_default_name.rb
378
+ - spec/type/multi_relation_type/test_dress.rb
379
+ - spec/type/sub_type/test_name.rb
380
+ - spec/type/sub_type/test_initialize.rb
381
+ - spec/type/sub_type/test_equality.rb
382
+ - spec/type/sub_type/test_include.rb
383
+ - spec/type/sub_type/test_default_name.rb
384
+ - spec/type/sub_type/test_dress.rb
385
+ - spec/type/proxy_type/test_resolve.rb
386
+ - spec/type/proxy_type/test_delegation.rb
387
+ - spec/type/ad_type/test_name.rb
388
+ - spec/type/ad_type/test_initialize.rb
389
+ - spec/type/ad_type/test_include.rb
386
390
  - spec/type/ad_type/test_default_name.rb
387
391
  - spec/type/ad_type/test_dress.rb
388
- - spec/type/ad_type/test_include.rb
389
- - spec/type/ad_type/test_initialize.rb
390
- - spec/type/ad_type/test_name.rb
391
- - spec/type/alias_type/test_default_name.rb
392
- - spec/type/alias_type/test_delegation.rb
393
- - spec/type/alias_type/test_name.rb
394
- - spec/type/any_type/test_default_name.rb
395
- - spec/type/any_type/test_dress.rb
392
+ - spec/type/struct_type/test_name.rb
393
+ - spec/type/struct_type/test_initialize.rb
394
+ - spec/type/struct_type/test_equality.rb
395
+ - spec/type/struct_type/test_include.rb
396
+ - spec/type/struct_type/test_default_name.rb
397
+ - spec/type/struct_type/test_dress.rb
398
+ - spec/type/set_type/test_name.rb
399
+ - spec/type/set_type/test_initialize.rb
400
+ - spec/type/set_type/test_equality.rb
401
+ - spec/type/set_type/test_include.rb
402
+ - spec/type/set_type/test_default_name.rb
403
+ - spec/type/set_type/test_dress.rb
404
+ - spec/type/relation_type/test_name.rb
405
+ - spec/type/relation_type/test_initialize.rb
406
+ - spec/type/relation_type/test_equality.rb
407
+ - spec/type/relation_type/test_include.rb
408
+ - spec/type/relation_type/test_default_name.rb
409
+ - spec/type/relation_type/test_dress.rb
410
+ - spec/type/any_type/test_name.rb
411
+ - spec/type/any_type/test_initialize.rb
396
412
  - spec/type/any_type/test_equality.rb
397
413
  - spec/type/any_type/test_include.rb
398
- - spec/type/any_type/test_initialize.rb
399
- - spec/type/any_type/test_name.rb
400
- - spec/type/builtin_type/test_default_name.rb
401
- - spec/type/builtin_type/test_dress.rb
414
+ - spec/type/any_type/test_default_name.rb
415
+ - spec/type/any_type/test_dress.rb
416
+ - spec/type/builtin_type/test_name.rb
417
+ - spec/type/builtin_type/test_initialize.rb
402
418
  - spec/type/builtin_type/test_equality.rb
403
419
  - spec/type/builtin_type/test_include.rb
404
- - spec/type/builtin_type/test_initialize.rb
405
- - spec/type/builtin_type/test_name.rb
406
- - spec/type/multi_relation_type/test_default_name.rb
407
- - spec/type/multi_relation_type/test_dress.rb
408
- - spec/type/multi_relation_type/test_equality.rb
409
- - spec/type/multi_relation_type/test_include.rb
410
- - spec/type/multi_relation_type/test_initialize.rb
411
- - spec/type/multi_relation_type/test_name.rb
412
- - spec/type/multi_tuple_type/test_default_name.rb
413
- - spec/type/multi_tuple_type/test_dress.rb
414
- - spec/type/multi_tuple_type/test_equality.rb
415
- - spec/type/multi_tuple_type/test_include.rb
416
- - spec/type/multi_tuple_type/test_initialize.rb
417
- - spec/type/multi_tuple_type/test_name.rb
418
- - spec/type/proxy_type/test_delegation.rb
419
- - spec/type/proxy_type/test_resolve.rb
420
- - spec/type/relation_type/test_default_name.rb
421
- - spec/type/relation_type/test_dress.rb
422
- - spec/type/relation_type/test_equality.rb
423
- - spec/type/relation_type/test_include.rb
424
- - spec/type/relation_type/test_initialize.rb
425
- - spec/type/relation_type/test_name.rb
426
- - spec/type/seq_type/test_default_name.rb
427
- - spec/type/seq_type/test_dress.rb
428
- - spec/type/seq_type/test_equality.rb
429
- - spec/type/seq_type/test_include.rb
430
- - spec/type/seq_type/test_initialize.rb
431
- - spec/type/seq_type/test_name.rb
432
- - spec/type/set_type/test_default_name.rb
433
- - spec/type/set_type/test_dress.rb
434
- - spec/type/set_type/test_equality.rb
435
- - spec/type/set_type/test_include.rb
436
- - spec/type/set_type/test_initialize.rb
437
- - spec/type/set_type/test_name.rb
438
- - spec/type/struct_type/test_default_name.rb
439
- - spec/type/struct_type/test_dress.rb
440
- - spec/type/struct_type/test_equality.rb
441
- - spec/type/struct_type/test_include.rb
442
- - spec/type/struct_type/test_initialize.rb
443
- - spec/type/struct_type/test_name.rb
444
- - spec/type/sub_type/test_default_name.rb
445
- - spec/type/sub_type/test_dress.rb
446
- - spec/type/sub_type/test_equality.rb
447
- - spec/type/sub_type/test_include.rb
448
- - spec/type/sub_type/test_initialize.rb
449
- - spec/type/sub_type/test_name.rb
450
- - spec/type/tuple_type/test_default_name.rb
451
- - spec/type/tuple_type/test_dress.rb
452
- - spec/type/tuple_type/test_equality.rb
453
- - spec/type/tuple_type/test_include.rb
454
- - spec/type/tuple_type/test_initialize.rb
455
- - spec/type/tuple_type/test_name.rb
456
- - spec/type/union_type/test_default_name.rb
457
- - spec/type/union_type/test_dress.rb
420
+ - spec/type/builtin_type/test_default_name.rb
421
+ - spec/type/builtin_type/test_dress.rb
422
+ - spec/type/union_type/test_name.rb
423
+ - spec/type/union_type/test_initialize.rb
458
424
  - spec/type/union_type/test_equality.rb
459
425
  - spec/type/union_type/test_include.rb
460
- - spec/type/union_type/test_initialize.rb
461
- - spec/type/union_type/test_name.rb
462
- - spec/type_factory/dsl/test_adt.rb
463
- - spec/type_factory/dsl/test_any.rb
464
- - spec/type_factory/dsl/test_attribute.rb
465
- - spec/type_factory/dsl/test_attributes.rb
466
- - spec/type_factory/dsl/test_builtin.rb
467
- - spec/type_factory/dsl/test_multi_relation.rb
468
- - spec/type_factory/dsl/test_multi_tuple.rb
469
- - spec/type_factory/dsl/test_relation.rb
470
- - spec/type_factory/dsl/test_seq.rb
471
- - spec/type_factory/dsl/test_set.rb
472
- - spec/type_factory/dsl/test_struct.rb
473
- - spec/type_factory/dsl/test_subtype.rb
474
- - spec/type_factory/dsl/test_tuple.rb
475
- - spec/type_factory/dsl/test_union.rb
476
- - spec/type_factory/factory/test_builtin.rb
477
- - spec/type_factory/factory/test_seq_type.rb
478
- - spec/type_factory/factory/test_set_type.rb
479
- - spec/type_factory/factory/test_struct_type.rb
480
- - spec/type_factory/factory/test_sub_type.rb
481
- - spec/type_factory/factory/test_tuple_type.rb
426
+ - spec/type/union_type/test_default_name.rb
427
+ - spec/type/union_type/test_dress.rb
428
+ - spec/type/tuple_type/test_name.rb
429
+ - spec/type/tuple_type/test_initialize.rb
430
+ - spec/type/tuple_type/test_equality.rb
431
+ - spec/type/tuple_type/test_include.rb
432
+ - spec/type/tuple_type/test_default_name.rb
433
+ - spec/type/tuple_type/test_dress.rb
434
+ - spec/type/alias_type/test_name.rb
435
+ - spec/type/alias_type/test_default_name.rb
436
+ - spec/type/alias_type/test_delegation.rb
437
+ - spec/type/seq_type/test_name.rb
438
+ - spec/type/seq_type/test_initialize.rb
439
+ - spec/type/seq_type/test_equality.rb
440
+ - spec/type/seq_type/test_include.rb
441
+ - spec/type/seq_type/test_default_name.rb
442
+ - spec/type/seq_type/test_dress.rb
443
+ - spec/type/multi_tuple_type/test_name.rb
444
+ - spec/type/multi_tuple_type/test_initialize.rb
445
+ - spec/type/multi_tuple_type/test_equality.rb
446
+ - spec/type/multi_tuple_type/test_include.rb
447
+ - spec/type/multi_tuple_type/test_default_name.rb
448
+ - spec/type/multi_tuple_type/test_dress.rb
449
+ - spec/syntax/nodes/test_tuple_type.rb
450
+ - spec/syntax/nodes/test_set_type.rb
451
+ - spec/syntax/nodes/test_union_type.rb
452
+ - spec/syntax/nodes/test_heading.rb
453
+ - spec/syntax/nodes/test_builtin_type.rb
454
+ - spec/syntax/nodes/imported.fio
455
+ - spec/syntax/nodes/test_import.rb
456
+ - spec/syntax/nodes/test_constraints.rb
457
+ - spec/syntax/nodes/test_type_ref.rb
458
+ - spec/syntax/nodes/test_system.rb
459
+ - spec/syntax/nodes/test_attribute.rb
460
+ - spec/syntax/nodes/test_contract.rb
461
+ - spec/syntax/nodes/test_named_constraint.rb
462
+ - spec/syntax/nodes/test_metadata.rb
463
+ - spec/syntax/nodes/test_type_def.rb
464
+ - spec/syntax/nodes/test_struct_type.rb
465
+ - spec/syntax/nodes/test_sub_type.rb
466
+ - spec/syntax/nodes/test_any_type.rb
467
+ - spec/syntax/nodes/test_constraint_def.rb
468
+ - spec/syntax/nodes/test_ad_type.rb
469
+ - spec/syntax/nodes/test_expression.rb
470
+ - spec/syntax/nodes/test_relation_type.rb
471
+ - spec/syntax/nodes/test_spacing.rb
472
+ - spec/syntax/nodes/test_comment.rb
473
+ - spec/syntax/nodes/test_seq_type.rb
474
+ - spec/syntax/nodes/test_unnamed_constraint.rb
475
+ - spec/syntax/expr/test_to_proc_source.rb
476
+ - spec/syntax/expr/test_free_variables.rb
477
+ - spec/syntax/test_compile.rb
478
+ - spec/syntax/test_compile_type.rb
479
+ - spec/constraint/test_name.rb
480
+ - spec/constraint/test_equality.rb
481
+ - spec/constraint/test_anonymous.rb
482
+ - spec/constraint/test_named.rb
483
+ - spec/constraint/test_triple_equal.rb