chelsy 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 129bcae8df6bfcf4cfd02feda9b21434f0e14995
4
- data.tar.gz: 5cffbdf5d8eb95b8818f8787cb57e9600cae90ce
3
+ metadata.gz: 12890aa7a65ea8ba2ae82a58ccde7c00b6f48dcc
4
+ data.tar.gz: 925692aeeb8a6afefddad2120c937e572ec37881
5
5
  SHA512:
6
- metadata.gz: 96b462cba28e4e094d5b7013a6f9ecda4076c25d00a6a4dded2b11e74d365923c50d14f9dd74f477406c709ca08408808f74e1c01539ffe4078eb3f18d9eb172
7
- data.tar.gz: a2f7ed0df99110425279350a7c7771dd35ad7e77d409019f50877d59f2da95eadc44f9fb7bce76d80aa934de2854358fb9d2b35b47fbd92eccc0287518ede8f2
6
+ metadata.gz: 002b987b8be634228cdb3d23399211df5aa311727359749f7e646623e938fd5442841ccf5915b1b9ce2ae1559a10ec515b30ad940248442aaa031ab97ed795ea
7
+ data.tar.gz: ae9080c3b6b5fe7b77ad4241cf1a237b604f91d0b4a449a35233f9523d3f2840cec32020135cb9d3b54e6c1e68b2be357726f2d0f4e6546440f5495ffad3d5db
data/lib/chelsy/ast.rb CHANGED
@@ -1248,7 +1248,7 @@ module Chelsy
1248
1248
  attr_reader :lineno, :filename
1249
1249
 
1250
1250
  def initialize(lineno, filename=nil, **rest)
1251
- @lineno = Syntax::Constant::Int.ensure(lineno)
1251
+ @lineno = Syntax::Coercers::Int.ensure(lineno)
1252
1252
  @filename = immutable_stringify(filename) if filename
1253
1253
 
1254
1254
  super **rest
@@ -1288,13 +1288,17 @@ end
1288
1288
  module Chelsy
1289
1289
  module Syntax
1290
1290
 
1291
- module Constant
1292
- Int = Coercer.new(Chelsy::Constant::Int) do |value|
1293
- Chelsy::Constant::Int.new(value) if ::Integer === value
1291
+ module Coercers
1292
+ Int = Coercer.new(Constant::Int) do |value|
1293
+ Constant::Int.new(value) if ::Integer === value
1294
1294
  end
1295
1295
 
1296
- String = Coercer.new(Chelsy::Constant::String) do |value|
1297
- Chelsy::Constant::String.new(value) if ::String === value
1296
+ String = Coercer.new(Constant::String) do |value|
1297
+ Constant::String.new(value) if ::String === value
1298
+ end
1299
+
1300
+ Param = Coercer.new(Chelsy::Param) do |value|
1301
+ Chelsy::Param.new(*value) if ::Array === value
1298
1302
  end
1299
1303
  end
1300
1304
 
@@ -1304,18 +1308,18 @@ module Chelsy
1304
1308
  Expr = Any.new('Expression', [
1305
1309
  Chelsy::Expr,
1306
1310
  Syntax::Ident,
1307
- Syntax::Constant::Int,
1308
- Syntax::Constant::String,
1311
+ Coercers::Int,
1312
+ Coercers::String,
1309
1313
  ])
1310
1314
  ExprOrType = Any.new('Expression-Or-Type', [Syntax::Expr, Syntax::Type])
1311
1315
  Fragment = Any.new('Fragment', [Fragment, String])
1312
1316
  Storage = Any.new('Storage-class specifiers', [:typedef, :extern, :static])
1313
- Param = Any.new('Parameter', [Chelsy::Param, :void, :"..."])
1317
+ Param = Any.new('Parameter', [Syntax::Coercers::Param, :void, :"..."])
1314
1318
  ProtoParam = Any.new('Prototype Parameter', [Syntax::Param, Symbol, Chelsy::Type::Base])
1315
1319
  ArraySize = Any.new('ArraySize', [Syntax::Expr])
1316
1320
  BitField = Any.new('BitField', [
1317
1321
  Chelsy::Constant::Integral,
1318
- Syntax::Constant::Int,
1322
+ Coercers::Int,
1319
1323
  ])
1320
1324
  StructOrUnionMember = Any.new('StructOrUnionMember', [Chelsy::Declaration, Chelsy::BitField])
1321
1325
  EnumMember = Any.new('EnumMember', [Chelsy::EnumMember, Symbol])
@@ -1,3 +1,3 @@
1
1
  module Chelsy
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -16,8 +16,8 @@ doc.fragments << Directive::Define.new(:STEP, 20)
16
16
 
17
17
  doc << Function.new(:main,
18
18
  Type::Int.new, [
19
- Param.new(:argc, Type::Int.new),
20
- Param.new(:argv, Type::Pointer.new(Type::Pointer.new(Type::Char.new(const: true)))),
19
+ [:argc, Type::Int.new],
20
+ [:argv, Type::Pointer.new(Type::Pointer.new(Type::Char.new(const: true)))],
21
21
  ]) do |b|
22
22
  init = Declaration.new(:fahr, Type::Int.new, :LOWER)
23
23
  cond = Operator::LessThanOrEqual.new(:fahr, :UPPER)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chelsy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takanori Ishikawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-03 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler