zeroc-ice 3.8.1 → 3.8.3
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 +4 -4
- data/dist/IceRuby/Communicator.cpp +26 -9
- data/dist/IceRuby/Config.h +0 -12
- data/dist/IceRuby/Connection.cpp +18 -9
- data/dist/IceRuby/DefaultSliceLoader.h +1 -1
- data/dist/IceRuby/Endpoint.cpp +21 -8
- data/dist/IceRuby/Operation.cpp +29 -11
- data/dist/IceRuby/Properties.cpp +3 -4
- data/dist/IceRuby/Proxy.cpp +11 -19
- data/dist/IceRuby/RubySliceLoader.cpp +1 -1
- data/dist/IceRuby/RubySliceLoader.h +6 -0
- data/dist/IceRuby/Types.cpp +162 -138
- data/dist/IceRuby/Types.h +68 -28
- data/dist/IceRuby/Util.cpp +14 -78
- data/dist/IceRuby/Util.h +7 -17
- data/dist/ice/cpp/include/Ice/Communicator.h +31 -8
- data/dist/ice/cpp/include/Ice/Config.h +2 -2
- data/dist/ice/cpp/include/Ice/Connection.h +24 -8
- data/dist/ice/cpp/include/Ice/CtrlCHandler.h +1 -1
- data/dist/ice/cpp/include/Ice/Demangle.h +1 -1
- data/dist/ice/cpp/include/Ice/Endpoint.h +4 -4
- data/dist/ice/cpp/include/Ice/Initialize.h +4 -4
- data/dist/ice/cpp/include/Ice/InputStream.h +5 -5
- data/dist/ice/cpp/include/Ice/Instrumentation.h +13 -7
- data/dist/ice/cpp/include/Ice/LocalExceptions.h +26 -5
- data/dist/ice/cpp/include/Ice/Logger.h +7 -0
- data/dist/ice/cpp/include/Ice/LoggerUtil.h +1 -1
- data/dist/ice/cpp/include/Ice/Object.h +10 -8
- data/dist/ice/cpp/include/Ice/ObjectAdapter.h +1 -1
- data/dist/ice/cpp/include/Ice/OutgoingAsync.h +5 -2
- data/dist/ice/cpp/include/Ice/OutgoingResponse.h +2 -1
- data/dist/ice/cpp/include/Ice/OutputStream.h +14 -11
- data/dist/ice/cpp/include/Ice/PluginFactory.h +1 -1
- data/dist/ice/cpp/include/Ice/Properties.h +3 -3
- data/dist/ice/cpp/include/Ice/Proxy.h +192 -50
- data/dist/ice/cpp/include/Ice/SSL/ClientAuthenticationOptions.h +3 -3
- data/dist/ice/cpp/include/Ice/SSL/EndpointInfo.h +1 -1
- data/dist/ice/cpp/include/Ice/SSL/ServerAuthenticationOptions.h +5 -5
- data/dist/ice/cpp/include/Ice/ServantLocator.h +1 -1
- data/dist/ice/cpp/include/Ice/Service.h +2 -5
- data/dist/ice/cpp/include/Ice/SliceLoader.h +1 -1
- data/dist/ice/cpp/include/Ice/SlicedData.h +5 -3
- data/dist/ice/cpp/include/Ice/StreamHelpers.h +1 -1
- data/dist/ice/cpp/include/Ice/StreamableTraits.h +2 -2
- data/dist/ice/cpp/include/Ice/StringConverter.h +2 -3
- data/dist/ice/cpp/include/Ice/StringUtil.h +2 -7
- data/dist/ice/cpp/include/Ice/UUID.h +1 -0
- data/dist/ice/cpp/include/Ice/Value.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/BuiltinSequences.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Context.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/EndpointTypes.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Identity.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Locator.h +57 -23
- data/dist/ice/cpp/include/generated/Ice/LocatorRegistry.h +38 -11
- data/dist/ice/cpp/include/generated/Ice/Metrics.h +99 -44
- data/dist/ice/cpp/include/generated/Ice/OperationMode.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Process.h +34 -8
- data/dist/ice/cpp/include/generated/Ice/PropertiesAdmin.h +42 -11
- data/dist/ice/cpp/include/generated/Ice/PropertyDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/RemoteLogger.h +93 -40
- data/dist/ice/cpp/include/generated/Ice/ReplyStatus.h +8 -4
- data/dist/ice/cpp/include/generated/Ice/Router.h +55 -19
- data/dist/ice/cpp/include/generated/Ice/SliceChecksumDict.h +2 -2
- data/dist/ice/cpp/include/generated/Ice/Version.h +2 -2
- data/dist/ice/cpp/include/generated/IceDiscovery/Lookup.h +66 -14
- data/dist/ice/cpp/include/generated/IceLocatorDiscovery/Lookup.h +34 -8
- data/dist/ice/cpp/src/Ice/AddDefaultPluginFactories_all.cpp +1 -1
- data/dist/ice/cpp/src/Ice/Base64.cpp +47 -137
- data/dist/ice/cpp/src/Ice/Base64.h +2 -2
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.cpp +28 -13
- data/dist/ice/cpp/src/Ice/BatchRequestQueue.h +5 -1
- data/dist/ice/cpp/src/Ice/Buffer.cpp +1 -1
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.cpp +6 -4
- data/dist/ice/cpp/src/Ice/CollocatedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/Communicator.cpp +4 -3
- data/dist/ice/cpp/src/Ice/CommunicatorFlushBatchAsync.cpp +8 -0
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.cpp +5 -15
- data/dist/ice/cpp/src/Ice/ConnectRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/ConnectionFactory.cpp +6 -8
- data/dist/ice/cpp/src/Ice/ConnectionFactory.h +0 -3
- data/dist/ice/cpp/src/Ice/ConnectionI.cpp +121 -108
- data/dist/ice/cpp/src/Ice/ConnectionI.h +12 -9
- data/dist/ice/cpp/src/Ice/ConsoleUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/DefaultsAndOverrides.cpp +10 -14
- data/dist/ice/cpp/src/Ice/EndpointI.h +1 -1
- data/dist/ice/cpp/src/Ice/FileUtil.cpp +15 -79
- data/dist/ice/cpp/src/Ice/FileUtil.h +0 -3
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.cpp +1 -1
- data/dist/ice/cpp/src/Ice/FixedRequestHandler.h +1 -1
- data/dist/ice/cpp/src/Ice/HttpParser.h +0 -2
- data/dist/ice/cpp/src/Ice/IPEndpointI.cpp +4 -0
- data/dist/ice/cpp/src/Ice/IdleTimeoutTransceiverDecorator.cpp +6 -3
- data/dist/ice/cpp/src/Ice/IncomingRequest.cpp +2 -4
- data/dist/ice/cpp/src/Ice/InputStream.cpp +50 -33
- data/dist/ice/cpp/src/Ice/Instance.cpp +73 -50
- data/dist/ice/cpp/src/Ice/Instance.h +1 -6
- data/dist/ice/cpp/src/Ice/LocalExceptions.cpp +7 -1
- data/dist/ice/cpp/src/Ice/LocatorInfo.cpp +2 -2
- data/dist/ice/cpp/src/Ice/LoggerAdminI.cpp +13 -18
- data/dist/ice/cpp/src/Ice/LoggerI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/LoggerI.h +2 -2
- data/dist/ice/cpp/src/Ice/MetricsAdminI.h +6 -1
- data/dist/ice/cpp/src/Ice/MetricsObserverI.h +22 -18
- data/dist/ice/cpp/src/Ice/NativePropertiesAdmin.cpp +5 -2
- data/dist/ice/cpp/src/Ice/Network.cpp +168 -103
- data/dist/ice/cpp/src/Ice/Network.h +12 -7
- data/dist/ice/cpp/src/Ice/NetworkProxy.cpp +17 -6
- data/dist/ice/cpp/src/Ice/NetworkProxy.h +2 -1
- data/dist/ice/cpp/src/Ice/Object.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ObjectAdapterI.cpp +56 -19
- data/dist/ice/cpp/src/Ice/OpaqueEndpointI.cpp +10 -10
- data/dist/ice/cpp/src/Ice/Options.cpp +7 -2
- data/dist/ice/cpp/src/Ice/OutgoingAsync.cpp +2 -2
- data/dist/ice/cpp/src/Ice/OutgoingResponse.cpp +127 -127
- data/dist/ice/cpp/src/Ice/OutgoingResponseInternal.h +21 -0
- data/dist/ice/cpp/src/Ice/OutputStream.cpp +50 -65
- data/dist/ice/cpp/src/Ice/PluginManagerI.cpp +7 -1
- data/dist/ice/cpp/src/Ice/Properties.cpp +26 -16
- data/dist/ice/cpp/src/Ice/PropertyNames.cpp +2 -1
- data/dist/ice/cpp/src/Ice/PropertyUtil.cpp +1 -1
- data/dist/ice/cpp/src/Ice/ProtocolInstance.cpp +0 -11
- data/dist/ice/cpp/src/Ice/ProtocolInstance.h +1 -2
- data/dist/ice/cpp/src/Ice/Proxy.cpp +9 -1
- data/dist/ice/cpp/src/Ice/ProxyAsync.cpp +110 -13
- data/dist/ice/cpp/src/Ice/ProxyFunctions.cpp +4 -4
- data/dist/ice/cpp/src/Ice/Random.cpp +68 -7
- data/dist/ice/cpp/src/Ice/Random.h +6 -2
- data/dist/ice/cpp/src/Ice/Reference.cpp +37 -26
- data/dist/ice/cpp/src/Ice/Reference.h +3 -0
- data/dist/ice/cpp/src/Ice/ReferenceFactory.cpp +26 -13
- data/dist/ice/cpp/src/Ice/RequestHandler.h +3 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.cpp +1 -1
- data/dist/ice/cpp/src/Ice/RequestHandlerCache.h +1 -1
- data/dist/ice/cpp/src/Ice/ResourceConfig.h +3 -3
- data/dist/ice/cpp/src/Ice/RetryQueue.cpp +8 -12
- data/dist/ice/cpp/src/Ice/SHA1.cpp +11 -11
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.cpp +0 -6
- data/dist/ice/cpp/src/Ice/SSL/DistinguishedName.h +0 -6
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.cpp +27 -12
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLEngine.h +1 -2
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.cpp +77 -27
- data/dist/ice/cpp/src/Ice/SSL/OpenSSLTransceiverI.h +2 -1
- data/dist/ice/cpp/src/Ice/SSL/RFC2253.cpp +2 -2
- data/dist/ice/cpp/src/Ice/SSL/SSLEndpointI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/SSL/SSLEngine.h +1 -4
- data/dist/ice/cpp/src/Ice/SSL/SSLUtil.cpp +39 -34
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.cpp +165 -80
- data/dist/ice/cpp/src/Ice/SSL/SchannelEngine.h +1 -5
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.cpp +73 -33
- data/dist/ice/cpp/src/Ice/SSL/SchannelTransceiverI.h +0 -1
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.cpp +110 -17
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportEngine.h +7 -2
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportTransceiverI.cpp +9 -3
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.cpp +73 -51
- data/dist/ice/cpp/src/Ice/SSL/SecureTransportUtil.h +0 -8
- data/dist/ice/cpp/src/Ice/Selector.cpp +13 -11
- data/dist/ice/cpp/src/Ice/ServantManager.cpp +3 -3
- data/dist/ice/cpp/src/Ice/Service.cpp +33 -115
- data/dist/ice/cpp/src/Ice/StreamSocket.cpp +33 -40
- data/dist/ice/cpp/src/Ice/StreamSocket.h +4 -4
- data/dist/ice/cpp/src/Ice/StringConverter.cpp +1 -1
- data/dist/ice/cpp/src/Ice/StringUtil.cpp +12 -21
- data/dist/ice/cpp/src/Ice/SysLoggerI.cpp +136 -100
- data/dist/ice/cpp/src/Ice/SysLoggerI.h +7 -3
- data/dist/ice/cpp/src/Ice/SystemdJournalI.cpp +1 -1
- data/dist/ice/cpp/src/Ice/TcpAcceptor.cpp +7 -7
- data/dist/ice/cpp/src/Ice/TcpAcceptor.h +2 -1
- data/dist/ice/cpp/src/Ice/TcpBufSize.h +40 -0
- data/dist/ice/cpp/src/Ice/TcpConnector.cpp +5 -2
- data/dist/ice/cpp/src/Ice/TcpConnector.h +2 -0
- data/dist/ice/cpp/src/Ice/TcpEndpointI.cpp +2 -2
- data/dist/ice/cpp/src/Ice/TcpTransceiver.cpp +6 -2
- data/dist/ice/cpp/src/Ice/ThreadPool.cpp +2 -8
- data/dist/ice/cpp/src/Ice/ThreadPool.h +0 -2
- data/dist/ice/cpp/src/Ice/Timer.cpp +7 -3
- data/dist/ice/cpp/src/Ice/UUID.cpp +1 -2
- data/dist/ice/cpp/src/Ice/UdpEndpointI.cpp +6 -3
- data/dist/ice/cpp/src/Ice/UdpTransceiver.cpp +136 -123
- data/dist/ice/cpp/src/Ice/UdpTransceiver.h +3 -4
- data/dist/ice/cpp/src/Ice/WSAcceptor.cpp +8 -3
- data/dist/ice/cpp/src/Ice/WSAcceptor.h +5 -1
- data/dist/ice/cpp/src/Ice/WSEndpoint.cpp +45 -2
- data/dist/ice/cpp/src/Ice/WSTransceiver.cpp +214 -34
- data/dist/ice/cpp/src/Ice/WSTransceiver.h +13 -2
- data/dist/ice/cpp/src/Ice/generated/BuiltinSequences.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Context.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/EndpointTypes.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Identity.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Locator.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/LocatorRegistry.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Metrics.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/OperationMode.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Process.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertiesAdmin.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/PropertyDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/RemoteLogger.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/ReplyStatus.cpp +4 -2
- data/dist/ice/cpp/src/Ice/generated/Router.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/SliceChecksumDict.cpp +2 -2
- data/dist/ice/cpp/src/Ice/generated/Version.cpp +2 -2
- data/dist/ice/cpp/src/IceDiscovery/LookupI.cpp +47 -9
- data/dist/ice/cpp/src/IceDiscovery/LookupI.h +8 -3
- data/dist/ice/cpp/src/IceDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/IceLocatorDiscovery/PluginI.cpp +43 -14
- data/dist/ice/cpp/src/IceLocatorDiscovery/generated/Lookup.cpp +2 -2
- data/dist/ice/cpp/src/Slice/DocCommentParser.cpp +32 -26
- data/dist/ice/cpp/src/Slice/DocCommentParser.h +6 -4
- data/dist/ice/cpp/src/Slice/FileTracker.cpp +3 -11
- data/dist/ice/cpp/src/Slice/FileTracker.h +0 -2
- data/dist/ice/cpp/src/Slice/Grammar.cpp +211 -210
- data/dist/ice/cpp/src/Slice/MetadataValidation.cpp +34 -14
- data/dist/ice/cpp/src/Slice/MetadataValidation.h +3 -2
- data/dist/ice/cpp/src/Slice/Parser.cpp +145 -97
- data/dist/ice/cpp/src/Slice/Parser.h +22 -8
- data/dist/ice/cpp/src/Slice/Preprocessor.cpp +77 -29
- data/dist/ice/cpp/src/Slice/Preprocessor.h +0 -3
- data/dist/ice/cpp/src/Slice/Scanner.cpp +3 -3
- data/dist/ice/cpp/src/Slice/SliceUtil.cpp +203 -172
- data/dist/ice/cpp/src/Slice/StringLiteralUtil.cpp +0 -2
- data/dist/ice/cpp/src/Slice/Util.h +21 -12
- data/dist/ice/cpp/src/slice2rb/Ruby.cpp +7 -3
- data/dist/ice/cpp/src/slice2rb/RubyUtil.cpp +26 -20
- data/dist/ice/cpp/src/slice2rb/RubyUtil.h +10 -13
- data/dist/ice/slice/Glacier2/Router.ice +3 -3
- data/dist/ice/slice/Ice/Identity.ice +3 -0
- data/dist/ice/slice/Ice/Locator.ice +6 -5
- data/dist/ice/slice/Ice/LocatorRegistry.ice +3 -0
- data/dist/ice/slice/Ice/Metrics.ice +7 -6
- data/dist/ice/slice/Ice/OperationMode.ice +8 -0
- data/dist/ice/slice/Ice/Process.ice +3 -0
- data/dist/ice/slice/Ice/RemoteLogger.ice +5 -5
- data/dist/ice/slice/Ice/ReplyStatus.ice +13 -0
- data/dist/ice/slice/IceGrid/Admin.ice +9 -9
- data/dist/ice/slice/IceGrid/Descriptor.ice +5 -5
- data/dist/ice/slice/IceStorm/Metrics.ice +1 -1
- data/dist/lib/Glacier2/Metrics.rb +1 -1
- data/dist/lib/Glacier2/PermissionsVerifier.rb +3 -3
- data/dist/lib/Glacier2/Router.rb +9 -9
- data/dist/lib/Glacier2/SSLInfo.rb +1 -1
- data/dist/lib/Glacier2/Session.rb +15 -15
- data/dist/lib/Ice/BuiltinSequences.rb +1 -1
- data/dist/lib/Ice/CompressBatch.rb +1 -2
- data/dist/lib/Ice/Context.rb +1 -1
- data/dist/lib/Ice/EndpointSelectionType.rb +1 -2
- data/dist/lib/Ice/EndpointTypes.rb +1 -1
- data/dist/lib/Ice/Identity.rb +1 -1
- data/dist/lib/Ice/IdentitySpaceship.rb +1 -0
- data/dist/lib/Ice/LocalExceptions.rb +3 -0
- data/dist/lib/Ice/Locator.rb +5 -5
- data/dist/lib/Ice/LocatorRegistry.rb +4 -4
- data/dist/lib/Ice/Metrics.rb +7 -7
- data/dist/lib/Ice/OperationMode.rb +2 -3
- data/dist/lib/Ice/Process.rb +3 -3
- data/dist/lib/Ice/PropertiesAdmin.rb +4 -4
- data/dist/lib/Ice/PropertyDict.rb +1 -1
- data/dist/lib/Ice/ProxyFunctions.rb +8 -4
- data/dist/lib/Ice/RemoteLogger.rb +7 -8
- data/dist/lib/Ice/ReplyStatus.rb +4 -4
- data/dist/lib/Ice/Router.rb +5 -5
- data/dist/lib/Ice/SliceChecksumDict.rb +1 -1
- data/dist/lib/Ice/SliceUtil.rb +2 -2
- data/dist/lib/Ice/Struct.rb +1 -0
- data/dist/lib/Ice/ToStringMode.rb +1 -2
- data/dist/lib/Ice/Value.rb +2 -2
- data/dist/lib/Ice/Version.rb +1 -1
- data/dist/lib/IceBox/ServiceManager.rb +8 -8
- data/dist/lib/IceGrid/Admin.rb +85 -86
- data/dist/lib/IceGrid/Descriptor.rb +1 -1
- data/dist/lib/IceGrid/Exception.rb +1 -1
- data/dist/lib/IceGrid/FileParser.rb +2 -2
- data/dist/lib/IceGrid/Registry.rb +14 -15
- data/dist/lib/IceGrid/Session.rb +7 -7
- data/dist/lib/IceGrid/UserAccountMapper.rb +2 -2
- data/dist/lib/IceStorm/IceStorm.rb +16 -16
- data/dist/lib/IceStorm/Metrics.rb +1 -1
- data/extconf.rb +1 -1
- data/ice.gemspec +3 -3
- metadata +5 -5
- data/dist/ice/cpp/src/Ice/DLLMain.cpp +0 -40
- data/dist/ice/cpp/src/Ice/UndefSysMacros.h +0 -37
|
@@ -67,7 +67,7 @@ Slice::misappliedMetadataMessage(const MetadataPtr& metadata, const SyntaxTreeBa
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
void
|
|
70
|
-
Slice::validateMetadata(const UnitPtr&
|
|
70
|
+
Slice::validateMetadata(const UnitPtr& unit, string_view prefix, map<string, MetadataInfo> knownMetadata)
|
|
71
71
|
{
|
|
72
72
|
// We want to perform all the metadata validation in the same pass, to keep all the diagnostics in order.
|
|
73
73
|
// So, we add all the language-agnostic metadata validation into the provided list.
|
|
@@ -108,7 +108,7 @@ Slice::validateMetadata(const UnitPtr& p, string_view prefix, map<string, Metada
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
return nullopt;
|
|
111
|
-
}
|
|
111
|
+
};
|
|
112
112
|
knownMetadata.emplace("deprecate", std::move(deprecatedInfo));
|
|
113
113
|
|
|
114
114
|
// "format"
|
|
@@ -126,6 +126,25 @@ Slice::validateMetadata(const UnitPtr& p, string_view prefix, map<string, Metada
|
|
|
126
126
|
};
|
|
127
127
|
knownMetadata.emplace("marshaled-result", std::move(marshaledResultInfo));
|
|
128
128
|
|
|
129
|
+
// "oneway"
|
|
130
|
+
MetadataInfo onewayInfo = {
|
|
131
|
+
.validOn = {typeid(Operation)},
|
|
132
|
+
.acceptedArgumentKind = MetadataArgumentKind::NoArguments,
|
|
133
|
+
.extraValidation = [](const MetadataPtr&, const SyntaxTreeBasePtr& q) -> optional<string>
|
|
134
|
+
{
|
|
135
|
+
if (auto op = dynamic_pointer_cast<Operation>(q))
|
|
136
|
+
{
|
|
137
|
+
if (op->returnsData())
|
|
138
|
+
{
|
|
139
|
+
return "'oneway' metadata cannot be applied to an operation that has a return type, out parameters,"
|
|
140
|
+
" or an exception specification";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return nullopt;
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
knownMetadata.emplace("oneway", std::move(onewayInfo));
|
|
147
|
+
|
|
129
148
|
// "suppress-warning"
|
|
130
149
|
MetadataInfo suppressWarningInfo = {
|
|
131
150
|
.validOn = {typeid(Unit)},
|
|
@@ -137,7 +156,7 @@ Slice::validateMetadata(const UnitPtr& p, string_view prefix, map<string, Metada
|
|
|
137
156
|
|
|
138
157
|
// Then we pass this list off the internal visitor, which performs the heavy lifting.
|
|
139
158
|
auto visitor = MetadataVisitor(prefix, std::move(knownMetadata));
|
|
140
|
-
|
|
159
|
+
unit->visit(&visitor);
|
|
141
160
|
}
|
|
142
161
|
|
|
143
162
|
MetadataVisitor::MetadataVisitor(string_view language, map<string, MetadataInfo> knownMetadata)
|
|
@@ -148,11 +167,11 @@ MetadataVisitor::MetadataVisitor(string_view language, map<string, MetadataInfo>
|
|
|
148
167
|
}
|
|
149
168
|
|
|
150
169
|
bool
|
|
151
|
-
MetadataVisitor::visitUnitStart(const UnitPtr&
|
|
170
|
+
MetadataVisitor::visitUnitStart(const UnitPtr& unit)
|
|
152
171
|
{
|
|
153
|
-
DefinitionContextPtr dc =
|
|
172
|
+
DefinitionContextPtr dc = unit->findDefinitionContext(unit->topLevelFile());
|
|
154
173
|
assert(dc);
|
|
155
|
-
dc->setMetadata(validate(dc->getMetadata(),
|
|
174
|
+
dc->setMetadata(validate(dc->getMetadata(), unit));
|
|
156
175
|
return true;
|
|
157
176
|
}
|
|
158
177
|
|
|
@@ -264,18 +283,18 @@ MetadataVisitor::validate(MetadataList metadata, const SyntaxTreeBasePtr& p, boo
|
|
|
264
283
|
for (auto i = metadata.begin(); i != metadata.end();)
|
|
265
284
|
{
|
|
266
285
|
const string& directive = (*i)->directive();
|
|
286
|
+
const auto colonIndex = directive.find(':');
|
|
267
287
|
|
|
268
|
-
//
|
|
269
|
-
|
|
270
|
-
if (directive.find(':') != string::npos && directive.find(_language) != 0)
|
|
288
|
+
// Only check the metadata if it starts with the provided '_language' prefix, or is language agnostic.
|
|
289
|
+
if ((directive.find(_language) == 0 && colonIndex == _language.size()) || colonIndex == string::npos)
|
|
271
290
|
{
|
|
272
|
-
|
|
291
|
+
// Check if the metadata is valid. If it's not, remove it to shield downstream logic from invalid inputs.
|
|
292
|
+
bool isValid = isMetadataValid(*i, p, isTypeContext);
|
|
293
|
+
i = isValid ? std::next(i, 1) : metadata.erase(i);
|
|
273
294
|
}
|
|
274
295
|
else
|
|
275
296
|
{
|
|
276
|
-
|
|
277
|
-
bool isValid = isMetadataValid(*i, p, isTypeContext);
|
|
278
|
-
i = isValid ? std::next(i, 1) : metadata.erase(i);
|
|
297
|
+
i = metadata.erase(i); // This metadata isn't relevant to the target language; remove it.
|
|
279
298
|
}
|
|
280
299
|
}
|
|
281
300
|
|
|
@@ -445,7 +464,8 @@ MetadataVisitor::isMetadataValid(const MetadataPtr& metadata, const SyntaxTreeBa
|
|
|
445
464
|
{
|
|
446
465
|
// We make a special exception to uniqueness for metadata on forward declarations, since there can be
|
|
447
466
|
// multiple forward declarations for the same entity, but they all share a single backing `MetadataList`.
|
|
448
|
-
// So for these types, even 'unique' metadata
|
|
467
|
+
// So for these types, we let even 'unique' metadata appear multiple times, but we require them to be
|
|
468
|
+
// identical.
|
|
449
469
|
if (dynamic_pointer_cast<ClassDecl>(p) || dynamic_pointer_cast<InterfaceDecl>(p))
|
|
450
470
|
{
|
|
451
471
|
const MetadataPtr& previousMetadata = _seenDirectives[directive];
|
|
@@ -95,12 +95,13 @@ namespace Slice
|
|
|
95
95
|
std::string misappliedMetadataMessage(const MetadataPtr& metadata, const SyntaxTreeBasePtr& p);
|
|
96
96
|
|
|
97
97
|
/// Validates all the metadata in the provided Unit against a map of known metadata.
|
|
98
|
-
/// @param
|
|
98
|
+
/// @param unit The unit whose metadata should be validated.
|
|
99
99
|
/// @param prefix Which language's metadata should be validated. Any metadata that starts with a different
|
|
100
100
|
/// language prefix than this one will be ignored. Note that metadata without any language prefix
|
|
101
101
|
/// (i.e. parser metadata) is always checked.
|
|
102
102
|
/// @param knownMetadata A map containing the directives that should be validated, and information describing
|
|
103
103
|
/// the various constraints and conditions that should be upheld for it and its arguments.
|
|
104
|
-
void
|
|
104
|
+
void
|
|
105
|
+
validateMetadata(const UnitPtr& unit, std::string_view prefix, std::map<std::string, MetadataInfo> knownMetadata);
|
|
105
106
|
}
|
|
106
107
|
#endif
|
|
@@ -48,7 +48,7 @@ namespace
|
|
|
48
48
|
DataMemberList filterOrderedOptionalDataMembers(const DataMemberList& members)
|
|
49
49
|
{
|
|
50
50
|
DataMemberList result;
|
|
51
|
-
copy_if(members.begin(), members.end(), back_inserter(result), [](const auto& p) { return p->
|
|
51
|
+
copy_if(members.begin(), members.end(), back_inserter(result), [](const auto& p) { return p->isOptional(); });
|
|
52
52
|
result.sort(compareTag<DataMemberPtr>);
|
|
53
53
|
return result;
|
|
54
54
|
}
|
|
@@ -79,10 +79,10 @@ namespace
|
|
|
79
79
|
/// Reports any naming conflicts between @p name and @p definitions.
|
|
80
80
|
/// This should only be called for Slice elements that are _not_ defined at module scope.
|
|
81
81
|
/// For example, this is fine to use for operations, enumerators, data members, and parameters.
|
|
82
|
-
/// For elements that are defined
|
|
82
|
+
/// For elements that are defined directly within modules, `findContents` must be used instead.
|
|
83
83
|
/// @param name The name to check for conflicts.
|
|
84
84
|
/// @param kind The kind of element that we're checking (only used for error messages).
|
|
85
|
-
/// @param definitions A list of definitions check @p name against.
|
|
85
|
+
/// @param definitions A list of definitions to check @p name against.
|
|
86
86
|
/// @return @c false if there are no name conflicts, @c true otherwise.
|
|
87
87
|
bool doesNameConflict(string_view name, string_view kind, const ContainedList& definitions)
|
|
88
88
|
{
|
|
@@ -111,6 +111,58 @@ namespace
|
|
|
111
111
|
}
|
|
112
112
|
return true;
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
/// Checks an identifier for illegal syntax and reports any errors that are present.
|
|
116
|
+
bool reportIllegalSuffixOrUnderscore(const string& identifier)
|
|
117
|
+
{
|
|
118
|
+
// check whether the identifier is scoped
|
|
119
|
+
size_t scopeIndex = identifier.rfind("::");
|
|
120
|
+
bool isScoped = scopeIndex != string::npos;
|
|
121
|
+
string name;
|
|
122
|
+
if (isScoped)
|
|
123
|
+
{
|
|
124
|
+
name = identifier.substr(scopeIndex + 2); // Only check the unscoped identifier for syntax
|
|
125
|
+
}
|
|
126
|
+
else
|
|
127
|
+
{
|
|
128
|
+
name = identifier;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
assert(!name.empty());
|
|
132
|
+
bool isValid = true;
|
|
133
|
+
|
|
134
|
+
// check the identifier for reserved suffixes
|
|
135
|
+
static const string suffixBlacklist[] = {"Helper", "Holder", "Prx", "Ptr"};
|
|
136
|
+
for (const auto& i : suffixBlacklist)
|
|
137
|
+
{
|
|
138
|
+
if (name.find(i, name.size() - i.size()) != string::npos)
|
|
139
|
+
{
|
|
140
|
+
currentUnit->error("illegal identifier '" + name + "': '" + i + "' suffix is reserved");
|
|
141
|
+
isValid = false;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// check the identifier for illegal underscores
|
|
147
|
+
size_t index = name.find('_');
|
|
148
|
+
if (index == 0)
|
|
149
|
+
{
|
|
150
|
+
currentUnit->error("illegal leading underscore in identifier '" + name + "'");
|
|
151
|
+
isValid = false;
|
|
152
|
+
}
|
|
153
|
+
else if (name.rfind('_') == (name.size() - 1))
|
|
154
|
+
{
|
|
155
|
+
currentUnit->error("illegal trailing underscore in identifier '" + name + "'");
|
|
156
|
+
isValid = false;
|
|
157
|
+
}
|
|
158
|
+
else if (name.find("__") != string::npos)
|
|
159
|
+
{
|
|
160
|
+
currentUnit->error("illegal double underscore in identifier '" + name + "'");
|
|
161
|
+
isValid = false;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return isValid;
|
|
165
|
+
}
|
|
114
166
|
}
|
|
115
167
|
|
|
116
168
|
namespace Slice
|
|
@@ -563,7 +615,7 @@ Slice::Builtin::kindAsString() const
|
|
|
563
615
|
return builtinTable[_kind];
|
|
564
616
|
}
|
|
565
617
|
|
|
566
|
-
optional<
|
|
618
|
+
optional<Builtin::Kind>
|
|
567
619
|
Slice::Builtin::kindFromString(string_view str)
|
|
568
620
|
{
|
|
569
621
|
// Object is an alias for Value that we don't put in the builtinTable.
|
|
@@ -749,7 +801,7 @@ Slice::Contained::getMetadataArgs(string_view directive) const
|
|
|
749
801
|
return nullopt;
|
|
750
802
|
}
|
|
751
803
|
|
|
752
|
-
|
|
804
|
+
optional<FormatType>
|
|
753
805
|
Slice::Contained::parseFormatMetadata() const
|
|
754
806
|
{
|
|
755
807
|
if (auto metadata = getMetadataArgs("format"))
|
|
@@ -813,8 +865,8 @@ Slice::Contained::Contained(const ContainerPtr& container, string name) : _conta
|
|
|
813
865
|
void
|
|
814
866
|
Slice::Container::destroyContents()
|
|
815
867
|
{
|
|
816
|
-
// Container has pointers to all
|
|
817
|
-
// But each Contained also keeps a pointer to
|
|
868
|
+
// Container has pointers to all its contents (since it logically owns them).
|
|
869
|
+
// But each Contained also keeps a pointer to its parent, creating a cycle.
|
|
818
870
|
// We need to break this cycle.
|
|
819
871
|
for (const auto& i : _contents)
|
|
820
872
|
{
|
|
@@ -947,7 +999,7 @@ Slice::Container::createClassDef(const string& name, int32_t id, const ClassDefP
|
|
|
947
999
|
def->_declaration = decl;
|
|
948
1000
|
decl->_definition = def;
|
|
949
1001
|
|
|
950
|
-
// Patch forward declarations which may
|
|
1002
|
+
// Patch forward declarations which may have been created in other openings of this class' module.
|
|
951
1003
|
for (const auto& q : matches)
|
|
952
1004
|
{
|
|
953
1005
|
dynamic_pointer_cast<ClassDecl>(q)->_definition = def;
|
|
@@ -1083,7 +1135,7 @@ Slice::Container::createInterfaceDef(const string& name, const InterfaceList& ba
|
|
|
1083
1135
|
def->_declaration = decl;
|
|
1084
1136
|
decl->_definition = def;
|
|
1085
1137
|
|
|
1086
|
-
// Patch forward declarations which may
|
|
1138
|
+
// Patch forward declarations which may have been created in other openings of this interface's module.
|
|
1087
1139
|
for (const auto& q : matches)
|
|
1088
1140
|
{
|
|
1089
1141
|
dynamic_pointer_cast<InterfaceDecl>(q)->_definition = def;
|
|
@@ -1595,9 +1647,9 @@ Slice::Container::lookupInterfaceDef(const string& identifier, bool emitErrors)
|
|
|
1595
1647
|
TypePtr resolvedType = lookupType(identifier);
|
|
1596
1648
|
if (resolvedType)
|
|
1597
1649
|
{
|
|
1598
|
-
if (auto
|
|
1650
|
+
if (auto interfaceDecl = dynamic_pointer_cast<InterfaceDecl>(resolvedType))
|
|
1599
1651
|
{
|
|
1600
|
-
if (InterfaceDefPtr def =
|
|
1652
|
+
if (InterfaceDefPtr def = interfaceDecl->definition())
|
|
1601
1653
|
{
|
|
1602
1654
|
return def;
|
|
1603
1655
|
}
|
|
@@ -2147,13 +2199,13 @@ Slice::Module::getTopLevelModule() const
|
|
|
2147
2199
|
return parent->getTopLevelModule();
|
|
2148
2200
|
}
|
|
2149
2201
|
// Reaching here means that this module is at the top-level! We return it.
|
|
2150
|
-
return
|
|
2202
|
+
return static_pointer_cast<Module>(const_pointer_cast<Container>(shared_from_this()));
|
|
2151
2203
|
}
|
|
2152
2204
|
|
|
2153
2205
|
void
|
|
2154
2206
|
Slice::Module::visit(ParserVisitor* visitor)
|
|
2155
2207
|
{
|
|
2156
|
-
auto self =
|
|
2208
|
+
auto self = static_pointer_cast<Module>(shared_from_this());
|
|
2157
2209
|
if (visitor->visitModuleStart(self))
|
|
2158
2210
|
{
|
|
2159
2211
|
visitContents(visitor);
|
|
@@ -2310,7 +2362,7 @@ Slice::ClassDef::createDataMember(
|
|
|
2310
2362
|
// Validate the tag.
|
|
2311
2363
|
for (const auto& q : dataMembers())
|
|
2312
2364
|
{
|
|
2313
|
-
if (q->
|
|
2365
|
+
if (q->isOptional() && tag == q->tag())
|
|
2314
2366
|
{
|
|
2315
2367
|
unit()->error("tag for optional data member '" + name + "' is already in use");
|
|
2316
2368
|
break;
|
|
@@ -2428,7 +2480,7 @@ Slice::ClassDef::kindOf() const
|
|
|
2428
2480
|
void
|
|
2429
2481
|
Slice::ClassDef::visit(ParserVisitor* visitor)
|
|
2430
2482
|
{
|
|
2431
|
-
auto self =
|
|
2483
|
+
auto self = static_pointer_cast<ClassDef>(shared_from_this());
|
|
2432
2484
|
if (visitor->visitClassDefStart(self))
|
|
2433
2485
|
{
|
|
2434
2486
|
visitContents(visitor);
|
|
@@ -2615,7 +2667,7 @@ Slice::InterfaceDecl::addPartition(
|
|
|
2615
2667
|
// list of lists, with each member list containing the operation
|
|
2616
2668
|
// names defined by the interfaces in each partition.
|
|
2617
2669
|
//
|
|
2618
|
-
|
|
2670
|
+
InterfaceDecl::StringPartitionList
|
|
2619
2671
|
Slice::InterfaceDecl::toStringPartitionList(const GraphPartitionList& partitions)
|
|
2620
2672
|
{
|
|
2621
2673
|
StringPartitionList spl;
|
|
@@ -2738,8 +2790,9 @@ Slice::InterfaceDef::createOperation(
|
|
|
2738
2790
|
break;
|
|
2739
2791
|
}
|
|
2740
2792
|
}
|
|
2741
|
-
|
|
2742
|
-
|
|
2793
|
+
|
|
2794
|
+
// Check the operations of the Object pseudo-interface unless we're generating code for Object itself.
|
|
2795
|
+
if (scoped() != "::Ice::Object" && !checkBaseOperationNames(name, {"ice_id", "ice_ids", "ice_ping", "ice_isA"}))
|
|
2743
2796
|
{
|
|
2744
2797
|
hasConflictingIdentifier = true;
|
|
2745
2798
|
}
|
|
@@ -2827,6 +2880,24 @@ Slice::InterfaceDef::operations() const
|
|
|
2827
2880
|
|
|
2828
2881
|
OperationList
|
|
2829
2882
|
Slice::InterfaceDef::allOperations() const
|
|
2883
|
+
{
|
|
2884
|
+
OperationList result = allInheritedOperations();
|
|
2885
|
+
|
|
2886
|
+
for (const auto& q : operations())
|
|
2887
|
+
{
|
|
2888
|
+
if (none_of(
|
|
2889
|
+
result.begin(),
|
|
2890
|
+
result.end(),
|
|
2891
|
+
[name = q->name()](const auto& other) { return other->name() == name; }))
|
|
2892
|
+
{
|
|
2893
|
+
result.push_back(q);
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
return result;
|
|
2897
|
+
}
|
|
2898
|
+
|
|
2899
|
+
OperationList
|
|
2900
|
+
Slice::InterfaceDef::allInheritedOperations() const
|
|
2830
2901
|
{
|
|
2831
2902
|
OperationList result;
|
|
2832
2903
|
for (const auto& p : _bases)
|
|
@@ -2842,17 +2913,6 @@ Slice::InterfaceDef::allOperations() const
|
|
|
2842
2913
|
}
|
|
2843
2914
|
}
|
|
2844
2915
|
}
|
|
2845
|
-
|
|
2846
|
-
for (const auto& q : operations())
|
|
2847
|
-
{
|
|
2848
|
-
if (none_of(
|
|
2849
|
-
result.begin(),
|
|
2850
|
-
result.end(),
|
|
2851
|
-
[name = q->name()](const auto& other) { return other->name() == name; }))
|
|
2852
|
-
{
|
|
2853
|
-
result.push_back(q);
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
2916
|
return result;
|
|
2857
2917
|
}
|
|
2858
2918
|
|
|
@@ -2865,7 +2925,7 @@ Slice::InterfaceDef::kindOf() const
|
|
|
2865
2925
|
void
|
|
2866
2926
|
Slice::InterfaceDef::visit(ParserVisitor* visitor)
|
|
2867
2927
|
{
|
|
2868
|
-
auto self =
|
|
2928
|
+
auto self = static_pointer_cast<InterfaceDef>(shared_from_this());
|
|
2869
2929
|
if (visitor->visitInterfaceDefStart(self))
|
|
2870
2930
|
{
|
|
2871
2931
|
visitContents(visitor);
|
|
@@ -2915,7 +2975,7 @@ Slice::InterfaceDef::InterfaceDef(const ContainerPtr& container, const string& n
|
|
|
2915
2975
|
// ----------------------------------------------------------------------
|
|
2916
2976
|
|
|
2917
2977
|
InterfaceDefPtr
|
|
2918
|
-
Slice::Operation::
|
|
2978
|
+
Slice::Operation::parentInterface() const
|
|
2919
2979
|
{
|
|
2920
2980
|
return dynamic_pointer_cast<InterfaceDef>(_container);
|
|
2921
2981
|
}
|
|
@@ -2947,7 +3007,7 @@ Slice::Operation::mode() const
|
|
|
2947
3007
|
bool
|
|
2948
3008
|
Slice::Operation::hasMarshaledResult() const
|
|
2949
3009
|
{
|
|
2950
|
-
InterfaceDefPtr intf =
|
|
3010
|
+
InterfaceDefPtr intf = parentInterface();
|
|
2951
3011
|
assert(intf);
|
|
2952
3012
|
if (intf->hasMetadata("marshaled-result") || hasMetadata("marshaled-result"))
|
|
2953
3013
|
{
|
|
@@ -2996,7 +3056,7 @@ Slice::Operation::createParameter(const string& name, const TypePtr& type, bool
|
|
|
2996
3056
|
{
|
|
2997
3057
|
for (const auto& param : parameters())
|
|
2998
3058
|
{
|
|
2999
|
-
if (param->
|
|
3059
|
+
if (param->isOptional() && param->tag() == tag)
|
|
3000
3060
|
{
|
|
3001
3061
|
unit()->error(msg);
|
|
3002
3062
|
break;
|
|
@@ -3028,12 +3088,11 @@ ParameterList
|
|
|
3028
3088
|
Slice::Operation::inParameters() const
|
|
3029
3089
|
{
|
|
3030
3090
|
ParameterList result;
|
|
3031
|
-
for (const auto& p :
|
|
3091
|
+
for (const auto& p : parameters())
|
|
3032
3092
|
{
|
|
3033
|
-
|
|
3034
|
-
if (q && !q->isOutParam())
|
|
3093
|
+
if (!p->isOutParam())
|
|
3035
3094
|
{
|
|
3036
|
-
result.push_back(
|
|
3095
|
+
result.push_back(p);
|
|
3037
3096
|
}
|
|
3038
3097
|
}
|
|
3039
3098
|
return result;
|
|
@@ -3046,7 +3105,7 @@ Slice::Operation::sortedInParameters() const
|
|
|
3046
3105
|
ParameterList required, optional;
|
|
3047
3106
|
for (const auto& param : inParameters())
|
|
3048
3107
|
{
|
|
3049
|
-
if (param->
|
|
3108
|
+
if (param->isOptional())
|
|
3050
3109
|
{
|
|
3051
3110
|
optional.push_back(param);
|
|
3052
3111
|
}
|
|
@@ -3068,12 +3127,11 @@ ParameterList
|
|
|
3068
3127
|
Slice::Operation::outParameters() const
|
|
3069
3128
|
{
|
|
3070
3129
|
ParameterList result;
|
|
3071
|
-
for (const auto& p :
|
|
3130
|
+
for (const auto& p : parameters())
|
|
3072
3131
|
{
|
|
3073
|
-
|
|
3074
|
-
if (q && q->isOutParam())
|
|
3132
|
+
if (p->isOutParam())
|
|
3075
3133
|
{
|
|
3076
|
-
result.push_back(
|
|
3134
|
+
result.push_back(p);
|
|
3077
3135
|
}
|
|
3078
3136
|
}
|
|
3079
3137
|
return result;
|
|
@@ -3122,7 +3180,7 @@ Slice::Operation::sortedReturnAndOutParameters(const string& returnName)
|
|
|
3122
3180
|
// First sort each parameter into either 'required' or 'optional'.
|
|
3123
3181
|
for (auto i = required.begin(); i != required.end();)
|
|
3124
3182
|
{
|
|
3125
|
-
if ((*i)->
|
|
3183
|
+
if ((*i)->isOptional())
|
|
3126
3184
|
{
|
|
3127
3185
|
optional.push_back(*i);
|
|
3128
3186
|
i = required.erase(i);
|
|
@@ -3193,9 +3251,9 @@ Slice::Operation::setExceptionList(const ExceptionList& exceptions)
|
|
|
3193
3251
|
bool
|
|
3194
3252
|
Slice::Operation::sendsClasses() const
|
|
3195
3253
|
{
|
|
3196
|
-
for (const auto& i :
|
|
3254
|
+
for (const auto& i : inParameters())
|
|
3197
3255
|
{
|
|
3198
|
-
if (
|
|
3256
|
+
if (i->type()->usesClasses())
|
|
3199
3257
|
{
|
|
3200
3258
|
return true;
|
|
3201
3259
|
}
|
|
@@ -3212,9 +3270,9 @@ Slice::Operation::returnsClasses() const
|
|
|
3212
3270
|
return true;
|
|
3213
3271
|
}
|
|
3214
3272
|
|
|
3215
|
-
for (const auto& i :
|
|
3273
|
+
for (const auto& i : outParameters())
|
|
3216
3274
|
{
|
|
3217
|
-
if (i->
|
|
3275
|
+
if (i->type()->usesClasses())
|
|
3218
3276
|
{
|
|
3219
3277
|
return true;
|
|
3220
3278
|
}
|
|
@@ -3225,25 +3283,7 @@ Slice::Operation::returnsClasses() const
|
|
|
3225
3283
|
bool
|
|
3226
3284
|
Slice::Operation::returnsData() const
|
|
3227
3285
|
{
|
|
3228
|
-
|
|
3229
|
-
if (t)
|
|
3230
|
-
{
|
|
3231
|
-
return true;
|
|
3232
|
-
}
|
|
3233
|
-
|
|
3234
|
-
for (const auto& i : parameters())
|
|
3235
|
-
{
|
|
3236
|
-
if (i->isOutParam())
|
|
3237
|
-
{
|
|
3238
|
-
return true;
|
|
3239
|
-
}
|
|
3240
|
-
}
|
|
3241
|
-
|
|
3242
|
-
if (!throws().empty())
|
|
3243
|
-
{
|
|
3244
|
-
return true;
|
|
3245
|
-
}
|
|
3246
|
-
return false;
|
|
3286
|
+
return returnsAnyValues() || !throws().empty();
|
|
3247
3287
|
}
|
|
3248
3288
|
|
|
3249
3289
|
bool
|
|
@@ -3270,7 +3310,7 @@ Slice::Operation::sendsOptionals() const
|
|
|
3270
3310
|
{
|
|
3271
3311
|
for (const auto& i : inParameters())
|
|
3272
3312
|
{
|
|
3273
|
-
if (i->
|
|
3313
|
+
if (i->isOptional())
|
|
3274
3314
|
{
|
|
3275
3315
|
return true;
|
|
3276
3316
|
}
|
|
@@ -3283,7 +3323,7 @@ Slice::Operation::receivesOptionals() const
|
|
|
3283
3323
|
{
|
|
3284
3324
|
for (const auto& i : outParameters())
|
|
3285
3325
|
{
|
|
3286
|
-
if (i->
|
|
3326
|
+
if (i->isOptional())
|
|
3287
3327
|
{
|
|
3288
3328
|
return true;
|
|
3289
3329
|
}
|
|
@@ -3291,10 +3331,10 @@ Slice::Operation::receivesOptionals() const
|
|
|
3291
3331
|
return returnIsOptional();
|
|
3292
3332
|
}
|
|
3293
3333
|
|
|
3294
|
-
|
|
3334
|
+
optional<FormatType>
|
|
3295
3335
|
Slice::Operation::format() const
|
|
3296
3336
|
{
|
|
3297
|
-
|
|
3337
|
+
optional<FormatType> format = parseFormatMetadata();
|
|
3298
3338
|
if (!format)
|
|
3299
3339
|
{
|
|
3300
3340
|
ContainedPtr cont = dynamic_pointer_cast<Contained>(container());
|
|
@@ -3313,7 +3353,7 @@ Slice::Operation::kindOf() const
|
|
|
3313
3353
|
void
|
|
3314
3354
|
Slice::Operation::visit(ParserVisitor* visitor)
|
|
3315
3355
|
{
|
|
3316
|
-
visitor->visitOperation(
|
|
3356
|
+
visitor->visitOperation(static_pointer_cast<Operation>(shared_from_this()));
|
|
3317
3357
|
}
|
|
3318
3358
|
|
|
3319
3359
|
void
|
|
@@ -3396,7 +3436,7 @@ Slice::Exception::createDataMember(
|
|
|
3396
3436
|
if (baseMember->name() == name)
|
|
3397
3437
|
{
|
|
3398
3438
|
ostringstream os;
|
|
3399
|
-
os << "data member '" << name << "' is already defined in a base exception";
|
|
3439
|
+
os << "data member '" << name << "' is already defined as a data member in a base exception";
|
|
3400
3440
|
unit()->error(os.str());
|
|
3401
3441
|
break;
|
|
3402
3442
|
}
|
|
@@ -3419,7 +3459,7 @@ Slice::Exception::createDataMember(
|
|
|
3419
3459
|
// Validate the tag.
|
|
3420
3460
|
for (const auto& q : dataMembers())
|
|
3421
3461
|
{
|
|
3422
|
-
if (q->
|
|
3462
|
+
if (q->isOptional() && tag == q->tag())
|
|
3423
3463
|
{
|
|
3424
3464
|
unit()->error("tag for optional data member '" + name + "' is already in use");
|
|
3425
3465
|
break;
|
|
@@ -3549,7 +3589,7 @@ Slice::Exception::kindOf() const
|
|
|
3549
3589
|
void
|
|
3550
3590
|
Slice::Exception::visit(ParserVisitor* visitor)
|
|
3551
3591
|
{
|
|
3552
|
-
auto self =
|
|
3592
|
+
auto self = static_pointer_cast<Exception>(shared_from_this());
|
|
3553
3593
|
if (visitor->visitExceptionStart(self))
|
|
3554
3594
|
{
|
|
3555
3595
|
visitContents(visitor);
|
|
@@ -3704,7 +3744,7 @@ Slice::Struct::kindOf() const
|
|
|
3704
3744
|
void
|
|
3705
3745
|
Slice::Struct::visit(ParserVisitor* visitor)
|
|
3706
3746
|
{
|
|
3707
|
-
auto self =
|
|
3747
|
+
auto self = static_pointer_cast<Struct>(shared_from_this());
|
|
3708
3748
|
if (visitor->visitStructStart(self))
|
|
3709
3749
|
{
|
|
3710
3750
|
visitContents(visitor);
|
|
@@ -3953,24 +3993,33 @@ Slice::Enum::createEnumerator(const string& name, optional<int32_t> explicitValu
|
|
|
3953
3993
|
ostringstream os;
|
|
3954
3994
|
os << "value for enumerator '" << name << "' is out of range";
|
|
3955
3995
|
unit()->error(os.str());
|
|
3996
|
+
nextValue = numeric_limits<int32_t>::min(); // Wrap around to the minimum value.
|
|
3997
|
+
}
|
|
3998
|
+
else
|
|
3999
|
+
{
|
|
4000
|
+
// If the enumerator was not assigned an explicit value,
|
|
4001
|
+
// we automatically assign it one more than the previous enumerator.
|
|
4002
|
+
nextValue = _lastValue + 1;
|
|
3956
4003
|
}
|
|
3957
|
-
// If the enumerator was not assigned an explicit value,
|
|
3958
|
-
// we automatically assign it one more than the previous enumerator.
|
|
3959
|
-
nextValue = _lastValue + 1;
|
|
3960
4004
|
}
|
|
3961
4005
|
|
|
3962
|
-
// Check if the enumerator's value is already in use.
|
|
3963
4006
|
bool checkForDuplicates = true;
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
_maxValue = nextValue;
|
|
3967
|
-
checkForDuplicates = false;
|
|
3968
|
-
}
|
|
3969
|
-
if (nextValue < _minValue)
|
|
4007
|
+
// Negative values indicate this is a bogus enumerator that is only created for error-recovery purposes.
|
|
4008
|
+
if (nextValue >= 0)
|
|
3970
4009
|
{
|
|
3971
|
-
|
|
3972
|
-
|
|
4010
|
+
if (nextValue > _maxValue)
|
|
4011
|
+
{
|
|
4012
|
+
_maxValue = nextValue;
|
|
4013
|
+
checkForDuplicates = false;
|
|
4014
|
+
}
|
|
4015
|
+
if (nextValue < _minValue)
|
|
4016
|
+
{
|
|
4017
|
+
_minValue = nextValue;
|
|
4018
|
+
checkForDuplicates = false;
|
|
4019
|
+
}
|
|
3973
4020
|
}
|
|
4021
|
+
|
|
4022
|
+
// Check if the enumerator's value is already in use.
|
|
3974
4023
|
if (checkForDuplicates)
|
|
3975
4024
|
{
|
|
3976
4025
|
for (const auto& r : enumerators())
|
|
@@ -4038,7 +4087,7 @@ Slice::Enum::kindOf() const
|
|
|
4038
4087
|
void
|
|
4039
4088
|
Slice::Enum::visit(ParserVisitor* visitor)
|
|
4040
4089
|
{
|
|
4041
|
-
visitor->visitEnum(
|
|
4090
|
+
visitor->visitEnum(static_pointer_cast<Enum>(shared_from_this()));
|
|
4042
4091
|
}
|
|
4043
4092
|
|
|
4044
4093
|
void
|
|
@@ -4179,7 +4228,7 @@ Slice::Parameter::setIsOutParam()
|
|
|
4179
4228
|
}
|
|
4180
4229
|
|
|
4181
4230
|
bool
|
|
4182
|
-
Slice::Parameter::
|
|
4231
|
+
Slice::Parameter::isOptional() const
|
|
4183
4232
|
{
|
|
4184
4233
|
return _optional;
|
|
4185
4234
|
}
|
|
@@ -4226,7 +4275,7 @@ Slice::DataMember::type() const
|
|
|
4226
4275
|
}
|
|
4227
4276
|
|
|
4228
4277
|
bool
|
|
4229
|
-
Slice::DataMember::
|
|
4278
|
+
Slice::DataMember::isOptional() const
|
|
4230
4279
|
{
|
|
4231
4280
|
return _optional;
|
|
4232
4281
|
}
|
|
@@ -4268,7 +4317,7 @@ Slice::DataMember::DataMember(
|
|
|
4268
4317
|
bool isOptional,
|
|
4269
4318
|
int32_t tag,
|
|
4270
4319
|
SyntaxTreeBasePtr defaultValueType,
|
|
4271
|
-
|
|
4320
|
+
optional<string> defaultValueString)
|
|
4272
4321
|
: Contained(container, name),
|
|
4273
4322
|
_type(std::move(type)),
|
|
4274
4323
|
_optional(isOptional),
|
|
@@ -4403,7 +4452,7 @@ Slice::Unit::currentLine() const
|
|
|
4403
4452
|
}
|
|
4404
4453
|
|
|
4405
4454
|
int
|
|
4406
|
-
Slice::Unit::setCurrentFile(
|
|
4455
|
+
Slice::Unit::setCurrentFile(string currentFile, int lineNumber)
|
|
4407
4456
|
{
|
|
4408
4457
|
assert(!currentFile.empty());
|
|
4409
4458
|
|
|
@@ -4418,7 +4467,6 @@ Slice::Unit::setCurrentFile(std::string currentFile, int lineNumber)
|
|
|
4418
4467
|
if (!IceInternal::fileExists(resolvedFilename))
|
|
4419
4468
|
{
|
|
4420
4469
|
// MCPP may report incorrect absolute paths when files are included using relative paths.
|
|
4421
|
-
// See: https://github.com/zeroc-ice/ice/issues/4253
|
|
4422
4470
|
|
|
4423
4471
|
// If the path is absolute but the file doesn't exist, treat it as relative to the current definition
|
|
4424
4472
|
// context.
|
|
@@ -4689,12 +4737,12 @@ Slice::Unit::findContents(const string& scopedName) const
|
|
|
4689
4737
|
}
|
|
4690
4738
|
|
|
4691
4739
|
void
|
|
4692
|
-
Slice::Unit::addTypeId(int32_t compactId, const
|
|
4740
|
+
Slice::Unit::addTypeId(int32_t compactId, const string& typeId)
|
|
4693
4741
|
{
|
|
4694
4742
|
_typeIds.insert(make_pair(compactId, typeId));
|
|
4695
4743
|
}
|
|
4696
4744
|
|
|
4697
|
-
|
|
4745
|
+
string
|
|
4698
4746
|
Slice::Unit::getTypeId(int32_t compactId) const
|
|
4699
4747
|
{
|
|
4700
4748
|
auto p = _typeIds.find(compactId);
|
|
@@ -4784,7 +4832,7 @@ Slice::Unit::destroy()
|
|
|
4784
4832
|
void
|
|
4785
4833
|
Slice::Unit::visit(ParserVisitor* visitor)
|
|
4786
4834
|
{
|
|
4787
|
-
auto self =
|
|
4835
|
+
auto self = static_pointer_cast<Unit>(shared_from_this());
|
|
4788
4836
|
if (visitor->visitUnitStart(self))
|
|
4789
4837
|
{
|
|
4790
4838
|
visitContents(visitor);
|
|
@@ -4813,7 +4861,7 @@ Slice::Unit::createBuiltin(Builtin::Kind kind)
|
|
|
4813
4861
|
{
|
|
4814
4862
|
return p->second;
|
|
4815
4863
|
}
|
|
4816
|
-
auto builtin = make_shared<Builtin>(
|
|
4864
|
+
auto builtin = make_shared<Builtin>(static_pointer_cast<Unit>(shared_from_this()), kind);
|
|
4817
4865
|
_builtins.insert(make_pair(kind, builtin));
|
|
4818
4866
|
return builtin;
|
|
4819
4867
|
}
|