iv-phonic 0.0.6 → 0.0.7
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.
- data/Manifest.txt +33 -33
- data/Rakefile +1 -1
- data/ext/include/iv/ast.h +2 -2
- data/ext/include/iv/{ast-serializer.h → ast_serializer.h} +1 -1
- data/ext/include/iv/{ast-visitor.h → ast_visitor.h} +1 -1
- data/ext/include/iv/conversions.h +20 -5
- data/ext/include/iv/lexer.h +1 -1
- data/ext/include/iv/parser.h +1 -1
- data/ext/include/iv/space.h +4 -5
- data/ext/include/iv/stringpiece.h +1 -1
- data/ext/iv/phonic/creator.h +1 -1
- data/ext/iv/phonic/factory.h +1 -1
- metadata +38 -44
- /data/ext/include/iv/{ast-factory.h → ast_factory.h} +0 -0
- /data/ext/include/iv/{ast-fwd.h → ast_fwd.h} +0 -0
- /data/ext/include/iv/{ast-info.h → ast_info.h} +0 -0
- /data/ext/iv/phonic/{ast-fwd.h → ast_fwd.h} +0 -0
data/Manifest.txt
CHANGED
@@ -3,45 +3,45 @@ Manifest.txt
|
|
3
3
|
README.rdoc
|
4
4
|
Rakefile
|
5
5
|
test/test_iv_phonic.rb
|
6
|
+
ext/include/iv/ast_factory.h
|
7
|
+
ext/include/iv/uchar.h
|
8
|
+
ext/include/iv/space.h
|
9
|
+
ext/include/iv/lexer.h
|
10
|
+
ext/include/iv/conversions.h
|
11
|
+
ext/include/iv/dtoa.h
|
6
12
|
ext/include/iv/mt19937.h
|
7
|
-
ext/include/iv/token.h
|
8
|
-
ext/include/iv/any.h
|
9
|
-
ext/include/iv/ast-fwd.h
|
10
|
-
ext/include/iv/static_assert.h
|
11
13
|
ext/include/iv/ast.h
|
12
|
-
ext/include/iv/dtoa.h
|
13
|
-
ext/include/iv/ast-visitor.h
|
14
|
-
ext/include/iv/ustringpiece.h
|
15
|
-
ext/include/iv/ucdata.h
|
16
|
-
ext/include/iv/ustring.h
|
17
14
|
ext/include/iv/noncopyable.h
|
18
|
-
ext/include/iv/
|
19
|
-
ext/include/iv/
|
15
|
+
ext/include/iv/stringpiece.h
|
16
|
+
ext/include/iv/static_assert.h
|
17
|
+
ext/include/iv/functor.h
|
18
|
+
ext/include/iv/ast_fwd.h
|
19
|
+
ext/include/iv/parser.h
|
20
|
+
ext/include/iv/errors.h
|
21
|
+
ext/include/iv/token.h
|
20
22
|
ext/include/iv/enable_if.h
|
21
|
-
ext/include/iv/
|
22
|
-
ext/include/iv/
|
23
|
-
ext/include/iv/
|
24
|
-
ext/include/iv/lexer.h
|
23
|
+
ext/include/iv/any.h
|
24
|
+
ext/include/iv/keyword.h
|
25
|
+
ext/include/iv/cmdline.h
|
25
26
|
ext/include/iv/xorshift.h
|
26
|
-
ext/include/iv/
|
27
|
+
ext/include/iv/location.h
|
28
|
+
ext/include/iv/ast_info.h
|
29
|
+
ext/include/iv/none.h
|
27
30
|
ext/include/iv/algorithm.h
|
28
|
-
ext/include/iv/
|
29
|
-
ext/include/iv/
|
30
|
-
ext/include/iv/
|
31
|
-
ext/include/iv/
|
32
|
-
ext/include/iv/stringpiece.h
|
33
|
-
ext/include/iv/uchar.h
|
34
|
-
ext/include/iv/ast-factory.h
|
31
|
+
ext/include/iv/ustring.h
|
32
|
+
ext/include/iv/ast_serializer.h
|
33
|
+
ext/include/iv/utils.h
|
34
|
+
ext/include/iv/ast_visitor.h
|
35
35
|
ext/include/iv/alloc.h
|
36
|
-
ext/include/iv/
|
37
|
-
ext/include/iv/
|
38
|
-
ext/include/iv/
|
39
|
-
ext/include/iv/
|
40
|
-
ext/iv/phonic/
|
36
|
+
ext/include/iv/chars.h
|
37
|
+
ext/include/iv/fixedcontainer.h
|
38
|
+
ext/include/iv/ustringpiece.h
|
39
|
+
ext/include/iv/ucdata.h
|
40
|
+
ext/iv/phonic/factory.h
|
41
|
+
ext/iv/phonic/ast_fwd.h
|
42
|
+
ext/iv/phonic/parser.h
|
43
|
+
ext/iv/phonic/encoding.h
|
41
44
|
ext/iv/phonic/source.h
|
42
|
-
ext/iv/phonic/creator.h
|
43
45
|
ext/iv/phonic/phonic.cc
|
44
|
-
ext/iv/phonic/
|
45
|
-
ext/iv/phonic/
|
46
|
-
ext/iv/phonic/parser.h
|
47
|
-
ext/iv/phonic/factory.h
|
46
|
+
ext/iv/phonic/creator.h
|
47
|
+
ext/iv/phonic/extconf.rb
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ directory "ext/include/iv"
|
|
10
10
|
|
11
11
|
HOE = Hoe.spec 'iv-phonic' do
|
12
12
|
developer('Constellation', 'utatane.tea@gmail.com')
|
13
|
-
self.version = '0.0.
|
13
|
+
self.version = '0.0.7'
|
14
14
|
self.readme_file = 'README.rdoc'
|
15
15
|
self.history_file = 'ChangeLog'
|
16
16
|
self.extra_rdoc_files = FileList['*.rdoc']
|
data/ext/include/iv/ast.h
CHANGED
@@ -252,7 +252,7 @@ inline double StringToDouble(Iter it, Iter last, bool parse_float) {
|
|
252
252
|
return (parse_float && !is_found_zero) ? Conversions::kNaN : 0;
|
253
253
|
} else {
|
254
254
|
buffer[pos++] = '\0';
|
255
|
-
return std::
|
255
|
+
return std::atof(buffer.data());
|
256
256
|
}
|
257
257
|
} else {
|
258
258
|
return Conversions::kNaN;
|
@@ -421,13 +421,20 @@ inline double DoubleToInteger(double d) {
|
|
421
421
|
return std::floor(std::abs(d)) * (std::signbit(d) ? -1 : 1);
|
422
422
|
}
|
423
423
|
|
424
|
-
|
424
|
+
template<typename Iter>
|
425
|
+
inline bool ConvertToUInt32(Iter it, const Iter last, uint32_t* value) {
|
425
426
|
static const uint32_t uint32_t_max = std::numeric_limits<uint32_t>::max();
|
426
427
|
uint16_t ch;
|
427
428
|
*value = 0;
|
428
|
-
|
429
|
-
|
430
|
-
|
429
|
+
if (it != last && *it == '0') {
|
430
|
+
if (it + 1 != last) {
|
431
|
+
return false;
|
432
|
+
} else {
|
433
|
+
*value = 0;
|
434
|
+
return true;
|
435
|
+
}
|
436
|
+
}
|
437
|
+
if (it != last && Chars::IsDecimalDigit(*it)) {
|
431
438
|
ch = *it - '0';
|
432
439
|
*value = ch;
|
433
440
|
} else {
|
@@ -449,6 +456,14 @@ inline bool ConvertToUInt32(const UStringPiece& str, uint32_t* value) {
|
|
449
456
|
(ch < (uint32_t_max % 10))));
|
450
457
|
}
|
451
458
|
|
459
|
+
inline bool ConvertToUInt32(const UStringPiece& str, uint32_t* value) {
|
460
|
+
return ConvertToUInt32(str.begin(), str.end(), value);
|
461
|
+
}
|
462
|
+
|
463
|
+
inline bool ConvertToUInt32(const StringPiece& str, uint32_t* value) {
|
464
|
+
return ConvertToUInt32(str.begin(), str.end(), value);
|
465
|
+
}
|
466
|
+
|
452
467
|
template<typename T>
|
453
468
|
inline std::size_t DoubleToStringWithRadix(double v, int radix, T* buf) {
|
454
469
|
static const int kMaxBufSize = 1100;
|
data/ext/include/iv/lexer.h
CHANGED
data/ext/include/iv/parser.h
CHANGED
data/ext/include/iv/space.h
CHANGED
@@ -92,19 +92,18 @@ class SpaceAllocator {
|
|
92
92
|
return *this;
|
93
93
|
}
|
94
94
|
|
95
|
-
Factory* space() const {
|
95
|
+
inline Factory* space() const {
|
96
96
|
return space_;
|
97
97
|
}
|
98
98
|
|
99
|
-
|
99
|
+
private:
|
100
100
|
void Swap(this_type& rhs) {
|
101
101
|
using std::swap;
|
102
102
|
swap(space_, rhs.space_);
|
103
103
|
}
|
104
|
-
Factory* space_;
|
105
|
-
|
106
|
-
private:
|
107
104
|
void operator=(const SpaceAllocator&);
|
105
|
+
|
106
|
+
Factory* space_;
|
108
107
|
};
|
109
108
|
|
110
109
|
template <typename Factory, typename T>
|
data/ext/iv/phonic/creator.h
CHANGED
data/ext/iv/phonic/factory.h
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iv-phonic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 19
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 7
|
9
|
+
version: 0.0.7
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Constellation
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-12-
|
17
|
+
date: 2010-12-11 00:00:00 +09:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 7
|
30
28
|
segments:
|
31
29
|
- 2
|
32
30
|
- 0
|
@@ -42,7 +40,6 @@ dependencies:
|
|
42
40
|
requirements:
|
43
41
|
- - ">="
|
44
42
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 3
|
46
43
|
segments:
|
47
44
|
- 0
|
48
45
|
version: "0"
|
@@ -56,12 +53,11 @@ dependencies:
|
|
56
53
|
requirements:
|
57
54
|
- - ">="
|
58
55
|
- !ruby/object:Gem::Version
|
59
|
-
hash: 19
|
60
56
|
segments:
|
61
57
|
- 2
|
62
|
-
-
|
63
|
-
-
|
64
|
-
version: 2.
|
58
|
+
- 6
|
59
|
+
- 2
|
60
|
+
version: 2.6.2
|
65
61
|
type: :development
|
66
62
|
version_requirements: *id003
|
67
63
|
description: phonic is ruby binding for iv AST API
|
@@ -80,48 +76,48 @@ files:
|
|
80
76
|
- README.rdoc
|
81
77
|
- Rakefile
|
82
78
|
- test/test_iv_phonic.rb
|
79
|
+
- ext/include/iv/ast_factory.h
|
80
|
+
- ext/include/iv/uchar.h
|
81
|
+
- ext/include/iv/space.h
|
82
|
+
- ext/include/iv/lexer.h
|
83
|
+
- ext/include/iv/conversions.h
|
84
|
+
- ext/include/iv/dtoa.h
|
83
85
|
- ext/include/iv/mt19937.h
|
84
|
-
- ext/include/iv/token.h
|
85
|
-
- ext/include/iv/any.h
|
86
|
-
- ext/include/iv/ast-fwd.h
|
87
|
-
- ext/include/iv/static_assert.h
|
88
86
|
- ext/include/iv/ast.h
|
89
|
-
- ext/include/iv/dtoa.h
|
90
|
-
- ext/include/iv/ast-visitor.h
|
91
|
-
- ext/include/iv/ustringpiece.h
|
92
|
-
- ext/include/iv/ucdata.h
|
93
|
-
- ext/include/iv/ustring.h
|
94
87
|
- ext/include/iv/noncopyable.h
|
95
|
-
- ext/include/iv/
|
96
|
-
- ext/include/iv/
|
88
|
+
- ext/include/iv/stringpiece.h
|
89
|
+
- ext/include/iv/static_assert.h
|
90
|
+
- ext/include/iv/functor.h
|
91
|
+
- ext/include/iv/ast_fwd.h
|
92
|
+
- ext/include/iv/parser.h
|
93
|
+
- ext/include/iv/errors.h
|
94
|
+
- ext/include/iv/token.h
|
97
95
|
- ext/include/iv/enable_if.h
|
98
|
-
- ext/include/iv/
|
99
|
-
- ext/include/iv/
|
100
|
-
- ext/include/iv/
|
101
|
-
- ext/include/iv/lexer.h
|
96
|
+
- ext/include/iv/any.h
|
97
|
+
- ext/include/iv/keyword.h
|
98
|
+
- ext/include/iv/cmdline.h
|
102
99
|
- ext/include/iv/xorshift.h
|
103
|
-
- ext/include/iv/
|
100
|
+
- ext/include/iv/location.h
|
101
|
+
- ext/include/iv/ast_info.h
|
102
|
+
- ext/include/iv/none.h
|
104
103
|
- ext/include/iv/algorithm.h
|
105
|
-
- ext/include/iv/
|
106
|
-
- ext/include/iv/
|
107
|
-
- ext/include/iv/
|
108
|
-
- ext/include/iv/
|
109
|
-
- ext/include/iv/stringpiece.h
|
110
|
-
- ext/include/iv/uchar.h
|
111
|
-
- ext/include/iv/ast-factory.h
|
104
|
+
- ext/include/iv/ustring.h
|
105
|
+
- ext/include/iv/ast_serializer.h
|
106
|
+
- ext/include/iv/utils.h
|
107
|
+
- ext/include/iv/ast_visitor.h
|
112
108
|
- ext/include/iv/alloc.h
|
113
|
-
- ext/include/iv/
|
114
|
-
- ext/include/iv/
|
115
|
-
- ext/include/iv/
|
116
|
-
- ext/include/iv/
|
117
|
-
- ext/iv/phonic/
|
109
|
+
- ext/include/iv/chars.h
|
110
|
+
- ext/include/iv/fixedcontainer.h
|
111
|
+
- ext/include/iv/ustringpiece.h
|
112
|
+
- ext/include/iv/ucdata.h
|
113
|
+
- ext/iv/phonic/factory.h
|
114
|
+
- ext/iv/phonic/ast_fwd.h
|
115
|
+
- ext/iv/phonic/parser.h
|
116
|
+
- ext/iv/phonic/encoding.h
|
118
117
|
- ext/iv/phonic/source.h
|
119
|
-
- ext/iv/phonic/creator.h
|
120
118
|
- ext/iv/phonic/phonic.cc
|
119
|
+
- ext/iv/phonic/creator.h
|
121
120
|
- ext/iv/phonic/extconf.rb
|
122
|
-
- ext/iv/phonic/encoding.h
|
123
|
-
- ext/iv/phonic/parser.h
|
124
|
-
- ext/iv/phonic/factory.h
|
125
121
|
has_rdoc: true
|
126
122
|
homepage: https://github.com/Constellation/iv/tree/master/src/phonic/
|
127
123
|
licenses: []
|
@@ -137,7 +133,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
137
133
|
requirements:
|
138
134
|
- - ">="
|
139
135
|
- !ruby/object:Gem::Version
|
140
|
-
hash: 49
|
141
136
|
segments:
|
142
137
|
- 1
|
143
138
|
- 9
|
@@ -148,7 +143,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
143
|
requirements:
|
149
144
|
- - ">="
|
150
145
|
- !ruby/object:Gem::Version
|
151
|
-
hash: 3
|
152
146
|
segments:
|
153
147
|
- 0
|
154
148
|
version: "0"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|