ruby_protobuf 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -2
- data/VERSION +1 -1
- data/lib/protobuf/common/wire_type.rb +2 -0
- data/lib/protobuf/compiler/nodes.rb +6 -0
- data/lib/protobuf/compiler/proto.y +5 -2
- data/lib/protobuf/compiler/proto_parser.rb +385 -366
- data/lib/protobuf/message/decoder.rb +31 -16
- data/lib/protobuf/message/encoder.rb +1 -0
- data/lib/protobuf/message/field.rb +12 -37
- data/lib/protobuf/message/message.rb +37 -97
- data/test/proto/merge.pb.rb +6 -6
- data/test/proto/merge.proto +3 -3
- data/test/test_enum_value.rb +3 -2
- data/test/test_extension.rb +1 -1
- data/test/test_message.rb +30 -24
- data/test/test_packed_field.rb +5 -0
- metadata +24 -29
- data/test/proto/address_book_service.rb +0 -31
- data/test/proto/client_add.rb +0 -18
- data/test/proto/client_search.rb +0 -18
- data/test/proto/float_default.pb.rb +0 -28
- data/test/proto/rpc.pb.rb +0 -16
data/History.txt
CHANGED
@@ -1,7 +1,14 @@
|
|
1
|
-
=== 0.4.
|
1
|
+
=== 0.4.6 / 2010-09-12
|
2
2
|
|
3
|
+
* 0.4.6
|
4
|
+
* Implement Message#to_hash method.
|
5
|
+
* Accept String value for enum fields.
|
6
|
+
* Optimizations.
|
7
|
+
* Bug fixes.
|
8
|
+
* Ignore "syntax = ...." in .proto.
|
9
|
+
* Empty packed field.
|
3
10
|
* 0.4.5
|
4
|
-
* Bug
|
11
|
+
* Bug fixes. (enum value, frozen string)
|
5
12
|
* 0.4.4
|
6
13
|
* Bug fix. (rprotoc)
|
7
14
|
* 0.4.3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.6
|
@@ -12,6 +12,7 @@ rule
|
|
12
12
|
| package
|
13
13
|
| option
|
14
14
|
| service
|
15
|
+
| syntax
|
15
16
|
| ';' { result = nil }
|
16
17
|
|
17
18
|
import : 'import' STRING_LITERAL ';'
|
@@ -73,6 +74,8 @@ rule
|
|
73
74
|
| rpc
|
74
75
|
| ';' { result = nil}
|
75
76
|
|
77
|
+
syntax : 'syntax' '=' STRING_LITERAL ';' { result = Protobuf::Node::SyntaxNode.new(val[2]) }
|
78
|
+
|
76
79
|
rpc : 'rpc' IDENT '(' rpc_arg ')' 'returns' '(' rpc_arg ')' ';'
|
77
80
|
{ result = Protobuf::Node::RpcNode.new(val[1], val[3], val[7]) }
|
78
81
|
|
@@ -104,7 +107,7 @@ rule
|
|
104
107
|
| label type field_name '=' integer_literal '[' field_option_list ']' ';'
|
105
108
|
{ result = Protobuf::Node::FieldNode.new(val[0], val[1], val[2], val[4], val[6]) }
|
106
109
|
|
107
|
-
field_name : IDENT | "required" | "optional" | "repeated" | "import" | "package" | "option" | "message" | "extend" | "enum" | "service" | "rpc" | "returns" | "group" | "default" | "extensions" | "to" | "max" | "double" | "float" | "int32" | "int64" | "uint32" | "uint64" | "sint32" | "sint64" | "fixed32" | "fixed64" | "sfixed32" | "sfixed64" | "bool" | "string" | "bytes"
|
110
|
+
field_name : IDENT | "required" | "optional" | "repeated" | "import" | "package" | "option" | "message" | "extend" | "enum" | "service" | "syntax" | "rpc" | "returns" | "group" | "default" | "extensions" | "to" | "max" | "double" | "float" | "int32" | "int64" | "uint32" | "uint64" | "sint32" | "sint64" | "fixed32" | "fixed64" | "sfixed32" | "sfixed64" | "bool" | "string" | "bytes"
|
108
111
|
|
109
112
|
field_option_list : field_option
|
110
113
|
{ result = val }
|
@@ -178,7 +181,7 @@ end
|
|
178
181
|
when match(/\/\*/)
|
179
182
|
# C-like comment
|
180
183
|
raise 'EOF inside block comment' until @scanner.scan_until(/\*\//)
|
181
|
-
when match(/(?:required|optional|repeated|import|package|option|message|extend|enum|service|rpc|returns|group|default|extensions|to|max|double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/)
|
184
|
+
when match(/(?:required|optional|repeated|import|package|option|message|extend|enum|service|syntax|rpc|returns|group|default|extensions|to|max|double|float|int32|int64|uint32|uint64|sint32|sint64|fixed32|fixed64|sfixed32|sfixed64|bool|string|bytes)\b/)
|
182
185
|
yield [@token, @token.to_sym]
|
183
186
|
when match(/[+-]?\d*\.\d+([Ee][\+-]?\d+)?/)
|
184
187
|
yield [:FLOAT_LITERAL, @token.to_f]
|