From 7e88b7b41aeb8a0628932c6c37199058b9370bce Mon Sep 17 00:00:00 2001 From: pahans Date: Thu, 3 Oct 2019 00:14:10 +0530 Subject: [PATCH 001/167] Refactor variable method --- .../debugadapter/JBallerinaDebugServer.java | 220 ++--------------- .../debugadapter/variable/Variable.java | 4 + .../variable/VariableFactory.java | 221 ++++++++++++++++++ .../debugadapter/variable/VariableImpl.java | 43 ++++ .../debugadapter/variable/types/BArray.java | 9 + 5 files changed, 298 insertions(+), 199 deletions(-) create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java index 06bfb05053b1..d674fcef6180 100755 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java @@ -17,9 +17,7 @@ package org.ballerinalang.debugadapter; import com.sun.jdi.AbsentInformationException; -import com.sun.jdi.ArrayReference; import com.sun.jdi.ClassNotLoadedException; -import com.sun.jdi.Field; import com.sun.jdi.IncompatibleThreadStateException; import com.sun.jdi.ThreadReference; import com.sun.jdi.Value; @@ -28,7 +26,6 @@ import com.sun.jdi.request.ClassPrepareRequest; import com.sun.jdi.request.EventRequestManager; import com.sun.jdi.request.StepRequest; -import com.sun.tools.jdi.ObjectReferenceImpl; import org.apache.commons.compress.utils.IOUtils; import org.ballerinalang.debugadapter.launchrequest.Launch; import org.ballerinalang.debugadapter.launchrequest.LaunchFactory; @@ -85,10 +82,8 @@ import java.nio.file.Paths; import java.util.Arrays; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -347,7 +342,16 @@ public CompletableFuture variables(VariablesArguments args) { String varTypeStr = (value == null) ? "null" : value.type().name(); String name = entry.getKey(); - return getVariable(value, varTypeStr, name); + VariableImpl variable = new VariableFactory().getVariable(value, varTypeStr, name); + if (variable != null && variable.getChildVariables() != null) { + long variableReference = (long) nextVarReference.getAndIncrement(); + variable.getDapVariable().setVariablesReference(variableReference); + this.childVariables.put(variableReference, variable.getChildVariables()); + } + if (variable == null) { + return null; + } + return variable.getDapVariable(); }).filter(Objects::nonNull).toArray(Variable[]::new); } else { try { @@ -367,8 +371,17 @@ public CompletableFuture variables(VariablesArguments args) { return null; } - return getVariable(localVariableValueEntry.getValue(), + VariableImpl variable = new VariableFactory().getVariable(localVariableValueEntry.getValue(), varType, name); + if (variable != null && variable.getChildVariables() != null) { + long variableReference = (long) nextVarReference.getAndIncrement(); + variable.getDapVariable().setVariablesReference(variableReference); + this.childVariables.put(variableReference, variable.getChildVariables()); + } + if (variable == null) { + return null; + } + return variable.getDapVariable(); }).filter(Objects::nonNull).toArray(Variable[]::new); } catch (AbsentInformationException ignored) { } @@ -378,197 +391,6 @@ public CompletableFuture variables(VariablesArguments args) { return CompletableFuture.completedFuture(variablesResponse); } - private Variable getVariable(Value value, String varType, String varName) { - - Variable dapVariable = new Variable(); - dapVariable.setName(varName); - - if (value == null) { - return null; - } - - if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(varType)) { - long variableReference = (long) nextVarReference.getAndIncrement(); - Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); - this.childVariables.put(variableReference, values); - dapVariable.setVariablesReference(variableReference); - - dapVariable.setType(varType); - dapVariable.setValue("Array"); - return dapVariable; - } else if ("java.lang.Object".equalsIgnoreCase(varType) - || "org.ballerinalang.jvm.values.MapValue".equalsIgnoreCase(varType) - || "org.ballerinalang.jvm.values.MapValueImpl".equalsIgnoreCase(varType) // for nested json arrays - ) { - // JSONs - dapVariable.setType("Object"); - if (value.type() == null || value.type().name() == null) { - dapVariable.setValue("null"); - return dapVariable; - } - if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(value.type().name())) { - // JSON array - dapVariable.setValue("Array"); - long variableReference = (long) nextVarReference.getAndIncrement(); - Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); - this.childVariables.put(variableReference, values); - dapVariable.setVariablesReference(variableReference); - return dapVariable; - } else if ("java.lang.Long".equalsIgnoreCase(value.type().name()) - || "java.lang.Boolean".equalsIgnoreCase(value.type().name()) - || "java.lang.Double".equalsIgnoreCase(value.type().name())) { - // anydata - Field valueField = ((ObjectReferenceImpl) value).referenceType().allFields().stream().filter( - field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); - Value longValue = ((ObjectReferenceImpl) value).getValue(valueField); - dapVariable.setType(varType.split("\\.")[2]); - dapVariable.setValue(longValue.toString()); - return dapVariable; - } else if ("java.lang.String".equalsIgnoreCase(value.type().name())) { - // union - dapVariable.setType("String"); - String stringValue = value.toString(); - dapVariable.setValue(stringValue); - return dapVariable; - } else if ("org.ballerinalang.jvm.values.ErrorValue".equalsIgnoreCase(value.type().name())) { - - List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); - - Field valueField = fields.stream().filter(field -> - field.name().equals("reason")) - .collect(Collectors.toList()).get(0); - - Value error = ((ObjectReferenceImpl) value).getValue(valueField); - dapVariable.setType("BError"); - dapVariable.setValue(error.toString()); - return dapVariable; - } else if ("org.ballerinalang.jvm.values.XMLItem".equalsIgnoreCase(value.type().name())) { - // TODO: support xml values - dapVariable.setType("xml"); - dapVariable.setValue(value.toString()); - return dapVariable; - } else { - dapVariable.setType("Object"); - List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); - - Optional valueField = fields.stream().filter(field -> - field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); - if (!valueField.isPresent()) { - return dapVariable; - } - Value jsonValue = ((ObjectReferenceImpl) value).getValue(valueField.get()); - String stringValue = jsonValue == null ? "null" : "Object"; - if (jsonValue == null) { - dapVariable.setValue(stringValue); - return dapVariable; - } - Map values = new HashMap<>(); - ((ArrayReference) jsonValue).getValues().stream().filter(Objects::nonNull).forEach(jsonMap -> { - List jsonValueFields = ((ObjectReferenceImpl) jsonMap).referenceType().visibleFields(); - Optional jsonKeyField = jsonValueFields.stream().filter(field -> - field.name().equals("key")).findFirst(); - - Optional jsonValueField = jsonValueFields.stream().filter(field -> - field.name().equals("value")).findFirst(); - - if (jsonKeyField.isPresent() && jsonValueField.isPresent()) { - Value jsonKey = ((ObjectReferenceImpl) jsonMap).getValue(jsonKeyField.get()); - Value jsonValue1 = ((ObjectReferenceImpl) jsonMap).getValue(jsonValueField.get()); - values.put(jsonKey.toString(), jsonValue1); - } - }); - long variableReference = (long) nextVarReference.getAndIncrement(); - childVariables.put(variableReference, values); - dapVariable.setVariablesReference(variableReference); - dapVariable.setValue(stringValue); - return dapVariable; - } - } else if ("org.ballerinalang.jvm.values.ObjectValue".equalsIgnoreCase(varType)) { - Map fieldValueMap = ((ObjectReferenceImpl) value) - .getValues(((ObjectReferenceImpl) value).referenceType().allFields()); - Map values = new HashMap<>(); - fieldValueMap.forEach((field, value1) -> { - // Filter out internal variables - if (!field.name().startsWith("$") && !field.name().startsWith("nativeData")) { - values.put(field.name(), value1); - } - }); - - long variableReference = (long) nextVarReference.getAndIncrement(); - childVariables.put(variableReference, values); - dapVariable.setVariablesReference(variableReference); - dapVariable.setType("Object"); - dapVariable.setValue("Object"); - return dapVariable; - } else if ("java.lang.Long".equalsIgnoreCase(varType) || "java.lang.Boolean".equalsIgnoreCase(varType) - || "java.lang.Double".equalsIgnoreCase(varType)) { - Field valueField = ((ObjectReferenceImpl) value).referenceType().allFields().stream().filter( - field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); - Value longValue = ((ObjectReferenceImpl) value).getValue(valueField); - dapVariable.setType(varType.split("\\.")[2]); - dapVariable.setValue(longValue.toString()); - return dapVariable; - } else if ("java.lang.String".equalsIgnoreCase(varType)) { - dapVariable.setType("String"); - String stringValue = value.toString(); - dapVariable.setValue(stringValue); - return dapVariable; - } else if (varType.contains("$value$")) { - // Record type - String stringValue = value.type().name(); - - List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); - - Optional valueField = fields.stream().filter(field -> - field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); - - if (!valueField.isPresent()) { - dapVariable.setValue(stringValue); - return dapVariable; - } - Value jsonValue = ((ObjectReferenceImpl) value).getValue(valueField.get()); - - Map values = new HashMap<>(); - ((ArrayReference) jsonValue).getValues().stream().filter(Objects::nonNull).forEach(jsonMap -> { - List jsonValueFields = ((ObjectReferenceImpl) jsonMap).referenceType().visibleFields(); - - - Optional jsonKeyField = jsonValueFields.stream().filter(field -> - field.name().equals("key")).findFirst(); - - - Optional jsonValueField = jsonValueFields.stream().filter(field -> - field.name().equals("value")).findFirst(); - - if (jsonKeyField.isPresent() && jsonValueField.isPresent()) { - Value jsonKey = ((ObjectReferenceImpl) jsonMap).getValue(jsonKeyField.get()); - Value jsonValue1 = ((ObjectReferenceImpl) jsonMap).getValue(jsonValueField.get()); - values.put(jsonKey.toString(), jsonValue1); - } - }); - - long variableReference = (long) nextVarReference.getAndIncrement(); - childVariables.put(variableReference, values); - dapVariable.setVariablesReference(variableReference); - stringValue = stringValue.replace("$value$", ""); - dapVariable.setType(stringValue); - dapVariable.setValue(stringValue); - return dapVariable; - } else if ("org.ballerinalang.jvm.types.BObjectType".equalsIgnoreCase(varType)) { - Value typeName = ((ObjectReferenceImpl) value) - .getValue(((ObjectReferenceImpl) value).referenceType().fieldByName("typeName")); - dapVariable.setType(varType); - String stringValue = typeName.toString(); - dapVariable.setValue(stringValue); - return dapVariable; - } else { - dapVariable.setType(varType); - String stringValue = value.toString(); - dapVariable.setValue(stringValue); - return dapVariable; - } - } - @Override public CompletableFuture scopes(ScopesArguments args) { ScopesResponse scopesResponse = new ScopesResponse(); @@ -621,7 +443,7 @@ public CompletableFuture stepOut(StepOutArguments args) { private void sendOutput(String output, String category) { if (output.contains("Listening for transport dt_socket") - || output.contains("Please start the remote debugging client to continue") + || output.contains("Please start the remote debugging client to continue") || output.contains("JAVACMD") || output.contains("Stream closed")) { return; diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java new file mode 100644 index 000000000000..92b6a4fec853 --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java @@ -0,0 +1,4 @@ +package org.ballerinalang.debugadapter.variable; + +public interface Variable { +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java new file mode 100644 index 000000000000..0f76bc3c1b81 --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable; + +import com.sun.jdi.ArrayReference; +import com.sun.jdi.Field; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.VariableUtils; +import org.ballerinalang.debugadapter.variable.types.BArray; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * Variable factory. + */ +public class VariableFactory { + public VariableImpl getVariable(Value value, String varType, String varName) { + VariableImpl variable = new VariableImpl(); + Variable dapVariable = new Variable(); + variable.setDapVariable(dapVariable); + dapVariable.setName(varName); + + if (value == null) { + return null; + } + + if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(varType)) { + variable = new BArray(); + + Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); + variable.setChildVariables(values); + + dapVariable.setType(varType); + dapVariable.setValue("Array"); + return variable; + } else if ("java.lang.Object".equalsIgnoreCase(varType) + || "org.ballerinalang.jvm.values.MapValue".equalsIgnoreCase(varType) + || "org.ballerinalang.jvm.values.MapValueImpl".equalsIgnoreCase(varType) // for nested json arrays + ) { + // JSONs + dapVariable.setType("Object"); + if (value.type() == null || value.type().name() == null) { + dapVariable.setValue("null"); + return variable; + } + if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(value.type().name())) { + // JSON array + dapVariable.setValue("Array"); + Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); + variable.setChildVariables(values); + return variable; + } else if ("java.lang.Long".equalsIgnoreCase(value.type().name()) + || "java.lang.Boolean".equalsIgnoreCase(value.type().name()) + || "java.lang.Double".equalsIgnoreCase(value.type().name())) { + // anydata + Field valueField = ((ObjectReferenceImpl) value).referenceType().allFields().stream().filter( + field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); + Value longValue = ((ObjectReferenceImpl) value).getValue(valueField); + dapVariable.setType(varType.split("\\.")[2]); + dapVariable.setValue(longValue.toString()); + return variable; + } else if ("java.lang.String".equalsIgnoreCase(value.type().name())) { + // union + dapVariable.setType("String"); + String stringValue = value.toString(); + dapVariable.setValue(stringValue); + return variable; + } else if ("org.ballerinalang.jvm.values.ErrorValue".equalsIgnoreCase(value.type().name())) { + + List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); + + Field valueField = fields.stream().filter(field -> + field.name().equals("reason")) + .collect(Collectors.toList()).get(0); + + Value error = ((ObjectReferenceImpl) value).getValue(valueField); + dapVariable.setType("BError"); + dapVariable.setValue(error.toString()); + return variable; + } else if ("org.ballerinalang.jvm.values.XMLItem".equalsIgnoreCase(value.type().name())) { + // TODO: support xml values + dapVariable.setType("xml"); + dapVariable.setValue(value.toString()); + return variable; + } else { + dapVariable.setType("Object"); + List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); + + Optional valueField = fields.stream().filter(field -> + field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); + if (!valueField.isPresent()) { + return variable; + } + Value jsonValue = ((ObjectReferenceImpl) value).getValue(valueField.get()); + String stringValue = jsonValue == null ? "null" : "Object"; + if (jsonValue == null) { + dapVariable.setValue(stringValue); + return variable; + } + Map values = new HashMap<>(); + ((ArrayReference) jsonValue).getValues().stream().filter(Objects::nonNull).forEach(jsonMap -> { + List jsonValueFields = ((ObjectReferenceImpl) jsonMap).referenceType().visibleFields(); + Optional jsonKeyField = jsonValueFields.stream().filter(field -> + field.name().equals("key")).findFirst(); + + Optional jsonValueField = jsonValueFields.stream().filter(field -> + field.name().equals("value")).findFirst(); + + if (jsonKeyField.isPresent() && jsonValueField.isPresent()) { + Value jsonKey = ((ObjectReferenceImpl) jsonMap).getValue(jsonKeyField.get()); + Value jsonValue1 = ((ObjectReferenceImpl) jsonMap).getValue(jsonValueField.get()); + values.put(jsonKey.toString(), jsonValue1); + } + }); + variable.setChildVariables(values); + dapVariable.setValue(stringValue); + return variable; + } + } else if ("org.ballerinalang.jvm.values.ObjectValue".equalsIgnoreCase(varType)) { + Map fieldValueMap = ((ObjectReferenceImpl) value) + .getValues(((ObjectReferenceImpl) value).referenceType().allFields()); + Map values = new HashMap<>(); + fieldValueMap.forEach((field, value1) -> { + // Filter out internal variables + if (!field.name().startsWith("$") && !field.name().startsWith("nativeData")) { + values.put(field.name(), value1); + } + }); + + variable.setChildVariables(values); + dapVariable.setType("Object"); + dapVariable.setValue("Object"); + return variable; + } else if ("java.lang.Long".equalsIgnoreCase(varType) || "java.lang.Boolean".equalsIgnoreCase(varType) + || "java.lang.Double".equalsIgnoreCase(varType)) { + Field valueField = ((ObjectReferenceImpl) value).referenceType().allFields().stream().filter( + field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); + Value longValue = ((ObjectReferenceImpl) value).getValue(valueField); + dapVariable.setType(varType.split("\\.")[2]); + dapVariable.setValue(longValue.toString()); + return variable; + } else if ("java.lang.String".equalsIgnoreCase(varType)) { + dapVariable.setType("String"); + String stringValue = value.toString(); + dapVariable.setValue(stringValue); + return variable; + } else if (varType.contains("$value$")) { + // Record type + String stringValue = value.type().name(); + + List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); + + Optional valueField = fields.stream().filter(field -> + field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); + + if (!valueField.isPresent()) { + dapVariable.setValue(stringValue); + return variable; + } + Value jsonValue = ((ObjectReferenceImpl) value).getValue(valueField.get()); + + Map values = new HashMap<>(); + ((ArrayReference) jsonValue).getValues().stream().filter(Objects::nonNull).forEach(jsonMap -> { + List jsonValueFields = ((ObjectReferenceImpl) jsonMap).referenceType().visibleFields(); + + + Optional jsonKeyField = jsonValueFields.stream().filter(field -> + field.name().equals("key")).findFirst(); + + + Optional jsonValueField = jsonValueFields.stream().filter(field -> + field.name().equals("value")).findFirst(); + + if (jsonKeyField.isPresent() && jsonValueField.isPresent()) { + Value jsonKey = ((ObjectReferenceImpl) jsonMap).getValue(jsonKeyField.get()); + Value jsonValue1 = ((ObjectReferenceImpl) jsonMap).getValue(jsonValueField.get()); + values.put(jsonKey.toString(), jsonValue1); + } + }); + + variable.setChildVariables(values); + stringValue = stringValue.replace("$value$", ""); + dapVariable.setType(stringValue); + dapVariable.setValue(stringValue); + return variable; + } else if ("org.ballerinalang.jvm.types.BObjectType".equalsIgnoreCase(varType)) { + Value typeName = ((ObjectReferenceImpl) value) + .getValue(((ObjectReferenceImpl) value).referenceType().fieldByName("typeName")); + dapVariable.setType(varType); + String stringValue = typeName.toString(); + dapVariable.setValue(stringValue); + return variable; + } else { + dapVariable.setType(varType); + String stringValue = value.toString(); + dapVariable.setValue(stringValue); + return variable; + } + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java new file mode 100644 index 000000000000..60fcd9a6820a --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable; + +import com.sun.jdi.Value; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.Map; + +public class VariableImpl { + private Map childVariables; + Variable dapVariable; + + public void setChildVariables(Map childVariables) { + this.childVariables = childVariables; + } + + public void setDapVariable(Variable dapVariable) { + this.dapVariable = dapVariable; + } + + public Variable getDapVariable() { + return dapVariable; + } + + public Map getChildVariables() { + return childVariables; + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java new file mode 100644 index 000000000000..e1743623ead6 --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java @@ -0,0 +1,9 @@ +package org.ballerinalang.debugadapter.variable.types; + +import org.ballerinalang.debugadapter.variable.Variable; +import org.ballerinalang.debugadapter.variable.VariableImpl; + +public class BArray extends VariableImpl { + + +} From 53851aa94299da4bd5ff00079857cd0e5fcc8c04 Mon Sep 17 00:00:00 2001 From: pahans Date: Sun, 6 Oct 2019 01:02:56 +0530 Subject: [PATCH 002/167] Refactor BArray value --- .../debugadapter/JBallerinaDebugServer.java | 2 + .../debugadapter/variable/Variable.java | 16 +++++ .../variable/VariableFactory.java | 12 +--- .../debugadapter/variable/VariableImpl.java | 1 + .../debugadapter/variable/types/BArray.java | 64 ++++++++++++++++++- 5 files changed, 84 insertions(+), 11 deletions(-) diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java index d674fcef6180..e07d59c45473 100755 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java @@ -31,6 +31,8 @@ import org.ballerinalang.debugadapter.launchrequest.LaunchFactory; import org.ballerinalang.debugadapter.terminator.OSUtils; import org.ballerinalang.debugadapter.terminator.TerminatorFactory; +import org.ballerinalang.debugadapter.variable.VariableFactory; +import org.ballerinalang.debugadapter.variable.VariableImpl; import org.ballerinalang.toml.model.Manifest; import org.eclipse.lsp4j.debug.Breakpoint; import org.eclipse.lsp4j.debug.Capabilities; diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java index 92b6a4fec853..a5924e41e556 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.ballerinalang.debugadapter.variable; public interface Variable { diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java index 0f76bc3c1b81..2ab8199081d6 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java @@ -46,13 +46,7 @@ public VariableImpl getVariable(Value value, String varType, String varName) { } if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(varType)) { - variable = new BArray(); - - Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); - variable.setChildVariables(values); - - dapVariable.setType(varType); - dapVariable.setValue("Array"); + variable = new BArray(value, varType, varName, dapVariable); return variable; } else if ("java.lang.Object".equalsIgnoreCase(varType) || "org.ballerinalang.jvm.values.MapValue".equalsIgnoreCase(varType) @@ -66,9 +60,7 @@ public VariableImpl getVariable(Value value, String varType, String varName) { } if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(value.type().name())) { // JSON array - dapVariable.setValue("Array"); - Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); - variable.setChildVariables(values); + variable = new BArray(value, varType, varName, dapVariable); return variable; } else if ("java.lang.Long".equalsIgnoreCase(value.type().name()) || "java.lang.Boolean".equalsIgnoreCase(value.type().name()) diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java index 60fcd9a6820a..fe2e4cba0610 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java @@ -40,4 +40,5 @@ public Variable getDapVariable() { public Map getChildVariables() { return childVariables; } + } diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java index e1743623ead6..ed2ae9b1da41 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java @@ -1,9 +1,71 @@ package org.ballerinalang.debugadapter.variable.types; -import org.ballerinalang.debugadapter.variable.Variable; +import com.sun.jdi.Field; +import com.sun.jdi.IntegerValue; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.VariableUtils; import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; public class BArray extends VariableImpl { + private final ObjectReferenceImpl value; + private final String varType; + private final String varName; + private Map childVariables; + + public BArray(Value value, String varType, String varName, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.varType = varType; + this.varName = varName; + this.setDapVariable(dapVariable); + dapVariable.setType(varType); + dapVariable.setValue(this.toString()); + + Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); + this.setChildVariables(values); + } + + @Override + public Map getChildVariables() { + return childVariables; + } + + @Override + public void setChildVariables(Map childVariables) { + this.childVariables = childVariables; + } + + @Override + public String toString() { + List fields = value.referenceType().allFields(); + Field arrayValueField = value.getValues(fields).entrySet().stream() + .filter(fieldValueEntry -> + fieldValueEntry.getValue() != null + && fieldValueEntry.getKey().toString().endsWith("Values")) + .map(Map.Entry::getKey) + .collect(Collectors.toList()).get(0); + String arrayType = arrayValueField.toString(); + + arrayType = arrayType.replaceFirst("org.ballerinalang.jvm.values.ArrayValue.", ""); + arrayType = arrayType.replaceFirst("Values", ""); + arrayType = arrayType.replaceFirst("ref", "Array"); + + Field arraySizeField = value + .getValues(fields).entrySet().stream() + .filter(fieldValueEntry -> + fieldValueEntry.getValue() != null + && fieldValueEntry.getKey().toString().endsWith("ArrayValue.size")) + .map(Map.Entry::getKey) + .collect(Collectors.toList()).get(0); + int arraySize = ((IntegerValue) value.getValue(arraySizeField)).value(); + + return arrayType + "[" + arraySize + "]"; + } } From 49c48475f303fbfe6a8bb5d395c586e9d68089ed Mon Sep 17 00:00:00 2001 From: pahans Date: Sun, 6 Oct 2019 02:18:25 +0530 Subject: [PATCH 003/167] Refactor string variable value --- .../variable/VariableFactory.java | 13 ++++---- .../debugadapter/variable/types/BArray.java | 8 ++--- .../debugadapter/variable/types/BString.java | 30 +++++++++++++++++++ 3 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java index 2ab8199081d6..7a4a8493f23f 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java @@ -22,6 +22,7 @@ import com.sun.tools.jdi.ObjectReferenceImpl; import org.ballerinalang.debugadapter.VariableUtils; import org.ballerinalang.debugadapter.variable.types.BArray; +import org.ballerinalang.debugadapter.variable.types.BString; import org.eclipse.lsp4j.debug.Variable; import java.util.HashMap; @@ -46,7 +47,7 @@ public VariableImpl getVariable(Value value, String varType, String varName) { } if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(varType)) { - variable = new BArray(value, varType, varName, dapVariable); + variable = new BArray(value, dapVariable); return variable; } else if ("java.lang.Object".equalsIgnoreCase(varType) || "org.ballerinalang.jvm.values.MapValue".equalsIgnoreCase(varType) @@ -60,7 +61,7 @@ public VariableImpl getVariable(Value value, String varType, String varName) { } if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(value.type().name())) { // JSON array - variable = new BArray(value, varType, varName, dapVariable); + variable = new BArray(value, dapVariable); return variable; } else if ("java.lang.Long".equalsIgnoreCase(value.type().name()) || "java.lang.Boolean".equalsIgnoreCase(value.type().name()) @@ -74,9 +75,7 @@ public VariableImpl getVariable(Value value, String varType, String varName) { return variable; } else if ("java.lang.String".equalsIgnoreCase(value.type().name())) { // union - dapVariable.setType("String"); - String stringValue = value.toString(); - dapVariable.setValue(stringValue); + variable = new BString(value, dapVariable); return variable; } else if ("org.ballerinalang.jvm.values.ErrorValue".equalsIgnoreCase(value.type().name())) { @@ -153,9 +152,7 @@ public VariableImpl getVariable(Value value, String varType, String varName) { dapVariable.setValue(longValue.toString()); return variable; } else if ("java.lang.String".equalsIgnoreCase(varType)) { - dapVariable.setType("String"); - String stringValue = value.toString(); - dapVariable.setValue(stringValue); + variable = new BString(value, dapVariable); return variable; } else if (varType.contains("$value$")) { // Record type diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java index ed2ae9b1da41..d52c5cbc038e 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java @@ -15,16 +15,12 @@ public class BArray extends VariableImpl { private final ObjectReferenceImpl value; - private final String varType; - private final String varName; private Map childVariables; - public BArray(Value value, String varType, String varName, Variable dapVariable) { + public BArray(Value value, Variable dapVariable) { this.value = (ObjectReferenceImpl) value; - this.varType = varType; - this.varName = varName; this.setDapVariable(dapVariable); - dapVariable.setType(varType); + dapVariable.setType(this.toString()); dapVariable.setValue(this.toString()); Map values = VariableUtils.getChildVariables((ObjectReferenceImpl) value); diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java new file mode 100644 index 000000000000..ff63af38594e --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java @@ -0,0 +1,30 @@ +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.Field; +import com.sun.jdi.IntegerValue; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.VariableUtils; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class BString extends VariableImpl { + + private final ObjectReferenceImpl value; + + public BString(Value value, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.setDapVariable(dapVariable); + dapVariable.setType("string"); + dapVariable.setValue(this.toString()); + } + + @Override + public String toString() { + return value.toString(); + } +} From 04214ba9979dd2ab8a22d51b7a7d78950386ce68 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Wed, 9 Oct 2019 11:29:19 +0100 Subject: [PATCH 004/167] Clean inbuilt formatter implementation and refactor insert handlers --- .../BallerinaEnterBetweenBracesHandler.java | 2 +- .../BallerinaEnterInDocumentationHandler.java | 2 +- .../BallerinaIndentingBackspaceHandler.java | 2 +- ...BallerinaSingleCharacterInsertHandler.java | 56 -- .../inserthandlers/BracesInsertHandler.java | 89 --- .../inserthandlers/ColonInsertHandler.java | 99 --- .../ParenthesisInsertHandler.java | 89 --- ...ParenthesisWithSemicolonInsertHandler.java | 89 --- .../inserthandlers/SemiolonInsertHandler.java | 89 --- .../idea/formatter/BallerinaBlock.java | 381 ---------- .../BallerinaFormattingModelBuilder.java | 656 ------------------ 11 files changed, 3 insertions(+), 1551 deletions(-) rename tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/{formatter => editor/inserthandlers}/BallerinaEnterBetweenBracesHandler.java (98%) rename tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/{formatter => editor/inserthandlers}/BallerinaEnterInDocumentationHandler.java (98%) rename tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/{formatter => editor/inserthandlers}/BallerinaIndentingBackspaceHandler.java (98%) delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaSingleCharacterInsertHandler.java delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BracesInsertHandler.java delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ColonInsertHandler.java delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisInsertHandler.java delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisWithSemicolonInsertHandler.java delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/SemiolonInsertHandler.java delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaBlock.java delete mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaFormattingModelBuilder.java diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaEnterBetweenBracesHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterBetweenBracesHandler.java similarity index 98% rename from tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaEnterBetweenBracesHandler.java rename to tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterBetweenBracesHandler.java index 06d2ac1eb0bf..14c8dee70427 100644 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaEnterBetweenBracesHandler.java +++ b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterBetweenBracesHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.ballerina.plugins.idea.formatter; +package io.ballerina.plugins.idea.editor.inserthandlers; import com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegateAdapter; import com.intellij.openapi.actionSystem.DataContext; diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaEnterInDocumentationHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInDocumentationHandler.java similarity index 98% rename from tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaEnterInDocumentationHandler.java rename to tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInDocumentationHandler.java index a089dbf83ba6..59d68dc18c99 100644 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaEnterInDocumentationHandler.java +++ b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInDocumentationHandler.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.ballerina.plugins.idea.formatter; +package io.ballerina.plugins.idea.editor.inserthandlers; import com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegateAdapter; import com.intellij.openapi.actionSystem.DataContext; diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaIndentingBackspaceHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaIndentingBackspaceHandler.java similarity index 98% rename from tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaIndentingBackspaceHandler.java rename to tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaIndentingBackspaceHandler.java index 46ae82b7aacf..db8981119e41 100644 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaIndentingBackspaceHandler.java +++ b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaIndentingBackspaceHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.ballerina.plugins.idea.formatter; +package io.ballerina.plugins.idea.editor.inserthandlers; import com.intellij.codeInsight.editorActions.BackspaceHandlerDelegate; import com.intellij.openapi.editor.Document; diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaSingleCharacterInsertHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaSingleCharacterInsertHandler.java deleted file mode 100644 index 3220edb2b2df..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaSingleCharacterInsertHandler.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.editor.inserthandlers; - -import com.intellij.codeInsight.AutoPopupController; -import com.intellij.codeInsight.completion.BasicInsertHandler; -import com.intellij.codeInsight.completion.InsertionContext; -import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.editor.Editor; -import org.jetbrains.annotations.NotNull; - -/** - * Provides support to insert a single character. - */ -public class BallerinaSingleCharacterInsertHandler extends BasicInsertHandler { - - public static final BallerinaSingleCharacterInsertHandler ORGANIZATION_SEPARATOR = - new BallerinaSingleCharacterInsertHandler('/'); - - private final char myCharacter; - - public BallerinaSingleCharacterInsertHandler(char c) { - myCharacter = c; - } - - @Override - public void handleInsert(@NotNull InsertionContext context, LookupElement item) { - Editor editor = context.getEditor(); - int tailOffset = context.getTailOffset(); - Document document = editor.getDocument(); - context.commitDocument(); - boolean staysAtChar = (document.getTextLength() > tailOffset) && - (document.getCharsSequence().charAt(tailOffset) == myCharacter); - context.setAddCompletionChar(false); - if (!staysAtChar) { - document.insertString(tailOffset, String.valueOf(myCharacter)); - } - editor.getCaretModel().moveToOffset(tailOffset + 1); - AutoPopupController.getInstance(context.getProject()).scheduleAutoPopup(editor); - } -} diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BracesInsertHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BracesInsertHandler.java deleted file mode 100644 index 956970b0f727..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BracesInsertHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.editor.inserthandlers; - -import com.intellij.codeInsight.AutoPopupController; -import com.intellij.codeInsight.completion.InsertHandler; -import com.intellij.codeInsight.completion.InsertionContext; -import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.editor.EditorModificationUtil; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.PsiDocumentManager; - -/** - * Provides braces completion support. - */ -public class BracesInsertHandler implements InsertHandler { - - public static final InsertHandler INSTANCE = new BracesInsertHandler(false); - public static final InsertHandler INSTANCE_WITH_AUTO_POPUP = - new BracesInsertHandler(true); - - private final String myIgnoreOnChars; - private final boolean myTriggerAutoPopup; - - public BracesInsertHandler(boolean triggerAutoPopup) { - this("", triggerAutoPopup); - } - - public BracesInsertHandler(String ignoreOnChars, boolean triggerAutoPopup) { - myIgnoreOnChars = ignoreOnChars; - myTriggerAutoPopup = triggerAutoPopup; - } - - public void handleInsert(InsertionContext context, LookupElement item) { - Editor editor = context.getEditor(); - char completionChar = context.getCompletionChar(); - if (completionChar == ' ' || StringUtil.containsChar(myIgnoreOnChars, completionChar)) { - return; - } - Project project = editor.getProject(); - if (project != null) { - int completionCharOffset = getCompletionCharOffset(editor); - if (completionCharOffset == -1) { - EditorModificationUtil.insertStringAtCaret(editor, " {}", false, 2); - PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); - } else { - editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + completionCharOffset + 1); - } - if (myTriggerAutoPopup) { - AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null); - } - } - } - - private static int getCompletionCharOffset(Editor editor) { - int startOffset = editor.getCaretModel().getOffset(); - Document document = editor.getDocument(); - int textLength = document.getTextLength(); - CharSequence charsSequence = document.getCharsSequence(); - - char c; - for (int i = startOffset; i < textLength; i++) { - c = charsSequence.charAt(i); - if (c == '(') { - return i - startOffset; - } else if (!Character.isSpaceChar(c)) { - break; - } - } - return -1; - } -} diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ColonInsertHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ColonInsertHandler.java deleted file mode 100644 index a502fd3e4dce..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ColonInsertHandler.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.editor.inserthandlers; - -import com.intellij.codeInsight.AutoPopupController; -import com.intellij.codeInsight.completion.InsertHandler; -import com.intellij.codeInsight.completion.InsertionContext; -import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.editor.EditorModificationUtil; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.PsiDocumentManager; - -/** - * Provides colon completion support. - */ -public class ColonInsertHandler implements InsertHandler { - - public static final InsertHandler INSTANCE = new ColonInsertHandler(false); - public static final InsertHandler INSTANCE_WITH_SPACE = new ColonInsertHandler(true, false); - public static final InsertHandler INSTANCE_WITH_AUTO_POPUP = - new ColonInsertHandler(true); - - private final String myIgnoreOnChars; - private final boolean myWithSpace; - private final boolean myTriggerAutoPopup; - - public ColonInsertHandler(boolean triggerAutoPopup) { - this("", false, triggerAutoPopup); - } - - public ColonInsertHandler(boolean withSpace, boolean triggerAutoPopup) { - this("", withSpace, triggerAutoPopup); - } - - public ColonInsertHandler(String ignoreOnChars, boolean withSpace, boolean triggerAutoPopup) { - myIgnoreOnChars = ignoreOnChars; - myWithSpace = withSpace; - myTriggerAutoPopup = triggerAutoPopup; - } - - public void handleInsert(InsertionContext context, LookupElement item) { - Editor editor = context.getEditor(); - char completionChar = context.getCompletionChar(); - if (completionChar == ' ' || StringUtil.containsChar(myIgnoreOnChars, completionChar)) { - return; - } - Project project = editor.getProject(); - if (project != null) { - int completionCharOffset = getCompletionCharOffset(editor); - if (completionCharOffset == -1) { - EditorModificationUtil.insertStringAtCaret(editor, ":", false, 1); - if (myWithSpace) { - EditorModificationUtil.insertStringAtCaret(editor, " ", false, 1); - } - PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); - } else { - editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + completionCharOffset + 1); - } - if (myTriggerAutoPopup) { - AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null); - } - } - } - - private static int getCompletionCharOffset(Editor editor) { - int startOffset = editor.getCaretModel().getOffset(); - Document document = editor.getDocument(); - int textLength = document.getTextLength(); - CharSequence charsSequence = document.getCharsSequence(); - - char c; - for (int i = startOffset; i < textLength; i++) { - c = charsSequence.charAt(i); - if (c == ':') { - return i - startOffset; - } else if (!Character.isSpaceChar(c)) { - break; - } - } - return -1; - } -} diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisInsertHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisInsertHandler.java deleted file mode 100644 index e98452525ab3..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisInsertHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.editor.inserthandlers; - -import com.intellij.codeInsight.AutoPopupController; -import com.intellij.codeInsight.completion.InsertHandler; -import com.intellij.codeInsight.completion.InsertionContext; -import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.editor.EditorModificationUtil; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.PsiDocumentManager; - -/** - * Provides parenthesis completion support. - */ -public class ParenthesisInsertHandler implements InsertHandler { - - public static final InsertHandler INSTANCE = new ParenthesisInsertHandler(false); - public static final InsertHandler INSTANCE_WITH_AUTO_POPUP = - new ParenthesisInsertHandler(true); - - private final String myIgnoreOnChars; - private final boolean myTriggerAutoPopup; - - public ParenthesisInsertHandler(boolean triggerAutoPopup) { - this("", triggerAutoPopup); - } - - public ParenthesisInsertHandler(String ignoreOnChars, boolean triggerAutoPopup) { - myIgnoreOnChars = ignoreOnChars; - myTriggerAutoPopup = triggerAutoPopup; - } - - public void handleInsert(InsertionContext context, LookupElement item) { - Editor editor = context.getEditor(); - char completionChar = context.getCompletionChar(); - if (completionChar == ' ' || StringUtil.containsChar(myIgnoreOnChars, completionChar)) { - return; - } - Project project = editor.getProject(); - if (project != null) { - int completionCharOffset = getCompletionCharOffset(editor); - if (completionCharOffset == -1) { - EditorModificationUtil.insertStringAtCaret(editor, "()", false, 1); - PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); - } else { - editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + completionCharOffset + 1); - } - if (myTriggerAutoPopup) { - AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null); - } - } - } - - private static int getCompletionCharOffset(Editor editor) { - int startOffset = editor.getCaretModel().getOffset(); - Document document = editor.getDocument(); - int textLength = document.getTextLength(); - CharSequence charsSequence = document.getCharsSequence(); - - char c; - for (int i = startOffset; i < textLength; i++) { - c = charsSequence.charAt(i); - if (c == '(') { - return i - startOffset; - } else if (!Character.isSpaceChar(c)) { - break; - } - } - return -1; - } -} diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisWithSemicolonInsertHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisWithSemicolonInsertHandler.java deleted file mode 100644 index 3728a2cf77b6..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/ParenthesisWithSemicolonInsertHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.editor.inserthandlers; - -import com.intellij.codeInsight.AutoPopupController; -import com.intellij.codeInsight.completion.InsertHandler; -import com.intellij.codeInsight.completion.InsertionContext; -import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.editor.EditorModificationUtil; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.PsiDocumentManager; - -/** - * Provides parenthesis with semicolon completion support. - */ -public class ParenthesisWithSemicolonInsertHandler implements InsertHandler { - - public static final InsertHandler INSTANCE = new ParenthesisWithSemicolonInsertHandler(false); - public static final InsertHandler INSTANCE_WITH_AUTO_POPUP = - new ParenthesisWithSemicolonInsertHandler(true); - - private final String myIgnoreOnChars; - private final boolean myTriggerAutoPopup; - - public ParenthesisWithSemicolonInsertHandler(boolean triggerAutoPopup) { - this("", triggerAutoPopup); - } - - public ParenthesisWithSemicolonInsertHandler(String ignoreOnChars, boolean triggerAutoPopup) { - myIgnoreOnChars = ignoreOnChars; - myTriggerAutoPopup = triggerAutoPopup; - } - - public void handleInsert(InsertionContext context, LookupElement item) { - Editor editor = context.getEditor(); - char completionChar = context.getCompletionChar(); - if (completionChar == ' ' || StringUtil.containsChar(myIgnoreOnChars, completionChar)) { - return; - } - Project project = editor.getProject(); - if (project != null) { - int completionCharOffset = getCompletionCharOffset(editor); - if (completionCharOffset == -1) { - EditorModificationUtil.insertStringAtCaret(editor, "();", false, 1); - PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); - } else { - editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + completionCharOffset + 1); - } - if (myTriggerAutoPopup) { - AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null); - } - } - } - - private static int getCompletionCharOffset(Editor editor) { - int startOffset = editor.getCaretModel().getOffset(); - Document document = editor.getDocument(); - int textLength = document.getTextLength(); - CharSequence charsSequence = document.getCharsSequence(); - - char c; - for (int i = startOffset; i < textLength; i++) { - c = charsSequence.charAt(i); - if (c == '(') { - return i - startOffset; - } else if (!Character.isSpaceChar(c)) { - break; - } - } - return -1; - } -} diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/SemiolonInsertHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/SemiolonInsertHandler.java deleted file mode 100644 index bcced7a715b9..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/SemiolonInsertHandler.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.editor.inserthandlers; - -import com.intellij.codeInsight.AutoPopupController; -import com.intellij.codeInsight.completion.InsertHandler; -import com.intellij.codeInsight.completion.InsertionContext; -import com.intellij.codeInsight.lookup.LookupElement; -import com.intellij.openapi.editor.Document; -import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.editor.EditorModificationUtil; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.psi.PsiDocumentManager; - -/** - * Provides semicolon completion support. - */ -public class SemiolonInsertHandler implements InsertHandler { - - public static final InsertHandler INSTANCE = new SemiolonInsertHandler(false); - public static final InsertHandler INSTANCE_WITH_AUTO_POPUP = - new SemiolonInsertHandler(true); - - private final String myIgnoreOnChars; - private final boolean myTriggerAutoPopup; - - public SemiolonInsertHandler(boolean triggerAutoPopup) { - this("", triggerAutoPopup); - } - - public SemiolonInsertHandler(String ignoreOnChars, boolean triggerAutoPopup) { - myIgnoreOnChars = ignoreOnChars; - myTriggerAutoPopup = triggerAutoPopup; - } - - public void handleInsert(InsertionContext context, LookupElement item) { - Editor editor = context.getEditor(); - char completionChar = context.getCompletionChar(); - if (completionChar == ' ' || StringUtil.containsChar(myIgnoreOnChars, completionChar)) { - return; - } - Project project = editor.getProject(); - if (project != null) { - int completionCharOffset = getCompletionCharOffset(editor); - if (completionCharOffset == -1) { - EditorModificationUtil.insertStringAtCaret(editor, ";", false, 1); - PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); - } else { - editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + completionCharOffset + 1); - } - if (myTriggerAutoPopup) { - AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null); - } - } - } - - private static int getCompletionCharOffset(Editor editor) { - int startOffset = editor.getCaretModel().getOffset(); - Document document = editor.getDocument(); - int textLength = document.getTextLength(); - CharSequence charsSequence = document.getCharsSequence(); - - char c; - for (int i = startOffset; i < textLength; i++) { - c = charsSequence.charAt(i); - if (c == ':') { - return i - startOffset; - } else if (!Character.isSpaceChar(c)) { - break; - } - } - return -1; - } -} diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaBlock.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaBlock.java deleted file mode 100644 index d0eab65dc069..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaBlock.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.formatter; - -import com.intellij.formatting.Alignment; -import com.intellij.formatting.Block; -import com.intellij.formatting.ChildAttributes; -import com.intellij.formatting.Indent; -import com.intellij.formatting.Spacing; -import com.intellij.formatting.SpacingBuilder; -import com.intellij.formatting.Wrap; -import com.intellij.formatting.WrapType; -import com.intellij.lang.ASTNode; -import com.intellij.openapi.util.TextRange; -import com.intellij.psi.TokenType; -import com.intellij.psi.codeStyle.CodeStyleSettings; -import com.intellij.psi.formatter.common.AbstractBlock; -import com.intellij.psi.tree.IElementType; -import com.intellij.util.containers.ContainerUtil; -import io.ballerina.plugins.idea.psi.BallerinaTypes; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * Represents a code block. - */ -public class BallerinaBlock extends AbstractBlock { - - @NotNull - private final ASTNode myNode; - @Nullable - private final Alignment myAlignment; - @Nullable - private final Indent myIndent; - @Nullable - private final Wrap myWrap; - @NotNull - private final CodeStyleSettings mySettings; - @NotNull - private final SpacingBuilder mySpacingBuilder; - @Nullable - private List mySubBlocks; - @NotNull - private Map myAlignmentMap; - - protected BallerinaBlock(@NotNull ASTNode node, @Nullable Alignment alignment, @Nullable Indent indent, - @Nullable Wrap wrap, @NotNull CodeStyleSettings settings, - @NotNull SpacingBuilder spacingBuilder, @NotNull Map alignmentMap) { - super(node, wrap, alignment); - - this.myNode = node; - this.myAlignment = alignment; - this.myIndent = indent; - this.myWrap = wrap; - this.mySettings = settings; - this.mySpacingBuilder = spacingBuilder; - this.myAlignmentMap = alignmentMap; - } - - @Override - protected List buildChildren() { - return new LinkedList<>(); - } - - @NotNull - @Override - public ASTNode getNode() { - return myNode; - } - - @NotNull - @Override - public TextRange getTextRange() { - return myNode.getTextRange(); - } - - @Nullable - @Override - public Wrap getWrap() { - return myWrap; - } - - @Override - public Indent getIndent() { - return myIndent; - } - - @Override - @Nullable - public Alignment getAlignment() { - return myAlignment; - } - - @NotNull - @Override - public List getSubBlocks() { - if (mySubBlocks == null) { - mySubBlocks = buildSubBlocks(); - } - return mySubBlocks; - } - - @NotNull - private List buildSubBlocks() { - List blocks = ContainerUtil.newArrayList(); - for (ASTNode child = myNode.getFirstChildNode(); child != null; child = child.getTreeNext()) { - IElementType childType = child.getElementType(); - if (child.getTextRange().getLength() == 0) { - continue; - } - if (childType == TokenType.WHITE_SPACE) { - continue; - } - Alignment alignment = getAlignment(child); - Indent indent = calculateIndent(child); - Wrap wrap = createWrap(child); - blocks.add( - new BallerinaBlock(child, alignment, indent, wrap, mySettings, mySpacingBuilder, myAlignmentMap)); - } - return blocks; - } - - private Alignment getAlignment(ASTNode child) { - Alignment alignment = null; - IElementType childElementType = child.getElementType(); - IElementType parentElementType = myNode.getElementType(); - if ((childElementType == BallerinaTypes.PARAMETER || childElementType == BallerinaTypes.DEFAULTABLE_PARAMETER - || childElementType == BallerinaTypes.REST_PARAMETER) - && parentElementType == BallerinaTypes.FORMAL_PARAMETER_LIST) { - if (myAlignmentMap.containsKey(myNode)) { - alignment = myAlignmentMap.get(myNode); - } else { - alignment = Alignment.createAlignment(true, Alignment.Anchor.LEFT); - myAlignmentMap.put(myNode, alignment); - } - } else if (childElementType == BallerinaTypes.RETURN_PARAMETER - && parentElementType == BallerinaTypes.CALLABLE_UNIT_SIGNATURE) { - if (myAlignmentMap.containsKey(myNode)) { - alignment = myAlignmentMap.get(myNode); - } else { - alignment = Alignment.createAlignment(true, Alignment.Anchor.LEFT); - myAlignmentMap.put(myNode, alignment); - } - } else if ( - (childElementType == BallerinaTypes.RETURNS || childElementType == BallerinaTypes.DEFAULTABLE_PARAMETER) - && parentElementType == BallerinaTypes.RETURN_PARAMETER) { - if (myAlignmentMap.containsKey(myNode)) { - alignment = myAlignmentMap.get(myNode); - } else { - alignment = Alignment.createAlignment(true, Alignment.Anchor.LEFT); - myAlignmentMap.put(myNode, alignment); - } - } else if (childElementType == BallerinaTypes.PARAMETER && parentElementType == BallerinaTypes.PARAMETER_LIST) { - ASTNode treeParent = myNode.getTreeParent().getTreeParent(); - if (myAlignmentMap.containsKey(treeParent)) { - alignment = myAlignmentMap.get(treeParent); - } else { - alignment = Alignment.createAlignment(true, Alignment.Anchor.LEFT); - myAlignmentMap.put(treeParent, alignment); - } - } else if (childElementType == BallerinaTypes.QUESTION_MARK - && parentElementType == BallerinaTypes.TERNARY_EXPRESSION) { - alignment = Alignment.createAlignment(true, Alignment.Anchor.LEFT); - myAlignmentMap.put(myNode, alignment); - } else if (childElementType == BallerinaTypes.COLON && parentElementType == BallerinaTypes.TERNARY_EXPRESSION) { - if (myAlignmentMap.containsKey(myNode)) { - alignment = myAlignmentMap.get(myNode); - } - } else if (childElementType == BallerinaTypes.TRANSACTION_PROPERTY_INIT_STATEMENT - && parentElementType == BallerinaTypes.TRANSACTION_PROPERTY_INIT_STATEMENT_LIST) { - ASTNode treeParent = myNode.getTreeParent().getTreeParent(); - if (myAlignmentMap.containsKey(treeParent)) { - alignment = myAlignmentMap.get(treeParent); - } else { - alignment = Alignment.createAlignment(true, Alignment.Anchor.LEFT); - myAlignmentMap.put(treeParent, alignment); - } - } - return alignment; - } - - @NotNull - private Indent calculateIndent(@NotNull ASTNode child) { - IElementType childElementType = child.getElementType(); - IElementType parentElementType = myNode.getElementType(); - // Todo - Refactor into separate helper methods - if (childElementType == BallerinaTypes.BLOCK) { - return Indent.getNormalIndent(); - } else if (parentElementType == BallerinaTypes.RECORD_LITERAL_BODY) { - return Indent.getNormalIndent(); - } else if (parentElementType == BallerinaTypes.WAIT_FOR_COLLECTION) { - if (childElementType != BallerinaTypes.LEFT_BRACE && childElementType != BallerinaTypes.RIGHT_BRACE) { - return Indent.getNormalIndent(); - } - } else if (childElementType == BallerinaTypes.LINE_COMMENT && ( - parentElementType == BallerinaTypes.CALLABLE_UNIT_BODY - || parentElementType == BallerinaTypes.WORKER_WITH_STATEMENTS_BLOCK - || parentElementType == BallerinaTypes.IF_CLAUSE - || parentElementType == BallerinaTypes.ELSE_IF_CLAUSE - || parentElementType == BallerinaTypes.ELSE_CLAUSE - || parentElementType == BallerinaTypes.WORKER_BODY - || parentElementType == BallerinaTypes.FORK_JOIN_STATEMENT - || parentElementType == BallerinaTypes.WHILE_STATEMENT_BODY - || parentElementType == BallerinaTypes.MATCH_STATEMENT_BODY - || parentElementType == BallerinaTypes.RECORD_LITERAL - || parentElementType == BallerinaTypes.FOREACH_STATEMENT - || parentElementType == BallerinaTypes.LOCK_STATEMENT - || parentElementType == BallerinaTypes.OBJECT_TYPE_NAME - || parentElementType == BallerinaTypes.OBJECT_FIELD_DEFINITION - || parentElementType == BallerinaTypes.TRY_CATCH_STATEMENT - || parentElementType == BallerinaTypes.CATCH_CLAUSE - || parentElementType == BallerinaTypes.FINALLY_CLAUSE - || parentElementType == BallerinaTypes.SERVICE_BODY - || parentElementType == BallerinaTypes.TRANSACTION_CLAUSE - || parentElementType == BallerinaTypes.ABORTED_CLAUSE - || parentElementType == BallerinaTypes.COMMITTED_CLAUSE)) { - return Indent.getNormalIndent(); - } else if (parentElementType == BallerinaTypes.CALLABLE_UNIT_SIGNATURE) { - return Indent.getIndent(Indent.Type.NORMAL, true, true); - } else if (childElementType == BallerinaTypes.RETURN_PARAMETER) { - return Indent.getNormalIndent(); - } else if ((childElementType == BallerinaTypes.TUPLE_TYPE_NAME - || childElementType == BallerinaTypes.UNION_TYPE_NAME)) { - return Indent.getIndent(Indent.Type.NORMAL, true, true); - } else if (parentElementType == BallerinaTypes.MATCH_PATTERN_CLAUSE) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.FIELD_DEFINITION - || childElementType == BallerinaTypes.RECORD_REST_FIELD_DEFINITION) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.WORKER_DEFINITION - && parentElementType == BallerinaTypes.FORK_JOIN_STATEMENT) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.WORKER_DEFINITION - && parentElementType == BallerinaTypes.WORKER_WITH_STATEMENTS_BLOCK) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.STATEMENT - && parentElementType == BallerinaTypes.WORKER_WITH_STATEMENTS_BLOCK) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.STATEMENT - && parentElementType == BallerinaTypes.CALLABLE_UNIT_BODY) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.INVOCATION_ARG_LIST) { - return Indent.getIndent(Indent.Type.NORMAL, true, true); - } else if (childElementType == BallerinaTypes.MATCH_STATEMENT_BODY) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.OBJECT_BODY) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.FOREVER_STATEMENT_BODY) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.BINARY_ADD_SUB_EXPRESSION - || childElementType == BallerinaTypes.BINARY_DIV_MUL_MOD_EXPRESSION - || childElementType == BallerinaTypes.BINARY_AND_EXPRESSION - || childElementType == BallerinaTypes.BINARY_OR_EXPRESSION - || childElementType == BallerinaTypes.BITWISE_EXPRESSION - || childElementType == BallerinaTypes.BITWISE_SHIFT_EXPRESSION - || childElementType == BallerinaTypes.BINARY_COMPARE_EXPRESSION) { - if (!(parentElementType == BallerinaTypes.BINARY_ADD_SUB_EXPRESSION - || parentElementType == BallerinaTypes.BINARY_DIV_MUL_MOD_EXPRESSION - || parentElementType == BallerinaTypes.BINARY_AND_EXPRESSION - || parentElementType == BallerinaTypes.BINARY_OR_EXPRESSION - || parentElementType == BallerinaTypes.BITWISE_EXPRESSION - || parentElementType == BallerinaTypes.BITWISE_SHIFT_EXPRESSION - || parentElementType == BallerinaTypes.BINARY_COMPARE_EXPRESSION - || parentElementType == BallerinaTypes.UNARY_EXPRESSION)) { - return Indent.getIndent(Indent.Type.NORMAL, true, true); - } - } else if (childElementType == BallerinaTypes.VARIABLE_REFERENCE_EXPRESSION && ( - parentElementType == BallerinaTypes.ASSIGNMENT_STATEMENT - || parentElementType == BallerinaTypes.VARIABLE_DEFINITION_STATEMENT)) { - return Indent.getNormalIndent(); - } else if ((childElementType == BallerinaTypes.LAMBDA_FUNCTION_EXPRESSION - || childElementType == BallerinaTypes.ARROW_FUNCTION_EXPRESSION) - && parentElementType == BallerinaTypes.VARIABLE_DEFINITION_STATEMENT) { - return Indent.getNormalIndent(); - } else if ((childElementType == BallerinaTypes.TABLE_COLUMN_DEFINITION - || childElementType == BallerinaTypes.TABLE_DATA_ARRAY) - && parentElementType == BallerinaTypes.TABLE_LITERAL) { - return Indent.getNormalIndent(); - } else if (childElementType == BallerinaTypes.TABLE_DATA_LIST && (parentElementType - == BallerinaTypes.TABLE_DATA_ARRAY)) { - return Indent.getNormalIndent(); - } - return Indent.getNoneIndent(); - } - - private Wrap createWrap(ASTNode child) { - return Wrap.createWrap(WrapType.CHOP_DOWN_IF_LONG, false); - } - - @Nullable - @Override - public Spacing getSpacing(@Nullable Block child1, @NotNull Block child2) { - return mySpacingBuilder.getSpacing(this, child1, child2); - } - - @NotNull - @Override - public ChildAttributes getChildAttributes(int newChildIndex) { - Indent childIndent = Indent.getNoneIndent(); - if (myNode.getElementType() == BallerinaTypes.CALLABLE_UNIT_BODY) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.WORKER_WITH_STATEMENTS_BLOCK) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.SERVICE_BODY) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.RECORD_LITERAL) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.RECORD_LITERAL_BODY) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.WORKER_BODY) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.WHILE_STATEMENT_BODY) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.FORK_JOIN_STATEMENT) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.MATCH_STATEMENT_BODY) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.FOREACH_STATEMENT) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.IF_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.ELSE_IF_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.ELSE_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.TRANSACTION_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.ABORTED_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.COMMITTED_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.ON_RETRY_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.TRY_CATCH_STATEMENT) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.CATCH_CLAUSES) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.CATCH_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.FINALLY_CLAUSE) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.LOCK_STATEMENT) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.OBJECT_TYPE_NAME) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.OBJECT_FIELD_DEFINITION) { - childIndent = Indent.getNormalIndent(); - } else if (myNode.getElementType() == BallerinaTypes.FOREVER_STATEMENT) { - childIndent = Indent.getNormalIndent(); - } - return new ChildAttributes(childIndent, null); - } - - @Override - public boolean isIncomplete() { - return false; - } - - @Override - public boolean isLeaf() { - return myNode.getFirstChildNode() == null; - } -} diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaFormattingModelBuilder.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaFormattingModelBuilder.java deleted file mode 100644 index a599a2710224..000000000000 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/formatter/BallerinaFormattingModelBuilder.java +++ /dev/null @@ -1,656 +0,0 @@ -/* - * Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.ballerina.plugins.idea.formatter; - -import com.intellij.formatting.Block; -import com.intellij.formatting.FormattingModel; -import com.intellij.formatting.FormattingModelBuilder; -import com.intellij.formatting.FormattingModelProvider; -import com.intellij.formatting.Indent; -import com.intellij.formatting.Spacing; -import com.intellij.formatting.SpacingBuilder; -import com.intellij.lang.ASTNode; -import com.intellij.openapi.util.TextRange; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiFile; -import com.intellij.psi.TokenType; -import com.intellij.psi.codeStyle.CodeStyleSettings; -import com.intellij.psi.formatter.common.AbstractBlock; -import com.intellij.psi.tree.IElementType; -import io.ballerina.plugins.idea.BallerinaLanguage; -import io.ballerina.plugins.idea.psi.BallerinaTypes; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; - -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ABORT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ABORTED; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ABORTED_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ACTION_INVOCATION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ADD; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ALL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.AND; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ANNOTATION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ANNOTATION_ATTACHMENT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ANY_IDENTIFIER_NAME; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ARRAY_TYPE_NAME; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.AS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ASSIGN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ATTACHMENT_POINT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.BIT_COMPLEMENT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.BREAK; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.BY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CALLABLE_UNIT_BODY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CALLABLE_UNIT_SIGNATURE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CATCH; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CATCH_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CATCH_CLAUSES; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CHANNEL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CHECK; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CLIENT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.COLON; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.COMMA; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.COMMITTED; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.COMMITTED_ABORTED_CLAUSES; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.COMMITTED_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.COMPLETE_PACKAGE_NAME; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.COMPOUND_OPERATOR; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CONST; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.CONTINUE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.DAY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.DECIMAL_INTEGER_LITERAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.DIV; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.DOT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ELLIPSIS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ELSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ELSE_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ELSE_IF_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ELVIS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ENTRY_BINDING_PATTERN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ENTRY_REF_BINDING_PATTERN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.EQUAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.EQUAL_GT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.EVENTS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.EVERY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.EXPRESSION_LIST; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FAIL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FIELD; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FIELD_BINDING_PATTERN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FIELD_DEFINITION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FIELD_REF_BINDING_PATTERN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FINAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FINALLY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FINALLY_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FINITE_TYPE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FIRST; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FLOATING_POINT_LITERAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FLUSH; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FOLLOWED; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FOR; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FOREACH; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FOREACH_STATEMENT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FOREVER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FORK; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FROM; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FULL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FUNCTION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FUNCTION_DEFINITION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FUNCTION_INVOCATION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FUNCTION_NAME_REFERENCE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.FUTURE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.GROUP; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.GT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.GT_EQUAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.HALF_OPEN_RANGE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.HAVING; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.HOUR; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.IDENTIFIER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.IF; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.IF_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.IMPORT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.IMPORT_DECLARATION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.IN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.INDEX; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.INNER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.INTEGER_LITERAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.INT_RANGE_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.INVOCATION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.INVOCATION_ARG; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.INVOCATION_ARG_LIST; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.IS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.JOIN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.JSON; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LARROW; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LAST; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LEFT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LEFT_BRACE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LEFT_BRACKET; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LEFT_PARENTHESIS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LISTENER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LOCK; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.LT_EQUAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.MAP; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.MATCH; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.MATCH_STATEMENT_BODY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.MINUTE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.MOD; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.MONTH; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.MUL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.NAME_REFERENCE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.NEW; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.NOT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.NOT_EQUAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.NULLABLE_TYPE_NAME; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.OBJECT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.OBJECT_BODY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ON; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ONRETRY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ON_RETRY_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.OR; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.ORDER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.OUTER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.OUTPUT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.PACKAGE_REFERENCE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.PANIC; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.PARAMETER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.PARAMETER_LIST; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.PIPE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.POW; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.PRIVATE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.PUBLIC; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.QUESTION_MARK; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RANGE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RARROW; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RECORD_KEY_VALUE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RECORD_LITERAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RECORD_LITERAL_BODY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RECORD_REF_BINDING_PATTERN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.REF_EQUAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.REF_NOT_EQUAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.REMOTE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RESOURCE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.REST_BINDING_PATTERN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.REST_PARAMETER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.REST_REF_BINDING_PATTERN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RETRIES; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RETURN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RETURNS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RETURN_PARAMETER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RIGHT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RIGHT_BRACE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RIGHT_BRACKET; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.RIGHT_PARENTHESIS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SAFE_ASSIGNMENT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SECOND; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SELECT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SEMICOLON; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SERVICE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SERVICE_BODY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SIMPLE_LITERAL_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SIMPLE_TYPE_NAME; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SIMPLE_VARIABLE_REFERENCE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SNAPSHOT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.START; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.STATEMENT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.STREAM; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SUB; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.SYNCRARROW; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TABLE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TERNARY_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.THROW; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TRANSACTION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TRANSACTION_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TRANSACTION_PROPERTY_INIT_STATEMENT_LIST; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TRAP; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TRY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TUPLE_TYPE_NAME; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TYPE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.TYPE_CONVERSION_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.UNARY_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.UNIDIRECTIONAL; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.UNION_TYPE_NAME; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.VAR; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.VARIABLE_REFERENCE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.VARIABLE_REFERENCE_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.VERSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WAIT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WAIT_KEY_VALUE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WHERE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WHERE_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WHILE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WHILE_STATEMENT_BODY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WINDOW; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WINDOW_CLAUSE; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WITH; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WITHIN; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WORKER; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WORKER_BODY; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WORKER_RECEIVE_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WORKER_SEND_ASYNC_STATEMENT; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.WORKER_SEND_SYNC_EXPRESSION; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.XMLNS; -import static io.ballerina.plugins.idea.psi.BallerinaTypes.YEAR; - -/** - * Builds the Ballerina file formatting model. - */ -public class BallerinaFormattingModelBuilder implements FormattingModelBuilder { - - // TODO Fix formatting rules for XML literals - - @NotNull - @Override - public FormattingModel createModel(PsiElement element, CodeStyleSettings settings) { - - if (!isGrammarViolated(element.getNode())) { - BallerinaBlock rootBlock = new BallerinaBlock(element.getNode(), null, Indent.getNoneIndent(), null, - settings, createSpaceBuilder(settings), new HashMap<>()); - return FormattingModelProvider - .createFormattingModelForPsiFile(element.getContainingFile(), rootBlock, settings); - // If the plugin grammar tree is not generated correctly for the file, code reformat should not work. - } else { - AbstractBlock rootBlock = new AbstractBlock(element.getNode(), null, null) { - @Nullable - @Override - public Spacing getSpacing(@Nullable Block child1, @NotNull Block child2) { - return null; - } - - @Override - public boolean isLeaf() { - return false; - } - - @Override - protected List buildChildren() { - return new LinkedList<>(); - } - }; - return FormattingModelProvider - .createFormattingModelForPsiFile(element.getContainingFile(), rootBlock, settings); - } - } - - // Checks whether the PSI tree for the file is properly generated. - private static boolean isGrammarViolated(ASTNode rootNode) { - IElementType firstChildType = getFirstChild(rootNode); - //Todo: Add more conditions - return firstChildType != null && firstChildType != BallerinaTypes.DEFINITION - && firstChildType != BallerinaTypes.IMPORT_DECLARATION - && firstChildType != BallerinaTypes.NAMESPACE_DECLARATION; - } - - @Nullable - private static IElementType getFirstChild(ASTNode parent) { - ASTNode child = parent.getFirstChildNode(); - if (child == null) { - return null; - } - while (child.getElementType() == BallerinaTypes.LINE_COMMENT - || child.getElementType() == TokenType.WHITE_SPACE) { - child = child.getTreeNext(); - if (child == null) { - return null; - } - } - return child.getElementType(); - } - - // Note - In case of multiple matching rules, top rule is the one which will get applied. - private static SpacingBuilder createSpaceBuilder(CodeStyleSettings settings) { - return new SpacingBuilder(settings, BallerinaLanguage.INSTANCE) - // Keywords - .around(IMPORT).spaceIf(true) - .around(AS).spaceIf(true) - .around(PUBLIC).spaceIf(true) - .around(PRIVATE).spaceIf(true) - .around(REMOTE).spaceIf(true) - .around(CLIENT).spaceIf(true) - .around(RESOURCE).spaceIf(true) - .around(OBJECT).spaceIf(true) - .around(WORKER).spaceIf(true) - .around(XMLNS).spaceIf(true) - .around(RETURNS).spaceIf(true) - .around(VERSION).spaceIf(true) - .around(IS).spaceIf(true) - .around(TRAP).spaceIf(true) - .around(PANIC).spaceIf(true) - .around(FLUSH).spaceIf(true) - .around(WAIT).spaceIf(true) - - .around(ABORTED).spaceIf(true) - .around(COMMITTED).spaceIf(true) - .around(LISTENER).spaceIf(true) - .around(VAR).spaceIf(true) - .around(CONST).spaceIf(true) - .around(FINAL).spaceIf(true) - .around(IF).spaceIf(true) - .around(MATCH).spaceIf(true) - .around(ELSE).spaceIf(true) - .around(FOREACH).spaceIf(true) - .around(WHILE).spaceIf(true) - .before(CONTINUE).spaceIf(true) - .after(CONTINUE).spaceIf(false) - .around(BREAK).spaceIf(false) - .around(JOIN).spaceIf(true) - .around(ALL).spaceIf(true) // Todo - .around(TRY).spaceIf(true) - .around(CATCH).spaceIf(true) - .around(FINALLY).spaceIf(true) - .around(THROW).spaceIf(true) - .around(TRANSACTION).spaceIf(true) - .around(ABORT).spaceIf(false) - .around(FAIL).spaceIf(true) - .around(ONRETRY).spaceIf(true) - .around(RETRIES).spaceIf(true) - .around(WITH).spaceIf(true) - .around(IN).spaceIf(true) - .around(LOCK).spaceIf(true) - .around(START).spaceIf(true) - .around(CHECK).spaceIf(true) - - // Streaming keywords - .around(FROM).spaceIf(true) - .around(ON).spaceIf(true) - .around(SELECT).spaceIf(true) - .around(GROUP).spaceIf(true) - .around(BY).spaceIf(true) - .around(HAVING).spaceIf(true) - .around(ORDER).spaceIf(true) - .around(WHERE).spaceIf(true) - .around(FOLLOWED).spaceIf(true) - .around(FOR).spaceIf(true) - .around(WINDOW).spaceIf(true) - .around(EVENTS).spaceIf(true) - .around(EVERY).spaceIf(true) - .around(WITHIN).spaceIf(true) - .around(LAST).spaceIf(true) - .around(FIRST).spaceIf(true) - .around(SNAPSHOT).spaceIf(true) - .around(OUTPUT).spaceIf(true) - .around(INNER).spaceIf(true) - .around(OUTER).spaceIf(true) - .around(RIGHT).spaceIf(true) - .around(LEFT).spaceIf(true) - .around(FULL).spaceIf(true) - .around(UNIDIRECTIONAL).spaceIf(true) - .around(SECOND).spaceIf(true) - .around(MINUTE).spaceIf(true) - .around(HOUR).spaceIf(true) - .around(DAY).spaceIf(true) - .around(MONTH).spaceIf(true) - .around(YEAR).spaceIf(true) - .around(FOREVER).spaceIf(true) - - //Channel keyword - .between(CHANNEL, LT).spaceIf(false) - - // Common tokens - .before(COMMA).spaceIf(false) - .after(COMMA).spaceIf(true) - .around(SEMICOLON).spaceIf(false) - .after(LEFT_BRACKET).spaceIf(false) - .before(RIGHT_BRACKET).spaceIf(false) - .around(EQUAL_GT).spaceIf(true) - - // Record binding pattern - .around(ENTRY_BINDING_PATTERN).spaceIf(true) - .beforeInside(COMMA, ENTRY_BINDING_PATTERN).spaceIf(false) - .afterInside(COMMA, ENTRY_BINDING_PATTERN).spaceIf(true) - .beforeInside(COLON, FIELD_BINDING_PATTERN).spaceIf(false) - .afterInside(COLON, FIELD_BINDING_PATTERN).spaceIf(true) - .between(LEFT_BRACE, REST_BINDING_PATTERN).spaceIf(true) - .between(REST_BINDING_PATTERN, RIGHT_BRACE).spaceIf(true) - .betweenInside(ELLIPSIS, IDENTIFIER, REST_BINDING_PATTERN).spaceIf(false) // Todo - Verify - - .around(RECORD_REF_BINDING_PATTERN).spaceIf(true) - .around(ENTRY_REF_BINDING_PATTERN).spaceIf(true) - .beforeInside(COMMA, ENTRY_REF_BINDING_PATTERN).spaceIf(false) - .afterInside(COMMA, ENTRY_REF_BINDING_PATTERN).spaceIf(true) - .beforeInside(COLON, FIELD_REF_BINDING_PATTERN).spaceIf(false) - .afterInside(COLON, FIELD_REF_BINDING_PATTERN).spaceIf(true) - .between(LEFT_BRACE, REST_REF_BINDING_PATTERN).spaceIf(true) - .between(REST_REF_BINDING_PATTERN, RIGHT_BRACE).spaceIf(true) - .betweenInside(ELLIPSIS, VARIABLE_REFERENCE, REST_REF_BINDING_PATTERN).spaceIf(false) // Todo - Verify - - // Ternary Expressions - .aroundInside(QUESTION_MARK, TERNARY_EXPRESSION).spaceIf(true) - .aroundInside(COLON, TERNARY_EXPRESSION).spaceIf(true) - - .between(LEFT_PARENTHESIS, RIGHT_PARENTHESIS).spaceIf(false) - .around(RETURN_PARAMETER).spaceIf(true) - .between(SIMPLE_TYPE_NAME, IDENTIFIER).spaceIf(true) - .between(SIMPLE_TYPE_NAME, EQUAL_GT).spaceIf(true) - .after(ANNOTATION_ATTACHMENT).spaceIf(true) - .between(FUNCTION, SIMPLE_TYPE_NAME).spaceIf(true) - .between(FUNCTION, LEFT_PARENTHESIS).spaceIf(true) - .around(SIMPLE_TYPE_NAME).spaceIf(false) - .between(NAME_REFERENCE, RECORD_LITERAL).spaceIf(true) - .around(NAME_REFERENCE).spaceIf(false) - - .between(UNION_TYPE_NAME, IDENTIFIER).spaceIf(true) - .between(FUNCTION_NAME_REFERENCE, LEFT_PARENTHESIS).spaceIf(false) - - .around(UNION_TYPE_NAME).spaceIf(false) - .between(TUPLE_TYPE_NAME, IDENTIFIER).spaceIf(true) - .around(TUPLE_TYPE_NAME).spaceIf(false) - .between(PARAMETER, ASSIGN).spaceIf(true) - .around(PARAMETER).spaceIf(false) - - .aroundInside(DIV, IMPORT_DECLARATION).spaceIf(false) - .aroundInside(DOT, COMPLETE_PACKAGE_NAME).spaceIf(false) - .aroundInside(COLON, PACKAGE_REFERENCE).spaceIf(false) - .afterInside(IDENTIFIER, CALLABLE_UNIT_SIGNATURE).spaceIf(false) - .aroundInside(DOT, FUNCTION_DEFINITION).spaceIf(false) - .around(CALLABLE_UNIT_SIGNATURE).spaceIf(true) - .after(PACKAGE_REFERENCE).spaceIf(false) - .aroundInside(NAME_REFERENCE, FUNCTION_INVOCATION).spaceIf(false) - .around(INVOCATION_ARG_LIST).spaceIf(false) - .before(CALLABLE_UNIT_BODY).spaceIf(true) - - .before(NEW).spaceIf(true) - .between(NEW, SEMICOLON).spaceIf(false) - .between(NEW, LEFT_PARENTHESIS).spaceIf(false) - .after(NEW).spaceIf(true) - - // Record Literals - .beforeInside(COLON, RECORD_KEY_VALUE).spaceIf(false) - .afterInside(COLON, RECORD_KEY_VALUE).spaceIf(true) - .beforeInside(COMMA, RECORD_LITERAL).spaceIf(false) - .afterInside(COMMA, RECORD_LITERAL).spaceIf(true) - .between(RECORD_KEY_VALUE, RIGHT_BRACE).spaceIf(false) - .between(LEFT_BRACE, RIGHT_BRACE).spaceIf(false) - .around(RECORD_LITERAL_BODY).spaceIf(true) - - // Statements - .beforeInside(LEFT_BRACE, FOREACH_STATEMENT).spaceIf(true) - .between(LEFT_BRACE, RIGHT_BRACE).spaceIf(false) - .between(LEFT_BRACKET, RIGHT_BRACKET).spaceIf(false) - .between(SIMPLE_VARIABLE_REFERENCE, ASSIGN).spaceIf(true) - .between(SIMPLE_VARIABLE_REFERENCE, SAFE_ASSIGNMENT).spaceIf(true) - .between(SIMPLE_VARIABLE_REFERENCE, COMPOUND_OPERATOR).spaceIf(true) - .between(SIMPLE_VARIABLE_REFERENCE, WHERE_CLAUSE).spaceIf(true) - .between(SIMPLE_VARIABLE_REFERENCE, WINDOW_CLAUSE).spaceIf(true) - .after(SIMPLE_VARIABLE_REFERENCE).spaceIf(false) - .aroundInside(DOT, INVOCATION).spaceIf(false) - .between(INVOCATION_ARG, COMMA).spaceIf(false) - .between(ANY_IDENTIFIER_NAME, LEFT_PARENTHESIS).spaceIf(false) - .between(EXPRESSION_LIST, LARROW).spaceIf(true) - .between(EXPRESSION_LIST, SERVICE_BODY).spaceIf(true) - .around(EXPRESSION_LIST).spaceIf(false) - .between(ARRAY_TYPE_NAME, IDENTIFIER).spaceIf(true) - .aroundInside(GT, TYPE_CONVERSION_EXPRESSION).spaceIf(false) - .after(LEFT_PARENTHESIS).spaceIf(false) - .before(RIGHT_PARENTHESIS).spaceIf(false) - - .between(ADD, INTEGER_LITERAL).spaceIf(false) - .between(SUB, INTEGER_LITERAL).spaceIf(false) - .between(ADD, FLOATING_POINT_LITERAL).spaceIf(false) - .between(SUB, FLOATING_POINT_LITERAL).spaceIf(false) - - .between(SERVICE, IDENTIFIER).spaceIf(true) - .before(SERVICE_BODY).spaceIf(true) - .between(SERVICE, LT).spaceIf(false) - - .between(ANNOTATION, LT).spaceIf(false) - .between(FUNCTION, LT).spaceIf(false) - .between(FUTURE, LT).spaceIf(false) - .between(JSON, LT).spaceIf(false) - .between(MAP, LT).spaceIf(false) - .between(STREAM, LT).spaceIf(false) - .between(TABLE, LT).spaceIf(false) - - .around(PIPE).spaceIf(false) - .between(NULLABLE_TYPE_NAME, IDENTIFIER).spaceIf(true) - .between(NULLABLE_TYPE_NAME, EQUAL_GT).spaceIf(true) - .around(NULLABLE_TYPE_NAME).spaceIf(false) - - .around(PARAMETER_LIST).spaceIf(false) - - .before(CATCH_CLAUSE).spaceIf(true) - .before(CATCH_CLAUSES).spaceIf(true) - .before(FINALLY_CLAUSE).spaceIf(true) - - .before(ELSE_IF_CLAUSE).spaceIf(true) - .before(ELSE_CLAUSE).spaceIf(true) - - .before(ON_RETRY_CLAUSE).spaceIf(true) - - .betweenInside(DOT, MUL, FIELD).spaceIf(false) - - .around(DECIMAL_INTEGER_LITERAL).spaceIf(false) - - //ELLIPSIS operator - .between(ELLIPSIS, VARIABLE_REFERENCE_EXPRESSION).spaceIf(false) - .between(EXPRESSION, ELLIPSIS).spaceIf(false) - .between(ELLIPSIS, EXPRESSION).spaceIf(false) - .between(SIMPLE_LITERAL_EXPRESSION, ELLIPSIS).spaceIf(false) - .between(ELLIPSIS, SIMPLE_LITERAL_EXPRESSION).spaceIf(false) - .betweenInside(ELLIPSIS, IDENTIFIER, REST_PARAMETER).spaceIf(true) - - .before(INDEX).spaceIf(false) - - .between(VARIABLE_REFERENCE_EXPRESSION, MATCH_STATEMENT_BODY).spaceIf(true) - - .between(RETURN, SEMICOLON).spaceIf(false) - .after(RETURN).spaceIf(true) - .around(RANGE).spaceIf(false) - - .around(OBJECT_BODY).spaceIf(true) - .around(FIELD_DEFINITION).spaceIf(true) - - .around(ANNOTATION_ATTACHMENT).spaceIf(true) - .around(ATTACHMENT_POINT).spaceIf(false) - - .betweenInside(ADD, VARIABLE_REFERENCE_EXPRESSION, UNARY_EXPRESSION).spaceIf(false) - .betweenInside(SUB, VARIABLE_REFERENCE_EXPRESSION, UNARY_EXPRESSION).spaceIf(false) - - .between(FORK, SEMICOLON).spaceIf(false) - .around(FORK).spaceIf(true) - - .between(TYPE, IDENTIFIER).spaceIf(true) - - .between(IDENTIFIER, FINITE_TYPE).spaceIf(true) - - .around(ARRAY_TYPE_NAME).spaceIf(false) - - .around(TRANSACTION_PROPERTY_INIT_STATEMENT_LIST).spaceIf(true) - .between(TRANSACTION_CLAUSE, COMMITTED_ABORTED_CLAUSES).spaceIf(true) - .between(ABORTED_CLAUSE, COMMITTED_CLAUSE).spaceIf(true) - .between(COMMITTED_CLAUSE, ABORTED_CLAUSE).spaceIf(true) - - // Streaming - .before(WHERE_CLAUSE).spaceIf(true) - .before(WINDOW_CLAUSE).spaceIf(true) - .around(INT_RANGE_EXPRESSION).spaceIf(true) - .betweenInside(DOT, IDENTIFIER, FIELD).spaceIf(false) - .betweenInside(NOT, IDENTIFIER, FIELD).spaceIf(false) - .before(FIELD).spaceIf(false) - - // Unary Expressions - .after(BIT_COMPLEMENT).spaceIf(false) - .between(NOT, VARIABLE_REFERENCE_EXPRESSION).spaceIf(false) - - // Operators - .around(ASSIGN).spaceIf(true) - .around(ADD).spaceIf(true) - .around(SUB).spaceIf(true) - .around(DIV).spaceIf(true) - .around(MUL).spaceIf(true) - .around(POW).spaceIf(true) - .around(MOD).spaceIf(true) - - .around(HALF_OPEN_RANGE).spaceIf(false) - - .around(EQUAL).spaceIf(true) - .around(NOT_EQUAL).spaceIf(true) - .around(REF_EQUAL).spaceIf(true) - .around(REF_NOT_EQUAL).spaceIf(true) - .around(GT).spaceIf(true) - .around(LT).spaceIf(true) - .around(GT_EQUAL).spaceIf(true) - .around(LT_EQUAL).spaceIf(true) - .around(AND).spaceIf(true) - .around(OR).spaceIf(true) - - //Workers - .aroundInside(RARROW, ACTION_INVOCATION).spaceIf(false) - .between(IDENTIFIER, WORKER_BODY).spaceIf(true) - .between(EXPRESSION_LIST, RARROW).spaceIf(true) - .aroundInside(RARROW, WORKER_SEND_ASYNC_STATEMENT).spaceIf(true) - .aroundInside(SYNCRARROW, WORKER_SEND_SYNC_EXPRESSION).spaceIf(false) - .afterInside(LARROW, WORKER_RECEIVE_EXPRESSION).spaceIf(false) - .between(LEFT_BRACE, WAIT_KEY_VALUE).spaceIf(true) - .between(WAIT_KEY_VALUE, RIGHT_BRACE).spaceIf(true) - .around(RARROW).spaceIf(false) - - .around(LARROW).spaceIf(true) - .around(ELVIS).spaceIf(true) - - .around(COMPOUND_OPERATOR).spaceIf(true) - - .around(SAFE_ASSIGNMENT).spaceIf(true) - - .around(STATEMENT).lineBreakOrForceSpace(true, true) - - .betweenInside(RIGHT_PARENTHESIS, LEFT_BRACE, IF_CLAUSE).spaceIf(true) - .betweenInside(RIGHT_PARENTHESIS, LEFT_BRACE, ELSE_IF_CLAUSE).spaceIf(true) - .betweenInside(RIGHT_PARENTHESIS, LEFT_BRACE, CATCH_CLAUSE).spaceIf(true) - - .betweenInside(EXPRESSION, LEFT_BRACE, IF_CLAUSE).spaceIf(true) - .betweenInside(SIMPLE_LITERAL_EXPRESSION, LEFT_BRACE, IF_CLAUSE).spaceIf(true) - .betweenInside(EXPRESSION, LEFT_BRACE, ELSE_IF_CLAUSE).spaceIf(true) - .betweenInside(SIMPLE_LITERAL_EXPRESSION, LEFT_BRACE, ELSE_IF_CLAUSE).spaceIf(true) - - .before(WHILE_STATEMENT_BODY).spaceIf(true) - .between(EXPRESSION, WHILE_STATEMENT_BODY).spaceIf(true) - .between(SIMPLE_LITERAL_EXPRESSION, WHILE_STATEMENT_BODY).spaceIf(true) - - ; - } - - @Nullable - @Override - public TextRange getRangeAffectingIndent(PsiFile file, int offset, ASTNode elementAtOffset) { - return null; - } -} From 64b24ef3c805d6759338ae1ba8ad542e8e0fc2e2 Mon Sep 17 00:00:00 2001 From: pahans Date: Sun, 13 Oct 2019 23:29:40 +0530 Subject: [PATCH 005/167] Refactor variable types/values --- .../debugadapter/JBallerinaDebugServer.java | 4 +- .../debugadapter/variable/Variable.java | 20 -- .../variable/VariableFactory.java | 171 ++++-------------- .../debugadapter/variable/VariableImpl.java | 4 + .../debugadapter/variable/types/BArray.java | 20 +- .../debugadapter/variable/types/BBoolean.java | 48 +++++ .../debugadapter/variable/types/BDouble.java | 48 +++++ .../debugadapter/variable/types/BError.java | 54 ++++++ .../debugadapter/variable/types/BLong.java | 48 +++++ .../variable/types/BMapObject.java | 88 +++++++++ .../variable/types/BObjectType.java | 45 +++++ .../variable/types/BObjectValue.java | 55 ++++++ .../debugadapter/variable/types/BString.java | 25 ++- 13 files changed, 468 insertions(+), 162 deletions(-) delete mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BBoolean.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BDouble.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BError.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BLong.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BMapObject.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectType.java create mode 100644 misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectValue.java diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java index e07d59c45473..0d82cacccdb4 100755 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/JBallerinaDebugServer.java @@ -373,8 +373,8 @@ public CompletableFuture variables(VariablesArguments args) { return null; } - VariableImpl variable = new VariableFactory().getVariable(localVariableValueEntry.getValue(), - varType, name); + VariableImpl variable = new VariableFactory() + .getVariable(localVariableValueEntry.getValue(), varType, name); if (variable != null && variable.getChildVariables() != null) { long variableReference = (long) nextVarReference.getAndIncrement(); variable.getDapVariable().setVariablesReference(variableReference); diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java deleted file mode 100644 index a5924e41e556..000000000000 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/Variable.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.ballerinalang.debugadapter.variable; - -public interface Variable { -} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java index 7a4a8493f23f..d58e68a6e278 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableFactory.java @@ -16,27 +16,23 @@ package org.ballerinalang.debugadapter.variable; -import com.sun.jdi.ArrayReference; -import com.sun.jdi.Field; import com.sun.jdi.Value; -import com.sun.tools.jdi.ObjectReferenceImpl; -import org.ballerinalang.debugadapter.VariableUtils; import org.ballerinalang.debugadapter.variable.types.BArray; +import org.ballerinalang.debugadapter.variable.types.BBoolean; +import org.ballerinalang.debugadapter.variable.types.BDouble; +import org.ballerinalang.debugadapter.variable.types.BError; +import org.ballerinalang.debugadapter.variable.types.BLong; +import org.ballerinalang.debugadapter.variable.types.BMapObject; +import org.ballerinalang.debugadapter.variable.types.BObjectType; +import org.ballerinalang.debugadapter.variable.types.BObjectValue; import org.ballerinalang.debugadapter.variable.types.BString; import org.eclipse.lsp4j.debug.Variable; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - /** * Variable factory. */ public class VariableFactory { - public VariableImpl getVariable(Value value, String varType, String varName) { + public VariableImpl getVariable(Value value, String parentVarType, String varName) { VariableImpl variable = new VariableImpl(); Variable dapVariable = new Variable(); variable.setDapVariable(dapVariable); @@ -46,12 +42,12 @@ public VariableImpl getVariable(Value value, String varType, String varName) { return null; } - if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(varType)) { + if ("org.ballerinalang.jvm.values.ArrayValue".equalsIgnoreCase(parentVarType)) { variable = new BArray(value, dapVariable); return variable; - } else if ("java.lang.Object".equalsIgnoreCase(varType) - || "org.ballerinalang.jvm.values.MapValue".equalsIgnoreCase(varType) - || "org.ballerinalang.jvm.values.MapValueImpl".equalsIgnoreCase(varType) // for nested json arrays + } else if ("java.lang.Object".equalsIgnoreCase(parentVarType) + || "org.ballerinalang.jvm.values.MapValue".equalsIgnoreCase(parentVarType) + || "org.ballerinalang.jvm.values.MapValueImpl".equalsIgnoreCase(parentVarType) // for nested json arrays ) { // JSONs dapVariable.setType("Object"); @@ -63,31 +59,21 @@ public VariableImpl getVariable(Value value, String varType, String varName) { // JSON array variable = new BArray(value, dapVariable); return variable; - } else if ("java.lang.Long".equalsIgnoreCase(value.type().name()) - || "java.lang.Boolean".equalsIgnoreCase(value.type().name()) - || "java.lang.Double".equalsIgnoreCase(value.type().name())) { - // anydata - Field valueField = ((ObjectReferenceImpl) value).referenceType().allFields().stream().filter( - field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); - Value longValue = ((ObjectReferenceImpl) value).getValue(valueField); - dapVariable.setType(varType.split("\\.")[2]); - dapVariable.setValue(longValue.toString()); + } else if ("java.lang.Long".equalsIgnoreCase(value.type().name())) { + variable = new BLong(value, dapVariable); + return variable; + } else if ("java.lang.Boolean".equalsIgnoreCase(value.type().name())) { + variable = new BBoolean(value, dapVariable); + return variable; + } else if ("java.lang.Double".equalsIgnoreCase(value.type().name())) { + variable = new BDouble(value, dapVariable); return variable; } else if ("java.lang.String".equalsIgnoreCase(value.type().name())) { // union variable = new BString(value, dapVariable); return variable; } else if ("org.ballerinalang.jvm.values.ErrorValue".equalsIgnoreCase(value.type().name())) { - - List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); - - Field valueField = fields.stream().filter(field -> - field.name().equals("reason")) - .collect(Collectors.toList()).get(0); - - Value error = ((ObjectReferenceImpl) value).getValue(valueField); - dapVariable.setType("BError"); - dapVariable.setValue(error.toString()); + variable = new BError(value, dapVariable); return variable; } else if ("org.ballerinalang.jvm.values.XMLItem".equalsIgnoreCase(value.type().name())) { // TODO: support xml values @@ -95,113 +81,32 @@ public VariableImpl getVariable(Value value, String varType, String varName) { dapVariable.setValue(value.toString()); return variable; } else { - dapVariable.setType("Object"); - List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); - - Optional valueField = fields.stream().filter(field -> - field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); - if (!valueField.isPresent()) { - return variable; - } - Value jsonValue = ((ObjectReferenceImpl) value).getValue(valueField.get()); - String stringValue = jsonValue == null ? "null" : "Object"; - if (jsonValue == null) { - dapVariable.setValue(stringValue); - return variable; - } - Map values = new HashMap<>(); - ((ArrayReference) jsonValue).getValues().stream().filter(Objects::nonNull).forEach(jsonMap -> { - List jsonValueFields = ((ObjectReferenceImpl) jsonMap).referenceType().visibleFields(); - Optional jsonKeyField = jsonValueFields.stream().filter(field -> - field.name().equals("key")).findFirst(); - - Optional jsonValueField = jsonValueFields.stream().filter(field -> - field.name().equals("value")).findFirst(); - - if (jsonKeyField.isPresent() && jsonValueField.isPresent()) { - Value jsonKey = ((ObjectReferenceImpl) jsonMap).getValue(jsonKeyField.get()); - Value jsonValue1 = ((ObjectReferenceImpl) jsonMap).getValue(jsonValueField.get()); - values.put(jsonKey.toString(), jsonValue1); - } - }); - variable.setChildVariables(values); - dapVariable.setValue(stringValue); + variable = new BMapObject(value, dapVariable); return variable; } - } else if ("org.ballerinalang.jvm.values.ObjectValue".equalsIgnoreCase(varType)) { - Map fieldValueMap = ((ObjectReferenceImpl) value) - .getValues(((ObjectReferenceImpl) value).referenceType().allFields()); - Map values = new HashMap<>(); - fieldValueMap.forEach((field, value1) -> { - // Filter out internal variables - if (!field.name().startsWith("$") && !field.name().startsWith("nativeData")) { - values.put(field.name(), value1); - } - }); - - variable.setChildVariables(values); - dapVariable.setType("Object"); - dapVariable.setValue("Object"); + } else if ("org.ballerinalang.jvm.values.ObjectValue".equalsIgnoreCase(parentVarType)) { + variable = new BObjectValue(value, dapVariable); return variable; - } else if ("java.lang.Long".equalsIgnoreCase(varType) || "java.lang.Boolean".equalsIgnoreCase(varType) - || "java.lang.Double".equalsIgnoreCase(varType)) { - Field valueField = ((ObjectReferenceImpl) value).referenceType().allFields().stream().filter( - field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); - Value longValue = ((ObjectReferenceImpl) value).getValue(valueField); - dapVariable.setType(varType.split("\\.")[2]); - dapVariable.setValue(longValue.toString()); + } else if ("java.lang.Long".equalsIgnoreCase(value.type().name())) { + variable = new BLong(value, dapVariable); return variable; - } else if ("java.lang.String".equalsIgnoreCase(varType)) { + } else if ("java.lang.Boolean".equalsIgnoreCase(value.type().name())) { + variable = new BBoolean(value, dapVariable); + return variable; + } else if ("java.lang.Double".equalsIgnoreCase(value.type().name())) { + variable = new BDouble(value, dapVariable); + return variable; + } else if ("java.lang.String".equalsIgnoreCase(parentVarType)) { variable = new BString(value, dapVariable); return variable; - } else if (varType.contains("$value$")) { - // Record type - String stringValue = value.type().name(); - - List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); - - Optional valueField = fields.stream().filter(field -> - field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); - - if (!valueField.isPresent()) { - dapVariable.setValue(stringValue); - return variable; - } - Value jsonValue = ((ObjectReferenceImpl) value).getValue(valueField.get()); - - Map values = new HashMap<>(); - ((ArrayReference) jsonValue).getValues().stream().filter(Objects::nonNull).forEach(jsonMap -> { - List jsonValueFields = ((ObjectReferenceImpl) jsonMap).referenceType().visibleFields(); - - - Optional jsonKeyField = jsonValueFields.stream().filter(field -> - field.name().equals("key")).findFirst(); - - - Optional jsonValueField = jsonValueFields.stream().filter(field -> - field.name().equals("value")).findFirst(); - - if (jsonKeyField.isPresent() && jsonValueField.isPresent()) { - Value jsonKey = ((ObjectReferenceImpl) jsonMap).getValue(jsonKeyField.get()); - Value jsonValue1 = ((ObjectReferenceImpl) jsonMap).getValue(jsonValueField.get()); - values.put(jsonKey.toString(), jsonValue1); - } - }); - - variable.setChildVariables(values); - stringValue = stringValue.replace("$value$", ""); - dapVariable.setType(stringValue); - dapVariable.setValue(stringValue); + } else if (parentVarType.contains("$value$")) { + variable = new BMapObject(value, dapVariable); return variable; - } else if ("org.ballerinalang.jvm.types.BObjectType".equalsIgnoreCase(varType)) { - Value typeName = ((ObjectReferenceImpl) value) - .getValue(((ObjectReferenceImpl) value).referenceType().fieldByName("typeName")); - dapVariable.setType(varType); - String stringValue = typeName.toString(); - dapVariable.setValue(stringValue); + } else if ("org.ballerinalang.jvm.types.BObjectType".equalsIgnoreCase(parentVarType)) { + variable = new BObjectType(value, dapVariable); return variable; } else { - dapVariable.setType(varType); + dapVariable.setType(parentVarType); String stringValue = value.toString(); dapVariable.setValue(stringValue); return variable; diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java index fe2e4cba0610..318bfbaa7994 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/VariableImpl.java @@ -21,6 +21,10 @@ import java.util.Map; + +/** + * Variable class for internal use of debug adapter. + */ public class VariableImpl { private Map childVariables; Variable dapVariable; diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java index d52c5cbc038e..d7b72bee591c 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BArray.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.ballerinalang.debugadapter.variable.types; import com.sun.jdi.Field; @@ -11,7 +27,9 @@ import java.util.List; import java.util.Map; import java.util.stream.Collectors; - +/** + * Array variable type. + */ public class BArray extends VariableImpl { private final ObjectReferenceImpl value; diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BBoolean.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BBoolean.java new file mode 100644 index 000000000000..c5edecfda68b --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BBoolean.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.Field; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.stream.Collectors; + +/** + * Boolean variable type. + */ +public class BBoolean extends VariableImpl { + + private final ObjectReferenceImpl value; + + public BBoolean(Value value, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.setDapVariable(dapVariable); + dapVariable.setType("double"); + dapVariable.setValue(this.toString()); + } + + @Override + public String toString() { + Field valueField = value.referenceType().allFields().stream().filter( + field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); + Value longValue = value.getValue(valueField); + return longValue.toString(); + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BDouble.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BDouble.java new file mode 100644 index 000000000000..f93ec25f1c68 --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BDouble.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.Field; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.stream.Collectors; + +/** + * Double variable type. + */ +public class BDouble extends VariableImpl { + + private final ObjectReferenceImpl value; + + public BDouble(Value value, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.setDapVariable(dapVariable); + dapVariable.setType("double"); + dapVariable.setValue(this.toString()); + } + + @Override + public String toString() { + Field valueField = value.referenceType().allFields().stream().filter( + field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); + Value longValue = value.getValue(valueField); + return longValue.toString(); + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BError.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BError.java new file mode 100644 index 000000000000..2fefb525e5de --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BError.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.Field; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * error type. + */ +public class BError extends VariableImpl { + + private final ObjectReferenceImpl value; + + public BError(Value value, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.setDapVariable(dapVariable); + dapVariable.setType("error"); + dapVariable.setValue(this.toString()); + } + + @Override + public String toString() { + List fields = value.referenceType().allFields(); + + Field valueField = fields.stream().filter(field -> + field.name().equals("reason")) + .collect(Collectors.toList()).get(0); + + Value error = value.getValue(valueField); + + return error.toString(); + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BLong.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BLong.java new file mode 100644 index 000000000000..e9785e1067c4 --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BLong.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.Field; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.stream.Collectors; + +/** + * long variable type. + */ +public class BLong extends VariableImpl { + + private final ObjectReferenceImpl value; + + public BLong(Value value, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.setDapVariable(dapVariable); + dapVariable.setType("long"); + dapVariable.setValue(this.toString()); + } + + @Override + public String toString() { + Field valueField = value.referenceType().allFields().stream().filter( + field -> "value".equals(field.name())).collect(Collectors.toList()).get(0); + Value longValue = value.getValue(valueField); + return longValue.toString(); + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BMapObject.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BMapObject.java new file mode 100644 index 000000000000..ecaae5a12baf --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BMapObject.java @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.ArrayReference; +import com.sun.jdi.Field; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + + +/** + * json/map variable type. + */ +public class BMapObject extends VariableImpl { + + private final ObjectReferenceImpl value; + + public BMapObject(Value value, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.setDapVariable(dapVariable); + + List fields = ((ObjectReferenceImpl) value).referenceType().allFields(); + dapVariable.setType("object"); + dapVariable.setValue(this.toString()); + + Optional valueField = fields.stream().filter(field -> + field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); + + if (!valueField.isPresent()) { + return; + } + Value jsonValue = ((ObjectReferenceImpl) value).getValue(valueField.get()); + + Map values = new HashMap<>(); + ((ArrayReference) jsonValue).getValues().stream().filter(Objects::nonNull).forEach(jsonMap -> { + List jsonValueFields = ((ObjectReferenceImpl) jsonMap).referenceType().visibleFields(); + Optional jsonKeyField = jsonValueFields.stream().filter(field -> + field.name().equals("key")).findFirst(); + + Optional jsonValueField = jsonValueFields.stream().filter(field -> + field.name().equals("value")).findFirst(); + + if (jsonKeyField.isPresent() && jsonValueField.isPresent()) { + Value jsonKey = ((ObjectReferenceImpl) jsonMap).getValue(jsonKeyField.get()); + Value jsonValue1 = ((ObjectReferenceImpl) jsonMap).getValue(jsonValueField.get()); + values.put(jsonKey.toString(), jsonValue1); + } + }); + this.setChildVariables(values); + } + + @Override + public String toString() { + List fields = value.referenceType().allFields(); + Optional valueField = fields.stream().filter(field -> + field.typeName().equals("java.util.HashMap$Node[]")).findFirst(); + if (!valueField.isPresent()) { + return "null"; + } + Value jsonValue = value.getValue(valueField.get()); + if (jsonValue == null) { + return "null"; + } + return "object"; + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectType.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectType.java new file mode 100644 index 000000000000..dd35f54f052c --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectType.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + + +/** + * object type. + */ +public class BObjectType extends VariableImpl { + + private final ObjectReferenceImpl value; + + public BObjectType(Value value, Variable dapVariable) { + this.value = (ObjectReferenceImpl) value; + this.setDapVariable(dapVariable); + dapVariable.setType("object"); + dapVariable.setValue(this.toString()); + } + + @Override + public String toString() { + Value typeName = ((ObjectReferenceImpl) value) + .getValue(((ObjectReferenceImpl) value).referenceType().fieldByName("typeName")); + return typeName.toString(); + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectValue.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectValue.java new file mode 100644 index 000000000000..1e9089465a5b --- /dev/null +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BObjectValue.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ballerinalang.debugadapter.variable.types; + +import com.sun.jdi.Field; +import com.sun.jdi.Value; +import com.sun.tools.jdi.ObjectReferenceImpl; +import org.ballerinalang.debugadapter.variable.VariableImpl; +import org.eclipse.lsp4j.debug.Variable; + +import java.util.HashMap; +import java.util.Map; + + +/** + * object value type. + */ +public class BObjectValue extends VariableImpl { + + public BObjectValue(Value value, Variable dapVariable) { + this.setDapVariable(dapVariable); + Map fieldValueMap = ((ObjectReferenceImpl) value) + .getValues(((ObjectReferenceImpl) value).referenceType().allFields()); + Map values = new HashMap<>(); + fieldValueMap.forEach((field, value1) -> { + // Filter out internal variables + if (!field.name().startsWith("$") && !field.name().startsWith("nativeData")) { + values.put(field.name(), value1); + } + }); + + this.setChildVariables(values); + dapVariable.setType("object"); + dapVariable.setValue(this.toString()); + } + + @Override + public String toString() { + return "object"; + } +} diff --git a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java index ff63af38594e..e680847ef42a 100644 --- a/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java +++ b/misc/debug-adapter/src/main/java/org/ballerinalang/debugadapter/variable/types/BString.java @@ -1,17 +1,30 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://wso2.com) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.ballerinalang.debugadapter.variable.types; -import com.sun.jdi.Field; -import com.sun.jdi.IntegerValue; import com.sun.jdi.Value; import com.sun.tools.jdi.ObjectReferenceImpl; -import org.ballerinalang.debugadapter.VariableUtils; import org.ballerinalang.debugadapter.variable.VariableImpl; import org.eclipse.lsp4j.debug.Variable; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; +/** + * string type. + */ public class BString extends VariableImpl { private final ObjectReferenceImpl value; From e01f0969becf5b81742d3c80d2c4c8e41ad1f0d8 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Wed, 16 Oct 2019 13:57:34 +0530 Subject: [PATCH 006/167] Rename binding pattern type BBEs --- .../error_type_binding_pattern.bal | 52 --------------- .../error_type_binding_pattern.description | 2 - .../error_type_binding_pattern.out | 10 --- .../tests/error_type_binding_pattern.bal | 29 --------- examples/index.json | 10 +-- .../record_type_binding_pattern.bal | 64 ------------------- .../record_type_binding_pattern.description | 2 - .../record_type_binding_pattern.out | 13 ---- .../tests/record_type_binding_pattern.bal | 33 ---------- .../tests/tuple_type_binding_pattern_test.bal | 43 ------------- .../tuple_type_binding_pattern.bal | 35 ---------- .../tuple_type_binding_pattern.description | 3 - .../tuple_type_binding_pattern.out | 9 --- 13 files changed, 5 insertions(+), 300 deletions(-) delete mode 100644 examples/error-type-binding-pattern/error_type_binding_pattern.bal delete mode 100644 examples/error-type-binding-pattern/error_type_binding_pattern.description delete mode 100644 examples/error-type-binding-pattern/error_type_binding_pattern.out delete mode 100644 examples/error-type-binding-pattern/tests/error_type_binding_pattern.bal delete mode 100644 examples/record-type-binding-pattern/record_type_binding_pattern.bal delete mode 100644 examples/record-type-binding-pattern/record_type_binding_pattern.description delete mode 100644 examples/record-type-binding-pattern/record_type_binding_pattern.out delete mode 100644 examples/record-type-binding-pattern/tests/record_type_binding_pattern.bal delete mode 100644 examples/tuple-type-binding-pattern/tests/tuple_type_binding_pattern_test.bal delete mode 100644 examples/tuple-type-binding-pattern/tuple_type_binding_pattern.bal delete mode 100644 examples/tuple-type-binding-pattern/tuple_type_binding_pattern.description delete mode 100644 examples/tuple-type-binding-pattern/tuple_type_binding_pattern.out diff --git a/examples/error-type-binding-pattern/error_type_binding_pattern.bal b/examples/error-type-binding-pattern/error_type_binding_pattern.bal deleted file mode 100644 index 9ecbd6bb2996..000000000000 --- a/examples/error-type-binding-pattern/error_type_binding_pattern.bal +++ /dev/null @@ -1,52 +0,0 @@ -import ballerina/io; - -type SampleErrorData record { - string message?; - error cause?; - string info; - boolean fatal; -}; - -type SampleError error; - -public function main() { - // This error-type binding pattern will destructure an `error` of the type `SampleError`, and create two variables as follows: - // The value of the reason string in the`SampleError` will be set to a new `string` variable `reason`. - // The values in the detail mapping will be set to new variables `info` and `fatal`. - var error(reason, info = info, fatal = fatal) = getSampleError(); - io:println("Reason String: " + reason); - io:println("Info: ", info); - io:println("Fatal: ", fatal); - - // The detail mapping can also be destructured using a rest parameter. - // `params` will be of the type `map`, and will have the - // `info` and `fatal` fields. - var error(reasonTwo, ...params) = getSampleError(); - io:println("Reason String: ", reasonTwo); - io:println("Detail Mapping: ", params); - - // When some error detail field names are provided rest parameter will only contain detail field that are not matched. - var error(reasonThree, info=info2, ...filteredParams) = getSampleError(); - io:println("Detail Mapping: ", filteredParams); - - // The underscore '_' sign can be used to ignore either the reason string or the detail mapping. - var error(_, detailMsg = detailMsg, isFatal = isFatal) = getRecordConstrainedError(); - io:println("Detail Message: ", detailMsg); -} - -function getSampleError() returns SampleError { - SampleError e = error("Sample Error", info = "Detail Msg", fatal = true); - return e; -} - -type Foo record {| - string message?; - error cause?; - string detailMsg; - boolean isFatal; -|}; - -function getRecordConstrainedError() returns error { - error e = error("Some Error", detailMsg = "Failed Message", isFatal = true); - return e; -} diff --git a/examples/error-type-binding-pattern/error_type_binding_pattern.description b/examples/error-type-binding-pattern/error_type_binding_pattern.description deleted file mode 100644 index 712c9b504bea..000000000000 --- a/examples/error-type-binding-pattern/error_type_binding_pattern.description +++ /dev/null @@ -1,2 +0,0 @@ -// Error-type binding patterns are used in declaring and defining new variables by destructuring an `error` value. -// The error-type binding pattern statement must have an assignment expression on the right hand side. diff --git a/examples/error-type-binding-pattern/error_type_binding_pattern.out b/examples/error-type-binding-pattern/error_type_binding_pattern.out deleted file mode 100644 index 6615f3dfc3ef..000000000000 --- a/examples/error-type-binding-pattern/error_type_binding_pattern.out +++ /dev/null @@ -1,10 +0,0 @@ -# To run this sample, navigate to the directory that contains the -# `.bal` file, and execute the `ballerina run` command. -$ ballerina run error_type_binding_pattern.bal -Reason String: Sample Error -Info: Detail Msg -Fatal: true -Reason String: Sample Error -Detail Mapping: info=Detail Msg fatal=true -Detail Mapping: fatal=true -Detail Message: Failed Message diff --git a/examples/error-type-binding-pattern/tests/error_type_binding_pattern.bal b/examples/error-type-binding-pattern/tests/error_type_binding_pattern.bal deleted file mode 100644 index eba8edbe38ed..000000000000 --- a/examples/error-type-binding-pattern/tests/error_type_binding_pattern.bal +++ /dev/null @@ -1,29 +0,0 @@ -import ballerina/io; -import ballerina/test; - -any[] outputs = []; -int counter = 0; - -// This is the mock function which will replace the real function -@test:Mock { - moduleName: "ballerina/io", - functionName: "println" -} -public function mockPrint(any... s) { - outputs[counter] = s[0]; - counter += 1; -} - -@test:Config -function testFunc() { - // Invoking the main function - main(); - test:assertEquals(outputs[0], "Reason String: Sample Error"); - test:assertEquals(outputs[1], "Detail Mapping: {\"detail\":\"Detail Msg\", \"fatal\":true}"); - test:assertEquals(outputs[2], "Reason String: Sample Error"); - test:assertEquals(outputs[3], "Detail Mapping Field One: Detail Msg"); - test:assertEquals(outputs[4], "Detail Mapping Field Two: true"); - test:assertEquals(outputs[5], "Reason String: Sample Error"); - test:assertEquals(outputs[6], "Detail Mapping: {\"detail\":\"Detail Msg\", \"fatal\":true}"); - test:assertEquals(outputs[7], "Detail Mapping: {detailMsg:\"Failed Message\", isFatal:true}"); -} diff --git a/examples/index.json b/examples/index.json index fd10cd252309..ac7ae88e2252 100644 --- a/examples/index.json +++ b/examples/index.json @@ -346,16 +346,16 @@ "column": 2, "category": "Language concepts", "samples": [ { - "name": "Tuple Type Binding Pattern", - "url": "tuple-type-binding-pattern" + "name": "Tuple-Typed Binding Pattern", + "url": "tuple-typed-binding-pattern" }, { - "name": "Record Type Binding Pattern", + "name": "Record-Typed Binding Pattern", "url": "record-type-binding-pattern" }, { - "name": "Error Type Binding Pattern", - "url": "error-type-binding-pattern" + "name": "Error-Typed Binding Pattern", + "url": "error-typed-binding-pattern" }, { "name": "Tuple Destructure Binding Pattern", diff --git a/examples/record-type-binding-pattern/record_type_binding_pattern.bal b/examples/record-type-binding-pattern/record_type_binding_pattern.bal deleted file mode 100644 index 0df85586ccf0..000000000000 --- a/examples/record-type-binding-pattern/record_type_binding_pattern.bal +++ /dev/null @@ -1,64 +0,0 @@ -import ballerina/io; - -type Person record { - string name; - int age; - string country; -}; - -type Country record { - string name; - Capital capital; -}; - -type Capital record {| - string name; -|}; - -public function main() { - // This record type binding pattern will destructure a `record` of the type `Person` and create three variables as follows: - // The value of the field `name` in the `Person` record will be set to a new `string` variable `firstName`. - // The value of the field `age` in the `Person` record will be set to a new `int` variable `personAge`. - // `...otherDetails` is a rest parameter. Since `Person` is an open record, a new `map` variable - // `otherDetails` will be created (with the remaining fields that have not been matched) in the record binding pattern. - Person { name: firstName, age: personAge, ...otherDetails } = getPerson(); - io:println("Name: ", firstName); - io:println("Age: ", personAge); - io:println("Other Details: ", otherDetails); - - // If a variable name is not given for a field, a variable will be created with the same name as the field. - // i.e, `Person {name, age}` is same as Person `{name: name, age: age}`. - // Since a rest parameter is not given, all remaining fields are ignored. - Person { name, age } = getPerson(); - io:println("Name: ", name); - io:println("Age: ", age); - - // Record type binding patterns can be used with `var` to infer the type from the right hand side. - // Since the types of the new variables are based on the type of the type binding pattern, using `var` will - // infer the types from the right hand side. - var { name: vFirstName, age: vPersonAge, ...vOtherDetails } = getPerson(); - // The type of `vFirstName` is inferred as `string`. - io:println("Name: ", vFirstName); - // The type of `vPersonAge` is inferred as `int`. - io:println("Age: ", vPersonAge); - // The type of `vOtherDetails` will be `map`. - io:println("Other Details: ", vOtherDetails); - - // Binding patterns are recursive in nature. `capital`, which is a field of the type `Capital` in `Country` can also be - // destructured as follows: - var { name: countryName, capital: { name: capitalName } } = getCountry(); - io:println("Country Name: ", countryName); - io:println("Capital Name: ", capitalName); -} - -function getPerson() returns Person { - Person person = { name: "Peter", age: 28, country: "Sri Lanka", - "occupation": "Software Engineer" }; - return person; -} - -function getCountry() returns Country { - Capital capital = { name: "Colombo" }; - Country country = { name: "Sri Lanka", capital: capital }; - return country; -} diff --git a/examples/record-type-binding-pattern/record_type_binding_pattern.description b/examples/record-type-binding-pattern/record_type_binding_pattern.description deleted file mode 100644 index c355db0e1fd6..000000000000 --- a/examples/record-type-binding-pattern/record_type_binding_pattern.description +++ /dev/null @@ -1,2 +0,0 @@ -// Record typed binding patterns are used in declaring and defining new variables by destructuring fields in a record variable. -// The record type binding pattern statement must have an assignment expression on the right hand side. diff --git a/examples/record-type-binding-pattern/record_type_binding_pattern.out b/examples/record-type-binding-pattern/record_type_binding_pattern.out deleted file mode 100644 index dd715b4b5443..000000000000 --- a/examples/record-type-binding-pattern/record_type_binding_pattern.out +++ /dev/null @@ -1,13 +0,0 @@ -# To run this sample, navigate to the directory that contains the -# `.bal` file, and execute the `ballerina run` command. -$ ballerina run record_type_binding_pattern.bal -Name: Peter -Age: 28 -Other Details: country=Sri Lanka occupation=Software Engineer -Name: Peter -Age: 28 -Name: Peter -Age: 28 -Other Details: country=Sri Lanka occupation=Software Engineer -Country Name: Sri Lanka -Capital Name: Colombo diff --git a/examples/record-type-binding-pattern/tests/record_type_binding_pattern.bal b/examples/record-type-binding-pattern/tests/record_type_binding_pattern.bal deleted file mode 100644 index 4d5cf986bb21..000000000000 --- a/examples/record-type-binding-pattern/tests/record_type_binding_pattern.bal +++ /dev/null @@ -1,33 +0,0 @@ -import ballerina/test; -import ballerina/io; - -any[] outputs = []; -int counter = 0; - -// This is the mock function which will replace the real function -@test:Mock { - moduleName: "ballerina/io", - functionName: "println" -} -public function mockPrint(any... s) { - outputs[counter] = s[0]; - counter += 1; -} - -@test:Config -function testFunc() { - // Invoking the main function - main(); - test:assertEquals(outputs[0], "Name: Peter"); - test:assertEquals(outputs[1], "Age: 28"); - test:assertEquals(outputs[2], "Other Details: {\"country\":\"Sri Lanka\", \"occupation\":\"Software Engineer\"}"); - test:assertEquals(outputs[3], "Name: Peter"); - test:assertEquals(outputs[4], "Age: 28"); - test:assertEquals(outputs[5], "Name: Peter"); - test:assertEquals(outputs[6], "Age: 28"); - test:assertEquals(outputs[7], "Other Details: {\"country\":\"Sri Lanka\", \"occupation\":\"Software Engineer\"}"); - test:assertEquals(outputs[8], "Name: John"); - test:assertEquals(outputs[9], "Age: 26"); - test:assertEquals(outputs[10], "Country Name: Sri Lanka"); - test:assertEquals(outputs[11], "Capital Name: Colombo"); -} diff --git a/examples/tuple-type-binding-pattern/tests/tuple_type_binding_pattern_test.bal b/examples/tuple-type-binding-pattern/tests/tuple_type_binding_pattern_test.bal deleted file mode 100644 index be74909657a8..000000000000 --- a/examples/tuple-type-binding-pattern/tests/tuple_type_binding_pattern_test.bal +++ /dev/null @@ -1,43 +0,0 @@ -import ballerina/test; -import ballerina/io; - -any[] outputs = []; -int counter = 0; - -// This is the mock function which will replace the real function -@test:Mock { - moduleName: "ballerina/io", - functionName: "println" -} -public function mockPrint(any... s) { - string outstr = ""; - foreach var str in s { - outstr = outstr + io:sprintf("%s", str); - } - outputs[counter] = outstr; - counter += 1; -} - -@test:Config -function testFunc() { - // Invoking the main function - main(); - - string out1 = "Simple variable : (true, 0.4)"; - string out2 = "Tuple variable : true 0.4"; - string out3 = "Tuple variable : Ballerina 4 6.7"; - string out4 = "Tuple variable : Ballerina 34 true 6.7"; - string out5 = "Tuple variable : Ballerina 3 true 34 5.6 45"; - string out6 = "Tuple variable : Ballerina 123 true"; - string out7 = "Tuple variable : Ballerina 3 true 34 5.6 45"; - string out8 = "Tuple variable : Ballerina 3.4 456"; - - test:assertEquals(outputs[0], out1); - test:assertEquals(outputs[1], out2); - test:assertEquals(outputs[2], out3); - test:assertEquals(outputs[3], out4); - test:assertEquals(outputs[4], out5); - test:assertEquals(outputs[5], out6); - test:assertEquals(outputs[6], out7); - test:assertEquals(outputs[7], out8); -} diff --git a/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.bal b/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.bal deleted file mode 100644 index 13f44db5119b..000000000000 --- a/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.bal +++ /dev/null @@ -1,35 +0,0 @@ -import ballerina/io; - -public function main() { - - // This is a simple binding pattern, which involves only a single variable. - [boolean, float] t = [true, 0.4]; - io:println("Simple variable : ", t); - - // The same variable definition can be written using a tuple-binding pattern - // with separate variables. - [boolean, float] [a1, a2] = [true, 0.4]; - io:println("Tuple variable : ", a1, " ", a2); - - // The binding patterns are recursive in nature. These examples show - // how to write complex recursive variable definitions. - [[string, int], float] [[b1, b2], b3] = [["Ballerina", 4], 6.7]; - io:println("Tuple variable : ", b1, " ", b2, " ", b3); - - [[string, int], [boolean, float]] [[c1, c2],[c3, c4]] = - [["Ballerina", 34], [true, 6.7]]; - io:println("Tuple variable : ", c1, " ", c2, " ", c3, " ", c4); - - // Tuple variables can also be defined using tuple-type expressions. - [[string, [int, [boolean, byte]]], [float, int]] v1 = - [["Ballerina", [3, [true, 34]]], [5.6, 45]]; - [[string, [int, [boolean, byte]]], - [float, int]] [[d1, [d2, [d3, d4]]], [d5, d6]] = v1; - io:println("Tuple variable : ", - d1, " ", d2, " ", d3, " ", d4, " ", d5, " ", d6); - - // Tuple variable definitions can also take union types. - [string|int|float, [string|float, int]] [g1, [g2, g3]] = - ["Ballerina", [3.4, 456]]; - io:println("Tuple variable : ", g1, " ", g2, " ", g3); -} diff --git a/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.description b/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.description deleted file mode 100644 index 8bcb43746914..000000000000 --- a/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.description +++ /dev/null @@ -1,3 +0,0 @@ -// Tuple-binding patterns are used to de-structure and assign values to each individual variable of the tuple. -// The tuple-typed binding patterns will be used in declaring and defining new tuple variables. -// The tuple-type variable definition must have an assignment expression on the right hand side. diff --git a/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.out b/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.out deleted file mode 100644 index 9fb8f56304bc..000000000000 --- a/examples/tuple-type-binding-pattern/tuple_type_binding_pattern.out +++ /dev/null @@ -1,9 +0,0 @@ -# To run this sample, navigate to the directory that contains the -# `.bal` file, and execute the `ballerina run` command. -$ ballerina run tuple_type_binding_pattern.bal -Simple variable : true 0.4 -Tuple variable : true 0.4 -Tuple variable : Ballerina 4 6.7 -Tuple variable : Ballerina 34 true 6.7 -Tuple variable : Ballerina 3 true 34 5.6 45 -Tuple variable : Ballerina 3.4 456 From 1eb9bebb2946cce134ca33ff74c3cdf37f52c25e Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Wed, 16 Oct 2019 14:21:11 +0530 Subject: [PATCH 007/167] Add the renamed files --- .../error_typed_binding_pattern.bal | 52 +++++++++++++++ .../error_typed_binding_pattern.description | 2 + .../error_typed_binding_pattern.out | 10 +++ .../tests/error_typed_binding_pattern.bal | 29 +++++++++ .../record_typed_binding_pattern.bal | 64 +++++++++++++++++++ .../record_typed_binding_pattern.description | 2 + .../record_typed_binding_pattern.out | 13 ++++ .../tests/record_typed_binding_pattern.bal | 33 ++++++++++ .../tuple_typed_binding_pattern_test.bal | 43 +++++++++++++ .../tuple_typed_binding_pattern.bal | 35 ++++++++++ .../tuple_typed_binding_pattern.description | 3 + .../tuple_typed_binding_pattern.out | 9 +++ 12 files changed, 295 insertions(+) create mode 100644 examples/error-typed-binding-pattern/error_typed_binding_pattern.bal create mode 100644 examples/error-typed-binding-pattern/error_typed_binding_pattern.description create mode 100644 examples/error-typed-binding-pattern/error_typed_binding_pattern.out create mode 100644 examples/error-typed-binding-pattern/tests/error_typed_binding_pattern.bal create mode 100644 examples/record-typed-binding-pattern/record_typed_binding_pattern.bal create mode 100644 examples/record-typed-binding-pattern/record_typed_binding_pattern.description create mode 100644 examples/record-typed-binding-pattern/record_typed_binding_pattern.out create mode 100644 examples/record-typed-binding-pattern/tests/record_typed_binding_pattern.bal create mode 100644 examples/tuple-typed-binding-pattern/tests/tuple_typed_binding_pattern_test.bal create mode 100644 examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.bal create mode 100644 examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.description create mode 100644 examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.out diff --git a/examples/error-typed-binding-pattern/error_typed_binding_pattern.bal b/examples/error-typed-binding-pattern/error_typed_binding_pattern.bal new file mode 100644 index 000000000000..9ecbd6bb2996 --- /dev/null +++ b/examples/error-typed-binding-pattern/error_typed_binding_pattern.bal @@ -0,0 +1,52 @@ +import ballerina/io; + +type SampleErrorData record { + string message?; + error cause?; + string info; + boolean fatal; +}; + +type SampleError error; + +public function main() { + // This error-type binding pattern will destructure an `error` of the type `SampleError`, and create two variables as follows: + // The value of the reason string in the`SampleError` will be set to a new `string` variable `reason`. + // The values in the detail mapping will be set to new variables `info` and `fatal`. + var error(reason, info = info, fatal = fatal) = getSampleError(); + io:println("Reason String: " + reason); + io:println("Info: ", info); + io:println("Fatal: ", fatal); + + // The detail mapping can also be destructured using a rest parameter. + // `params` will be of the type `map`, and will have the + // `info` and `fatal` fields. + var error(reasonTwo, ...params) = getSampleError(); + io:println("Reason String: ", reasonTwo); + io:println("Detail Mapping: ", params); + + // When some error detail field names are provided rest parameter will only contain detail field that are not matched. + var error(reasonThree, info=info2, ...filteredParams) = getSampleError(); + io:println("Detail Mapping: ", filteredParams); + + // The underscore '_' sign can be used to ignore either the reason string or the detail mapping. + var error(_, detailMsg = detailMsg, isFatal = isFatal) = getRecordConstrainedError(); + io:println("Detail Message: ", detailMsg); +} + +function getSampleError() returns SampleError { + SampleError e = error("Sample Error", info = "Detail Msg", fatal = true); + return e; +} + +type Foo record {| + string message?; + error cause?; + string detailMsg; + boolean isFatal; +|}; + +function getRecordConstrainedError() returns error { + error e = error("Some Error", detailMsg = "Failed Message", isFatal = true); + return e; +} diff --git a/examples/error-typed-binding-pattern/error_typed_binding_pattern.description b/examples/error-typed-binding-pattern/error_typed_binding_pattern.description new file mode 100644 index 000000000000..712c9b504bea --- /dev/null +++ b/examples/error-typed-binding-pattern/error_typed_binding_pattern.description @@ -0,0 +1,2 @@ +// Error-type binding patterns are used in declaring and defining new variables by destructuring an `error` value. +// The error-type binding pattern statement must have an assignment expression on the right hand side. diff --git a/examples/error-typed-binding-pattern/error_typed_binding_pattern.out b/examples/error-typed-binding-pattern/error_typed_binding_pattern.out new file mode 100644 index 000000000000..6615f3dfc3ef --- /dev/null +++ b/examples/error-typed-binding-pattern/error_typed_binding_pattern.out @@ -0,0 +1,10 @@ +# To run this sample, navigate to the directory that contains the +# `.bal` file, and execute the `ballerina run` command. +$ ballerina run error_type_binding_pattern.bal +Reason String: Sample Error +Info: Detail Msg +Fatal: true +Reason String: Sample Error +Detail Mapping: info=Detail Msg fatal=true +Detail Mapping: fatal=true +Detail Message: Failed Message diff --git a/examples/error-typed-binding-pattern/tests/error_typed_binding_pattern.bal b/examples/error-typed-binding-pattern/tests/error_typed_binding_pattern.bal new file mode 100644 index 000000000000..eba8edbe38ed --- /dev/null +++ b/examples/error-typed-binding-pattern/tests/error_typed_binding_pattern.bal @@ -0,0 +1,29 @@ +import ballerina/io; +import ballerina/test; + +any[] outputs = []; +int counter = 0; + +// This is the mock function which will replace the real function +@test:Mock { + moduleName: "ballerina/io", + functionName: "println" +} +public function mockPrint(any... s) { + outputs[counter] = s[0]; + counter += 1; +} + +@test:Config +function testFunc() { + // Invoking the main function + main(); + test:assertEquals(outputs[0], "Reason String: Sample Error"); + test:assertEquals(outputs[1], "Detail Mapping: {\"detail\":\"Detail Msg\", \"fatal\":true}"); + test:assertEquals(outputs[2], "Reason String: Sample Error"); + test:assertEquals(outputs[3], "Detail Mapping Field One: Detail Msg"); + test:assertEquals(outputs[4], "Detail Mapping Field Two: true"); + test:assertEquals(outputs[5], "Reason String: Sample Error"); + test:assertEquals(outputs[6], "Detail Mapping: {\"detail\":\"Detail Msg\", \"fatal\":true}"); + test:assertEquals(outputs[7], "Detail Mapping: {detailMsg:\"Failed Message\", isFatal:true}"); +} diff --git a/examples/record-typed-binding-pattern/record_typed_binding_pattern.bal b/examples/record-typed-binding-pattern/record_typed_binding_pattern.bal new file mode 100644 index 000000000000..0df85586ccf0 --- /dev/null +++ b/examples/record-typed-binding-pattern/record_typed_binding_pattern.bal @@ -0,0 +1,64 @@ +import ballerina/io; + +type Person record { + string name; + int age; + string country; +}; + +type Country record { + string name; + Capital capital; +}; + +type Capital record {| + string name; +|}; + +public function main() { + // This record type binding pattern will destructure a `record` of the type `Person` and create three variables as follows: + // The value of the field `name` in the `Person` record will be set to a new `string` variable `firstName`. + // The value of the field `age` in the `Person` record will be set to a new `int` variable `personAge`. + // `...otherDetails` is a rest parameter. Since `Person` is an open record, a new `map` variable + // `otherDetails` will be created (with the remaining fields that have not been matched) in the record binding pattern. + Person { name: firstName, age: personAge, ...otherDetails } = getPerson(); + io:println("Name: ", firstName); + io:println("Age: ", personAge); + io:println("Other Details: ", otherDetails); + + // If a variable name is not given for a field, a variable will be created with the same name as the field. + // i.e, `Person {name, age}` is same as Person `{name: name, age: age}`. + // Since a rest parameter is not given, all remaining fields are ignored. + Person { name, age } = getPerson(); + io:println("Name: ", name); + io:println("Age: ", age); + + // Record type binding patterns can be used with `var` to infer the type from the right hand side. + // Since the types of the new variables are based on the type of the type binding pattern, using `var` will + // infer the types from the right hand side. + var { name: vFirstName, age: vPersonAge, ...vOtherDetails } = getPerson(); + // The type of `vFirstName` is inferred as `string`. + io:println("Name: ", vFirstName); + // The type of `vPersonAge` is inferred as `int`. + io:println("Age: ", vPersonAge); + // The type of `vOtherDetails` will be `map`. + io:println("Other Details: ", vOtherDetails); + + // Binding patterns are recursive in nature. `capital`, which is a field of the type `Capital` in `Country` can also be + // destructured as follows: + var { name: countryName, capital: { name: capitalName } } = getCountry(); + io:println("Country Name: ", countryName); + io:println("Capital Name: ", capitalName); +} + +function getPerson() returns Person { + Person person = { name: "Peter", age: 28, country: "Sri Lanka", + "occupation": "Software Engineer" }; + return person; +} + +function getCountry() returns Country { + Capital capital = { name: "Colombo" }; + Country country = { name: "Sri Lanka", capital: capital }; + return country; +} diff --git a/examples/record-typed-binding-pattern/record_typed_binding_pattern.description b/examples/record-typed-binding-pattern/record_typed_binding_pattern.description new file mode 100644 index 000000000000..c355db0e1fd6 --- /dev/null +++ b/examples/record-typed-binding-pattern/record_typed_binding_pattern.description @@ -0,0 +1,2 @@ +// Record typed binding patterns are used in declaring and defining new variables by destructuring fields in a record variable. +// The record type binding pattern statement must have an assignment expression on the right hand side. diff --git a/examples/record-typed-binding-pattern/record_typed_binding_pattern.out b/examples/record-typed-binding-pattern/record_typed_binding_pattern.out new file mode 100644 index 000000000000..dd715b4b5443 --- /dev/null +++ b/examples/record-typed-binding-pattern/record_typed_binding_pattern.out @@ -0,0 +1,13 @@ +# To run this sample, navigate to the directory that contains the +# `.bal` file, and execute the `ballerina run` command. +$ ballerina run record_type_binding_pattern.bal +Name: Peter +Age: 28 +Other Details: country=Sri Lanka occupation=Software Engineer +Name: Peter +Age: 28 +Name: Peter +Age: 28 +Other Details: country=Sri Lanka occupation=Software Engineer +Country Name: Sri Lanka +Capital Name: Colombo diff --git a/examples/record-typed-binding-pattern/tests/record_typed_binding_pattern.bal b/examples/record-typed-binding-pattern/tests/record_typed_binding_pattern.bal new file mode 100644 index 000000000000..4d5cf986bb21 --- /dev/null +++ b/examples/record-typed-binding-pattern/tests/record_typed_binding_pattern.bal @@ -0,0 +1,33 @@ +import ballerina/test; +import ballerina/io; + +any[] outputs = []; +int counter = 0; + +// This is the mock function which will replace the real function +@test:Mock { + moduleName: "ballerina/io", + functionName: "println" +} +public function mockPrint(any... s) { + outputs[counter] = s[0]; + counter += 1; +} + +@test:Config +function testFunc() { + // Invoking the main function + main(); + test:assertEquals(outputs[0], "Name: Peter"); + test:assertEquals(outputs[1], "Age: 28"); + test:assertEquals(outputs[2], "Other Details: {\"country\":\"Sri Lanka\", \"occupation\":\"Software Engineer\"}"); + test:assertEquals(outputs[3], "Name: Peter"); + test:assertEquals(outputs[4], "Age: 28"); + test:assertEquals(outputs[5], "Name: Peter"); + test:assertEquals(outputs[6], "Age: 28"); + test:assertEquals(outputs[7], "Other Details: {\"country\":\"Sri Lanka\", \"occupation\":\"Software Engineer\"}"); + test:assertEquals(outputs[8], "Name: John"); + test:assertEquals(outputs[9], "Age: 26"); + test:assertEquals(outputs[10], "Country Name: Sri Lanka"); + test:assertEquals(outputs[11], "Capital Name: Colombo"); +} diff --git a/examples/tuple-typed-binding-pattern/tests/tuple_typed_binding_pattern_test.bal b/examples/tuple-typed-binding-pattern/tests/tuple_typed_binding_pattern_test.bal new file mode 100644 index 000000000000..be74909657a8 --- /dev/null +++ b/examples/tuple-typed-binding-pattern/tests/tuple_typed_binding_pattern_test.bal @@ -0,0 +1,43 @@ +import ballerina/test; +import ballerina/io; + +any[] outputs = []; +int counter = 0; + +// This is the mock function which will replace the real function +@test:Mock { + moduleName: "ballerina/io", + functionName: "println" +} +public function mockPrint(any... s) { + string outstr = ""; + foreach var str in s { + outstr = outstr + io:sprintf("%s", str); + } + outputs[counter] = outstr; + counter += 1; +} + +@test:Config +function testFunc() { + // Invoking the main function + main(); + + string out1 = "Simple variable : (true, 0.4)"; + string out2 = "Tuple variable : true 0.4"; + string out3 = "Tuple variable : Ballerina 4 6.7"; + string out4 = "Tuple variable : Ballerina 34 true 6.7"; + string out5 = "Tuple variable : Ballerina 3 true 34 5.6 45"; + string out6 = "Tuple variable : Ballerina 123 true"; + string out7 = "Tuple variable : Ballerina 3 true 34 5.6 45"; + string out8 = "Tuple variable : Ballerina 3.4 456"; + + test:assertEquals(outputs[0], out1); + test:assertEquals(outputs[1], out2); + test:assertEquals(outputs[2], out3); + test:assertEquals(outputs[3], out4); + test:assertEquals(outputs[4], out5); + test:assertEquals(outputs[5], out6); + test:assertEquals(outputs[6], out7); + test:assertEquals(outputs[7], out8); +} diff --git a/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.bal b/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.bal new file mode 100644 index 000000000000..13f44db5119b --- /dev/null +++ b/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.bal @@ -0,0 +1,35 @@ +import ballerina/io; + +public function main() { + + // This is a simple binding pattern, which involves only a single variable. + [boolean, float] t = [true, 0.4]; + io:println("Simple variable : ", t); + + // The same variable definition can be written using a tuple-binding pattern + // with separate variables. + [boolean, float] [a1, a2] = [true, 0.4]; + io:println("Tuple variable : ", a1, " ", a2); + + // The binding patterns are recursive in nature. These examples show + // how to write complex recursive variable definitions. + [[string, int], float] [[b1, b2], b3] = [["Ballerina", 4], 6.7]; + io:println("Tuple variable : ", b1, " ", b2, " ", b3); + + [[string, int], [boolean, float]] [[c1, c2],[c3, c4]] = + [["Ballerina", 34], [true, 6.7]]; + io:println("Tuple variable : ", c1, " ", c2, " ", c3, " ", c4); + + // Tuple variables can also be defined using tuple-type expressions. + [[string, [int, [boolean, byte]]], [float, int]] v1 = + [["Ballerina", [3, [true, 34]]], [5.6, 45]]; + [[string, [int, [boolean, byte]]], + [float, int]] [[d1, [d2, [d3, d4]]], [d5, d6]] = v1; + io:println("Tuple variable : ", + d1, " ", d2, " ", d3, " ", d4, " ", d5, " ", d6); + + // Tuple variable definitions can also take union types. + [string|int|float, [string|float, int]] [g1, [g2, g3]] = + ["Ballerina", [3.4, 456]]; + io:println("Tuple variable : ", g1, " ", g2, " ", g3); +} diff --git a/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.description b/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.description new file mode 100644 index 000000000000..8bcb43746914 --- /dev/null +++ b/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.description @@ -0,0 +1,3 @@ +// Tuple-binding patterns are used to de-structure and assign values to each individual variable of the tuple. +// The tuple-typed binding patterns will be used in declaring and defining new tuple variables. +// The tuple-type variable definition must have an assignment expression on the right hand side. diff --git a/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.out b/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.out new file mode 100644 index 000000000000..9fb8f56304bc --- /dev/null +++ b/examples/tuple-typed-binding-pattern/tuple_typed_binding_pattern.out @@ -0,0 +1,9 @@ +# To run this sample, navigate to the directory that contains the +# `.bal` file, and execute the `ballerina run` command. +$ ballerina run tuple_type_binding_pattern.bal +Simple variable : true 0.4 +Tuple variable : true 0.4 +Tuple variable : Ballerina 4 6.7 +Tuple variable : Ballerina 34 true 6.7 +Tuple variable : Ballerina 3 true 34 5.6 45 +Tuple variable : Ballerina 3.4 456 From 0736fb6806842891b0f89ca5aa717f478b7eb768 Mon Sep 17 00:00:00 2001 From: praneesha Date: Wed, 16 Oct 2019 14:37:08 +0530 Subject: [PATCH 008/167] Update examples/index.json Co-Authored-By: Maryam Ziyad --- examples/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/index.json b/examples/index.json index ac7ae88e2252..66da36168c4a 100644 --- a/examples/index.json +++ b/examples/index.json @@ -351,7 +351,7 @@ }, { "name": "Record-Typed Binding Pattern", - "url": "record-type-binding-pattern" + "url": "record-typed-binding-pattern" }, { "name": "Error-Typed Binding Pattern", From e68445d76b68ad3843a6f3dda1b6101990a7a6b0 Mon Sep 17 00:00:00 2001 From: praneesha Date: Wed, 16 Oct 2019 14:41:24 +0530 Subject: [PATCH 009/167] Update examples/index.json Co-Authored-By: Maryam Ziyad --- examples/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/index.json b/examples/index.json index 66da36168c4a..5e748c9fa277 100644 --- a/examples/index.json +++ b/examples/index.json @@ -351,7 +351,7 @@ }, { "name": "Record-Typed Binding Pattern", - "url": "record-typed-binding-pattern" + "url": "record-typed-binding-pattern" }, { "name": "Error-Typed Binding Pattern", From 311a0f3fa9522b34097baddfb14d3192108cab72 Mon Sep 17 00:00:00 2001 From: Nipuna Marcus Date: Fri, 18 Oct 2019 15:06:33 +0530 Subject: [PATCH 010/167] Fix data in table data row not getting formatted --- .../compiler/format/FormattingNodeTree.java | 72 ++++++++++--------- .../formatting/expected/expectedTable.bal | 21 ++++++ .../src/test/resources/formatting/table.bal | 21 ++++++ 3 files changed, 81 insertions(+), 33 deletions(-) diff --git a/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java b/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java index cdcb558af718..0fc8714ba227 100644 --- a/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java +++ b/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java @@ -3574,54 +3574,60 @@ public void formatRecordLiteralExprNode(JsonObject node) { * @param node {JsonObject} node as json object */ public void formatRecordLiteralKeyValueNode(JsonObject node) { - if (node.has(FormattingConstants.WS) && node.has(FormattingConstants.FORMATTING_CONFIG)) { - JsonArray ws = node.getAsJsonArray(FormattingConstants.WS); + if (node.has(FormattingConstants.FORMATTING_CONFIG)) { JsonObject formatConfig = node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG); String indentation = this.getIndentation(formatConfig, false); - // Update whitespace for colon of the record literal key value pair. - this.preserveHeight(ws, indentation); + if (node.has(FormattingConstants.WS)) { + JsonArray ws = node.getAsJsonArray(FormattingConstants.WS); + // Update whitespace for colon of the record literal key value pair. + this.preserveHeight(ws, indentation); - boolean colonVisited = false; - boolean calculatedKey = false; + boolean colonVisited = false; + boolean calculatedKey = false; - for (JsonElement wsItem : ws) { - JsonObject currentWS = wsItem.getAsJsonObject(); - String text = currentWS.get(FormattingConstants.TEXT).getAsString(); + for (JsonElement wsItem : ws) { + JsonObject currentWS = wsItem.getAsJsonObject(); + String text = currentWS.get(FormattingConstants.TEXT).getAsString(); - if (text.equals(Tokens.COLON)) { - colonVisited = true; - } else if (text.equals(Tokens.OPENING_BRACKET) && !colonVisited) { - calculatedKey = true; - } + if (text.equals(Tokens.COLON)) { + colonVisited = true; + } else if (text.equals(Tokens.OPENING_BRACKET) && !colonVisited) { + calculatedKey = true; + } - if (this.noHeightAvailable(currentWS.get(FormattingConstants.WS).getAsString())) { - if (text.equals(Tokens.COLON) || text.equals(Tokens.CLOSING_BRACKET)) { - currentWS.addProperty(FormattingConstants.WS, FormattingConstants.EMPTY_SPACE); - } else if (text.equals(Tokens.OPENING_BRACKET)) { - currentWS.addProperty(FormattingConstants.WS, this.getWhiteSpaces(formatConfig - .get(FormattingConstants.SPACE_COUNT).getAsInt())); + if (this.noHeightAvailable(currentWS.get(FormattingConstants.WS).getAsString())) { + if (text.equals(Tokens.COLON) || text.equals(Tokens.CLOSING_BRACKET)) { + currentWS.addProperty(FormattingConstants.WS, FormattingConstants.EMPTY_SPACE); + } else if (text.equals(Tokens.OPENING_BRACKET)) { + currentWS.addProperty(FormattingConstants.WS, this.getWhiteSpaces(formatConfig + .get(FormattingConstants.SPACE_COUNT).getAsInt())); + } } } - } - // Update whitespace for key value of record literal. - if (node.has("key")) { - JsonObject keyNode = node.getAsJsonObject("key"); - if (calculatedKey) { - keyNode.add(FormattingConstants.FORMATTING_CONFIG, - this.getFormattingConfig(0, 0, 0, false, - formatConfig.get(FormattingConstants.INDENTED_START_COLUMN).getAsInt(), - formatConfig.get(FormattingConstants.USE_PARENT_INDENTATION).getAsBoolean())); - } else { - keyNode.add(FormattingConstants.FORMATTING_CONFIG, formatConfig); + + // Update whitespace for key value of record literal. + if (node.has("key")) { + JsonObject keyNode = node.getAsJsonObject("key"); + if (calculatedKey) { + keyNode.add(FormattingConstants.FORMATTING_CONFIG, + this.getFormattingConfig(0, 0, 0, false, + formatConfig.get(FormattingConstants.INDENTED_START_COLUMN).getAsInt(), + formatConfig.get(FormattingConstants.USE_PARENT_INDENTATION).getAsBoolean())); + } else { + keyNode.add(FormattingConstants.FORMATTING_CONFIG, formatConfig); + } } } // Update whitespace for value of record literal. if (node.has(FormattingConstants.VALUE)) { JsonObject valueNode = node.getAsJsonObject(FormattingConstants.VALUE); - JsonObject valueNodeFormatConfig = this.getFormattingConfig(0, 1, - 0, false, this.getWhiteSpaceCount(indentation), true); + JsonObject valueNodeFormatConfig = formatConfig; + if (node.has(FormattingConstants.WS)) { + valueNodeFormatConfig = this.getFormattingConfig(0, 1, + 0, false, this.getWhiteSpaceCount(indentation), true); + } valueNode.add(FormattingConstants.FORMATTING_CONFIG, valueNodeFormatConfig); } } diff --git a/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTable.bal b/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTable.bal index 1c3b2f013894..32f8de40732c 100644 --- a/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTable.bal +++ b/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTable.bal @@ -75,3 +75,24 @@ function name1() returns error? { ] }; } + +type Person1 record { + int id; + int age = -1; + float salary; + string name; + boolean married; + float amount = 55.0; +}; + +public function main() { + table personTable = table { + {key id, age, salary, name, married, amount}, + [ + {1, 30, 300.5, "Mary", true}, + {2, 20, 300.5, "John", true} + ] + }; + + io:println(personTable); +} diff --git a/language-server/modules/langserver-core/src/test/resources/formatting/table.bal b/language-server/modules/langserver-core/src/test/resources/formatting/table.bal index 5e6efc3dcaf2..eaf55aaedb27 100644 --- a/language-server/modules/langserver-core/src/test/resources/formatting/table.bal +++ b/language-server/modules/langserver-core/src/test/resources/formatting/table.bal @@ -56,4 +56,25 @@ function name1() returns error?{ {key id, key age, salary, name, married}, [ p2,p3] }; +} + +type Person1 record { + int id; + int age = -1; + float salary; + string name; + boolean married; + float amount = 55.0; +}; + +public function main() { + table personTable = table { + { key id, age, salary , name, married,amount } , + [ + { 1,30, 300.5 , "Mary" , true } , + { 2 , 20, 300.5 , "John" , true } + ] + }; + + io:println(personTable); } \ No newline at end of file From 2f47b9b3a12e47c7aece4017220ab8b1711baf40 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Fri, 18 Oct 2019 17:25:53 +0530 Subject: [PATCH 011/167] Remove ballerina compile command --- .../packerina/cmd/CompileCommand.java | 273 ------------------ .../resources/cli-help/ballerina-compile.help | 45 --- 2 files changed, 318 deletions(-) delete mode 100644 cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/CompileCommand.java delete mode 100644 cli/ballerina-tool/src/main/resources/cli-help/ballerina-compile.help diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/CompileCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/CompileCommand.java deleted file mode 100644 index 14e531246585..000000000000 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/CompileCommand.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.ballerinalang.packerina.cmd; - -import org.ballerinalang.compiler.CompilerPhase; -import org.ballerinalang.jvm.util.BLangConstants; -import org.ballerinalang.packerina.TaskExecutor; -import org.ballerinalang.packerina.buildcontext.BuildContext; -import org.ballerinalang.packerina.task.CleanTargetDirTask; -import org.ballerinalang.packerina.task.CompileTask; -import org.ballerinalang.packerina.task.CopyModuleJarTask; -import org.ballerinalang.packerina.task.CopyNativeLibTask; -import org.ballerinalang.packerina.task.CreateBaloTask; -import org.ballerinalang.packerina.task.CreateBirTask; -import org.ballerinalang.packerina.task.CreateJarTask; -import org.ballerinalang.packerina.task.CreateLockFileTask; -import org.ballerinalang.packerina.task.CreateTargetDirTask; -import org.ballerinalang.packerina.task.RunTestsTask; -import org.ballerinalang.tool.BLauncherCmd; -import org.ballerinalang.tool.LauncherUtils; -import org.wso2.ballerinalang.compiler.util.CompilerContext; -import org.wso2.ballerinalang.compiler.util.CompilerOptions; -import org.wso2.ballerinalang.compiler.util.ProjectDirConstants; -import org.wso2.ballerinalang.compiler.util.ProjectDirs; -import org.wso2.ballerinalang.util.RepoUtils; -import picocli.CommandLine; - -import java.io.PrintStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; - -import static org.ballerinalang.compiler.CompilerOptionName.COMPILER_PHASE; -import static org.ballerinalang.compiler.CompilerOptionName.EXPERIMENTAL_FEATURES_ENABLED; -import static org.ballerinalang.compiler.CompilerOptionName.LOCK_ENABLED; -import static org.ballerinalang.compiler.CompilerOptionName.OFFLINE; -import static org.ballerinalang.compiler.CompilerOptionName.PROJECT_DIR; -import static org.ballerinalang.compiler.CompilerOptionName.SKIP_TESTS; -import static org.ballerinalang.compiler.CompilerOptionName.TEST_ENABLED; -import static org.ballerinalang.packerina.cmd.Constants.COMPILE_COMMAND; - -/** - * Compile Ballerina modules in to balo. - * - * @since 0.992.0 - */ -@CommandLine.Command(name = COMPILE_COMMAND, description = "Ballerina compile - Compiles Ballerina module(s) and " + - "generates a .balo file(s).") -public class CompileCommand implements BLauncherCmd { - - private final PrintStream outStream; - private final PrintStream errStream; - private Path sourceRootPath; - private boolean exitWhenFinish; - - public CompileCommand() { - this.sourceRootPath = Paths.get(System.getProperty("user.dir")); - this.outStream = System.out; - this.errStream = System.err; - this.exitWhenFinish = true; - } - - public CompileCommand(Path userDir, PrintStream outStream, PrintStream errStream, boolean exitWhenFinish) { - this.sourceRootPath = userDir; - this.outStream = outStream; - this.errStream = errStream; - this.exitWhenFinish = exitWhenFinish; - } - - @CommandLine.Option(names = {"--offline"}, description = "Compiles offline without downloading dependencies.") - private boolean offline; - - @CommandLine.Option(names = {"--skip-lock"}, description = "Skip using the lock file to resolve dependencies") - private boolean skipLock; - - @CommandLine.Option(names = {"--skip-tests"}, description = "Skips test compilation and execution.") - private boolean skipTests; - - @CommandLine.Parameters - private List argList; - - @CommandLine.Option(names = {"--native"}, hidden = true, - description = "compile Ballerina program to a native binary") - private boolean nativeBinary; - - @CommandLine.Option(names = "--dump-bir", hidden = true) - private boolean dumpBIR; - - @CommandLine.Option(names = "--dump-llvm-ir", hidden = true) - private boolean dumpLLVMIR; - - @CommandLine.Option(names = {"--help", "-h"}, hidden = true) - private boolean helpFlag; - - @CommandLine.Option(names = "--experimental", description = "Enable experimental language features") - private boolean experimentalFlag; - - @CommandLine.Option(names = {"--config"}, description = "Path to the configuration file when running tests." + - " A configuration file cannot be set if " + - "'--skip-tests' flag is passed.") - private String configFilePath; - - public void execute() { - - if (this.helpFlag) { - String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(COMPILE_COMMAND); - errStream.println(commandUsageInfo); - return; - } - - if (this.argList != null && this.argList.size() > 1) { - CommandUtil.printError(this.errStream, - "too many arguments.", - "ballerina compile []", - true); - } - - - if (!this.skipTests && null != this.configFilePath) { - throw LauncherUtils.createLauncherException("you cannot use a config file for tests when tests are set " + - "to skip with '--skip-tests'."); - } - - if (this.nativeBinary) { - throw LauncherUtils.createLauncherException("llvm native generation is not supported"); - } - - // validation and decide source root and source full path - Path sourcePath = null; - Path targetPath; - - // when no bal file or module is given, it is assumed to compile all modules of the project. check if the - // command is executed within a ballerina project. update source root path if command executed inside a project. - if (this.argList == null || this.argList.size() == 0) { - // when compiling all the modules - - //// validate and set source root path - if (!ProjectDirs.isProject(this.sourceRootPath)) { - Path findRoot = ProjectDirs.findProjectRoot(this.sourceRootPath); - if (null == findRoot) { - throw LauncherUtils.createLauncherException("you are trying to compile a ballerina project but " + - "there is no Ballerina.toml file. Run " + - "'ballerina new' from '" + this.sourceRootPath + - "' to initialize it as a project."); - } - - this.sourceRootPath = findRoot; - } - - targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME); - } else if (this.argList.get(0).endsWith(BLangConstants.BLANG_SRC_FILE_SUFFIX)) { - // when a single bal file is provided. - throw LauncherUtils.createLauncherException("'compile' command cannot be used on ballerina files. it can" + - " only be used with ballerina projects."); - } else if (Files.exists( - this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(this.argList.get(0))) && - Files.isDirectory( - this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(this.argList.get(0)))) { - - // when compiling a ballerina module - - //// check if command executed from project root. - if (!RepoUtils.isBallerinaProject(this.sourceRootPath)) { - throw LauncherUtils.createLauncherException("you are trying to compile a module that is not inside " + - "a project. Run 'ballerina new' from " + - this.sourceRootPath + " to initialize it as a " + - "project and then compile the module."); - } - - //// check if module name given is not absolute. - if (Paths.get(argList.get(0)).isAbsolute()) { - throw LauncherUtils.createLauncherException("you are trying to compile a module by giving the " + - "absolute path. you only need give the name of the " + - "module."); - } - - String moduleName = argList.get(0); - - //// remove end forward slash - if (moduleName.endsWith("/")) { - moduleName = moduleName.substring(0, moduleName.length() - 1); - } - - sourcePath = Paths.get(moduleName); - - //// check if module exists. - if (Files.notExists(this.sourceRootPath.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(sourcePath))) { - throw LauncherUtils.createLauncherException("'" + sourcePath + "' module does not exist."); - } - - targetPath = this.sourceRootPath.resolve(ProjectDirConstants.TARGET_DIR_NAME); - } else { - throw LauncherUtils.createLauncherException("invalid ballerina source path, it should either be a module " + - "name in a ballerina project or a file with a \'" + - BLangConstants.BLANG_SRC_FILE_SUFFIX + "\' extension."); - } - - // normalize paths - this.sourceRootPath = this.sourceRootPath.normalize(); - sourcePath = sourcePath == null ? null : sourcePath.normalize(); - targetPath = targetPath.normalize(); - - // create compiler context - CompilerContext compilerContext = new CompilerContext(); - CompilerOptions options = CompilerOptions.getInstance(compilerContext); - options.put(PROJECT_DIR, this.sourceRootPath.toString()); - options.put(OFFLINE, Boolean.toString(this.offline)); - options.put(COMPILER_PHASE, CompilerPhase.BIR_GEN.toString()); - options.put(LOCK_ENABLED, Boolean.toString(!this.skipLock)); - options.put(SKIP_TESTS, Boolean.toString(this.skipTests)); - options.put(TEST_ENABLED, "true"); - options.put(EXPERIMENTAL_FEATURES_ENABLED, Boolean.toString(this.experimentalFlag)); - - // create builder context - BuildContext buildContext = new BuildContext(this.sourceRootPath, targetPath, sourcePath, compilerContext); - buildContext.setOut(outStream); - buildContext.setErr(errStream); - - TaskExecutor taskExecutor = new TaskExecutor.TaskBuilder() - .addTask(new CleanTargetDirTask()) // clean the target directory - .addTask(new CreateTargetDirTask()) // create target directory. - .addTask(new CompileTask()) // compile the modules - .addTask(new CreateBaloTask()) // create the balos for modules - .addTask(new CreateBirTask()) // create the bir - .addTask(new CopyNativeLibTask()) // copy the native libs - .addTask(new CreateJarTask(this.dumpBIR)) // create the jar - .addTask(new CopyModuleJarTask()) - .addTask(new RunTestsTask(), this.skipTests) // run tests - .addTask(new CreateLockFileTask()) // create a lock file - .build(); - - taskExecutor.executeTasks(buildContext); - - if (this.exitWhenFinish) { - Runtime.getRuntime().exit(0); - } - } - - @Override - public String getName() { - return COMPILE_COMMAND; - } - - @Override - public void printLongDesc(StringBuilder out) { - out.append("Compiles Ballerina module(s) and generates shareable .balo file(s). \n"); - } - - @Override - public void printUsage(StringBuilder out) { - out.append(" ballerina compile [] [--offline] [--skip-tests] [--skip-lock] \n"); - } - - @Override - public void setParentCmdParser(CommandLine parentCmdParser) { - } -} diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-compile.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-compile.help deleted file mode 100644 index bc0a33a96276..000000000000 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-compile.help +++ /dev/null @@ -1,45 +0,0 @@ -NAME - ballerina-compile - Compile Ballerina module(s) and generate shareable - .balo file(s). - -SYNOPSIS - ballerina compile [] [--offline] [--skip-tests] [--skip-lock] - [--experimental] [--config ] - -DESCRIPTION - Compile command compiles Ballerina module(s) and generates shareable .balo file(s). - - The command will only work inside a project and it will create balo files - for each module in the project. You can compile a specific module by passing - the module name to the compile command. - - -OPTIONS - - --offline - Builds offline without downloading dependencies. - - --skip-tests - Skips test compilation and execution. - - --skip-lock - Skip using the lock file to resolve dependencies. - - --experimental - Enable experimental language features. - - --config - Path to the configuration file when running tests. - A configuration file cannot be set if '--skip-tests' flag is passed. - - -EXAMPLES - Compile all the modules in a project. - → ballerina compile - This will generate .balo files for each module in ./target/balo directory of - the project. - - Compile hello module. - → ballerina compile hello - This will generate a .balo file for the 'hello' module in the ./target/balo - directory of the project. From f15112f0ee594bc13d92e551c294a9eb1c7079d3 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Fri, 18 Oct 2019 17:26:39 +0530 Subject: [PATCH 012/167] Remove --config option from build and test command --- .../java/org/ballerinalang/config/ConfigProcessor.java | 2 +- .../org/ballerinalang/packerina/cmd/BuildCommand.java | 7 ++----- .../java/org/ballerinalang/packerina/cmd/RunCommand.java | 2 +- .../java/org/ballerinalang/packerina/cmd/TestCommand.java | 8 +++----- .../META-INF/services/org.ballerinalang.tool.BLauncherCmd | 1 - .../src/main/resources/cli-help/ballerina-build.help | 5 +++-- .../src/main/resources/cli-help/ballerina-run.help | 4 +++- .../src/main/resources/cli-help/ballerina-test.help | 8 +++----- .../ballerinalang/test/command/CommandParserTestCase.java | 1 - .../org/ballerinalang/test/packaging/ConfigTestCase.java | 8 ++++---- 10 files changed, 20 insertions(+), 26 deletions(-) diff --git a/bvm/ballerina-config/src/main/java/org/ballerinalang/config/ConfigProcessor.java b/bvm/ballerina-config/src/main/java/org/ballerinalang/config/ConfigProcessor.java index 00db348b708d..1559832154cd 100644 --- a/bvm/ballerina-config/src/main/java/org/ballerinalang/config/ConfigProcessor.java +++ b/bvm/ballerina-config/src/main/java/org/ballerinalang/config/ConfigProcessor.java @@ -47,7 +47,7 @@ public class ConfigProcessor { * (environment vars, etcd or something similar), 3. ballerina.conf file * * @param runtimeParams The -B params passed to the BVM as CLI parameters - * @param userProvidedConfigFile The config file provided through the --config CLI parameter + * @param userProvidedConfigFile The config file provided through the --b7a.config.file property * @param ballerinaConfDefaultPath The default config file (ballerina.conf) located at the source root * @return The parsed and resolved set of configurations * @throws IOException Thrown if there was an error while attempting to process the config file diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java index 0cbaf3a7d924..6ee221946ef5 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java @@ -149,11 +149,8 @@ public BuildCommand(Path userDir, PrintStream outStream, PrintStream errStream, @CommandLine.Option(names = "--experimental", description = "Enable experimental language features.") private boolean experimentalFlag; - @CommandLine.Option(names = {"--config"}, description = "Path to the configuration file when running tests.") - private String configFilePath; - private static final String buildCmd = "ballerina build [-o ] [--sourceroot] [--offline] [--skip-tests]\n" + - " [--skip-lock] { | -a | --all}"; + " [--skip-lock] { | -a | --all} [--] [(--key=value)...]"; public void execute() { if (this.helpFlag) { @@ -423,7 +420,7 @@ public void printLongDesc(StringBuilder out) { @Override public void printUsage(StringBuilder out) { out.append(" ballerina build [-o ] [--offline] [--skip-tests] [--skip-lock] " + - "{ | -a | --all} \n"); + "{ | -a | --all} [--] [(--key=value)...]\n"); } @Override diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/RunCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/RunCommand.java index d92e87387526..22a41dd606f4 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/RunCommand.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/RunCommand.java @@ -302,7 +302,7 @@ public void printLongDesc(StringBuilder out) { public void printUsage(StringBuilder out) { out.append(" ballerina run [--offline]\n" + " [--sourceroot]\n" + - " { | module-name | executable-jar} [configs (--key=value)...] " + " { | module-name | executable-jar} [(--key=value)...] " + "[--] [args...] \n"); } diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java index 0436a05460df..ff92f4a0d712 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java @@ -118,9 +118,6 @@ public TestCommand(Path userDir, PrintStream outStream, PrintStream errStream, b @CommandLine.Option(names = "--debug", description = "start Ballerina in remote debugging mode") private String debugPort; - @CommandLine.Option(names = {"--config"}, description = "Path to the configuration file when running tests.") - private String configFilePath; - public void execute() { if (this.helpFlag) { String commandUsageInfo = BLauncherCmd.getCommandUsageInfo(TEST_COMMAND); @@ -136,7 +133,7 @@ public void execute() { CommandUtil.printError(this.errStream, "too many arguments.", "ballerina test [--offline] [--sourceroot ] [--experimental] [--skip-lock]\n" + - " [--config ] [ | -a | --all]", + " [ | -a | --all] [--] [(--key=value)...]", false); CommandUtil.exitError(this.exitWhenFinish); @@ -292,7 +289,8 @@ public void printLongDesc(StringBuilder out) { @Override public void printUsage(StringBuilder out) { - out.append(" ballerina test [] \n"); + out.append(" \"ballerina test [--offline] [--sourceroot ] [--experimental] [--skip-lock]\\n\" +\n" + + "[ | -a | --all] [--] [(--key=value)...]\n"); } @Override diff --git a/cli/ballerina-packerina/src/main/resources/META-INF/services/org.ballerinalang.tool.BLauncherCmd b/cli/ballerina-packerina/src/main/resources/META-INF/services/org.ballerinalang.tool.BLauncherCmd index 2dd9a76acccb..a3eac53bd3d5 100644 --- a/cli/ballerina-packerina/src/main/resources/META-INF/services/org.ballerinalang.tool.BLauncherCmd +++ b/cli/ballerina-packerina/src/main/resources/META-INF/services/org.ballerinalang.tool.BLauncherCmd @@ -5,7 +5,6 @@ org.ballerinalang.packerina.cmd.PullCommand org.ballerinalang.packerina.cmd.PushCommand org.ballerinalang.packerina.cmd.NewCommand org.ballerinalang.packerina.cmd.AddCommand -org.ballerinalang.packerina.cmd.CompileCommand org.ballerinalang.packerina.cmd.SearchCommand org.ballerinalang.packerina.cmd.CleanCommand org.ballerinalang.packerina.cmd.TestCommand diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help index 164d10958feb..27197ee1f695 100644 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help +++ b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help @@ -3,8 +3,8 @@ NAME SYNOPSIS ballerina build [] - | [(--key=value)...] - ballerina build -a | --all [] + | [] + ballerina build -a | --all [] -- [] DESCRIPTION @@ -47,6 +47,7 @@ OPTIONS --skip-lock Skip using the lock file to resolve dependencies. +CONFIG PROPERTIES (--key=value)... Set Ballerina environment parameters as key/value pairs. If multiple parameters need to be provided, each parameter diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help index 6000106e0461..3d5b6cf1cae6 100644 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help +++ b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help @@ -3,7 +3,7 @@ NAME SYNOPSIS ballerina run [] | - | [(--key=value)...] [--] [args...] + | [] [--] [] DESCRIPTION @@ -37,6 +37,7 @@ OPTIONS The source will be looked up relative to the given source root path. +CONFIG PROPERTIES (--key=value)... Set Ballerina environment parameters as key/value pairs. If multiple parameters need to be provided, each parameter @@ -44,6 +45,7 @@ OPTIONS supported by the Ballerina standard library modules are specified in the relevant API documentation. +ARGUMENTS -- The argument '--' signals the end of Ballerina environment parameters. Any and all arguments following '--' are treated as diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help index b78f230d2392..be73d4890b34 100644 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help +++ b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help @@ -2,8 +2,8 @@ NAME ballerina-test - Run module tests SYNOPSIS - ballerina test [] [(--key=value)...] - ballerina test -a | --all [] + ballerina test [] [] + ballerina test -a | --all [] -- [] DESCRIPTION @@ -36,9 +36,7 @@ OPTIONS --debug Start Ballerina in remote debugging mode. - --config - Path to the configuration file when running tests. - +CONFIG PROPERTIES (--key=value)... Set Ballerina environment parameters as key/value pairs. If multiple parameters need to be provided, each parameter diff --git a/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/command/CommandParserTestCase.java b/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/command/CommandParserTestCase.java index 6e6e2ef968b8..b3340732ff4e 100644 --- a/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/command/CommandParserTestCase.java +++ b/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/command/CommandParserTestCase.java @@ -115,7 +115,6 @@ public void testUnknownOption(String unknownOption) throws BallerinaTestExceptio @DataProvider(name = "runCmdOptions") public Object[][] runCmdOptions() { return new Object[][] { - { "--config" }, { "--debug" }, { "--offline" }, { "-e" } diff --git a/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/packaging/ConfigTestCase.java b/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/packaging/ConfigTestCase.java index c0410ad41cfe..58baa2d16a79 100644 --- a/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/packaging/ConfigTestCase.java +++ b/tests/ballerina-tools-integration-test/src/test/java/org/ballerinalang/test/packaging/ConfigTestCase.java @@ -73,7 +73,7 @@ public void testRunWithDefaultConfigFromDiff() throws Exception { @Test(description = "Test running a ballerina file by specifying the config file path") public void testRunWithConfig() throws Exception { String confPath = (new File("src/test/resources/config/pkg/example.conf")).getAbsolutePath(); - String[] clientArgs = {"--config", confPath, "read_from_config.bal"}; + String[] clientArgs = {"read_from_config.bal", "--b7a.config.file=" + confPath}; LogLeecher clientLeecher = new LogLeecher("localhost"); balClient.runMain("run", clientArgs, envVariables, new String[0], new LogLeecher[]{clientLeecher}, balSourcePkgPath); @@ -81,7 +81,7 @@ public void testRunWithConfig() throws Exception { @Test(description = "Execute tests in a ballerina module by specifying the config file path") public void testModuleWithConfig() throws Exception { - String[] clientArgs = {"--config", "sample.conf"}; + String[] clientArgs = {"--b7a.config.file=sample.conf"}; String msg = "http://localhost:9090/sample/hello"; LogLeecher clientLeecher = new LogLeecher(msg); balClient.runMain("test", clientArgs, envVariables, new String[0], new LogLeecher[]{clientLeecher}, @@ -100,7 +100,7 @@ public void testModuleWithDefaultConfig() throws Exception { @Test(description = "Execute tests in a ballerina module with a non-existing config file") public void testModuleWithInvalidConfig() throws Exception { - String[] clientArgs = {"--config", "invalid.conf"}; + String[] clientArgs = {"--b7a.config.file=invalid.conf"}; LogLeecher clientLeecher = new LogLeecher("configuration file not found: invalid.conf", LogLeecher.LeecherType.ERROR); balClient.runMain("test", clientArgs, envVariables, new String[0], new LogLeecher[]{clientLeecher}, @@ -122,7 +122,7 @@ public void testRunWithInvalidDefaultConfig() throws Exception { public void testRunWithInvalidConfig() throws Exception { Path sourcePath = Paths.get(balSourcePkgPath, "invalid"); String confPath = (new File("src/test/resources/config/invalid/test.conf")).getAbsolutePath(); - String[] clientArgs = {"--config", confPath, "read_from_config.bal"}; + String[] clientArgs = {"read_from_config.bal", "--b7a.config.file="+ confPath"}; LogLeecher clientLeecher = new LogLeecher("error: invalid toml syntax at test.conf:5", LogLeecher.LeecherType.ERROR); balClient.runMain("run", clientArgs, envVariables, new String[0], new LogLeecher[]{clientLeecher}, From 8e2e31024b30f8d12452032d2f4ac2a9a5ab5b10 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sat, 19 Oct 2019 12:05:01 +0530 Subject: [PATCH 013/167] Fix minor formatting issue --- .../main/java/org/ballerinalang/packerina/cmd/TestCommand.java | 2 +- .../src/main/resources/cli-help/ballerina-build.help | 2 +- .../src/main/resources/cli-help/ballerina-test.help | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java index ff92f4a0d712..0b27ea8e21ed 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java @@ -289,7 +289,7 @@ public void printLongDesc(StringBuilder out) { @Override public void printUsage(StringBuilder out) { - out.append(" \"ballerina test [--offline] [--sourceroot ] [--experimental] [--skip-lock]\\n\" +\n" + + out.append(" ballerina test [--offline] [--sourceroot ] [--experimental] [--skip-lock]\n" + "[ | -a | --all] [--] [(--key=value)...]\n"); } diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help index 27197ee1f695..2889d08eacfe 100644 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help +++ b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help @@ -4,7 +4,7 @@ NAME SYNOPSIS ballerina build [] | [] - ballerina build -a | --all [] -- [] + ballerina build -a | --all [] [--] [] DESCRIPTION diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help index be73d4890b34..a76470dfe91e 100644 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help +++ b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-test.help @@ -3,7 +3,7 @@ NAME SYNOPSIS ballerina test [] [] - ballerina test -a | --all [] -- [] + ballerina test -a | --all [] [--] [] DESCRIPTION From 6981907f93c6c9ed0426fe393e4d53c247763ba1 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Mon, 21 Oct 2019 11:09:45 +0530 Subject: [PATCH 014/167] Update plugin version --- tool-plugins/intellij/gradle.properties | 2 +- tool-plugins/intellij/src/main/resources/META-INF/plugin.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tool-plugins/intellij/gradle.properties b/tool-plugins/intellij/gradle.properties index fea291334f10..911f0113de3e 100644 --- a/tool-plugins/intellij/gradle.properties +++ b/tool-plugins/intellij/gradle.properties @@ -14,5 +14,5 @@ # limitations under the License. # ballerinaPluginName=ballerina-intellij-idea-plugin -ballerinaPluginVersion=1.0.1 +ballerinaPluginVersion=1.0.2 ideaVersion=2019.2 diff --git a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml index 705c310c8885..49fc010d41ae 100644 --- a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml +++ b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml @@ -1,7 +1,7 @@ io.ballerina Ballerina - 1.0.1 + 1.0.2 BallerinaLang Date: Mon, 21 Oct 2019 12:19:08 +0530 Subject: [PATCH 015/167] Update plugin description and release notes --- .../src/main/resources/META-INF/plugin.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml index 49fc010d41ae..05b58704c78c 100644 --- a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml +++ b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml @@ -5,18 +5,17 @@ BallerinaLang Ballerina is a simple programming language whose syntax and platform address - the hard problems of integration. It is a general purpose, concurrent, transactional, statically and strongly - typed programming language with both textual and graphical syntaxes. Its specialization is integration - it - brings fundamental concepts, ideas and tools of distributed system integration into the language and offers a - type safe, concurrent environment to implement such applications. These include distributed transactions, - reliable messaging, stream processing, workflows and container management platforms. + The Ballerina IntelliJ plugin provides the Ballerina development capabilities + in IntelliJ IDEA. +

For instructions on how to download, install, and use the features of the plugin, refer the + Ballerina IntelliJ plugin Guide. ]]>
-
  • Added diagnostics related plugin performance fix.
  • -
  • Fixed line-based code actions.
  • +
  • Added fixes for ballerina external library tracker.
  • +
  • Added debugger related minor fixes and improvements.
  • +
  • Fixed package reference highlighting inside annotation attachments.
  • ]]>
    From 36891759505e58057fdb8d48f11a3d09069b01bc Mon Sep 17 00:00:00 2001 From: rukshani Date: Mon, 21 Oct 2019 14:35:08 +0530 Subject: [PATCH 016/167] Update transport version --- distribution/zip/jballerina/build.gradle | 2 +- gradle/javaProject.gradle | 2 +- stdlib/grpc/src/main/ballerina/Ballerina.toml | 2 +- stdlib/http/src/main/ballerina/Ballerina.toml | 2 +- stdlib/mime/src/main/ballerina/Ballerina.toml | 2 +- stdlib/websub/src/main/ballerina/Ballerina.toml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/distribution/zip/jballerina/build.gradle b/distribution/zip/jballerina/build.gradle index 6dbf1bebc840..d45b79f0ee20 100644 --- a/distribution/zip/jballerina/build.gradle +++ b/distribution/zip/jballerina/build.gradle @@ -59,7 +59,7 @@ dependencies { dist 'org.wso2.carbon:org.wso2.carbon.core:5.1.0' dist 'org.wso2.securevault:org.wso2.securevault:1.0.0-wso2v2' dist 'org.wso2.transport.file:org.wso2.transport.local-file-system:6.0.55' - dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.28' + dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.30' dist 'org.bouncycastle:bcprov-jdk15on:1.61' dist 'org.bouncycastle:bcpkix-jdk15on:1.61' diff --git a/gradle/javaProject.gradle b/gradle/javaProject.gradle index 15f91b030c50..14eaedff7909 100644 --- a/gradle/javaProject.gradle +++ b/gradle/javaProject.gradle @@ -89,7 +89,7 @@ dependencies { implementation 'org.wso2.carbon.messaging:org.wso2.carbon.messaging:2.3.7' implementation 'org.wso2.orbit.org.antlr:antlr4-runtime:4.5.1.wso2v1' implementation 'org.wso2.orbit.org.yaml:snakeyaml:1.16.0.wso2v1' - implementation 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.28' + implementation 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.30' implementation 'org.wso2.transport.file:org.wso2.transport.local-file-system:6.0.55' implementation 'org.wso2.staxon:staxon-core:1.2.0.wso2v2' implementation 'org.quartz-scheduler:quartz:2.3.1' diff --git a/stdlib/grpc/src/main/ballerina/Ballerina.toml b/stdlib/grpc/src/main/ballerina/Ballerina.toml index 5cf6d2e5f14c..13bb8ddda59e 100644 --- a/stdlib/grpc/src/main/ballerina/Ballerina.toml +++ b/stdlib/grpc/src/main/ballerina/Ballerina.toml @@ -22,7 +22,7 @@ target = "java8" [[platform.libraries]] artifactId = "org.wso2.transport.http.netty" version = "6.0.294" - path = "./lib/org.wso2.transport.http.netty-6.2.28.jar" + path = "./lib/org.wso2.transport.http.netty-6.2.30.jar" groupId = "org.wso2.transport.http" modules = ["grpc"] diff --git a/stdlib/http/src/main/ballerina/Ballerina.toml b/stdlib/http/src/main/ballerina/Ballerina.toml index e80a4cb8e575..ec2d11e5868f 100644 --- a/stdlib/http/src/main/ballerina/Ballerina.toml +++ b/stdlib/http/src/main/ballerina/Ballerina.toml @@ -15,7 +15,7 @@ target = "java8" [[platform.libraries]] artifactId = "org.wso2.transport.http.netty" version = "6.0.294" - path = "./lib/org.wso2.transport.http.netty-6.2.28.jar" + path = "./lib/org.wso2.transport.http.netty-6.2.30.jar" groupId = "org.wso2.transport.http" modules = ["http"] diff --git a/stdlib/mime/src/main/ballerina/Ballerina.toml b/stdlib/mime/src/main/ballerina/Ballerina.toml index b0e8343b66bc..994c59e50544 100644 --- a/stdlib/mime/src/main/ballerina/Ballerina.toml +++ b/stdlib/mime/src/main/ballerina/Ballerina.toml @@ -15,7 +15,7 @@ target = "java8" [[platform.libraries]] artifactId = "org.wso2.transport.http.netty" version = "6.0.294" - path = "./lib/org.wso2.transport.http.netty-6.2.28.jar" + path = "./lib/org.wso2.transport.http.netty-6.2.30.jar" groupId = "org.wso2.transport.http" modules = ["mime"] diff --git a/stdlib/websub/src/main/ballerina/Ballerina.toml b/stdlib/websub/src/main/ballerina/Ballerina.toml index 4eb11ae771e3..92463b572931 100644 --- a/stdlib/websub/src/main/ballerina/Ballerina.toml +++ b/stdlib/websub/src/main/ballerina/Ballerina.toml @@ -15,7 +15,7 @@ target = "java8" [[platform.libraries]] artifactId = "org.wso2.transport.http.netty" version = "6.0.294" - path = "./lib/org.wso2.transport.http.netty-6.2.28.jar" + path = "./lib/org.wso2.transport.http.netty-6.2.30.jar" groupId = "org.wso2.transport.http" modules = ["web-sub"] From df346abd57c975bf2f0a278c0a92ae19e163ec5e Mon Sep 17 00:00:00 2001 From: chamil321 Date: Mon, 21 Oct 2019 17:30:48 +0530 Subject: [PATCH 017/167] Remove redundant outbound write closure --- .../net/http/nativeimpl/connection/ResponseWriter.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stdlib/http/src/main/java/org/ballerinalang/net/http/nativeimpl/connection/ResponseWriter.java b/stdlib/http/src/main/java/org/ballerinalang/net/http/nativeimpl/connection/ResponseWriter.java index a0f16dfe1eca..1153bc4063ad 100644 --- a/stdlib/http/src/main/java/org/ballerinalang/net/http/nativeimpl/connection/ResponseWriter.java +++ b/stdlib/http/src/main/java/org/ballerinalang/net/http/nativeimpl/connection/ResponseWriter.java @@ -177,9 +177,8 @@ public void onError(Throwable throwable) { ErrorValue httpConnectorError = HttpUtil.createHttpError(throwable.getMessage(), HttpErrorType.GENERIC_LISTENER_ERROR); if (outboundMsgDataStreamer != null) { - if (throwable instanceof IOException) { - this.dataContext.getOutboundRequest().setIoException((IOException) throwable); - } else { + // Relevant transport state should set the IO Exception. Following code snippet is for other exceptions + if (!(throwable instanceof IOException)) { this.dataContext.getOutboundRequest() .setIoException(new IOException(throwable.getMessage(), throwable)); } From 7814b9bdee86fada91a5a2892ab3f08010c95221 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Tue, 22 Oct 2019 10:57:28 +0530 Subject: [PATCH 018/167] Add review suggestions --- tool-plugins/intellij/src/main/resources/META-INF/plugin.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml index 05b58704c78c..9fdf9cde2b4c 100644 --- a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml +++ b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml @@ -13,8 +13,8 @@ -
  • Added fixes for ballerina external library tracker.
  • -
  • Added debugger related minor fixes and improvements.
  • +
  • Added fixes for Ballerina external library tracker.
  • +
  • Added debugger-related minor fixes and improvements.
  • Fixed package reference highlighting inside annotation attachments.
  • ]]> From 147396dd189b0d1b237937004a02028b9989cc9d Mon Sep 17 00:00:00 2001 From: Hemika Kodikara Date: Tue, 22 Oct 2019 11:21:52 +0530 Subject: [PATCH 019/167] Revert "invalidate home repo bir upon ballerina version" This reverts commit 1e03e5e2 --- .../java/org/ballerinalang/packerina/task/CreateBirTask.java | 4 +++- .../wso2/ballerinalang/compiler/util/ProjectDirConstants.java | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java index 7928fed9c82e..9524f03abadb 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java @@ -74,7 +74,9 @@ private void writeImportBir(BuildContext buildContext, List impo // If not fetch from home bir cache. importBir = buildContext.getBirPathFromHomeCache(id); // Write only if bir does not exists. No need to overwrite. - birWriter.writeBIRToPath(bPackageSymbol.birPackageFile, id, importBir, true); + if (Files.notExists(importBir)) { + birWriter.writeBIRToPath(bPackageSymbol.birPackageFile, id, importBir); + } } // write child import bir(s) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java index f74383f86f32..6084c83d3aba 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java @@ -81,8 +81,6 @@ private ProjectDirConstants() { public static final String JAVA_MAIN = "main"; public static final String FILE_NAME_DELIMITER = "-"; - - public static final String BIR_BALLERINA_VERSION_CACHE_FILE_NAME = "ballerina-version"; // Balo specific constants public static final String BALO_METADATA_DIR_NAME = "metadata"; From 0e461d44e7e56847a542cb185866c019450c353c Mon Sep 17 00:00:00 2001 From: Hemika Kodikara Date: Tue, 22 Oct 2019 11:23:20 +0530 Subject: [PATCH 020/167] revert bir-cache-invalidate-fix --- .../packerina/task/CreateBirTask.java | 1 + .../packerina/writer/BirFileWriter.java | 22 ++------ .../compiler/packaging/repo/HomeBirRepo.java | 53 +++++-------------- 3 files changed, 16 insertions(+), 60 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java index 9524f03abadb..0a81cf1d52c4 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBirTask.java @@ -27,6 +27,7 @@ import org.wso2.ballerinalang.compiler.util.CompilerContext; import org.wso2.ballerinalang.compiler.util.ProjectDirs; +import java.nio.file.Files; import java.nio.file.Path; import java.util.List; diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BirFileWriter.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BirFileWriter.java index 4b0493a49d90..d4a22aab1576 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BirFileWriter.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BirFileWriter.java @@ -26,15 +26,11 @@ import org.wso2.ballerinalang.compiler.util.CompilerContext; import org.wso2.ballerinalang.programfile.CompiledBinaryFile; import org.wso2.ballerinalang.programfile.PackageFileWriter; -import org.wso2.ballerinalang.util.RepoUtils; import java.io.IOException; -import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; -import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BIR_BALLERINA_VERSION_CACHE_FILE_NAME; - /** * Write a bir to cache. * @@ -99,27 +95,15 @@ private void writeBIRToProjectCache(BLangPackage module, Path birFilePath) { } public void writeBIRToPath(CompiledBinaryFile.BIRPackageFile birPackageFile, PackageID id, Path birFilePath) { - writeBIRToPath(birPackageFile, id, birFilePath, false); - } - - public void writeBIRToPath(CompiledBinaryFile.BIRPackageFile birPackageFile, PackageID id, Path birFilePath, - boolean createBalVersionCache) { + try { byte[] pkgBirBinaryContent = PackageFileWriter.writePackage(birPackageFile); Files.write(birFilePath, pkgBirBinaryContent); - - Path versionDir = birFilePath.getParent(); - if (createBalVersionCache && versionDir != null) { - Path moduleDir = versionDir.getParent(); - if (moduleDir != null) { - Files.write(moduleDir.resolve(BIR_BALLERINA_VERSION_CACHE_FILE_NAME), - RepoUtils.getBallerinaVersion().getBytes(Charset.defaultCharset())); - } - } } catch (IOException e) { String msg = "error writing the compiled module(bir) of '" + - id + "' to '" + birFilePath + "': " + e.getMessage(); + id + "' to '" + birFilePath + "': " + e.getMessage(); throw new BLangCompilerException(msg, e); } } + } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java index ba37338fcbc0..a1e27576ca15 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java @@ -25,64 +25,35 @@ import org.wso2.ballerinalang.compiler.util.ProjectDirConstants; import org.wso2.ballerinalang.util.RepoUtils; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; import java.nio.file.Path; import static org.wso2.ballerinalang.compiler.packaging.Patten.LATEST_VERSION_DIR; import static org.wso2.ballerinalang.compiler.packaging.Patten.path; -import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BIR_BALLERINA_VERSION_CACHE_FILE_NAME; /** * Repo for bir_cache in home repository. */ public class HomeBirRepo implements Repo { - private Path birCache; private PathConverter pathConverter; public HomeBirRepo() { - this.birCache = RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME); - this.pathConverter = new PathConverter(this.birCache); + Path repoLocation = RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME); + this.pathConverter = new PathConverter(repoLocation); } @Override public Patten calculate(PackageID moduleID) { - try { - String orgName = moduleID.getOrgName().getValue(); - String pkgName = moduleID.getName().getValue(); - Patten.Part version; - String versionStr = moduleID.getPackageVersion().getValue(); - if (versionStr.isEmpty()) { - version = LATEST_VERSION_DIR; - } else { - version = path(versionStr); - } - - Path ballerinaVersionCachePath = this.birCache.resolve(orgName).resolve(pkgName) - .resolve(BIR_BALLERINA_VERSION_CACHE_FILE_NAME); - - // if ballerina version cache file does not exists, - // then consider it that the current ballerina version it not - // compatible with the bir(if such exists) - if (Files.notExists(ballerinaVersionCachePath)) { - return Patten.NULL; - } - - if (Files.exists(ballerinaVersionCachePath)) { - String ballerinaVersion = new String(Files.readAllBytes(ballerinaVersionCachePath), - StandardCharsets.UTF_8); - // if ballerina version cache file exists but its a different version, then consider it that the - // current ballerina version it not compatible with the bir(if such exists) - if (!RepoUtils.getBallerinaVersion().equals(ballerinaVersion)) { - return Patten.NULL; - } - } - - return new Patten(path(orgName, pkgName), version, path(pkgName + ".bir")); - } catch (IOException e) { - return Patten.NULL; + String orgName = moduleID.getOrgName().getValue(); + String pkgName = moduleID.getName().getValue(); + Patten.Part version; + String versionStr = moduleID.getPackageVersion().getValue(); + if (versionStr.isEmpty()) { + version = LATEST_VERSION_DIR; + } else { + version = path(versionStr); } + + return new Patten(path(orgName, pkgName), version, path(pkgName + ".bir")); } @Override From 0e7d9628ea85b27dad2911027045ba899ab376a0 Mon Sep 17 00:00:00 2001 From: Hemika Kodikara Date: Tue, 22 Oct 2019 11:48:19 +0530 Subject: [PATCH 021/167] update home repo cache invalidation implementation --- .../packerina/buildcontext/BuildContext.java | 6 ++++-- .../packerina/task/CreateTargetDirTask.java | 10 +++------- .../compiler/packaging/repo/HomeBirRepo.java | 3 ++- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java index 8c720a7e1cf9..aa3e07cb5bfd 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java @@ -270,11 +270,13 @@ public Path getHomeRepoDir() { } public Path getBirCacheFromHome() { - return RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME); + return RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME + "-" + + RepoUtils.getBallerinaVersion()); } public Path getJarCacheFromHome() { - return RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.JAR_CACHE_DIR_NAME); + return RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.JAR_CACHE_DIR_NAME + "-" + + RepoUtils.getBallerinaVersion()); } public Path getBaloCacheFromHome() { diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateTargetDirTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateTargetDirTask.java index ba4631db3b10..382f356499b7 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateTargetDirTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateTargetDirTask.java @@ -20,7 +20,6 @@ import org.ballerinalang.packerina.buildcontext.BuildContext; import org.ballerinalang.packerina.buildcontext.BuildContextField; -import org.wso2.ballerinalang.compiler.util.ProjectDirConstants; import org.wso2.ballerinalang.util.RepoUtils; import java.io.IOException; @@ -43,13 +42,10 @@ public void execute(BuildContext buildContext) { } // We create a home repo if home repo path not exists Path homeRepo = RepoUtils.createAndGetHomeReposPath(); - Path baloCache = homeRepo.resolve(ProjectDirConstants.BALO_CACHE_DIR_NAME); - Path birCache = homeRepo.resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME); - Path jarCache = homeRepo.resolve(ProjectDirConstants.JAR_CACHE_DIR_NAME); Files.createDirectories(homeRepo); - Files.createDirectories(baloCache); - Files.createDirectories(birCache); - Files.createDirectories(jarCache); + Files.createDirectories(buildContext.getBaloCacheFromHome()); + Files.createDirectories(buildContext.getBirCacheFromHome()); + Files.createDirectories(buildContext.getJarCacheFromHome()); } catch (IOException e) { throw createLauncherException("unable to create target directory: " + targetDir); } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java index a1e27576ca15..0d56a2c7bb24 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/packaging/repo/HomeBirRepo.java @@ -37,7 +37,8 @@ public class HomeBirRepo implements Repo { private PathConverter pathConverter; public HomeBirRepo() { - Path repoLocation = RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME); + Path repoLocation = RepoUtils.createAndGetHomeReposPath().resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME + "-" + + RepoUtils.getBallerinaVersion()); this.pathConverter = new PathConverter(repoLocation); } From dd15affadace30ee354c941e46759845b41f907b Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 11 Sep 2019 20:35:51 +0530 Subject: [PATCH 022/167] Fix few datastructure bottlenecks --- .../compiler/bir/writer/ConstantPool.java | 27 ++++++-- .../compiler/semantics/analyzer/Types.java | 68 +++++++++---------- 2 files changed, 55 insertions(+), 40 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java index 5abf137460f5..7aaf799e6840 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java @@ -29,7 +29,9 @@ import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * A pool of constant values in the binary BIR file. @@ -41,18 +43,31 @@ public class ConstantPool { // Size to be written to tag a null value private static final int NULL_VALUE_FIELD_SIZE_TAG = -1; + private final Map cpEntriesMap = new HashMap<>(); private final List cpEntries = new ArrayList<>(); + public int addCPEntry(CPEntry cpEntry) { - int i = cpEntries.indexOf(cpEntry); - if (i >= 0) { - return i; + int size = cpEntries.size(); + Integer position = cpEntriesMap.get(cpEntry); + if (position == null) { + cpEntries.add(cpEntry); + cpEntriesMap.put(cpEntry, size); + return size; } - - cpEntries.add(cpEntry); - return cpEntries.size() - 1; + return position; } +// public int addCPEntry(CPEntry cpEntry) { +// int i = cpEntries.indexOf(cpEntry); +// if (i >= 0) { +// return i; +// } +// +// cpEntries.add(cpEntry); +// return cpEntries.size() - 1; +// } + public int addShapeCPEntry(BType shape) { CPEntry.ShapeCPEntry shapeCPEntry = new CPEntry.ShapeCPEntry(shape); return addCPEntry(shapeCPEntry); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java index 31e60ece2c41..8072547d756e 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java @@ -195,10 +195,10 @@ public boolean isLax(BType type) { } public boolean isSameType(BType source, BType target) { - return isSameType(source, target, new ArrayList<>()); + return isSameType(source, target, new HashSet<>()); } - private boolean isSameType(BType source, BType target, List unresolvedTypes) { + private boolean isSameType(BType source, BType target, Set unresolvedTypes) { // If we encounter two types that we are still resolving, then skip it. // This is done to avoid recursive checking of the same type. TypePair pair = new TypePair(source, target); @@ -335,7 +335,7 @@ public boolean isBrandedType(BType type) { * @return true if source type is assignable to the target type. */ public boolean isAssignable(BType source, BType target) { - return isAssignable(source, target, new ArrayList<>()); + return isAssignable(source, target, new HashSet<>()); } boolean isStampingAllowed(BType source, BType target) { @@ -347,7 +347,7 @@ private boolean checkTypeEquivalencyForStamping(BType source, BType target) { if (target.tag == TypeTags.RECORD) { if (source.tag == TypeTags.RECORD) { TypePair pair = new TypePair(source, target); - List unresolvedTypes = new ArrayList<>(); + Set unresolvedTypes = new HashSet<>(); unresolvedTypes.add(pair); return checkRecordEquivalencyForStamping((BRecordType) source, (BRecordType) target, unresolvedTypes); } else if (source.tag == TypeTags.MAP) { @@ -394,7 +394,7 @@ private boolean checkTypeEquivalencyForStamping(BType source, BType target) { } private boolean checkRecordEquivalencyForStamping(BRecordType rhsType, BRecordType lhsType, - List unresolvedTypes) { + Set unresolvedTypes) { // Both records should be public or private. // Get the XOR of both flags(masks) // If both are public, then public bit should be 0; @@ -423,7 +423,7 @@ private boolean checkRecordEquivalencyForStamping(BRecordType rhsType, BRecordTy } private boolean checkFieldEquivalencyForStamping(BStructureType lhsType, BStructureType rhsType, - List unresolvedTypes) { + Set unresolvedTypes) { Map rhsFields = rhsType.fields.stream().collect( Collectors.toMap(BField::getName, field -> field)); @@ -496,7 +496,7 @@ private boolean checkTupleEquivalencyForStamping(BType source, BType target) { return true; } - private boolean isAssignable(BType source, BType target, List unresolvedTypes) { + private boolean isAssignable(BType source, BType target, Set unresolvedTypes) { if (isSameType(source, target)) { return true; @@ -618,7 +618,7 @@ private boolean isAssignable(BType source, BType target, List unresolv } if (source.tag == TypeTags.INVOKABLE && target.tag == TypeTags.INVOKABLE) { - return isFunctionTypeAssignable((BInvokableType) source, (BInvokableType) target, new ArrayList<>()); + return isFunctionTypeAssignable((BInvokableType) source, (BInvokableType) target, new HashSet<>()); } return source.tag == TypeTags.ARRAY && target.tag == TypeTags.ARRAY && @@ -638,7 +638,7 @@ private boolean recordFieldsAssignableToMap(BRecordType recordType, BMapType tar return recordType.fields.stream().allMatch(field -> isAssignable(field.type, targetMapType.constraint)); } - private boolean isErrorTypeAssignable(BErrorType source, BErrorType target, List unresolvedTypes) { + private boolean isErrorTypeAssignable(BErrorType source, BErrorType target, Set unresolvedTypes) { if (target == symTable.errorType) { return true; } @@ -651,7 +651,7 @@ private boolean isErrorTypeAssignable(BErrorType source, BErrorType target, List isAssignable(source.detailType, target.detailType, unresolvedTypes); } - private boolean isTupleTypeAssignable(BType source, BType target, List unresolvedTypes) { + private boolean isTupleTypeAssignable(BType source, BType target, Set unresolvedTypes) { if (source.tag != TypeTags.TUPLE || target.tag != TypeTags.TUPLE) { return false; } @@ -684,7 +684,7 @@ private boolean isTupleTypeAssignable(BType source, BType target, List } private boolean isTupleTypeAssignableToArrayType(BTupleType source, BArrayType target, - List unresolvedTypes) { + Set unresolvedTypes) { if (target.state != BArrayState.UNSEALED && (source.restType != null || source.tupleTypes.size() != target.size)) { return false; @@ -699,7 +699,7 @@ private boolean isTupleTypeAssignableToArrayType(BTupleType source, BArrayType t } private boolean isArrayTypeAssignableToTupleType(BArrayType source, BTupleType target, - List unresolvedTypes) { + Set unresolvedTypes) { if (!target.tupleTypes.isEmpty()) { if (source.state == BArrayState.UNSEALED) { // [int, int, int...] = int[] || [int, int] = int[] @@ -726,7 +726,7 @@ private boolean isArrayTypeAssignableToTupleType(BArrayType source, BTupleType t .allMatch(tupleElemType -> isAssignable(source.eType, tupleElemType, unresolvedTypes)); } - public boolean isArrayTypesAssignable(BType source, BType target, List unresolvedTypes) { + public boolean isArrayTypesAssignable(BType source, BType target, Set unresolvedTypes) { if (target.tag == TypeTags.ARRAY && source.tag == TypeTags.ARRAY) { // Both types are array types BArrayType lhsArrayType = (BArrayType) target; @@ -772,7 +772,7 @@ public boolean isArrayTypesAssignable(BType source, BType target, List } private boolean isFunctionTypeAssignable(BInvokableType source, BInvokableType target, - List unresolvedTypes) { + Set unresolvedTypes) { // For invokable types with typeParam parameters, we have to check whether the source param types are // covariant with the target param types. if (containsTypeParams(target)) { @@ -832,12 +832,12 @@ private boolean containsTypeParams(BInvokableType type) { return TypeParamAnalyzer.isTypeParam(type.retType); } - private boolean isSameFunctionType(BInvokableType source, BInvokableType target, List unresolvedTypes) { + private boolean isSameFunctionType(BInvokableType source, BInvokableType target, Set unresolvedTypes) { return checkFunctionTypeEquality(source, target, unresolvedTypes, this::isSameType); } private boolean checkFunctionTypeEquality(BInvokableType source, BInvokableType target, - List unresolvedTypes, TypeEqualityPredicate equality) { + Set unresolvedTypes, TypeEqualityPredicate equality) { if (source.paramTypes.size() != target.paramTypes.size()) { return false; } @@ -859,7 +859,7 @@ private boolean checkFunctionTypeEquality(BInvokableType source, BInvokableType return isAssignable(source.retType, target.retType, unresolvedTypes); } - public boolean checkArrayEquality(BType source, BType target, List unresolvedTypes) { + public boolean checkArrayEquality(BType source, BType target, Set unresolvedTypes) { if (target.tag == TypeTags.ARRAY && source.tag == TypeTags.ARRAY) { // Both types are array types BArrayType lhsArrayType = (BArrayType) target; @@ -880,10 +880,10 @@ public boolean checkSealedArraySizeEquality(BArrayType rhsArrayType, BArrayType } public boolean checkStructEquivalency(BType rhsType, BType lhsType) { - return checkStructEquivalency(rhsType, lhsType, new ArrayList<>()); + return checkStructEquivalency(rhsType, lhsType, new HashSet<>()); } - private boolean checkStructEquivalency(BType rhsType, BType lhsType, List unresolvedTypes) { + private boolean checkStructEquivalency(BType rhsType, BType lhsType, Set unresolvedTypes) { // If we encounter two types that we are still resolving, then skip it. // This is done to avoid recursive checking of the same type. TypePair pair = new TypePair(rhsType, lhsType); @@ -903,7 +903,7 @@ private boolean checkStructEquivalency(BType rhsType, BType lhsType, List unresolvedTypes) { + public boolean checkObjectEquivalency(BObjectType rhsType, BObjectType lhsType, Set unresolvedTypes) { BObjectTypeSymbol lhsStructSymbol = (BObjectTypeSymbol) lhsType.tsymbol; BObjectTypeSymbol rhsStructSymbol = (BObjectTypeSymbol) rhsType.tsymbol; List lhsFuncs = lhsStructSymbol.attachedFuncs; @@ -959,7 +959,7 @@ private int getObjectFuncCount(BObjectTypeSymbol sym) { return sym.attachedFuncs.size(); } - public boolean checkRecordEquivalency(BRecordType rhsType, BRecordType lhsType, List unresolvedTypes) { + public boolean checkRecordEquivalency(BRecordType rhsType, BRecordType lhsType, Set unresolvedTypes) { // If the LHS record is closed and the RHS record is open, the records aren't equivalent if (lhsType.sealed && !rhsType.sealed) { return false; @@ -1287,7 +1287,7 @@ public boolean checkListenerCompatibility(BType type) { return false; } - BAttachedFunction rhsFunc = getMatchingInvokableType(rhsFuncs, lhsFunc, new ArrayList<>()); + BAttachedFunction rhsFunc = getMatchingInvokableType(rhsFuncs, lhsFunc, new HashSet<>()); if (rhsFunc == null || !Symbols.isPublic(rhsFunc.symbol)) { return false; } @@ -1316,11 +1316,11 @@ private BCastOperatorSymbol createCastOperatorSymbol(BType sourceType, } private BSymbol getExplicitArrayCastOperator(BType t, BType s, BType origT, BType origS) { - return getExplicitArrayCastOperator(t, s, origT, origS, new ArrayList<>()); + return getExplicitArrayCastOperator(t, s, origT, origS, new HashSet<>()); } private BSymbol getExplicitArrayCastOperator(BType t, BType s, BType origT, BType origS, - List unresolvedTypes) { + Set unresolvedTypes) { if (t.tag == TypeTags.ARRAY && s.tag == TypeTags.ARRAY) { return getExplicitArrayCastOperator(((BArrayType) t).eType, ((BArrayType) s).eType, origT, origS, unresolvedTypes); @@ -1576,7 +1576,7 @@ public BSymbol visit(BInvokableType t, BType s) { if (s == symTable.anyType) { return createCastOperatorSymbol(s, t, false, InstructionCodes.CHECKCAST); } else if (s.tag == TypeTags.INVOKABLE && isFunctionTypeAssignable((BInvokableType) s, t, - new ArrayList<>())) { + new HashSet<>())) { return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); } @@ -1632,9 +1632,9 @@ public BSymbol visit(BTypedescType t, BType s) { private class BSameTypeVisitor implements BTypeVisitor { - List unresolvedTypes; + Set unresolvedTypes; - BSameTypeVisitor(List unresolvedTypes) { + BSameTypeVisitor(Set unresolvedTypes) { this.unresolvedTypes = unresolvedTypes; } @@ -1706,7 +1706,7 @@ public Boolean visit(BJSONType t, BType s) { @Override public Boolean visit(BArrayType t, BType s) { - return s.tag == TypeTags.ARRAY && checkArrayEquality(s, t, new ArrayList<>()); + return s.tag == TypeTags.ARRAY && checkArrayEquality(s, t, new HashSet<>()); } @Override @@ -1785,7 +1785,7 @@ public Boolean visit(BStreamType t, BType s) { @Override public Boolean visit(BInvokableType t, BType s) { - return s.tag == TypeTags.INVOKABLE && isSameFunctionType((BInvokableType) s, t, new ArrayList<>()); + return s.tag == TypeTags.INVOKABLE && isSameFunctionType((BInvokableType) s, t, new HashSet<>()); } @Override @@ -1860,7 +1860,7 @@ public Boolean visit(BFiniteType t, BType s) { }; - private boolean checkFieldEquivalency(BRecordType lhsType, BRecordType rhsType, List unresolvedTypes) { + private boolean checkFieldEquivalency(BRecordType lhsType, BRecordType rhsType, Set unresolvedTypes) { Map rhsFields = rhsType.fields.stream().collect(Collectors.toMap(BField::getName, f -> f)); // Check if the RHS record has corresponding fields to those of the LHS record. @@ -1892,7 +1892,7 @@ private boolean checkFieldEquivalency(BRecordType lhsType, BRecordType rhsType, } private BAttachedFunction getMatchingInvokableType(List rhsFuncList, BAttachedFunction lhsFunc, - List unresolvedTypes) { + Set unresolvedTypes) { return rhsFuncList.stream() .filter(rhsFunc -> lhsFunc.funcName.equals(rhsFunc.funcName)) .filter(rhsFunc -> isFunctionTypeAssignable(rhsFunc.type, lhsFunc.type, unresolvedTypes)) @@ -1910,7 +1910,7 @@ private boolean isInSameVisibilityRegion(BSymbol lhsSym, BSymbol rhsSym) { return !Symbols.isPrivate(rhsSym) && !Symbols.isPublic(rhsSym) && lhsSym.pkgID.equals(rhsSym.pkgID); } - private boolean isAssignableToUnionType(BType source, BType target, List unresolvedTypes) { + private boolean isAssignableToUnionType(BType source, BType target, Set unresolvedTypes) { Set sourceTypes = new LinkedHashSet<>(); Set targetTypes = new LinkedHashSet<>(); @@ -1934,7 +1934,7 @@ private boolean isAssignableToUnionType(BType source, BType target, List unresolvedTypes) { + private boolean isFiniteTypeAssignable(BFiniteType finiteType, BType targetType, Set unresolvedTypes) { if (targetType.tag == TypeTags.FINITE) { return finiteType.valueSpace.stream() .allMatch(expression -> isAssignableToFiniteType(targetType, (BLangLiteral) expression)); @@ -2664,6 +2664,6 @@ public int hashCode() { * @since 0.995.0 */ private interface TypeEqualityPredicate { - boolean test(BType source, BType target, List unresolvedTypes); + boolean test(BType source, BType target, Set unresolvedTypes); } } From 392201ca648d6b23a2e34d2634af7bb68d209812 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Thu, 12 Sep 2019 06:26:09 +0530 Subject: [PATCH 023/167] Retriger the build --- .../compiler/semantics/analyzer/SemanticAnalyzer.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index dca197a22baf..7dbd2beea2d5 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -467,7 +467,7 @@ public void visit(BLangErrorType errorType) { BType detailType = errorType.detailType.type; if (!types.isValidErrorDetailType(detailType)) { - dlog.error(errorType.detailType.pos, DiagnosticCode.INVALID_ERROR_DETAIL_TYPE, errorType.detailType, + dlog.error(errorType.detailType.pos, DiagnosticCode.INVALID_ERROR_DETAIL_TYPE, detailType, symTable.detailType); } } @@ -1367,7 +1367,12 @@ private boolean validateErrorVariable(BLangErrorVariable errorVariable, BErrorTy } } - if (isRestDetailBindingAvailable(errorVariable)) { + // todo: remote below + // add useless code to get build re-triggered. + int j = 0; + for(int i = 0; i < 100; i++) { + j += i; + }if (isRestDetailBindingAvailable(errorVariable)) { BTypeSymbol typeSymbol = createTypeSymbol(SymTag.TYPE); BMapType restType = new BMapType(TypeTags.MAP, recordType.restFieldType, typeSymbol); typeSymbol.type = restType; From 0c829cb1ee9f43a9edb9cec232e27ca6a2ef56f6 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Thu, 12 Sep 2019 07:20:49 +0530 Subject: [PATCH 024/167] Fix checkstyle (cherry picked from commit 542f25b2ada9a7a645094926ca5b93d388a0dd7d) --- .../compiler/semantics/analyzer/SemanticAnalyzer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index 7dbd2beea2d5..118b0dfd97c3 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -1370,7 +1370,7 @@ private boolean validateErrorVariable(BLangErrorVariable errorVariable, BErrorTy // todo: remote below // add useless code to get build re-triggered. int j = 0; - for(int i = 0; i < 100; i++) { + for (int i = 0; i < 100; i++) { j += i; }if (isRestDetailBindingAvailable(errorVariable)) { BTypeSymbol typeSymbol = createTypeSymbol(SymTag.TYPE); From d5c7f3fdd5e68cde8744ca995ef25965f1164665 Mon Sep 17 00:00:00 2001 From: aashikam Date: Mon, 21 Oct 2019 15:08:05 +0530 Subject: [PATCH 025/167] Add rabbitmq module to ballerina distribution --- distribution/zip/jballerina/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/distribution/zip/jballerina/build.gradle b/distribution/zip/jballerina/build.gradle index 6dbf1bebc840..15452d834684 100644 --- a/distribution/zip/jballerina/build.gradle +++ b/distribution/zip/jballerina/build.gradle @@ -93,6 +93,7 @@ dependencies { dist 'com.google.protobuf:protobuf-java:3.9.1' dist 'org.wso2.orbit.org.yaml:snakeyaml:1.16.0.wso2v1' dist 'org.wso2.staxon:staxon-core:1.2.0.wso2v2' + dist 'com.rabbitmq:amqp-client:5.7.3' dist 'com.jcraft:jzlib:1.1.3' dist 'io.nats:java-nats-streaming:2.2.1' dist 'io.nats:jnats:2.6.0' @@ -134,6 +135,7 @@ dependencies { distBal project(path: ':ballerina-xslt', configuration: 'baloImplementation') distBal project(path: ':ballerina-kafka', configuration: 'baloImplementation') distBal project(path: ':ballerina-nats', configuration: 'baloImplementation') + distBal project(path: ':ballerina-rabbitmq', configuration: 'baloImplementation') distBal project(path: ':ballerina-stringutils', configuration: 'baloImplementation') distBal project(path: ':ballerina-utils', configuration: 'baloImplementation') distBal project(path: ':ballerina-jwt', configuration: 'baloImplementation') @@ -189,6 +191,7 @@ dependencies { balSource project(path: ':ballerina-xslt', configuration: 'balSource') balSource project(path: ':ballerina-kafka', configuration: 'balSource') balSource project(path: ':ballerina-nats', configuration: 'balSource') + balSource project(path: ':ballerina-rabbitmq', configuration: 'balSource') balSource project(path: ':ballerina-stringutils', configuration: 'balSource') balSource project(path: ':ballerina-utils', configuration: 'balSource') balSource project(path: ':ballerina-jwt', configuration: 'balSource') @@ -261,6 +264,7 @@ dependencies { dist project(':tracing-extensions:ballerina-jaeger-extension') dist project(':ballerina-kafka') dist project(':ballerina-nats') + dist project(':ballerina-rabbitmq') dist project(':ballerina-stringutils') dist project(':ballerina-jwt') dist project(':ballerina-oauth2') From 9763577553878eb028ef09e4d4bbdecbbaa6e928 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Thu, 12 Sep 2019 15:39:19 +0530 Subject: [PATCH 026/167] Improve runtime type related perf bottleneck (cherry picked from commit f1050bceb97b7abc2aa7cfe03f5e6b6c2d422423) --- .../main/java/org/ballerinalang/jvm/types/BType.java | 1 + .../java/org/ballerinalang/jvm/types/BUnionType.java | 12 +++++------- .../semantics/analyzer/SemanticAnalyzer.java | 7 +------ 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java index 80faeb4a0b84..d9d56129b478 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java @@ -34,6 +34,7 @@ public abstract class BType { protected BPackage pkg; protected Class valueClass; private int hashCode; + public Boolean isAnydata; protected BType(String typeName, BPackage pkg, Class valueClass) { this.typeName = typeName; diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java index 2678ce3166c5..a0febce738c6 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java @@ -18,6 +18,7 @@ package org.ballerinalang.jvm.types; import java.util.Arrays; +import java.util.HashSet; import java.util.List; import java.util.Objects; @@ -137,16 +138,13 @@ public boolean equals(Object o) { } BUnionType that = (BUnionType) o; - if (this.memberTypes.size() != that.memberTypes.size()) { + if (that.memberTypes.size() != memberTypes.size()) { return false; } - for (int i = 0; i < memberTypes.size(); i++) { - if (!this.memberTypes.get(i).equals(that.memberTypes.get(i))) { - return false; - } - } - return true; + HashSet memberSet = new HashSet<>(memberTypes); + memberSet.removeAll(that.memberTypes); + return memberSet.isEmpty(); } @Override diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index 118b0dfd97c3..7ca9be1516b9 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -1367,12 +1367,7 @@ private boolean validateErrorVariable(BLangErrorVariable errorVariable, BErrorTy } } - // todo: remote below - // add useless code to get build re-triggered. - int j = 0; - for (int i = 0; i < 100; i++) { - j += i; - }if (isRestDetailBindingAvailable(errorVariable)) { + if (isRestDetailBindingAvailable(errorVariable)) { BTypeSymbol typeSymbol = createTypeSymbol(SymTag.TYPE); BMapType restType = new BMapType(TypeTags.MAP, recordType.restFieldType, typeSymbol); typeSymbol.type = restType; From da6aad1ccccce93952c8213cddf8772c04a79782 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Sat, 14 Sep 2019 14:25:43 +0530 Subject: [PATCH 027/167] Remove few more bottlenecks (cherry picked from commit 3446bc29fa9df176ac0989c71906c56c75f06420) --- .../jvm/scheduling/Scheduler.java | 24 +++++++++++++++++++ .../ballerinalang/jvm/types/BUnionType.java | 21 ++++++++++++---- .../semantics/analyzer/TypeNarrower.java | 11 +++++---- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java index 44fcc0211b54..2a2b3d6d3da1 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java @@ -73,6 +73,7 @@ public class Scheduler { private static int poolSize = Runtime.getRuntime().availableProcessors() * 2; private Semaphore mainBlockSem; + private static LogicalProcessorCount logicalProcessorCount = new LogicalProcessorCount(); public Scheduler(boolean immortal) { try { @@ -371,6 +372,29 @@ public void poison() { runnableList.add(POISON_PILL); } } + + private void infectResourceFunction(Strand strand, FutureValue futureValue) { + String gTransactionId = (String) strand.getProperty(GLOBAL_TRANSACTION_ID); + if (gTransactionId != null) { + String globalTransactionId = strand.getProperty(GLOBAL_TRANSACTION_ID).toString(); + String url = strand.getProperty(TRANSACTION_URL).toString(); + TransactionLocalContext transactionLocalContext = TransactionLocalContext.create(globalTransactionId, + url, "2pc"); + strand.setLocalTransactionContext(transactionLocalContext); + futureValue.transactionLocalContext = transactionLocalContext; + } + } + + private static class LogicalProcessorCount { + private int threadCount; + LogicalProcessorCount() { + threadCount = Runtime.getRuntime().availableProcessors() * 2; + } + + int getAllowedThreadCount() { + return threadCount; + } + } } /** diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java index a0febce738c6..f1796faa43cf 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java @@ -138,13 +138,26 @@ public boolean equals(Object o) { } BUnionType that = (BUnionType) o; - if (that.memberTypes.size() != memberTypes.size()) { + int memberTypeCount = memberTypes.size(); + if (that.memberTypes.size() != memberTypeCount) { return false; } - HashSet memberSet = new HashSet<>(memberTypes); - memberSet.removeAll(that.memberTypes); - return memberSet.isEmpty(); + for (int i = 0; i < memberTypeCount; i++) { + BType m = memberTypes.get(i); + boolean found = false; + for (int j = 0; j < memberTypeCount; j++) { + BType n = that.memberTypes.get(j); + if (m.equals(n)) { + found = true; + break; + } + } + if (!found) { + return false; + } + } + return true; } @Override diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeNarrower.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeNarrower.java index 56bda9ffc8eb..cae170766e55 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeNarrower.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/TypeNarrower.java @@ -129,10 +129,13 @@ public void visit(BLangUnaryExpr unaryExpr) { return; } - unaryExpr.narrowedTypeInfo = getNarrowedTypes(unaryExpr.expr, env).entrySet().stream() - .collect(Collectors.toMap( - entry -> entry.getKey(), - entry -> new NarrowedTypes(entry.getValue().falseType, entry.getValue().trueType))); + Map narrowedTypes = getNarrowedTypes(unaryExpr.expr, env); + Map newMap = new HashMap<>(narrowedTypes.size()); + for (Map.Entry entry : narrowedTypes.entrySet()) { + newMap.put(entry.getKey(), new NarrowedTypes(entry.getValue().falseType, entry.getValue().trueType)); + } + + unaryExpr.narrowedTypeInfo = newMap; } @Override From bf405ad31032a1499e82c3edc5cc7ebfc9a8da4e Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Sat, 14 Sep 2019 15:23:03 +0530 Subject: [PATCH 028/167] Fix checkstyle error (cherry picked from commit 4bda55c86547e277b0c2e8474b4404accec1153f) --- .../src/main/java/org/ballerinalang/jvm/types/BUnionType.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java index f1796faa43cf..260822988048 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java @@ -18,7 +18,6 @@ package org.ballerinalang.jvm.types; import java.util.Arrays; -import java.util.HashSet; import java.util.List; import java.util.Objects; From 8396a55fc32cdf271ef4c78e2cfbbefe5d5cdcd2 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 25 Sep 2019 10:18:26 +0530 Subject: [PATCH 029/167] Simplify BType.equals method (cherry picked from commit 8fb4b5d53d66b850e472d0508f30cf62f7dc0e3b) --- .../java/org/ballerinalang/jvm/types/BType.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java index d9d56129b478..aeb3f0c91e00 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java @@ -92,10 +92,15 @@ public boolean equals(Object obj) { return namesEqual; } - if (this.pkg.getName() == null && other.pkg.getName() == null) { - return namesEqual; - } else if (this.pkg.getName() != null && other.pkg.getName() != null) { - return this.pkg.getName().equals(other.pkg.getName()) && namesEqual; + String thisPkgName = this.pkg.getName(); + String otherPkgName = other.pkg.getName(); + + if (otherPkgName == null) { + if (thisPkgName == null) { + return namesEqual; + } + } else if (thisPkgName != null) { + return namesEqual && thisPkgName.equals(otherPkgName); } } return false; From 308733af7e30f8655a59733227b57075eaa13ef5 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 9 Oct 2019 10:11:45 +0530 Subject: [PATCH 030/167] Clean up the code (cherry picked from commit c70aee08ac66116d3a9644123585f2fa3f32caea) --- .../org/ballerinalang/jvm/types/BType.java | 1 - .../compiler/bir/writer/ConstantPool.java | 13 +- .../compiler/semantics/analyzer/Types.java | 316 ------------------ 3 files changed, 1 insertion(+), 329 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java index aeb3f0c91e00..9e10880d790b 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BType.java @@ -34,7 +34,6 @@ public abstract class BType { protected BPackage pkg; protected Class valueClass; private int hashCode; - public Boolean isAnydata; protected BType(String typeName, BPackage pkg, Class valueClass) { this.typeName = typeName; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java index 7aaf799e6840..8e00ebcfb9a8 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/bir/writer/ConstantPool.java @@ -46,7 +46,6 @@ public class ConstantPool { private final Map cpEntriesMap = new HashMap<>(); private final List cpEntries = new ArrayList<>(); - public int addCPEntry(CPEntry cpEntry) { int size = cpEntries.size(); Integer position = cpEntriesMap.get(cpEntry); @@ -58,16 +57,6 @@ public int addCPEntry(CPEntry cpEntry) { return position; } -// public int addCPEntry(CPEntry cpEntry) { -// int i = cpEntries.indexOf(cpEntry); -// if (i >= 0) { -// return i; -// } -// -// cpEntries.add(cpEntry); -// return cpEntries.size() - 1; -// } - public int addShapeCPEntry(BType shape) { CPEntry.ShapeCPEntry shapeCPEntry = new CPEntry.ShapeCPEntry(shape); return addCPEntry(shapeCPEntry); @@ -86,7 +75,7 @@ public byte[] serialize() { } } - private void overwriteSize(byte[] bytes) throws IOException { + private void overwriteSize(byte[] bytes) { int v = cpEntries.size(); bytes[0] = (byte) ((v >>> 24) & 0xFF); bytes[1] = (byte) ((v >>> 16) & 0xFF); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java index 8072547d756e..c9a419eb1b67 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/Types.java @@ -316,10 +316,6 @@ public boolean isSubTypeOfBaseType(BType type, int baseTypeTag) { return ((BUnionType) type).getMemberTypes().stream().allMatch(memType -> memType.tag == baseTypeTag); } - public boolean isBrandedType(BType type) { - return type.tag < TypeTags.ANY; - } - /** * Checks whether source type is assignable to the target type. *

    @@ -1315,321 +1311,10 @@ private BCastOperatorSymbol createCastOperatorSymbol(BType sourceType, false, safe, opcode, null, null); } - private BSymbol getExplicitArrayCastOperator(BType t, BType s, BType origT, BType origS) { - return getExplicitArrayCastOperator(t, s, origT, origS, new HashSet<>()); - } - - private BSymbol getExplicitArrayCastOperator(BType t, BType s, BType origT, BType origS, - Set unresolvedTypes) { - if (t.tag == TypeTags.ARRAY && s.tag == TypeTags.ARRAY) { - return getExplicitArrayCastOperator(((BArrayType) t).eType, ((BArrayType) s).eType, origT, origS, - unresolvedTypes); - } else if (t.tag == TypeTags.ARRAY) { - if (s.tag == TypeTags.JSON) { - // If the target type is JSON array, and the source type is a JSON - if (getElementType(t).tag == TypeTags.JSON) { - return createCastOperatorSymbol(origS, origT, false, InstructionCodes.CHECKCAST); - } else { - return createCastOperatorSymbol(origS, origT, false, InstructionCodes.JSON2ARRAY); - } - } - - // If only the target type is an array type, then the source type must be of type 'any' or 'anydata' - if (s.tag == TypeTags.ANY || s.tag == TypeTags.ANYDATA) { - return createCastOperatorSymbol(origS, origT, false, InstructionCodes.CHECKCAST); - } - return symTable.notFoundSymbol; - - } else if (s.tag == TypeTags.ARRAY) { - if (t.tag == TypeTags.JSON) { - if (getElementType(s).tag == TypeTags.JSON) { - return createCastOperatorSymbol(origS, origT, true, InstructionCodes.NOP); - } else { - // the conversion visitor below may report back a conversion symbol, which is - // unsafe (e.g. T2JSON), so we must make our one also unsafe - if (castVisitor.visit((BJSONType) t, ((BArrayType) s).eType) != symTable.notFoundSymbol) { - return createCastOperatorSymbol(origS, origT, false, InstructionCodes.ARRAY2JSON); - } - } - } - - // If only the source type is an array type, then the target type must be of type 'any' - if (t.tag == TypeTags.ANY) { - return createCastOperatorSymbol(origS, origT, true, InstructionCodes.NOP); - } - return symTable.notFoundSymbol; - } - - // Now both types are not array types - if (s == t) { - return createCastOperatorSymbol(origS, origT, true, InstructionCodes.NOP); - } - - if ((s.tag == TypeTags.OBJECT || s.tag == TypeTags.RECORD) - && (t.tag == TypeTags.OBJECT || t.tag == TypeTags.RECORD)) { - if (checkStructEquivalency(s, t, unresolvedTypes)) { - return createCastOperatorSymbol(origS, origT, true, InstructionCodes.NOP); - } else { - return createCastOperatorSymbol(origS, origT, false, InstructionCodes.CHECKCAST); - } - } - - if (isAssignable(s, t)) { - return createCastOperatorSymbol(origS, origT, true, InstructionCodes.NOP); - } - - if (isAssignable(t, s)) { - return createCastOperatorSymbol(origS, origT, false, InstructionCodes.CHECKCAST); - } - - return symTable.notFoundSymbol; - } - private boolean isNullable(BType fieldType) { return fieldType.isNullable(); } - private boolean checkUnionTypeToJSONConvertibility(BUnionType type, BJSONType target) { - // Check whether all the member types are convertible to JSON - return type.getMemberTypes().stream() - .anyMatch(memberType -> castVisitor.visit(memberType, target) == symTable.notFoundSymbol); - } - - private boolean checkJsonToMapConvertibility(BJSONType src, BMapType target) { - return true; - } - - private boolean checkMapToJsonConvertibility(BMapType src, BJSONType target) { - return true; - } - - private BTypeVisitor castVisitor = new BTypeVisitor() { - - @Override - public BSymbol visit(BType t, BType s) { - return symResolver.resolveOperator(Names.CAST_OP, Lists.of(s, t)); - } - - @Override - public BSymbol visit(BBuiltInRefType t, BType s) { - return symResolver.resolveOperator(Names.CAST_OP, Lists.of(s, t)); - } - - @Override - public BSymbol visit(BAnyType t, BType s) { - if (isValueType(s)) { - return symResolver.resolveOperator(Names.CAST_OP, Lists.of(s, t)); - } - - // TODO: 11/1/18 Remove the below check after verifying it doesn't break anything - // Here condition is added for prevent explicit cast assigning map union constrained - // to map any constrained. - if (s.tag == TypeTags.MAP && - ((BMapType) s).constraint.tag == TypeTags.UNION) { - return symTable.notFoundSymbol; - } - - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } - - @Override - public BSymbol visit(BAnydataType t, BType s) { - if (isValueType(s)) { - return symResolver.resolveOperator(Names.CAST_OP, Lists.of(s, t)); - } - - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } - - @Override - public BSymbol visit(BMapType t, BType s) { - if (isSameType(s, t)) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } else if (s.tag == TypeTags.MAP) { - if (t.constraint.tag == TypeTags.ANY) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } else if (((BMapType) s).constraint.tag == TypeTags.ANY) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.CHECKCAST); - } else if (checkStructEquivalency(((BMapType) s).constraint, - t.constraint)) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } else { - return symTable.notFoundSymbol; - } - } else if (s.tag == TypeTags.OBJECT || s.tag == TypeTags.RECORD) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.T2MAP); - } else if (s.tag == TypeTags.JSON) { - if (!checkJsonToMapConvertibility((BJSONType) s, t)) { - return symTable.notFoundSymbol; - } - return createCastOperatorSymbol(s, t, false, InstructionCodes.JSON2MAP); - } else if (s.tag == TypeTags.ANYDATA) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.ANY2MAP); - } - - return symResolver.resolveOperator(Names.CAST_OP, Lists.of(s, t)); - } - - @Override - public BSymbol visit(BXMLType t, BType s) { - return visit((BBuiltInRefType) t, s); - } - - @Override - public BSymbol visit(BJSONType t, BType s) { - if (isSameType(s, t)) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } else if (s.tag == TypeTags.OBJECT) { -// TODO: do type checking and fail for obvious incompatible types -// if (checkStructToJSONConvertibility(s)) { -// return createCastOperatorSymbol(s, t, false, InstructionCodes.T2JSON); -// } else { -// return symTable.notFoundSymbol; -// } - return createCastOperatorSymbol(s, t, false, InstructionCodes.T2JSON); - } else if (s.tag == TypeTags.JSON) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } else if (s.tag == TypeTags.ARRAY) { - return getExplicitArrayCastOperator(t, s, t, s); - } else if (s.tag == TypeTags.UNION) { - if (checkUnionTypeToJSONConvertibility((BUnionType) s, t)) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.O2JSON); - } - return symTable.notFoundSymbol; - } else if (s.tag == TypeTags.MAP) { - if (!checkMapToJsonConvertibility((BMapType) s, t)) { - return symTable.notFoundSymbol; - } - return createCastOperatorSymbol(s, t, false, InstructionCodes.MAP2JSON); - } - - return symResolver.resolveOperator(Names.CAST_OP, Lists.of(s, t)); - } - - @Override - public BSymbol visit(BArrayType t, BType s) { - return getExplicitArrayCastOperator(t, s, t, s); - } - - @Override - public BSymbol visit(BObjectType t, BType s) { - if (s == symTable.anyType) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.ANY2T); - } - - if ((s.tag == TypeTags.OBJECT || s.tag == TypeTags.RECORD) && checkStructEquivalency(s, t)) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } else if (s.tag == TypeTags.OBJECT || s.tag == TypeTags.RECORD || s.tag == TypeTags.ANY) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.CHECKCAST); - } else if (s.tag == TypeTags.MAP) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.MAP2T); - } else if (s.tag == TypeTags.JSON) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.JSON2T); - } - - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BRecordType t, BType s) { - if (s == symTable.anyType || s == symTable.anydataType) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.ANY2T); - } - - if ((s.tag == TypeTags.RECORD || s.tag == TypeTags.OBJECT) && checkStructEquivalency(s, t)) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } else if (s.tag == TypeTags.RECORD || s.tag == TypeTags.OBJECT || s.tag == TypeTags.ANY) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.CHECKCAST); - } else if (s.tag == TypeTags.MAP) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.MAP2T); - } else if (s.tag == TypeTags.JSON) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.JSON2T); - } - - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BTableType t, BType s) { - if (s == symTable.anyType || s.tag == symTable.anydataType.tag) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.ANY2DT); - } - - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BTupleType t, BType s) { - if (s == symTable.anyType || s == symTable.anydataType) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.CHECKCAST); - } - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BStreamType t, BType s) { - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BInvokableType t, BType s) { - if (s == symTable.anyType) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.CHECKCAST); - } else if (s.tag == TypeTags.INVOKABLE && isFunctionTypeAssignable((BInvokableType) s, t, - new HashSet<>())) { - return createCastOperatorSymbol(s, t, true, InstructionCodes.NOP); - } - - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BUnionType t, BType s) { - - // TODO handle union type to - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BSemanticErrorType t, BType s) { - // TODO Implement. Not needed for now. - throw new AssertionError(); - } - - @Override - public BSymbol visit(BErrorType t, BType s) { - // TODO Implement. Not needed for now. - throw new AssertionError(); - } - - @Override - public BSymbol visit(BFutureType t, BType s) { - return null; - } - - @Override - public BSymbol visit(BFiniteType t, BType s) { - if (s.tag == symTable.anyType.tag || s.tag == symTable.anydataType.tag) { - return createCastOperatorSymbol(s, t, false, InstructionCodes.CHECKCAST); - } - - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BServiceType t, BType s) { - - return symTable.notFoundSymbol; - } - - @Override - public BSymbol visit(BTypedescType t, BType s) { - - return symTable.notFoundSymbol; - } - - }; - private class BSameTypeVisitor implements BTypeVisitor { Set unresolvedTypes; @@ -1638,7 +1323,6 @@ private class BSameTypeVisitor implements BTypeVisitor { this.unresolvedTypes = unresolvedTypes; } -// private BTypeVisitor sameTypeVisitor = new BTypeVisitor() { @Override public Boolean visit(BType t, BType s) { From 73f6c66441658309b5843151a34a0551ffeb18cd Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Mon, 14 Oct 2019 12:08:02 +0530 Subject: [PATCH 031/167] Revert back union equals method (cherry picked from commit 058d2beaa008e7a4c96e685da642da2cb8080f12) --- .../ballerinalang/jvm/types/BUnionType.java | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java index 260822988048..20f09e575514 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/types/BUnionType.java @@ -137,22 +137,15 @@ public boolean equals(Object o) { } BUnionType that = (BUnionType) o; - int memberTypeCount = memberTypes.size(); - if (that.memberTypes.size() != memberTypeCount) { + if (this.memberTypes.size() != that.memberTypes.size()) { return false; } - for (int i = 0; i < memberTypeCount; i++) { - BType m = memberTypes.get(i); - boolean found = false; - for (int j = 0; j < memberTypeCount; j++) { - BType n = that.memberTypes.get(j); - if (m.equals(n)) { - found = true; - break; - } - } - if (!found) { + // Note: Ordered comparison is used here as an optimization to speed up the union equals method. + // union types that are like (A|B is B|A) will be fall through to assignable check in jvm/TypeChecker + // Refer: https://github.com/ballerina-platform/ballerina-lang/pull/19197#discussion_r328972983 + for (int i = 0; i < memberTypes.size(); i++) { + if (!this.memberTypes.get(i).equals(that.memberTypes.get(i))) { return false; } } From d78cb76dd9ebb2878913a93e642cec308ffb10c9 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Tue, 22 Oct 2019 15:14:53 +0530 Subject: [PATCH 032/167] Fix cherrypick conflict --- .../org/ballerinalang/jvm/scheduling/Scheduler.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java index 2a2b3d6d3da1..82e7ed0ba873 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java @@ -373,18 +373,6 @@ public void poison() { } } - private void infectResourceFunction(Strand strand, FutureValue futureValue) { - String gTransactionId = (String) strand.getProperty(GLOBAL_TRANSACTION_ID); - if (gTransactionId != null) { - String globalTransactionId = strand.getProperty(GLOBAL_TRANSACTION_ID).toString(); - String url = strand.getProperty(TRANSACTION_URL).toString(); - TransactionLocalContext transactionLocalContext = TransactionLocalContext.create(globalTransactionId, - url, "2pc"); - strand.setLocalTransactionContext(transactionLocalContext); - futureValue.transactionLocalContext = transactionLocalContext; - } - } - private static class LogicalProcessorCount { private int threadCount; LogicalProcessorCount() { From 5435bb221f25fc9c0cc9799e5a5c03b2fd5df6ee Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Tue, 22 Oct 2019 15:25:38 +0530 Subject: [PATCH 033/167] Remove unused code --- .../org/ballerinalang/jvm/scheduling/Scheduler.java | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java index 82e7ed0ba873..44fcc0211b54 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java @@ -73,7 +73,6 @@ public class Scheduler { private static int poolSize = Runtime.getRuntime().availableProcessors() * 2; private Semaphore mainBlockSem; - private static LogicalProcessorCount logicalProcessorCount = new LogicalProcessorCount(); public Scheduler(boolean immortal) { try { @@ -372,17 +371,6 @@ public void poison() { runnableList.add(POISON_PILL); } } - - private static class LogicalProcessorCount { - private int threadCount; - LogicalProcessorCount() { - threadCount = Runtime.getRuntime().availableProcessors() * 2; - } - - int getAllowedThreadCount() { - return threadCount; - } - } } /** From 69a703143f2b5808e1d9bf5b2e8db87f861ab957 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Tue, 22 Oct 2019 19:08:33 +0530 Subject: [PATCH 034/167] Make checked vs enclosing error mismatch a warning --- .../util/diagnostic/DiagnosticCode.java | 1 + .../semantics/analyzer/CodeAnalyzer.java | 18 +++++++++++++++--- .../src/main/resources/compiler.properties | 9 +++++++-- .../checkedexpr/CheckedExprNegativeTest.java | 19 ++++++++++++------- 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java index 7c339ad4c776..c26e1b003a47 100644 --- a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java +++ b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java @@ -368,6 +368,7 @@ public enum DiagnosticCode { // Checked expression related errors CHECKED_EXPR_INVALID_USAGE_NO_ERROR_TYPE_IN_RHS("checked.expr.invalid.usage.no.error.type.rhs"), CHECKED_EXPR_INVALID_USAGE_ALL_ERROR_TYPES_IN_RHS("checked.expr.invalid.usage.only.error.types.rhs"), + CHECKED_EXPR_NO_ERROR_RETURN_IN_ENCL_INVOKABLE("checked.expr.no.error.return.in.encl.invokable"), CHECKED_EXPR_NO_MATCHING_ERROR_RETURN_IN_ENCL_INVOKABLE("checked.expr.no.matching.error.return.in.encl.invokable"), START_REQUIRE_INVOCATION("start.require.invocation"), diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java index bdb1fd87b02d..e27f546bece9 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/CodeAnalyzer.java @@ -2246,7 +2246,6 @@ public void visit(BLangMatchExpression bLangMatchExpression) { @Override public void visit(BLangCheckedExpr checkedExpr) { analyzeExpr(checkedExpr.expr); - boolean enclInvokableHasErrorReturn = false; if (this.env.scope.owner.getKind() == SymbolKind.PACKAGE) { // Check at module level. @@ -2255,8 +2254,10 @@ public void visit(BLangCheckedExpr checkedExpr) { BType exprType = env.enclInvokable.getReturnTypeNode().type; - if (!types.isAssignable(getErrorTypes(checkedExpr.expr.type), exprType)) { - dlog.error(checkedExpr.pos, DiagnosticCode.CHECKED_EXPR_NO_MATCHING_ERROR_RETURN_IN_ENCL_INVOKABLE); + if (!hasError(exprType)) { + dlog.error(checkedExpr.pos, DiagnosticCode.CHECKED_EXPR_NO_ERROR_RETURN_IN_ENCL_INVOKABLE); + } else if (!types.isAssignable(getErrorTypes(checkedExpr.expr.type), exprType)) { + dlog.warning(checkedExpr.pos, DiagnosticCode.CHECKED_EXPR_NO_MATCHING_ERROR_RETURN_IN_ENCL_INVOKABLE); } returnTypes.peek().add(exprType); @@ -2351,6 +2352,17 @@ public void visit(BLangConstant constant) { analyzeExportableTypeRef(constant.symbol, constant.symbol.type.tsymbol, false, constant.pos); } + private boolean hasError(BType type) { + switch (type.tag) { + case TypeTags.ERROR: + return true; + case TypeTags.UNION: + return ((BUnionType) type).getMemberTypes().stream().anyMatch(memType -> memType.tag == TypeTags.ERROR); + default: + return false; + } + } + /** * This method checks for private symbols being accessed or used outside of package and|or private symbols being * used in public fields of objects/records and will fail those occurrences. diff --git a/compiler/ballerina-lang/src/main/resources/compiler.properties b/compiler/ballerina-lang/src/main/resources/compiler.properties index cd9f3d1eefaf..a5a6c000663d 100644 --- a/compiler/ballerina-lang/src/main/resources/compiler.properties +++ b/compiler/ballerina-lang/src/main/resources/compiler.properties @@ -814,8 +814,8 @@ error.checked.expr.invalid.usage.no.error.type.rhs=\ error.checked.expr.invalid.usage.only.error.types.rhs=\ invalid usage of the ''{0}'' expression operator: all expression types are equivalent to error type -error.checked.expr.no.matching.error.return.in.encl.invokable=\ - invalid usage of the ''check'' expression operator: no matching error return type(s) in the enclosing invokable +error.checked.expr.no.error.return.in.encl.invokable=\ + invalid usage of the ''check'' expression operator: no error type return in enclosing invokable error.start.require.invocation=\ invalid async operation usage, require an invocation @@ -1115,6 +1115,11 @@ warning.multi.line.strings.not.allowed=\ multi-line strings are not allowed by the Ballerina specification version 2019R3. This is currently allowed due \ to a bug in the compiler (https://git.io/JeRY5) and will be removed in a future release. +warning.checked.expr.no.matching.error.return.in.encl.invokable=\ + invalid usage of the ''check'' expression operator: no matching error return type(s) in the enclosing invokable. \ + This is currently allowed due to a bug in the compiler (https://git.io/JeR1p) and will be removed in a future \ + release. If the expression/action evaluates to error, this would result in abrupt completion with panic. + error.redeclared.import.module=\ redeclared import module ''{0}'' diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/checkedexpr/CheckedExprNegativeTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/checkedexpr/CheckedExprNegativeTest.java index 01f53ea1204a..50b4d545ee35 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/checkedexpr/CheckedExprNegativeTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/checkedexpr/CheckedExprNegativeTest.java @@ -28,8 +28,13 @@ */ public class CheckedExprNegativeTest { - private static final String ERROR_MISMATCH_ERR_MSG = "invalid usage of the 'check' expression " + - "operator: no matching error return type(s) in the enclosing invokable"; + private static final String NO_ERROR_ERR_MSG = "invalid usage of the 'check' expression operator: no error " + + "type return in enclosing invokable"; + + private static final String ERROR_MISMATCH_ERR_MSG = "invalid usage of the 'check' expression operator: no " + + "matching error return type(s) in the enclosing invokable. This is currently allowed due to a bug in " + + "the compiler (https://git.io/JeR1p) and will be removed in a future release. If the expression/action " + + "evaluates to error, this would result in abrupt completion with panic."; @Test public void testSemanticErrors() { @@ -51,7 +56,7 @@ public void testErrors() { CompileResult compile = BCompileUtil.compile( "test-src/expressions/checkedexpr/checked_expr_negative.bal"); Assert.assertEquals(compile.getErrorCount(), 1, compile.toString()); - BAssertUtil.validateError(compile, 0, ERROR_MISMATCH_ERR_MSG, 11, 19); + BAssertUtil.validateError(compile, 0, NO_ERROR_ERR_MSG, 11, 19); } @Test @@ -59,15 +64,15 @@ public void testSemanticErrorsWithResources() { CompileResult compile = BCompileUtil.compile( "test-src/expressions/checkedexpr/checked_expr_within_resource_negative.bal"); Assert.assertEquals(compile.getErrorCount(), 1); - BAssertUtil.validateError(compile, 0, ERROR_MISMATCH_ERR_MSG, 28, 22); + BAssertUtil.validateError(compile, 0, NO_ERROR_ERR_MSG, 28, 22); } @Test public void testCheckedErrorvsReturnTypeMismatch() { CompileResult compile = BCompileUtil.compile( "test-src/expressions/checkedexpr/checked_error_return_type_mismatch_negative.bal"); - Assert.assertEquals(compile.getErrorCount(), 2); - BAssertUtil.validateError(compile, 0, ERROR_MISMATCH_ERR_MSG, 24, 13); - BAssertUtil.validateError(compile, 1, ERROR_MISMATCH_ERR_MSG, 45, 17); + Assert.assertEquals(compile.getWarnCount(), 2); + BAssertUtil.validateWarning(compile, 0, ERROR_MISMATCH_ERR_MSG, 24, 13); + BAssertUtil.validateWarning(compile, 1, ERROR_MISMATCH_ERR_MSG, 45, 17); } } From 43d938107559bb34d901c8bad6ab0c5cadabaefd Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Tue, 22 Oct 2019 15:50:55 +0530 Subject: [PATCH 035/167] Emit warning instead of error --- .../semantics/analyzer/SemanticAnalyzer.java | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index dca197a22baf..a1779417ad5c 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -1310,7 +1310,7 @@ private boolean validateErrorVariable(BLangErrorVariable errorVariable) { dlog.error(errorVariable.pos, DiagnosticCode.NO_NEW_VARIABLES_VAR_ASSIGNMENT); return false; } - return validateErrorReasonMatchPatternSyntax(errorVariable); + return validateErrorReasonMatchPatternSyntax(errorVariable, true); } if (errorType.detailType.getKind() == TypeKind.RECORD) { @@ -1332,7 +1332,7 @@ private boolean validateErrorVariable(BLangErrorVariable errorVariable) { } private boolean validateErrorVariable(BLangErrorVariable errorVariable, BErrorType errorType) { - if (!validateErrorReasonMatchPatternSyntax(errorVariable)) { + if (!validateErrorReasonMatchPatternSyntax(errorVariable, false)) { return false; } @@ -1377,7 +1377,8 @@ private boolean validateErrorVariable(BLangErrorVariable errorVariable, BErrorTy return true; } - private boolean validateErrorReasonMatchPatternSyntax(BLangErrorVariable errorVariable) { + // todo: warn parameter is a hack to fix patch compatibility by using dlog.warn, remove for minor release + private boolean validateErrorReasonMatchPatternSyntax(BLangErrorVariable errorVariable, boolean warn) { if (errorVariable.isInMatchStmt && !errorVariable.reasonVarPrefixAvailable && errorVariable.reasonMatchConst == null @@ -1385,13 +1386,23 @@ && isReasonSpecified(errorVariable)) { BSymbol reasonConst = symResolver.lookupSymbol( this.env.enclEnv, names.fromString(errorVariable.reason.name.value), SymTag.CONSTANT); - if (reasonConst == symTable.notFoundSymbol) { - dlog.error(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, - errorVariable.reason.name); + if (warn) { + if (reasonConst == symTable.notFoundSymbol) { + dlog.warning(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, + errorVariable.reason.name); + } else { + dlog.warning(errorVariable.reason.pos, DiagnosticCode.UNSUPPORTED_ERROR_REASON_CONST_MATCH); + } + return false; } else { - dlog.error(errorVariable.reason.pos, DiagnosticCode.UNSUPPORTED_ERROR_REASON_CONST_MATCH); + if (reasonConst == symTable.notFoundSymbol) { + dlog.error(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, + errorVariable.reason.name); + } else { + dlog.error(errorVariable.reason.pos, DiagnosticCode.UNSUPPORTED_ERROR_REASON_CONST_MATCH); + } + return false; } - return false; } return true; } From c373066bdf4a9cfe963f33de22c35973137a9b7d Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Tue, 22 Oct 2019 19:39:10 +0530 Subject: [PATCH 036/167] Add warning --- .../semantics/analyzer/SemanticAnalyzer.java | 19 +++++++------------ .../src/main/resources/compiler.properties | 5 +++++ .../MatchStructuredErrorPatternsTest.java | 10 +++++++--- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index a1779417ad5c..0fc3149f89bc 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -1386,23 +1386,18 @@ && isReasonSpecified(errorVariable)) { BSymbol reasonConst = symResolver.lookupSymbol( this.env.enclEnv, names.fromString(errorVariable.reason.name.value), SymTag.CONSTANT); - if (warn) { - if (reasonConst == symTable.notFoundSymbol) { + if (reasonConst == symTable.notFoundSymbol) { + if (warn) { dlog.warning(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, errorVariable.reason.name); - } else { - dlog.warning(errorVariable.reason.pos, DiagnosticCode.UNSUPPORTED_ERROR_REASON_CONST_MATCH); + return false; } - return false; + dlog.error(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, + errorVariable.reason.name); } else { - if (reasonConst == symTable.notFoundSymbol) { - dlog.error(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, - errorVariable.reason.name); - } else { - dlog.error(errorVariable.reason.pos, DiagnosticCode.UNSUPPORTED_ERROR_REASON_CONST_MATCH); - } - return false; + dlog.error(errorVariable.reason.pos, DiagnosticCode.UNSUPPORTED_ERROR_REASON_CONST_MATCH); } + return false; } return true; } diff --git a/compiler/ballerina-lang/src/main/resources/compiler.properties b/compiler/ballerina-lang/src/main/resources/compiler.properties index cd9f3d1eefaf..8418ee1a554b 100644 --- a/compiler/ballerina-lang/src/main/resources/compiler.properties +++ b/compiler/ballerina-lang/src/main/resources/compiler.properties @@ -1115,6 +1115,11 @@ warning.multi.line.strings.not.allowed=\ multi-line strings are not allowed by the Ballerina specification version 2019R3. This is currently allowed due \ to a bug in the compiler (https://git.io/JeRY5) and will be removed in a future release. +warning.invalid.error.reason.binding.pattern=\ + invalid error reason binding pattern, error reason should be ''var {0}'' according to Ballerina specification \ + version 2019R3. This is currently allowed due to a bug in the compiler (https://git.io/JeRS5) \ + and will be removed in a future release. + error.redeclared.import.module=\ redeclared import module ''{0}'' diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java index e24f51e2d87f..7d8909503450 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java @@ -209,14 +209,18 @@ public void testErrorMatchPatternNotSupportedErrors() { "error match pattern with a constant reference as the reason is not yet supported", 33, 15); BAssertUtil.validateError(result, i++, "invalid error reason binding pattern, error reason should be 'var reason'", 36, 15); - BAssertUtil.validateError(result, i++, - "invalid error reason binding pattern, error reason should be 'var r'", 45, 15); + BAssertUtil.validateWarning(result, i++, + "invalid error reason binding pattern, error reason should be 'var r' according to " + + "Ballerina specification version 2019R3. This is currently allowed due to a bug in the " + + "compiler (https://git.io/JeRS5) and will be removed in a future release.", 45, 15); BAssertUtil.validateError(result, i++, "invalid error detail type 'ErrorDataABC', expected a subtype of " + "'record {| string message?; error cause?; (anydata|error)...; |}'", 52, 24); BAssertUtil.validateError(result, i++, "unknown type 'ErrorDataABC'", 52, 24); BAssertUtil.validateError(result, i++, "undefined symbol 'm'", 57, 62); - Assert.assertEquals(result.getErrorCount(), i); + Assert.assertEquals(result.getErrorCount(), i - 1); // i = errors + warning + Assert.assertEquals(result.getWarnCount(), 1); // i = errors + warning + } @Test() From 688f75903c018c5fde2b946f3ee7e697792ea924 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Tue, 22 Oct 2019 21:11:23 +0530 Subject: [PATCH 037/167] Fix merge conflict --- .../compiler/semantics/analyzer/SemanticAnalyzer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index 7ca9be1516b9..dca197a22baf 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -467,7 +467,7 @@ public void visit(BLangErrorType errorType) { BType detailType = errorType.detailType.type; if (!types.isValidErrorDetailType(detailType)) { - dlog.error(errorType.detailType.pos, DiagnosticCode.INVALID_ERROR_DETAIL_TYPE, detailType, + dlog.error(errorType.detailType.pos, DiagnosticCode.INVALID_ERROR_DETAIL_TYPE, errorType.detailType, symTable.detailType); } } From 733554d299b59479866edd95dcc8b693d67c7593 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 23 Oct 2019 09:23:58 +0530 Subject: [PATCH 038/167] Add missing pos and WS to identifier node --- .../compiler/desugar/ASTBuilderUtil.java | 20 --- .../compiler/desugar/AnnotationDesugar.java | 7 +- .../compiler/parser/BLangPackageBuilder.java | 141 +++++++++--------- .../semantics/analyzer/SymbolEnter.java | 3 +- .../compiler/tree/BLangIdentifier.java | 1 + .../tree/expressions/BLangXMLQName.java | 6 - .../net/grpc/proto/ServiceProtoBuilder.java | 11 +- 7 files changed, 79 insertions(+), 110 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java index b32a96f52745..6d2195789305 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/ASTBuilderUtil.java @@ -857,26 +857,6 @@ private static BVarSymbol duplicateParamSymbol(BVarSymbol paramSymbol, BInvokabl return newParamSymbol; } - static BLangInvocation createLambdaInvocation(DiagnosticPos pos, BInvokableSymbol invokableSymbol, - BLangSimpleVarRef varRef, List requiredArgs, - SymbolResolver symResolver) { - final BLangInvocation invokeLambda = (BLangInvocation) TreeBuilder.createInvocationNode(); - invokeLambda.pos = pos; - BLangIdentifier invocationName = (BLangIdentifier) TreeBuilder.createIdentifierNode(); - invocationName.setValue(BLangBuiltInMethod.CALL.getName()); - invokeLambda.name = invocationName; - invokeLambda.argExprs.addAll(generateArgExprsForLambdas(pos, requiredArgs, invokableSymbol.params, - symResolver)); - invokeLambda.requiredArgs.addAll(generateArgExprsForLambdas(pos, requiredArgs, invokableSymbol.params, - symResolver)); - invokeLambda.builtInMethod = BLangBuiltInMethod.CALL; - invokeLambda.type = ((BInvokableType) invokableSymbol.type).retType; - invokeLambda.expr = varRef; - invokeLambda.builtinMethodInvocation = true; - invokeLambda.symbol = varRef.symbol; - return invokeLambda; - } - private static List generateArgExprsForLambdas(DiagnosticPos pos, List args, List formalParams, SymbolResolver symResolver) { diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java index 49c3a5622083..db2d4be82a86 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java @@ -305,12 +305,11 @@ private void addVarArgsAnnotation(BLangFunction mainFunc) { if (annSymbol instanceof BAnnotationSymbol) { annoAttachment.annotationSymbol = (BAnnotationSymbol) annSymbol; } - IdentifierNode identifierNode = TreeBuilder.createIdentifierNode(); - if (identifierNode instanceof BLangIdentifier) { - annoAttachment.annotationName = (BLangIdentifier) identifierNode; - } + BLangIdentifier identifierNode = (BLangIdentifier) TreeBuilder.createIdentifierNode(); + annoAttachment.annotationName = identifierNode; annoAttachment.annotationName.value = DEFAULTABLE_ANN; annoAttachment.pos = pos; + annoAttachment.annotationName.pos = pos; BLangRecordLiteral literalNode = (BLangRecordLiteral) TreeBuilder.createRecordLiteralNode(); annoAttachment.expr = literalNode; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java index c9b58dc4255d..95342aeec2e2 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java @@ -453,7 +453,7 @@ void addRecordType(DiagnosticPos pos, Set ws, boolean isFieldAnalyse BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); // Generate a name for the anonymous object String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(pos, genName); + IdentifierNode anonTypeGenName = createIdentifier(pos, genName, null); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); @@ -570,7 +570,7 @@ void addErrorType(DiagnosticPos pos, Set ws, boolean reasonTypeExist BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); // Generate a name for the anonymous error String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(pos, genName); + IdentifierNode anonTypeGenName = createIdentifier(pos, genName, null); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); @@ -599,16 +599,6 @@ void addConstraintTypeWithTypeName(DiagnosticPos pos, Set ws, String addType(constrainedType); } - void addEndpointType(DiagnosticPos pos, Set ws) { - BLangNameReference nameReference = nameReferenceStack.pop(); - BLangUserDefinedType constraintType = (BLangUserDefinedType) TreeBuilder.createUserDefinedTypeNode(); - constraintType.pos = pos; - constraintType.pkgAlias = (BLangIdentifier) nameReference.pkgAlias; - constraintType.typeName = (BLangIdentifier) nameReference.name; - constraintType.addWS(nameReference.ws); - addType(constraintType); - } - void addFunctionType(DiagnosticPos pos, Set ws, boolean paramsAvail, boolean retParamsAvail) { // TODO : Fix function main ()(boolean , function(string x)(float, int)){} issue @@ -640,8 +630,8 @@ private void addType(TypeNode typeNode) { } void addNameReference(DiagnosticPos currentPos, Set ws, String pkgName, String name) { - IdentifierNode pkgNameNode = createIdentifier(currentPos, pkgName); - IdentifierNode nameNode = createIdentifier(currentPos, name); + IdentifierNode pkgNameNode = createIdentifier(currentPos, pkgName, null); + IdentifierNode nameNode = createIdentifier(currentPos, name, ws); nameReferenceStack.push(new BLangNameReference(currentPos, ws, pkgNameNode, nameNode)); } @@ -667,7 +657,7 @@ void startBlock() { this.blockNodeStack.push(TreeBuilder.createBlockNode()); } - private IdentifierNode createIdentifier(DiagnosticPos pos, String value) { + private BLangIdentifier createIdentifier(DiagnosticPos pos, String value, Set ws) { BLangIdentifier node = (BLangIdentifier) TreeBuilder.createIdentifierNode(); if (value == null) { return node; @@ -677,14 +667,18 @@ private IdentifierNode createIdentifier(DiagnosticPos pos, String value) { if (!escapeQuotedIdentifier(value).matches("^[0-9a-zA-Z.]*$")) { dlog.error(pos, DiagnosticCode.IDENTIFIER_LITERAL_ONLY_SUPPORTS_ALPHANUMERICS); } - value = StringEscapeUtils.unescapeJava(value); - node.setValue(value.substring(1)); + String unescapedValue = StringEscapeUtils.unescapeJava(value); + node.setValue(unescapedValue.substring(1)); + node.originalValue = value; node.setLiteral(true); } else { node.setValue(value); node.setLiteral(false); } node.pos = pos; + if (ws != null) { + node.addWS(ws); + } return node; } @@ -727,7 +721,7 @@ BLangVariable addBindingPatternMemberVariable(DiagnosticPos pos, DiagnosticPos identifierPos) { BLangSimpleVariable memberVar = (BLangSimpleVariable) TreeBuilder.createSimpleVariableNode(); memberVar.pos = pos; - IdentifierNode name = this.createIdentifier(identifierPos, identifier); + IdentifierNode name = this.createIdentifier(identifierPos, identifier, ws); ((BLangIdentifier) name).pos = identifierPos; memberVar.setName(name); memberVar.addWS(ws); @@ -847,7 +841,7 @@ private BLangSimpleVarRef createIgnoreVarRef() { } void addErrorDetailBinding(DiagnosticPos pos, Set ws, String name, String bindingVarName) { - BLangIdentifier bLangIdentifier = (BLangIdentifier) this.createIdentifier(pos, name); + BLangIdentifier bLangIdentifier = this.createIdentifier(pos, name, ws); bLangIdentifier.pos = pos; bLangIdentifier.addWS(ws); if (!this.varStack.empty()) { @@ -895,11 +889,13 @@ private BLangSimpleVariable createIgnoreVar() { private BLangErrorVariable.BLangErrorDetailEntry createErrorDetailEntry(DiagnosticPos pos, String bindingVarName, BLangIdentifier bLangIdentifier) { BLangSimpleVariable simpleVariableNode = (BLangSimpleVariable) TreeBuilder.createSimpleVariableNode(); - simpleVariableNode.name = (BLangIdentifier) this.createIdentifier(pos, bindingVarName); + simpleVariableNode.name = this.createIdentifier(pos, bindingVarName, null); simpleVariableNode.name.pos = pos; simpleVariableNode.pos = pos; - if (this.bindingPatternIdentifierWS.size() > 0) { - simpleVariableNode.addWS(this.bindingPatternIdentifierWS.pop()); + if (!this.bindingPatternIdentifierWS.isEmpty()) { + Set ws = this.bindingPatternIdentifierWS.pop(); + simpleVariableNode.name.addWS(ws); + simpleVariableNode.addWS(ws); } return new BLangErrorVariable.BLangErrorDetailEntry(bLangIdentifier, simpleVariableNode); } @@ -909,7 +905,7 @@ void addTupleVariable(DiagnosticPos pos, Set ws, int members, boolea BLangTupleVariable tupleVariable = (BLangTupleVariable) TreeBuilder.createTupleVariableNode(); tupleVariable.pos = pos; tupleVariable.addWS(ws); - if (this.bindingPatternIdentifierWS.size() > 0) { + if (!this.bindingPatternIdentifierWS.isEmpty()) { tupleVariable.addWS(this.bindingPatternIdentifierWS.pop()); } if (restBindingAvailable) { @@ -973,13 +969,13 @@ void addRecordVariableReference(DiagnosticPos pos, Set ws, boolean h void addFieldBindingMemberVar(DiagnosticPos pos, Set ws, String identifier, DiagnosticPos identifierPos, boolean bindingPattern) { BLangRecordVariableKeyValue recordKeyValue = new BLangRecordVariableKeyValue(); - recordKeyValue.key = (BLangIdentifier) this.createIdentifier(identifierPos, identifier); + recordKeyValue.key = this.createIdentifier(identifierPos, identifier, ws); if (!bindingPattern) { addBindingPatternMemberVariable(pos, ws, identifier, identifierPos); } recordKeyValue.valueBindingPattern = this.varStack.pop(); recordKeyValue.valueBindingPattern.addWS(ws); - if (this.bindingPatternIdentifierWS.size() > 0) { + if (!this.bindingPatternIdentifierWS.isEmpty()) { recordKeyValue.valueBindingPattern.addWS(this.bindingPatternIdentifierWS.pop()); } this.recordVarListStack.peek().add(recordKeyValue); @@ -996,7 +992,7 @@ void addFieldRefBindingMemberVar(DiagnosticPos pos, Set ws, String i expression = (BLangExpression) this.exprNodeStack.pop(); BLangRecordVarRefKeyValue keyValue = new BLangRecordVarRefKeyValue(); - keyValue.variableName = (BLangIdentifier) createIdentifier(pos, identifier); + keyValue.variableName = createIdentifier(pos, identifier, ws); keyValue.variableReference = expression; keyValue.variableReference.addWS(ws); this.recordVarRefListStack.peek().add(keyValue); @@ -1042,7 +1038,7 @@ void endCallableUnitSignature(DiagnosticPos pos, boolean retParamsAvail, boolean restParamAvail) { InvokableNode invNode = this.invokableNodeStack.peek(); - BLangIdentifier identifierNode = (BLangIdentifier) this.createIdentifier(identifierPos, identifier); + BLangIdentifier identifierNode = this.createIdentifier(identifierPos, identifier, ws); identifierNode.pos = identifierPos; invNode.setName(identifierNode); invNode.addWS(ws); @@ -1079,7 +1075,7 @@ void startLambdaFunctionDef(PackageID pkgID) { startFunctionDef(0, true); BLangFunction lambdaFunction = (BLangFunction) this.invokableNodeStack.peek(); lambdaFunction.setName(createIdentifier(lambdaFunction.pos, - anonymousModelHelper.getNextAnonymousFunctionKey(pkgID))); + anonymousModelHelper.getNextAnonymousFunctionKey(pkgID), null)); lambdaFunction.addFlag(Flag.LAMBDA); lambdaFunction.addFlag(Flag.ANONYMOUS); } @@ -1091,6 +1087,7 @@ void addLambdaFunctionDef(DiagnosticPos pos, boolean restParamAvail) { BLangFunction lambdaFunction = (BLangFunction) this.invokableNodeStack.peek(); lambdaFunction.pos = pos; + // todo: verify are passing all correct positions and WS endCallableUnitSignature(pos, ws, lambdaFunction.getName().value, pos, paramsAvail, retParamsAvail, restParamAvail); BLangLambdaFunction lambdaExpr = (BLangLambdaFunction) TreeBuilder.createLambdaFunctionNode(); @@ -1105,7 +1102,8 @@ void addArrowFunctionDef(DiagnosticPos pos, Set ws, PackageID pkgID) BLangArrowFunction arrowFunctionNode = (BLangArrowFunction) TreeBuilder.createArrowFunctionNode(); arrowFunctionNode.pos = pos; arrowFunctionNode.addWS(ws); - arrowFunctionNode.functionName = createIdentifier(pos, anonymousModelHelper.getNextAnonymousFunctionKey(pkgID)); + arrowFunctionNode.functionName = createIdentifier(pos, anonymousModelHelper.getNextAnonymousFunctionKey(pkgID), + null); varListStack.pop().forEach(var -> arrowFunctionNode.params.add((BLangSimpleVariable) var)); arrowFunctionNode.expression = (BLangExpression) this.exprNodeStack.pop(); addExpressionNode(arrowFunctionNode); @@ -1127,7 +1125,7 @@ void addSimpleVariableDefStatement(DiagnosticPos pos, Set ws, String boolean isDeclaredWithVar) { BLangSimpleVariableDef varDefNode = createSimpleVariableDef(pos, ws, identifier, identifierPos, isFinal, isExpressionAvailable, isDeclaredWithVar); - if (this.bindingPatternIdentifierWS.size() > 0) { + if (!this.bindingPatternIdentifierWS.isEmpty()) { varDefNode.addWS(this.bindingPatternIdentifierWS.pop()); } addStmtToCurrentBlock(varDefNode); @@ -1144,7 +1142,7 @@ private BLangSimpleVariableDef createSimpleVariableDef(DiagnosticPos pos, Set ws, String initNam //TODO check whether pkgName can be be empty IdentifierNode pkgNameNode = TreeBuilder.createIdentifierNode(); - IdentifierNode nameNode = createIdentifier(pos, initName); + IdentifierNode nameNode = createIdentifier(pos, initName, ws); BLangNameReference nameReference = new BLangNameReference(pos, ws, pkgNameNode, nameNode); invocationNode.name = (BLangIdentifier) nameReference.name; invocationNode.addWS(nameReference.ws); @@ -1320,7 +1318,7 @@ void startCatchClause() { void addCatchClause(DiagnosticPos poc, Set ws, String paramName) { BLangSimpleVariable variableNode = (BLangSimpleVariable) TreeBuilder.createSimpleVariableNode(); variableNode.typeNode = (BLangType) this.typeNodeStack.pop(); - variableNode.name = (BLangIdentifier) createIdentifier(variableNode.typeNode.pos, paramName); + variableNode.name = createIdentifier(variableNode.typeNode.pos, paramName, null); variableNode.pos = variableNode.typeNode.pos; variableNode.addWS(removeNthFromLast(ws, 3)); @@ -1471,9 +1469,9 @@ void endTableDataList(DiagnosticPos pos, Set ws) { //key BLangSimpleVarRef keyExpr = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode(); keyExpr.pos = pos; - IdentifierNode identifierNode = TreeBuilder.createIdentifierNode(); - identifierNode.setValue(keyNames.get(index).columnName); - keyExpr.variableName = (BLangIdentifier) identifierNode; + BLangTableLiteral.BLangTableColumn key = keyNames.get(index); + BLangIdentifier identifierNode = createIdentifier(key.pos, key.columnName, key.getWS()); + keyExpr.variableName = identifierNode; keyValue.key = new BLangRecordKey(keyExpr); //Key-Value pair recordLiteral.keyValuePairs.add(keyValue); @@ -1583,8 +1581,8 @@ void createInvocationNode(DiagnosticPos pos, Set ws, String invocati } invocationNode.expr = (BLangExpression) exprNodeStack.pop(); - invocationNode.name = (BLangIdentifier) createIdentifier(identifierPos, invocation); - invocationNode.pkgAlias = (BLangIdentifier) createIdentifier(pos, null); + invocationNode.name = createIdentifier(identifierPos, invocation, ws); + invocationNode.pkgAlias = createIdentifier(pos, null, null); addExpressionNode(invocationNode); } @@ -1594,8 +1592,8 @@ void createWorkerLambdaInvocationNode(DiagnosticPos pos, Set ws, Str invocationNode.addWS(ws); invocationNode.addWS(invocationWsStack.pop()); - invocationNode.name = (BLangIdentifier) createIdentifier(pos, invocation); - invocationNode.pkgAlias = (BLangIdentifier) createIdentifier(pos, null); + invocationNode.name = createIdentifier(pos, invocation, ws); + invocationNode.pkgAlias = createIdentifier(pos, null, null); addExpressionNode(invocationNode); } @@ -1616,7 +1614,7 @@ void createFieldBasedAccessNode(DiagnosticPos pos, Set ws, String fi BLangFieldBasedAccess fieldBasedAccess = (BLangFieldBasedAccess) TreeBuilder.createFieldBasedAccessNode(); fieldBasedAccess.pos = pos; fieldBasedAccess.addWS(ws); - fieldBasedAccess.field = (BLangIdentifier) createIdentifier(fieldNamePos, fieldName); + fieldBasedAccess.field = createIdentifier(fieldNamePos, fieldName, ws); fieldBasedAccess.field.pos = fieldNamePos; fieldBasedAccess.expr = (BLangVariableReference) exprNodeStack.pop(); fieldBasedAccess.fieldKind = fieldType; @@ -1818,7 +1816,7 @@ void addWorker(DiagnosticPos pos, Set ws, String workerName, boolean private void addWorkerVariableDefStatement(DiagnosticPos pos, String identifier) { BLangSimpleVariableDef varDefNode = createSimpleVariableDef(pos, null, identifier, null, true, true, true); - if (this.bindingPatternIdentifierWS.size() > 0) { + if (!this.bindingPatternIdentifierWS.isEmpty()) { varDefNode.addWS(this.bindingPatternIdentifierWS.pop()); } varDefNode.var.flagSet.add(Flag.WORKER); @@ -1901,10 +1899,10 @@ void addImportPackageDeclaration(DiagnosticPos pos, private BLangImportPackage getImportPackage(DiagnosticPos pos, Set ws, String orgName, List nameComps, String version, String alias) { List pkgNameComps = new ArrayList<>(); - nameComps.forEach(e -> pkgNameComps.add((BLangIdentifier) this.createIdentifier(pos, e))); - BLangIdentifier versionNode = (BLangIdentifier) this.createIdentifier(pos, version); + nameComps.forEach(e -> pkgNameComps.add((BLangIdentifier) this.createIdentifier(pos, e, ws))); + BLangIdentifier versionNode = this.createIdentifier(pos, version, ws); BLangIdentifier aliasNode = (alias != null && !alias.isEmpty()) ? - (BLangIdentifier) this.createIdentifier(pos, alias) : + this.createIdentifier(pos, alias, ws) : pkgNameComps.get(pkgNameComps.size() - 1); BLangImportPackage importDcl = (BLangImportPackage) TreeBuilder.createImportPackageNode(); @@ -1912,9 +1910,9 @@ private BLangImportPackage getImportPackage(DiagnosticPos pos, Set w importDcl.addWS(ws); importDcl.pkgNameComps = pkgNameComps; importDcl.version = versionNode; - importDcl.orgName = (BLangIdentifier) this.createIdentifier(pos, orgName); + importDcl.orgName = this.createIdentifier(pos, orgName, ws); importDcl.alias = aliasNode; - importDcl.compUnit = (BLangIdentifier) this.createIdentifier(pos, this.compUnit.getName()); + importDcl.compUnit = this.createIdentifier(pos, this.compUnit.getName(), ws); return importDcl; } @@ -1922,7 +1920,7 @@ private VariableNode generateBasicVarNodeWithoutType(DiagnosticPos pos, Set ws DiagnosticPos identifierPos, boolean isTypeAvailable) { BLangConstant constantNode = (BLangConstant) TreeBuilder.createConstantNode(); constantNode.pos = pos; - BLangIdentifier name = (BLangIdentifier) TreeBuilder.createIdentifierNode(); - name.pos = identifierPos; - name.value = identifier; + BLangIdentifier name = createIdentifier(identifierPos, identifier, ws); constantNode.setName(name); constantNode.addWS(ws); if (isTypeAvailable) { @@ -1958,7 +1954,7 @@ private VariableNode generateBasicVarNode(DiagnosticPos pos, Set ws, boolean isExpressionAvailable) { BLangSimpleVariable var = (BLangSimpleVariable) TreeBuilder.createSimpleVariableNode(); var.pos = pos; - IdentifierNode name = this.createIdentifier(identifierPos, identifier); + IdentifierNode name = this.createIdentifier(identifierPos, identifier, ws); ((BLangIdentifier) name).pos = identifierPos; var.setName(name); var.addWS(ws); @@ -2008,7 +2004,7 @@ void addConstant(DiagnosticPos pos, Set ws, String identifier, Diagn // Create a new anonymous type definition. BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName); + IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName, null); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); @@ -2091,7 +2087,7 @@ void addObjectType(DiagnosticPos pos, Set ws, boolean isFieldAnalyse BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); // Generate a name for the anonymous object String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(pos, genName); + IdentifierNode anonTypeGenName = createIdentifier(pos, genName, null); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); @@ -2125,7 +2121,7 @@ void endFiniteType(Set ws) { void endTypeDefinition(DiagnosticPos pos, Set ws, String identifier, DiagnosticPos identifierPos, boolean publicType) { BLangTypeDefinition typeDefinition = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); - BLangIdentifier identifierNode = (BLangIdentifier) this.createIdentifier(identifierPos, identifier); + BLangIdentifier identifierNode = this.createIdentifier(identifierPos, identifier, ws); identifierNode.pos = identifierPos; typeDefinition.setName(identifierNode); @@ -2168,7 +2164,7 @@ void endTypeDefinition(DiagnosticPos pos, Set ws, String identifier, BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); // Generate a name for the anonymous object String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName); + IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName, null); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); @@ -2272,7 +2268,7 @@ void endAnnotationDef(Set ws, String identifier, DiagnosticPos ident boolean isTypeAttached, boolean isConst) { BLangAnnotation annotationNode = (BLangAnnotation) this.annotationStack.pop(); annotationNode.addWS(ws); - BLangIdentifier identifierNode = (BLangIdentifier) this.createIdentifier(identifierPos, identifier); + BLangIdentifier identifierNode = this.createIdentifier(identifierPos, identifier, ws); identifierNode.pos = identifierPos; annotationNode.setName(identifierNode); @@ -2331,7 +2327,7 @@ void endParameterDocumentation(DiagnosticPos pos, Set ws, String par MarkdownDocumentationNode markdownDocumentationNode = markdownDocumentationStack.peek(); BLangMarkdownParameterDocumentation parameterDocumentationNode = (BLangMarkdownParameterDocumentation) TreeBuilder.createMarkdownParameterDocumentationNode(); - parameterDocumentationNode.parameterName = (BLangIdentifier) createIdentifier(pos, parameterName); + parameterDocumentationNode.parameterName = createIdentifier(pos, parameterName, ws); parameterDocumentationNode.pos = pos; parameterDocumentationNode.addWS(ws); parameterDocumentationNode.addParameterDocumentationLine(description); @@ -2497,7 +2493,7 @@ void addForeachStatementWithSimpleVariableDefStatement(DiagnosticPos pos, Set 0) { + if (!this.bindingPatternIdentifierWS.isEmpty()) { variableDefinitionNode.addWS(this.bindingPatternIdentifierWS.pop()); } addForeachStatement(pos, ws, variableDefinitionNode, isDeclaredWithVar); @@ -2778,7 +2774,7 @@ void addMatchStmtStructuredBindingPattern(DiagnosticPos pos, Set ws, (BLangMatchStructuredBindingPatternClause) TreeBuilder.createMatchStatementStructuredBindingPattern(); patternClause.pos = pos; patternClause.addWS(ws); - if (this.bindingPatternIdentifierWS.size() > 0) { + if (!this.bindingPatternIdentifierWS.isEmpty()) { patternClause.addWS(this.bindingPatternIdentifierWS.pop()); } @@ -2797,7 +2793,7 @@ void addMatchStmtStructuredBindingPattern(DiagnosticPos pos, Set ws, void addWorkerSendStmt(DiagnosticPos pos, Set ws, String workerName, boolean hasKey) { BLangWorkerSend workerSendNode = (BLangWorkerSend) TreeBuilder.createWorkerSendNode(); - workerSendNode.setWorkerName(this.createIdentifier(pos, workerName)); + workerSendNode.setWorkerName(this.createIdentifier(pos, workerName, ws)); workerSendNode.expr = (BLangExpression) exprNodeStack.pop(); workerSendNode.pos = pos; workerSendNode.addWS(ws); @@ -2812,7 +2808,7 @@ void addWorkerSendStmt(DiagnosticPos pos, Set ws, String workerName, void addWorkerReceiveExpr(DiagnosticPos pos, Set ws, String workerName, boolean hasKey) { BLangWorkerReceive workerReceiveExpr = (BLangWorkerReceive) TreeBuilder.createWorkerReceiveNode(); - workerReceiveExpr.setWorkerName(this.createIdentifier(pos, workerName)); + workerReceiveExpr.setWorkerName(this.createIdentifier(pos, workerName, ws)); workerReceiveExpr.pos = pos; workerReceiveExpr.addWS(ws); //if there are two expressions, this is a channel receive and the top expression is the key @@ -2826,7 +2822,7 @@ void addWorkerReceiveExpr(DiagnosticPos pos, Set ws, String workerNa void addWorkerFlushExpr(DiagnosticPos pos, Set ws, String workerName) { BLangWorkerFlushExpr workerFlushExpr = TreeBuilder.createWorkerFlushExpressionNode(); if (workerName != null) { - workerFlushExpr.workerIdentifier = (BLangIdentifier) createIdentifier(pos, workerName); + workerFlushExpr.workerIdentifier = createIdentifier(pos, workerName, ws); } workerFlushExpr.pos = pos; workerFlushExpr.addWS(ws); @@ -2835,7 +2831,7 @@ void addWorkerFlushExpr(DiagnosticPos pos, Set ws, String workerName void addWorkerSendSyncExpr(DiagnosticPos pos, Set ws, String workerName) { BLangWorkerSyncSendExpr workerSendExpr = TreeBuilder.createWorkerSendSyncExprNode(); - workerSendExpr.setWorkerName(this.createIdentifier(pos, workerName)); + workerSendExpr.setWorkerName(this.createIdentifier(pos, workerName, ws)); workerSendExpr.expr = (BLangExpression) exprNodeStack.pop(); workerSendExpr.pos = pos; workerSendExpr.addWS(ws); @@ -2879,7 +2875,7 @@ void endServiceDef(DiagnosticPos pos, Set ws, String serviceName, Di identifierPos = pos; } String serviceTypeName = this.anonymousModelHelper.getNextAnonymousServiceTypeKey(pos.src.pkgID, serviceName); - BLangIdentifier serviceVar = (BLangIdentifier) createIdentifier(identifierPos, serviceName); + BLangIdentifier serviceVar = createIdentifier(identifierPos, serviceName, ws); serviceVar.pos = identifierPos; serviceNode.setName(serviceVar); if (!isAnonServiceValue) { @@ -2893,7 +2889,7 @@ void endServiceDef(DiagnosticPos pos, Set ws, String serviceName, Di // 1) Define type nodeDefinition for service type. BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); - BLangIdentifier serviceTypeID = (BLangIdentifier) createIdentifier(identifierPos, serviceTypeName); + BLangIdentifier serviceTypeID = createIdentifier(identifierPos, serviceTypeName, ws); serviceTypeID.pos = pos; typeDef.setName(serviceTypeID); typeDef.flagSet.add(Flag.SERVICE); @@ -2927,8 +2923,8 @@ void endServiceDef(DiagnosticPos pos, Set ws, String serviceName, Di void createXMLQName(DiagnosticPos pos, Set ws, String localname, String prefix) { BLangXMLQName qname = (BLangXMLQName) TreeBuilder.createXMLQNameNode(); - qname.localname = (BLangIdentifier) createIdentifier(pos, localname); - qname.prefix = (BLangIdentifier) createIdentifier(pos, prefix); + qname.localname = createIdentifier(pos, localname, ws); + qname.prefix = createIdentifier(pos, prefix, ws); qname.pos = pos; qname.addWS(ws); addExpressionNode(qname); @@ -3046,9 +3042,7 @@ void addXMLNSDeclaration(DiagnosticPos pos, DiagnosticPos prefixPos, boolean isTopLevel) { BLangXMLNS xmlns = (BLangXMLNS) TreeBuilder.createXMLNSNode(); - BLangIdentifier prefixIdentifer = (BLangIdentifier) TreeBuilder.createIdentifierNode(); - prefixIdentifer.pos = prefixPos; - prefixIdentifer.value = prefix; + BLangIdentifier prefixIdentifer = createIdentifier(prefixPos, prefix, ws); addLiteralValue(pos, removeNthFromStart(ws, 1), TypeTags.STRING, namespaceUri); xmlns.namespaceURI = (BLangLiteral) exprNodeStack.pop(); @@ -3111,7 +3105,7 @@ void addNamedArgument(DiagnosticPos pos, Set ws, String name) { BLangNamedArgsExpression namedArg = (BLangNamedArgsExpression) TreeBuilder.createNamedArgNode(); namedArg.pos = pos; namedArg.addWS(ws); - namedArg.name = (BLangIdentifier) this.createIdentifier(pos, name); + namedArg.name = this.createIdentifier(pos, name, ws); namedArg.expr = (BLangExpression) this.exprNodeStack.pop(); addExpressionNode(namedArg); } @@ -3901,9 +3895,8 @@ void addKeyValueToWaitForAll(DiagnosticPos pos, Set ws, String ident keyValue.addWS(ws); keyValue.pos = pos; // Add the key as an identifier - BLangIdentifier key = (BLangIdentifier) TreeBuilder.createIdentifierNode(); + BLangIdentifier key = createIdentifier(pos, identifier, ws); key.setLiteral(false); - key.setValue(identifier); keyValue.key = key; // Add the value. If it is a Identifier:expr pair then add the value by popping the expr from the expression // stack else the value is not assigned. diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java index da30ef3abecb..d47e08b8f61a 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java @@ -1612,7 +1612,8 @@ private StatementNode createAssignmentStmt(BLangSimpleVariable variable, BVarSym private BLangSimpleVariable createReceiver(DiagnosticPos pos, BLangIdentifier name) { BLangSimpleVariable receiver = (BLangSimpleVariable) TreeBuilder.createSimpleVariableNode(); receiver.pos = pos; - IdentifierNode identifier = createIdentifier(Names.SELF.getValue()); + BLangIdentifier identifier = (BLangIdentifier) createIdentifier(Names.SELF.getValue()); + identifier.pos = pos; receiver.setName(identifier); BLangUserDefinedType structTypeNode = (BLangUserDefinedType) TreeBuilder.createUserDefinedTypeNode(); structTypeNode.pkgAlias = new BLangIdentifier(); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangIdentifier.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangIdentifier.java index ec58f061c1ed..3610c5de1ed6 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangIdentifier.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangIdentifier.java @@ -26,6 +26,7 @@ public class BLangIdentifier extends BLangNode implements IdentifierNode { public String value = ""; + public String originalValue; public boolean isLiteral; @Override diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/expressions/BLangXMLQName.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/expressions/BLangXMLQName.java index 832393635004..b91dc68f1069 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/expressions/BLangXMLQName.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/expressions/BLangXMLQName.java @@ -40,12 +40,6 @@ public class BLangXMLQName extends BLangExpression implements XMLQNameNode { public BLangXMLQName() { } - public BLangXMLQName(String localname) { - this.localname = new BLangIdentifier(); - this.prefix = new BLangIdentifier(); - this.localname.value = localname; - } - public BLangXMLQName(String localname, String prefix) { this.localname = new BLangIdentifier(); this.localname.value = localname; diff --git a/stdlib/grpc/src/main/java/org/ballerinalang/net/grpc/proto/ServiceProtoBuilder.java b/stdlib/grpc/src/main/java/org/ballerinalang/net/grpc/proto/ServiceProtoBuilder.java index f4b9c804a563..93100cf4ce45 100644 --- a/stdlib/grpc/src/main/java/org/ballerinalang/net/grpc/proto/ServiceProtoBuilder.java +++ b/stdlib/grpc/src/main/java/org/ballerinalang/net/grpc/proto/ServiceProtoBuilder.java @@ -22,7 +22,6 @@ import org.ballerinalang.model.elements.AttachPoint; import org.ballerinalang.model.elements.PackageID; import org.ballerinalang.model.tree.AnnotationAttachmentNode; -import org.ballerinalang.model.tree.IdentifierNode; import org.ballerinalang.model.tree.NodeKind; import org.ballerinalang.model.tree.ServiceNode; import org.ballerinalang.model.tree.expressions.LiteralNode; @@ -192,16 +191,15 @@ private void addDescriptorAnnotation(ServiceNode serviceNode, String rootDescrip if (annSymbol instanceof BAnnotationSymbol) { annoAttachment.annotationSymbol = (BAnnotationSymbol) annSymbol; } - IdentifierNode identifierNode = TreeBuilder.createIdentifierNode(); - if (identifierNode instanceof BLangIdentifier) { - annoAttachment.annotationName = (BLangIdentifier) identifierNode; - } + annoAttachment.annotationName = (BLangIdentifier) TreeBuilder.createIdentifierNode(); annoAttachment.annotationName.value = ANN_SERVICE_DESCRIPTOR; + annoAttachment.annotationName.pos = pos; annoAttachment.pos = pos; BLangRecordLiteral literalNode = (BLangRecordLiteral) TreeBuilder.createRecordLiteralNode(); annoAttachment.expr = literalNode; BLangIdentifier pkgAlias = (BLangIdentifier) TreeBuilder.createIdentifierNode(); pkgAlias.setValue(PROTOCOL_PACKAGE_GRPC); + pkgAlias.pos = pos; annoAttachment.pkgAlias = pkgAlias; annoAttachment.attachPoints.add(AttachPoint.Point.SERVICE); literalNode.pos = pos; @@ -257,9 +255,11 @@ private void addDescriptorAnnotation(ServiceNode serviceNode, String rootDescrip functionRef.type = symTable.mapType; BLangIdentifier funcName = (BLangIdentifier) TreeBuilder.createIdentifierNode(); funcName.setValue(DESCRIPTOR_MAP); + funcName.pos = pos; functionRef.name = funcName; BLangIdentifier funcPkgAlias = (BLangIdentifier) TreeBuilder.createIdentifierNode(); funcPkgAlias.setValue(""); + funcPkgAlias.pos = pos; functionRef.pkgAlias = funcPkgAlias; } @@ -270,6 +270,7 @@ private void addDescriptorAnnotation(ServiceNode serviceNode, String rootDescrip BLangSimpleVarRef mapKeyLiteral = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode(); BLangIdentifier keyName = (BLangIdentifier) TreeBuilder.createIdentifierNode(); keyName.setValue(ANN_FIELD_DESC_MAP); + keyName.pos = pos; mapKeyLiteral.variableName = keyName; mapKeyLiteral.type = symTable.mapType; mapKeyLiteral.pos = pos; From a2ee1e1fdecf2f2156b4b9d07725dd4018a5445e Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 23 Oct 2019 10:13:50 +0530 Subject: [PATCH 039/167] fix checkstyle issue --- .../wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java index db2d4be82a86..13fd717d2102 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/desugar/AnnotationDesugar.java @@ -22,7 +22,6 @@ import org.ballerinalang.model.symbols.SymbolKind; import org.ballerinalang.model.tree.AnnotatableNode; import org.ballerinalang.model.tree.AnnotationAttachmentNode; -import org.ballerinalang.model.tree.IdentifierNode; import org.ballerinalang.model.tree.NodeKind; import org.ballerinalang.model.types.TypeKind; import org.wso2.ballerinalang.compiler.semantics.analyzer.SymbolResolver; From 96841385631291230d8ba535eb6477339bb4df69 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 23 Oct 2019 10:22:48 +0530 Subject: [PATCH 040/167] Fix error message --- .../matchstmt/MatchStructuredErrorPatternsTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java index 7d8909503450..b52226dd12f3 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java @@ -212,14 +212,14 @@ public void testErrorMatchPatternNotSupportedErrors() { BAssertUtil.validateWarning(result, i++, "invalid error reason binding pattern, error reason should be 'var r' according to " + "Ballerina specification version 2019R3. This is currently allowed due to a bug in the " + - "compiler (https://git.io/JeRS5) and will be removed in a future release.", 45, 15); + "compiler (https://git.io/JeRS5) and will be prohibited in a future release.", 45, 15); BAssertUtil.validateError(result, i++, "invalid error detail type 'ErrorDataABC', expected a subtype of " + "'record {| string message?; error cause?; (anydata|error)...; |}'", 52, 24); BAssertUtil.validateError(result, i++, "unknown type 'ErrorDataABC'", 52, 24); BAssertUtil.validateError(result, i++, "undefined symbol 'm'", 57, 62); Assert.assertEquals(result.getErrorCount(), i - 1); // i = errors + warning - Assert.assertEquals(result.getWarnCount(), 1); // i = errors + warning + Assert.assertEquals(result.getWarnCount(), 1); } From bd903d1b555d35fee7b73e9680078b44ecb1624d Mon Sep 17 00:00:00 2001 From: Chanaka Lakmal Date: Wed, 23 Oct 2019 10:32:11 +0530 Subject: [PATCH 041/167] Add ldap for distribution --- distribution/zip/jballerina/build.gradle | 3 + .../authservices/15_ldap_auth_store_test.bal | 186 +++++++++--------- .../src/test/resources/testng.xml | 2 +- 3 files changed, 97 insertions(+), 94 deletions(-) diff --git a/distribution/zip/jballerina/build.gradle b/distribution/zip/jballerina/build.gradle index 6dbf1bebc840..4710050b6792 100644 --- a/distribution/zip/jballerina/build.gradle +++ b/distribution/zip/jballerina/build.gradle @@ -137,6 +137,7 @@ dependencies { distBal project(path: ':ballerina-stringutils', configuration: 'baloImplementation') distBal project(path: ':ballerina-utils', configuration: 'baloImplementation') distBal project(path: ':ballerina-jwt', configuration: 'baloImplementation') + distBal project(path: ':ballerina-ldap', configuration: 'baloImplementation') distBal project(path: ':ballerina-oauth2', configuration: 'baloImplementation') distBal project(path: ':ballerina-xmlutils', configuration: 'baloImplementation') distBal project(path: ':ballerina-jsonutils', configuration: 'baloImplementation') @@ -192,6 +193,7 @@ dependencies { balSource project(path: ':ballerina-stringutils', configuration: 'balSource') balSource project(path: ':ballerina-utils', configuration: 'balSource') balSource project(path: ':ballerina-jwt', configuration: 'balSource') + balSource project(path: ':ballerina-ldap', configuration: 'balSource') balSource project(path: ':ballerina-oauth2', configuration: 'balSource') balSource project(path: ':ballerina-xmlutils', configuration: 'balSource') balSource project(path: ':ballerina-jsonutils', configuration: 'balSource') @@ -263,6 +265,7 @@ dependencies { dist project(':ballerina-nats') dist project(':ballerina-stringutils') dist project(':ballerina-jwt') + dist project(':ballerina-ldap') dist project(':ballerina-oauth2') dist project(':ballerina-xmlutils') dist project(':ballerina-jsonutils') diff --git a/tests/jballerina-integration-test/src/test/resources/auth/src/authservices/15_ldap_auth_store_test.bal b/tests/jballerina-integration-test/src/test/resources/auth/src/authservices/15_ldap_auth_store_test.bal index 5d6b8cc6a158..fee60d86e7d6 100644 --- a/tests/jballerina-integration-test/src/test/resources/auth/src/authservices/15_ldap_auth_store_test.bal +++ b/tests/jballerina-integration-test/src/test/resources/auth/src/authservices/15_ldap_auth_store_test.bal @@ -1,96 +1,96 @@ -//// Copyright (c) 2018 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -//// -//// WSO2 Inc. licenses this file to you under the Apache License, -//// Version 2.0 (the "License"); you may not use this file except -//// in compliance with the License. -//// You may obtain a copy of the License at -//// -//// http://www.apache.org/licenses/LICENSE-2.0 -//// -//// Unless required by applicable law or agreed to in writing, -//// software distributed under the License is distributed on an -//// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -//// KIND, either express or implied. See the License for the -//// specific language governing permissions and limitations -//// under the License. +// Copyright (c) 2018 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. // -//import ballerina/config; -//import ballerina/ldap; -//import ballerina/http; +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at // -//ldap:LdapConnectionConfig ldapConfig = { -// domainName: "ballerina.io", -// connectionURL: "ldap://localhost:20100", -// connectionName: "uid=admin,ou=system", -// connectionPassword: "secret", -// userSearchBase: "ou=Users,dc=ballerina,dc=io", -// userEntryObjectClass: "identityPerson", -// userNameAttribute: "uid", -// userNameSearchFilter: "(&(objectClass=person)(uid=?))", -// userNameListFilter: "(objectClass=person)", -// groupSearchBase: ["ou=Groups,dc=ballerina,dc=io"], -// groupEntryObjectClass: "groupOfNames", -// groupNameAttribute: "cn", -// groupNameSearchFilter: "(&(objectClass=groupOfNames)(cn=?))", -// groupNameListFilter: "(objectClass=groupOfNames)", -// membershipAttribute: "member", -// userRolesCacheEnabled: true, -// connectionPoolingEnabled: false, -// connectionTimeoutInMillis: 5000, -// readTimeoutInMillis: 60000, -// retryAttempts: 3 -//}; +// http://www.apache.org/licenses/LICENSE-2.0 // -//ldap:InboundLdapAuthProvider ldapAuthProvider = new(ldapConfig, "ldap01"); -//http:BasicAuthHandler ldapAuthHandler = new(ldapAuthProvider); -// -//listener http:Listener ep = new(20021, { -// auth: { -// authHandlers: [ldapAuthHandler] -// }, -// secureSocket: { -// keyStore: { -// path: config:getAsString("keystore"), -// password: "ballerina" -// } -// } -//}); -// -//@http:ServiceConfig { -// basePath: "/ldapAuth", -// auth: { -// enabled: true -// } -//} -//service helloService on ep { -// -// @http:ResourceConfig { -// methods: ["GET"], -// path: "/disableAuthz" -// } -// resource function disableAuthz(http:Caller caller, http:Request req) { -// checkpanic caller->respond("Hello, World!!!"); -// } -// -// @http:ResourceConfig { -// methods: ["GET"], -// path: "/enableAuthz", -// auth: { -// scopes: ["test"] -// } -// } -// resource function enableAuthz(http:Caller caller, http:Request req) { -// checkpanic caller->respond("Hello, World!!!"); -// } -// -// @http:ResourceConfig { -// methods: ["GET"], -// path: "/failAuthz", -// auth: { -// scopes: ["admin", "support"] -// } -// } -// resource function failAuthz(http:Caller caller, http:Request req) { -// checkpanic caller->respond("Hello, World!!!"); -// } -//} +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/config; +import ballerina/ldap; +import ballerina/http; + +ldap:LdapConnectionConfig ldapConfig = { + domainName: "ballerina.io", + connectionURL: "ldap://localhost:20100", + connectionName: "uid=admin,ou=system", + connectionPassword: "secret", + userSearchBase: "ou=Users,dc=ballerina,dc=io", + userEntryObjectClass: "identityPerson", + userNameAttribute: "uid", + userNameSearchFilter: "(&(objectClass=person)(uid=?))", + userNameListFilter: "(objectClass=person)", + groupSearchBase: ["ou=Groups,dc=ballerina,dc=io"], + groupEntryObjectClass: "groupOfNames", + groupNameAttribute: "cn", + groupNameSearchFilter: "(&(objectClass=groupOfNames)(cn=?))", + groupNameListFilter: "(objectClass=groupOfNames)", + membershipAttribute: "member", + userRolesCacheEnabled: true, + connectionPoolingEnabled: false, + connectionTimeoutInMillis: 5000, + readTimeoutInMillis: 60000, + retryAttempts: 3 +}; + +ldap:InboundLdapAuthProvider ldapAuthProvider = new(ldapConfig, "ldap01"); +http:BasicAuthHandler ldapAuthHandler = new(ldapAuthProvider); + +listener http:Listener ep = new(20021, { + auth: { + authHandlers: [ldapAuthHandler] + }, + secureSocket: { + keyStore: { + path: config:getAsString("keystore"), + password: "ballerina" + } + } +}); + +@http:ServiceConfig { + basePath: "/ldapAuth", + auth: { + enabled: true + } +} +service helloService on ep { + + @http:ResourceConfig { + methods: ["GET"], + path: "/disableAuthz" + } + resource function disableAuthz(http:Caller caller, http:Request req) { + checkpanic caller->respond("Hello, World!!!"); + } + + @http:ResourceConfig { + methods: ["GET"], + path: "/enableAuthz", + auth: { + scopes: ["test"] + } + } + resource function enableAuthz(http:Caller caller, http:Request req) { + checkpanic caller->respond("Hello, World!!!"); + } + + @http:ResourceConfig { + methods: ["GET"], + path: "/failAuthz", + auth: { + scopes: ["admin", "support"] + } + } + resource function failAuthz(http:Caller caller, http:Request req) { + checkpanic caller->respond("Hello, World!!!"); + } +} diff --git a/tests/jballerina-integration-test/src/test/resources/testng.xml b/tests/jballerina-integration-test/src/test/resources/testng.xml index 72e1bbbeadb1..bdbda4211317 100644 --- a/tests/jballerina-integration-test/src/test/resources/testng.xml +++ b/tests/jballerina-integration-test/src/test/resources/testng.xml @@ -116,7 +116,7 @@ - + From ff88664b9cc28f151c9da54827ff20a720ddfa7a Mon Sep 17 00:00:00 2001 From: aashikam Date: Wed, 23 Oct 2019 11:32:44 +0530 Subject: [PATCH 042/167] Add synchronous message consuming functionality --- .../main/ballerina/src/rabbitmq/channel.bal | 8 ++ .../rabbitmq/nativeimpl/channel/BasicGet.java | 79 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java diff --git a/stdlib/messaging/rabbitmq/src/main/ballerina/src/rabbitmq/channel.bal b/stdlib/messaging/rabbitmq/src/main/ballerina/src/rabbitmq/channel.bal index 2b06b284c769..620942bbb426 100644 --- a/stdlib/messaging/rabbitmq/src/main/ballerina/src/rabbitmq/channel.bal +++ b/stdlib/messaging/rabbitmq/src/main/ballerina/src/rabbitmq/channel.bal @@ -111,6 +111,14 @@ public type Channel client object { # + return - RabbitMQ Connection object or error if an I/O problem is encountered. public function getConnection() returns Connection | Error = external; + # Retrieves a message synchronously from the given queue, providing direct access to the messages in the queue. + # + # + queueName - The name of the queue. + # + ackMode - Type of acknowledgement mode. + # + return - `Message` object containing the retrieved message data or an `Error` if an + # I/O problem is encountered. + public remote function basicGet(string queueName, AcknowledgementMode ackMode) returns Message | Error = external; + private function createChannel(Connection? connection) = external; }; diff --git a/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java b/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java new file mode 100644 index 000000000000..fce318f01210 --- /dev/null +++ b/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.messaging.rabbitmq.nativeimpl.channel; + +import com.rabbitmq.client.AMQP; +import com.rabbitmq.client.Channel; +import com.rabbitmq.client.GetResponse; +import org.ballerinalang.jvm.BallerinaValues; +import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.messaging.rabbitmq.RabbitMQConstants; +import org.ballerinalang.messaging.rabbitmq.RabbitMQUtils; +import org.ballerinalang.model.types.TypeKind; +import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; + +import java.io.IOException; + +/** + * Retrieves a message from a queue using RabbitMQ pull API. + * + * @since 1.0.3 + */ +@BallerinaFunction( + orgName = RabbitMQConstants.ORG_NAME, + packageName = RabbitMQConstants.RABBITMQ, + functionName = "basicGet", + receiver = @Receiver(type = TypeKind.OBJECT, + structType = RabbitMQConstants.CHANNEL_OBJECT, + structPackage = RabbitMQConstants.PACKAGE_RABBITMQ), + isPublic = true +) +public class BasicGet { + + public static Object basicGet(Strand strand, ObjectValue channelObjectValue, String queueName, Object ackMode) { + Channel channel = (Channel) channelObjectValue.getNativeData(RabbitMQConstants.CHANNEL_NATIVE_OBJECT); + boolean autoAck = false; + if (ackMode.toString().equals("auto")) { + autoAck = true; + } + try { + GetResponse response = channel.basicGet(queueName, autoAck); + return getMessageObjectValue(response.getBody(), response.getEnvelope().getDeliveryTag(), + response.getProps(), channel, autoAck); + } catch (IOException e) { + return RabbitMQUtils.returnErrorValue("Error occurred while retrieving the message: " + + e.getMessage()); + } + } + + private static ObjectValue getMessageObjectValue(byte[] message, long deliveryTag, AMQP.BasicProperties properties, + Channel channel, boolean autoAck) { + ObjectValue messageObjectValue = BallerinaValues.createObjectValue(RabbitMQConstants.PACKAGE_ID_RABBITMQ, + RabbitMQConstants.MESSAGE_OBJECT); + messageObjectValue.addNativeData(RabbitMQConstants.DELIVERY_TAG, deliveryTag); + messageObjectValue.addNativeData(RabbitMQConstants.CHANNEL_NATIVE_OBJECT, channel); + messageObjectValue.addNativeData(RabbitMQConstants.MESSAGE_CONTENT, message); + messageObjectValue.addNativeData(RabbitMQConstants.AUTO_ACK_STATUS, autoAck); + messageObjectValue.addNativeData(RabbitMQConstants.BASIC_PROPERTIES, properties); + messageObjectValue.addNativeData(RabbitMQConstants.MESSAGE_ACK_STATUS, false); + return messageObjectValue; + } +} From 85908d083916dbfbc32c6ac17241f4e42fda22fd Mon Sep 17 00:00:00 2001 From: aashikam Date: Wed, 23 Oct 2019 12:55:47 +0530 Subject: [PATCH 043/167] Add changes from code review --- .../messaging/rabbitmq/nativeimpl/channel/BasicGet.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java b/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java index fce318f01210..43d968ac2520 100644 --- a/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java +++ b/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java @@ -56,7 +56,7 @@ public static Object basicGet(Strand strand, ObjectValue channelObjectValue, Str } try { GetResponse response = channel.basicGet(queueName, autoAck); - return getMessageObjectValue(response.getBody(), response.getEnvelope().getDeliveryTag(), + return createAndPopulateMessageObjectValue(response.getBody(), response.getEnvelope().getDeliveryTag(), response.getProps(), channel, autoAck); } catch (IOException e) { return RabbitMQUtils.returnErrorValue("Error occurred while retrieving the message: " + @@ -64,8 +64,9 @@ public static Object basicGet(Strand strand, ObjectValue channelObjectValue, Str } } - private static ObjectValue getMessageObjectValue(byte[] message, long deliveryTag, AMQP.BasicProperties properties, - Channel channel, boolean autoAck) { + private static ObjectValue createAndPopulateMessageObjectValue(byte[] message, long deliveryTag, + AMQP.BasicProperties properties, + Channel channel, boolean autoAck) { ObjectValue messageObjectValue = BallerinaValues.createObjectValue(RabbitMQConstants.PACKAGE_ID_RABBITMQ, RabbitMQConstants.MESSAGE_OBJECT); messageObjectValue.addNativeData(RabbitMQConstants.DELIVERY_TAG, deliveryTag); From a8cb2f591cb8562478320b45e7738de137878a07 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 23 Oct 2019 15:19:34 +0530 Subject: [PATCH 044/167] Remove extra whitespace insertions --- .../compiler/parser/BLangPackageBuilder.java | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java index 95342aeec2e2..059c020ddd58 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java @@ -657,6 +657,10 @@ void startBlock() { this.blockNodeStack.push(TreeBuilder.createBlockNode()); } + private BLangIdentifier createIdentifier(DiagnosticPos pos, String value) { + return createIdentifier(pos, value, null); + } + private BLangIdentifier createIdentifier(DiagnosticPos pos, String value, Set ws) { BLangIdentifier node = (BLangIdentifier) TreeBuilder.createIdentifierNode(); if (value == null) { @@ -969,7 +973,7 @@ void addRecordVariableReference(DiagnosticPos pos, Set ws, boolean h void addFieldBindingMemberVar(DiagnosticPos pos, Set ws, String identifier, DiagnosticPos identifierPos, boolean bindingPattern) { BLangRecordVariableKeyValue recordKeyValue = new BLangRecordVariableKeyValue(); - recordKeyValue.key = this.createIdentifier(identifierPos, identifier, ws); + recordKeyValue.key = this.createIdentifier(identifierPos, identifier); if (!bindingPattern) { addBindingPatternMemberVariable(pos, ws, identifier, identifierPos); } @@ -992,7 +996,7 @@ void addFieldRefBindingMemberVar(DiagnosticPos pos, Set ws, String i expression = (BLangExpression) this.exprNodeStack.pop(); BLangRecordVarRefKeyValue keyValue = new BLangRecordVarRefKeyValue(); - keyValue.variableName = createIdentifier(pos, identifier, ws); + keyValue.variableName = createIdentifier(pos, identifier); keyValue.variableReference = expression; keyValue.variableReference.addWS(ws); this.recordVarRefListStack.peek().add(keyValue); @@ -1318,7 +1322,7 @@ void startCatchClause() { void addCatchClause(DiagnosticPos poc, Set ws, String paramName) { BLangSimpleVariable variableNode = (BLangSimpleVariable) TreeBuilder.createSimpleVariableNode(); variableNode.typeNode = (BLangType) this.typeNodeStack.pop(); - variableNode.name = createIdentifier(variableNode.typeNode.pos, paramName, null); + variableNode.name = createIdentifier(variableNode.typeNode.pos, paramName); variableNode.pos = variableNode.typeNode.pos; variableNode.addWS(removeNthFromLast(ws, 3)); @@ -1470,7 +1474,7 @@ void endTableDataList(DiagnosticPos pos, Set ws) { BLangSimpleVarRef keyExpr = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode(); keyExpr.pos = pos; BLangTableLiteral.BLangTableColumn key = keyNames.get(index); - BLangIdentifier identifierNode = createIdentifier(key.pos, key.columnName, key.getWS()); + BLangIdentifier identifierNode = createIdentifier(key.pos, key.columnName); keyExpr.variableName = identifierNode; keyValue.key = new BLangRecordKey(keyExpr); //Key-Value pair @@ -1582,7 +1586,7 @@ void createInvocationNode(DiagnosticPos pos, Set ws, String invocati invocationNode.expr = (BLangExpression) exprNodeStack.pop(); invocationNode.name = createIdentifier(identifierPos, invocation, ws); - invocationNode.pkgAlias = createIdentifier(pos, null, null); + invocationNode.pkgAlias = createIdentifier(pos, null); addExpressionNode(invocationNode); } @@ -1593,7 +1597,7 @@ void createWorkerLambdaInvocationNode(DiagnosticPos pos, Set ws, Str invocationNode.addWS(invocationWsStack.pop()); invocationNode.name = createIdentifier(pos, invocation, ws); - invocationNode.pkgAlias = createIdentifier(pos, null, null); + invocationNode.pkgAlias = createIdentifier(pos, null); addExpressionNode(invocationNode); } @@ -1899,10 +1903,12 @@ void addImportPackageDeclaration(DiagnosticPos pos, private BLangImportPackage getImportPackage(DiagnosticPos pos, Set ws, String orgName, List nameComps, String version, String alias) { List pkgNameComps = new ArrayList<>(); - nameComps.forEach(e -> pkgNameComps.add((BLangIdentifier) this.createIdentifier(pos, e, ws))); - BLangIdentifier versionNode = this.createIdentifier(pos, version, ws); + for (String component : nameComps) { + pkgNameComps.add(this.createIdentifier(pos, component, null)); + } + BLangIdentifier versionNode = this.createIdentifier(pos, version); BLangIdentifier aliasNode = (alias != null && !alias.isEmpty()) ? - this.createIdentifier(pos, alias, ws) : + this.createIdentifier(pos, alias, null) : pkgNameComps.get(pkgNameComps.size() - 1); BLangImportPackage importDcl = (BLangImportPackage) TreeBuilder.createImportPackageNode(); @@ -1910,9 +1916,9 @@ private BLangImportPackage getImportPackage(DiagnosticPos pos, Set w importDcl.addWS(ws); importDcl.pkgNameComps = pkgNameComps; importDcl.version = versionNode; - importDcl.orgName = this.createIdentifier(pos, orgName, ws); + importDcl.orgName = this.createIdentifier(pos, orgName); importDcl.alias = aliasNode; - importDcl.compUnit = this.createIdentifier(pos, this.compUnit.getName(), ws); + importDcl.compUnit = this.createIdentifier(pos, this.compUnit.getName()); return importDcl; } @@ -2004,7 +2010,7 @@ void addConstant(DiagnosticPos pos, Set ws, String identifier, Diagn // Create a new anonymous type definition. BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName, null); + IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); @@ -2087,7 +2093,7 @@ void addObjectType(DiagnosticPos pos, Set ws, boolean isFieldAnalyse BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); // Generate a name for the anonymous object String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(pos, genName, null); + IdentifierNode anonTypeGenName = createIdentifier(pos, genName); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); @@ -2164,7 +2170,7 @@ void endTypeDefinition(DiagnosticPos pos, Set ws, String identifier, BLangTypeDefinition typeDef = (BLangTypeDefinition) TreeBuilder.createTypeDefinition(); // Generate a name for the anonymous object String genName = anonymousModelHelper.getNextAnonymousTypeKey(pos.src.pkgID); - IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName, null); + IdentifierNode anonTypeGenName = createIdentifier(identifierPos, genName); typeDef.setName(anonTypeGenName); typeDef.flagSet.add(Flag.PUBLIC); typeDef.flagSet.add(Flag.ANONYMOUS); From eb0c8cd2f7b696384952c521509626975584914d Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Wed, 23 Oct 2019 15:34:55 +0530 Subject: [PATCH 045/167] Improve the Character I/O example --- examples/character-io/character_io.bal | 44 +++++++++++++++----------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/examples/character-io/character_io.bal b/examples/character-io/character_io.bal index dd70dbf66529..687c392ba787 100644 --- a/examples/character-io/character_io.bal +++ b/examples/character-io/character_io.bal @@ -32,24 +32,30 @@ function closeWc(io:WritableCharacterChannel ch) { } } +public function main() returns error? { +    // This example uses the /examples/character-io/files/sample.txt file as the  +    // source file, which includes the text "Hello Ballerina!!".  +    // You can replace this with the file path of a preferred text file.  +    io:ReadableByteChannel readableFieldResult = check io:openReadableFile("./files/sample.txt"); +    io:ReadableCharacterChannel sourceChannel = +            new(readableFieldResult, "UTF-8"); -public function main() returns error? { - io:ReadableByteChannel readableFieldResult = check io:openReadableFile("./files/sample.txt"); - io:ReadableCharacterChannel sourceChannel = - new(readableFieldResult, "UTF-8"); - io:WritableByteChannel writableFileResult = check io:openWritableFile("./files/sampleResponse.txt"); - io:WritableCharacterChannel destinationChannel = - new(writableFileResult, "UTF-8"); - io:println("Started to process the file."); - // Processes the given `string`. - var result = process(sourceChannel, destinationChannel); - if (result is error) { - log:printError("error occurred while processing chars ", err = result); - } else { - io:println("File processing complete."); - } - // Closes the readable channel. - closeRc(sourceChannel); - // Closes the writable channel. - closeWc(destinationChannel); +    // This example creates the /examples/character-io/files/sampleResponse.txt +    // destination file and writes the text "Hello my name is Ballerina!!"".   +    // You can replace this with the file path of a preferred text file. +    io:WritableByteChannel writableFileResult = check io:openWritableFile("./files/sampleResponse.txt"); +    io:WritableCharacterChannel destinationChannel = +            new(writableFileResult, "UTF-8"); +    io:println("Started to process the file."); +    // Processes the given `string`. +    var result = process(sourceChannel, destinationChannel); +    if (result is error) { +        log:printError("error occurred while processing chars ", err = result); +    } else { +        io:println("File processing complete."); +    } +    // Closes the readable channel. +    closeRc(sourceChannel); +    // Closes the writable channel. +    closeWc(destinationChannel); } From eca7c39f722c2e804f8c4cb6c91834f3d9cf6a4d Mon Sep 17 00:00:00 2001 From: wggihan Date: Wed, 23 Oct 2019 13:59:33 +0530 Subject: [PATCH 046/167] Restore directory listener to file module --- stdlib/file/build.gradle | 8 + stdlib/file/pom.xml | 290 ------------------ .../main/ballerina/src/file/file_common.bal | 24 ++ .../ballerina/src/file/service_endpoint.bal | 70 +++++ .../file/service/DirectoryCallback.java | 42 +++ .../service/DirectoryListenerConstants.java | 43 +++ .../stdlib/file/service/FSListener.java | 77 +++++ .../DirectoryListenerCompilerPlugin.java | 97 ++++++ .../file/service/endpoint/InitEndpoint.java | 62 ++++ .../file/service/endpoint/Register.java | 115 +++++++ .../stdlib/file/service/endpoint/Start.java | 55 ++++ .../stdlib/file/utils/FileConstants.java | 9 +- ...lerinalang.compiler.plugins.CompilerPlugin | 1 + .../file/DirectoryListenerConnectorTest.java | 204 ++++++++++++ .../file-system-negative-folder-exist.bal | 27 ++ ...le-system-negative-invalid-param-count.bal | 27 ++ ...ile-system-negative-invalid-param-type.bal | 27 ++ ...-system-negative-invalid-resource-name.bal | 33 ++ .../file-system-negative-invalid-returns.bal | 28 ++ .../file-system-negative-missing-variable.bal | 27 ++ .../file-system-negative-not-folder.bal | 27 ++ .../file-system-negative-without-resource.bal | 25 ++ .../test/resources/test-src/file-system.bal | 53 ++++ stdlib/file/src/test/resources/testng.xml | 14 +- 24 files changed, 1089 insertions(+), 296 deletions(-) delete mode 100644 stdlib/file/pom.xml create mode 100644 stdlib/file/src/main/ballerina/src/file/file_common.bal create mode 100644 stdlib/file/src/main/ballerina/src/file/service_endpoint.bal create mode 100644 stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryCallback.java create mode 100644 stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryListenerConstants.java create mode 100644 stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/FSListener.java create mode 100644 stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java create mode 100644 stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/InitEndpoint.java create mode 100644 stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Register.java create mode 100644 stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Start.java create mode 100644 stdlib/file/src/main/resources/META-INF/services/org.ballerinalang.compiler.plugins.CompilerPlugin create mode 100644 stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-folder-exist.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-count.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-type.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-invalid-resource-name.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-invalid-returns.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-missing-variable.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-not-folder.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system-negative-without-resource.bal create mode 100644 stdlib/file/src/test/resources/test-src/file-system.bal diff --git a/stdlib/file/build.gradle b/stdlib/file/build.gradle index c24c5e7a71b3..6db826db4378 100644 --- a/stdlib/file/build.gradle +++ b/stdlib/file/build.gradle @@ -16,6 +16,7 @@ */ apply from: "$rootDir/gradle/balNativeLibProject.gradle" +apply from: "$rootDir/gradle/baseNativeStdLibProject.gradle" configurations.testCompileClasspath { resolutionStrategy { @@ -31,6 +32,7 @@ dependencies { implementation project(':ballerina-time') implementation project(':ballerina-lang:internal') implementation project(':ballerina-io') + implementation 'org.wso2.transport.file:org.wso2.transport.local-file-system' baloImplementation project(path: ':ballerina-lang:annotations', configuration: 'baloImplementation') baloImplementation project(path: ':ballerina-runtime-api', configuration: 'baloImplementation') @@ -49,6 +51,12 @@ createBalo { jvmTarget = 'true' } +configurations { + testCompile.exclude group: 'org.slf4j', module: 'slf4j-log4j12' + testCompile.exclude group: 'org.slf4j', module: 'slf4j-simple' + testCompile.exclude group: 'org.ops4j.pax.logging', module: 'pax-logging-api' +} + description = 'Ballerina - File' configurations.all { diff --git a/stdlib/file/pom.xml b/stdlib/file/pom.xml deleted file mode 100644 index 5603c94e151a..000000000000 --- a/stdlib/file/pom.xml +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - ballerina-parent - org.ballerinalang - 0.992.0-m2-SNAPSHOT - ../../pom.xml - - 4.0.0 - - ballerina-file - jar - Ballerina - File - http://ballerina.io - - - - org.ballerinalang - ballerina-lang - - - org.ballerinalang - ballerina-core - - - org.ballerinalang - ballerina-runtime - - - org.ballerinalang - lib-creator - - - org.ballerinalang - ballerina-builtin - zip - ballerina-binary-repo - - - org.testng - testng - test - - - org.ballerinalang - ballerina-test-utils - test - - - org.ballerinalang - ballerina-builtin - test - - - org.ballerinalang - ballerina-runtime-api - test - - - org.ballerinalang - ballerina-time - - - org.ballerinalang - ballerina-time - zip - ballerina-binary-repo - - - org.ballerinalang - ballerina-runtime-api - zip - ballerina-binary-repo - - - io.swagger - swagger-models - - - - - - - src/main/resources - - ballerina/** - - - - - - org.codehaus.mojo - exec-maven-plugin - - - gen-balo - - java - - compile - - - - BALLERINA_DEV_MODE_COMPILE - true - - - - false - ${basedir}/src/main/ballerina/ - ${project.build.directory}/generated-balo/repo/ballerina - ${project.build.directory} - ${project.version} - true - - - - - - org.ballerinalang.stdlib.utils.GenerateBalo - test - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack-dependencies - generate-resources - - unpack-dependencies - - - ballerina-binary-repo - ${project.build.directory}/lib - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - distribution - package - - attached - - - assembly - - - - - - - - org.bsc.maven - maven-processor-plugin - ${mvn.processor.plugin.version} - - - org.ballerinalang.codegen.BallerinaAnnotationProcessor - - - - org.ballerinalang.stdlib.file.generated.providers - - StandardNativeElementProvider - - - - - process - - process - - generate-sources - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven.compiler.plugin.version} - - -proc:none - - - - org.apache.maven.plugins - maven-surefire-plugin - - -Dfile.encoding=UTF-8 ${jacoco.agent.argLine} - - ${project.build.testOutputDirectory}/logging.properties - - org.ballerinalang.logging.BLogManager - ${project.build.directory} - - - src/test/resources/testng.xml - - - - - org.jacoco - jacoco-maven-plugin - - - prepare-it-test-agent - - prepare-agent - - - true - true - - org/wso2/ballerinalang/compiler/parser/antlr4/** - - jacoco.agent.argLine - ${project.build.directory}/coverage-reports/jacoco.exec - - - - it-report - verify - - report-aggregate - - - - **/coverage-reports/jacoco.exec - - - org/wso2/ballerinalang/compiler/parser/antlr4/** - - ${project.build.directory}/coverage-reports/site - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-file-balo - compile - - copy-resources - - - ${project.build.directory}/lib/repo - - - ${project.build.directory}/generated-balo/repo/ - - - - - - - - - - - **/generated/** - - diff --git a/stdlib/file/src/main/ballerina/src/file/file_common.bal b/stdlib/file/src/main/ballerina/src/file/file_common.bal new file mode 100644 index 000000000000..fc3a781e29f1 --- /dev/null +++ b/stdlib/file/src/main/ballerina/src/file/file_common.bal @@ -0,0 +1,24 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# Represents an event which will trigger when there is a changes to listining direcotry. +# +# + name - Absolute file URI for triggerd event +# + operation - Triggered event action. This can be create, delete or modify +public type FileEvent record {| + string name; + string operation; +|}; diff --git a/stdlib/file/src/main/ballerina/src/file/service_endpoint.bal b/stdlib/file/src/main/ballerina/src/file/service_endpoint.bal new file mode 100644 index 000000000000..60fbeb204ce0 --- /dev/null +++ b/stdlib/file/src/main/ballerina/src/file/service_endpoint.bal @@ -0,0 +1,70 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/lang.'object as lang; + +/////////////////////////////////// +/// Direcotry Listener Endpoint /// +/////////////////////////////////// +# Represents directory listener endpoint where used to listen to a directory in the local file system. +# +public type Listener object { + private ListenerConfig config; + + *lang:Listener; + + public function __init(ListenerConfig listenerConfig) { + self.config = listenerConfig; + var result = self.initEndpoint(); + if (result is error) { + panic result; + } + } + + public function __start() returns error? { + return self.start(); + } + + public function __gracefulStop() returns error? { + return (); + } + + public function __immediateStop() returns error? { + return (); + } + + public function __attach(service s, string? name = ()) returns error? { + return self.register(s, name); + } + + public function __detach(service s) returns error? { + } + + function initEndpoint() returns error? = external; + + function register(service serviceType, string? name) returns error? = external; + + function start() returns error? = external; +}; + +# Represents configurations that required for directory listener. +# +# + path - Directory path which need to listen +# + recursive - Recursively monitor all sub folders or not in the given direcotry path +public type ListenerConfig record {| + string? path = (); + boolean recursive = false; +|}; diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryCallback.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryCallback.java new file mode 100644 index 000000000000..b29a3a4b6472 --- /dev/null +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryCallback.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file.service; + +import org.ballerinalang.jvm.values.ErrorValue; +import org.ballerinalang.jvm.values.connector.CallableUnitCallback; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * {@code DirectoryCallback} is the responsible for acting on notifications received from Ballerina side. + */ +public class DirectoryCallback implements CallableUnitCallback { + + private static final Logger log = LoggerFactory.getLogger(DirectoryCallback.class); + + @Override + public void notifySuccess() { + log.debug("File Listener: event deliver successfully."); + } + + @Override + public void notifyFailure(ErrorValue error) { + log.debug("File Listener: event deliver failed."); + } +} diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryListenerConstants.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryListenerConstants.java new file mode 100644 index 000000000000..f58e0a91a8e4 --- /dev/null +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/DirectoryListenerConstants.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file.service; + +import org.wso2.transport.localfilesystem.server.util.Constants; + +/** + * Constants for Directory Listener Server connector. + */ +public class DirectoryListenerConstants { + + //Annotation + public static final String ANNOTATION_PATH = "path"; + public static final String ANNOTATION_DIRECTORY_RECURSIVE = Constants.DIRECTORY_WATCH_RECURSIVE; + + public static final String FILE_SYSTEM_EVENT = "FileEvent"; + public static final String FS_SERVER_CONNECTOR = "serverConnector"; + public static final String SERVICE_ENDPOINT_CONFIG = "config"; + + public static final String EVENT_CREATE = Constants.EVENT_CREATE; + public static final String EVENT_DELETE = Constants.EVENT_DELETE; + public static final String EVENT_MODIFY = Constants.EVENT_MODIFY; + + public static final String RESOURCE_NAME_ON_CREATE = "onCreate"; + public static final String RESOURCE_NAME_ON_DELETE = "onDelete"; + public static final String RESOURCE_NAME_ON_MODIFY = "onModify"; +} diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/FSListener.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/FSListener.java new file mode 100644 index 000000000000..de06a1458bfa --- /dev/null +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/FSListener.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file.service; + +import org.ballerinalang.jvm.BallerinaValues; +import org.ballerinalang.jvm.scheduling.Scheduler; +import org.ballerinalang.jvm.types.AttachedFunction; +import org.ballerinalang.jvm.values.MapValue; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.jvm.values.connector.Executor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.wso2.transport.localfilesystem.server.connector.contract.LocalFileSystemEvent; +import org.wso2.transport.localfilesystem.server.connector.contract.LocalFileSystemListener; + +import java.util.Map; + +import static org.ballerinalang.stdlib.file.service.DirectoryListenerConstants.FILE_SYSTEM_EVENT; +import static org.ballerinalang.stdlib.file.utils.FileConstants.FILE_EVENT_NAME; +import static org.ballerinalang.stdlib.file.utils.FileConstants.FILE_EVENT_OPERATION; +import static org.ballerinalang.stdlib.file.utils.FileConstants.FILE_PACKAGE_ID; + +/** + * File System connector listener for Ballerina. + */ +public class FSListener implements LocalFileSystemListener { + + private static final Logger log = LoggerFactory.getLogger(FSListener.class); + private Scheduler scheduler; + private ObjectValue service; + private Map attachedFunctionRegistry; + + public FSListener(Scheduler scheduler, ObjectValue service, Map resourceRegistry) { + this.scheduler = scheduler; + this.service = service; + this.attachedFunctionRegistry = resourceRegistry; + } + + @Override + public void onMessage(LocalFileSystemEvent fileEvent) { + Object[] parameters = getJvmSignatureParameters(fileEvent); + AttachedFunction resource = getAttachedFunction(fileEvent.getEvent()); + if (resource != null) { + Executor.submit(scheduler, service, resource.getName(), new DirectoryCallback(), null, parameters); + } else { + log.warn(String.format("FileEvent received for unregistered resource: [%s] %s", fileEvent.getEvent(), + fileEvent.getFileName())); + } + } + + private Object[] getJvmSignatureParameters(LocalFileSystemEvent fileEvent) { + MapValue eventStruct = BallerinaValues.createRecordValue(FILE_PACKAGE_ID, FILE_SYSTEM_EVENT); + eventStruct.put(FILE_EVENT_NAME, fileEvent.getFileName()); + eventStruct.put(FILE_EVENT_OPERATION, fileEvent.getEvent()); + return new Object[] { eventStruct, true }; + } + + private AttachedFunction getAttachedFunction(String event) { + return attachedFunctionRegistry.get(event); + } +} diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java new file mode 100644 index 000000000000..6a4ddca6eb39 --- /dev/null +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file.service.compiler; + +import org.ballerinalang.compiler.plugins.SupportedResourceParamTypes; +import org.ballerinalang.model.tree.AnnotationAttachmentNode; +import org.ballerinalang.model.tree.ServiceNode; +import org.ballerinalang.model.types.TypeKind; +import org.ballerinalang.util.diagnostic.DiagnosticLog; +import org.wso2.ballerinalang.compiler.semantics.model.types.BStructureType; +import org.wso2.ballerinalang.compiler.semantics.model.types.BType; +import org.wso2.ballerinalang.compiler.tree.BLangFunction; +import org.wso2.ballerinalang.compiler.tree.BLangSimpleVariable; +import org.wso2.ballerinalang.util.AbstractTransportCompilerPlugin; + +import java.util.List; + +import static org.ballerinalang.stdlib.file.service.DirectoryListenerConstants.FILE_SYSTEM_EVENT; +import static org.ballerinalang.stdlib.file.service.DirectoryListenerConstants.RESOURCE_NAME_ON_CREATE; +import static org.ballerinalang.stdlib.file.service.DirectoryListenerConstants.RESOURCE_NAME_ON_DELETE; +import static org.ballerinalang.stdlib.file.service.DirectoryListenerConstants.RESOURCE_NAME_ON_MODIFY; +import static org.ballerinalang.util.diagnostic.Diagnostic.Kind.ERROR; + +/** + * Compiler plugin for validating Directory Listener. + * + * @since 0.970.0 + */ +@SupportedResourceParamTypes( + expectedListenerType = @SupportedResourceParamTypes.Type(packageName = "file", name = "Listener"), + paramTypes = { @SupportedResourceParamTypes.Type(packageName = "file", name = "FileEvent") } +) +public class DirectoryListenerCompilerPlugin extends AbstractTransportCompilerPlugin { + + private DiagnosticLog dlog = null; + + @Override + public void init(DiagnosticLog diagnosticLog) { + this.dlog = diagnosticLog; + } + + @Override + public void process(ServiceNode serviceData, List annotations) { + List resources = (List) serviceData.getResources(); + resources.forEach(res -> validate(serviceData.getName().getValue(), res, this.dlog)); + } + + public void validate(String serviceName, BLangFunction resource, DiagnosticLog dlog) { + switch (resource.getName().getValue()) { + case RESOURCE_NAME_ON_CREATE: + case RESOURCE_NAME_ON_DELETE: + case RESOURCE_NAME_ON_MODIFY: + final List parameters = resource.getParameters(); + String msg = "Invalid resource signature for %s in service %s. " + + "The parameter should be a file:FileEvent with no returns."; + msg = String.format(msg, resource.getName().getValue(), serviceName); + if (parameters.size() != 1) { + dlog.logDiagnostic(ERROR, resource.getPosition(), msg); + return; + } + BType fileEvent = parameters.get(0).getTypeNode().type; + if (fileEvent.getKind().equals(TypeKind.OBJECT)) { + if (fileEvent instanceof BStructureType) { + BStructureType event = (BStructureType) fileEvent; + if (!"file".equals(event.tsymbol.pkgID.name.value) || !FILE_SYSTEM_EVENT + .equals(event.tsymbol.name.value)) { + dlog.logDiagnostic(ERROR, resource.getPosition(), msg); + return; + } + } + } + if (!isResourceReturnsErrorOrNil(resource)) { + dlog.logDiagnostic(ERROR, resource.getPosition(), msg); + } + break; + default: + dlog.logDiagnostic(ERROR, resource.getPosition(), + "Invalid resource name " + resource.getName().getValue() + " in service " + serviceName); + } + } +} diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/InitEndpoint.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/InitEndpoint.java new file mode 100644 index 000000000000..2325a335caa5 --- /dev/null +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/InitEndpoint.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file.service.endpoint; + +import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; +import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; +import org.ballerinalang.stdlib.file.service.DirectoryListenerConstants; +import org.ballerinalang.stdlib.file.utils.FileConstants; +import org.ballerinalang.stdlib.file.utils.FileUtils; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + +/** + * Initialize endpoints. + */ + +@BallerinaFunction( + orgName = "ballerina", + packageName = "file", + functionName = "initEndpoint", + receiver = @Receiver(type = TypeKind.OBJECT, structType = "Listener", structPackage = "ballerina/file"), + isPublic = true +) +public class InitEndpoint { + + public static Object initEndpoint(Strand strand, ObjectValue listener) { + final String path = listener.getMapValue(DirectoryListenerConstants.SERVICE_ENDPOINT_CONFIG). + getStringValue(DirectoryListenerConstants.ANNOTATION_PATH); + if (path == null || path.isEmpty()) { + return FileUtils.getBallerinaError(FileConstants.FILE_SYSTEM_ERROR, "'path' field is empty"); + } + final Path dirPath = Paths.get(path); + if (Files.notExists(dirPath)) { + return FileUtils.getBallerinaError(FileConstants.FILE_SYSTEM_ERROR, "Folder does not exist: " + path); + } + if (!Files.isDirectory(dirPath)) { + return FileUtils.getBallerinaError(FileConstants.FILE_SYSTEM_ERROR, "Unable to find a directory: " + path); + } + return null; + } +} diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Register.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Register.java new file mode 100644 index 000000000000..34bfa09cb354 --- /dev/null +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Register.java @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file.service.endpoint; + +import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.types.AttachedFunction; +import org.ballerinalang.jvm.values.MapValueImpl; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; +import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; +import org.ballerinalang.stdlib.file.service.DirectoryListenerConstants; +import org.ballerinalang.stdlib.file.service.FSListener; +import org.ballerinalang.stdlib.file.utils.FileConstants; +import org.ballerinalang.stdlib.file.utils.FileUtils; +import org.wso2.transport.localfilesystem.server.connector.contract.LocalFileSystemConnectorFactory; +import org.wso2.transport.localfilesystem.server.connector.contract.LocalFileSystemServerConnector; +import org.wso2.transport.localfilesystem.server.connector.contractimpl.LocalFileSystemConnectorFactoryImpl; +import org.wso2.transport.localfilesystem.server.exception.LocalFileSystemServerConnectorException; +import org.wso2.transport.localfilesystem.server.util.Constants; + +import java.util.HashMap; +import java.util.Map; + +import static org.ballerinalang.stdlib.file.service.DirectoryListenerConstants.FILE_SYSTEM_EVENT; + +/** + * Register file listener service. + */ + +@BallerinaFunction( + orgName = "ballerina", + packageName = "file", + functionName = "register", + receiver = @Receiver(type = TypeKind.OBJECT, structType = "Listener", structPackage = "ballerina/file"), + isPublic = true +) +public class Register { + + public static Object register(Strand strand, ObjectValue listener, ObjectValue service, Object name) { + MapValueImpl serviceEndpointConfig = listener.getMapValue(DirectoryListenerConstants.SERVICE_ENDPOINT_CONFIG); + try { + final Map resourceRegistry = getResourceRegistry(service); + final String events = String.join(",", resourceRegistry.keySet()); + final Map paramMap = getParamMap(serviceEndpointConfig, events); + LocalFileSystemConnectorFactory connectorFactory = new LocalFileSystemConnectorFactoryImpl(); + LocalFileSystemServerConnector serverConnector = connectorFactory + .createServerConnector(service.getType().getName(), paramMap, + new FSListener(strand.scheduler, service, resourceRegistry)); + listener.addNativeData(DirectoryListenerConstants.FS_SERVER_CONNECTOR, serverConnector); + } catch (LocalFileSystemServerConnectorException e) { + return FileUtils.getBallerinaError(FileConstants.FILE_SYSTEM_ERROR, + "Unable to initialize server connector: " + e.getMessage()); + } + return null; + } + + private static Map getResourceRegistry(ObjectValue service) { + Map registry = new HashMap<>(5); + final AttachedFunction[] attachedFunctions = service.getType().getAttachedFunctions(); + for (AttachedFunction resource : attachedFunctions) { + switch (resource.getName()) { + case DirectoryListenerConstants.RESOURCE_NAME_ON_CREATE: + registry.put(DirectoryListenerConstants.EVENT_CREATE, resource); + break; + case DirectoryListenerConstants.RESOURCE_NAME_ON_DELETE: + registry.put(DirectoryListenerConstants.EVENT_DELETE, resource); + break; + case DirectoryListenerConstants.RESOURCE_NAME_ON_MODIFY: + registry.put(DirectoryListenerConstants.EVENT_MODIFY, resource); + break; + default: + // Do nothing. + } + } + if (registry.size() == 0) { + String msg = "At least a single resource required from following: " + + DirectoryListenerConstants.RESOURCE_NAME_ON_CREATE + " ," + + DirectoryListenerConstants.RESOURCE_NAME_ON_DELETE + " ," + + DirectoryListenerConstants.RESOURCE_NAME_ON_MODIFY + ". " + "Parameter should be of type - " + + "file:" + FILE_SYSTEM_EVENT; + throw new org.ballerinalang.jvm.util.exceptions.BallerinaConnectorException(msg); + } + return registry; + } + + private static Map getParamMap(MapValueImpl serviceEndpointConfig, String events) { + final String path = serviceEndpointConfig.getStringValue(DirectoryListenerConstants.ANNOTATION_PATH); + final boolean recursive = serviceEndpointConfig + .getBooleanValue(DirectoryListenerConstants.ANNOTATION_DIRECTORY_RECURSIVE); + Map paramMap = new HashMap<>(3); + if (path != null && !path.isEmpty()) { + paramMap.put(Constants.FILE_URI, path); + } + paramMap.put(Constants.DIRECTORY_WATCH_EVENTS, events); + paramMap.put(Constants.DIRECTORY_WATCH_RECURSIVE, String.valueOf(recursive)); + return paramMap; + } +} diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Start.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Start.java new file mode 100644 index 000000000000..ea94dc0a5af5 --- /dev/null +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/endpoint/Start.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file.service.endpoint; + +import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; +import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; +import org.ballerinalang.stdlib.file.service.DirectoryListenerConstants; +import org.ballerinalang.stdlib.file.utils.FileConstants; +import org.ballerinalang.stdlib.file.utils.FileUtils; +import org.wso2.transport.localfilesystem.server.connector.contract.LocalFileSystemServerConnector; +import org.wso2.transport.localfilesystem.server.exception.LocalFileSystemServerConnectorException; + +/** + * Start server connector. + */ + +@BallerinaFunction( + orgName = "ballerina", + packageName = "file", + functionName = "start", + receiver = @Receiver(type = TypeKind.OBJECT, structType = "Listener", structPackage = "ballerina/file"), + isPublic = true +) +public class Start { + + public static Object start(Strand strand, ObjectValue listener) { + LocalFileSystemServerConnector serverConnector = (LocalFileSystemServerConnector) listener + .getNativeData(DirectoryListenerConstants.FS_SERVER_CONNECTOR); + try { + serverConnector.start(); + } catch (LocalFileSystemServerConnectorException e) { + return FileUtils.getBallerinaError(FileConstants.FILE_SYSTEM_ERROR, e.getMessage()); + } + return null; + } +} diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/utils/FileConstants.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/utils/FileConstants.java index 6e0368c57e1d..4abfa2c06dff 100644 --- a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/utils/FileConstants.java +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/utils/FileConstants.java @@ -21,7 +21,6 @@ import org.ballerinalang.jvm.types.BPackage; import static org.ballerinalang.jvm.util.BLangConstants.BALLERINA_BUILTIN_PKG_PREFIX; -import static org.ballerinalang.jvm.util.BLangConstants.ORG_NAME_SEPARATOR; /** * Constants for file package functions. @@ -42,8 +41,7 @@ public class FileConstants { /** * Package path. */ - static final String FILE_PACKAGE_PATH = ORG_NAME + ORG_NAME_SEPARATOR + PACKAGE_NAME; - static final BPackage FILE_PACKAGE_ID = new BPackage(BALLERINA_BUILTIN_PKG_PREFIX, "file"); + public static final BPackage FILE_PACKAGE_ID = new BPackage(BALLERINA_BUILTIN_PKG_PREFIX, "file"); static final String FILE_INFO_TYPE = "FileInfo"; @@ -58,6 +56,11 @@ public class FileConstants { // System constant fields public static final int DEFAULT_MAX_DEPTH = -1; + // FileEvent struct field names + public static final String FILE_EVENT_NAME = "name"; + + public static final String FILE_EVENT_OPERATION = "operation"; + private FileConstants() { } } diff --git a/stdlib/file/src/main/resources/META-INF/services/org.ballerinalang.compiler.plugins.CompilerPlugin b/stdlib/file/src/main/resources/META-INF/services/org.ballerinalang.compiler.plugins.CompilerPlugin new file mode 100644 index 000000000000..fb853eb74f41 --- /dev/null +++ b/stdlib/file/src/main/resources/META-INF/services/org.ballerinalang.compiler.plugins.CompilerPlugin @@ -0,0 +1 @@ +org.ballerinalang.stdlib.file.service.compiler.DirectoryListenerCompilerPlugin diff --git a/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java b/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java new file mode 100644 index 000000000000..a68139790ae3 --- /dev/null +++ b/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.stdlib.file; + +import org.awaitility.Awaitility; +import org.ballerinalang.model.values.BBoolean; +import org.ballerinalang.model.values.BValue; +import org.ballerinalang.test.util.BCompileUtil; +import org.ballerinalang.test.util.BRunUtil; +import org.ballerinalang.test.util.CompileResult; +import org.ballerinalang.util.exceptions.BLangRuntimeException; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.FileVisitOption; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.attribute.FileTime; +import java.util.Comparator; + +import static java.util.concurrent.TimeUnit.MINUTES; + +/** + * Test class for Directory Listener connector. + */ +@Test() +public class DirectoryListenerConnectorTest { + + private File rootDirectory; + private Path testResourceRoot; + + @BeforeClass + public void init() { + try { + Path rootListenFolderPath = Files.createDirectory(Paths.get("src", "test", "resources", "fs")); + rootDirectory = rootListenFolderPath.toFile(); + rootDirectory.deleteOnExit(); + String resourceRoot = Paths.get("src", "test", "resources").toAbsolutePath().toString(); + testResourceRoot = Paths.get(resourceRoot, "test-src"); + } catch (IOException e) { + Assert.fail("Unable to create root folder to setup watch.", e); + } + } + + @AfterClass + public void cleanup() { + if (rootDirectory != null) { + try { + Files.walk(rootDirectory.toPath(), FileVisitOption.FOLLOW_LINKS) + .sorted(Comparator.reverseOrder()) + .map(Path::toFile) + .forEach(File::delete); + } catch (IOException ignore) { + //Ignore + } + } + } + + @Test(description = "Check the valid successful use case.") + public void testValidLocalFileSystemServerConnectorSyntax() { + CompileResult compileResult = BCompileUtil.compile(testResourceRoot.resolve("file-system.bal").toString()); + try { + final Path file = Files.createFile(Paths.get("src", "test", "resources", "fs", "temp.txt")); + Awaitility.await().atMost(1, MINUTES).until(() -> { + BValue[] result = BRunUtil.invoke(compileResult, "isCreateInvoked"); + return ((BBoolean) result[0]).booleanValue(); + }); + Files.setLastModifiedTime(file, FileTime.fromMillis(System.currentTimeMillis())); + Awaitility.await().atMost(1, MINUTES).until(() -> { + BValue[] result = BRunUtil.invoke(compileResult, "isModifyInvoked"); + return ((BBoolean) result[0]).booleanValue(); + }); + Files.deleteIfExists(file); + Awaitility.await().atMost(1, MINUTES).until(() -> { + BValue[] result = BRunUtil.invoke(compileResult, "isDeleteInvoked"); + return ((BBoolean) result[0]).booleanValue(); + }); + } catch (Throwable e) { + Assert.fail(e.getMessage()); + } + } + + + @Test(description = "Check the negative test for non valid resources.") + public void testNegativeWithoutResource() { + try { + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-without-resource.bal").toString()); + } catch (BLangRuntimeException e) { + String actualMsg = e.getMessage(); + String expectedErrorMsg = "At least a single resource required from following: " + + "onCreate ,onDelete ,onModify. Parameter should be of type - file:FileEvent"; + Assert.assertEquals(actualMsg, expectedErrorMsg, "Didn't get expected error msg for not having resources"); + } + } + + @Test(description = "Check the negative test for invalid resource param count.") + public void testNegativeWithoutInvalidParamCount() { + try { + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-invalid-param-count.bal"). + toString()); + } catch (Throwable e) { + String actualMsg = e.getMessage(); + String expectedErrorMsg = "Compilation Failed:\nERROR: .::" + + "file-system-negative-invalid-param-count.bal:25:5:: Invalid resource signature for onCreate in " + + "service fileSystem. The parameter should be a file:FileEvent with no returns.\n"; + Assert.assertEquals(actualMsg, expectedErrorMsg, "Didn't get expected error for invalid resource param."); + } + } + + @Test(description = "Check the negative test for invalid resource param type.") + public void testNegativeWithoutInvalidParamType() { + try { + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-invalid-param-type.bal"). + toString()); + } catch (Throwable e) { + String actualMsg = e.getMessage(); + String expectedErrorMsg = "Compilation Failed:\nERROR: .::" + + "file-system-negative-invalid-param-type.bal:26:5:: Invalid resource signature for onCreate in " + + "service fileSystem. The parameter should be a file:FileEvent\n"; + Assert.assertEquals(actualMsg, expectedErrorMsg, "Didn't get expected error for invalid resource type."); + } + } + + @Test(description = "Check the negative test for invalid resource name.") + public void testNegativeWithoutInvalidResourceName() { + try { + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-invalid-resource-name.bal").toString()); + } catch (Throwable e) { + String actualMsg = e.getMessage(); + String expectedErrorMsg = "Compilation Failed:\nERROR: .::" + + "file-system-negative-invalid-resource-name.bal:25:5:: Invalid resource name onCreate1 in " + + "service fileSystem\n"; + Assert.assertEquals(actualMsg, expectedErrorMsg, "Didn't get expected error for invalid resource name."); + } + } + + @Test(description = "Check the negative test for not a folder situation.") + public void testNegativeNotDirectory() { + try { + Files.createFile(Paths.get("src", "test", "resources", "fs", "file.txt")); + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-not-folder.bal").toString()); + } catch (Throwable e) { + String actualMsg = e.getMessage().substring(47, 51 + 54); + String expectedErrorMsg = "Unable to find a directory: src/test/resources/fs/file.txt"; + Assert.assertEquals(actualMsg, expectedErrorMsg, "Didn't get expected error for invalid folder."); + } + } + + @Test(description = "Check the negative test for folder not exist.") + public void testNegativeDirectoryNotExist() { + try { + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-folder-exist.bal").toString()); + } catch (BLangRuntimeException e) { + String actualMsg = e.getMessage().substring(47, 51 + 34); + String expectedErrorMsg = "Folder does not exist: hello/ballerina"; + Assert.assertEquals(actualMsg, expectedErrorMsg, "Didn't get expected error for non-exist folder."); + } + } + + @Test(description = "Check the negative test for endpoint config variable") + public void testNegativeMissingEndpointVariable() { + try { + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-missing-variable.bal").toString()); + } catch (Throwable e) { + String actualMsg = e.getMessage().substring(47, 51 + 17); + String expectedErrorMsg = "'path' field is empty"; + Assert.assertEquals(actualMsg, expectedErrorMsg, "Didn't get expected error for empty path."); + } + } + + @Test(description = "Check the negative test for invalid returns") + public void testNegativeInvalidReturn() { + try { + BCompileUtil.compile(testResourceRoot.resolve("file-system-negative-invalid-returns.bal").toString()); + } catch (Throwable e) { + String actualMsg = e.getMessage(); + String expect = "Compilation Failed:\n" + "ERROR: .::file-system-negative-invalid-returns.bal:25:5:: " + + "Invalid resource signature for onCreate in service fileSystem. " + + "The parameter should be a file:FileEvent with no returns.\n"; + Assert.assertEquals(actualMsg, expect, "Didn't get expected error for invalid returns."); + } + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-folder-exist.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-folder-exist.bal new file mode 100644 index 000000000000..951e2d185935 --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-folder-exist.bal @@ -0,0 +1,27 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "hello/ballerina", + recursive: false +}); + +service fileSystem on localFolder { + resource function onCreate (file:FileEvent m) { + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-count.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-count.bal new file mode 100644 index 000000000000..a064835df03f --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-count.bal @@ -0,0 +1,27 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "src/test/resources/fs", + recursive: false +}); + +service fileSystem on localFolder { + resource function onCreate(file:FileEvent m, string str) { + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-type.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-type.bal new file mode 100644 index 000000000000..c7cc33cb1c56 --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-param-type.bal @@ -0,0 +1,27 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "src/test/resources/fs", + recursive: false +}); + +service fileSystem on localFolder { + resource function onCreate(string req) { + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-resource-name.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-resource-name.bal new file mode 100644 index 000000000000..96170397ec68 --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-resource-name.bal @@ -0,0 +1,33 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "src/test/resources/fs", + recursive: false +}); + +service fileSystem on localFolder { + resource function onCreate1(file:FileEvent m) { + } + + resource function onModify(file:FileEvent m) { + } + + resource function onDelete(file:FileEvent m) { + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-returns.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-returns.bal new file mode 100644 index 000000000000..2d68a36895ef --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-invalid-returns.bal @@ -0,0 +1,28 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new({ + path: "src/test/resources/fs", + recursive: false +}); + +service fileSystem on localFolder { + resource function onCreate (file:FileEvent m) returns boolean { + return true; + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-missing-variable.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-missing-variable.bal new file mode 100644 index 000000000000..1443f081733e --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-missing-variable.bal @@ -0,0 +1,27 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "", + recursive: false +}); + +service fileSystem on localFolder { + resource function onCreate (file:FileEvent m) { + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-not-folder.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-not-folder.bal new file mode 100644 index 000000000000..fd3492d06a43 --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-not-folder.bal @@ -0,0 +1,27 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "src/test/resources/fs/file.txt", + recursive: false +}); + +service fileSystem on localFolder { + resource function onCreate (file:FileEvent m) { + } +} diff --git a/stdlib/file/src/test/resources/test-src/file-system-negative-without-resource.bal b/stdlib/file/src/test/resources/test-src/file-system-negative-without-resource.bal new file mode 100644 index 000000000000..d363e1812414 --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system-negative-without-resource.bal @@ -0,0 +1,25 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "src/test/resources/fs", + recursive: false +}); + +service fileSystem on localFolder { +} diff --git a/stdlib/file/src/test/resources/test-src/file-system.bal b/stdlib/file/src/test/resources/test-src/file-system.bal new file mode 100644 index 000000000000..59970f2fd798 --- /dev/null +++ b/stdlib/file/src/test/resources/test-src/file-system.bal @@ -0,0 +1,53 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/file; + +listener file:Listener localFolder = new ({ + path: "src/test/resources/fs", + recursive: false +}); + +boolean createInvoke = false; +boolean modifyInvoke = false; +boolean deleteInvoke = false; + +service fileSystem on localFolder { + + resource function onCreate(file:FileEvent m) { + createInvoke = true; + } + + resource function onModify(file:FileEvent m) { + modifyInvoke = true; + } + + resource function onDelete(file:FileEvent m) { + deleteInvoke = true; + } +} + +function isCreateInvoked() returns boolean { + return createInvoke; +} + +function isModifyInvoked() returns boolean { + return modifyInvoke; +} + +function isDeleteInvoked() returns boolean { + return deleteInvoke; +} diff --git a/stdlib/file/src/test/resources/testng.xml b/stdlib/file/src/test/resources/testng.xml index 0c5174a297f9..abbeef5d9e60 100644 --- a/stdlib/file/src/test/resources/testng.xml +++ b/stdlib/file/src/test/resources/testng.xml @@ -20,9 +20,17 @@ + + + - - - + + + + + + + + From 57399c16957ef56b2817e47bf1c420e1a2dcb4f7 Mon Sep 17 00:00:00 2001 From: Pubudu Fernando Date: Wed, 23 Oct 2019 17:58:42 +0530 Subject: [PATCH 047/167] Remove unnecessary log lib bindings --- bvm/ballerina-core/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bvm/ballerina-core/build.gradle b/bvm/ballerina-core/build.gradle index c54a6d5c0a6c..577507350d43 100644 --- a/bvm/ballerina-core/build.gradle +++ b/bvm/ballerina-core/build.gradle @@ -44,6 +44,7 @@ dependencies { implementation 'io.opentracing:opentracing-util' implementation 'org.awaitility:awaitility' implementation 'com.zaxxer:HikariCP' + implementation 'org.slf4j:slf4j-jdk14' } description = 'Ballerina - Core' @@ -51,6 +52,9 @@ description = 'Ballerina - Core' configurations { implementation { exclude group: 'org.apache.servicemix.bundles', module: 'org.apache.servicemix.bundles.commons-beanutils' + exclude group: 'org.ops4j.pax.logging', module: 'pax-logging-api' + exclude group: 'org.ops4j.pax.logging', module: 'pax-logging-log4j2' + exclude group: 'org.slf4j', module: 'slf4j-log4j12' } } From f6852e8c8c2d0f19414c0a8fed9804b913e13f77 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Wed, 23 Oct 2019 18:02:46 +0530 Subject: [PATCH 048/167] Fix bad-sad error in error match warning --- .../semantics/analyzer/SemanticAnalyzer.java | 2 +- .../MatchStructuredErrorPatternsTest.java | 11 ++++++++ .../error_match_pattern_warning_test.bal | 25 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/statements/matchstmt/error_match_pattern_warning_test.bal diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java index 0fc3149f89bc..5afee1512c9f 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SemanticAnalyzer.java @@ -1390,7 +1390,7 @@ && isReasonSpecified(errorVariable)) { if (warn) { dlog.warning(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, errorVariable.reason.name); - return false; + return true; } dlog.error(errorVariable.reason.pos, DiagnosticCode.INVALID_ERROR_REASON_BINDING_PATTERN, errorVariable.reason.name); diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java index b52226dd12f3..678d002228bb 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/matchstmt/MatchStructuredErrorPatternsTest.java @@ -223,6 +223,17 @@ public void testErrorMatchPatternNotSupportedErrors() { } + @Test + public void testErrorMatchPatternWarning() { + CompileResult resultWithWarning = + BCompileUtil.compile("test-src/statements/matchstmt/error_match_pattern_warning_test.bal"); + Assert.assertEquals(resultWithWarning.getWarnCount(), 1); + Assert.assertEquals(resultWithWarning.getErrorCount(), 0); + + BValue[] returns = BRunUtil.invoke(resultWithWarning, "noVarReasonErrorMatch"); + Assert.assertEquals(returns[0].stringValue(), "error-reason"); + } + @Test() public void testErrorMatchWihtoutReason() { BValue[] returns = BRunUtil.invoke(result, "testErrorMatchWihtoutReason"); diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/statements/matchstmt/error_match_pattern_warning_test.bal b/tests/jballerina-unit-test/src/test/resources/test-src/statements/matchstmt/error_match_pattern_warning_test.bal new file mode 100644 index 000000000000..df39c26b56c1 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/statements/matchstmt/error_match_pattern_warning_test.bal @@ -0,0 +1,25 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +function noVarReasonErrorMatch() returns string { + any|error a = error("error-reason"); + match a { + error(r) => { return r;} // should be error(var r); + 12 => { return "matched 12";} + } + + return "default"; +} From 1db75613382e5d20639d8712b6b2960f704278de Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Wed, 23 Oct 2019 20:01:19 +0530 Subject: [PATCH 049/167] Improve backspace handling --- .../BallerinaIndentingBackspaceHandler.java | 61 ++++++++++++------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaIndentingBackspaceHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaIndentingBackspaceHandler.java index db8981119e41..12b2e6cffb39 100644 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaIndentingBackspaceHandler.java +++ b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaIndentingBackspaceHandler.java @@ -18,11 +18,13 @@ import com.intellij.codeInsight.editorActions.BackspaceHandlerDelegate; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.editor.EditorModificationUtil; import com.intellij.openapi.editor.LogicalPosition; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import io.ballerina.plugins.idea.BallerinaLanguage; +import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; /** @@ -51,32 +53,49 @@ public boolean charDeleted(char c, @NotNull PsiFile file, @NotNull Editor editor LogicalPosition position = editor.getCaretModel().getLogicalPosition(); int lineStartOff = doc.getLineStartOffset(position.line); int lineEndOff = doc.getLineEndOffset(position.line); - String line = doc.getText(new TextRange(lineStartOff, lineEndOff)).trim(); + int caretOffset = editor.getCaretModel().getPrimaryCaret().getOffset(); + if (caretOffset < lineStartOff || caretOffset > lineEndOff) { + return false; + } - // if the line is empty, caret should be moved to the previous line. - if (line.isEmpty() && position.line > 1) { - int prevLineEndOff = doc.getLineEndOffset(position.line - 1); - doc.deleteString(prevLineEndOff, lineEndOff); + String textBeforeCaret = doc.getText(new TextRange(lineStartOff, caretOffset)).trim(); + String textToBeMoved = doc.getText(new TextRange(caretOffset, lineEndOff)).trim(); + // only if the text before the caret position is empty in a given line, caret should be moved to the previous + // line. + if (!textBeforeCaret.trim().isEmpty() || position.line <= 1) { + return false; + } - lineStartOff = doc.getLineStartOffset(position.line - 1); - lineEndOff = doc.getLineEndOffset(position.line - 1); - line = doc.getText(new TextRange(lineStartOff, lineEndOff)).trim(); + // if the text before the caret is empty in a given line, caret should be moved to the previous line. + int prevLineStartOff = doc.getLineStartOffset(position.line - 1); + int prevLineEndOff = doc.getLineEndOffset(position.line - 1); + doc.deleteString(prevLineEndOff, lineEndOff); + String prevLine = doc.getText(new TextRange(prevLineStartOff, prevLineEndOff)).trim(); - if (!line.isEmpty()) { - // if the previous line is not empty, caret should be moved to the end of that line. - editor.getCaretModel().moveToOffset(lineEndOff); - } else { - // if the previous line is empty, caret should be moved to the previous line while preserving - // indentation. - editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(position.line - 1, - position.column + 1)); - } + if (!prevLine.isEmpty()) { + // if the previous line is not empty, caret should be moved to the end of that line. + editor.getCaretModel().moveToOffset(prevLineEndOff); + } else { + // if the previous line is empty, caret should be moved to the previous line while preserving + // indentation. + int lineToBeMoved = position.line - 1; + int columnToBeMoved = position.column + 1; + editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(lineToBeMoved, + columnToBeMoved, position.leansForward)); - // Commit the document. - PsiDocumentManager.getInstance(file.getProject()).commitDocument(doc); - return true; + // This verification is needed since the column number might not be currently available. In that case, we + // need to add the required indentation manually. + int curColumn = editor.getCaretModel().getCurrentCaret().getLogicalPosition().column; + if (curColumn < columnToBeMoved) { + EditorModificationUtil.insertStringAtCaret(editor, StringUtils.repeat(" ", + columnToBeMoved - curColumn)); + } } - return false; + EditorModificationUtil.insertStringAtCaret(editor, textToBeMoved, false, 0); + // Commit the document. + PsiDocumentManager.getInstance(file.getProject()).commitDocument(doc); + return true; + } } From 9088687891c9cf7e13b29f3c4c27f318d1825c0b Mon Sep 17 00:00:00 2001 From: Pubudu Fernando Date: Thu, 24 Oct 2019 00:28:09 +0530 Subject: [PATCH 050/167] Exclude log binding from test utils --- tests/ballerina-test-utils/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ballerina-test-utils/build.gradle b/tests/ballerina-test-utils/build.gradle index a30ac227c6d1..48cc389d75c9 100644 --- a/tests/ballerina-test-utils/build.gradle +++ b/tests/ballerina-test-utils/build.gradle @@ -61,6 +61,7 @@ shadowJar { exclude(dependency('org.wso2.eclipse.osgi:org.eclipse.osgi.services')) exclude(dependency('org.slf4j:slf4j-log4j12')) exclude(dependency('org.slf4j:slf4j-simple')) + exclude(dependency('org.slf4j:slf4j-jdk14')) exclude(dependency('org.codehaus.woodstox:woodstox-core-asl')) exclude(dependency('org.codehaus.woodstox:stax2-api')) exclude(dependency('io.netty:netty-common')) From 622a5cc32d23727d7e367fab2b83c26e86facdfb Mon Sep 17 00:00:00 2001 From: aashikam Date: Wed, 23 Oct 2019 14:18:39 +0530 Subject: [PATCH 051/167] Add changes from code review --- .../rabbitmq/nativeimpl/channel/BasicGet.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java b/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java index 43d968ac2520..4bb75e36a82b 100644 --- a/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java +++ b/stdlib/messaging/rabbitmq/src/main/java/org/ballerinalang/messaging/rabbitmq/nativeimpl/channel/BasicGet.java @@ -18,7 +18,6 @@ package org.ballerinalang.messaging.rabbitmq.nativeimpl.channel; -import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; import com.rabbitmq.client.GetResponse; import org.ballerinalang.jvm.BallerinaValues; @@ -56,24 +55,22 @@ public static Object basicGet(Strand strand, ObjectValue channelObjectValue, Str } try { GetResponse response = channel.basicGet(queueName, autoAck); - return createAndPopulateMessageObjectValue(response.getBody(), response.getEnvelope().getDeliveryTag(), - response.getProps(), channel, autoAck); + return createAndPopulateMessageObjectValue(response, channel, autoAck); } catch (IOException e) { return RabbitMQUtils.returnErrorValue("Error occurred while retrieving the message: " + e.getMessage()); } } - private static ObjectValue createAndPopulateMessageObjectValue(byte[] message, long deliveryTag, - AMQP.BasicProperties properties, - Channel channel, boolean autoAck) { + private static ObjectValue createAndPopulateMessageObjectValue(GetResponse response, Channel channel, + boolean autoAck) { ObjectValue messageObjectValue = BallerinaValues.createObjectValue(RabbitMQConstants.PACKAGE_ID_RABBITMQ, RabbitMQConstants.MESSAGE_OBJECT); - messageObjectValue.addNativeData(RabbitMQConstants.DELIVERY_TAG, deliveryTag); + messageObjectValue.addNativeData(RabbitMQConstants.DELIVERY_TAG, response.getEnvelope().getDeliveryTag()); messageObjectValue.addNativeData(RabbitMQConstants.CHANNEL_NATIVE_OBJECT, channel); - messageObjectValue.addNativeData(RabbitMQConstants.MESSAGE_CONTENT, message); + messageObjectValue.addNativeData(RabbitMQConstants.MESSAGE_CONTENT, response.getBody()); messageObjectValue.addNativeData(RabbitMQConstants.AUTO_ACK_STATUS, autoAck); - messageObjectValue.addNativeData(RabbitMQConstants.BASIC_PROPERTIES, properties); + messageObjectValue.addNativeData(RabbitMQConstants.BASIC_PROPERTIES, response.getProps()); messageObjectValue.addNativeData(RabbitMQConstants.MESSAGE_ACK_STATUS, false); return messageObjectValue; } From e881c5808502d7135ec2a0f7bc35316a5355b0e6 Mon Sep 17 00:00:00 2001 From: chamil321 Date: Thu, 24 Oct 2019 08:14:51 +0530 Subject: [PATCH 052/167] Cache subscriber callback clients --- .../src/websub/hub_configuration.bal | 1 + .../main/ballerina/src/websub/hub_service.bal | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal index 79120c246bf5..7103cf6e78ee 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal @@ -25,6 +25,7 @@ const string HUB_PATH = "/hub"; const string DEFAULT_HOST = "0.0.0.0"; const int DEFAULT_LEASE_SECONDS_VALUE = 86400; //one day const string DEFAULT_SIGNATURE_METHOD = "SHA256"; +const int DEFAULT_CACHE_EXPIRY_MILLIS = 172800000; //TODO: Fix persistence configs, H2? const string DEFAULT_DB_DIRECTORY = "/tmp/websubdb"; diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index f99eae261153..28780e176d67 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -14,6 +14,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/cache; import ballerina/config; import ballerina/crypto; import ballerina/encoding; @@ -26,6 +27,9 @@ import ballerina/time; @tainted map pendingRequests = {}; +# This cache is used for caching HTTP clients against the subscriber callbacks. +cache:Cache subscriberCallbackClientCache = new(expiryTimeInMillis = DEFAULT_CACHE_EXPIRY_MILLIS); + service hubService = @http:ServiceConfig { basePath: BASE_PATH, @@ -273,7 +277,7 @@ function validateSubscriptionChangeRequest(string mode, string topic, string cal # + topic - The topic specified in the new subscription/unsubscription request # + params - Parameters specified in the new subscription/unsubscription request function verifyIntentAndAddSubscription(string callback, string topic, map params) { - http:Client callbackEp = new http:Client(callback, hubClientConfig); + http:Client callbackEp = getSubcriberCallbackClient(callback); string mode = params[HUB_MODE] ?: ""; string strLeaseSeconds = params[HUB_LEASE_SECONDS] ?: ""; var result = langint:fromString(strLeaseSeconds); @@ -441,7 +445,7 @@ function fetchTopicUpdate(string topic) returns http:Response|error { # + return - Nil if successful, error in case of invalid content-type function distributeContent(string callback, SubscriptionDetails subscriptionDetails, WebSubContent webSubContent) returns error? { - http:Client callbackEp = new http:Client(callback, hubClientConfig); + http:Client callbackEp = getSubcriberCallbackClient(callback); http:Request request = new; request.setPayload(webSubContent.payload); check request.setContentType(webSubContent.contentType); @@ -504,6 +508,26 @@ returns error? { return; } +# Function to retrieve cached subscriberCallbackClient for a given callback. +# +# + callback - The callback URL registered for the subscriber +# + return - `http:Client` indicating the client for a given callback from cache or new client +function getSubcriberCallbackClient(string callback) returns http:Client { + http:Client subscriberCallbackClient; + if (subscriberCallbackClientCache.hasKey(callback)) { + return subscriberCallbackClientCache.get(callback); + } else { + lock { + if (subscriberCallbackClientCache.hasKey(callback)) { + return subscriberCallbackClientCache.get(callback); + } + subscriberCallbackClient = new http:Client(callback, hubClientConfig); + subscriberCallbackClientCache.put(callback, <@untainted> subscriberCallbackClient); + return subscriberCallbackClient; + } + } +} + // TODO: validate if no longer necessary # Struct to represent a topic registration. # From 28890ea6b84a52698ea504ad92a59175787c5cb7 Mon Sep 17 00:00:00 2001 From: Tharik Kanaka Date: Thu, 24 Oct 2019 10:08:39 +0530 Subject: [PATCH 053/167] Enable setting java by installers --- distribution/zip/jballerina/bin/ballerina.bat | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/distribution/zip/jballerina/bin/ballerina.bat b/distribution/zip/jballerina/bin/ballerina.bat index acfd9bd94e9d..3ff603fecf31 100644 --- a/distribution/zip/jballerina/bin/ballerina.bat +++ b/distribution/zip/jballerina/bin/ballerina.bat @@ -33,6 +33,11 @@ rem ----- if JAVA_HOME is not set we're not happy ------------------------------ :checkJava +set BALLERINA_HOME=%~sdp0.. +if exist JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre ( + set "JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre" +) + if "%JAVA_HOME%" == "" goto noJavaHome if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome goto checkServer From d3e0d7907e5de3a3e65866fcc2a6829d907d3ab4 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Thu, 24 Oct 2019 05:47:41 +0000 Subject: [PATCH 054/167] [Gradle Release Plugin] - new version commit: 'v1.0.3-SNAPSHOT'. --- composer/lerna.json | 2 +- composer/package-lock.json | 532 +---------------- composer/package.json | 2 +- .../packages/api-designer/package-lock.json | 2 +- composer/packages/api-designer/package.json | 4 +- composer/packages/ast-model/package-lock.json | 2 +- composer/packages/ast-model/package.json | 6 +- composer/packages/bbe/package-lock.json | 2 +- composer/packages/bbe/package.json | 4 +- composer/packages/diagram/package-lock.json | 2 +- composer/packages/diagram/package.json | 12 +- composer/packages/distribution/package.json | 18 +- .../packages/documentation/package-lock.json | 2 +- composer/packages/documentation/package.json | 4 +- composer/packages/font/package-lock.json | 2 +- composer/packages/font/package.json | 4 +- .../packages/lang-service/package-lock.json | 2 +- composer/packages/lang-service/package.json | 4 +- .../syntax-highlighter/package-lock.json | 539 +----------------- .../packages/syntax-highlighter/package.json | 2 +- composer/packages/theme/package-lock.json | 2 +- composer/packages/theme/package.json | 4 +- composer/packages/tracing/package-lock.json | 2 +- composer/packages/tracing/package.json | 4 +- composer/tools/composer-cli/package-lock.json | 2 +- composer/tools/composer-cli/package.json | 2 +- gradle.properties | 2 +- tool-plugins/vscode/grammar/ballerina-grammar | 2 +- tool-plugins/vscode/package-lock.json | 2 +- tool-plugins/vscode/package.json | 2 +- 30 files changed, 52 insertions(+), 1119 deletions(-) diff --git a/composer/lerna.json b/composer/lerna.json index bee3d043885f..835f96e25f78 100644 --- a/composer/lerna.json +++ b/composer/lerna.json @@ -3,5 +3,5 @@ "packages/*", "tools/*" ], - "version": "1.0.2-SNAPSHOT" + "version": "1.0.2" } diff --git a/composer/package-lock.json b/composer/package-lock.json index 08c807ca17d9..129402420874 100644 --- a/composer/package-lock.json +++ b/composer/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/composer", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7587,7 +7587,6 @@ "anymatch": "2.0.0", "async-each": "1.0.2", "braces": "2.3.2", - "fsevents": "1.2.9", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -11370,535 +11369,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.13.2", - "node-pre-gyp": "0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "4.1.1", - "iconv-lite": "0.4.24", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.3.0", - "nopt": "4.0.1", - "npm-packlist": "1.4.1", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.3", - "semver": "5.7.0", - "tar": "4.4.8" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.6" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } - } - }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", diff --git a/composer/package.json b/composer/package.json index 233d02be3535..64e163779cfb 100644 --- a/composer/package.json +++ b/composer/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@ballerina/composer", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "scripts": { "prebuild": "npm i && lerna bootstrap", diff --git a/composer/packages/api-designer/package-lock.json b/composer/packages/api-designer/package-lock.json index 5824fa611017..f4b4e66bee0d 100644 --- a/composer/packages/api-designer/package-lock.json +++ b/composer/packages/api-designer/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/api-designer", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/api-designer/package.json b/composer/packages/api-designer/package.json index 5a3d3fa9e0ce..4bb4f248f276 100644 --- a/composer/packages/api-designer/package.json +++ b/composer/packages/api-designer/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/api-designer", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "lib/index.js", "scripts": { @@ -18,7 +18,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "copyfiles": "^2.1.0" }, "dependencies": { diff --git a/composer/packages/ast-model/package-lock.json b/composer/packages/ast-model/package-lock.json index b8927044ea2a..9386091e6660 100644 --- a/composer/packages/ast-model/package-lock.json +++ b/composer/packages/ast-model/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ast-model", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/ast-model/package.json b/composer/packages/ast-model/package.json index 1bf4b3bb11c5..72356b306aae 100644 --- a/composer/packages/ast-model/package.json +++ b/composer/packages/ast-model/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ast-model", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "ast-model", "license": "Apache-2.0", "files": [ @@ -23,7 +23,7 @@ "gen-default-nodes": "npm run build && node lib/tools/gen-default-nodes" }, "dependencies": { - "@ballerina/lang-service": "^1.0.2-SNAPSHOT", + "@ballerina/lang-service": "^1.0.2", "glob": "^7.1.3", "lodash": "^4.17.11", "prettier": "^1.5.2", @@ -31,7 +31,7 @@ "vscode-uri": "^1.0.6" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/lodash": "^4.14.117", "copyfiles": "^2.1.0" }, diff --git a/composer/packages/bbe/package-lock.json b/composer/packages/bbe/package-lock.json index 4a9af408a3bf..d6156f05b178 100644 --- a/composer/packages/bbe/package-lock.json +++ b/composer/packages/bbe/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ballerina-by-examples", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/bbe/package.json b/composer/packages/bbe/package.json index 7742a24bfea2..73f7fbf73195 100644 --- a/composer/packages/bbe/package.json +++ b/composer/packages/bbe/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ballerina-by-examples", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Provides components for displaying Ballerina By Examples", "main": "lib/src/index.js", "scripts": { @@ -19,7 +19,7 @@ "lodash": "^4.17.11" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/lodash": "^4.14.118" }, "author": "ballerina.io", diff --git a/composer/packages/diagram/package-lock.json b/composer/packages/diagram/package-lock.json index 40e1319055fe..fb338de427ea 100644 --- a/composer/packages/diagram/package-lock.json +++ b/composer/packages/diagram/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/diagram", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/diagram/package.json b/composer/packages/diagram/package.json index 45c43d659c00..03b013b25c02 100644 --- a/composer/packages/diagram/package.json +++ b/composer/packages/diagram/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/diagram", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Provides a set of react components to draw Ballerina Diagrams.", "keywords": [ "ballerina", @@ -31,16 +31,16 @@ "react-dom": "^16.2.0" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", - "@ballerina/font": "^1.0.2-SNAPSHOT", - "@ballerina/theme": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", + "@ballerina/font": "^1.0.2", + "@ballerina/theme": "^1.0.2", "@types/lodash": "^4.14.118", "@types/lodash.debounce": "^4.0.4", "copyfiles": "^2.1.0" }, "dependencies": { - "@ballerina/ast-model": "^1.0.2-SNAPSHOT", - "@ballerina/lang-service": "^1.0.2-SNAPSHOT", + "@ballerina/ast-model": "^1.0.2", + "@ballerina/lang-service": "^1.0.2", "lodash": "^4.17.11", "lodash.debounce": "^4.0.8", "log4javascript": "^1.4.15", diff --git a/composer/packages/distribution/package.json b/composer/packages/distribution/package.json index 51c53b0bc100..8c0ee1ae678d 100644 --- a/composer/packages/distribution/package.json +++ b/composer/packages/distribution/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/distribution", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "build/composer.js", "scripts": { @@ -15,15 +15,15 @@ "author": "ballerina.io", "license": "Apache-2.0", "dependencies": { - "@ballerina/api-designer": "^1.0.2-SNAPSHOT", - "@ballerina/ballerina-by-examples": "^1.0.2-SNAPSHOT", - "@ballerina/diagram": "^1.0.2-SNAPSHOT", - "@ballerina/documentation": "^1.0.2-SNAPSHOT", - "@ballerina/font": "^1.0.2-SNAPSHOT", - "@ballerina/theme": "^1.0.2-SNAPSHOT", - "@ballerina/tracing": "^1.0.2-SNAPSHOT" + "@ballerina/api-designer": "^1.0.2", + "@ballerina/ballerina-by-examples": "^1.0.2", + "@ballerina/diagram": "^1.0.2", + "@ballerina/documentation": "^1.0.2", + "@ballerina/font": "^1.0.2", + "@ballerina/theme": "^1.0.2", + "@ballerina/tracing": "^1.0.2" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT" + "@ballerina/composer-cli": "^1.0.2" } } diff --git a/composer/packages/documentation/package-lock.json b/composer/packages/documentation/package-lock.json index aa320c7c34d3..53fae5bbd0ae 100644 --- a/composer/packages/documentation/package-lock.json +++ b/composer/packages/documentation/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/documentation", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/documentation/package.json b/composer/packages/documentation/package.json index 0eed7735acc5..8d024d797b8c 100644 --- a/composer/packages/documentation/package.json +++ b/composer/packages/documentation/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/documentation", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "lib/index.js", "scripts": { @@ -10,7 +10,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "dependencies": { - "@ballerina/ast-model": "^1.0.2-SNAPSHOT", + "@ballerina/ast-model": "^1.0.2", "diff": "^3.5.0", "escape-html": "^1.0.3", "react-markdown": "^4.0.0" diff --git a/composer/packages/font/package-lock.json b/composer/packages/font/package-lock.json index dbadd8854517..28a388a8a03d 100644 --- a/composer/packages/font/package-lock.json +++ b/composer/packages/font/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/font", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/font/package.json b/composer/packages/font/package.json index 7c5dc4308fe6..f358ede3db5d 100644 --- a/composer/packages/font/package.json +++ b/composer/packages/font/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/font", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Ballerina Diagram Font", "main": "build/index.js", "scripts": { @@ -12,7 +12,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "watch": "^1.0.2", "webfont": "^8.1.4" } diff --git a/composer/packages/lang-service/package-lock.json b/composer/packages/lang-service/package-lock.json index 4104df42ec1e..2d2d706105ec 100644 --- a/composer/packages/lang-service/package-lock.json +++ b/composer/packages/lang-service/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/lang-service", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/lang-service/package.json b/composer/packages/lang-service/package.json index a55199b1b86f..7db915786be9 100644 --- a/composer/packages/lang-service/package.json +++ b/composer/packages/lang-service/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/lang-service", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "lang-service", "license": "Apache-2.0", "files": [ @@ -31,7 +31,7 @@ "ws": "^6.1.0" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/fs-extra": "^5.0.4", "@types/glob": "^7.1.1", "@types/jest": "^22.0.1", diff --git a/composer/packages/syntax-highlighter/package-lock.json b/composer/packages/syntax-highlighter/package-lock.json index 6ffbda0bf3d5..baf8a362c6c3 100644 --- a/composer/packages/syntax-highlighter/package-lock.json +++ b/composer/packages/syntax-highlighter/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/syntax-highlighter", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -908,7 +908,6 @@ "anymatch": "2.0.0", "async-each": "1.0.3", "braces": "2.3.2", - "fsevents": "1.2.9", "glob-parent": "3.1.0", "inherits": "2.0.4", "is-binary-path": "1.0.1", @@ -2142,535 +2141,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.14.0", - "node-pre-gyp": "0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "4.1.1", - "iconv-lite": "0.4.24", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.3.0", - "nopt": "4.0.1", - "npm-packlist": "1.4.1", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.3", - "semver": "5.7.0", - "tar": "4.4.8" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.6" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -3804,13 +3274,6 @@ "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", "dev": true }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", diff --git a/composer/packages/syntax-highlighter/package.json b/composer/packages/syntax-highlighter/package.json index d243b43373ad..c1772d4fb062 100644 --- a/composer/packages/syntax-highlighter/package.json +++ b/composer/packages/syntax-highlighter/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/syntax-highlighter", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "A frontend syntax highlighter for Ballerina based on monaco.", "main": "lib/highlighter.js", "scripts": { diff --git a/composer/packages/theme/package-lock.json b/composer/packages/theme/package-lock.json index 9ec4a550f2ec..9608ac0865c7 100644 --- a/composer/packages/theme/package-lock.json +++ b/composer/packages/theme/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/theme", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/theme/package.json b/composer/packages/theme/package.json index bcf1cc2268ef..e5755c21cbd9 100644 --- a/composer/packages/theme/package.json +++ b/composer/packages/theme/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/theme", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Theme for web components of Ballerina Tooling.", "keywords": [ "ballerina", @@ -21,6 +21,6 @@ "watch": "^1.0.2" }, "dependencies": { - "@ballerina/font": "^1.0.2-SNAPSHOT" + "@ballerina/font": "^1.0.2" } } diff --git a/composer/packages/tracing/package-lock.json b/composer/packages/tracing/package-lock.json index f6dd07e72ebe..5362d35d7eaa 100644 --- a/composer/packages/tracing/package-lock.json +++ b/composer/packages/tracing/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/tracing", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/tracing/package.json b/composer/packages/tracing/package.json index 8b9b069c0337..dcf5506cdeaf 100644 --- a/composer/packages/tracing/package.json +++ b/composer/packages/tracing/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/tracing", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "lib/src/index.js", "scripts": { @@ -18,7 +18,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/lodash": "^4.14.116" }, "dependencies": { diff --git a/composer/tools/composer-cli/package-lock.json b/composer/tools/composer-cli/package-lock.json index 4f031b7cb1df..78bb4dee0a27 100644 --- a/composer/tools/composer-cli/package-lock.json +++ b/composer/tools/composer-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/composer-cli", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/tools/composer-cli/package.json b/composer/tools/composer-cli/package.json index fbd6d7e52a83..32315d6bccc3 100644 --- a/composer/tools/composer-cli/package.json +++ b/composer/tools/composer-cli/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@ballerina/composer-cli", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Includes a CLI util to help with composer packages development", "bin": { "composer": "./bin/composer" diff --git a/gradle.properties b/gradle.properties index c844c014e7bd..c3fddace4d4d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,6 @@ org.gradle.caching=true org.gradle.parallel=true org.gradle.jvmargs='-Dfile.encoding=UTF-8' org.gradle.workers.max=3 -version=1.0.2 +version=1.0.3-SNAPSHOT group=org.ballerinalang bootstrappedOn=1.0.0-alpha2 diff --git a/tool-plugins/vscode/grammar/ballerina-grammar b/tool-plugins/vscode/grammar/ballerina-grammar index 3c64295bd78b..8f6cf0aef527 160000 --- a/tool-plugins/vscode/grammar/ballerina-grammar +++ b/tool-plugins/vscode/grammar/ballerina-grammar @@ -1 +1 @@ -Subproject commit 3c64295bd78b174e24329a76aef227a74fc1d702 +Subproject commit 8f6cf0aef527a8a682949721920233770dca05d5 diff --git a/tool-plugins/vscode/package-lock.json b/tool-plugins/vscode/package-lock.json index c6e9726a3962..ecf9f066c00a 100644 --- a/tool-plugins/vscode/package-lock.json +++ b/tool-plugins/vscode/package-lock.json @@ -1,6 +1,6 @@ { "name": "ballerina", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/tool-plugins/vscode/package.json b/tool-plugins/vscode/package.json index 24d5c2abbb06..9c164fdbf4b0 100644 --- a/tool-plugins/vscode/package.json +++ b/tool-plugins/vscode/package.json @@ -2,7 +2,7 @@ "name": "ballerina", "displayName": "Ballerina", "description": "Intellisense, Diagram View, Debugging, code formatting and refactoring for Ballerina", - "version": "1.0.1", + "version": "1.0.2", "publisher": "ballerina", "repository": { "type": "git", From 8a53a2affd99bffe9a030550c97960fb4deb1e08 Mon Sep 17 00:00:00 2001 From: Nipuna Marcus Date: Thu, 24 Oct 2019 11:19:36 +0530 Subject: [PATCH 055/167] Fix service error reporting position to service name --- .../openapi/validator/ValidatorUtil.java | 71 +++++++++++++------ 1 file changed, 48 insertions(+), 23 deletions(-) diff --git a/misc/openapi-ballerina/modules/openapi-validator/src/main/java/org/ballerinalang/openapi/validator/ValidatorUtil.java b/misc/openapi-ballerina/modules/openapi-validator/src/main/java/org/ballerinalang/openapi/validator/ValidatorUtil.java index cf054a7f0bee..989278aeb795 100644 --- a/misc/openapi-ballerina/modules/openapi-validator/src/main/java/org/ballerinalang/openapi/validator/ValidatorUtil.java +++ b/misc/openapi-ballerina/modules/openapi-validator/src/main/java/org/ballerinalang/openapi/validator/ValidatorUtil.java @@ -69,7 +69,8 @@ static OpenAPI parseOpenAPIFile(String definitionURI) throws OpenApiValidatorExc OpenAPI api = new OpenAPIV3Parser().read(definitionURI); if (api == null) { - throw new OpenApiValidatorException("Couldn't read the definition from file: " + definitionURI); + throw new OpenApiValidatorException("Couldn't read the OpenAPI contract from the given file: " + + definitionURI); } return api; @@ -233,7 +234,10 @@ static void validateResourcesAgainstOpenApi(List tags, List oper openAPISummaryList); if (openAPIPathSummary == null) { dLog.logDiagnostic(Diagnostic.Kind.ERROR, resourceSummary.getPathPosition(), - "Mismatch with OpenAPI contract. Path: " + resourceSummary.getPath()); + "Ballerina service contains a Resource that is not" + + " documented in the OpenAPI contract." + + " Error Resource path: '" + resourceSummary.getPath() + + "'"); } else { List unmatchedMethods = new ArrayList<>(); if (!operationFilteringEnabled && !tagFilteringEnabled) { @@ -277,10 +281,12 @@ static void validateResourcesAgainstOpenApi(List tags, List oper if (!isExist) { dLog.logDiagnostic(Diagnostic.Kind.ERROR, parameter.getParameter().getPosition(), - "Mismatch with OpenAPI contract. Couldn't " + - "find documentation for the parameter '" - + parameter.getName() + "' for the method '" + resourceMethod - + "' of the Path: " + resourceSummary.getPath()); + "'" + + parameter.getName() + "' parameter for the method '" + + resourceMethod + + "' of the resource associated with the path: '" + + resourceSummary.getPath() + + "' is not documented in the OpenAPI contract"); } } } @@ -288,9 +294,9 @@ static void validateResourcesAgainstOpenApi(List tags, List oper String methods = getUnmatchedMethodList(unmatchedMethods); if (!openAPIPathSummary.getAvailableOperations().containsAll(resourceSummary.getMethods())) { dLog.logDiagnostic(Diagnostic.Kind.ERROR, resourceSummary.getMethodsPosition(), - "Mismatch with OpenAPI contract. Couldn't find" + - " documentation for http method(s) '" + methods + "' for the Path: " + - resourceSummary.getPath()); + "OpenAPI contract doesn't contains the" + + " documentation for http method(s) '" + methods + "' for the Path: '" + + resourceSummary.getPath() + "'"); } } } @@ -320,7 +326,7 @@ static void validateOpenApiAgainstResources(ServiceNode serviceNode, List resourceSummaries = getResourceSummaryByPath(openApiSummary.getPath(), resourceSummaryList); if (resourceSummaries == null) { - dLog.logDiagnostic(Diagnostic.Kind.ERROR, serviceNode.getPosition(), + dLog.logDiagnostic(Diagnostic.Kind.ERROR, getServiceNamePosition(serviceNode), "Mismatch with OpenAPI contract. Implementation is missing for the path: " + openApiSummary.getPath()); } else { @@ -343,7 +349,7 @@ static void validateOpenApiAgainstResources(ServiceNode serviceNode, List 0) { String methods = getUnmatchedMethodList(unmatchedMethods); - dLog.logDiagnostic(Diagnostic.Kind.ERROR, serviceNode.getPosition(), + dLog.logDiagnostic(Diagnostic.Kind.ERROR, getServiceNamePosition(serviceNode), "Mismatch with OpenAPI contract. " + "Implementation is missing for http method(s) '" + methods + "' for the path: " + openApiSummary.getPath()); @@ -359,7 +365,7 @@ static void validateOpenApiAgainstResources(ServiceNode serviceNode, List 0) { String methods = getUnmatchedMethodList(unmatchedMethods); - dLog.logDiagnostic(Diagnostic.Kind.ERROR, serviceNode.getPosition(), + dLog.logDiagnostic(Diagnostic.Kind.ERROR, getServiceNamePosition(serviceNode), "Mismatch with OpenAPI contract. " + "Implementation is missing for http method(s) '" + methods + "' for the path: " + openApiSummary.getPath()); @@ -379,7 +385,7 @@ static void validateOpenApiAgainstResources(ServiceNode serviceNode, List 0) { String methods = getUnmatchedMethodList(unmatchedMethods); - dLog.logDiagnostic(Diagnostic.Kind.ERROR, serviceNode.getPosition(), + dLog.logDiagnostic(Diagnostic.Kind.ERROR, getServiceNamePosition(serviceNode), "Mismatch with OpenAPI contract. " + "Implementation is missing for http method(s) '" + methods + "' for the path: " + openApiSummary.getPath()); @@ -393,7 +399,7 @@ static void validateOpenApiAgainstResources(ServiceNode serviceNode, List resourceParamNames = resourceSummaryForMethod.getParamNames(); for (OpenAPIParameter openAPIParameter : operationParamNames) { boolean isExist = false; + ResourceParameter nonExistingResourceParameter = null; for (ResourceParameter parameter : resourceParamNames) { if (openAPIParameter.isTypeAvailableAsRef()) { if (openAPIParameter.getName().equals(parameter.getName())) { @@ -478,14 +485,29 @@ private static void checkForParameterMismatch(OpenAPIPathSummary openApiSummary, isExist = validateOpenAPIAgainResourceParams(parameter, parameter.getParameter().symbol, openAPIParameter.getParameter().getSchema(), dLog, method); } + + if (!isExist) { + nonExistingResourceParameter = parameter; + break; + } } if (!isExist) { - dLog.logDiagnostic(Diagnostic.Kind.ERROR, serviceNode.getPosition(), - "Mismatch with OpenAPI contract. Implementation " + - "is missing for parameter '" + openAPIParameter.getName() + - "' for the method '" + method + "' of the Path: " + - resourceSummaryForMethod.getPath()); + if (nonExistingResourceParameter != null) { + dLog.logDiagnostic(Diagnostic.Kind.ERROR, + nonExistingResourceParameter.getParameter().getPosition(), + "Mismatch with OpenAPI contract. Ballerina implementation " + + "is missing for the parameter '" + openAPIParameter.getName() + + "' for the method '" + method + "' of the Path: " + + resourceSummaryForMethod.getPath()); + } else { + dLog.logDiagnostic(Diagnostic.Kind.ERROR, getServiceNamePosition(serviceNode), + "Mismatch with OpenAPI contract. Ballerina implementation " + + "is missing for the parameter '" + openAPIParameter.getName() + + "' for the method '" + method + "' of the Path: " + + resourceSummaryForMethod.getPath()); + } + break; } } } @@ -517,9 +539,8 @@ private static boolean validateResourceAgainstOpenAPIParams(BVarSymbol resourceP if (!isExist) { dLog.logDiagnostic(Diagnostic.Kind.ERROR, field.pos, - "Mismatch with OpenAPI contract. Couldn't " + - "find documentation for the field '" + field.name.getValue() + - "' for '" + method + "' method"); + "'" + field.name.getValue() + + "' field is not documented in OpenAPI contract for '" + method + "' method"); } } return true; @@ -619,7 +640,7 @@ private static List getResourceSummaryByPath(String path, List resourceSummaryList) { List resourceSummaries = null; for (ResourceSummary resourceSummary : resourceSummaryList) { - if (resourceSummary.getPath().equals(path)) { + if (resourceSummary.getPath() != null && resourceSummary.getPath().equals(path)) { if (resourceSummaries == null) { resourceSummaries = new ArrayList<>(); resourceSummaries.add(resourceSummary); @@ -658,4 +679,8 @@ private static String convertOpenAPITypeToBallerina(String type) { return convertedType; } + + private static Diagnostic.DiagnosticPosition getServiceNamePosition(ServiceNode serviceNode) { + return serviceNode.getName().getPosition(); + } } From cf9a8331ed579492e954d6997cc19184f197b300 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Thu, 24 Oct 2019 13:57:02 +0530 Subject: [PATCH 056/167] Add string splitting support for enter key press --- .../BallerinaEnterInStringHandler.java | 112 ++++++++++++++++++ .../src/main/resources/META-INF/plugin.xml | 10 +- 2 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java new file mode 100644 index 000000000000..975a9b6eb1d1 --- /dev/null +++ b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.ballerina.plugins.idea.editor.inserthandlers; + +import com.intellij.codeInsight.editorActions.enter.EnterHandlerDelegateAdapter; +import com.intellij.openapi.actionSystem.DataContext; +import com.intellij.openapi.editor.Document; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.editor.EditorModificationUtil; +import com.intellij.openapi.editor.LogicalPosition; +import com.intellij.openapi.editor.actionSystem.EditorActionHandler; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.Ref; +import com.intellij.openapi.util.TextRange; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import io.ballerina.plugins.idea.BallerinaLanguage; +import io.ballerina.plugins.idea.psi.BallerinaTypes; +import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; + +/** + * Enter key press handler for ballerina strings. + */ +public class BallerinaEnterInStringHandler extends EnterHandlerDelegateAdapter { + + public Result preprocessEnter(@NotNull PsiFile file, @NotNull Editor editor, @NotNull Ref caretOffset, + @NotNull Ref caretAdvance, @NotNull DataContext dataContext, + EditorActionHandler originalHandler) { + + if (!file.getLanguage().is(BallerinaLanguage.INSTANCE)) { + return Result.Continue; + } + + // We need to save the file before checking. Otherwise issues can occur when we press enter in a string. + Project project = file.getProject(); + PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); + + // Checks whether the cursor is placed inside the double quotes. + int caretOff = editor.getCaretModel().getOffset(); + if (!isInStringLiteral(file, caretOff)) { + return Result.Continue; + } + + PsiElement element = file.findElementAt(caretOff); + if (element == null) { + return Result.Continue; + } + Document doc = editor.getDocument(); + int startOffset = element.getTextRange().getStartOffset(); + int endOffset = element.getTextRange().getEndOffset(); + int lineEndOffset = doc.getLineEndOffset(editor.getCaretModel().getLogicalPosition().line); + + // Adds the missing double quotes and + operator to the splitted text. + String lText = doc.getText(new TextRange(startOffset, caretOff)) + "\" + \n"; + String rText = "\"" + doc.getText(new TextRange(caretOff, endOffset)) + doc.getText(new TextRange(endOffset, + lineEndOffset)); + + editor.getCaretModel().moveToOffset(startOffset); + LogicalPosition caretPos = editor.getCaretModel().getLogicalPosition(); + + // Replaces the current single string with the splitted strings. + doc.deleteString(startOffset, lineEndOffset); + doc.insertString(startOffset, lText); + navigateToNextLine(editor, caretPos); + EditorModificationUtil.insertStringAtCaret(editor, rText, false, 1); + + PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); + return Result.Stop; + } + + private boolean isInStringLiteral(PsiFile file, int offset) { + PsiElement element = file.findElementAt(offset); + PsiElement prevElement = file.findElementAt(offset - 1); + PsiElement nextElement = file.findElementAt(offset + 1); + return isStringLiteral(element) && isStringLiteral(prevElement) && isStringLiteral(nextElement); + } + + private boolean isStringLiteral(PsiElement element) { + if (element == null) { + return false; + } + return element.getNode().getElementType() == BallerinaTypes.QUOTED_STRING_LITERAL; + } + + private void navigateToNextLine(Editor editor, LogicalPosition caretPos) { + editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(caretPos.line + 1, + caretPos.column, caretPos.leansForward)); + // This verification is needed since the column number might not be currently available. In that case, we + // need to add the required indentation manually. + int curColumn = editor.getCaretModel().getCurrentCaret().getLogicalPosition().column; + if (curColumn < caretPos.column) { + EditorModificationUtil.insertStringAtCaret(editor, StringUtils.repeat(" ", caretPos.column - curColumn)); + } + } +} + diff --git a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml index 9fdf9cde2b4c..46cc8201284a 100644 --- a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml +++ b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml @@ -115,14 +115,16 @@ className="io.ballerina.plugins.idea.editor.BallerinaQuoteHandler"/> - + implementation="io.ballerina.plugins.idea.editor.inserthandlers.BallerinaEnterBetweenBracesHandler"/> + + + implementation="io.ballerina.plugins.idea.editor.inserthandlers.BallerinaIndentingBackspaceHandler"/> From 1c323e741cdcea65dfca8378f9083c3cdb8a5968 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Thu, 24 Oct 2019 16:44:28 +0530 Subject: [PATCH 057/167] Fix broken links in API docs --- observelib/observe/src/main/ballerina/src/observe/Module.md | 2 +- stdlib/http/src/main/ballerina/src/http/Module.md | 2 +- stdlib/time/src/main/ballerina/src/time/Module.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/observelib/observe/src/main/ballerina/src/observe/Module.md b/observelib/observe/src/main/ballerina/src/observe/Module.md index 13ec98438cef..dc329e83755f 100644 --- a/observelib/observe/src/main/ballerina/src/observe/Module.md +++ b/observelib/observe/src/main/ballerina/src/observe/Module.md @@ -5,7 +5,7 @@ Ballerina supports Observability out of the box. This module provides user api's To observe Ballerina code, the '--b7a.observability.enabled=true' property should be given when starting the service. i.e. `ballerina run hello_world.bal --b7a.observability.enabled=true' -For more information on Ballerina Observability visit [How to Observe Ballerina Services](https://ballerina.io/learn/how-to-observe-ballerina-code/) +For more information on Ballerina Observability visit [How to Observe Ballerina Services](https://v1-0.ballerina.io/learn/how-to-observe-ballerina-code/). ## Tracing diff --git a/stdlib/http/src/main/ballerina/src/http/Module.md b/stdlib/http/src/main/ballerina/src/http/Module.md index 5111101b2a72..62328e4aa265 100644 --- a/stdlib/http/src/main/ballerina/src/http/Module.md +++ b/stdlib/http/src/main/ballerina/src/http/Module.md @@ -76,7 +76,7 @@ See [Listener Endpoint Example](https://ballerina.io/learn/by-example/http-data- For more information, see [Mutual SSL Example](https://ballerina.io/learn/by-example/mutual-ssl.html). -For more information, see [Caching Example](https://ballerina.io/learn/by-example/caching.html), [HTTP Disable Chunking Example](https://ballerina.io/learn/by-example/http-disable-chunking.html). +For more information, see [Caching Example](https://ballerina.io/learn/by-example/cache.html), [HTTP Disable Chunking Example](https://ballerina.io/learn/by-example/http-disable-chunking.html). ### WebSocket diff --git a/stdlib/time/src/main/ballerina/src/time/Module.md b/stdlib/time/src/main/ballerina/src/time/Module.md index e3888e84c165..8c84fc587154 100644 --- a/stdlib/time/src/main/ballerina/src/time/Module.md +++ b/stdlib/time/src/main/ballerina/src/time/Module.md @@ -2,7 +2,7 @@ This module provides implementations related to time, date, time zones, and durations. -The module has two main types as [Time](time.html#Time) and [TimeZone](time.html#TimeZone). The type `Time` represents a time associated with a given time zone. It has `time` and `zone` as attributes. The type `TimeZone` represents the time zone associated with a given time. It has `id` and `offset` as attributes. An `id` can be one of the following: +The module has two main types as [Time](records/Time.html) and [TimeZone](records/TimeZone.html). The type `Time` represents a time associated with a given time zone. It has `time` and `zone` as attributes. The type `TimeZone` represents the time zone associated with a given time. It has `id` and `offset` as attributes. An `id` can be one of the following: * If `id` equals 'Z', the result is UTC. * If `id` equals 'GMT', 'UTC' or 'UT', it is equivalent to UTC. From db86ba26a6a064a3673fc00a85145b70cb83b581 Mon Sep 17 00:00:00 2001 From: Rasika Date: Thu, 24 Oct 2019 19:44:33 +0530 Subject: [PATCH 058/167] Fix Ballerina command not working in Windows8 Signed-off-by: Rasika --- distribution/zip/jballerina/bin/ballerina.bat | 326 +++++++++--------- 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/distribution/zip/jballerina/bin/ballerina.bat b/distribution/zip/jballerina/bin/ballerina.bat index 3ff603fecf31..24b6a2f48ac8 100644 --- a/distribution/zip/jballerina/bin/ballerina.bat +++ b/distribution/zip/jballerina/bin/ballerina.bat @@ -1,163 +1,163 @@ -@echo off - -REM --------------------------------------------------------------------------- -REM Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. - -rem --------------------------------------------------------------------------- -rem Main Script for Ballerina -rem -rem Environment Variable Prerequisites -rem -rem BALLERINA_HOME Home of BALLERINA installation. If not set I will try -rem to figure it out. -rem -rem JAVA_HOME Must point at your Java Development Kit installation. -rem -rem JAVA_OPTS (Optional) Java runtime options used when the commands -rem is executed. -rem --------------------------------------------------------------------------- - -rem ----- if JAVA_HOME is not set we're not happy ------------------------------ - -:checkJava - -set BALLERINA_HOME=%~sdp0.. -if exist JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre ( - set "JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre" -) - -if "%JAVA_HOME%" == "" goto noJavaHome -if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome -goto checkServer - -:noJavaHome -echo "You must set the JAVA_HOME variable before running Ballerina." -goto end - -rem ----- set BALLERINA_HOME ---------------------------- -:checkServer -rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed -set BALLERINA_HOME=%~sdp0.. - -goto updateClasspath - -:noServerHome -echo BALLERINA_HOME is set incorrectly or BALLERINA could not be located. Please set BALLERINA_HOME. -goto end - -rem ----- update classpath ----------------------------------------------------- -:updateClasspath - -setlocal EnableDelayedExpansion -set BALLERINA_CLASSPATH= -FOR %%C in ("%BALLERINA_HOME%\bre\lib\bootstrap\*.jar") DO set BALLERINA_CLASSPATH=!BALLERINA_CLASSPATH!;"%BALLERINA_HOME%\bre\lib\bootstrap\%%~nC%%~xC" - -set BALLERINA_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%BALLERINA_CLASSPATH%; - -set BALLERINA_CLASSPATH=!BALLERINA_CLASSPATH!;"%BALLERINA_HOME%\bre\lib\*" - -set BALLERINA_CLI_HEIGHT= -set BALLERINA_CLI_WIDTH= -for /F "tokens=2 delims=:" %%a in ('mode con') do for %%b in (%%a) do ( - if not defined BALLERINA_CLI_HEIGHT ( - set "BALLERINA_CLI_HEIGHT=%%b" - ) else if not defined BALLERINA_CLI_WIDTH ( - set "BALLERINA_CLI_WIDTH=%%b" - ) -) - -set argCount=0 -for %%x in (%*) do ( - set /A argCount+=1 - set "argValue[!argCount!]=%%~x" -) - -set /a counter=1 -for /l %%i in (1, 1, %argCount%) do ( - set /a counter=!counter!+1 - if "!argValue[%%i]!"=="--debug" call set BAL_JAVA_DEBUG=%%!counter! -) - -if defined BAL_JAVA_DEBUG goto commandDebug - -rem ----- Process the input command ------------------------------------------- -goto doneStart - -rem ----- commandDebug --------------------------------------------------------- -:commandDebug -if "%BAL_JAVA_DEBUG%"=="" goto noDebugPort -if not "%JAVA_OPTS%"=="" echo Warning !!!. User specified JAVA_OPTS will be ignored, once you give the BAL_JAVA_DEBUG variable. -set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%BAL_JAVA_DEBUG% -echo Please start the remote debugging client to continue... -goto runServer - -:noDebugPort -echo Please specify the debug port for the BAL_JAVA_DEBUG variable -goto end - -:doneStart -if "%OS%"=="Windows_NT" @setlocal -if "%OS%"=="WINNT" @setlocal -rem find the version of the jdk -:findJdk - -set CMD=RUN %* - -:checkJdk8AndHigher -set JVER= -for /f tokens^=2-5^ delims^=.-_^" %%j in ('"%JAVA_HOME%\bin\java" -fullversion 2^>^&1') do set "JVER=%%j%%k" -if %JVER% EQU 18 goto jdk8 -goto unknownJdk - -:unknownJdk -echo Ballerina is supported only on JDK 1.8 -goto end - -:jdk8 -goto runServer - -rem ----------------- Execute The Requested Command ---------------------------- - -:runServer - -set CMD=%* - -rem ---------- Add jars to classpath ---------------- - -set BALLERINA_CLASSPATH=.\bre\lib\bootstrap;%BALLERINA_CLASSPATH% - -rem BALLERINA_CLASSPATH_EXT is for outsiders to additionally add -rem classpath locations, e.g. AWS Lambda function libraries. -set BALLERINA_CLASSPATH=%BALLERINA_CLASSPATH%;%BALLERINA_CLASSPATH_EXT% - -set CMD_LINE_ARGS=-Xbootclasspath/a:%BALLERINA_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%BALLERINA_HOME%\heap-dump.hprof" -Dcom.sun.management.jmxremote -classpath %BALLERINA_CLASSPATH% %JAVA_OPTS% -Dballerina.home="%BALLERINA_HOME%" -Dballerina.target="jvm" -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Denable.nonblocking=false -Dfile.encoding=UTF8 -Dballerina.version=${project.version} -Djava.util.logging.config.class="org.ballerinalang.logging.util.LogConfigReader" -Djava.util.logging.manager="org.ballerinalang.logging.BLogManager" - -set jar=%2 -if %1==run if not [%2]==[] if %jar:~-4%==.jar goto runJarFile -:runJava -"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.ballerinalang.tool.Main %CMD% -goto end - -:runJarFile -for /f "tokens=1,*" %%a in ("%*") do set ARGS=%%b -"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% -jar %ARGS% -goto end - -:end -goto endlocal - -:endlocal - -:END +@echo off + +REM --------------------------------------------------------------------------- +REM Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +REM +REM Licensed under the Apache License, Version 2.0 (the "License"); +REM you may not use this file except in compliance with the License. +REM You may obtain a copy of the License at +REM +REM http://www.apache.org/licenses/LICENSE-2.0 +REM +REM Unless required by applicable law or agreed to in writing, software +REM distributed under the License is distributed on an "AS IS" BASIS, +REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +REM See the License for the specific language governing permissions and +REM limitations under the License. + +rem --------------------------------------------------------------------------- +rem Main Script for Ballerina +rem +rem Environment Variable Prerequisites +rem +rem BALLERINA_HOME Home of BALLERINA installation. If not set I will try +rem to figure it out. +rem +rem JAVA_HOME Must point at your Java Development Kit installation. +rem +rem JAVA_OPTS (Optional) Java runtime options used when the commands +rem is executed. +rem --------------------------------------------------------------------------- + +rem ----- if JAVA_HOME is not set we're not happy ------------------------------ + +:checkJava + +set BALLERINA_HOME=%~sdp0.. +if exist JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre ( + set "JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre" +) + +if "%JAVA_HOME%" == "" goto noJavaHome +if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome +goto checkServer + +:noJavaHome +echo "You must set the JAVA_HOME variable before running Ballerina." +goto end + +rem ----- set BALLERINA_HOME ---------------------------- +:checkServer +rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed +set BALLERINA_HOME=%~sdp0.. + +goto updateClasspath + +:noServerHome +echo BALLERINA_HOME is set incorrectly or BALLERINA could not be located. Please set BALLERINA_HOME. +goto end + +rem ----- update classpath ----------------------------------------------------- +:updateClasspath + +setlocal EnableDelayedExpansion +set BALLERINA_CLASSPATH= +FOR %%C in ("%BALLERINA_HOME%\bre\lib\bootstrap\*.jar") DO set BALLERINA_CLASSPATH=!BALLERINA_CLASSPATH!;"%BALLERINA_HOME%\bre\lib\bootstrap\%%~nC%%~xC" + +set BALLERINA_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%BALLERINA_CLASSPATH%; + +set BALLERINA_CLASSPATH=!BALLERINA_CLASSPATH!;"%BALLERINA_HOME%\bre\lib\*" + +set BALLERINA_CLI_HEIGHT= +set BALLERINA_CLI_WIDTH= +for /F "tokens=2 delims=:" %%a in ('mode con') do for %%b in (%%a) do ( + if not defined BALLERINA_CLI_HEIGHT ( + set "BALLERINA_CLI_HEIGHT=%%b" + ) else if not defined BALLERINA_CLI_WIDTH ( + set "BALLERINA_CLI_WIDTH=%%b" + ) +) + +set argCount=0 +for %%x in (%*) do ( + set /A argCount+=1 + set "argValue[!argCount!]=%%~x" +) + +set /a counter=1 +for /l %%i in (1, 1, %argCount%) do ( + set /a counter=!counter!+1 + if "!argValue[%%i]!"=="--debug" call set BAL_JAVA_DEBUG=%%!counter! +) + +if defined BAL_JAVA_DEBUG goto commandDebug + +rem ----- Process the input command ------------------------------------------- +goto doneStart + +rem ----- commandDebug --------------------------------------------------------- +:commandDebug +if "%BAL_JAVA_DEBUG%"=="" goto noDebugPort +if not "%JAVA_OPTS%"=="" echo Warning !!!. User specified JAVA_OPTS will be ignored, once you give the BAL_JAVA_DEBUG variable. +set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%BAL_JAVA_DEBUG% +echo Please start the remote debugging client to continue... +goto runServer + +:noDebugPort +echo Please specify the debug port for the BAL_JAVA_DEBUG variable +goto end + +:doneStart +if "%OS%"=="Windows_NT" @setlocal +if "%OS%"=="WINNT" @setlocal +rem find the version of the jdk +:findJdk + +set CMD=RUN %* + +:checkJdk8AndHigher +set JVER= +for /f tokens^=2-5^ delims^=.-_^" %%j in ('"%JAVA_HOME%\bin\java" -fullversion 2^>^&1') do set "JVER=%%j%%k" +if %JVER% EQU 18 goto jdk8 +goto unknownJdk + +:unknownJdk +echo Ballerina is supported only on JDK 1.8 +goto end + +:jdk8 +goto runServer + +rem ----------------- Execute The Requested Command ---------------------------- + +:runServer + +set CMD=%* + +rem ---------- Add jars to classpath ---------------- + +set BALLERINA_CLASSPATH=.\bre\lib\bootstrap;%BALLERINA_CLASSPATH% + +rem BALLERINA_CLASSPATH_EXT is for outsiders to additionally add +rem classpath locations, e.g. AWS Lambda function libraries. +set BALLERINA_CLASSPATH=%BALLERINA_CLASSPATH%;%BALLERINA_CLASSPATH_EXT% + +set CMD_LINE_ARGS=-Xbootclasspath/a:%BALLERINA_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%BALLERINA_HOME%\heap-dump.hprof" -Dcom.sun.management.jmxremote -classpath %BALLERINA_CLASSPATH% %JAVA_OPTS% -Dballerina.home="%BALLERINA_HOME%" -Dballerina.target="jvm" -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Denable.nonblocking=false -Dfile.encoding=UTF8 -Dballerina.version=${project.version} -Djava.util.logging.config.class="org.ballerinalang.logging.util.LogConfigReader" -Djava.util.logging.manager="org.ballerinalang.logging.BLogManager" + +set jar=%2 +if "%1" == "run" if not "%2" == "" if "%jar:~-4%" == ".jar" goto runJarFile +:runJava +"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.ballerinalang.tool.Main %CMD% +goto end + +:runJarFile +for /f "tokens=1,*" %%a in ("%*") do set ARGS=%%b +"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% -jar %ARGS% +goto end + +:end +goto endlocal + +:endlocal + +:END From c5ab587689be08ef676ecd45ce139588cd213a78 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Thu, 24 Oct 2019 19:45:53 +0530 Subject: [PATCH 059/167] Fix constructFrom failing even with one match in a union --- .../src/main/java/org/ballerinalang/jvm/TypeChecker.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/TypeChecker.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/TypeChecker.java index 7b1ae17377f0..27c5e05d43d1 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/TypeChecker.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/TypeChecker.java @@ -967,7 +967,10 @@ static boolean checkIsLikeType(Object sourceValue, BType targetType, List compatibleTypesWithNumConversion = new ArrayList<>(); List compatibleTypesWithoutNumConversion = new ArrayList<>(); for (BType type : ((BUnionType) targetType).getMemberTypes()) { - if (checkIsLikeType(sourceValue, type, unresolvedValues, false)) { + List tempList = new ArrayList<>(unresolvedValues.size()); + tempList.addAll(unresolvedValues); + + if (checkIsLikeType(sourceValue, type, tempList, false)) { compatibleTypesWithoutNumConversion.add(type); } From ce551e5490ceb4e1a71ca63d6d859408faf08a51 Mon Sep 17 00:00:00 2001 From: chamil321 Date: Thu, 24 Oct 2019 23:04:27 +0530 Subject: [PATCH 060/167] Fix WebSub listener start() API --- .../websub/subscriber_service_endpoint.bal | 9 +++- .../net/websub/WebSubSubscriberConstants.java | 4 ++ .../ballerinalang/net/websub/WebSubUtils.java | 22 +++++++++ .../StartWebSubSubscriberServiceEndpoint.java | 11 ++++- .../WebSubSubscriberStartUpTest.java | 47 +++++++++++++++++++ .../subscriber/test_subscriber_startup.bal | 31 ++++++++++++ 6 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java create mode 100644 stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal diff --git a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal index 357a6558be86..722b1709c9fe 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal @@ -46,8 +46,11 @@ public type Listener object { } public function __start() returns error? { + var err = self.startWebSubSubscriberServiceEndpoint(); + if (err is error) { + return err; + } // TODO: handle data and return error on error - self.startWebSubSubscriberServiceEndpoint(); self.sendSubscriptionRequests(); } @@ -153,7 +156,9 @@ public type Listener object { } # Start the registered WebSub Subscriber service. - function startWebSubSubscriberServiceEndpoint() = external; + # + # + return - An `error` if there is any error occurred during the listener start process + function startWebSubSubscriberServiceEndpoint() returns error?= external; # Sets the topic to which this service is subscribing, for auto intent verification. # diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java index 6d5b9d1f659a..31acdec01a0e 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java @@ -116,4 +116,8 @@ public class WebSubSubscriberConstants { public static final String SERVICE_CONFIG_TOPIC_PAYLOAD_KEYS = "topicPayloadKeys"; public static final String SERVICE_CONFIG_TOPIC_RESOURCE_MAP = "topicResourceMap"; + + // WebSub error types related constants + public static final String ERROR_DETAIL_RECORD = "Detail"; + public static final String ERROR_REASON_WEBSUB_LISTENER_STARTUP_FAILURE = "{ballerina/websub}ListenerStartupError"; } diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java index abd54ebe6fb8..dc7d62a59d97 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java @@ -28,16 +28,23 @@ import org.ballerinalang.jvm.values.ObjectValue; import org.ballerinalang.mime.util.EntityBodyHandler; import org.ballerinalang.mime.util.MimeUtil; +import org.ballerinalang.net.http.HttpErrorType; import org.wso2.transport.http.netty.message.HttpCarbonMessage; +import java.util.HashMap; +import java.util.Map; + import static org.ballerinalang.mime.util.MimeConstants.ENTITY; import static org.ballerinalang.mime.util.MimeConstants.ENTITY_BYTE_CHANNEL; import static org.ballerinalang.mime.util.MimeConstants.PROTOCOL_MIME_PKG_ID; +import static org.ballerinalang.net.http.HttpConstants.HTTP_ERROR_DETAIL_RECORD; import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTP_PKG_ID; import static org.ballerinalang.net.http.HttpConstants.REQUEST; import static org.ballerinalang.net.http.HttpUtil.extractEntity; import static org.ballerinalang.net.http.HttpUtil.populateEntityBody; import static org.ballerinalang.net.http.HttpUtil.populateInboundRequest; +import static org.ballerinalang.net.websub.WebSubSubscriberConstants.ERROR_DETAIL_RECORD; +import static org.ballerinalang.net.websub.WebSubSubscriberConstants.WEBSUB_PACKAGE_ID; /** * Util class for WebSub. @@ -102,4 +109,19 @@ public static AttachedFunction getAttachedFunction(ObjectValue service, String f public static ErrorValue createError(String errMsg) { return BallerinaErrors.createError(WEBSUB_ERROR_CODE, errMsg); } + + /** + * Create WebSub specific error for a given error reason and detail. + * + * @param reason The standard error reason + * @param message The Actual error cause + * @return Ballerina error value + */ + public static ErrorValue createError(String reason, String message) { + Map values = new HashMap<>(); + values.put(BallerinaErrors.ERROR_MESSAGE_FIELD, message); + MapValue detail = + BallerinaValues.createRecordValue(WEBSUB_PACKAGE_ID, ERROR_DETAIL_RECORD, values); + return BallerinaErrors.createError(reason, detail); + } } diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java index 000acf24da65..b2ed3e3b0d1c 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java @@ -29,6 +29,7 @@ import org.ballerinalang.net.websub.BallerinaWebSubConnectorListener; import org.ballerinalang.net.websub.WebSubServicesRegistry; import org.ballerinalang.net.websub.WebSubSubscriberConstants; +import org.ballerinalang.net.websub.WebSubUtils; import org.wso2.transport.http.netty.contract.ServerConnector; import org.wso2.transport.http.netty.contract.ServerConnectorFuture; @@ -51,7 +52,7 @@ ) public class StartWebSubSubscriberServiceEndpoint extends AbstractHttpNativeFunction { - public static void startWebSubSubscriberServiceEndpoint(Strand strand, ObjectValue subscriberServiceEndpoint) { + public static Object startWebSubSubscriberServiceEndpoint(Strand strand, ObjectValue subscriberServiceEndpoint) { ObjectValue serviceEndpoint = (ObjectValue) subscriberServiceEndpoint.get(WEBSUB_HTTP_ENDPOINT); ServerConnector serverConnector = getServerConnector(serviceEndpoint); //TODO: check if isStarted check is required @@ -62,5 +63,13 @@ public static void startWebSubSubscriberServiceEndpoint(Strand strand, ObjectVal new BallerinaWebSubConnectorListener(strand, webSubServicesRegistry, serviceEndpoint .getMapValue(HttpConstants.SERVICE_ENDPOINT_CONFIG))); serverConnectorFuture.setPortBindingEventListener(new HttpConnectorPortBindingListener()); + try { + serverConnectorFuture.sync(); + } catch (Exception ex) { + return WebSubUtils.createError(WebSubSubscriberConstants.ERROR_REASON_WEBSUB_LISTENER_STARTUP_FAILURE, + "failed to start server connector '" + serverConnector.getConnectorID() + + "': " + ex.getMessage()); + } + return null; } } diff --git a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java new file mode 100644 index 000000000000..c878eba17d16 --- /dev/null +++ b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.ballerinalang.net.websub; + +import org.ballerinalang.model.values.BValue; +import org.ballerinalang.test.util.BCompileUtil; +import org.ballerinalang.test.util.BRunUtil; +import org.ballerinalang.test.util.CompileResult; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * Class to test WebSub Subscriber service startup. + */ +public class WebSubSubscriberStartUpTest { + + private CompileResult result; + + @BeforeClass + public void setup() { + result = BCompileUtil.compile("test-src/subscriber/test_subscriber_startup.bal"); + } + + @Test(description = "Test multiple Subscriber service startup in a single port") + public void testMultipleSubscribersStartUpInSamePort() { + BValue[] returns = BRunUtil.invoke(result, "startSubscriberService"); + Assert.assertEquals(returns.length, 1); + Assert.assertEquals(returns[0].stringValue(), "http://localhost:/websub/hub"); + } +} diff --git a/stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal b/stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal new file mode 100644 index 000000000000..49c8ba84a34e --- /dev/null +++ b/stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal @@ -0,0 +1,31 @@ +// Copyright (c) 2018 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/websub; + +function startSubscriberService() returns string { + websub:Listener l1 = new(8080); + websub:Listener l2 = new(8080); + + var l1Error = l1.__start()); + if (l1Error is error) { + return l1Error.detail()?.message; + } + var l2Error = l2.__start(); + if (l2Error is error) { + return l2Error.detail()?.message; + } +} From 067f0130761b025c4220cf256fd2c86fd159d18e Mon Sep 17 00:00:00 2001 From: chamil321 Date: Fri, 25 Oct 2019 00:09:02 +0530 Subject: [PATCH 061/167] Add test case --- .../src/main/ballerina/src/websub/errors.bal | 31 +++++++++++++++++++ .../net/websub/WebSubSubscriberConstants.java | 2 +- .../ballerinalang/net/websub/WebSubUtils.java | 2 -- .../StartWebSubSubscriberServiceEndpoint.java | 2 +- .../WebSubSubscriberStartUpTest.java | 5 +-- .../subscriber/test_subscriber_startup.bal | 13 ++++---- 6 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 stdlib/websub/src/main/ballerina/src/websub/errors.bal diff --git a/stdlib/websub/src/main/ballerina/src/websub/errors.bal b/stdlib/websub/src/main/ballerina/src/websub/errors.bal new file mode 100644 index 000000000000..9823e06382f5 --- /dev/null +++ b/stdlib/websub/src/main/ballerina/src/websub/errors.bal @@ -0,0 +1,31 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +# Holds the details of an WebSub error +# +# + message - Specific error message for the error +# + cause - Cause of the error; If this error occurred due to another error (Probably from another module) +public type Detail record { + string message; + error cause?; +}; + +// Ballerina WebSub Listener Error Types + +# Represents the reason string for the `websub:ListenerStartupError` +public const LISTENER_STARTUP_ERROR = "{ballerina/websub}ListenerStartupError"; +# Represents a listener startup error +public type ListenerStartupError error; diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java index 31acdec01a0e..6dbe660d432d 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java @@ -119,5 +119,5 @@ public class WebSubSubscriberConstants { // WebSub error types related constants public static final String ERROR_DETAIL_RECORD = "Detail"; - public static final String ERROR_REASON_WEBSUB_LISTENER_STARTUP_FAILURE = "{ballerina/websub}ListenerStartupError"; + public static final String WEBSUB_LISTENER_STARTUP_FAILURE = "{ballerina/websub}ListenerStartupError"; } diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java index dc7d62a59d97..2f6f2305e97b 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubUtils.java @@ -28,7 +28,6 @@ import org.ballerinalang.jvm.values.ObjectValue; import org.ballerinalang.mime.util.EntityBodyHandler; import org.ballerinalang.mime.util.MimeUtil; -import org.ballerinalang.net.http.HttpErrorType; import org.wso2.transport.http.netty.message.HttpCarbonMessage; import java.util.HashMap; @@ -37,7 +36,6 @@ import static org.ballerinalang.mime.util.MimeConstants.ENTITY; import static org.ballerinalang.mime.util.MimeConstants.ENTITY_BYTE_CHANNEL; import static org.ballerinalang.mime.util.MimeConstants.PROTOCOL_MIME_PKG_ID; -import static org.ballerinalang.net.http.HttpConstants.HTTP_ERROR_DETAIL_RECORD; import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTP_PKG_ID; import static org.ballerinalang.net.http.HttpConstants.REQUEST; import static org.ballerinalang.net.http.HttpUtil.extractEntity; diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java index b2ed3e3b0d1c..10d51f6695ec 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartWebSubSubscriberServiceEndpoint.java @@ -66,7 +66,7 @@ public static Object startWebSubSubscriberServiceEndpoint(Strand strand, ObjectV try { serverConnectorFuture.sync(); } catch (Exception ex) { - return WebSubUtils.createError(WebSubSubscriberConstants.ERROR_REASON_WEBSUB_LISTENER_STARTUP_FAILURE, + return WebSubUtils.createError(WebSubSubscriberConstants.WEBSUB_LISTENER_STARTUP_FAILURE, "failed to start server connector '" + serverConnector.getConnectorID() + "': " + ex.getMessage()); } diff --git a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java index c878eba17d16..035fd9ab8303 100644 --- a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java +++ b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java @@ -27,7 +27,7 @@ import org.testng.annotations.Test; /** - * Class to test WebSub Subscriber service startup. + * Class to test WebSub listener startup. */ public class WebSubSubscriberStartUpTest { @@ -42,6 +42,7 @@ public void setup() { public void testMultipleSubscribersStartUpInSamePort() { BValue[] returns = BRunUtil.invoke(result, "startSubscriberService"); Assert.assertEquals(returns.length, 1); - Assert.assertEquals(returns[0].stringValue(), "http://localhost:/websub/hub"); + Assert.assertEquals(returns[0].stringValue(), + "failed to start server connector '0.0.0.0:8387': Address already in use"); } } diff --git a/stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal b/stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal index 49c8ba84a34e..3d43790b48ba 100644 --- a/stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal +++ b/stdlib/websub/src/test/resources/test-src/subscriber/test_subscriber_startup.bal @@ -1,4 +1,4 @@ -// Copyright (c) 2018 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. // // WSO2 Inc. licenses this file to you under the Apache License, // Version 2.0 (the "License"); you may not use this file except @@ -17,15 +17,16 @@ import ballerina/websub; function startSubscriberService() returns string { - websub:Listener l1 = new(8080); - websub:Listener l2 = new(8080); + websub:Listener l1 = new(8387); + websub:Listener l2 = new(8387); - var l1Error = l1.__start()); + var l1Error = l1.__start(); if (l1Error is error) { - return l1Error.detail()?.message; + return l1Error.detail()?.message ?: "l1 error unavailable"; } var l2Error = l2.__start(); if (l2Error is error) { - return l2Error.detail()?.message; + return l2Error.detail()?.message; } + return "no error"; } From f4943016ee137274e7df34607573eaf30ef44201 Mon Sep 17 00:00:00 2001 From: chamil321 Date: Fri, 25 Oct 2019 10:01:49 +0530 Subject: [PATCH 062/167] Fix windows test failure --- .../WebSubSubscriberStartUpTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java index 035fd9ab8303..5461210f3423 100644 --- a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java +++ b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java @@ -42,7 +42,7 @@ public void setup() { public void testMultipleSubscribersStartUpInSamePort() { BValue[] returns = BRunUtil.invoke(result, "startSubscriberService"); Assert.assertEquals(returns.length, 1); - Assert.assertEquals(returns[0].stringValue(), - "failed to start server connector '0.0.0.0:8387': Address already in use"); + Assert.assertTrue(returns[0].stringValue().contains("failed to start server connector '0.0.0.0:8387': " + + "Address already in use")); } } From 4e00c73640e59b6ab19489d405933675ebcf635c Mon Sep 17 00:00:00 2001 From: Nipuna Marcus Date: Fri, 25 Oct 2019 12:58:03 +0530 Subject: [PATCH 063/167] Fix calculating wrong start column for block node when formatting --- .../compiler/format/FormattingNodeTree.java | 210 ++++++++++-------- .../langserver/compiler/format/Tokens.java | 2 + .../expected/expectedTransaction.bal | 9 +- .../test/resources/formatting/transaction.bal | 19 +- 4 files changed, 136 insertions(+), 104 deletions(-) diff --git a/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java b/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java index 0fc8714ba227..5acd4fa368bd 100644 --- a/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java +++ b/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/FormattingNodeTree.java @@ -496,69 +496,46 @@ public void formatBinaryExprNode(JsonObject node) { * @param node {JsonObject} node as json object */ public void formatBlockNode(JsonObject node) { - JsonObject position = new JsonObject(); - - // TODO: revisit code of how block node is handled. - JsonObject formatConfig = node.has(FormattingConstants.FORMATTING_CONFIG) - ? node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG) : null; - - // Get the start column of the parent. - position.addProperty(FormattingConstants.START_COLUMN, node.get("parent").getAsJsonObject() - .get(FormattingConstants.POSITION) - .getAsJsonObject().get(FormattingConstants.START_COLUMN).getAsInt()); - - // Add block position to be the parent's position. - node.add(FormattingConstants.POSITION, position); + if (node.has(FormattingConstants.FORMATTING_CONFIG)) { + JsonObject formatConfig = node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG); - // Update the statements whitespaces. - for (int i = 0; i < node.getAsJsonArray(FormattingConstants.STATEMENTS).size(); i++) { - JsonElement child = node.getAsJsonArray(FormattingConstants.STATEMENTS).get(i); - JsonObject childFormatConfig = formatConfig; - if (formatConfig == null) { - childFormatConfig = this.getFormattingConfig(1, 0, - node.get(FormattingConstants.POSITION).getAsJsonObject().get(FormattingConstants.START_COLUMN) - .getAsInt(), true, node.get(FormattingConstants.POSITION).getAsJsonObject() - .get(FormattingConstants.START_COLUMN).getAsInt(), false); + // Update the statements whitespaces. + for (JsonElement child : node.getAsJsonArray(FormattingConstants.STATEMENTS)) { + child.getAsJsonObject().add(FormattingConstants.FORMATTING_CONFIG, formatConfig); } - child.getAsJsonObject().add(FormattingConstants.FORMATTING_CONFIG, childFormatConfig); - } - // If this is a else block continue to following. - if (node.has(FormattingConstants.WS) && node.getAsJsonArray(FormattingConstants.WS).get(0).getAsJsonObject() - .get(FormattingConstants.TEXT).getAsString().equals(Tokens.ELSE)) { + // If this is a else block continue to following. + if (node.has(FormattingConstants.WS) && node.getAsJsonArray(FormattingConstants.WS).get(0).getAsJsonObject() + .get(FormattingConstants.TEXT).getAsString().equals(Tokens.ELSE)) { - JsonArray ws = node.getAsJsonArray(FormattingConstants.WS); + JsonArray ws = node.getAsJsonArray(FormattingConstants.WS); - this.preserveHeight(ws, this.getWhiteSpaces(node.getAsJsonObject(FormattingConstants.POSITION) - .get(FormattingConstants.START_COLUMN).getAsInt())); + // Whitespaces for else block should indent as to the parent's start column. + String indentation = this.getWhiteSpaces(formatConfig.get(FormattingConstants.START_COLUMN).getAsInt()); - // Update the else keyword whitespace. - JsonObject elseKeywordWS = ws.get(0).getAsJsonObject(); - if (this.noHeightAvailable(elseKeywordWS.get(FormattingConstants.WS).getAsString())) { - elseKeywordWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); - } - - // Update the opening brace whitespace. - JsonObject openingBraceWS = ws.get(ws.size() - 2).getAsJsonObject(); - if (this.noHeightAvailable(openingBraceWS.get(FormattingConstants.WS).getAsString())) { - openingBraceWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); - } + // Preserve available line breaks. + this.preserveHeight(ws, indentation); - // Update the closing brace whitespace. - JsonObject closingBraceWS = ws.get(ws.size() - 1).getAsJsonObject(); - if (node.getAsJsonArray(FormattingConstants.STATEMENTS).size() <= 0) { - if (this.noHeightAvailable(closingBraceWS.get(FormattingConstants.WS).getAsString())) { - closingBraceWS.addProperty(FormattingConstants.WS, FormattingConstants.NEW_LINE + - this.getWhiteSpaces(node.getAsJsonObject(FormattingConstants.POSITION) - .get(FormattingConstants.START_COLUMN).getAsInt()) - + FormattingConstants.NEW_LINE + - this.getWhiteSpaces(node.getAsJsonObject(FormattingConstants.POSITION) - .get(FormattingConstants.START_COLUMN).getAsInt())); - } - } else if (this.noHeightAvailable(closingBraceWS.get(FormattingConstants.WS).getAsString())) { - closingBraceWS.addProperty(FormattingConstants.WS, FormattingConstants.NEW_LINE + - this.getWhiteSpaces(node.getAsJsonObject(FormattingConstants.POSITION) - .get(FormattingConstants.START_COLUMN).getAsInt())); + // Iterate and format whitespaces for else node. + for (JsonElement wsItem : ws) { + JsonObject currentWS = wsItem.getAsJsonObject(); + if (this.noHeightAvailable(currentWS.get(FormattingConstants.WS).getAsString())) { + String text = currentWS.get(FormattingConstants.TEXT).getAsString(); + if (text.equals(Tokens.ELSE)) { + currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); + } else if (text.equals(Tokens.OPENING_BRACE)) { + currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); + } else if (text.equals(Tokens.CLOSING_BRACE)) { + if (node.getAsJsonArray(FormattingConstants.STATEMENTS).size() <= 0) { + currentWS.addProperty(FormattingConstants.WS, FormattingConstants.NEW_LINE + + indentation + FormattingConstants.NEW_LINE + indentation); + } else { + currentWS.addProperty(FormattingConstants.WS, FormattingConstants.NEW_LINE + + indentation); + } + } + } + } } } } @@ -1620,6 +1597,7 @@ public void formatForeachNode(JsonObject node) { if (node.has(FormattingConstants.WS) && node.has(FormattingConstants.FORMATTING_CONFIG)) { JsonArray ws = node.getAsJsonArray(FormattingConstants.WS); JsonObject formatConfig = node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG); + String indentation = this.getIndentation(formatConfig, false); String indentWithParentIndentation = formatConfig.get(FormattingConstants.DO_INDENT).getAsBoolean() ? this.getWhiteSpaces(formatConfig.get(FormattingConstants.INDENTED_START_COLUMN).getAsInt()) + @@ -1702,6 +1680,11 @@ public void formatForeachNode(JsonObject node) { this.getFormattingConfig(0, 1, 0, false, this.getWhiteSpaceCount(indentWithParentIndentation), true)); } + + if (node.has(FormattingConstants.BODY)) { + modifyConstructBody(node.getAsJsonObject(FormattingConstants.BODY), + indentation, indentWithParentIndentation); + } } } @@ -1995,6 +1978,11 @@ public void formatFunctionNode(JsonObject node) { externalAnnotationAttachment.add(FormattingConstants.FORMATTING_CONFIG, annotationFormattingConfig); } } + + if (node.has(FormattingConstants.BODY)) { + modifyConstructBody(node.getAsJsonObject(FormattingConstants.BODY), + indentation, indentWithParentIndentation); + } } } @@ -2335,6 +2323,10 @@ public void formatIfNode(JsonObject node) { this.getWhiteSpaceCount(indentation), false, this.getWhiteSpaceCount(indentWithParentIndentation), false); elseStatement.add(FormattingConstants.FORMATTING_CONFIG, elseStatementFormatConfig); + } else if (node.has("elseStatement") + && node.getAsJsonObject("elseStatement").has("isElseBlock") + && node.getAsJsonObject("elseStatement").get("isElseBlock").getAsBoolean()) { + modifyConstructBody(node.getAsJsonObject("elseStatement"), indentation, indentWithParentIndentation); } if (node.has("condition")) { @@ -2343,6 +2335,11 @@ public void formatIfNode(JsonObject node) { this.getWhiteSpaceCount(indentWithParentIndentation), true); conditionWs.add(FormattingConstants.FORMATTING_CONFIG, conditionFormatConfig); } + + if (node.has(FormattingConstants.BODY)) { + modifyConstructBody(node.getAsJsonObject(FormattingConstants.BODY), + indentation, indentWithParentIndentation); + } } } @@ -3014,10 +3011,8 @@ public void formatMatchStructuredPatternClauseNode(JsonObject node) { } } - if (node.has("statement") && !withCurlies) { - JsonObject statementFormatConfig = this.getFormattingConfig(0, 1, 0, false, - this.getWhiteSpaceCount(indentation), false); - node.getAsJsonObject("statement").add(FormattingConstants.FORMATTING_CONFIG, statementFormatConfig); + if (node.has("statement")) { + modifyConstructBody(node.getAsJsonObject("statement"), indentation, indentation); } } } @@ -3077,10 +3072,8 @@ public void formatMatchStaticPatternClauseNode(JsonObject node) { } } - if (node.has("statement") && !withCurlies) { - JsonObject statementFormatConfig = this.getFormattingConfig(0, 1, 0, false, - this.getWhiteSpaceCount(indentation), false); - node.getAsJsonObject("statement").add(FormattingConstants.FORMATTING_CONFIG, statementFormatConfig); + if (node.has("statement")) { + modifyConstructBody(node.getAsJsonObject("statement"), indentation, indentation); } } } @@ -5162,59 +5155,75 @@ public void formatTransactionNode(JsonObject node) { // Update transaction and retry whitespaces. boolean isRetryBody = false; + boolean isCommittedBody = false; + boolean isAbortedBody = false; for (JsonElement wsItem : ws) { JsonObject currentWS = wsItem.getAsJsonObject(); - if (this.noHeightAvailable(currentWS.get(FormattingConstants.WS).getAsString())) { - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.TRANSACTION)) { + String text = currentWS.get(FormattingConstants.TEXT).getAsString(); + if (text.equals(Tokens.TRANSACTION)) { currentWS.addProperty(FormattingConstants.WS, this.getNewLines(formatConfig.get(FormattingConstants.NEW_LINE_COUNT).getAsInt()) + indentation); - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.ONRETRY)) { + } else if (text.equals(Tokens.ONRETRY)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); isRetryBody = true; - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.OPENING_BRACE)) { + isAbortedBody = false; + isCommittedBody = false; + } else if (text.equals(Tokens.ABORTED)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.CLOSING_BRACE)) { + isRetryBody = false; + isAbortedBody = true; + isCommittedBody = false; + } else if (text.equals(Tokens.COMMITTED)) { + currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); + isRetryBody = false; + isAbortedBody = false; + isCommittedBody = true; + } else if (text.equals(Tokens.OPENING_BRACE)) { + currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); + } else if (text.equals(Tokens.CLOSING_BRACE)) { if (isRetryBody) { modifyBlockClosingBrace(node, indentation, currentWS, "onRetryBody", false); + } else if (isAbortedBody) { + modifyBlockClosingBrace(node, indentation, currentWS, "abortedBody", false); + } else if (isCommittedBody) { + modifyBlockClosingBrace(node, indentation, currentWS, "committedBody", false); } else { modifyBlockClosingBrace(node, indentation, currentWS, "transactionBody", false); } - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.WITH)) { + } else if (text.equals(Tokens.WITH)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.RETRIES)) { + } else if (text.equals(Tokens.RETRIES)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.EQUAL)) { + } else if (text.equals(Tokens.EQUAL)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.COMMA)) { + } else if (text.equals(Tokens.COMMA)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.EMPTY_SPACE); - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.ONABORT)) { + } else if (text.equals(Tokens.ONABORT)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); - } - - if (currentWS.get(FormattingConstants.TEXT).getAsString().equals(Tokens.ONCOMMIT)) { + } else if (text.equals(Tokens.ONCOMMIT)) { currentWS.addProperty(FormattingConstants.WS, FormattingConstants.SINGLE_SPACE); } } } + if (node.has("transactionBody")) { + modifyConstructBody(node.getAsJsonObject("transactionBody"), indentation, indentation); + } + + if (node.has("onRetryBody")) { + modifyConstructBody(node.getAsJsonObject("onRetryBody"), indentation, indentation); + } + + if (node.has("committedBody")) { + modifyConstructBody(node.getAsJsonObject("committedBody"), indentation, indentation); + } + + if (node.has("abortedBody")) { + modifyConstructBody(node.getAsJsonObject("abortedBody"), indentation, indentation); + } + // Update whitespaces for retryCount. if (node.has("retryCount")) { this.skipFormatting(node.getAsJsonObject("retryCount"), true); @@ -6521,6 +6530,7 @@ public void formatWhileNode(JsonObject node) { JsonArray ws = node.getAsJsonArray(FormattingConstants.WS); JsonObject formatConfig = node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG); String indentation = this.getIndentation(formatConfig, true); + String indentationOfParent = this.getParentIndentation(formatConfig); node.getAsJsonObject(FormattingConstants.POSITION).addProperty(FormattingConstants.START_COLUMN, this.getWhiteSpaceCount(indentation)); @@ -6552,6 +6562,11 @@ public void formatWhileNode(JsonObject node) { 0, false, this.getWhiteSpaceCount(indentation), true); whileCondition.add(FormattingConstants.FORMATTING_CONFIG, whileConditionFormatConfig); } + + if (node.has(FormattingConstants.BODY)) { + modifyConstructBody(node.getAsJsonObject(FormattingConstants.BODY), + indentation, indentationOfParent); + } } } @@ -7128,6 +7143,15 @@ public void formatXmlTextLiteralNode(JsonObject node) { // --------- Util functions for the modifying node tree -------- + private void modifyConstructBody(JsonObject node, String indentation, String indentWithParentIndentation) { + node.add(FormattingConstants.FORMATTING_CONFIG, + this.getFormattingConfig(1, 0, + this.getWhiteSpaceCount(this.getWhiteSpaceCount(indentation) == 0 + ? indentWithParentIndentation : indentation), true, + this.getWhiteSpaceCount(indentWithParentIndentation), false)); + + } + private void modifyXMLLiteralNode(JsonObject node) { if (node.has(FormattingConstants.WS) && node.has(FormattingConstants.FORMATTING_CONFIG)) { JsonObject formatConfig = node.getAsJsonObject(FormattingConstants.FORMATTING_CONFIG); diff --git a/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/Tokens.java b/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/Tokens.java index eb61f18ed7c6..3ce016cd3b23 100644 --- a/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/Tokens.java +++ b/language-server/modules/langserver-compiler/src/main/java/org/ballerinalang/langserver/compiler/format/Tokens.java @@ -120,4 +120,6 @@ public class Tokens { public static final String TYPEDESC = "typedesc"; public static final String XMLNS = "xmlns"; public static final String XML_LITERAL_START = "xml `"; + public static final String COMMITTED = "committed"; + public static final String ABORTED = "aborted"; } diff --git a/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTransaction.bal b/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTransaction.bal index 214e0192e12c..aa115882b135 100644 --- a/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTransaction.bal +++ b/language-server/modules/langserver-core/src/test/resources/formatting/expected/expectedTransaction.bal @@ -30,11 +30,14 @@ function name3() { function name4() { transaction with retries = 0 { int h = 0; - } onretry { + } + onretry { a = a + " retry"; - } committed { + } + committed { a = a + " committed"; - } aborted { + } + aborted { a = a + " aborted"; } } diff --git a/language-server/modules/langserver-core/src/test/resources/formatting/transaction.bal b/language-server/modules/langserver-core/src/test/resources/formatting/transaction.bal index f42293f9f8cf..78f9ab164316 100644 --- a/language-server/modules/langserver-core/src/test/resources/formatting/transaction.bal +++ b/language-server/modules/langserver-core/src/test/resources/formatting/transaction.bal @@ -20,21 +20,24 @@ function name3() { int h = 0; } onretry { a = a + " retry"; - } aborted { + } aborted{ a = a + " committed"; - } committed { + }committed { a = a + " aborted"; - } + } } function name4() { transaction with retries = 0 { int h = 0; - } onretry { - a = a + " retry"; - } committed { + } + onretry{ + a = a + " retry"; + } +committed { a = a + " committed"; - } aborted { + } + aborted{ a = a + " aborted"; - } + } } \ No newline at end of file From c2fc7bee851205f20f5edfd04fcc143808ad72bc Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Thu, 24 Oct 2019 17:04:15 +0530 Subject: [PATCH 064/167] Make generated java functions to return null, for ballerina functions with no-returns --- .../java/org/ballerinalang/jvm/BRuntime.java | 8 +- .../jvm/scheduling/Scheduler.java | 16 ++ .../streams/DefaultStreamSubscription.java | 2 +- .../TransactionResourceManager.java | 2 +- .../interop/external_method_gen.bal | 3 +- .../interop/interop_method_gen.bal | 157 ++++++++-------- .../compiler_backend_jvm/jvm_constants.bal | 2 - .../jvm_instruction_gen.bal | 17 +- .../compiler_backend_jvm/jvm_method_gen.bal | 170 +++++++----------- .../compiler_backend_jvm/jvm_package_gen.bal | 3 +- .../jvm_terminator_gen.bal | 51 +++--- .../compiler_backend_jvm/jvm_value_gen.bal | 3 +- .../interop/external_method_gen.bal | 2 +- .../interop/interop_method_gen.bal | 163 ++++++++--------- .../compiler_backend_jvm/jvm_constants.bal | 2 - .../jvm_instruction_gen.bal | 17 +- .../compiler_backend_jvm/jvm_method_gen.bal | 169 +++++++---------- .../jvm_terminator_gen.bal | 48 ++--- .../compiler_backend_jvm/jvm_value_gen.bal | 4 +- .../ballerinalang/langlib/array/ForEach.java | 2 +- .../ballerinalang/langlib/map/ForEach.java | 2 +- .../ballerinalang/langlib/xml/ForEach.java | 4 +- .../src/main/ballerina/src/jvm/types.bal | 3 +- .../methodvisitor/VisitInvokeDynamicInsn.java | 13 +- .../jvm/src/main/ballerina/src/jvm/types.bal | 3 +- .../methodvisitor/VisitInvokeDynamicInsn.java | 14 +- 26 files changed, 369 insertions(+), 511 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java index ae19305fed8c..e7df305354ee 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java @@ -19,6 +19,7 @@ import org.ballerinalang.jvm.scheduling.Scheduler; import org.ballerinalang.jvm.scheduling.State; import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.types.BTypes; import org.ballerinalang.jvm.values.ErrorValue; import org.ballerinalang.jvm.values.ObjectValue; import org.ballerinalang.jvm.values.connector.CallableUnitCallback; @@ -26,6 +27,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Semaphore; import java.util.function.Consumer; +import java.util.function.Function; /** * External API to be used by the interop users to control Ballerina runtime behavior. @@ -55,18 +57,18 @@ public static BRuntime getCurrentRuntime() { } public void invokeMethodAsync(ObjectValue object, String methodName, Object... args) { - Consumer func = o -> object.call((Strand) (((Object[]) o)[0]), methodName, args); + Function func = o -> object.call((Strand) (((Object[]) o)[0]), methodName, args); scheduler.schedule(new Object[1], func, null, null); } public void invokeMethodAsync(ObjectValue object, String methodName, CallableUnitCallback callback, Object... args) { - Consumer func = o -> object.call((Strand) (((Object[]) o)[0]), methodName, args); + Function func = o -> object.call((Strand) (((Object[]) o)[0]), methodName, args); scheduler.schedule(new Object[1], func, null, callback); } public void invokeMethodSync(ObjectValue object, String methodName, Object... args) { - Consumer func = o -> object.call((Strand) (((Object[]) o)[0]), methodName, args); + Function func = o -> object.call((Strand) (((Object[]) o)[0]), methodName, args); Semaphore semaphore = new Semaphore(0); final ErrorValue[] errorValue = new ErrorValue[1]; scheduler.schedule(new Object[1], func, null, new CallableUnitCallback() { diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java index 44fcc0211b54..44963e363aa2 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java @@ -105,6 +105,7 @@ public FutureValue scheduleFunction(Object[] params, FPValue fp, Strand pa return schedule(params, fp.getFunction(), parent, null, null, returnType); } + @Deprecated public FutureValue scheduleConsumer(Object[] params, FPValue fp, Strand parent) { return schedule(params, fp.getConsumer(), parent, null); } @@ -126,6 +127,20 @@ public FutureValue schedule(Object[] params, Function function, Strand parent, C return schedule(params, function, parent, future); } + /** + * Add a task to the runnable list, which will eventually be executed by the Scheduler. + * + * @param params - parameters to be passed to the function + * @param function - function to be executed + * @param parent - parent strand that makes the request to schedule another + * @param callback - to notify any listener when ever the execution of the given function is finished + * @return - Reference to the scheduled task + */ + public FutureValue schedule(Object[] params, Function function, Strand parent, CallableUnitCallback callback) { + FutureValue future = createFuture(parent, callback, null, BTypes.typeNull); + return schedule(params, function, parent, future); + } + private FutureValue schedule(Object[] params, Function function, Strand parent, FutureValue future) { params[0] = future.strand; SchedulerItem item = new SchedulerItem(function, params, future); @@ -144,6 +159,7 @@ private FutureValue schedule(Object[] params, Function function, Strand parent, * @param callback - to notify any listener when ever the execution of the given function is finished * @return - Reference to the scheduled task */ + @Deprecated public FutureValue schedule(Object[] params, Consumer consumer, Strand parent, CallableUnitCallback callback) { FutureValue future = createFuture(parent, callback, null, BTypes.typeNull); params[0] = future.strand; diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java index df0c1dd69be3..9b19a7c3ec93 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java @@ -40,7 +40,7 @@ public class DefaultStreamSubscription extends StreamSubscription { public void execute(Object[] fpParams) { //Cannot use scheduler, as the order of events should be preserved - functionPointer.accept(fpParams); + functionPointer.apply(fpParams); } public StreamValue getStream() { diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/transactions/TransactionResourceManager.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/transactions/TransactionResourceManager.java index d397b789ff28..65619bad619f 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/transactions/TransactionResourceManager.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/transactions/TransactionResourceManager.java @@ -313,7 +313,7 @@ private void invokeCommittedFunction(Strand strand, String transactionId, String FPValue fp = committedFuncRegistry.get(transactionBlockId); Object[] args = { strand, (transactionId + ":" + transactionBlockId), true }; if (fp != null) { - strand.scheduler.schedule(args, fp.getConsumer(), strand, null); + strand.scheduler.schedule(args, fp.getFunction(), strand, null); } } diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal index ed3fe41e5d73..0e47d180428b 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal @@ -192,8 +192,9 @@ function createOldStyleExternalFunctionWrapper(bir:Function birFunc, string orgN bir:BType? attachedType = receiver is bir:VariableDcl ? receiver.typeValue : (); string jvmMethodDescription = getMethodDesc(functionTypeDesc.paramTypes, functionTypeDesc?.retType, attachedType = attachedType); + string jMethodVMSig = getMethodDesc(jMethodPramTypes, functionTypeDesc?.retType, - attachedType = attachedType); + attachedType = attachedType, isExtern = true); return { orgName : orgName, diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal index f6f0c5930dae..a1ea06ef8ee0 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal @@ -211,31 +211,30 @@ function genJFieldForInteropField(JFieldFunctionWrapper jFieldFuncWrapper, } // Handle return type - int returnVarRefIndex = -1; bir:BType retType = birFunc.typeValue["retType"]; + bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; + int returnVarRefIndex = indexMap.getIndex(retVarDcl); + if retType is bir:BTypeNil { + mv.visitInsn(ACONST_NULL); + } else if retType is bir:BTypeHandle { + // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before + bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; + int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); + mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); + mv.visitTypeInsn(NEW, HANDLE_VALUE); + mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); + mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); } else { - bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; - returnVarRefIndex = indexMap.getIndex(retVarDcl); - if retType is bir:BTypeHandle { - // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before - bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; - int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); - mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); - mv.visitTypeInsn(NEW, HANDLE_VALUE); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); - mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); + // bType is a value-type + if(jFieldType is jvm:PrimitiveType) { + performWideningPrimitiveConversion(mv, retType, jFieldType); } else { - // bType is a value-type - if(jFieldType is jvm:PrimitiveType) { - performWideningPrimitiveConversion(mv, retType, jFieldType); - } else { - addUnboxInsn(mv, retType); - } + addUnboxInsn(mv, retType); } - generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); } + generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); jvm:Label retLabel = labelGen.getLabel("return_lable"); mv.visitLabel(retLabel); @@ -391,15 +390,56 @@ function genJMethodForInteropMethod(JMethodFunctionWrapper extFuncWrapper, } // Handle return type - int returnVarRefIndex = -1; bir:BType retType = birFunc.typeValue["retType"]; + bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; + int returnVarRefIndex = indexMap.getIndex(retVarDcl); + if retType is bir:BTypeNil { - } else { - boolean isVoidReturnThrows = false; - bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; - returnVarRefIndex = indexMap.getIndex(retVarDcl); - if retType is bir:BTypeHandle { - // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before + mv.visitInsn(ACONST_NULL); + } else if retType is bir:BTypeHandle { + // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before + bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; + int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); + mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); + mv.visitTypeInsn(NEW, HANDLE_VALUE); + mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); + mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); + } else if (retType is BValueType) { + // retType is a value-type + if(jMethodRetType is jvm:PrimitiveType) { + performWideningPrimitiveConversion(mv, retType, jMethodRetType); + } else { + addUnboxInsn(mv, retType); + } + } else if (retType is bir:BUnionType) { + if (jMethodRetType is jvm:PrimitiveType) { + bir:BType bType = getBTypeFromJType(jMethodRetType); + performWideningPrimitiveConversion(mv, bType, jMethodRetType); + addBoxInsn(mv, bType); + } else if (jMethodRetType is jvm:RefType) { + jvm:Label afterHandle = labelGen.getLabel("after_handle"); + if (jMethodRetType.typeName == "java/lang/Object") { + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, ERROR_VALUE); + mv.visitJumpInsn(IFNE, afterHandle); + + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, "java/lang/Number"); + mv.visitJumpInsn(IFNE, afterHandle); + + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, "java/lang/Boolean"); + mv.visitJumpInsn(IFNE, afterHandle); + + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, REF_VALUE); + mv.visitJumpInsn(IFNE, afterHandle); + + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, "java/lang/Byte"); + mv.visitJumpInsn(IFNE, afterHandle); + } bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); @@ -407,70 +447,21 @@ function genJMethodForInteropMethod(JMethodFunctionWrapper extFuncWrapper, mv.visitInsn(DUP); mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); - } else if (retType is BValueType) { - // retType is a value-type - if(jMethodRetType is jvm:PrimitiveType) { - performWideningPrimitiveConversion(mv, retType, jMethodRetType); - } else { - addUnboxInsn(mv, retType); - } - } else if (retType is bir:BUnionType) { - if (jMethodRetType is jvm:PrimitiveType) { - bir:BType bType = getBTypeFromJType(jMethodRetType); - performWideningPrimitiveConversion(mv, bType, jMethodRetType); - addBoxInsn(mv, bType); - if bType is bir:BTypeNil { - isVoidReturnThrows = true; - } - } else if (jMethodRetType is jvm:RefType) { - jvm:Label afterHandle = labelGen.getLabel("after_handle"); - if (jMethodRetType.typeName == "java/lang/Object") { - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, ERROR_VALUE); - mv.visitJumpInsn(IFNE, afterHandle); - - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, "java/lang/Number"); - mv.visitJumpInsn(IFNE, afterHandle); - - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, "java/lang/Boolean"); - mv.visitJumpInsn(IFNE, afterHandle); - - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, REF_VALUE); - mv.visitJumpInsn(IFNE, afterHandle); - - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, "java/lang/Byte"); - mv.visitJumpInsn(IFNE, afterHandle); - } - bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; - int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); - mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); - mv.visitTypeInsn(NEW, HANDLE_VALUE); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); - mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); - mv.visitLabel(afterHandle); - } + mv.visitLabel(afterHandle); + } + + if (getActualType(retType) is bir:BTypeNil) { + mv.visitInsn(ACONST_NULL); } - if (!isVoidReturnThrows) { - generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); - } } + generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); + jvm:Label retLabel = labelGen.getLabel("return_lable"); mv.visitLabel(retLabel); mv.visitLineNumber(birFunc.pos.sLine, retLabel); - if (retType is bir:BUnionType && getActualType(retType) is bir:BTypeNil) { - mv.visitInsn(ACONST_NULL); - mv.visitInsn(ARETURN); - } else { - termGen.genReturnTerm({pos:{}, kind:"RETURN"}, returnVarRefIndex, birFunc); - } - + termGen.genReturnTerm({pos:{}, kind:"RETURN"}, returnVarRefIndex, birFunc); // iterate the exception classes and generate catch blocks foreach var exception in extFuncWrapper.jMethod.throws { diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal index 13eaf7d8ee5d..beb961b984d9 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal @@ -298,7 +298,6 @@ const string LINKED_HASH_SET = "java/util/LinkedHashSet"; const string STRING_BUILDER = "java/lang/StringBuilder"; const string COMPARABLE = "java/lang/Comparable"; const string FUNCTION = "java/util/function/Function"; -const string CONSUMER = "java/util/function/Consumer"; const string EXCEPTION = "java/lang/Exception"; const string LONG_STREAM = "java/util/stream/LongStream"; const string JAVA_THREAD = "java/lang/Thread"; @@ -345,7 +344,6 @@ const string BUILT_IN_PACKAGE_NAME = "lang.annotations"; // scheduler related constants -const string SCHEDULE_CONSUMER_METHOD = "scheduleConsumer"; const string SCHEDULE_FUNCTION_METHOD = "scheduleFunction"; const string SCHEDULER_START_METHOD = "start"; diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal index 605f44f428bd..4a1c9b185be9 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal @@ -885,28 +885,21 @@ type InstructionGenerator object { string methodClass = lookupFullQualifiedClassName(lookupKey); bir:BType returnType = inst.lhsOp.typeValue; - boolean isVoid = false; - if (returnType is bir:BInvokableType) { - isVoid = returnType?.retType is bir:BTypeNil; - } else { + if !(returnType is bir:BInvokableType) { error err = error( "Expected BInvokableType, found " + io:sprintf("%s", returnType)); panic err; } + foreach var v in inst.closureMaps { if (v is bir:VarRef) { self.loadVar(v.variableDcl); } } - self.mv.visitInvokeDynamicInsn(currentClass, lambdaName, isVoid, inst.closureMaps.length()); + self.mv.visitInvokeDynamicInsn(currentClass, lambdaName, inst.closureMaps.length()); loadType(self.mv, returnType); - if (isVoid) { - self.mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", CONSUMER, BTYPE), false); - } else { - self.mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); - } + self.mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", + io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); self.storeToVar(inst.lhsOp.variableDcl); lambdas[lambdaName] = inst; diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal index c7402a15823c..14e288f627ba 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal @@ -328,7 +328,7 @@ function genJMethodForBFunc(bir:Function func, k = k + 1; } - mv.visitMaxs(200, 400); + mv.visitMaxs(0, 0); mv.visitEnd(); } @@ -834,15 +834,9 @@ function generateLambdaMethod(bir:AsyncCall|bir:FPLoad ins, jvm:ClassWriter cw, } string closureMapsDesc = getMapValueDesc(closureMapsCount); - boolean isVoid = returnType is bir:BTypeNil; jvm:MethodVisitor mv; - if (isVoid) { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, cleanupFunctionName(lambdaName), - io:sprintf("(%s[L%s;)V", closureMapsDesc, OBJECT), (), ()); - } else { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, cleanupFunctionName(lambdaName), - io:sprintf("(%s[L%s;)L%s;", closureMapsDesc, OBJECT, OBJECT), (), ()); - } + mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, cleanupFunctionName(lambdaName), + io:sprintf("(%s[L%s;)L%s;", closureMapsDesc, OBJECT, OBJECT), (), ()); mv.visitCode(); // load strand as first arg @@ -865,14 +859,9 @@ function generateLambdaMethod(bir:AsyncCall|bir:FPLoad ins, jvm:ClassWriter cw, mv.visitInsn(ICONST_0); mv.visitFieldInsn(PUTFIELD, STRAND, "blockedOnExtern", "Z"); - if (!isVoid) { - mv.visitInsn(DUP); - - mv.visitFieldInsn(GETFIELD, STRAND, "returnValue", "Ljava/lang/Object;"); - mv.visitInsn(ARETURN); - } else { - mv.visitInsn(RETURN); - } + mv.visitInsn(DUP); + mv.visitFieldInsn(GETFIELD, STRAND, "returnValue", "Ljava/lang/Object;"); + mv.visitInsn(ARETURN); mv.visitLabel(blockedOnExternLabel); } @@ -956,15 +945,10 @@ function generateLambdaMethod(bir:AsyncCall|bir:FPLoad ins, jvm:ClassWriter cw, mv.visitMethodInsn(INVOKESTATIC, jvmClass, funcName, methodDesc, false); } - if (isVoid) { - mv.visitInsn(RETURN); - } else { - if (!isVirtual) { - addBoxInsn(mv, returnType); - } - mv.visitInsn(ARETURN); + if (!isVirtual) { + addBoxInsn(mv, returnType); } - + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -1089,7 +1073,8 @@ function loadDefaultValue(jvm:MethodVisitor mv, bir:BType bType) { } } -function getMethodDesc(bir:BType?[] paramTypes, bir:BType? retType, bir:BType? attachedType = ()) returns string { +function getMethodDesc(bir:BType?[] paramTypes, bir:BType? retType, bir:BType? attachedType = (), + boolean isExtern = false) returns string { string desc = "(Lorg/ballerinalang/jvm/scheduling/Strand;"; if (attachedType is bir:BType) { @@ -1102,7 +1087,7 @@ function getMethodDesc(bir:BType?[] paramTypes, bir:BType? retType, bir:BType? a desc = desc + getArgTypeSignature(paramType); i += 1; } - string returnType = generateReturnType(retType); + string returnType = generateReturnType(retType, isExtern); desc = desc + returnType; return desc; @@ -1177,9 +1162,12 @@ function getArgTypeSignature(bir:BType bType) returns string { } } -function generateReturnType(bir:BType? bType) returns string { - if (bType is ()) { - return ")V"; +function generateReturnType(bir:BType? bType, boolean isExtern = false) returns string { + if (bType is ()|bir:BTypeNil) { + if (isExtern) { + return ")V"; + } + return io:sprintf(")L%s;", OBJECT); } else if (bType is bir:BTypeInt) { return ")J"; } else if (bType is bir:BTypeByte) { @@ -1192,8 +1180,6 @@ function generateReturnType(bir:BType? bType) returns string { return io:sprintf(")L%s;", DECIMAL_VALUE); } else if (bType is bir:BTypeBoolean) { return ")Z"; - } else if (bType is bir:BTypeNil) { - return ")V"; } else if (bType is bir:BArrayType || bType is bir:BTupleType) { return io:sprintf(")L%s;", ARRAY_VALUE); @@ -1242,21 +1228,15 @@ function getMainFunc(bir:Function?[] funcs) returns bir:Function? { return userMainFunc; } -function createFunctionPointer(jvm:MethodVisitor mv, string class, string lambdaName, boolean isVoid, int closureMapCount) { +function createFunctionPointer(jvm:MethodVisitor mv, string class, string lambdaName, int closureMapCount) { mv.visitTypeInsn(NEW, FUNCTION_POINTER); mv.visitInsn(DUP); - mv.visitInvokeDynamicInsn(class, cleanupFunctionName(lambdaName), isVoid, closureMapCount); + mv.visitInvokeDynamicInsn(class, cleanupFunctionName(lambdaName), closureMapCount); // load null here for type, since these are fp's created for internal usages. mv.visitInsn(ACONST_NULL); - - if (isVoid) { - mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", CONSUMER, BTYPE), false); - } else { - mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); - } + mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", + io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); } function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir:Package pkg, string mainClass, @@ -1293,11 +1273,10 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: kind: "ARG" }; int schedulerVarIndex = indexMap.getIndex(schedulerVar); mv.visitVarInsn(ASTORE, schedulerVarIndex); - mv.visitVarInsn(ALOAD, schedulerVarIndex); if (hasInitFunction(pkg)) { string initFuncName = MODULE_INIT; - mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, schedulerVarIndex); mv.visitIntInsn(BIPUSH, 1); mv.visitTypeInsn(ANEWARRAY, OBJECT); @@ -1305,7 +1284,7 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: string lambdaName = io:sprintf("$lambda$%s$", initFuncName); // create FP value - createFunctionPointer(mv, initClass, lambdaName, false, 0); + createFunctionPointer(mv, initClass, lambdaName, 0); // no parent strand mv.visitInsn(ACONST_NULL); @@ -1320,7 +1299,6 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: mv.visitTypeInsn(ANEWARRAY, OBJECT); mv.visitFieldInsn(PUTFIELD, STRAND, "frames", io:sprintf("[L%s;", OBJECT)); errorGen.printStackTraceFromFutureValue(mv, indexMap); - mv.visitInsn(POP); bir:VariableDcl futureVar = { typeValue: "any", name: { value: "initdummy" }, @@ -1334,32 +1312,28 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: } if (userMainFunc is bir:Function) { - mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, schedulerVarIndex); loadCLIArgsForMain(mv, userMainFunc.params, userMainFunc.restParamExist, userMainFunc.annotAttachments); // invoke the user's main method string lambdaName = "$lambda$main$"; - createFunctionPointer(mv, initClass, lambdaName, isVoidFunction, 0); + createFunctionPointer(mv, initClass, lambdaName, 0); // no parent strand mv.visitInsn(ACONST_NULL); + //submit to the scheduler - if (isVoidFunction) { - mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_CONSUMER_METHOD, - io:sprintf("([L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, FUTURE_VALUE), false); - } else { - loadType(mv, userMainFunc.typeValue?.retType); - mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_FUNCTION_METHOD, - io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); - mv.visitInsn(DUP); - } + loadType(mv, userMainFunc.typeValue?.retType); + mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_FUNCTION_METHOD, + io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); + mv.visitInsn(DUP); + mv.visitInsn(DUP); mv.visitFieldInsn(GETFIELD, FUTURE_VALUE, "strand", io:sprintf("L%s;", STRAND)); mv.visitIntInsn(BIPUSH, 100); mv.visitTypeInsn(ANEWARRAY, OBJECT); mv.visitFieldInsn(PUTFIELD, STRAND, "frames", io:sprintf("[L%s;", OBJECT)); errorGen.printStackTraceFromFutureValue(mv, indexMap); - mv.visitInsn(POP); // At this point we are done executing all the functions including asyncs if (!isVoidFunction) { @@ -1416,6 +1390,8 @@ function registerShutdownListener(jvm:MethodVisitor mv, string initClass) { function scheduleStartMethod(jvm:MethodVisitor mv, bir:Package pkg, string initClass, boolean serviceEPAvailable, ErrorHandlerGenerator errorGen, BalToJVMIndexMap indexMap, int schedulerVarIndex) { + + mv.visitVarInsn(ALOAD, schedulerVarIndex); // schedule the start method string startFuncName = MODULE_START; string startLambdaName = io:sprintf("$lambda$%s$", startFuncName); @@ -1424,7 +1400,7 @@ function scheduleStartMethod(jvm:MethodVisitor mv, bir:Package pkg, string initC mv.visitTypeInsn(ANEWARRAY, OBJECT); // create FP value - createFunctionPointer(mv, initClass, startLambdaName, false, 0); + createFunctionPointer(mv, initClass, startLambdaName, 0); // no parent strand mv.visitInsn(ACONST_NULL); @@ -1441,7 +1417,6 @@ function scheduleStartMethod(jvm:MethodVisitor mv, bir:Package pkg, string initC mv.visitTypeInsn(ANEWARRAY, OBJECT); mv.visitFieldInsn(PUTFIELD, STRAND, "frames", io:sprintf("[L%s;", OBJECT)); errorGen.printStackTraceFromFutureValue(mv, indexMap); - mv.visitInsn(POP); bir:VariableDcl futureVar = { typeValue: "any", name: { value: "startdummy" }, @@ -1472,16 +1447,9 @@ function generateLambdaForMain(bir:Function userMainFunc, jvm:ClassWriter cw, bi string mainClass, string initClass) { string pkgName = getPackageName(pkg.org.value, pkg.name.value); bir:BType returnType = userMainFunc.typeValue?.retType; - boolean isVoidFunc = returnType is bir:BTypeNil; - - jvm:MethodVisitor mv; - if (isVoidFunc) { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "$lambda$main$", - io:sprintf("([L%s;)V", OBJECT), (), ()); - } else { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "$lambda$main$", - io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); - } + + jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "$lambda$main$", + io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); mv.visitCode(); //load strand as first arg @@ -1504,12 +1472,8 @@ function generateLambdaForMain(bir:Function userMainFunc, jvm:ClassWriter cw, bi } mv.visitMethodInsn(INVOKESTATIC, mainClass, userMainFunc.name.value, getMethodDesc(paramTypes, returnType), false); - if (isVoidFunc) { - mv.visitInsn(RETURN); - } else { - addBoxInsn(mv, returnType); - mv.visitInsn(ARETURN); - } + addBoxInsn(mv, returnType); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -1607,16 +1571,9 @@ function generateLambdaForPackageInits(jvm:ClassWriter cw, bir:Package pkg, function generateLambdaForModuleFunction(jvm:ClassWriter cw, string funcName, string initClass, boolean voidReturn = true) { - jvm:MethodVisitor mv; - if (voidReturn) { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, - io:sprintf("$lambda$%s$", funcName), - io:sprintf("([L%s;)V", OBJECT), (), ()); - } else { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, - io:sprintf("$lambda$%s$", funcName), - io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); - } + jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, + io:sprintf("$lambda$%s$", funcName), + io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); mv.visitCode(); //load strand as first arg @@ -1625,14 +1582,9 @@ function generateLambdaForModuleFunction(jvm:ClassWriter cw, string funcName, st mv.visitInsn(AALOAD); mv.visitTypeInsn(CHECKCAST, STRAND); - if (voidReturn) { - mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)V", STRAND), false); - mv.visitInsn(RETURN); - } else { - mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)L%s;", STRAND, OBJECT), false); - addBoxInsn(mv, errUnion); - mv.visitInsn(ARETURN); - } + mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)L%s;", STRAND, OBJECT), false); + addBoxInsn(mv, errUnion); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -1641,7 +1593,7 @@ function generateLambdaForDepModStopFunc(jvm:ClassWriter cw, string funcName, st jvm:MethodVisitor mv; mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, io:sprintf("$lambda$%s", funcName), - io:sprintf("([L%s;)V", OBJECT), (), ()); + io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); mv.visitCode(); //load strand as first arg @@ -1650,8 +1602,8 @@ function generateLambdaForDepModStopFunc(jvm:ClassWriter cw, string funcName, st mv.visitInsn(AALOAD); mv.visitTypeInsn(CHECKCAST, STRAND); - mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)V", STRAND), false); - mv.visitInsn(RETURN); + mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)L%s;", STRAND, OBJECT), false); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -2313,7 +2265,10 @@ function generateModuleInitializer(jvm:ClassWriter cw, bir:Package module) { string moduleName = module.name.value; string versionValue = module.versionValue.value; string pkgName = getPackageName(orgName, moduleName); - jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, CURRENT_MODULE_INIT, io:sprintf("(L%s;)V", STRAND), (), ()); + // Using object return type since this is similar to a ballerina function without a return. + // A ballerina function with no returns is equivalent to a function with nil-return. + jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, CURRENT_MODULE_INIT, + io:sprintf("(L%s;)L%s;", STRAND, OBJECT), (), ()); mv.visitCode(); mv.visitMethodInsn(INVOKESTATIC, typeOwnerClass, "$createTypes", "()V", false); @@ -2329,7 +2284,9 @@ function generateModuleInitializer(jvm:ClassWriter cw, bir:Package module) { io:sprintf("(L%s;L%s;L%s;L%s;)V", STRING_VALUE, STRING_VALUE, STRING_VALUE, VALUE_CREATOR), false); - mv.visitInsn(RETURN); + // Add a nil-return + mv.visitInsn(ACONST_NULL); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); @@ -2371,7 +2328,7 @@ function generateExecutionStopMethod(jvm:ClassWriter cw, string initClass, bir:P bir:ModuleID currentModId = packageToModuleId(module); string fullFuncName = calculateModuleSpecialFuncName(currentModId, stopFuncName); - scheduleMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex); + scheduleStopMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex); int i = imprtMods.length() - 1; while i >= 0 { @@ -2379,7 +2336,7 @@ function generateExecutionStopMethod(jvm:ClassWriter cw, string initClass, bir:P i -= 1; fullFuncName = calculateModuleSpecialFuncName(id, stopFuncName); - scheduleMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex); + scheduleStopMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex); } mv.visitInsn(RETURN); @@ -2394,8 +2351,8 @@ function generateExecutionStopMethod(jvm:ClassWriter cw, string initClass, bir:P versionValue, typeOwnerClass); } -function scheduleMethod(jvm:MethodVisitor mv, string initClass, string stopFuncName, ErrorHandlerGenerator errorGen, - BalToJVMIndexMap indexMap, int schedulerIndex) { +function scheduleStopMethod(jvm:MethodVisitor mv, string initClass, string stopFuncName, + ErrorHandlerGenerator errorGen, BalToJVMIndexMap indexMap, int schedulerIndex) { string lambdaFuncName = "$lambda$" + stopFuncName; // Create a schedular. A new schedular is used here, to make the stop function to not to // depend/wait on whatever is being running on the background. eg: a busy loop in the main. @@ -2406,13 +2363,14 @@ function scheduleMethod(jvm:MethodVisitor mv, string initClass, string stopFuncN mv.visitTypeInsn(ANEWARRAY, OBJECT); // create FP value - createFunctionPointer(mv, initClass, lambdaFuncName, true, 0); + createFunctionPointer(mv, initClass, lambdaFuncName, 0); // no parent strand mv.visitInsn(ACONST_NULL); - mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_CONSUMER_METHOD, - io:sprintf("([L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, FUTURE_VALUE), false); + loadType(mv, bir:TYPE_NIL); + mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_FUNCTION_METHOD, + io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); mv.visitInsn(DUP); mv.visitFieldInsn(GETFIELD, FUTURE_VALUE, "strand", io:sprintf("L%s;", STRAND)); diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal index 781069ab71e2..2297377d3fc9 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal @@ -533,7 +533,8 @@ function generateClassNameMappings(bir:Package module, string pkgName, string in } function getFunctionWrapper(bir:Function currentFunc, string orgName ,string moduleName, - string versionValue, string moduleClass) returns BIRFunctionWrapper { + string versionValue, string moduleClass) + returns BIRFunctionWrapper { bir:BInvokableType functionTypeDesc = currentFunc.typeValue; bir:VariableDcl? receiver = currentFunc.receiver; diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal index db581316516f..fb5941151d4c 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal @@ -165,7 +165,8 @@ type TerminatorGenerator object { } bir:BType bType = func.typeValue?.retType; if (bType is bir:BTypeNil) { - self.mv.visitInsn(RETURN); + self.mv.visitVarInsn(ALOAD, returnVarRefIndex); + self.mv.visitInsn(ARETURN); } else if (bType is bir:BTypeInt) { self.mv.visitVarInsn(LLOAD, returnVarRefIndex); self.mv.visitInsn(LRETURN); @@ -267,6 +268,7 @@ type TerminatorGenerator object { string orgName = callIns.pkgID.org; string moduleName = callIns.pkgID.name; + bir:VariableDcl? lhsOpVarDcl = callIns.lhsOp?.variableDcl; // check for native blocking call if (isInteropFuncCall(callIns)) { jvm:Label blockedOnExternLabel = new; @@ -280,12 +282,12 @@ type TerminatorGenerator object { self.mv.visitInsn(ICONST_0); self.mv.visitFieldInsn(PUTFIELD, "org/ballerinalang/jvm/scheduling/Strand", "blockedOnExtern", "Z"); - if (callIns.lhsOp?.variableDcl is bir:VariableDcl) { + if (lhsOpVarDcl is bir:VariableDcl) { self.mv.visitVarInsn(ALOAD, localVarOffset); self.mv.visitFieldInsn(GETFIELD, "org/ballerinalang/jvm/scheduling/Strand", "returnValue", "Ljava/lang/Object;"); addUnboxInsn(self.mv, callIns.lhsOp?.typeValue); // store return - self.storeReturnFromCallIns(callIns); + self.storeToVar(lhsOpVarDcl); } self.mv.visitJumpInsn(GOTO, notBlockedOnExternLabel); @@ -295,7 +297,7 @@ type TerminatorGenerator object { self.genCall(callIns, orgName, moduleName, localVarOffset); // store return - self.storeReturnFromCallIns(callIns); + self.storeReturnFromCallIns(lhsOpVarDcl); self.mv.visitLabel(notBlockedOnExternLabel); } else { @@ -303,7 +305,7 @@ type TerminatorGenerator object { self.genCall(callIns, orgName, moduleName, localVarOffset); // store return - self.storeReturnFromCallIns(callIns); + self.storeReturnFromCallIns(lhsOpVarDcl); } } @@ -385,11 +387,11 @@ type TerminatorGenerator object { panic err; } - private function storeReturnFromCallIns(bir:Call callIns) { - bir:VariableDcl? lhsOpVarDcl = callIns.lhsOp?.variableDcl; - + private function storeReturnFromCallIns(bir:VariableDcl? lhsOpVarDcl) { if (lhsOpVarDcl is bir:VariableDcl) { self.storeToVar(lhsOpVarDcl); + } else { + self.mv.visitInsn(POP); } } @@ -493,11 +495,7 @@ type TerminatorGenerator object { self.mv.visitMethodInsn(INVOKEINTERFACE, OBJECT_VALUE, "call", methodDesc, true); bir:BType? returnType = callIns.lhsOp?.typeValue; - if (returnType is ()) { - self.mv.visitInsn(POP); - } else { - addUnboxInsn(self.mv, returnType); - } + addUnboxInsn(self.mv, returnType); } function loadBooleanArgToIndicateUserProvidedArg(string orgName, string moduleName, boolean userProvided) { @@ -575,8 +573,8 @@ type TerminatorGenerator object { if (futureType is bir:BFutureType) { returnType = futureType.returnType; } - boolean isVoid = returnType is bir:BTypeNil; - createFunctionPointer(self.mv, methodClass, lambdaName, isVoid, 0); + + createFunctionPointer(self.mv, methodClass, lambdaName, 0); lambdas[lambdaName] = callIns; self.lambdaIndex += 1; @@ -683,18 +681,12 @@ type TerminatorGenerator object { } // if async, we submit this to sceduler (worker scenario) - boolean isVoid = false; bir:BType returnType = fpCall.fp.typeValue; - if (returnType is bir:BInvokableType) { - isVoid = returnType?.retType is bir:BTypeNil; - } if (fpCall.isAsync) { // load function ref now self.loadVar(fpCall.fp.variableDcl); self.submitToScheduler(fpCall.lhsOp, localVarOffset); - } else if (isVoid) { - self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "accept", io:sprintf("(L%s;)V", OBJECT), false); } else { self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "apply", io:sprintf("(L%s;)L%s;", OBJECT, OBJECT), false); // store reult @@ -706,6 +698,8 @@ type TerminatorGenerator object { bir:VariableDcl? lhsVar = fpCall.lhsOp?.variableDcl; if (lhsVar is bir:VariableDcl) { self.storeToVar(lhsVar); + } else { + self.mv.visitInsn(POP); } } } @@ -786,22 +780,17 @@ type TerminatorGenerator object { function submitToScheduler(bir:VarRef? lhsOp, int localVarOffset) { bir:BType? futureType = lhsOp?.typeValue; - boolean isVoid = false; bir:BType returnType = "any"; if (futureType is bir:BFutureType) { - isVoid = futureType.returnType is bir:BTypeNil; returnType = futureType.returnType; } + // load strand self.mv.visitVarInsn(ALOAD, localVarOffset); - if (isVoid) { - self.mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, "scheduleConsumer", - io:sprintf("([L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, FUTURE_VALUE), false); - } else { - loadType(self.mv, returnType); - self.mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, "scheduleFunction", - io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); - } + + loadType(self.mv, returnType); + self.mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, "scheduleFunction", + io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); // store return if (lhsOp is bir:VarRef) { diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal index d0ddd65e2e46..b79cab5084e9 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal @@ -390,7 +390,8 @@ public type ObjectGenerator object { initFuncName = cleanupFunctionName(recordType.name.value + "__init_"); } - mv.visitMethodInsn(INVOKESTATIC, valueClassName, initFuncName, io:sprintf("(L%s;L%s;)V", STRAND, MAP_VALUE), false); + mv.visitMethodInsn(INVOKESTATIC, valueClassName, initFuncName, + io:sprintf("(L%s;L%s;)L%s;", STRAND, MAP_VALUE, OBJECT), false); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal index 0ad859c59d2b..517f59e28a40 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal @@ -193,7 +193,7 @@ function createOldStyleExternalFunctionWrapper(bir:Function birFunc, string orgN string jvmMethodDescription = getMethodDesc(functionTypeDesc.paramTypes, functionTypeDesc?.retType, attachedType = attachedType); string jMethodVMSig = getMethodDesc(jMethodPramTypes, functionTypeDesc?.retType, - attachedType = attachedType); + attachedType = attachedType, isExtern = true); return { orgName : orgName, diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal index 76d099d31c6e..3b1c921e68e0 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal @@ -211,32 +211,32 @@ function genJFieldForInteropField(JFieldFunctionWrapper jFieldFuncWrapper, } // Handle return type - int returnVarRefIndex = -1; bir:BType retType = birFunc.typeValue["retType"]; + bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; + int returnVarRefIndex = indexMap.getIndex(retVarDcl); + if retType is bir:BTypeNil { + mv.visitInsn(ACONST_NULL); + } else if retType is bir:BTypeHandle { + // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before + bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; + int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); + mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); + mv.visitTypeInsn(NEW, HANDLE_VALUE); + mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); + mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); } else { - bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; - returnVarRefIndex = indexMap.getIndex(retVarDcl); - if retType is bir:BTypeHandle { - // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before - bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; - int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); - mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); - mv.visitTypeInsn(NEW, HANDLE_VALUE); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); - mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); + // bType is a value-type + if(jFieldType is jvm:PrimitiveType) { + performWideningPrimitiveConversion(mv, retType, jFieldType); } else { - // bType is a value-type - if(jFieldType is jvm:PrimitiveType) { - performWideningPrimitiveConversion(mv, retType, jFieldType); - } else { - addUnboxInsn(mv, retType); - } + addUnboxInsn(mv, retType); } - generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); } + generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); + jvm:Label retLabel = labelGen.getLabel("return_lable"); mv.visitLabel(retLabel); mv.visitLineNumber(birFunc.pos.sLine, retLabel); @@ -391,15 +391,58 @@ function genJMethodForInteropMethod(JMethodFunctionWrapper extFuncWrapper, } // Handle return type - int returnVarRefIndex = -1; bir:BType retType = birFunc.typeValue["retType"]; + bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; + int returnVarRefIndex = indexMap.getIndex(retVarDcl); + if retType is bir:BTypeNil { - } else { - boolean isVoidReturnThrows = false; - bir:VariableDcl retVarDcl = { typeValue: retType, name: { value: "$_ret_var_$" }, kind: "LOCAL" }; - returnVarRefIndex = indexMap.getIndex(retVarDcl); - if retType is bir:BTypeHandle { - // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before + mv.visitInsn(ACONST_NULL); + } else if retType is bir:BTypeHandle { + // Here the corresponding Java method parameter type is 'jvm:RefType'. This has been verified before + bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; + int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); + mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); + mv.visitTypeInsn(NEW, HANDLE_VALUE); + mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); + mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); + } else if (retType is BValueType) { + // retType is a value-type + if(jMethodRetType is jvm:PrimitiveType) { + performWideningPrimitiveConversion(mv, retType, jMethodRetType); + } else { + addUnboxInsn(mv, retType); + } + } else if (retType is bir:BUnionType) { + if (jMethodRetType is jvm:PrimitiveType) { + bir:BType bType = getBTypeFromJType(jMethodRetType); + performWideningPrimitiveConversion(mv, bType, jMethodRetType); + addBoxInsn(mv, bType); + } else if (jMethodRetType is jvm:RefType) { + jvm:Label afterHandle = labelGen.getLabel("after_handle"); + if (jMethodRetType.typeName == "java/lang/Object") { + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, ERROR_VALUE); + mv.visitJumpInsn(IFNE, afterHandle); + + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, "java/lang/Number"); + mv.visitJumpInsn(IFNE, afterHandle); + + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, "java/lang/Boolean"); + mv.visitJumpInsn(IFNE, afterHandle); + + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, "java/lang/Byte"); + mv.visitJumpInsn(IFNE, afterHandle); + } + + // if the returned value is a Ballerina Value, do nothing + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, REF_VALUE); + mv.visitJumpInsn(IFNE, afterHandle); + bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); @@ -407,73 +450,21 @@ function genJMethodForInteropMethod(JMethodFunctionWrapper extFuncWrapper, mv.visitInsn(DUP); mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); - } else if (retType is BValueType) { - // retType is a value-type - if(jMethodRetType is jvm:PrimitiveType) { - performWideningPrimitiveConversion(mv, retType, jMethodRetType); - } else { - addUnboxInsn(mv, retType); - } - } else if (retType is bir:BUnionType) { - if (jMethodRetType is jvm:PrimitiveType) { - bir:BType bType = getBTypeFromJType(jMethodRetType); - performWideningPrimitiveConversion(mv, bType, jMethodRetType); - addBoxInsn(mv, bType); - if bType is bir:BTypeNil { - isVoidReturnThrows = true; - } - } else if (jMethodRetType is jvm:RefType) { - jvm:Label afterHandle = labelGen.getLabel("after_handle"); - if (jMethodRetType.typeName == "java/lang/Object") { - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, ERROR_VALUE); - mv.visitJumpInsn(IFNE, afterHandle); - - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, "java/lang/Number"); - mv.visitJumpInsn(IFNE, afterHandle); - - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, "java/lang/Boolean"); - mv.visitJumpInsn(IFNE, afterHandle); - - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, "java/lang/Byte"); - mv.visitJumpInsn(IFNE, afterHandle); - } - - // if the returned value is a Ballerina Value, do nothing - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, REF_VALUE); - mv.visitJumpInsn(IFNE, afterHandle); + mv.visitLabel(afterHandle); + } - bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; - int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); - mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); - mv.visitTypeInsn(NEW, HANDLE_VALUE); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, returnJObjectVarRefIndex); - mv.visitMethodInsn(INVOKESPECIAL, HANDLE_VALUE, "", "(Ljava/lang/Object;)V", false); - mv.visitLabel(afterHandle); - } + if (getActualType(retType) is bir:BTypeNil) { + mv.visitInsn(ACONST_NULL); } - if (!isVoidReturnThrows) { - generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); - } } - + generateVarStore(mv, retVarDcl, currentPackageName, returnVarRefIndex); + jvm:Label retLabel = labelGen.getLabel("return_lable"); mv.visitLabel(retLabel); mv.visitLineNumber(birFunc.pos.sLine, retLabel); - if (retType is bir:BUnionType && getActualType(retType) is bir:BTypeNil) { - mv.visitInsn(ACONST_NULL); - mv.visitInsn(ARETURN); - } else { - termGen.genReturnTerm({pos:{}, kind:"RETURN"}, returnVarRefIndex, birFunc); - } - - + termGen.genReturnTerm({pos:{}, kind:"RETURN"}, returnVarRefIndex, birFunc); + // iterate the exception classes and generate catch blocks foreach var exception in extFuncWrapper.jMethod.throws { jvm:Label catchLabel = labelGen.getLabel(exception + "$label$"); diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal index f3dd7a6db24a..d92dd3d18b03 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_constants.bal @@ -299,7 +299,6 @@ const string LINKED_HASH_SET = "java/util/LinkedHashSet"; const string STRING_BUILDER = "java/lang/StringBuilder"; const string COMPARABLE = "java/lang/Comparable"; const string FUNCTION = "java/util/function/Function"; -const string CONSUMER = "java/util/function/Consumer"; const string EXCEPTION = "java/lang/Exception"; const string LONG_STREAM = "java/util/stream/LongStream"; const string JAVA_THREAD = "java/lang/Thread"; @@ -346,7 +345,6 @@ const string BUILT_IN_PACKAGE_NAME = "lang.annotations"; // scheduler related constants -const string SCHEDULE_CONSUMER_METHOD = "scheduleConsumer"; const string SCHEDULE_FUNCTION_METHOD = "scheduleFunction"; const string SCHEDULER_START_METHOD = "start"; diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal index f94b804ceca3..a38c2726113c 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_instruction_gen.bal @@ -900,28 +900,21 @@ type InstructionGenerator object { string methodClass = lookupFullQualifiedClassName(lookupKey); bir:BType returnType = inst.lhsOp.typeValue; - boolean isVoid = false; - if (returnType is bir:BInvokableType) { - isVoid = returnType?.retType is bir:BTypeNil; - } else { + if !(returnType is bir:BInvokableType) { error err = error( "Expected BInvokableType, found " + io:sprintf("%s", returnType)); panic err; } + foreach var v in inst.closureMaps { if (v is bir:VarRef) { self.loadVar(v.variableDcl); } } - self.mv.visitInvokeDynamicInsn(currentClass, lambdaName, isVoid, inst.closureMaps.length()); + self.mv.visitInvokeDynamicInsn(currentClass, lambdaName, inst.closureMaps.length()); loadType(self.mv, returnType); - if (isVoid) { - self.mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", CONSUMER, BTYPE), false); - } else { - self.mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); - } + self.mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", + io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); // Set annotations if available. self.mv.visitInsn(DUP); diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal index e4c763fb1fc0..82357c84a078 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_method_gen.bal @@ -334,7 +334,7 @@ function genJMethodForBFunc(bir:Function func, k = k + 1; } - mv.visitMaxs(200, 400); + mv.visitMaxs(0, 0); mv.visitEnd(); } @@ -840,15 +840,9 @@ function generateLambdaMethod(bir:AsyncCall|bir:FPLoad ins, jvm:ClassWriter cw, } string closureMapsDesc = getMapValueDesc(closureMapsCount); - boolean isVoid = returnType is bir:BTypeNil; jvm:MethodVisitor mv; - if (isVoid) { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, cleanupFunctionName(lambdaName), - io:sprintf("(%s[L%s;)V", closureMapsDesc, OBJECT), (), ()); - } else { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, cleanupFunctionName(lambdaName), - io:sprintf("(%s[L%s;)L%s;", closureMapsDesc, OBJECT, OBJECT), (), ()); - } + mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, cleanupFunctionName(lambdaName), + io:sprintf("(%s[L%s;)L%s;", closureMapsDesc, OBJECT, OBJECT), (), ()); mv.visitCode(); // load strand as first arg @@ -871,14 +865,9 @@ function generateLambdaMethod(bir:AsyncCall|bir:FPLoad ins, jvm:ClassWriter cw, mv.visitInsn(ICONST_0); mv.visitFieldInsn(PUTFIELD, STRAND, "blockedOnExtern", "Z"); - if (!isVoid) { - mv.visitInsn(DUP); - - mv.visitFieldInsn(GETFIELD, STRAND, "returnValue", "Ljava/lang/Object;"); - mv.visitInsn(ARETURN); - } else { - mv.visitInsn(RETURN); - } + mv.visitInsn(DUP); + mv.visitFieldInsn(GETFIELD, STRAND, "returnValue", "Ljava/lang/Object;"); + mv.visitInsn(ARETURN); mv.visitLabel(blockedOnExternLabel); } @@ -962,15 +951,10 @@ function generateLambdaMethod(bir:AsyncCall|bir:FPLoad ins, jvm:ClassWriter cw, mv.visitMethodInsn(INVOKESTATIC, jvmClass, funcName, methodDesc, false); } - if (isVoid) { - mv.visitInsn(RETURN); - } else { - if (!isVirtual) { - addBoxInsn(mv, returnType); - } - mv.visitInsn(ARETURN); + if (!isVirtual) { + addBoxInsn(mv, returnType); } - + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -1095,7 +1079,8 @@ function loadDefaultValue(jvm:MethodVisitor mv, bir:BType bType) { } } -function getMethodDesc(bir:BType?[] paramTypes, bir:BType? retType, bir:BType? attachedType = ()) returns string { +function getMethodDesc(bir:BType?[] paramTypes, bir:BType? retType, bir:BType? attachedType = (), + boolean isExtern = false) returns string { string desc = "(Lorg/ballerinalang/jvm/scheduling/Strand;"; if (attachedType is bir:BType) { @@ -1108,7 +1093,7 @@ function getMethodDesc(bir:BType?[] paramTypes, bir:BType? retType, bir:BType? a desc = desc + getArgTypeSignature(paramType); i += 1; } - string returnType = generateReturnType(retType); + string returnType = generateReturnType(retType, isExtern); desc = desc + returnType; return desc; @@ -1183,9 +1168,12 @@ function getArgTypeSignature(bir:BType bType) returns string { } } -function generateReturnType(bir:BType? bType) returns string { - if (bType is ()) { - return ")V"; +function generateReturnType(bir:BType? bType, boolean isExtern = false) returns string { + if (bType is ()|bir:BTypeNil) { + if (isExtern) { + return ")V"; + } + return io:sprintf(")L%s;", OBJECT); } else if (bType is bir:BTypeInt) { return ")J"; } else if (bType is bir:BTypeByte) { @@ -1198,8 +1186,6 @@ function generateReturnType(bir:BType? bType) returns string { return io:sprintf(")L%s;", DECIMAL_VALUE); } else if (bType is bir:BTypeBoolean) { return ")Z"; - } else if (bType is bir:BTypeNil) { - return ")V"; } else if (bType is bir:BArrayType || bType is bir:BTupleType) { return io:sprintf(")L%s;", ARRAY_VALUE); @@ -1248,21 +1234,16 @@ function getMainFunc(bir:Function?[] funcs) returns bir:Function? { return userMainFunc; } -function createFunctionPointer(jvm:MethodVisitor mv, string class, string lambdaName, boolean isVoid, int closureMapCount) { +function createFunctionPointer(jvm:MethodVisitor mv, string class, string lambdaName, int closureMapCount) { mv.visitTypeInsn(NEW, FUNCTION_POINTER); mv.visitInsn(DUP); - mv.visitInvokeDynamicInsn(class, cleanupFunctionName(lambdaName), isVoid, closureMapCount); + mv.visitInvokeDynamicInsn(class, cleanupFunctionName(lambdaName), closureMapCount); // load null here for type, since these are fp's created for internal usages. mv.visitInsn(ACONST_NULL); - if (isVoid) { - mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", CONSUMER, BTYPE), false); - } else { - mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", - io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); - } + mv.visitMethodInsn(INVOKESPECIAL, FUNCTION_POINTER, "", + io:sprintf("(L%s;L%s;)V", FUNCTION, BTYPE), false); } function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir:Package pkg, string mainClass, @@ -1302,11 +1283,10 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: kind: "ARG" }; int schedulerVarIndex = indexMap.getIndex(schedulerVar); mv.visitVarInsn(ASTORE, schedulerVarIndex); - mv.visitVarInsn(ALOAD, schedulerVarIndex); if (hasInitFunction(pkg)) { string initFuncName = MODULE_INIT; - mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, schedulerVarIndex); mv.visitIntInsn(BIPUSH, 1); mv.visitTypeInsn(ANEWARRAY, OBJECT); @@ -1314,7 +1294,7 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: string lambdaName = io:sprintf("$lambda$%s$", initFuncName); // create FP value - createFunctionPointer(mv, initClass, lambdaName, false, 0); + createFunctionPointer(mv, initClass, lambdaName, 0); // no parent strand mv.visitInsn(ACONST_NULL); @@ -1329,7 +1309,6 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: mv.visitTypeInsn(ANEWARRAY, OBJECT); mv.visitFieldInsn(PUTFIELD, STRAND, "frames", io:sprintf("[L%s;", OBJECT)); errorGen.printStackTraceFromFutureValue(mv, indexMap); - mv.visitInsn(POP); bir:VariableDcl futureVar = { typeValue: "any", name: { value: "initdummy" }, @@ -1343,32 +1322,28 @@ function generateMainMethod(bir:Function? userMainFunc, jvm:ClassWriter cw, bir: } if (userMainFunc is bir:Function) { - mv.visitInsn(DUP); + mv.visitVarInsn(ALOAD, schedulerVarIndex); loadCLIArgsForMain(mv, userMainFunc.params, userMainFunc.restParamExist, userMainFunc.annotAttachments); // invoke the user's main method string lambdaName = "$lambda$main$"; - createFunctionPointer(mv, initClass, lambdaName, isVoidFunction, 0); + createFunctionPointer(mv, initClass, lambdaName, 0); // no parent strand mv.visitInsn(ACONST_NULL); + //submit to the scheduler - if (isVoidFunction) { - mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_CONSUMER_METHOD, - io:sprintf("([L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, FUTURE_VALUE), false); - } else { - loadType(mv, userMainFunc.typeValue?.retType); - mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_FUNCTION_METHOD, - io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); - mv.visitInsn(DUP); - } + loadType(mv, userMainFunc.typeValue?.retType); + mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_FUNCTION_METHOD, + io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); + mv.visitInsn(DUP); + mv.visitInsn(DUP); mv.visitFieldInsn(GETFIELD, FUTURE_VALUE, "strand", io:sprintf("L%s;", STRAND)); mv.visitIntInsn(BIPUSH, 100); mv.visitTypeInsn(ANEWARRAY, OBJECT); mv.visitFieldInsn(PUTFIELD, STRAND, "frames", io:sprintf("[L%s;", OBJECT)); errorGen.printStackTraceFromFutureValue(mv, indexMap); - mv.visitInsn(POP); // At this point we are done executing all the functions including asyncs if (!isVoidFunction) { @@ -1429,6 +1404,8 @@ function registerShutdownListener(jvm:MethodVisitor mv, string initClass) { function scheduleStartMethod(jvm:MethodVisitor mv, bir:Package pkg, string initClass, boolean serviceEPAvailable, ErrorHandlerGenerator errorGen, BalToJVMIndexMap indexMap, int schedulerVarIndex) { + + mv.visitVarInsn(ALOAD, schedulerVarIndex); // schedule the start method string startFuncName = MODULE_START; string startLambdaName = io:sprintf("$lambda$%s$", startFuncName); @@ -1437,7 +1414,7 @@ function scheduleStartMethod(jvm:MethodVisitor mv, bir:Package pkg, string initC mv.visitTypeInsn(ANEWARRAY, OBJECT); // create FP value - createFunctionPointer(mv, initClass, startLambdaName, false, 0); + createFunctionPointer(mv, initClass, startLambdaName, 0); // no parent strand mv.visitInsn(ACONST_NULL); @@ -1454,7 +1431,6 @@ function scheduleStartMethod(jvm:MethodVisitor mv, bir:Package pkg, string initC mv.visitTypeInsn(ANEWARRAY, OBJECT); mv.visitFieldInsn(PUTFIELD, STRAND, "frames", io:sprintf("[L%s;", OBJECT)); errorGen.printStackTraceFromFutureValue(mv, indexMap); - mv.visitInsn(POP); bir:VariableDcl futureVar = { typeValue: "any", name: { value: "startdummy" }, @@ -1485,16 +1461,9 @@ function generateLambdaForMain(bir:Function userMainFunc, jvm:ClassWriter cw, bi string mainClass, string initClass) { string pkgName = getPackageName(pkg.org.value, pkg.name.value); bir:BType returnType = userMainFunc.typeValue?.retType; - boolean isVoidFunc = returnType is bir:BTypeNil; - jvm:MethodVisitor mv; - if (isVoidFunc) { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "$lambda$main$", - io:sprintf("([L%s;)V", OBJECT), (), ()); - } else { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "$lambda$main$", - io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); - } + jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "$lambda$main$", + io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); mv.visitCode(); //load strand as first arg @@ -1517,12 +1486,8 @@ function generateLambdaForMain(bir:Function userMainFunc, jvm:ClassWriter cw, bi } mv.visitMethodInsn(INVOKESTATIC, mainClass, userMainFunc.name.value, getMethodDesc(paramTypes, returnType), false); - if (isVoidFunc) { - mv.visitInsn(RETURN); - } else { - addBoxInsn(mv, returnType); - mv.visitInsn(ARETURN); - } + addBoxInsn(mv, returnType); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -1620,16 +1585,9 @@ function generateLambdaForPackageInits(jvm:ClassWriter cw, bir:Package pkg, function generateLambdaForModuleFunction(jvm:ClassWriter cw, string funcName, string initClass, boolean voidReturn = true) { - jvm:MethodVisitor mv; - if (voidReturn) { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, - io:sprintf("$lambda$%s$", funcName), - io:sprintf("([L%s;)V", OBJECT), (), ()); - } else { - mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, - io:sprintf("$lambda$%s$", funcName), - io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); - } + jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, + io:sprintf("$lambda$%s$", funcName), + io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); mv.visitCode(); //load strand as first arg @@ -1638,14 +1596,9 @@ function generateLambdaForModuleFunction(jvm:ClassWriter cw, string funcName, st mv.visitInsn(AALOAD); mv.visitTypeInsn(CHECKCAST, STRAND); - if (voidReturn) { - mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)V", STRAND), false); - mv.visitInsn(RETURN); - } else { - mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)L%s;", STRAND, OBJECT), false); - addBoxInsn(mv, errUnion); - mv.visitInsn(ARETURN); - } + mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)L%s;", STRAND, OBJECT), false); + addBoxInsn(mv, errUnion); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -1654,7 +1607,7 @@ function generateLambdaForDepModStopFunc(jvm:ClassWriter cw, string funcName, st jvm:MethodVisitor mv; mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, io:sprintf("$lambda$%s", funcName), - io:sprintf("([L%s;)V", OBJECT), (), ()); + io:sprintf("([L%s;)L%s;", OBJECT, OBJECT), (), ()); mv.visitCode(); //load strand as first arg @@ -1663,8 +1616,8 @@ function generateLambdaForDepModStopFunc(jvm:ClassWriter cw, string funcName, st mv.visitInsn(AALOAD); mv.visitTypeInsn(CHECKCAST, STRAND); - mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)V", STRAND), false); - mv.visitInsn(RETURN); + mv.visitMethodInsn(INVOKESTATIC, initClass, funcName, io:sprintf("(L%s;)L%s;", STRAND, OBJECT), false); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); } @@ -2325,7 +2278,11 @@ function generateModuleInitializer(jvm:ClassWriter cw, bir:Package module) { string moduleName = module.name.value; string versionValue = module.versionValue.value; string pkgName = getPackageName(orgName, moduleName); - jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, CURRENT_MODULE_INIT, io:sprintf("(L%s;)V", STRAND), (), ()); + + // Using object return type since this is similar to a ballerina function without a return. + // A ballerina function with no returns is equivalent to a function with nil-return. + jvm:MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, CURRENT_MODULE_INIT, + io:sprintf("(L%s;)L%s;", STRAND, OBJECT), (), ()); mv.visitCode(); mv.visitMethodInsn(INVOKESTATIC, typeOwnerClass, "$createTypes", "()V", false); @@ -2341,7 +2298,9 @@ function generateModuleInitializer(jvm:ClassWriter cw, bir:Package module) { io:sprintf("(L%s;L%s;L%s;L%s;)V", STRING_VALUE, STRING_VALUE, STRING_VALUE, VALUE_CREATOR), false); - mv.visitInsn(RETURN); + // Add a nil-return + mv.visitInsn(ACONST_NULL); + mv.visitInsn(ARETURN); mv.visitMaxs(0,0); mv.visitEnd(); @@ -2387,7 +2346,7 @@ function generateExecutionStopMethod(jvm:ClassWriter cw, string initClass, bir:P bir:ModuleID currentModId = packageToModuleId(module); string fullFuncName = calculateModuleSpecialFuncName(currentModId, stopFuncName); - scheduleMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex, futureIndex); + scheduleStopMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex, futureIndex); int i = imprtMods.length() - 1; while i >= 0 { @@ -2395,7 +2354,7 @@ function generateExecutionStopMethod(jvm:ClassWriter cw, string initClass, bir:P i -= 1; fullFuncName = calculateModuleSpecialFuncName(id, stopFuncName); - scheduleMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex, futureIndex); + scheduleStopMethod(mv, initClass, cleanupFunctionName(fullFuncName), errorGen, indexMap, schedulerIndex, futureIndex); } mv.visitInsn(RETURN); @@ -2410,8 +2369,9 @@ function generateExecutionStopMethod(jvm:ClassWriter cw, string initClass, bir:P versionValue, typeOwnerClass); } -function scheduleMethod(jvm:MethodVisitor mv, string initClass, string stopFuncName, ErrorHandlerGenerator errorGen, - BalToJVMIndexMap indexMap, int schedulerIndex, int futureIndex) { +function scheduleStopMethod(jvm:MethodVisitor mv, string initClass, string stopFuncName, + ErrorHandlerGenerator errorGen, BalToJVMIndexMap indexMap, int schedulerIndex, + int futureIndex) { string lambdaFuncName = "$lambda$" + stopFuncName; // Create a schedular. A new schedular is used here, to make the stop function to not to // depend/wait on whatever is being running on the background. eg: a busy loop in the main. @@ -2422,13 +2382,14 @@ function scheduleMethod(jvm:MethodVisitor mv, string initClass, string stopFuncN mv.visitTypeInsn(ANEWARRAY, OBJECT); // create FP value - createFunctionPointer(mv, initClass, lambdaFuncName, true, 0); + createFunctionPointer(mv, initClass, lambdaFuncName, 0); // no parent strand mv.visitInsn(ACONST_NULL); - mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_CONSUMER_METHOD, - io:sprintf("([L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, FUTURE_VALUE), false); + loadType(mv, bir:TYPE_NIL); + mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, SCHEDULE_FUNCTION_METHOD, + io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); mv.visitVarInsn(ASTORE, futureIndex); diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal index d62914cf2f41..71ecbc62c883 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal @@ -164,7 +164,8 @@ type TerminatorGenerator object { } bir:BType bType = func.typeValue?.retType; if (bType is bir:BTypeNil) { - self.mv.visitInsn(RETURN); + self.mv.visitVarInsn(ALOAD, returnVarRefIndex); + self.mv.visitInsn(ARETURN); } else if (bType is bir:BTypeInt) { self.mv.visitVarInsn(LLOAD, returnVarRefIndex); self.mv.visitInsn(LRETURN); @@ -266,6 +267,7 @@ type TerminatorGenerator object { string orgName = callIns.pkgID.org; string moduleName = callIns.pkgID.name; + bir:VariableDcl? lhsOpVarDcl = callIns.lhsOp?.variableDcl; // check for native blocking call if (isInteropFuncCall(callIns)) { jvm:Label blockedOnExternLabel = new; @@ -279,12 +281,12 @@ type TerminatorGenerator object { self.mv.visitInsn(ICONST_0); self.mv.visitFieldInsn(PUTFIELD, "org/ballerinalang/jvm/scheduling/Strand", "blockedOnExtern", "Z"); - if (callIns.lhsOp?.variableDcl is bir:VariableDcl) { + if (lhsOpVarDcl is bir:VariableDcl) { self.mv.visitVarInsn(ALOAD, localVarOffset); self.mv.visitFieldInsn(GETFIELD, "org/ballerinalang/jvm/scheduling/Strand", "returnValue", "Ljava/lang/Object;"); addUnboxInsn(self.mv, callIns.lhsOp?.typeValue); // store return - self.storeReturnFromCallIns(callIns); + self.storeToVar(lhsOpVarDcl); } self.mv.visitJumpInsn(GOTO, notBlockedOnExternLabel); @@ -294,7 +296,7 @@ type TerminatorGenerator object { self.genCall(callIns, orgName, moduleName, localVarOffset); // store return - self.storeReturnFromCallIns(callIns); + self.storeReturnFromCallIns(lhsOpVarDcl); self.mv.visitLabel(notBlockedOnExternLabel); } else { @@ -302,7 +304,7 @@ type TerminatorGenerator object { self.genCall(callIns, orgName, moduleName, localVarOffset); // store return - self.storeReturnFromCallIns(callIns); + self.storeReturnFromCallIns(lhsOpVarDcl); } } @@ -384,11 +386,11 @@ type TerminatorGenerator object { panic err; } - private function storeReturnFromCallIns(bir:Call callIns) { - bir:VariableDcl? lhsOpVarDcl = callIns.lhsOp?.variableDcl; - + private function storeReturnFromCallIns(bir:VariableDcl? lhsOpVarDcl) { if (lhsOpVarDcl is bir:VariableDcl) { self.storeToVar(lhsOpVarDcl); + } else { + self.mv.visitInsn(POP); } } @@ -492,11 +494,7 @@ type TerminatorGenerator object { self.mv.visitMethodInsn(INVOKEINTERFACE, OBJECT_VALUE, "call", methodDesc, true); bir:BType? returnType = callIns.lhsOp?.typeValue; - if (returnType is ()) { - self.mv.visitInsn(POP); - } else { - addUnboxInsn(self.mv, returnType); - } + addUnboxInsn(self.mv, returnType); } function loadBooleanArgToIndicateUserProvidedArg(string orgName, string moduleName, boolean userProvided) { @@ -568,8 +566,8 @@ type TerminatorGenerator object { if (futureType is bir:BFutureType) { returnType = futureType.returnType; } - boolean isVoid = returnType is bir:BTypeNil; - createFunctionPointer(self.mv, currentClass, lambdaName, isVoid, 0); + + createFunctionPointer(self.mv, currentClass, lambdaName, 0); lambdas[lambdaName] = callIns; lambdaIndex += 1; @@ -676,18 +674,12 @@ type TerminatorGenerator object { } // if async, we submit this to sceduler (worker scenario) - boolean isVoid = false; bir:BType returnType = fpCall.fp.typeValue; - if (returnType is bir:BInvokableType) { - isVoid = returnType?.retType is bir:BTypeNil; - } if (fpCall.isAsync) { // load function ref now self.loadVar(fpCall.fp.variableDcl); self.submitToScheduler(fpCall.lhsOp, localVarOffset); - } else if (isVoid) { - self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "accept", io:sprintf("(L%s;)V", OBJECT), false); } else { self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "apply", io:sprintf("(L%s;)L%s;", OBJECT, OBJECT), false); // store reult @@ -699,6 +691,8 @@ type TerminatorGenerator object { bir:VariableDcl? lhsVar = fpCall.lhsOp?.variableDcl; if (lhsVar is bir:VariableDcl) { self.storeToVar(lhsVar); + } else { + self.mv.visitInsn(POP); } } } @@ -779,22 +773,16 @@ type TerminatorGenerator object { function submitToScheduler(bir:VarRef? lhsOp, int localVarOffset) { bir:BType? futureType = lhsOp?.typeValue; - boolean isVoid = false; bir:BType returnType = "any"; if (futureType is bir:BFutureType) { - isVoid = futureType.returnType is bir:BTypeNil; returnType = futureType.returnType; } + // load strand self.mv.visitVarInsn(ALOAD, localVarOffset); - if (isVoid) { - self.mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, "scheduleConsumer", - io:sprintf("([L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, FUTURE_VALUE), false); - } else { - loadType(self.mv, returnType); - self.mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, "scheduleFunction", + loadType(self.mv, returnType); + self.mv.visitMethodInsn(INVOKEVIRTUAL, SCHEDULER, "scheduleFunction", io:sprintf("([L%s;L%s;L%s;L%s;)L%s;", OBJECT, FUNCTION_POINTER, STRAND, BTYPE, FUTURE_VALUE), false); - } // store return if (lhsOp is bir:VarRef) { diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal index b662a2b5f4b8..446e2ea4e237 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_value_gen.bal @@ -390,7 +390,9 @@ public type ObjectGenerator object { initFuncName = cleanupFunctionName(recordType.name.value + "__init_"); } - mv.visitMethodInsn(INVOKESTATIC, valueClassName, initFuncName, io:sprintf("(L%s;L%s;)V", STRAND, MAP_VALUE), false); + mv.visitMethodInsn(INVOKESTATIC, valueClassName, initFuncName, + io:sprintf("(L%s;L%s;)L%s;", STRAND, MAP_VALUE, OBJECT), false); + mv.visitInsn(POP); mv.visitInsn(RETURN); mv.visitMaxs(0, 0); mv.visitEnd(); diff --git a/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java b/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java index a186c9d6bf7a..54faa26fc07c 100644 --- a/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java +++ b/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java @@ -47,7 +47,7 @@ public static void forEach(Strand strand, ArrayValue arr, FPValue m, FPValue func) { - m.forEach((key, value) -> func.accept(new Object[]{strand, value, true})); + m.forEach((key, value) -> func.apply(new Object[]{strand, value, true})); } } diff --git a/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java b/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java index 953bd25255c9..aae2dfedf1e7 100644 --- a/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java +++ b/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java @@ -43,14 +43,14 @@ public class ForEach { public static void forEach(Strand strand, XMLValue x, FPValue func) { if (x.isSingleton()) { - func.accept(new Object[]{strand, x, true}); + func.apply(new Object[]{strand, x, true}); return; } IteratorValue iterator = ((XMLSequence) x).getIterator(); while (iterator.hasNext()) { Object xmlOrStringVal = iterator.next(); - func.accept(new Object[]{strand, xmlOrStringVal, true}); + func.apply(new Object[]{strand, xmlOrStringVal, true}); } } } diff --git a/stdlib/jvm-old/src/main/ballerina/src/jvm/types.bal b/stdlib/jvm-old/src/main/ballerina/src/jvm/types.bal index 39fbfd539c46..868e4db508f3 100644 --- a/stdlib/jvm-old/src/main/ballerina/src/jvm/types.bal +++ b/stdlib/jvm-old/src/main/ballerina/src/jvm/types.bal @@ -66,8 +66,7 @@ public type MethodVisitor object { public function visitLookupSwitchInsn(Label defaultLabel, int[] keys, Label[] labels) = external; - public function visitInvokeDynamicInsn(string className, string lambdaName, boolean isVoid, - int closureMapCount) = external; + public function visitInvokeDynamicInsn(string className, string lambdaName, int closureMapCount) = external; public function visitTryCatchBlock(Label startLabel, Label endLabel, Label handlerLabel, string? exceptionType) = external; diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java index 6133fe1011ee..3f5efbda9292 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java @@ -28,7 +28,6 @@ import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; -import static org.ballerinalang.model.types.TypeKind.BOOLEAN; import static org.ballerinalang.model.types.TypeKind.INT; import static org.ballerinalang.model.types.TypeKind.OBJECT; import static org.ballerinalang.model.types.TypeKind.STRING; @@ -52,18 +51,16 @@ args = { @Argument(name = "className", type = STRING), @Argument(name = "lambdaName", type = STRING), - @Argument(name = "isVoid", type = BOOLEAN), @Argument(name = "closureMapCount", type = INT) } ) public class VisitInvokeDynamicInsn { public static void visitInvokeDynamicInsn(Strand strand, ObjectValue oMv, String className, String lambdaName, - boolean isVoid, long mapsCount) { + long mapsCount) { String mapDesc = getMapsDesc(mapsCount); - //Function - create a dynamic lambda invocation with object[] param and returns object MethodVisitor mv = ASMUtil.getRefArgumentNativeData(oMv); Handle handle = new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", @@ -71,14 +68,6 @@ public static void visitInvokeDynamicInsn(Strand strand, ObjectValue oMv, String + STRING_DESC + METHOD_TYPE_DESC + METHOD_TYPE_DESC + "Ljava/lang/invoke/MethodHandle;" + METHOD_TYPE_DESC + ")Ljava/lang/invoke/CallSite;", false); - if (isVoid) { - mv.visitInvokeDynamicInsn("accept", "(" + mapDesc + ")Ljava/util/function/Consumer;", handle, - new Object[]{Type.getType("(" + OBJECT_DESC + ")V"), - new Handle(Opcodes.H_INVOKESTATIC, className, lambdaName, - "(" + mapDesc + "[" + OBJECT_DESC + ")V", false), - Type.getType("([" + OBJECT_DESC + ")V")}); - return; - } mv.visitInvokeDynamicInsn("apply", "(" + mapDesc + ")" + FUNCTION_DESC, handle, new Object[]{Type.getType("(" + OBJECT_DESC + ")" + OBJECT_DESC), diff --git a/stdlib/jvm/src/main/ballerina/src/jvm/types.bal b/stdlib/jvm/src/main/ballerina/src/jvm/types.bal index 39fbfd539c46..868e4db508f3 100644 --- a/stdlib/jvm/src/main/ballerina/src/jvm/types.bal +++ b/stdlib/jvm/src/main/ballerina/src/jvm/types.bal @@ -66,8 +66,7 @@ public type MethodVisitor object { public function visitLookupSwitchInsn(Label defaultLabel, int[] keys, Label[] labels) = external; - public function visitInvokeDynamicInsn(string className, string lambdaName, boolean isVoid, - int closureMapCount) = external; + public function visitInvokeDynamicInsn(string className, string lambdaName, int closureMapCount) = external; public function visitTryCatchBlock(Label startLabel, Label endLabel, Label handlerLabel, string? exceptionType) = external; diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java index 6133fe1011ee..d28abcff513c 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/methodvisitor/VisitInvokeDynamicInsn.java @@ -28,7 +28,6 @@ import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; -import static org.ballerinalang.model.types.TypeKind.BOOLEAN; import static org.ballerinalang.model.types.TypeKind.INT; import static org.ballerinalang.model.types.TypeKind.OBJECT; import static org.ballerinalang.model.types.TypeKind.STRING; @@ -52,18 +51,16 @@ args = { @Argument(name = "className", type = STRING), @Argument(name = "lambdaName", type = STRING), - @Argument(name = "isVoid", type = BOOLEAN), @Argument(name = "closureMapCount", type = INT) } ) public class VisitInvokeDynamicInsn { public static void visitInvokeDynamicInsn(Strand strand, ObjectValue oMv, String className, String lambdaName, - boolean isVoid, long mapsCount) { + long mapsCount) { String mapDesc = getMapsDesc(mapsCount); - //Function - create a dynamic lambda invocation with object[] param and returns object MethodVisitor mv = ASMUtil.getRefArgumentNativeData(oMv); Handle handle = new Handle(Opcodes.H_INVOKESTATIC, "java/lang/invoke/LambdaMetafactory", @@ -71,15 +68,6 @@ public static void visitInvokeDynamicInsn(Strand strand, ObjectValue oMv, String + STRING_DESC + METHOD_TYPE_DESC + METHOD_TYPE_DESC + "Ljava/lang/invoke/MethodHandle;" + METHOD_TYPE_DESC + ")Ljava/lang/invoke/CallSite;", false); - if (isVoid) { - mv.visitInvokeDynamicInsn("accept", "(" + mapDesc + ")Ljava/util/function/Consumer;", handle, - new Object[]{Type.getType("(" + OBJECT_DESC + ")V"), - new Handle(Opcodes.H_INVOKESTATIC, className, lambdaName, - "(" + mapDesc + "[" + OBJECT_DESC + ")V", false), - Type.getType("([" + OBJECT_DESC + ")V")}); - return; - } - mv.visitInvokeDynamicInsn("apply", "(" + mapDesc + ")" + FUNCTION_DESC, handle, new Object[]{Type.getType("(" + OBJECT_DESC + ")" + OBJECT_DESC), new Handle(Opcodes.H_INVOKESTATIC, className, lambdaName, From 7300c272c71cdeb345c07938d45aef054b0201aa Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Fri, 25 Oct 2019 14:32:28 +0530 Subject: [PATCH 065/167] Remove consumer from the FPValue and the scheduler --- .../org/ballerinalang/jvm/AnnotationUtils.java | 4 ++-- .../jvm/scheduling/Scheduler.java | 16 +++++++--------- .../jvm/streams/DefaultStreamSubscription.java | 2 +- .../org/ballerinalang/jvm/values/FPValue.java | 18 ++++++++++++++---- .../ballerinalang/jvm/values/TableValue.java | 2 +- .../jvm_terminator_gen.bal | 2 +- .../jvm_terminator_gen.bal | 2 +- .../ballerinalang/langlib/array/ForEach.java | 2 +- .../org/ballerinalang/langlib/map/ForEach.java | 2 +- .../org/ballerinalang/langlib/xml/ForEach.java | 4 ++-- 10 files changed, 31 insertions(+), 23 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/AnnotationUtils.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/AnnotationUtils.java index 9b7bb39d7a8e..f32c4f3f56f9 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/AnnotationUtils.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/AnnotationUtils.java @@ -66,7 +66,7 @@ public static void processServiceAnnotations(MapValue globalAnnotMap, BServiceTy String annotationKey = bType.getAnnotationKey(); if (globalAnnotMap.containsKey(annotationKey)) { bType.setAnnotations((MapValue) - ((FPValue) globalAnnotMap.get(annotationKey)).apply(new Object[]{strand})); + ((FPValue) globalAnnotMap.get(annotationKey)).call(new Object[]{strand})); } for (AttachedFunction attachedFunction : bType.getAttachedFunctions()) { @@ -74,7 +74,7 @@ public static void processServiceAnnotations(MapValue globalAnnotMap, BServiceTy if (globalAnnotMap.containsKey(annotationKey)) { attachedFunction.setAnnotations((MapValue) ((FPValue) globalAnnotMap.get(annotationKey)) - .apply(new Object[]{strand})); + .call(new Object[]{strand})); } } } diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java index 44963e363aa2..fb3543549842 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/scheduling/Scheduler.java @@ -107,7 +107,7 @@ public FutureValue scheduleFunction(Object[] params, FPValue fp, Strand pa @Deprecated public FutureValue scheduleConsumer(Object[] params, FPValue fp, Strand parent) { - return schedule(params, fp.getConsumer(), parent, null); + return schedule(params, fp.getFunction(), parent, (CallableUnitCallback) null); } /** @@ -396,7 +396,6 @@ public void poison() { */ class SchedulerItem { private Function function; - private Consumer consumer; private Object[] params; final FutureValue future; boolean parked; @@ -409,9 +408,13 @@ public SchedulerItem(Function function, Object[] params, FutureValue future) { this.params = params; } + @Deprecated public SchedulerItem(Consumer consumer, Object[] params, FutureValue future) { this.future = future; - this.consumer = consumer; + this.function = val -> { + consumer.accept(val); + return null; + }; this.params = params; } @@ -420,12 +423,7 @@ private SchedulerItem() { } public Object execute() { - if (this.consumer != null) { - this.consumer.accept(this.params); - return null; - } else { - return this.function.apply(this.params); - } + return this.function.apply(this.params); } public boolean isYielded() { diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java index 9b19a7c3ec93..cb2343e5c6f9 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/streams/DefaultStreamSubscription.java @@ -40,7 +40,7 @@ public class DefaultStreamSubscription extends StreamSubscription { public void execute(Object[] fpParams) { //Cannot use scheduler, as the order of events should be preserved - functionPointer.apply(fpParams); + functionPointer.call(fpParams); } public StreamValue getStream() { diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/FPValue.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/FPValue.java index d48625f4f21c..b66a67cf8efe 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/FPValue.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/FPValue.java @@ -42,32 +42,42 @@ public class FPValue implements RefValue { final BType type; Function function; - Consumer consumer; public FPValue(Function function, BType type) { this.function = function; this.type = type; } + public R call(T t) { + return this.function.apply(t); + } + + @Deprecated public FPValue(Consumer consumer, BType type) { - this.consumer = consumer; + this.function = val -> { + consumer.accept(val); + return null; + }; this.type = type; } + @Deprecated public R apply(T t) { return this.function.apply(t); } + @Deprecated public void accept(T t) { - this.consumer.accept(t); + this.function.apply(t); } public Function getFunction() { return this.function; } + @Deprecated public Consumer getConsumer() { - return this.consumer; + return val -> this.function.apply(val); } @Override diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/TableValue.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/TableValue.java index 765fd2c2be2f..9d2ef142c7c3 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/TableValue.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/values/TableValue.java @@ -245,7 +245,7 @@ public Object performRemoveOperation(Strand strand, FPValue fun int deletedCount = 0; while (this.hasNext()) { MapValueImpl row = this.getNext(); - if (func.apply(new Object[] { strand, row, true })) { + if (func.call(new Object[] { strand, row, true })) { tableProvider.deleteData(this.tableName, row); ++deletedCount; } diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal index fb5941151d4c..4b2991051ff6 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal @@ -688,7 +688,7 @@ type TerminatorGenerator object { self.loadVar(fpCall.fp.variableDcl); self.submitToScheduler(fpCall.lhsOp, localVarOffset); } else { - self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "apply", io:sprintf("(L%s;)L%s;", OBJECT, OBJECT), false); + self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "call", io:sprintf("(L%s;)L%s;", OBJECT, OBJECT), false); // store reult bir:BType? lhsType = fpCall.lhsOp?.typeValue; if (lhsType is bir:BType) { diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal index 71ecbc62c883..14a091154e87 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_terminator_gen.bal @@ -681,7 +681,7 @@ type TerminatorGenerator object { self.loadVar(fpCall.fp.variableDcl); self.submitToScheduler(fpCall.lhsOp, localVarOffset); } else { - self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "apply", io:sprintf("(L%s;)L%s;", OBJECT, OBJECT), false); + self.mv.visitMethodInsn(INVOKEVIRTUAL, FUNCTION_POINTER, "call", io:sprintf("(L%s;)L%s;", OBJECT, OBJECT), false); // store reult bir:BType? lhsType = fpCall.lhsOp?.typeValue; if (lhsType is bir:BType) { diff --git a/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java b/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java index 54faa26fc07c..22ea3dfd02de 100644 --- a/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java +++ b/langlib/lang.array/src/main/java/org/ballerinalang/langlib/array/ForEach.java @@ -47,7 +47,7 @@ public static void forEach(Strand strand, ArrayValue arr, FPValue m, FPValue func) { - m.forEach((key, value) -> func.apply(new Object[]{strand, value, true})); + m.forEach((key, value) -> func.call(new Object[]{strand, value, true})); } } diff --git a/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java b/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java index aae2dfedf1e7..029dbb0cd002 100644 --- a/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java +++ b/langlib/lang.xml/src/main/java/org/ballerinalang/langlib/xml/ForEach.java @@ -43,14 +43,14 @@ public class ForEach { public static void forEach(Strand strand, XMLValue x, FPValue func) { if (x.isSingleton()) { - func.apply(new Object[]{strand, x, true}); + func.call(new Object[]{strand, x, true}); return; } IteratorValue iterator = ((XMLSequence) x).getIterator(); while (iterator.hasNext()) { Object xmlOrStringVal = iterator.next(); - func.apply(new Object[]{strand, xmlOrStringVal, true}); + func.call(new Object[]{strand, xmlOrStringVal, true}); } } } From 2e8ec297f108d68b4dcf9088243470798a8d691c Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Fri, 25 Oct 2019 14:50:16 +0530 Subject: [PATCH 066/167] Add test cases --- .../expressions/lambda/FunctionPointersTest.java | 6 ++++++ .../expressions/lambda/function-pointers.bal | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/lambda/FunctionPointersTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/lambda/FunctionPointersTest.java index 767a76228751..a039ae50af87 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/lambda/FunctionPointersTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/expressions/lambda/FunctionPointersTest.java @@ -277,4 +277,10 @@ public void testSubTypingWithAny() { BValue[] returns = BRunUtil.invoke(fpProgram, "testSubTypingWithAny"); Assert.assertEquals(returns[0].stringValue(), "12"); } + + @Test(description = "Test passing a no-return function pointer as a nil-returning function pointer") + public void testVoidFunctionAsUnionReturnFunction() { + BValue[] returns = BRunUtil.invoke(fpProgram, "testVoidFunctionAsUnionReturnFunction"); + Assert.assertEquals(returns[0].stringValue(), "value - updated through lambda"); + } } diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/expressions/lambda/function-pointers.bal b/tests/jballerina-unit-test/src/test/resources/test-src/expressions/lambda/function-pointers.bal index 9f68f0c424aa..7097cecd24c0 100644 --- a/tests/jballerina-unit-test/src/test/resources/test-src/expressions/lambda/function-pointers.bal +++ b/tests/jballerina-unit-test/src/test/resources/test-src/expressions/lambda/function-pointers.bal @@ -159,3 +159,16 @@ function testSubTypingWithAny() returns any { any s = ff(); return s; } + +public function testVoidFunctionAsUnionReturnFunction() returns string { + string s = "value"; + xyz(function () { + s += " - updated through lambda"; + }); + + return s; +} + +function xyz(function() returns any|error func) { + var result = func(); +} From ea60a3c5e7e15e8989370c3295e32ec46bcebf90 Mon Sep 17 00:00:00 2001 From: Nipuna Ranasinghe Date: Fri, 25 Oct 2019 14:52:29 +0530 Subject: [PATCH 067/167] Fix auto completion for double quotes --- .../BallerinaQuotesInsertHandler.java | 76 +++++++++++++++++++ .../src/main/resources/META-INF/plugin.xml | 5 +- 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaQuotesInsertHandler.java diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaQuotesInsertHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaQuotesInsertHandler.java new file mode 100644 index 000000000000..8c8b5b93dda1 --- /dev/null +++ b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaQuotesInsertHandler.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.ballerina.plugins.idea.editor.inserthandlers; + +import com.intellij.codeInsight.editorActions.TypedHandlerDelegate; +import com.intellij.openapi.editor.Editor; +import com.intellij.openapi.editor.EditorModificationUtil; +import com.intellij.openapi.fileTypes.FileType; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.util.TextRange; +import com.intellij.psi.PsiDocumentManager; +import com.intellij.psi.PsiElement; +import com.intellij.psi.PsiFile; +import io.ballerina.plugins.idea.BallerinaLanguage; +import io.ballerina.plugins.idea.psi.BallerinaTypes; +import org.jetbrains.annotations.NotNull; + +/** + * Handles auto completion for the closing quotes. + */ +public class BallerinaQuotesInsertHandler extends TypedHandlerDelegate { + + @NotNull + @Override + public Result beforeCharTyped(char c, @NotNull Project project, @NotNull Editor editor, @NotNull PsiFile file, + @NotNull FileType fileType) { + + if (c != '\"' || !file.getLanguage().is(BallerinaLanguage.INSTANCE)) { + return Result.CONTINUE; + } + + // We need to save the file before checking. Otherwise issues can occur when we press enter in a string. + PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); + + // Checks whether the cursor is already placed inside a ballerina string. + int caretOff = editor.getCaretModel().getOffset(); + if (!isInStringLiteral(file, caretOff)) { + // If the cursor is already placed inside a string, auto closing shouldn't be triggered. + char prevChar = editor.getDocument().getText(new TextRange(caretOff - 1, caretOff)).charAt(0); + char nextChar = editor.getDocument().getText(new TextRange(caretOff, caretOff + 1)).charAt(0); + + if (c == prevChar && c == nextChar) { + EditorModificationUtil.moveCaretRelatively(editor, 1); + return Result.STOP; + } else { + return Result.CONTINUE; + } + } else { + // Adds the closing quotes and places the cursor in-between the quotes. + EditorModificationUtil.insertStringAtCaret(editor, "\"", false, 0); + PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); + return Result.CONTINUE; + } + } + + private boolean isInStringLiteral(PsiFile file, int offset) { + PsiElement element = file.findElementAt(offset); + if (element == null) { + return false; + } + return element.getNode().getElementType() == BallerinaTypes.QUOTED_STRING_LITERAL; + } +} diff --git a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml index 46cc8201284a..a01d5878e2d2 100644 --- a/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml +++ b/tool-plugins/intellij/src/main/resources/META-INF/plugin.xml @@ -111,8 +111,9 @@ - + + Date: Fri, 25 Oct 2019 14:55:49 +0530 Subject: [PATCH 068/167] Update comments --- .../editor/inserthandlers/BallerinaEnterInStringHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java index 975a9b6eb1d1..8f24d8fa8e0d 100644 --- a/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java +++ b/tool-plugins/intellij/src/main/java/io/ballerina/plugins/idea/editor/inserthandlers/BallerinaEnterInStringHandler.java @@ -67,6 +67,8 @@ public Result preprocessEnter(@NotNull PsiFile file, @NotNull Editor editor, @No int lineEndOffset = doc.getLineEndOffset(editor.getCaretModel().getLogicalPosition().line); // Adds the missing double quotes and + operator to the splitted text. + // Note - Don't replace the "\n" with the "System.lineSeparator()" as Docuemnt.insertString() method only + // accepts the unix line separator. String lText = doc.getText(new TextRange(startOffset, caretOff)) + "\" + \n"; String rText = "\"" + doc.getText(new TextRange(caretOff, endOffset)) + doc.getText(new TextRange(endOffset, lineEndOffset)); From 36d91052c4126ae2722980b1743849318cb94bce Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Fri, 25 Oct 2019 15:03:02 +0530 Subject: [PATCH 069/167] Refactor code --- .../src/main/java/org/ballerinalang/jvm/BRuntime.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java index e7df305354ee..1a0ff0b94ef5 100644 --- a/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java +++ b/bvm/ballerina-runtime/src/main/java/org/ballerinalang/jvm/BRuntime.java @@ -19,14 +19,12 @@ import org.ballerinalang.jvm.scheduling.Scheduler; import org.ballerinalang.jvm.scheduling.State; import org.ballerinalang.jvm.scheduling.Strand; -import org.ballerinalang.jvm.types.BTypes; import org.ballerinalang.jvm.values.ErrorValue; import org.ballerinalang.jvm.values.ObjectValue; import org.ballerinalang.jvm.values.connector.CallableUnitCallback; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Semaphore; -import java.util.function.Consumer; import java.util.function.Function; /** From 16b79d66ea9d94df00014c91ad4bcd0dbbb64482 Mon Sep 17 00:00:00 2001 From: wggihan Date: Fri, 25 Oct 2019 15:16:17 +0530 Subject: [PATCH 070/167] Enable disabled test case --- .../stdlib/file/DirectoryListenerConnectorTest.java | 2 +- stdlib/file/src/test/resources/testng.xml | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java b/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java index a68139790ae3..cee38a47074c 100644 --- a/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java +++ b/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java @@ -79,7 +79,7 @@ public void cleanup() { @Test(description = "Check the valid successful use case.") public void testValidLocalFileSystemServerConnectorSyntax() { - CompileResult compileResult = BCompileUtil.compile(testResourceRoot.resolve("file-system.bal").toString()); + CompileResult compileResult = BCompileUtil.compile(true, testResourceRoot.resolve("file-system.bal").toString()); try { final Path file = Files.createFile(Paths.get("src", "test", "resources", "fs", "temp.txt")); Awaitility.await().atMost(1, MINUTES).until(() -> { diff --git a/stdlib/file/src/test/resources/testng.xml b/stdlib/file/src/test/resources/testng.xml index abbeef5d9e60..14bc4c97582d 100644 --- a/stdlib/file/src/test/resources/testng.xml +++ b/stdlib/file/src/test/resources/testng.xml @@ -25,11 +25,7 @@ - - - - - + From 2001f71495cc4823b13a4925afdefafe996ba608 Mon Sep 17 00:00:00 2001 From: wggihan Date: Fri, 25 Oct 2019 15:31:12 +0530 Subject: [PATCH 071/167] Enable disabled test case --- .../stdlib/file/DirectoryListenerConnectorTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java b/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java index cee38a47074c..bceebe855520 100644 --- a/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java +++ b/stdlib/file/src/test/java/org/ballerinalang/stdlib/file/DirectoryListenerConnectorTest.java @@ -79,7 +79,8 @@ public void cleanup() { @Test(description = "Check the valid successful use case.") public void testValidLocalFileSystemServerConnectorSyntax() { - CompileResult compileResult = BCompileUtil.compile(true, testResourceRoot.resolve("file-system.bal").toString()); + CompileResult compileResult = BCompileUtil + .compile(true, testResourceRoot.resolve("file-system.bal").toString()); try { final Path file = Files.createFile(Paths.get("src", "test", "resources", "fs", "temp.txt")); Awaitility.await().atMost(1, MINUTES).until(() -> { From df169ff5caf8cb0c63bf3e9ab8b8a077ac810335 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Fri, 25 Oct 2019 15:32:25 +0530 Subject: [PATCH 072/167] Add tests --- .../langlib/test/LangLibTypedescTest.java | 6 ++++++ .../resources/test-src/typedesclib_test.bal | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/langlib/langlib-test/src/test/java/org/ballerinalang/langlib/test/LangLibTypedescTest.java b/langlib/langlib-test/src/test/java/org/ballerinalang/langlib/test/LangLibTypedescTest.java index f23dc18355d1..4310b56c026d 100644 --- a/langlib/langlib-test/src/test/java/org/ballerinalang/langlib/test/LangLibTypedescTest.java +++ b/langlib/langlib-test/src/test/java/org/ballerinalang/langlib/test/LangLibTypedescTest.java @@ -74,6 +74,12 @@ public void testAmbiguousTargetType() { Assert.assertTrue(((BBoolean) returns[0]).booleanValue()); } + @Test + public void testConvertingToUnionConstrainedType() { + BValue[] returns = BRunUtil.invokeFunction(compileResult, "testConvertingToUnionConstrainedType"); + Assert.assertTrue(((BBoolean) returns[0]).booleanValue()); + } + @Test public void testConstructFromForNil() { BValue[] returns = BRunUtil.invokeFunction(compileResult, "testConstructFromForNilPositive"); diff --git a/langlib/langlib-test/src/test/resources/test-src/typedesclib_test.bal b/langlib/langlib-test/src/test/resources/test-src/typedesclib_test.bal index 53037ef3f4e9..ab0505b51a6e 100644 --- a/langlib/langlib-test/src/test/resources/test-src/typedesclib_test.bal +++ b/langlib/langlib-test/src/test/resources/test-src/typedesclib_test.bal @@ -178,3 +178,21 @@ function testSettingRecordDefaultValuesOnConversion() returns boolean { A|error d = A.constructFrom(c); return d is A && d.i == 4 && d.s == "test" && d.b.p == "hello" && d.b.q == "world" && d.f == 34.0; } + +type D record { + int i; +}; + +type E record { + string s; +}; + +type F record { + float f; +}; + +function testConvertingToUnionConstrainedType() returns boolean { + map f = {x:{i:1}}; + json j = json.constructFrom(f); + return map.constructFrom(j) == f; +} From d3fd3085dba85eba0798ab467066f6e4e339e985 Mon Sep 17 00:00:00 2001 From: chamil321 Date: Fri, 25 Oct 2019 15:44:53 +0530 Subject: [PATCH 073/167] Address review requests --- stdlib/websub/src/main/ballerina/src/websub/errors.bal | 6 ++---- .../ballerina/src/websub/subscriber_service_endpoint.bal | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/errors.bal b/stdlib/websub/src/main/ballerina/src/websub/errors.bal index 9823e06382f5..69ab42fcd2fa 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/errors.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/errors.bal @@ -23,9 +23,7 @@ public type Detail record { error cause?; }; -// Ballerina WebSub Listener Error Types - -# Represents the reason string for the `websub:ListenerStartupError` +# Represents the reason string for the `websub:ListenerStartupError`. public const LISTENER_STARTUP_ERROR = "{ballerina/websub}ListenerStartupError"; -# Represents a listener startup error +# Represents a listener startup error. public type ListenerStartupError error; diff --git a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal index 722b1709c9fe..dc5cf6b5dcec 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal @@ -46,10 +46,7 @@ public type Listener object { } public function __start() returns error? { - var err = self.startWebSubSubscriberServiceEndpoint(); - if (err is error) { - return err; - } + check self.startWebSubSubscriberServiceEndpoint(); // TODO: handle data and return error on error self.sendSubscriptionRequests(); } @@ -158,7 +155,7 @@ public type Listener object { # Start the registered WebSub Subscriber service. # # + return - An `error` if there is any error occurred during the listener start process - function startWebSubSubscriberServiceEndpoint() returns error?= external; + function startWebSubSubscriberServiceEndpoint() returns error? = external; # Sets the topic to which this service is subscribing, for auto intent verification. # From 0573af7eb7ab4295520e2e25be0026c769c0b8ed Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Fri, 25 Oct 2019 10:37:05 +0000 Subject: [PATCH 074/167] [Gradle Release Plugin] - new version commit: 'v1.0.3-SNAPSHOT'. --- composer/lerna.json | 2 +- composer/package-lock.json | 532 +---------------- composer/package.json | 2 +- .../packages/api-designer/package-lock.json | 2 +- composer/packages/api-designer/package.json | 4 +- composer/packages/ast-model/package-lock.json | 2 +- composer/packages/ast-model/package.json | 6 +- composer/packages/bbe/package-lock.json | 2 +- composer/packages/bbe/package.json | 4 +- composer/packages/diagram/package-lock.json | 2 +- composer/packages/diagram/package.json | 12 +- composer/packages/distribution/package.json | 18 +- .../packages/documentation/package-lock.json | 2 +- composer/packages/documentation/package.json | 4 +- composer/packages/font/package-lock.json | 2 +- composer/packages/font/package.json | 4 +- .../packages/lang-service/package-lock.json | 2 +- composer/packages/lang-service/package.json | 4 +- .../syntax-highlighter/package-lock.json | 539 +----------------- .../packages/syntax-highlighter/package.json | 2 +- composer/packages/theme/package-lock.json | 2 +- composer/packages/theme/package.json | 4 +- composer/packages/tracing/package-lock.json | 2 +- composer/packages/tracing/package.json | 4 +- composer/tools/composer-cli/package-lock.json | 2 +- composer/tools/composer-cli/package.json | 2 +- gradle.properties | 2 +- tool-plugins/vscode/grammar/ballerina-grammar | 2 +- tool-plugins/vscode/package-lock.json | 2 +- tool-plugins/vscode/package.json | 2 +- 30 files changed, 52 insertions(+), 1119 deletions(-) diff --git a/composer/lerna.json b/composer/lerna.json index bee3d043885f..835f96e25f78 100644 --- a/composer/lerna.json +++ b/composer/lerna.json @@ -3,5 +3,5 @@ "packages/*", "tools/*" ], - "version": "1.0.2-SNAPSHOT" + "version": "1.0.2" } diff --git a/composer/package-lock.json b/composer/package-lock.json index 08c807ca17d9..129402420874 100644 --- a/composer/package-lock.json +++ b/composer/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/composer", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -7587,7 +7587,6 @@ "anymatch": "2.0.0", "async-each": "1.0.2", "braces": "2.3.2", - "fsevents": "1.2.9", "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -11370,535 +11369,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.13.2", - "node-pre-gyp": "0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "4.1.1", - "iconv-lite": "0.4.24", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.3.0", - "nopt": "4.0.1", - "npm-packlist": "1.4.1", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.3", - "semver": "5.7.0", - "tar": "4.4.8" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.6" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } - } - }, "fstream": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", diff --git a/composer/package.json b/composer/package.json index 233d02be3535..64e163779cfb 100644 --- a/composer/package.json +++ b/composer/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@ballerina/composer", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "scripts": { "prebuild": "npm i && lerna bootstrap", diff --git a/composer/packages/api-designer/package-lock.json b/composer/packages/api-designer/package-lock.json index 5824fa611017..f4b4e66bee0d 100644 --- a/composer/packages/api-designer/package-lock.json +++ b/composer/packages/api-designer/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/api-designer", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/api-designer/package.json b/composer/packages/api-designer/package.json index 5a3d3fa9e0ce..4bb4f248f276 100644 --- a/composer/packages/api-designer/package.json +++ b/composer/packages/api-designer/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/api-designer", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "lib/index.js", "scripts": { @@ -18,7 +18,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "copyfiles": "^2.1.0" }, "dependencies": { diff --git a/composer/packages/ast-model/package-lock.json b/composer/packages/ast-model/package-lock.json index b8927044ea2a..9386091e6660 100644 --- a/composer/packages/ast-model/package-lock.json +++ b/composer/packages/ast-model/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ast-model", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/ast-model/package.json b/composer/packages/ast-model/package.json index 1bf4b3bb11c5..72356b306aae 100644 --- a/composer/packages/ast-model/package.json +++ b/composer/packages/ast-model/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ast-model", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "ast-model", "license": "Apache-2.0", "files": [ @@ -23,7 +23,7 @@ "gen-default-nodes": "npm run build && node lib/tools/gen-default-nodes" }, "dependencies": { - "@ballerina/lang-service": "^1.0.2-SNAPSHOT", + "@ballerina/lang-service": "^1.0.2", "glob": "^7.1.3", "lodash": "^4.17.11", "prettier": "^1.5.2", @@ -31,7 +31,7 @@ "vscode-uri": "^1.0.6" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/lodash": "^4.14.117", "copyfiles": "^2.1.0" }, diff --git a/composer/packages/bbe/package-lock.json b/composer/packages/bbe/package-lock.json index 4a9af408a3bf..d6156f05b178 100644 --- a/composer/packages/bbe/package-lock.json +++ b/composer/packages/bbe/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ballerina-by-examples", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/bbe/package.json b/composer/packages/bbe/package.json index 7742a24bfea2..73f7fbf73195 100644 --- a/composer/packages/bbe/package.json +++ b/composer/packages/bbe/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/ballerina-by-examples", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Provides components for displaying Ballerina By Examples", "main": "lib/src/index.js", "scripts": { @@ -19,7 +19,7 @@ "lodash": "^4.17.11" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/lodash": "^4.14.118" }, "author": "ballerina.io", diff --git a/composer/packages/diagram/package-lock.json b/composer/packages/diagram/package-lock.json index 40e1319055fe..fb338de427ea 100644 --- a/composer/packages/diagram/package-lock.json +++ b/composer/packages/diagram/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/diagram", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/diagram/package.json b/composer/packages/diagram/package.json index 45c43d659c00..03b013b25c02 100644 --- a/composer/packages/diagram/package.json +++ b/composer/packages/diagram/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/diagram", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Provides a set of react components to draw Ballerina Diagrams.", "keywords": [ "ballerina", @@ -31,16 +31,16 @@ "react-dom": "^16.2.0" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", - "@ballerina/font": "^1.0.2-SNAPSHOT", - "@ballerina/theme": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", + "@ballerina/font": "^1.0.2", + "@ballerina/theme": "^1.0.2", "@types/lodash": "^4.14.118", "@types/lodash.debounce": "^4.0.4", "copyfiles": "^2.1.0" }, "dependencies": { - "@ballerina/ast-model": "^1.0.2-SNAPSHOT", - "@ballerina/lang-service": "^1.0.2-SNAPSHOT", + "@ballerina/ast-model": "^1.0.2", + "@ballerina/lang-service": "^1.0.2", "lodash": "^4.17.11", "lodash.debounce": "^4.0.8", "log4javascript": "^1.4.15", diff --git a/composer/packages/distribution/package.json b/composer/packages/distribution/package.json index 51c53b0bc100..8c0ee1ae678d 100644 --- a/composer/packages/distribution/package.json +++ b/composer/packages/distribution/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/distribution", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "build/composer.js", "scripts": { @@ -15,15 +15,15 @@ "author": "ballerina.io", "license": "Apache-2.0", "dependencies": { - "@ballerina/api-designer": "^1.0.2-SNAPSHOT", - "@ballerina/ballerina-by-examples": "^1.0.2-SNAPSHOT", - "@ballerina/diagram": "^1.0.2-SNAPSHOT", - "@ballerina/documentation": "^1.0.2-SNAPSHOT", - "@ballerina/font": "^1.0.2-SNAPSHOT", - "@ballerina/theme": "^1.0.2-SNAPSHOT", - "@ballerina/tracing": "^1.0.2-SNAPSHOT" + "@ballerina/api-designer": "^1.0.2", + "@ballerina/ballerina-by-examples": "^1.0.2", + "@ballerina/diagram": "^1.0.2", + "@ballerina/documentation": "^1.0.2", + "@ballerina/font": "^1.0.2", + "@ballerina/theme": "^1.0.2", + "@ballerina/tracing": "^1.0.2" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT" + "@ballerina/composer-cli": "^1.0.2" } } diff --git a/composer/packages/documentation/package-lock.json b/composer/packages/documentation/package-lock.json index aa320c7c34d3..53fae5bbd0ae 100644 --- a/composer/packages/documentation/package-lock.json +++ b/composer/packages/documentation/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/documentation", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/documentation/package.json b/composer/packages/documentation/package.json index 0eed7735acc5..8d024d797b8c 100644 --- a/composer/packages/documentation/package.json +++ b/composer/packages/documentation/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/documentation", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "lib/index.js", "scripts": { @@ -10,7 +10,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "dependencies": { - "@ballerina/ast-model": "^1.0.2-SNAPSHOT", + "@ballerina/ast-model": "^1.0.2", "diff": "^3.5.0", "escape-html": "^1.0.3", "react-markdown": "^4.0.0" diff --git a/composer/packages/font/package-lock.json b/composer/packages/font/package-lock.json index dbadd8854517..28a388a8a03d 100644 --- a/composer/packages/font/package-lock.json +++ b/composer/packages/font/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/font", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/font/package.json b/composer/packages/font/package.json index 7c5dc4308fe6..f358ede3db5d 100644 --- a/composer/packages/font/package.json +++ b/composer/packages/font/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/font", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Ballerina Diagram Font", "main": "build/index.js", "scripts": { @@ -12,7 +12,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "watch": "^1.0.2", "webfont": "^8.1.4" } diff --git a/composer/packages/lang-service/package-lock.json b/composer/packages/lang-service/package-lock.json index 4104df42ec1e..2d2d706105ec 100644 --- a/composer/packages/lang-service/package-lock.json +++ b/composer/packages/lang-service/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/lang-service", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/lang-service/package.json b/composer/packages/lang-service/package.json index a55199b1b86f..7db915786be9 100644 --- a/composer/packages/lang-service/package.json +++ b/composer/packages/lang-service/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/lang-service", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "lang-service", "license": "Apache-2.0", "files": [ @@ -31,7 +31,7 @@ "ws": "^6.1.0" }, "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/fs-extra": "^5.0.4", "@types/glob": "^7.1.1", "@types/jest": "^22.0.1", diff --git a/composer/packages/syntax-highlighter/package-lock.json b/composer/packages/syntax-highlighter/package-lock.json index 6ffbda0bf3d5..baf8a362c6c3 100644 --- a/composer/packages/syntax-highlighter/package-lock.json +++ b/composer/packages/syntax-highlighter/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/syntax-highlighter", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -908,7 +908,6 @@ "anymatch": "2.0.0", "async-each": "1.0.3", "braces": "2.3.2", - "fsevents": "1.2.9", "glob-parent": "3.1.0", "inherits": "2.0.4", "is-binary-path": "1.0.1", @@ -2142,535 +2141,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "2.14.0", - "node-pre-gyp": "0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "2.1.2" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "1.1.11" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "2.3.5" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "4.1.1", - "iconv-lite": "0.4.24", - "sax": "1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.3.0", - "nopt": "4.0.1", - "npm-packlist": "1.4.1", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.3", - "semver": "5.7.0", - "tar": "4.4.8" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.6" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -3804,13 +3274,6 @@ "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", "dev": true }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true, - "optional": true - }, "nanomatch": { "version": "1.2.13", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", diff --git a/composer/packages/syntax-highlighter/package.json b/composer/packages/syntax-highlighter/package.json index d243b43373ad..c1772d4fb062 100644 --- a/composer/packages/syntax-highlighter/package.json +++ b/composer/packages/syntax-highlighter/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/syntax-highlighter", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "A frontend syntax highlighter for Ballerina based on monaco.", "main": "lib/highlighter.js", "scripts": { diff --git a/composer/packages/theme/package-lock.json b/composer/packages/theme/package-lock.json index 9ec4a550f2ec..9608ac0865c7 100644 --- a/composer/packages/theme/package-lock.json +++ b/composer/packages/theme/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/theme", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/theme/package.json b/composer/packages/theme/package.json index bcf1cc2268ef..e5755c21cbd9 100644 --- a/composer/packages/theme/package.json +++ b/composer/packages/theme/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/theme", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Theme for web components of Ballerina Tooling.", "keywords": [ "ballerina", @@ -21,6 +21,6 @@ "watch": "^1.0.2" }, "dependencies": { - "@ballerina/font": "^1.0.2-SNAPSHOT" + "@ballerina/font": "^1.0.2" } } diff --git a/composer/packages/tracing/package-lock.json b/composer/packages/tracing/package-lock.json index f6dd07e72ebe..5362d35d7eaa 100644 --- a/composer/packages/tracing/package-lock.json +++ b/composer/packages/tracing/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/tracing", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/packages/tracing/package.json b/composer/packages/tracing/package.json index 8b9b069c0337..dcf5506cdeaf 100644 --- a/composer/packages/tracing/package.json +++ b/composer/packages/tracing/package.json @@ -1,6 +1,6 @@ { "name": "@ballerina/tracing", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "", "main": "lib/src/index.js", "scripts": { @@ -18,7 +18,7 @@ "author": "ballerina.io", "license": "Apache-2.0", "devDependencies": { - "@ballerina/composer-cli": "^1.0.2-SNAPSHOT", + "@ballerina/composer-cli": "^1.0.2", "@types/lodash": "^4.14.116" }, "dependencies": { diff --git a/composer/tools/composer-cli/package-lock.json b/composer/tools/composer-cli/package-lock.json index 4f031b7cb1df..78bb4dee0a27 100644 --- a/composer/tools/composer-cli/package-lock.json +++ b/composer/tools/composer-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "@ballerina/composer-cli", - "version": "0.990.4-SNAPSHOT", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/composer/tools/composer-cli/package.json b/composer/tools/composer-cli/package.json index fbd6d7e52a83..32315d6bccc3 100644 --- a/composer/tools/composer-cli/package.json +++ b/composer/tools/composer-cli/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@ballerina/composer-cli", - "version": "1.0.2-SNAPSHOT", + "version": "1.0.2", "description": "Includes a CLI util to help with composer packages development", "bin": { "composer": "./bin/composer" diff --git a/gradle.properties b/gradle.properties index c844c014e7bd..c3fddace4d4d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,6 @@ org.gradle.caching=true org.gradle.parallel=true org.gradle.jvmargs='-Dfile.encoding=UTF-8' org.gradle.workers.max=3 -version=1.0.2 +version=1.0.3-SNAPSHOT group=org.ballerinalang bootstrappedOn=1.0.0-alpha2 diff --git a/tool-plugins/vscode/grammar/ballerina-grammar b/tool-plugins/vscode/grammar/ballerina-grammar index 3c64295bd78b..8f6cf0aef527 160000 --- a/tool-plugins/vscode/grammar/ballerina-grammar +++ b/tool-plugins/vscode/grammar/ballerina-grammar @@ -1 +1 @@ -Subproject commit 3c64295bd78b174e24329a76aef227a74fc1d702 +Subproject commit 8f6cf0aef527a8a682949721920233770dca05d5 diff --git a/tool-plugins/vscode/package-lock.json b/tool-plugins/vscode/package-lock.json index c6e9726a3962..ecf9f066c00a 100644 --- a/tool-plugins/vscode/package-lock.json +++ b/tool-plugins/vscode/package-lock.json @@ -1,6 +1,6 @@ { "name": "ballerina", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/tool-plugins/vscode/package.json b/tool-plugins/vscode/package.json index 24d5c2abbb06..9c164fdbf4b0 100644 --- a/tool-plugins/vscode/package.json +++ b/tool-plugins/vscode/package.json @@ -2,7 +2,7 @@ "name": "ballerina", "displayName": "Ballerina", "description": "Intellisense, Diagram View, Debugging, code formatting and refactoring for Ballerina", - "version": "1.0.1", + "version": "1.0.2", "publisher": "ballerina", "repository": { "type": "git", From bd7d873d0225e1c88f3c1d3656e6db0c5a9e1e6d Mon Sep 17 00:00:00 2001 From: chamil321 Date: Fri, 25 Oct 2019 17:22:59 +0530 Subject: [PATCH 075/167] Add WebSub module to the distribution --- distribution/zip/jballerina/build.gradle | 3 ++ examples/index.json | 22 ++++++++ .../src/test/resources/testng.xml | 54 +++++++++---------- 3 files changed, 52 insertions(+), 27 deletions(-) diff --git a/distribution/zip/jballerina/build.gradle b/distribution/zip/jballerina/build.gradle index d9ae14a72120..91c2f6699081 100644 --- a/distribution/zip/jballerina/build.gradle +++ b/distribution/zip/jballerina/build.gradle @@ -132,6 +132,7 @@ dependencies { distBal project(path: ':ballerina-transactions', configuration: 'baloImplementation') distBal project(path: ':ballerina-java', configuration: 'baloImplementation') distBal project(path: ':ballerina-java-arrays', configuration: 'baloImplementation') + distBal project(path: ':ballerina-websub', configuration: 'baloImplementation') distBal project(path: ':ballerina-xslt', configuration: 'baloImplementation') distBal project(path: ':ballerina-kafka', configuration: 'baloImplementation') distBal project(path: ':ballerina-nats', configuration: 'baloImplementation') @@ -186,6 +187,7 @@ dependencies { balSource project(path: ':ballerina-streams', configuration: 'balSource') balSource project(path: ':ballerina-openapi', configuration: 'balSource') balSource project(path: ':ballerina-system', configuration: 'balSource') + balSource project(path: ':ballerina-websub', configuration: 'balSource') balSource project(path: ':ballerina-task', configuration: 'balSource') balSource project(path: ':ballerina-time', configuration: 'balSource') balSource project(path: ':ballerina-transactions', configuration: 'balSource') @@ -246,6 +248,7 @@ dependencies { dist project(':ballerina-logging') dist project(':ballerina-math') dist project(':ballerina-mime') + dist project(':ballerina-websub') dist project(':ballerina-observability') dist project(':ballerina-reflect') dist project(':ballerina-runtime-api') diff --git a/examples/index.json b/examples/index.json index 20bea48b48f3..7ebdc1ac795a 100644 --- a/examples/index.json +++ b/examples/index.json @@ -786,6 +786,28 @@ } ] }, + { + "title": "WebSub", + "column": 1, + "category": "Working over the network", + "samples": [{ + "name": "Internal Hub Sample", + "url": "websub-internal-hub-sample" + }, + { + "name": "Remote Hub Sample", + "url": "websub-remote-hub-sample" + }, + { + "name": "Hub Client Sample", + "url": "websub-hub-client-sample" + }, + { + "name": "Service Integration Sample", + "url": "websub-service-integration-sample" + } + ] + }, { "title": "Database", "column": 2, diff --git a/tests/jballerina-integration-test/src/test/resources/testng.xml b/tests/jballerina-integration-test/src/test/resources/testng.xml index bdbda4211317..0f339f8c1845 100644 --- a/tests/jballerina-integration-test/src/test/resources/testng.xml +++ b/tests/jballerina-integration-test/src/test/resources/testng.xml @@ -226,34 +226,34 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + From 74c84d9a0323adc28b37b2d1119153be617335be Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Sat, 26 Oct 2019 16:52:06 +0530 Subject: [PATCH 076/167] Make hub paths configurable and default to / --- .../websub-hub-client-sample/publisher.bal | 2 +- .../websub-internal-hub-sample/publisher.bal | 2 +- examples/websub-remote-hub-sample/hub.bal | 2 +- .../order_mgmt_service.bal | 4 +- .../src/main/ballerina/src/websub/commons.bal | 21 +- .../src/websub/hub_configuration.bal | 6 +- .../main/ballerina/src/websub/hub_service.bal | 417 +++++++++--------- .../src/main/ballerina/src/websub/natives.bal | 6 +- .../org/ballerinalang/net/websub/hub/Hub.java | 19 +- .../websub/nativeimpl/StartUpHubService.java | 6 +- .../test-src/hub/test_hub_startup.bal | 2 +- .../advanced_services/01_websub_publisher.bal | 2 +- .../src/services/01_websub_publisher.bal | 3 +- 13 files changed, 254 insertions(+), 238 deletions(-) diff --git a/examples/websub-hub-client-sample/publisher.bal b/examples/websub-hub-client-sample/publisher.bal index d2b655ef2bb9..5232539f0ae4 100644 --- a/examples/websub-hub-client-sample/publisher.bal +++ b/examples/websub-hub-client-sample/publisher.bal @@ -10,7 +10,7 @@ public function main() { // Starts the internal Ballerina Hub. io:println("Starting up the Ballerina Hub Service"); - var result = websub:startHub(new http:Listener(9191)); + var result = websub:startHub(new http:Listener(9191), "/websub", "/hub"); websub:WebSubHub webSubHub = result is websub:HubStartedUpError ? result.startedUpHub : result; // Registers a topic at the hub. diff --git a/examples/websub-internal-hub-sample/publisher.bal b/examples/websub-internal-hub-sample/publisher.bal index e0219df8bdce..58168bcc2faf 100644 --- a/examples/websub-internal-hub-sample/publisher.bal +++ b/examples/websub-internal-hub-sample/publisher.bal @@ -9,7 +9,7 @@ public function main() { // Specifies the port that the internal Ballerina hub needs to start on and start the hub. io:println("Starting up the Ballerina Hub Service"); - var result = websub:startHub(new http:Listener(9191)); + var result = websub:startHub(new http:Listener(9191), "/websub", "/hub"); websub:WebSubHub webSubHub = result is websub:HubStartedUpError ? result.startedUpHub : result; diff --git a/examples/websub-remote-hub-sample/hub.bal b/examples/websub-remote-hub-sample/hub.bal index 5b19ce2f5472..3a47e019cdb9 100644 --- a/examples/websub-remote-hub-sample/hub.bal +++ b/examples/websub-remote-hub-sample/hub.bal @@ -10,7 +10,7 @@ public function main() { // updates of the topics. io:println("Starting up the Ballerina Hub Service"); - var result = websub:startHub(new http:Listener(9191), { + var result = websub:startHub(new http:Listener(9191), "/websub", "/hub", { remotePublish : { enabled : true }}); diff --git a/examples/websub-service-integration-sample/order_mgmt_service.bal b/examples/websub-service-integration-sample/order_mgmt_service.bal index 82e349316629..6e5725198eea 100644 --- a/examples/websub-service-integration-sample/order_mgmt_service.bal +++ b/examples/websub-service-integration-sample/order_mgmt_service.bal @@ -50,7 +50,7 @@ service orderMgt on httpListener { var orderReq = req.getJsonPayload(); if (orderReq is json) { string orderId = orderReq.Order.ID.toString(); - orderMap[orderId] = orderReq; + orderMap[orderId] = <@untainted> orderReq; // Creates the response message indicating successful order creation. http:Response response = new; @@ -80,7 +80,7 @@ service orderMgt on httpListener { // Starts up a Ballerina WebSub Hub on port 9191 and registers the topic against // which updates will be published. function startHubAndRegisterTopic() returns websub:WebSubHub { - var hubStartUpResult = websub:startHub(new http:Listener(9191)); + var hubStartUpResult = websub:startHub(new http:Listener(9191), "/websub", "/hub"); websub:WebSubHub internalHub = hubStartUpResult is websub:HubStartedUpError ? hubStartUpResult.startedUpHub : hubStartUpResult; diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index c19f87aedcd4..888b62a2e482 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -454,7 +454,7 @@ public type HubConfiguration record {| # Record representing remote publishing allowance. # -# + enabled - Whether remote publishers should be allowed to publish to this hub (HTTP requests) +# + enabled - Whether remote publishers should be allowed to publish to this hub (HTTP requests) // todo remove # + mode - If remote publishing is allowed, the mode to use, `direct` (default) - fat ping with # the notification payload specified or `fetch` - the hub fetches the topic URL # specified in the "publish" request to identify the payload @@ -466,12 +466,17 @@ public type RemotePublishConfig record {| # Starts up the Ballerina Hub. # # + hubServiceListener - The `http:Listener` to which the hub service is attached +# + basePath - The base path of the hub service +# + resourcePath - The resource path of the hub # + hubConfiguration - The hub specific configuration # + return - `WebSubHub` The WebSubHub object representing the newly started up hub, or `HubStartedUpError` indicating # that the hub is already started, and including the WebSubHub object representing the # already started up hub -public function startHub(http:Listener hubServiceListener, HubConfiguration hubConfiguration = {}) - returns WebSubHub|HubStartedUpError { +public function startHub(http:Listener hubServiceListener, public string basePath = "/", + public string resourcePath = "/", public HubConfiguration hubConfiguration = {}) + returns WebSubHub|HubStartedUpError { + hubBasePath = config:getAsString("b7a.websub.hub.basepath", basePath); + hubResourcePath = config:getAsString("b7a.websub.hub.resourcepath", resourcePath); hubLeaseSeconds = config:getAsInt("b7a.websub.hub.leasetime", hubConfiguration.leaseSeconds); hubSignatureMethod = getSignatureMethod(hubConfiguration.signatureMethod); @@ -489,8 +494,14 @@ public function startHub(http:Listener hubServiceListener, HubConfiguration hubC hubPersistenceEnabled = true; } - startHubService(hubServiceListener); - return startUpHubService(hubTopicRegistrationRequired, hubPublicUrl, hubServiceListener); + + WebSubHub|HubStartedUpError res = startUpHubService(hubBasePath, hubResourcePath, hubTopicRegistrationRequired, + hubPublicUrl, hubServiceListener); + if (res is WebSubHub) { + startHubService(hubServiceListener); + } + + return res; } # Object representing a Ballerina WebSub Hub. diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal index 7103cf6e78ee..bd2fecd04dad 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal @@ -19,8 +19,6 @@ import ballerina/http; import ballerina/log; import ballerina/stringutils; -const string BASE_PATH = "/websub"; -const string HUB_PATH = "/hub"; const string DEFAULT_HOST = "0.0.0.0"; const int DEFAULT_LEASE_SECONDS_VALUE = 86400; //one day @@ -33,6 +31,8 @@ const string DEFAULT_DB_NAME = "HUB_DB"; const string DEFAULT_DB_USERNAME = "sa"; const string DEFAULT_DB_PASSWORD = ""; +string hubBasePath = "/"; +string hubResourcePath = "/"; int hubLeaseSeconds = DEFAULT_LEASE_SECONDS_VALUE; string hubSignatureMethod = DEFAULT_SIGNATURE_METHOD; RemotePublishConfig remotePublishConfig = {}; @@ -48,7 +48,7 @@ boolean hubPersistenceEnabled = false; # + hubServiceListener - The `http:Listener` to which the service is attached function startHubService(http:Listener hubServiceListener) { // TODO : handle errors - checkpanic hubServiceListener.__attach(hubService); + checkpanic hubServiceListener.__attach(getHubService()); checkpanic hubServiceListener.__start(); } diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 28780e176d67..06b04b43876e 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -30,222 +30,213 @@ import ballerina/time; # This cache is used for caching HTTP clients against the subscriber callbacks. cache:Cache subscriberCallbackClientCache = new(expiryTimeInMillis = DEFAULT_CACHE_EXPIRY_MILLIS); -service hubService = -@http:ServiceConfig { - basePath: BASE_PATH, - auth: { - enabled: config:getAsBoolean("b7a.websub.hub.auth.enabled", false), - scopes: getArray(config:getAsString("b7a.websub.hub.auth.scopes")) +function getHubService() returns service { + return @http:ServiceConfig { + basePath: hubBasePath, + auth: { + enabled: config:getAsBoolean("b7a.websub.hub.auth.enabled", false), + scopes: getArray(config:getAsString("b7a.websub.hub.auth.scopes")) + } } + service { + + @http:ResourceConfig { + methods: ["POST"], + path: hubResourcePath + } + resource function hub(http:Caller httpCaller, http:Request request) { + http:Response response = new; + string topic = ""; + + var reqFormParamMap = request.getFormParams(); + map params = reqFormParamMap is map ? reqFormParamMap : {}; + + string mode = params[HUB_MODE] ?: ""; + + var topicFromParams = params[HUB_TOPIC]; + if topicFromParams is string { + var decodedValue = encoding:decodeUriComponent(topicFromParams, "UTF-8"); + topic = decodedValue is string ? decodedValue : topicFromParams; + } + + if (mode == MODE_SUBSCRIBE || mode == MODE_UNSUBSCRIBE) { + boolean validSubscriptionChangeRequest = false; + // TODO: check the non-existing key at this point and return the 400 + var result = params[HUB_CALLBACK]; + string callbackFromParams = params[HUB_CALLBACK] ?: ""; + var decodedCallbackFromParams = encoding:decodeUriComponent(callbackFromParams, "UTF-8"); + string callback = decodedCallbackFromParams is string ? decodedCallbackFromParams : callbackFromParams; + var validationStatus = validateSubscriptionChangeRequest(mode, topic, callback); + if (validationStatus is error) { + response.statusCode = http:STATUS_BAD_REQUEST; + string errorMessage = validationStatus.detail()?.message; + response.setTextPayload(errorMessage); + } else { + validSubscriptionChangeRequest = true; + response.statusCode = http:STATUS_ACCEPTED; + } + + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding to subscription change request", responseError); + } else { + if (validSubscriptionChangeRequest) { + verifyIntentAndAddSubscription(callback, topic, params); + } + } + return; + } else if (mode == MODE_REGISTER) { + if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload("Remote topic registration not allowed/not required at the Hub"); + log:printWarn("Remote topic registration denied at Hub"); + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on remote topic registration failure", responseError); + } + return; + } + + var registerStatus = registerTopicAtHub(topic); + if (registerStatus is error) { + string errorMessage = registerStatus.detail()?.message; + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload(errorMessage); + log:printWarn("Topic registration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); + } else { + response.statusCode = http:STATUS_ACCEPTED; + log:printInfo("Topic registration successful at Hub, for topic[" + topic + "]"); + } + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding remote topic registration status", responseError); + } + } else if (mode == MODE_UNREGISTER) { + if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload("Remote unregistration not allowed/not required at the Hub"); + log:printWarn("Remote topic unregistration denied at Hub"); + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on remote topic unregistration failure", responseError); + } + return; + } + + var unregisterStatus = unregisterTopicAtHub(topic); + if (unregisterStatus is error) { + string errorMessage = unregisterStatus.detail()?.message; + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload(errorMessage); + log:printWarn("Topic unregistration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); + } else { + response.statusCode = http:STATUS_ACCEPTED; + log:printInfo("Topic unregistration successful at Hub, for topic[" + topic + "]"); + } + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding remote topic unregistration status", responseError); + } + } else { + if (mode != MODE_PUBLISH) { + mode = request.getQueryParamValue(HUB_MODE) ?: ""; + string topicValue = request.getQueryParamValue(HUB_TOPIC) ?: ""; + var decodedTopic = encoding:decodeUriComponent(topicValue, "UTF-8"); + topic = decodedTopic is string ? decodedTopic : topicValue; + } + + if (mode == MODE_PUBLISH && remotePublishConfig.enabled) { + if (!hubTopicRegistrationRequired || isTopicRegistered(topic)) { + byte [0] arr = []; + byte[]|error binaryPayload = arr; + string stringPayload; + string contentType = ""; + if (remotePublishConfig.mode == PUBLISH_MODE_FETCH) { + var fetchResponse = fetchTopicUpdate(topic); + if (fetchResponse is http:Response) { + binaryPayload = fetchResponse.getBinaryPayload(); + if (fetchResponse.hasHeader(CONTENT_TYPE)) { + contentType = fetchResponse.getHeader(CONTENT_TYPE); + } + var fetchedPayload = fetchResponse.getTextPayload(); + stringPayload = fetchedPayload is string ? fetchedPayload : ""; + } else { + string errorCause = fetchResponse.detail()?.message; + string errorMessage = "Error fetching updates for topic URL [" + topic + "]: " + + errorCause; + log:printError(errorMessage); + response.setTextPayload(<@untainted string> errorMessage); + response.statusCode = http:STATUS_BAD_REQUEST; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on update fetch failure", responseError); + } + return; + } + } else { + binaryPayload = request.getBinaryPayload(); + if (request.hasHeader(CONTENT_TYPE)) { + contentType = request.getHeader(CONTENT_TYPE); + } + var result = request.getTextPayload(); + stringPayload = result is string ? result : ""; + } + + error? publishStatus = (); + if (binaryPayload is byte[]) { + WebSubContent notification = { payload:binaryPayload, contentType:contentType }; + publishStatus = publishToInternalHub(topic, notification); + } else { + string errorCause = binaryPayload.detail()?.message; + string errorMessage = "Error extracting payload: " + <@untainted string> errorCause; + log:printError(errorMessage); + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload(errorMessage); + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on payload extraction failure for" + + " publish request", responseError); + } + return; + } + + if (publishStatus is error) { + string errorCause = publishStatus.detail()?.message; + string errorMessage = "Update notification failed for Topic [" + topic + "]: " + errorCause; + response.setTextPayload(<@untainted string> errorMessage); + log:printError(errorMessage); + } else { + log:printInfo("Update notification done for Topic [" + topic + "]"); + response.statusCode = http:STATUS_ACCEPTED; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on update notification for topic[" + topic + + "]", responseError); + } + return; + } + } else { + string errorMessage = "Publish request denied for unregistered topic[" + topic + "]"; + log:printDebug(errorMessage); + response.setTextPayload(<@untainted string> errorMessage); + } + response.statusCode = http:STATUS_BAD_REQUEST; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding to publish request", responseError); + } + } else { + response.statusCode = http:STATUS_BAD_REQUEST; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding to request", responseError); + } + } + } + } + }; } -service { - @http:ResourceConfig { - methods: ["GET"], - path: HUB_PATH - } - resource function status(http:Caller httpCaller, http:Request request) { - http:Response response = new; - response.statusCode = http:STATUS_ACCEPTED; - response.setTextPayload("Ballerina Hub Service - Up and Running!"); - checkpanic httpCaller->respond(response); - } - - @http:ResourceConfig { - methods: ["POST"], - path: HUB_PATH - } - resource function hub(http:Caller httpCaller, http:Request request) { - http:Response response = new; - string topic = ""; - - var reqFormParamMap = request.getFormParams(); - map params = reqFormParamMap is map ? reqFormParamMap : {}; - - string mode = params[HUB_MODE] ?: ""; - - var topicFromParams = params[HUB_TOPIC]; - if topicFromParams is string { - var decodedValue = encoding:decodeUriComponent(topicFromParams, "UTF-8"); - topic = decodedValue is string ? decodedValue : topicFromParams; - } - - if (mode == MODE_SUBSCRIBE || mode == MODE_UNSUBSCRIBE) { - boolean validSubscriptionChangeRequest = false; - // TODO: check the non-existing key at this point and return the 400 - var result = params[HUB_CALLBACK]; - string callbackFromParams = params[HUB_CALLBACK] ?: ""; - var decodedCallbackFromParams = encoding:decodeUriComponent(callbackFromParams, "UTF-8"); - string callback = decodedCallbackFromParams is string ? decodedCallbackFromParams : callbackFromParams; - var validationStatus = validateSubscriptionChangeRequest(mode, topic, callback); - if (validationStatus is error) { - response.statusCode = http:STATUS_BAD_REQUEST; - string errorMessage = validationStatus.detail()?.message; - response.setTextPayload(errorMessage); - } else { - validSubscriptionChangeRequest = true; - response.statusCode = http:STATUS_ACCEPTED; - } - - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding to subscription change request", responseError); - } else { - if (validSubscriptionChangeRequest) { - verifyIntentAndAddSubscription(callback, topic, params); - } - } - return; - } else if (mode == MODE_REGISTER) { - if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload("Remote topic registration not allowed/not required at the Hub"); - log:printWarn("Remote topic registration denied at Hub"); - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on remote topic registration failure", responseError); - } - return; - } - - var registerStatus = registerTopicAtHub(topic); - if (registerStatus is error) { - string errorMessage = registerStatus.detail()?.message; - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload(errorMessage); - log:printWarn("Topic registration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); - } else { - response.statusCode = http:STATUS_ACCEPTED; - log:printInfo("Topic registration successful at Hub, for topic[" + topic + "]"); - } - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding remote topic registration status", responseError); - } - } else if (mode == MODE_UNREGISTER) { - if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload("Remote unregistration not allowed/not required at the Hub"); - log:printWarn("Remote topic unregistration denied at Hub"); - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on remote topic unregistration failure", responseError); - } - return; - } - - var unregisterStatus = unregisterTopicAtHub(topic); - if (unregisterStatus is error) { - string errorMessage = unregisterStatus.detail()?.message; - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload(errorMessage); - log:printWarn("Topic unregistration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); - } else { - response.statusCode = http:STATUS_ACCEPTED; - log:printInfo("Topic unregistration successful at Hub, for topic[" + topic + "]"); - } - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding remote topic unregistration status", responseError); - } - } else { - if (mode != MODE_PUBLISH) { - mode = request.getQueryParamValue(HUB_MODE) ?: ""; - string topicValue = request.getQueryParamValue(HUB_TOPIC) ?: ""; - var decodedTopic = encoding:decodeUriComponent(topicValue, "UTF-8"); - topic = decodedTopic is string ? decodedTopic : topicValue; - } - - if (mode == MODE_PUBLISH && remotePublishConfig.enabled) { - if (!hubTopicRegistrationRequired || isTopicRegistered(topic)) { - byte [0] arr = []; - byte[]|error binaryPayload = arr; - string stringPayload; - string contentType = ""; - if (remotePublishConfig.mode == PUBLISH_MODE_FETCH) { - var fetchResponse = fetchTopicUpdate(topic); - if (fetchResponse is http:Response) { - binaryPayload = fetchResponse.getBinaryPayload(); - if (fetchResponse.hasHeader(CONTENT_TYPE)) { - contentType = fetchResponse.getHeader(CONTENT_TYPE); - } - var fetchedPayload = fetchResponse.getTextPayload(); - stringPayload = fetchedPayload is string ? fetchedPayload : ""; - } else { - string errorCause = fetchResponse.detail()?.message; - string errorMessage = "Error fetching updates for topic URL [" + topic + "]: " - + errorCause; - log:printError(errorMessage); - response.setTextPayload(<@untainted string> errorMessage); - response.statusCode = http:STATUS_BAD_REQUEST; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on update fetch failure", responseError); - } - return; - } - } else { - binaryPayload = request.getBinaryPayload(); - if (request.hasHeader(CONTENT_TYPE)) { - contentType = request.getHeader(CONTENT_TYPE); - } - var result = request.getTextPayload(); - stringPayload = result is string ? result : ""; - } - - error? publishStatus = (); - if (binaryPayload is byte[]) { - WebSubContent notification = { payload:binaryPayload, contentType:contentType }; - publishStatus = publishToInternalHub(topic, notification); - } else { - string errorCause = binaryPayload.detail()?.message; - string errorMessage = "Error extracting payload: " + <@untainted string> errorCause; - log:printError(errorMessage); - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload(errorMessage); - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on payload extraction failure for" - + " publish request", responseError); - } - return; - } - - if (publishStatus is error) { - string errorCause = publishStatus.detail()?.message; - string errorMessage = "Update notification failed for Topic [" + topic + "]: " + errorCause; - response.setTextPayload(<@untainted string> errorMessage); - log:printError(errorMessage); - } else { - log:printInfo("Update notification done for Topic [" + topic + "]"); - response.statusCode = http:STATUS_ACCEPTED; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on update notification for topic[" + topic - + "]", responseError); - } - return; - } - } else { - string errorMessage = "Publish request denied for unregistered topic[" + topic + "]"; - log:printDebug(errorMessage); - response.setTextPayload(<@untainted string> errorMessage); - } - response.statusCode = http:STATUS_BAD_REQUEST; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding to publish request", responseError); - } - } else { - response.statusCode = http:STATUS_BAD_REQUEST; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding to request", responseError); - } - } - } - } -}; # Function to validate a subscription/unsubscription request, by validating the mode, topic and callback specified. # diff --git a/stdlib/websub/src/main/ballerina/src/websub/natives.bal b/stdlib/websub/src/main/ballerina/src/websub/natives.bal index b2a90304149b..a6d7e5817bf1 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/natives.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/natives.bal @@ -22,6 +22,8 @@ import ballerina/io; /////////////////////////////////////////////////////////////////// # Starts up the internal Ballerina Hub. # +# + basePath - The base path of the hub service +# + resourcePath - The resource path of the hub # + topicRegistrationRequired - Whether a topic needs to be registered at the hub prior to publishing/subscribing # to the topic # + publicUrl - The URL for the hub to be included in content delivery requests, defaults to @@ -30,8 +32,8 @@ import ballerina/io; # + return - `WebSubHub` The WebSubHub object representing the newly started up hub, or `HubStartedUpError` indicating # that the hub is already started, and including the WebSubHub object representing the # already started up hub -function startUpHubService(boolean topicRegistrationRequired, string publicUrl, http:Listener hubListener) - returns WebSubHub|HubStartedUpError = external; +function startUpHubService(string basePath, string resourcePath, boolean topicRegistrationRequired, + string publicUrl, http:Listener hubListener) returns WebSubHub|HubStartedUpError = external; # Stop the Ballerina Hub, if started. # diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java index ec4edc6403d4..ec3e59eeda7f 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java @@ -61,10 +61,12 @@ public class Hub { private List subscribers = new ArrayList<>(); private ClassLoader classLoader = this.getClass().getClassLoader(); - private static final String BASE_PATH = "/websub"; - private static final String HUB_PATH = "/hub"; + private String basePath = "/"; + private String resourcePath = "/"; private static final String HUB_SERVICE = "hub_service"; + private static final String SLASH = "/"; + public static Hub getInstance() { return instance; } @@ -195,13 +197,16 @@ public boolean isStarted() { * Method to start up the default Ballerina WebSub Hub. * * @param strand current strand + * @param basePath the base path of the hub service + * @param resourcePath the resource path of the hub * @param topicRegistrationRequired whether a topic needs to be registered at the hub prior to * publishing/subscribing to the topic * @param publicUrl the URL for the hub to be included in content delivery requests * @param hubListener the http:Listener to which the hub service is attached */ @SuppressWarnings("unchecked") - public void startUpHubService(Strand strand, boolean topicRegistrationRequired, String publicUrl, + public void startUpHubService(Strand strand, String basePath, String resourcePath, + boolean topicRegistrationRequired, String publicUrl, ObjectValue hubListener) { synchronized (this) { if (!isStarted()) { @@ -210,6 +215,8 @@ public void startUpHubService(Strand strand, boolean topicRegistrationRequired, } catch (Exception e) { throw new BallerinaException("Error starting up internal broker for WebSub Hub"); } + this.basePath = basePath.startsWith(SLASH) ? basePath : SLASH.concat(basePath); + this.resourcePath = resourcePath.startsWith(SLASH) ? resourcePath : SLASH.concat(resourcePath); hubTopicRegistrationRequired = topicRegistrationRequired; String hubUrl = populateHubUrl(publicUrl, hubListener); //TODO: change once made public and available as a param @@ -235,8 +242,10 @@ private String populateHubUrl(String hubUrl, ObjectValue hubListener) { if (hubUrl.isEmpty()) { String hubPort = String.valueOf(hubListener.get("port")); Object secureSocket = ((MapValue) hubListener.get("config")).get("secureSocket"); - hubUrl = secureSocket != null ? ("https://localhost:" + hubPort + BASE_PATH + HUB_PATH) - : ("http://localhost:" + hubPort + BASE_PATH + HUB_PATH); + + String path = basePath.equals(SLASH) ? resourcePath : basePath.concat(resourcePath); + hubUrl = secureSocket != null ? ("https://localhost:" + hubPort + path) + : ("http://localhost:" + hubPort + path); } return hubUrl; } diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java index fc1fe41acf36..42c2f3bced38 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java @@ -48,14 +48,16 @@ ) public class StartUpHubService { - public static Object startUpHubService(Strand strand, boolean topicRegistrationRequired, String publicUrl, + public static Object startUpHubService(Strand strand, String basePath, String resourcePath, + boolean topicRegistrationRequired, String publicUrl, ObjectValue hubListener) { Hub hubInstance = Hub.getInstance(); if (hubInstance.isStarted()) { return getHubStartedUpError(hubInstance); } try { - hubInstance.startUpHubService(strand, topicRegistrationRequired, publicUrl, hubListener); + hubInstance.startUpHubService(strand, basePath, resourcePath, topicRegistrationRequired, publicUrl, + hubListener); } catch (BallerinaWebSubException e) { return getHubStartedUpError(hubInstance); } diff --git a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal index b255d8f40478..aae33028468f 100644 --- a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal +++ b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal @@ -18,7 +18,7 @@ import ballerina/websub; import ballerina/http; function startupHub(int hubPort) returns websub:WebSubHub|websub:HubStartedUpError { - return websub:startHub(new http:Listener(hubPort)); + return websub:startHub(new http:Listener(hubPort), "/websub", "/hub"); } //TODO change function to accept websub:WebSubHub|websub:HubStartedUpError hubStartUpResult once test migration is done diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal index 9f0112783c9b..fb0ff9af23e7 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal @@ -205,7 +205,7 @@ function startWebSubHub() returns websub:WebSubHub { password: "ballerina" } } - }), { remotePublish : { enabled : true }}); + }), "/websub", "/hub", { remotePublish : { enabled : true }}); if (result is websub:WebSubHub) { return result; } else { diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal index ea81764af3a7..a4e78aa8a16f 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal @@ -212,7 +212,8 @@ function startHubAndRegisterTopic() returns websub:WebSubHub { } function startWebSubHub() returns websub:WebSubHub { - var result = websub:startHub(new http:Listener(23191), { remotePublish : { enabled : true }}); + var result = websub:startHub(new http:Listener(23191), "/websub", "/hub", + hubConfiguration = { remotePublish : { enabled : true }}); if (result is websub:WebSubHub) { return result; } else { From 7ff44cd1c706a0e2eae8857d11225b302f783943 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Sat, 26 Oct 2019 19:17:09 +0530 Subject: [PATCH 077/167] Intro two clients for pub and sub instead of one --- .../subscription_change_client.bal | 4 +- .../websub-remote-hub-sample/publisher.bal | 4 +- .../src/main/ballerina/src/websub/Module.md | 8 +- .../ballerina/src/websub/publisher_client.bal | 168 ++++++++++++++++ .../{hub_client.bal => subscriber_client.bal} | 185 +++--------------- .../websub/subscriber_service_endpoint.bal | 2 +- .../advanced_services/01_websub_publisher.bal | 2 +- .../src/services/01_websub_publisher.bal | 2 +- .../subscriber/test_unsubscription_client.bal | 2 +- 9 files changed, 206 insertions(+), 171 deletions(-) create mode 100644 stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal rename stdlib/websub/src/main/ballerina/src/websub/{hub_client.bal => subscriber_client.bal} (53%) diff --git a/examples/websub-hub-client-sample/subscription_change_client.bal b/examples/websub-hub-client-sample/subscription_change_client.bal index e0ead2169361..24f42eefc14b 100644 --- a/examples/websub-hub-client-sample/subscription_change_client.bal +++ b/examples/websub-hub-client-sample/subscription_change_client.bal @@ -3,8 +3,8 @@ import ballerina/io; import ballerina/runtime; import ballerina/websub; -websub:Client websubHubClientEP = new - websub:Client("http://localhost:9191/websub/hub"); +websub:SubscriptionClient websubHubClientEP = + new ("http://localhost:9191/websub/hub"); public function main() { diff --git a/examples/websub-remote-hub-sample/publisher.bal b/examples/websub-remote-hub-sample/publisher.bal index 9bdb8569cb0b..2a7eb828ab4e 100644 --- a/examples/websub-remote-hub-sample/publisher.bal +++ b/examples/websub-remote-hub-sample/publisher.bal @@ -4,8 +4,8 @@ import ballerina/runtime; import ballerina/websub; // This is the remote WebSub Hub Endpoint to which registration and publish requests are sent. -websub:Client websubHubClientEP = - new websub:Client("http://localhost:9191/websub/hub"); +websub:PublisherClient websubHubClientEP = + new ("http://localhost:9191/websub/hub"); public function main() { diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index d12be127d145..d8b8f8ceb1e4 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -247,14 +247,14 @@ public function main() { } ``` -Ballerina publishers can also use the hub client endpoint to register topics at Ballerina WebSub hubs +Ballerina publishers can also use the publisher client to register topics at Ballerina WebSub hubs and publish/notify updates to the remote hubs. ```ballerina import ballerina/log; import ballerina/runtime; import ballerina/websub; -websub:Client websubHubClientEP = new("https://localhost:9191/websub/hub"); +websub:PublisherClient websubHubClientEP = new ("https://localhost:9191/websub/hub"); public function main() { @@ -279,12 +279,12 @@ public function main() { } ``` -The hub client endpoint can also be used by subscribers to send subscription and unsubscription requests explicitly. +The subscription client can be used by subscribers to send subscription and unsubscription requests explicitly. ```ballerina import ballerina/log; import ballerina/websub; -websub:Client websubHubClientEP = new(""); +websub:SubscriptionClient websubHubClientEP = new(""); public function main() { diff --git a/stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal b/stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal new file mode 100644 index 000000000000..4d25d0e2c888 --- /dev/null +++ b/stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal @@ -0,0 +1,168 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import ballerina/http; +import ballerina/io; +import ballerina/mime; + +# The HTTP based client for WebSub topic registration and unregistration, and notifying the hub of new updates. +public type PublisherClient client object { + + private string url; + private http:Client httpClient; + + # Initializer function for the client. + # + # + url - The URL to publish/notify updates to + # + config - The `http:ClientConfiguration` for the underlying client or `()` + public function __init(string url, http:ClientConfiguration? config = ()) { + self.url = url; + self.httpClient = new (self.url, config); + } + + # Registers a topic in a Ballerina WebSub Hub against which subscribers can subscribe and the publisher will + # publish updates. + # + # + topic - The topic to register + # + return - `error` if an error occurred registering the topic + public remote function registerTopic(string topic) returns @tainted error? { + http:Client httpClient = self.httpClient; + http:Request request = buildTopicRegistrationChangeRequest(MODE_REGISTER, topic); + var registrationResponse = httpClient->post("", request); + if (registrationResponse is http:Response) { + if (registrationResponse.statusCode != http:STATUS_ACCEPTED) { + var result = registrationResponse.getTextPayload(); + string payload = result is string ? result : ""; + error webSubError = error(WEBSUB_ERROR_CODE, message = "Error occurred during topic registration: " + payload); + return webSubError; + } + } else { + error err = registrationResponse;//todo + string errCause = err.detail()?.message; + error webSubError = error(WEBSUB_ERROR_CODE, message = "Error sending topic registration request: " + errCause); + return webSubError; + } + } + + # Unregisters a topic in a Ballerina WebSub Hub. + # + # + topic - The topic to unregister + # + return - `error` if an error occurred unregistering the topic + public remote function unregisterTopic(string topic) returns @tainted error? { + http:Client httpClient = self.httpClient; + http:Request request = buildTopicRegistrationChangeRequest(MODE_UNREGISTER, topic); + var unregistrationResponse = httpClient->post("", request); + if (unregistrationResponse is http:Response) { + if (unregistrationResponse.statusCode != http:STATUS_ACCEPTED) { + var result = unregistrationResponse.getTextPayload(); + string payload = result is string ? result : ""; + error webSubError = error(WEBSUB_ERROR_CODE, message = "Error occurred during topic unregistration: " + payload); + return webSubError; + } + } else { + error err = unregistrationResponse; + string errCause = err.detail()?.message; + error webSubError = error(WEBSUB_ERROR_CODE, message = "Error sending topic unregistration request: " + errCause); + return webSubError; + } + return; + } + + # Publishes an update to a remote Ballerina WebSub Hub. + # + # + topic - The topic for which the update occurred + # + payload - The update payload + # + contentType - The type of the update content, to set as the `ContentType` header + # + headers - The headers, if any, that need to be set + # + return - `error` if an error occurred with the update + public remote function publishUpdate(string topic, string|xml|json|byte[]|io:ReadableByteChannel payload, + string? contentType = (), map? headers = ()) returns @tainted error? { + http:Client httpClient = self.httpClient; + http:Request request = new; + string queryParams = HUB_MODE + "=" + MODE_PUBLISH + "&" + HUB_TOPIC + "=" + topic; + request.setPayload(payload); + + if (contentType is string) { + check request.setContentType(contentType); + } + + if (headers is map) { + foreach var [key, value] in headers.entries() { + request.setHeader(key, value); + } + } + + var response = httpClient->post(<@untainted string> ("?" + queryParams), request); + if (response is http:Response) { + if (!isSuccessStatusCode(response.statusCode)) { + var result = response.getTextPayload(); + string textPayload = result is string ? result : ""; + error webSubError = error(WEBSUB_ERROR_CODE, message = "Error occurred publishing update: " + textPayload); + return webSubError; + } + } else { + error webSubError = error(WEBSUB_ERROR_CODE, message = "Publish failed for topic [" + topic + "]"); + return webSubError; + } + return; + } + + # Notifies a remote WebSub Hub that an update is available to fetch, for hubs that require publishing to + # happen as such. + # + # + topic - The topic for which the update occurred + # + headers - The headers, if any, that need to be set + # + return - `error` if an error occurred with the notification + public remote function notifyUpdate(string topic, map? headers = ()) returns @tainted error? { + http:Client httpClient = self.httpClient; + http:Request request = new; + string queryParams = HUB_MODE + "=" + MODE_PUBLISH + "&" + HUB_TOPIC + "=" + topic; + + if (headers is map) { + foreach var [key, value] in headers.entries() { + request.setHeader(key, value); + } + } + + var response = httpClient->post(<@untainted string> ("?" + queryParams), request); + if (response is http:Response) { + if (!isSuccessStatusCode(response.statusCode)) { + var result = response.getTextPayload(); + string textPayload = result is string ? result : ""; + error webSubError = error(WEBSUB_ERROR_CODE, + message = "Error occurred notifying update availability: " + textPayload); + return webSubError; + } + } else { + error webSubError = error(WEBSUB_ERROR_CODE, + message = "Update availability notification failed for topic [" + topic + "]"); + return webSubError; + } + return; + } +}; + +# Builds the topic registration change request to register or unregister a topic at the hub. +# +# + mode - Whether the request is for registration or unregistration +# + topic - The topic to register/unregister +# + return - `http:Request` The Request to send to the hub to register/unregister +function buildTopicRegistrationChangeRequest(@untainted string mode, @untainted string topic) returns (http:Request) { + http:Request request = new; + request.setTextPayload(HUB_MODE + "=" + mode + "&" + HUB_TOPIC + "=" + topic); + request.setHeader(CONTENT_TYPE, mime:APPLICATION_FORM_URLENCODED); + return request; +} diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_client.bal b/stdlib/websub/src/main/ballerina/src/websub/subscriber_client.bal similarity index 53% rename from stdlib/websub/src/main/ballerina/src/websub/hub_client.bal rename to stdlib/websub/src/main/ballerina/src/websub/subscriber_client.bal index d9ae8e33aa43..d44e81e30038 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_client.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/subscriber_client.bal @@ -1,4 +1,4 @@ -// Copyright (c) 2018 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. // // WSO2 Inc. licenses this file to you under the Apache License, // Version 2.0 (the "License"); you may not use this file except @@ -16,24 +16,23 @@ import ballerina/encoding; import ballerina/http; -import ballerina/io; import ballerina/log; import ballerina/mime; -# The HTTP based Caller remote functions for outbound WebSub Subscription, Unsubscription, Registration, Unregistration and -# Notification requests to a Hub. -# -# + hubUrl - The URL of the target Hub to which requests need to be sent -public type Client client object { - - public string hubUrl; +# The HTTP based client for WebSub subscription and unsubscription. +public type SubscriptionClient client object { - private http:Client httpClientEndpoint; + private string url; + private http:Client httpClient; private http:FollowRedirects? followRedirects = (); + # Initializer function for the client. + # + # + url - The URL to publish/notify updates to + # + config - The `http:ClientConfiguration` for the underlying client or `()` public function __init(string url, http:ClientConfiguration? config = ()) { - self.hubUrl = url; - self.httpClientEndpoint = new (self.hubUrl, config); + self.url = url; + self.httpClient = new (self.url, config); self.followRedirects = config?.followRedirects; } @@ -45,11 +44,11 @@ public type Client client object { public remote function subscribe(SubscriptionChangeRequest subscriptionRequest) returns @tainted SubscriptionChangeResponse|error { - http:Client httpClientEndpoint = self.httpClientEndpoint; + http:Client httpClient = self.httpClient; http:Request builtSubscriptionRequest = buildSubscriptionChangeRequest(MODE_SUBSCRIBE, subscriptionRequest); - var response = httpClientEndpoint->post("", builtSubscriptionRequest); + var response = httpClient->post("", builtSubscriptionRequest); int redirectCount = getRedirectionMaxCount(self.followRedirects); - return processHubResponse(self.hubUrl, MODE_SUBSCRIBE, subscriptionRequest, response, httpClientEndpoint, + return processHubResponse(self.url, MODE_SUBSCRIBE, subscriptionRequest, response, httpClient, redirectCount); } @@ -61,148 +60,16 @@ public type Client client object { public remote function unsubscribe(SubscriptionChangeRequest unsubscriptionRequest) returns @tainted SubscriptionChangeResponse|error { - http:Client httpClientEndpoint = self.httpClientEndpoint; + http:Client httpClient = self.httpClient; http:Request builtUnsubscriptionRequest = buildSubscriptionChangeRequest(MODE_UNSUBSCRIBE, unsubscriptionRequest); - var response = httpClientEndpoint->post("", builtUnsubscriptionRequest); + var response = httpClient->post("", builtUnsubscriptionRequest); int redirectCount = getRedirectionMaxCount(self.followRedirects); - return processHubResponse(self.hubUrl, MODE_UNSUBSCRIBE, unsubscriptionRequest, response, httpClientEndpoint, + return processHubResponse(self.url, MODE_UNSUBSCRIBE, unsubscriptionRequest, response, httpClient, redirectCount); } - # Registers a topic in a Ballerina WebSub Hub against which subscribers can subscribe and the publisher will - # publish updates. - # - # + topic - The topic to register - # + return - `error` if an error occurred registering the topic - public remote function registerTopic(string topic) returns @tainted error? { - http:Client httpClientEndpoint = self.httpClientEndpoint; - http:Request request = buildTopicRegistrationChangeRequest(MODE_REGISTER, topic); - var registrationResponse = httpClientEndpoint->post("", request); - if (registrationResponse is http:Response) { - if (registrationResponse.statusCode != http:STATUS_ACCEPTED) { - var result = registrationResponse.getTextPayload(); - string payload = result is string ? result : ""; - error webSubError = error(WEBSUB_ERROR_CODE, message = "Error occurred during topic registration: " + payload); - return webSubError; - } - } else { - error err = registrationResponse; - string errCause = err.detail()?.message; - error webSubError = error(WEBSUB_ERROR_CODE, message = "Error sending topic registration request: " + errCause); - return webSubError; - } - } - - # Unregisters a topic in a Ballerina WebSub Hub. - # - # + topic - The topic to unregister - # + return - `error` if an error occurred unregistering the topic - public remote function unregisterTopic(string topic) returns @tainted error? { - http:Client httpClientEndpoint = self.httpClientEndpoint; - http:Request request = buildTopicRegistrationChangeRequest(MODE_UNREGISTER, topic); - var unregistrationResponse = httpClientEndpoint->post("", request); - if (unregistrationResponse is http:Response) { - if (unregistrationResponse.statusCode != http:STATUS_ACCEPTED) { - var result = unregistrationResponse.getTextPayload(); - string payload = result is string ? result : ""; - error webSubError = error(WEBSUB_ERROR_CODE, message = "Error occurred during topic unregistration: " + payload); - return webSubError; - } - } else { - error err = unregistrationResponse; - string errCause = err.detail()?.message; - error webSubError = error(WEBSUB_ERROR_CODE, message = "Error sending topic unregistration request: " + errCause); - return webSubError; - } - return; - } - - # Publishes an update to a remote Ballerina WebSub Hub. - # - # + topic - The topic for which the update occurred - # + payload - The update payload - # + contentType - The type of the update content, to set as the `ContentType` header - # + headers - The headers, if any, that need to be set - # + return - `error` if an error occurred with the update - public remote function publishUpdate(string topic, string|xml|json|byte[]|io:ReadableByteChannel payload, - string? contentType = (), map? headers = ()) returns @tainted error? { - http:Client httpClientEndpoint = self.httpClientEndpoint; - http:Request request = new; - string queryParams = HUB_MODE + "=" + MODE_PUBLISH + "&" + HUB_TOPIC + "=" + topic; - request.setPayload(payload); - - if (contentType is string) { - check request.setContentType(contentType); - } - - if (headers is map) { - foreach var [key, value] in headers.entries() { - request.setHeader(key, value); - } - } - - var response = httpClientEndpoint->post(<@untainted string> ("?" + queryParams), request); - if (response is http:Response) { - if (!isSuccessStatusCode(response.statusCode)) { - var result = response.getTextPayload(); - string textPayload = result is string ? result : ""; - error webSubError = error(WEBSUB_ERROR_CODE, message = "Error occurred publishing update: " + textPayload); - return webSubError; - } - } else { - error webSubError = error(WEBSUB_ERROR_CODE, message = "Publish failed for topic [" + topic + "]"); - return webSubError; - } - return; - } - - # Notifies a remote WebSub Hub that an update is available to fetch, for hubs that require publishing to - # happen as such. - # - # + topic - The topic for which the update occurred - # + headers - The headers, if any, that need to be set - # + return - `error` if an error occurred with the notification - public remote function notifyUpdate(string topic, map? headers = ()) returns @tainted error? { - http:Client httpClientEndpoint = self.httpClientEndpoint; - http:Request request = new; - string queryParams = HUB_MODE + "=" + MODE_PUBLISH + "&" + HUB_TOPIC + "=" + topic; - - if (headers is map) { - foreach var [key, value] in headers.entries() { - request.setHeader(key, value); - } - } - - var response = httpClientEndpoint->post(<@untainted string> ("?" + queryParams), request); - if (response is http:Response) { - if (!isSuccessStatusCode(response.statusCode)) { - var result = response.getTextPayload(); - string textPayload = result is string ? result : ""; - error webSubError = error(WEBSUB_ERROR_CODE, - message = "Error occurred notifying update availability: " + textPayload); - return webSubError; - } - } else { - error webSubError = error(WEBSUB_ERROR_CODE, - message = "Update availability notification failed for topic [" + topic + "]"); - return webSubError; - } - return; - } }; -# Builds the topic registration change request to register or unregister a topic at the hub. -# -# + mode - Whether the request is for registration or unregistration -# + topic - The topic to register/unregister -# + return - `http:Request` The Request to send to the hub to register/unregister -function buildTopicRegistrationChangeRequest(@untainted string mode, @untainted string topic) returns (http:Request) { - http:Request request = new; - request.setTextPayload(HUB_MODE + "=" + mode + "&" + HUB_TOPIC + "=" + topic); - request.setHeader(CONTENT_TYPE, mime:APPLICATION_FORM_URLENCODED); - return request; -} - # Function to build the subscription request to subscribe at the hub. # # + mode - Whether the request is for subscription or unsubscription @@ -241,12 +108,12 @@ function buildSubscriptionChangeRequest(@untainted string mode, # + mode - Whether the request was sent for subscription or unsubscription # + subscriptionChangeRequest - The subscription change request sent # + response - The http:Response or error received on request to the hub -# + httpClientEndpoint - The underlying HTTP Client Endpoint +# + httpClient - The underlying HTTP Client Endpoint # + return - `SubscriptionChangeResponse` indicating subscription/unsubscription details, if the request was successful # else `error` if an error occurred function processHubResponse(@untainted string hub, @untainted string mode, SubscriptionChangeRequest subscriptionChangeRequest, - http:Response|error response, http:Client httpClientEndpoint, + http:Response|error response, http:Client httpClient, int remainingRedirects) returns @tainted SubscriptionChangeResponse|error { string topic = subscriptionChangeRequest.topic; @@ -262,7 +129,7 @@ function processHubResponse(@untainted string hub, @untainted string mode, if (remainingRedirects > 0) { string redirected_hub = response.getHeader("Location"); return invokeClientConnectorOnRedirection(redirected_hub, mode, subscriptionChangeRequest, - httpClientEndpoint.config.auth, remainingRedirects - 1); + httpClient.config.auth, remainingRedirects - 1); } error subscriptionError = error(WEBSUB_ERROR_CODE, message = "Redirection response received for " + "subscription change request made with followRedirects disabled or after maxCount exceeded: Hub [" @@ -311,25 +178,25 @@ function invokeClientConnectorOnRedirection(@untainted string hub, @untainted st return unsubscribeWithRetries(hub, subscriptionChangeRequest, auth, remainingRedirects = remainingRedirects); } -function subscribeWithRetries(string hubUrl, SubscriptionChangeRequest subscriptionRequest, +function subscribeWithRetries(string url, SubscriptionChangeRequest subscriptionRequest, http:OutboundAuthConfig? auth, int remainingRedirects = 0) returns @tainted SubscriptionChangeResponse| error { - http:Client clientEndpoint = new http:Client(hubUrl, { auth: auth }); + http:Client clientEndpoint = new http:Client(url, { auth: auth }); http:Request builtSubscriptionRequest = buildSubscriptionChangeRequest(MODE_SUBSCRIBE, subscriptionRequest); var response = clientEndpoint->post("", builtSubscriptionRequest); - return processHubResponse(hubUrl, MODE_SUBSCRIBE, subscriptionRequest, response, clientEndpoint, + return processHubResponse(url, MODE_SUBSCRIBE, subscriptionRequest, response, clientEndpoint, remainingRedirects); } -function unsubscribeWithRetries(string hubUrl, SubscriptionChangeRequest unsubscriptionRequest, +function unsubscribeWithRetries(string url, SubscriptionChangeRequest unsubscriptionRequest, http:OutboundAuthConfig? auth, int remainingRedirects = 0) returns @tainted SubscriptionChangeResponse|error { - http:Client clientEndpoint = new http:Client(hubUrl, { + http:Client clientEndpoint = new http:Client(url, { auth: auth }); http:Request builtSubscriptionRequest = buildSubscriptionChangeRequest(MODE_UNSUBSCRIBE, unsubscriptionRequest); var response = clientEndpoint->post("", builtSubscriptionRequest); - return processHubResponse(hubUrl, MODE_UNSUBSCRIBE, unsubscriptionRequest, response, clientEndpoint, + return processHubResponse(url, MODE_UNSUBSCRIBE, unsubscriptionRequest, response, clientEndpoint, remainingRedirects); } diff --git a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal index 357a6558be86..8c9609189aa0 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal @@ -259,7 +259,7 @@ function retrieveHubAndTopicUrl(string resourceUrl, http:ClientConfiguration? pu # + subscriptionDetails - Map containing subscription details function invokeClientConnectorForSubscription(string hub, http:ClientConfiguration? hubClientConfig, map subscriptionDetails) { - Client websubHubClientEP = new Client(hub, hubClientConfig); + SubscriptionClient websubHubClientEP = new (hub, hubClientConfig); [string, string][_, topic] = <[string, string]> subscriptionDetails[ANNOT_FIELD_TARGET]; string callback = subscriptionDetails[ANNOT_FIELD_CALLBACK]; diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal index fb0ff9af23e7..675edfa6ba1d 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal @@ -39,7 +39,7 @@ auth:OutboundBasicAuthProvider OutBoundbasicAuthProvider = new({ http:BasicAuthHandler outboundBasicAuthHandler = new(OutBoundbasicAuthProvider); -websub:Client websubHubClientEP = new websub:Client(webSubHub.hubUrl, { +websub:PublisherClient websubHubClientEP = new (webSubHub.hubUrl, { auth: { authHandler: outboundBasicAuthHandler }, secureSocket: { trustStore: { diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal index a4e78aa8a16f..ede9ad3356c2 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal @@ -31,7 +31,7 @@ boolean remoteTopicRegistered = false; websub:WebSubHub webSubHub = startHubAndRegisterTopic(); -websub:Client websubHubClientEP = new websub:Client(webSubHub.hubUrl); +websub:PublisherClient websubHubClientEP = new (webSubHub.hubUrl); listener http:Listener publisherServiceEP = new http:Listener(23080); diff --git a/tests/jballerina-integration-test/src/test/resources/websub/subscriber/test_unsubscription_client.bal b/tests/jballerina-integration-test/src/test/resources/websub/subscriber/test_unsubscription_client.bal index 3edf5a3673e1..dc347519ef1b 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/subscriber/test_unsubscription_client.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/subscriber/test_unsubscription_client.bal @@ -19,7 +19,7 @@ import ballerina/runtime; import ballerina/websub; // This is the client used to send subscription and unsubscription requests. -websub:Client websubHubClientEP = new websub:Client("http://localhost:23191/websub/hub"); +websub:SubscriptionClient websubHubClientEP = new ("http://localhost:23191/websub/hub"); public function main(string... args) { From 6270714cfc964c8efa748edcfb2310c2478d7a84 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Sat, 26 Oct 2019 22:41:55 +0530 Subject: [PATCH 078/167] Introduce separate resources for publishing/subscribing at the hub --- .../src/main/ballerina/src/websub/commons.bal | 47 +- .../src/websub/hub_configuration.bal | 3 +- .../main/ballerina/src/websub/hub_service.bal | 435 +++++++++--------- .../src/main/ballerina/src/websub/natives.bal | 19 +- .../org/ballerinalang/net/websub/hub/Hub.java | 71 ++- .../websub/nativeimpl/StartUpHubService.java | 10 +- .../net/websub/nativeimpl/StopHubService.java | 15 +- .../ValidateAndPublishToInternalHub.java | 2 +- .../advanced_services/01_websub_publisher.bal | 14 +- .../src/services/01_websub_publisher.bal | 6 +- 10 files changed, 349 insertions(+), 273 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index 888b62a2e482..6a00e6e898e9 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -467,16 +467,19 @@ public type RemotePublishConfig record {| # # + hubServiceListener - The `http:Listener` to which the hub service is attached # + basePath - The base path of the hub service -# + resourcePath - The resource path of the hub +# + subscriptionResourcePath - The resource path for subscription changes +# + publishResourcePath - The resource path for publishing and topic registration # + hubConfiguration - The hub specific configuration # + return - `WebSubHub` The WebSubHub object representing the newly started up hub, or `HubStartedUpError` indicating # that the hub is already started, and including the WebSubHub object representing the # already started up hub public function startHub(http:Listener hubServiceListener, public string basePath = "/", - public string resourcePath = "/", public HubConfiguration hubConfiguration = {}) - returns WebSubHub|HubStartedUpError { + public string subscriptionResourcePath = "/", public string publishResourcePath = "/publish", + public HubConfiguration hubConfiguration = {}) returns WebSubHub|HubStartedUpError { hubBasePath = config:getAsString("b7a.websub.hub.basepath", basePath); - hubResourcePath = config:getAsString("b7a.websub.hub.resourcepath", resourcePath); + hubSubscriptionResourcePath = config:getAsString("b7a.websub.hub.resourcepath.subscription", + subscriptionResourcePath); + hubPublishResourcePath = config:getAsString("b7a.websub.hub.resourcepath.publish", publishResourcePath); hubLeaseSeconds = config:getAsInt("b7a.websub.hub.leasetime", hubConfiguration.leaseSeconds); hubSignatureMethod = getSignatureMethod(hubConfiguration.signatureMethod); @@ -495,7 +498,8 @@ public function startHub(http:Listener hubServiceListener, public string basePat } - WebSubHub|HubStartedUpError res = startUpHubService(hubBasePath, hubResourcePath, hubTopicRegistrationRequired, + WebSubHub|HubStartedUpError res = startUpHubService(hubBasePath, hubSubscriptionResourcePath, + hubPublishResourcePath, hubTopicRegistrationRequired, hubPublicUrl, hubServiceListener); if (res is WebSubHub) { startHubService(hubServiceListener); @@ -506,24 +510,39 @@ public function startHub(http:Listener hubServiceListener, public string basePat # Object representing a Ballerina WebSub Hub. # -# + hubUrl - The URL of the started up Ballerina WebSub Hub +# + subscriptionUrl - The URL for subscription changes +# + publishUrl - The URL for publishing and topic registration public type WebSubHub object { - public string hubUrl; + public string subscriptionUrl; + public string publishUrl; private http:Listener hubHttpListener; - public function __init(string hubUrl, http:Listener hubHttpListener) { - self.hubUrl = hubUrl; + public function __init(string subscriptionUrl, string publishUrl, http:Listener hubHttpListener) { + self.subscriptionUrl = subscriptionUrl; + self.publishUrl = publishUrl; self.hubHttpListener = hubHttpListener; } # Stops the started up Ballerina WebSub Hub. # # + return - `boolean` indicating whether the internal Ballerina Hub was stopped - public function stop() returns boolean { - // TODO: return error + public function stop() returns error? { var stopResult = self.hubHttpListener.__immediateStop(); - return stopHubService(self.hubUrl) && !(stopResult is error); + var stopHubServiceResult = stopHubService(self); + + if (stopResult is () && stopHubServiceResult is ()) { + return; + } + + if (stopResult is error) { + if (stopHubServiceResult is error) { + error[] causes = [stopResult, stopHubServiceResult]; + return error(WEBSUB_ERROR_CODE, causes = causes); + } + return error(WEBSUB_ERROR_CODE, cause = stopResult); + } + return error(WEBSUB_ERROR_CODE, cause = stopHubServiceResult); } # Publishes an update against the topic in the initialized Ballerina Hub. @@ -534,7 +553,7 @@ public type WebSubHub object { # + return - `error` if the hub is not initialized or does not represent the internal hub public function publishUpdate(string topic, string|xml|json|byte[]|io:ReadableByteChannel payload, string? contentType = ()) returns error? { - if (self.hubUrl == "") { + if (self.publishUrl == "") { error webSubError = error(WEBSUB_ERROR_CODE, message = "Internal Ballerina Hub not initialized or incorrectly referenced"); return webSubError; @@ -562,7 +581,7 @@ public type WebSubHub object { } } - return validateAndPublishToInternalHub(self.hubUrl, topic, content); + return validateAndPublishToInternalHub(self.publishUrl, topic, content); } # Registers a topic in the Ballerina Hub. diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal index bd2fecd04dad..0f551ec90252 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal @@ -32,7 +32,8 @@ const string DEFAULT_DB_USERNAME = "sa"; const string DEFAULT_DB_PASSWORD = ""; string hubBasePath = "/"; -string hubResourcePath = "/"; +string hubSubscriptionResourcePath = "/"; +string hubPublishResourcePath = "/"; int hubLeaseSeconds = DEFAULT_LEASE_SECONDS_VALUE; string hubSignatureMethod = DEFAULT_SIGNATURE_METHOD; RemotePublishConfig remotePublishConfig = {}; diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 06b04b43876e..481855b72f11 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -28,212 +28,237 @@ import ballerina/time; @tainted map pendingRequests = {}; # This cache is used for caching HTTP clients against the subscriber callbacks. -cache:Cache subscriberCallbackClientCache = new(expiryTimeInMillis = DEFAULT_CACHE_EXPIRY_MILLIS); +cache:Cache subscriberCallbackClientCache = new (expiryTimeInMillis = DEFAULT_CACHE_EXPIRY_MILLIS); function getHubService() returns service { return @http:ServiceConfig { - basePath: hubBasePath, - auth: { - enabled: config:getAsBoolean("b7a.websub.hub.auth.enabled", false), - scopes: getArray(config:getAsString("b7a.websub.hub.auth.scopes")) - } + basePath: hubBasePath, + auth: { + enabled: config:getAsBoolean("b7a.websub.hub.auth.enabled", false), + scopes: getArray(config:getAsString("b7a.websub.hub.auth.scopes")) + } } service { - @http:ResourceConfig { - methods: ["POST"], - path: hubResourcePath - } - resource function hub(http:Caller httpCaller, http:Request request) { - http:Response response = new; - string topic = ""; - - var reqFormParamMap = request.getFormParams(); - map params = reqFormParamMap is map ? reqFormParamMap : {}; - - string mode = params[HUB_MODE] ?: ""; - - var topicFromParams = params[HUB_TOPIC]; - if topicFromParams is string { - var decodedValue = encoding:decodeUriComponent(topicFromParams, "UTF-8"); - topic = decodedValue is string ? decodedValue : topicFromParams; - } - - if (mode == MODE_SUBSCRIBE || mode == MODE_UNSUBSCRIBE) { - boolean validSubscriptionChangeRequest = false; - // TODO: check the non-existing key at this point and return the 400 - var result = params[HUB_CALLBACK]; - string callbackFromParams = params[HUB_CALLBACK] ?: ""; - var decodedCallbackFromParams = encoding:decodeUriComponent(callbackFromParams, "UTF-8"); - string callback = decodedCallbackFromParams is string ? decodedCallbackFromParams : callbackFromParams; - var validationStatus = validateSubscriptionChangeRequest(mode, topic, callback); - if (validationStatus is error) { - response.statusCode = http:STATUS_BAD_REQUEST; - string errorMessage = validationStatus.detail()?.message; - response.setTextPayload(errorMessage); - } else { - validSubscriptionChangeRequest = true; - response.statusCode = http:STATUS_ACCEPTED; - } - - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding to subscription change request", responseError); - } else { - if (validSubscriptionChangeRequest) { - verifyIntentAndAddSubscription(callback, topic, params); - } - } - return; - } else if (mode == MODE_REGISTER) { - if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload("Remote topic registration not allowed/not required at the Hub"); - log:printWarn("Remote topic registration denied at Hub"); - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on remote topic registration failure", responseError); - } - return; - } - - var registerStatus = registerTopicAtHub(topic); - if (registerStatus is error) { - string errorMessage = registerStatus.detail()?.message; - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload(errorMessage); - log:printWarn("Topic registration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); - } else { - response.statusCode = http:STATUS_ACCEPTED; - log:printInfo("Topic registration successful at Hub, for topic[" + topic + "]"); - } - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding remote topic registration status", responseError); - } - } else if (mode == MODE_UNREGISTER) { - if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload("Remote unregistration not allowed/not required at the Hub"); - log:printWarn("Remote topic unregistration denied at Hub"); - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on remote topic unregistration failure", responseError); - } - return; - } - - var unregisterStatus = unregisterTopicAtHub(topic); - if (unregisterStatus is error) { - string errorMessage = unregisterStatus.detail()?.message; - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload(errorMessage); - log:printWarn("Topic unregistration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); - } else { - response.statusCode = http:STATUS_ACCEPTED; - log:printInfo("Topic unregistration successful at Hub, for topic[" + topic + "]"); - } - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding remote topic unregistration status", responseError); - } - } else { - if (mode != MODE_PUBLISH) { - mode = request.getQueryParamValue(HUB_MODE) ?: ""; - string topicValue = request.getQueryParamValue(HUB_TOPIC) ?: ""; - var decodedTopic = encoding:decodeUriComponent(topicValue, "UTF-8"); - topic = decodedTopic is string ? decodedTopic : topicValue; - } - - if (mode == MODE_PUBLISH && remotePublishConfig.enabled) { - if (!hubTopicRegistrationRequired || isTopicRegistered(topic)) { - byte [0] arr = []; - byte[]|error binaryPayload = arr; - string stringPayload; - string contentType = ""; - if (remotePublishConfig.mode == PUBLISH_MODE_FETCH) { - var fetchResponse = fetchTopicUpdate(topic); - if (fetchResponse is http:Response) { - binaryPayload = fetchResponse.getBinaryPayload(); - if (fetchResponse.hasHeader(CONTENT_TYPE)) { - contentType = fetchResponse.getHeader(CONTENT_TYPE); - } - var fetchedPayload = fetchResponse.getTextPayload(); - stringPayload = fetchedPayload is string ? fetchedPayload : ""; - } else { - string errorCause = fetchResponse.detail()?.message; - string errorMessage = "Error fetching updates for topic URL [" + topic + "]: " - + errorCause; - log:printError(errorMessage); - response.setTextPayload(<@untainted string> errorMessage); - response.statusCode = http:STATUS_BAD_REQUEST; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on update fetch failure", responseError); - } - return; - } - } else { - binaryPayload = request.getBinaryPayload(); - if (request.hasHeader(CONTENT_TYPE)) { - contentType = request.getHeader(CONTENT_TYPE); - } - var result = request.getTextPayload(); - stringPayload = result is string ? result : ""; - } - - error? publishStatus = (); - if (binaryPayload is byte[]) { - WebSubContent notification = { payload:binaryPayload, contentType:contentType }; - publishStatus = publishToInternalHub(topic, notification); - } else { - string errorCause = binaryPayload.detail()?.message; - string errorMessage = "Error extracting payload: " + <@untainted string> errorCause; - log:printError(errorMessage); - response.statusCode = http:STATUS_BAD_REQUEST; - response.setTextPayload(errorMessage); - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on payload extraction failure for" - + " publish request", responseError); - } - return; - } - - if (publishStatus is error) { - string errorCause = publishStatus.detail()?.message; - string errorMessage = "Update notification failed for Topic [" + topic + "]: " + errorCause; - response.setTextPayload(<@untainted string> errorMessage); - log:printError(errorMessage); - } else { - log:printInfo("Update notification done for Topic [" + topic + "]"); - response.statusCode = http:STATUS_ACCEPTED; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding on update notification for topic[" + topic - + "]", responseError); - } - return; - } - } else { - string errorMessage = "Publish request denied for unregistered topic[" + topic + "]"; - log:printDebug(errorMessage); - response.setTextPayload(<@untainted string> errorMessage); - } - response.statusCode = http:STATUS_BAD_REQUEST; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding to publish request", responseError); - } - } else { - response.statusCode = http:STATUS_BAD_REQUEST; - var responseError = httpCaller->respond(response); - if (responseError is error) { - log:printError("Error responding to request", responseError); - } - } - } - } + @http:ResourceConfig { + methods: ["POST"], + path: hubPublishResourcePath + } + resource function publish(http:Caller httpCaller, http:Request request) { + http:Response response = new; + string topic = ""; + + var reqFormParamMap = request.getFormParams(); + map params = reqFormParamMap is map ? reqFormParamMap : {}; + + string mode = params[HUB_MODE] ?: ""; + + var topicFromParams = params[HUB_TOPIC]; + if topicFromParams is string { + var decodedValue = encoding:decodeUriComponent(topicFromParams, "UTF-8"); + topic = decodedValue is string ? decodedValue : topicFromParams; + } + + if (mode == MODE_REGISTER) { + if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload("Remote topic registration not allowed/not required at the Hub"); + log:printWarn("Remote topic registration denied at Hub"); + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on remote topic registration failure", responseError); + } + return; + } + + var registerStatus = registerTopicAtHub(topic); + if (registerStatus is error) { + string errorMessage = registerStatus.detail()?.message; + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload(errorMessage); + log:printWarn("Topic registration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); + } else { + response.statusCode = http:STATUS_ACCEPTED; + log:printInfo("Topic registration successful at Hub, for topic[" + topic + "]"); + } + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding remote topic registration status", responseError); + } + } else if (mode == MODE_UNREGISTER) { + if (!remotePublishConfig.enabled || !hubTopicRegistrationRequired) { + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload("Remote unregistration not allowed/not required at the Hub"); + log:printWarn("Remote topic unregistration denied at Hub"); + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on remote topic unregistration failure", responseError); + } + return; + } + + var unregisterStatus = unregisterTopicAtHub(topic); + if (unregisterStatus is error) { + string errorMessage = unregisterStatus.detail()?.message; + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload(errorMessage); + log:printWarn("Topic unregistration unsuccessful at Hub for Topic[" + topic + "]: " + errorMessage); + } else { + response.statusCode = http:STATUS_ACCEPTED; + log:printInfo("Topic unregistration successful at Hub, for topic[" + topic + "]"); + } + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding remote topic unregistration status", responseError); + } + } else { + if (mode != MODE_PUBLISH) { + mode = request.getQueryParamValue(HUB_MODE) ?: ""; + string topicValue = request.getQueryParamValue(HUB_TOPIC) ?: ""; + var decodedTopic = encoding:decodeUriComponent(topicValue, "UTF-8"); + topic = decodedTopic is string ? decodedTopic : topicValue; + } + + if (mode == MODE_PUBLISH && remotePublishConfig.enabled) { + if (!hubTopicRegistrationRequired || isTopicRegistered(topic)) { + byte[0] arr = []; + byte[] | error binaryPayload = arr; + string stringPayload; + string contentType = ""; + if (remotePublishConfig.mode == PUBLISH_MODE_FETCH) { + var fetchResponse = fetchTopicUpdate(topic); + if (fetchResponse is http:Response) { + binaryPayload = fetchResponse.getBinaryPayload(); + if (fetchResponse.hasHeader(CONTENT_TYPE)) { + contentType = fetchResponse.getHeader(CONTENT_TYPE); + } + var fetchedPayload = fetchResponse.getTextPayload(); + stringPayload = fetchedPayload is string ? fetchedPayload : ""; + } else { + string errorCause = fetchResponse.detail()?.message; + string errorMessage = "Error fetching updates for topic URL [" + topic + "]: " + + errorCause; + log:printError(errorMessage); + response.setTextPayload(<@untaintedstring>errorMessage); + response.statusCode = http:STATUS_BAD_REQUEST; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on update fetch failure", responseError); + } + return; + } + } else { + binaryPayload = request.getBinaryPayload(); + if (request.hasHeader(CONTENT_TYPE)) { + contentType = request.getHeader(CONTENT_TYPE); + } + var result = request.getTextPayload(); + stringPayload = result is string ? result : ""; + } + + error? publishStatus = (); + if (binaryPayload is byte[]) { + WebSubContent notification = {payload: binaryPayload, contentType: contentType}; + publishStatus = publishToInternalHub(topic, notification); + } else { + string errorCause = binaryPayload.detail()?.message; + string errorMessage = "Error extracting payload: " + <@untaintedstring>errorCause; + log:printError(errorMessage); + response.statusCode = http:STATUS_BAD_REQUEST; + response.setTextPayload(errorMessage); + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on payload extraction failure for" + + " publish request", responseError); + } + return; + } + + if (publishStatus is error) { + string errorCause = publishStatus.detail()?.message; + string errorMessage = "Update notification failed for Topic [" + topic + "]: " + errorCause; + response.setTextPayload(<@untaintedstring>errorMessage); + log:printError(errorMessage); + } else { + log:printInfo("Update notification done for Topic [" + topic + "]"); + response.statusCode = http:STATUS_ACCEPTED; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding on update notification for topic[" + topic + + "]", responseError); + } + return; + } + } else { + string errorMessage = "Publish request denied for unregistered topic[" + topic + "]"; + log:printDebug(errorMessage); + response.setTextPayload(<@untaintedstring>errorMessage); + } + response.statusCode = http:STATUS_BAD_REQUEST; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding to publish request", responseError); + } + } else { + response.statusCode = http:STATUS_BAD_REQUEST; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding to request", responseError); + } + } + } + } + + @http:ResourceConfig { + methods: ["POST"], + path: hubSubscriptionResourcePath + } + resource function subscribe(http:Caller httpCaller, http:Request request) { + http:Response response = new; + string topic = ""; + + var reqFormParamMap = request.getFormParams(); + map params = reqFormParamMap is map ? reqFormParamMap : {}; + + string mode = params[HUB_MODE] ?: ""; + + var topicFromParams = params[HUB_TOPIC]; + if topicFromParams is string { + var decodedValue = encoding:decodeUriComponent(topicFromParams, "UTF-8"); + topic = decodedValue is string ? decodedValue : topicFromParams; + } + + if (mode != MODE_SUBSCRIBE && mode != MODE_UNSUBSCRIBE) { + response.statusCode = http:STATUS_BAD_REQUEST; + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding to request", responseError); + } + } + + boolean validSubscriptionChangeRequest = false; + // TODO: check the non-existing key at this point and return the 400 + var result = params[HUB_CALLBACK]; + string callbackFromParams = params[HUB_CALLBACK] ?: ""; + var decodedCallbackFromParams = encoding:decodeUriComponent(callbackFromParams, "UTF-8"); + string callback = decodedCallbackFromParams is string ? decodedCallbackFromParams : callbackFromParams; + var validationStatus = validateSubscriptionChangeRequest(mode, topic, callback); + if (validationStatus is error) { + response.statusCode = http:STATUS_BAD_REQUEST; + string errorMessage = validationStatus.detail()?.message; + response.setTextPayload(errorMessage); + } else { + validSubscriptionChangeRequest = true; + response.statusCode = http:STATUS_ACCEPTED; + } + + var responseError = httpCaller->respond(response); + if (responseError is error) { + log:printError("Error responding to subscription change request", responseError); + } else if (validSubscriptionChangeRequest) { + verifyIntentAndAddSubscription(callback, topic, params); + } + } }; } @@ -371,7 +396,7 @@ function persistTopicRegistrationChange(string mode, string topic) { function persistSubscriptionChange(string mode, SubscriptionDetails subscriptionDetails) { HubPersistenceStore? hubStoreImpl = hubPersistenceStoreImpl; if (hubStoreImpl is HubPersistenceStore) { - if (mode == MODE_SUBSCRIBE) { + if (mode == MODE_SUBSCRIBE) { hubStoreImpl.addSubscription(subscriptionDetails); } else { hubStoreImpl.removeSubscription(subscriptionDetails); @@ -396,7 +421,7 @@ function addTopicRegistrationsOnStartup(HubPersistenceStore persistenceStore) { var registerStatus = registerTopicAtHub(topic, loadingOnStartUp = true); if (registerStatus is error) { string errCause = registerStatus.detail()?.message; - log:printError("Error registering retrieved topic details: "+ errCause); + log:printError("Error registering retrieved topic details: " + errCause); } } } @@ -539,9 +564,9 @@ type PendingSubscriptionChangeRequest object { public string callback; public function __init(string mode, string topic, string callback) { - self.mode = mode; - self.topic = topic; - self.callback = callback; + self.mode = mode; + self.topic = topic; + self.callback = callback; } # Function to check if two pending subscription change requests are equal. diff --git a/stdlib/websub/src/main/ballerina/src/websub/natives.bal b/stdlib/websub/src/main/ballerina/src/websub/natives.bal index a6d7e5817bf1..689335e2a17b 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/natives.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/natives.bal @@ -23,7 +23,8 @@ import ballerina/io; # Starts up the internal Ballerina Hub. # # + basePath - The base path of the hub service -# + resourcePath - The resource path of the hub +# + subscriptionResourcePath - The resource path for subscription +# + publishResourcePath - The resource path for publishing and topic registration # + topicRegistrationRequired - Whether a topic needs to be registered at the hub prior to publishing/subscribing # to the topic # + publicUrl - The URL for the hub to be included in content delivery requests, defaults to @@ -32,15 +33,15 @@ import ballerina/io; # + return - `WebSubHub` The WebSubHub object representing the newly started up hub, or `HubStartedUpError` indicating # that the hub is already started, and including the WebSubHub object representing the # already started up hub -function startUpHubService(string basePath, string resourcePath, boolean topicRegistrationRequired, - string publicUrl, http:Listener hubListener) returns WebSubHub|HubStartedUpError = external; +function startUpHubService(string basePath, string subscriptionResourcePath, string publishResourcePath, + boolean topicRegistrationRequired, string publicUrl, http:Listener hubListener) + returns WebSubHub|HubStartedUpError = external; # Stop the Ballerina Hub, if started. # -# + hubUrl - The URL of the Hub service -# + return - `boolean` True if the Ballerina Hub had been started up and was stopped now, false if the Hub had not been -# started up -function stopHubService(string hubUrl) returns boolean = external; +# + hub - The WebSubHub object returned when starting the hub +# + return - `()` if the Ballerina Hub had been started up and was stopped now, `error` if not +function stopHubService(WebSubHub hub) returns error? = external; # Adds a new subscription for the specified topic in the Ballerina Hub. # @@ -84,10 +85,10 @@ function isTopicRegistered(string topic) returns boolean = external; /////////////////////////////////////////////////////////////////// # Publishes an update against the topic in the Ballerina Hub. # -# + hubUrl - The URL of the Ballerina WebSub Hub as included in the WebSubHub struct +# + publishUrl - The publisher URL of the Ballerina WebSub Hub as included in the WebSubHub object # + topic - The topic for which the update should happen # + content - The content to send to subscribers, with the payload and content-type specified # + return - `error` if an error occurred during publishing -function validateAndPublishToInternalHub(string hubUrl, string topic, WebSubContent content) returns error? = external; +function validateAndPublishToInternalHub(string publishUrl, string topic, WebSubContent content) returns error? = external; function constructByteArray(io:ReadableByteChannel byteChannel) returns byte[] = external; diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java index ec3e59eeda7f..dbd933e59c02 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java @@ -51,7 +51,8 @@ public class Hub { private static Hub instance = new Hub(); private BallerinaBroker brokerInstance = null; private ObjectValue hubObject = null; - private String hubUrl; + private String publishUrl; + private String subscribeUrl; private boolean hubTopicRegistrationRequired; private boolean hubPersistenceEnabled; private volatile boolean started = false; @@ -62,7 +63,8 @@ public class Hub { private ClassLoader classLoader = this.getClass().getClassLoader(); private String basePath = "/"; - private String resourcePath = "/"; + private String publishResourcePath = "/publish"; + private String subscribeResourcePath = "/"; private static final String HUB_SERVICE = "hub_service"; private static final String SLASH = "/"; @@ -74,8 +76,8 @@ public static Hub getInstance() { private Hub() { } - public String getHubUrl() { - return hubUrl; + public String getPublishUrl() { + return publishUrl; } public ObjectValue getHubObject() { @@ -198,15 +200,16 @@ public boolean isStarted() { * * @param strand current strand * @param basePath the base path of the hub service - * @param resourcePath the resource path of the hub + * @param subscriptionResourcePath the resource path for subscription + * @param publishResourcePath the resource path for publishing and topic registration * @param topicRegistrationRequired whether a topic needs to be registered at the hub prior to * publishing/subscribing to the topic * @param publicUrl the URL for the hub to be included in content delivery requests * @param hubListener the http:Listener to which the hub service is attached */ @SuppressWarnings("unchecked") - public void startUpHubService(Strand strand, String basePath, String resourcePath, - boolean topicRegistrationRequired, String publicUrl, + public void startUpHubService(Strand strand, String basePath, String subscriptionResourcePath, + String publishResourcePath, boolean topicRegistrationRequired, String publicUrl, ObjectValue hubListener) { synchronized (this) { if (!isStarted()) { @@ -216,21 +219,27 @@ public void startUpHubService(Strand strand, String basePath, String resourcePat throw new BallerinaException("Error starting up internal broker for WebSub Hub"); } this.basePath = basePath.startsWith(SLASH) ? basePath : SLASH.concat(basePath); - this.resourcePath = resourcePath.startsWith(SLASH) ? resourcePath : SLASH.concat(resourcePath); + this.subscribeResourcePath = subscriptionResourcePath.startsWith(SLASH) ? subscriptionResourcePath : + SLASH.concat(subscriptionResourcePath); + this.publishResourcePath = publishResourcePath.startsWith(SLASH) ? publishResourcePath : + SLASH.concat(publishResourcePath); hubTopicRegistrationRequired = topicRegistrationRequired; - String hubUrl = populateHubUrl(publicUrl, hubListener); + String publishUrl = populatePublishUrl(publicUrl, hubListener); + String subscribeUrl = populateSubscribeUrl(publicUrl, hubListener); //TODO: change once made public and available as a param Object returnValue = executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, "hub_configuration", "isHubPersistenceEnabled"); hubPersistenceEnabled = Boolean.parseBoolean(returnValue.toString()); PrintStream console = System.err; - console.println("[ballerina/websub] Default Ballerina WebSub Hub started up at " + hubUrl); + console.println("[ballerina/websub] Ballerina WebSub Hub started up.\n[ballerina/websub] Publish URL:" + + " " + publishUrl + "\n[ballerina/websub] Subscription URL: " + subscribeUrl); started = true; executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, HUB_SERVICE, "setupOnStartup"); - setHubUrl(hubUrl); - setHubObject(BallerinaValues.createObjectValue(WEBSUB_PACKAGE_ID, STRUCT_WEBSUB_BALLERINA_HUB, hubUrl, - hubListener)); + setPublishUrl(publishUrl); + setSubscribeUrl(subscribeUrl); + setHubObject(BallerinaValues.createObjectValue(WEBSUB_PACKAGE_ID, STRUCT_WEBSUB_BALLERINA_HUB, + subscribeUrl, publishUrl, hubListener)); } else { throw new BallerinaWebSubException("Hub Service already started up"); } @@ -238,16 +247,29 @@ public void startUpHubService(Strand strand, String basePath, String resourcePat } @SuppressWarnings("unchecked") - private String populateHubUrl(String hubUrl, ObjectValue hubListener) { - if (hubUrl.isEmpty()) { + private String populatePublishUrl(String publicUrl, ObjectValue hubListener) { + if (publicUrl.isEmpty()) { String hubPort = String.valueOf(hubListener.get("port")); Object secureSocket = ((MapValue) hubListener.get("config")).get("secureSocket"); - String path = basePath.equals(SLASH) ? resourcePath : basePath.concat(resourcePath); - hubUrl = secureSocket != null ? ("https://localhost:" + hubPort + path) + String path = basePath.equals(SLASH) ? publishResourcePath : basePath.concat(publishResourcePath); + publicUrl = secureSocket != null ? ("https://localhost:" + hubPort + path) : ("http://localhost:" + hubPort + path); } - return hubUrl; + return publicUrl; + } + + @SuppressWarnings("unchecked") + private String populateSubscribeUrl(String publicUrl, ObjectValue hubListener) { + if (publicUrl.isEmpty()) { + String hubPort = String.valueOf(hubListener.get("port")); + Object secureSocket = ((MapValue) hubListener.get("config")).get("secureSocket"); + + String path = basePath.equals(SLASH) ? subscribeResourcePath : basePath.concat(subscribeResourcePath); + publicUrl = secureSocket != null ? ("https://localhost:" + hubPort + path) + : ("http://localhost:" + hubPort + path); + } + return publicUrl; } /** @@ -258,7 +280,8 @@ public void stopHubService() { if (isStarted()) { started = false; setHubObject(null); - setHubUrl(null); + setSubscribeUrl(null); + setPublishUrl(null); hubTopicRegistrationRequired = false; hubPersistenceEnabled = false; topics = new ArrayList<>(); @@ -268,13 +291,17 @@ public void stopHubService() { subscribers = new ArrayList<>(); brokerInstance = null; } else { - throw new BallerinaWebSubException("Hub Service already stopped"); + throw new BallerinaWebSubException("error stopping the hub service: already stopped"); } } } - private void setHubUrl(String hubUrl) { - this.hubUrl = hubUrl; + private void setSubscribeUrl(String subscribeUrl) { + this.subscribeUrl = subscribeUrl; + } + + private void setPublishUrl(String publishUrl) { + this.publishUrl = publishUrl; } private void setHubObject(ObjectValue hubObject) { diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java index 42c2f3bced38..cf61aa0513c0 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java @@ -48,16 +48,16 @@ ) public class StartUpHubService { - public static Object startUpHubService(Strand strand, String basePath, String resourcePath, - boolean topicRegistrationRequired, String publicUrl, - ObjectValue hubListener) { + public static Object startUpHubService(Strand strand, String basePath, String subscriptionResourcePath, + String publishResourcePath, boolean topicRegistrationRequired, + String publicUrl, ObjectValue hubListener) { Hub hubInstance = Hub.getInstance(); if (hubInstance.isStarted()) { return getHubStartedUpError(hubInstance); } try { - hubInstance.startUpHubService(strand, basePath, resourcePath, topicRegistrationRequired, publicUrl, - hubListener); + hubInstance.startUpHubService(strand, basePath, subscriptionResourcePath, publishResourcePath, + topicRegistrationRequired, publicUrl, hubListener); } catch (BallerinaWebSubException e) { return getHubStartedUpError(hubInstance); } diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java index bf048abef5ea..cb6cfd6f5bb6 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java @@ -23,6 +23,7 @@ import org.ballerinalang.natives.annotations.BallerinaFunction; import org.ballerinalang.natives.annotations.ReturnType; import org.ballerinalang.net.websub.BallerinaWebSubException; +import org.ballerinalang.net.websub.WebSubUtils; import org.ballerinalang.net.websub.hub.Hub; /** @@ -33,21 +34,25 @@ @BallerinaFunction( orgName = "ballerina", packageName = "websub", functionName = "stopHubService", - returnType = {@ReturnType(type = TypeKind.BOOLEAN)}, + returnType = {@ReturnType(type = TypeKind.ERROR), @ReturnType(type = TypeKind.NIL)}, isPublic = true ) public class StopHubService { - public static boolean stopHubService(Strand strand, String hubUrl) { + public static Object stopHubService(Strand strand, Object hub) { Hub hubInstance = Hub.getInstance(); if (hubInstance.isStarted()) { try { + if (hubInstance.getHubObject() != hub) { + return WebSubUtils.createError("error stopping the hub service: hub object does not match the " + + "started hub"); + } hubInstance.stopHubService(); - return true; + return null; } catch (BallerinaWebSubException e) { - return false; + return WebSubUtils.createError(e.getMessage()); } } - return false; + return WebSubUtils.createError("error stopping the hub service: hub service not started"); } } diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/ValidateAndPublishToInternalHub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/ValidateAndPublishToInternalHub.java index f22ecf6dec73..a6c4f6c9949b 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/ValidateAndPublishToInternalHub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/ValidateAndPublishToInternalHub.java @@ -48,7 +48,7 @@ public class ValidateAndPublishToInternalHub { public static Object validateAndPublishToInternalHub(Strand strand, String hubUrl, String topic, MapValue content) { Hub hubInstance = Hub.getInstance(); - if (hubInstance.isStarted() && hubInstance.getHubUrl().equals(hubUrl)) { + if (hubInstance.isStarted() && hubInstance.getPublishUrl().equals(hubUrl)) { try { Hub.getInstance().publish(topic, content); } catch (BallerinaWebSubException e) { diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal index 675edfa6ba1d..e95cc3ed2c01 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal @@ -39,7 +39,7 @@ auth:OutboundBasicAuthProvider OutBoundbasicAuthProvider = new({ http:BasicAuthHandler outboundBasicAuthHandler = new(OutBoundbasicAuthProvider); -websub:PublisherClient websubHubClientEP = new (webSubHub.hubUrl, { +websub:PublisherClient websubHubClientEP = new (webSubHub.publishUrl, { auth: { authHandler: outboundBasicAuthHandler }, secureSocket: { trustStore: { @@ -56,7 +56,7 @@ service publisher on publisherServiceEP { resource function discover(http:Caller caller, http:Request req) { http:Response response = new; // Add a link header indicating the hub and topic - websub:addWebSubLinkHeader(response, [webSubHub.hubUrl], WEBSUB_PERSISTENCE_TOPIC_ONE); + websub:addWebSubLinkHeader(response, [webSubHub.subscriptionUrl], WEBSUB_PERSISTENCE_TOPIC_ONE); var err = caller->accepted(response); if (err is error) { log:printError("Error responding on discovery", err); @@ -94,7 +94,7 @@ service publisherTwo on publisherServiceEP { resource function discover(http:Caller caller, http:Request req) { http:Response response = new; // Add a link header indicating the hub and topic - websub:addWebSubLinkHeader(response, [webSubHub.hubUrl], WEBSUB_PERSISTENCE_TOPIC_TWO); + websub:addWebSubLinkHeader(response, [webSubHub.subscriptionUrl], WEBSUB_PERSISTENCE_TOPIC_TWO); var err = caller->accepted(response); if (err is error) { log:printError("Error responding on discovery", err); @@ -131,7 +131,7 @@ service publisherThree on publisherServiceEP { resource function discover(http:Caller caller, http:Request req) { http:Response response = new; // Add a link header indicating the hub and topic - websub:addWebSubLinkHeader(response, [webSubHub.hubUrl], WEBSUB_TOPIC_ONE); + websub:addWebSubLinkHeader(response, [webSubHub.subscriptionUrl], WEBSUB_TOPIC_ONE); var err = caller->accepted(response); if (err is error) { log:printError("Error responding on discovery", err); @@ -165,9 +165,7 @@ service helperService on publisherServiceEP { methods: ["POST"] } resource function restartHub(http:Caller caller, http:Request req) { - if (!webSubHub.stop()) { - log:printError("hub shutdown failed!"); - } + checkpanic webSubHub.stop(); webSubHub = startHubAndRegisterTopic(); checkpanic caller->accepted(); } @@ -205,7 +203,7 @@ function startWebSubHub() returns websub:WebSubHub { password: "ballerina" } } - }), "/websub", "/hub", { remotePublish : { enabled : true }}); + }), "/websub", "/hub", hubConfiguration = { remotePublish : { enabled : true }}); if (result is websub:WebSubHub) { return result; } else { diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal index ede9ad3356c2..f7d9d2cb1938 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal @@ -31,7 +31,7 @@ boolean remoteTopicRegistered = false; websub:WebSubHub webSubHub = startHubAndRegisterTopic(); -websub:PublisherClient websubHubClientEP = new (webSubHub.hubUrl); +websub:PublisherClient websubHubClientEP = new (webSubHub.publishUrl); listener http:Listener publisherServiceEP = new http:Listener(23080); @@ -42,7 +42,7 @@ service publisher on publisherServiceEP { resource function discover(http:Caller caller, http:Request req) { http:Response response = new; // Add a link header indicating the hub and topic - websub:addWebSubLinkHeader(response, [webSubHub.hubUrl], WEBSUB_TOPIC_ONE); + websub:addWebSubLinkHeader(response, [webSubHub.subscriptionUrl], WEBSUB_TOPIC_ONE); var err = caller->accepted(response); if (err is error) { log:printError("Error responding on ordering", err); @@ -119,7 +119,7 @@ service publisherTwo on publisherServiceEP { resource function discover(http:Caller caller, http:Request req) { http:Response response = new; // Add a link header indicating the hub and topic - websub:addWebSubLinkHeader(response, [webSubHub.hubUrl], WEBSUB_TOPIC_FOUR); + websub:addWebSubLinkHeader(response, [webSubHub.subscriptionUrl], WEBSUB_TOPIC_FOUR); var err = caller->accepted(response); if (err is error) { log:printError("Error responding on ordering", err); From f8a774ff1a9f0095e8ae6b246f1fbb56e3001d05 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Sun, 27 Oct 2019 09:06:18 +0530 Subject: [PATCH 079/167] Remove reading conf params and allow hub resource level auth --- .../src/main/ballerina/src/websub/Module.md | 24 ++------ .../src/main/ballerina/src/websub/commons.bal | 36 +++++++---- .../src/websub/hub_configuration.bal | 60 ++++--------------- .../main/ballerina/src/websub/hub_service.bal | 12 ++-- .../src/websub/subscriber_service.bal | 28 --------- .../WebSubHubStartUpTest.java | 3 +- .../test-src/hub/test_hub_startup.bal | 8 +-- .../advanced_services/01_websub_publisher.bal | 35 ++++++----- .../src/advanced_services/sample-users.toml | 4 -- 9 files changed, 68 insertions(+), 142 deletions(-) delete mode 100644 stdlib/websub/src/main/ballerina/src/websub/subscriber_service.bal diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index d8b8f8ceb1e4..aa7d001e68f9 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -66,18 +66,14 @@ http:ServiceEndpointConfiguration hubListenerConfig = { var val = websub:startHub(new http:Listener(9191, hubListenerConfig)); ``` -In addition to the `BasicAuthHandler` for the listener, a user also has to specify the `authConfig` properties at the service -config level. +In addition to the `BasicAuthHandler` for the listener, a user also has to specify the `authConfig` properties at the service or resource levels. -It can be populated by providing the `authConfig` via a TOML file under the `b7a.websub.hub.auth` alias. -Recognized users can also be mentioned in the same file, which permits the auth providers to read it. +They can be set by passing arguments for the `serviceAuth`, `subscriptionResourceAuth` or `publisherResourceAuth` parameters when starting up the hub. -``` -[b7a.websub.hub.auth] -enabled=true # enables the authentication -scopes="scope1" # defines the scope of possible users +Recognized users can be specified in a `.toml` file, which can be passed as a configuration file when running the program. +``` [b7a.users] [b7a.users.tom] @@ -319,18 +315,6 @@ public function main() { } ``` -## Configuration Parameters -The Ballerina WebSub implementation allows specifying the following properties/parameters via the Ballerina Config API, -where the values specified via the Config API would override values specified as params on hub start up. - - -| Configuration Key | Default Value | Description | -|--------------------------------| --------------|--------------------------------------------------------------------| -| b7a.websub.hub.leasetime | 86400 | The default lease period, if not specified in a request | -| b7a.websub.hub.signaturemethod | "SHA256" | The signature method to use for authenticated content distribution | -| b7a.websub.hub.remotepublish | false | Whether publishing updates against the topics in the hub could be done by remote publishers via HTTP requests with `hub.mode` set to `publish` | -| b7a.websub.hub.topicregistration | true | Whether a topic needs to be registered at the hub for publishers to publish updates against the topic and for subscribers to send subscription requests for the topic | - ## Introducing Specific Subscriber Services (Webhook Callback Services) Ballerina's WebSub subscriber service listener can be extended to introduce specific Webhooks. diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index 6a00e6e898e9..a56f55243330 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -14,7 +14,6 @@ // specific language governing permissions and limitations // under the License. -import ballerina/config; import ballerina/crypto; import ballerina/encoding; import ballerina/http; @@ -454,7 +453,7 @@ public type HubConfiguration record {| # Record representing remote publishing allowance. # -# + enabled - Whether remote publishers should be allowed to publish to this hub (HTTP requests) // todo remove +# + enabled - Whether remote publishers should be allowed to publish to this hub (HTTP requests) # + mode - If remote publishing is allowed, the mode to use, `direct` (default) - fat ping with # the notification payload specified or `fetch` - the hub fetches the topic URL # specified in the "publish" request to identify the payload @@ -469,27 +468,38 @@ public type RemotePublishConfig record {| # + basePath - The base path of the hub service # + subscriptionResourcePath - The resource path for subscription changes # + publishResourcePath - The resource path for publishing and topic registration +# + serviceAuth - The auth configuration for the hub service +# + subscriptionResourceAuth - The auth configuration for the subscription resource of the hub service +# + publisherResourceAuth - The auth configuration for the publisher resource of the hub service # + hubConfiguration - The hub specific configuration # + return - `WebSubHub` The WebSubHub object representing the newly started up hub, or `HubStartedUpError` indicating # that the hub is already started, and including the WebSubHub object representing the # already started up hub -public function startHub(http:Listener hubServiceListener, public string basePath = "/", - public string subscriptionResourcePath = "/", public string publishResourcePath = "/publish", +public function startHub(http:Listener hubServiceListener, + public string basePath = "/", + public string subscriptionResourcePath = "/", + public string publishResourcePath = "/publish", + public http:ServiceResourceAuth serviceAuth = {enabled:false}, + public http:ServiceResourceAuth subscriptionResourceAuth = {enabled:false}, + public http:ServiceResourceAuth publisherResourceAuth = {enabled:false}, public HubConfiguration hubConfiguration = {}) returns WebSubHub|HubStartedUpError { - hubBasePath = config:getAsString("b7a.websub.hub.basepath", basePath); - hubSubscriptionResourcePath = config:getAsString("b7a.websub.hub.resourcepath.subscription", - subscriptionResourcePath); - hubPublishResourcePath = config:getAsString("b7a.websub.hub.resourcepath.publish", publishResourcePath); - hubLeaseSeconds = config:getAsInt("b7a.websub.hub.leasetime", - hubConfiguration.leaseSeconds); + + hubBasePath = basePath; + hubSubscriptionResourcePath = subscriptionResourcePath; + hubPublishResourcePath = publishResourcePath; + + hubServiceAuth = serviceAuth; + hubSubscriptionResourceAuth = subscriptionResourceAuth; + hubPublisherResourceAuth = publisherResourceAuth; + + hubLeaseSeconds = hubConfiguration.leaseSeconds; hubSignatureMethod = getSignatureMethod(hubConfiguration.signatureMethod); remotePublishConfig = getRemotePublishConfig(hubConfiguration["remotePublish"]); - hubTopicRegistrationRequired = config:getAsBoolean("b7a.websub.hub.topicregistration", - hubConfiguration.topicRegistrationRequired); + hubTopicRegistrationRequired = hubConfiguration.topicRegistrationRequired; // reset the hubUrl once the other parameters are set. if url is an empty string, create hub url with listener // configs in the native code - hubPublicUrl = config:getAsString("b7a.websub.hub.url", hubConfiguration["publicUrl"] ?: ""); + hubPublicUrl = hubConfiguration["publicUrl"] ?: ""; hubClientConfig = hubConfiguration["clientConfig"]; hubPersistenceStoreImpl = hubConfiguration["hubPersistenceStore"]; diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal index 0f551ec90252..ea917ac3b08e 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal @@ -14,10 +14,7 @@ // specific language governing permissions and limitations // under the License. -import ballerina/config; import ballerina/http; -import ballerina/log; -import ballerina/stringutils; const string DEFAULT_HOST = "0.0.0.0"; @@ -25,15 +22,14 @@ const int DEFAULT_LEASE_SECONDS_VALUE = 86400; //one day const string DEFAULT_SIGNATURE_METHOD = "SHA256"; const int DEFAULT_CACHE_EXPIRY_MILLIS = 172800000; -//TODO: Fix persistence configs, H2? -const string DEFAULT_DB_DIRECTORY = "/tmp/websubdb"; -const string DEFAULT_DB_NAME = "HUB_DB"; -const string DEFAULT_DB_USERNAME = "sa"; -const string DEFAULT_DB_PASSWORD = ""; - string hubBasePath = "/"; string hubSubscriptionResourcePath = "/"; -string hubPublishResourcePath = "/"; +string hubPublishResourcePath = "/publish"; + +http:ServiceResourceAuth hubServiceAuth = {enabled: false}; +http:ServiceResourceAuth hubSubscriptionResourceAuth = {enabled: false}; +http:ServiceResourceAuth hubPublisherResourceAuth = {enabled: false}; + int hubLeaseSeconds = DEFAULT_LEASE_SECONDS_VALUE; string hubSignatureMethod = DEFAULT_SIGNATURE_METHOD; RemotePublishConfig remotePublishConfig = {}; @@ -67,50 +63,18 @@ function isHubTopicRegistrationRequired() returns boolean { return hubTopicRegistrationRequired; } - function getSignatureMethod(SignatureMethod? signatureMethod) returns string { - string signaturemethodAsConfig = config:getAsString("b7a.websub.hub.signaturemethod"); - if (signaturemethodAsConfig == "") { - match signatureMethod { - "SHA256" => { - return "SHA256"; - } - "SHA1" => { - return "SHA1"; - } - } - } else { - if (stringutils:equalsIgnoreCase(signaturemethodAsConfig, SHA1)) { - return signaturemethodAsConfig; + match signatureMethod { + "SHA256" => { + return "SHA256"; } - if (!stringutils:equalsIgnoreCase(signaturemethodAsConfig, SHA256)) { - log:printWarn("unknown signature method : [" + signaturemethodAsConfig + "], defaulting to SHA256"); + "SHA1" => { + return "SHA1"; } } return DEFAULT_SIGNATURE_METHOD; } function getRemotePublishConfig(RemotePublishConfig? remotePublish) returns RemotePublishConfig { - RemotePublishMode hubRemotePublishMode = PUBLISH_MODE_DIRECT; - boolean remotePublishingEnabled = false; - if (remotePublish is RemotePublishConfig) { - remotePublishingEnabled = config:getAsBoolean("b7a.websub.hub.remotepublish", remotePublish.enabled); - } - - - string remotePublishModeAsConfig = config:getAsString("b7a.websub.hub.remotepublish.mode"); - if (remotePublishModeAsConfig == "") { - if (remotePublish is RemotePublishConfig) { - hubRemotePublishMode = remotePublish.mode; - } else { - hubRemotePublishMode = PUBLISH_MODE_DIRECT; - } - } else { - if (stringutils:equalsIgnoreCase(remotePublishModeAsConfig, REMOTE_PUBLISHING_MODE_FETCH)) { - hubRemotePublishMode = PUBLISH_MODE_FETCH; - } else if (!stringutils:equalsIgnoreCase(remotePublishModeAsConfig, REMOTE_PUBLISHING_MODE_DIRECT)) { - log:printWarn("unknown publish mode: [" + remotePublishModeAsConfig + "], defaulting to direct mode"); - } - } - return { enabled : remotePublishingEnabled, mode : hubRemotePublishMode }; + return remotePublish is RemotePublishConfig ? remotePublish : {}; } diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 481855b72f11..801a3e36206c 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -15,7 +15,6 @@ // under the License. import ballerina/cache; -import ballerina/config; import ballerina/crypto; import ballerina/encoding; import ballerina/http; @@ -33,16 +32,14 @@ cache:Cache subscriberCallbackClientCache = new (expiryTimeInMillis = DEFAULT_CA function getHubService() returns service { return @http:ServiceConfig { basePath: hubBasePath, - auth: { - enabled: config:getAsBoolean("b7a.websub.hub.auth.enabled", false), - scopes: getArray(config:getAsString("b7a.websub.hub.auth.scopes")) - } + auth: hubServiceAuth } service { @http:ResourceConfig { methods: ["POST"], - path: hubPublishResourcePath + path: hubPublishResourcePath, + auth: hubPublisherResourceAuth } resource function publish(http:Caller httpCaller, http:Request request) { http:Response response = new; @@ -211,7 +208,8 @@ function getHubService() returns service { @http:ResourceConfig { methods: ["POST"], - path: hubSubscriptionResourcePath + path: hubSubscriptionResourcePath, + auth: hubSubscriptionResourceAuth } resource function subscribe(http:Caller httpCaller, http:Request request) { http:Response response = new; diff --git a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service.bal b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service.bal deleted file mode 100644 index 4400acd6fc5e..000000000000 --- a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service.bal +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2018 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -//# The object representing the WebSub Subscriber Service. -//public type Service object { -// -// # Returns the WebSub Listener endpoint to which this service binds. -// # -// # + return - WebSub `Listener` endpoint -// public function getEndpoint() returns Listener { -// Listener ep = new; -// return ep; -// } -// -//}; diff --git a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartUpTest.java b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartUpTest.java index 8613a0802370..30dc79907698 100644 --- a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartUpTest.java +++ b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartUpTest.java @@ -87,8 +87,7 @@ public void testHubShutdownAndStart() { @AfterClass public void tearDown() { - //TODO Uncomment following once test suite is migrated to jBal types and values -// BRunUtil.invoke(result, "stopHub", new BValue[]{hubStartUpObject}); + BRunUtil.invoke(result, "stopHub", new BValue[]{hubStartUpObject}); } } diff --git a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal index aae33028468f..1a5b2b42f6d4 100644 --- a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal +++ b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal @@ -21,12 +21,10 @@ function startupHub(int hubPort) returns websub:WebSubHub|websub:HubStartedUpErr return websub:startHub(new http:Listener(hubPort), "/websub", "/hub"); } -//TODO change function to accept websub:WebSubHub|websub:HubStartedUpError hubStartUpResult once test migration is done -function stopHub(int hubPort) returns boolean { - var hubStartUpResult = websub:startHub(new http:Listener(hubPort)); +function stopHub(websub:WebSubHub|websub:HubStartedUpError hubStartUpResult) { if (hubStartUpResult is websub:WebSubHub) { - return hubStartUpResult.stop(); + checkpanic hubStartUpResult.stop(); } else { - return hubStartUpResult.startedUpHub.stop(); + checkpanic hubStartUpResult.startedUpHub.stop(); } } diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal index e95cc3ed2c01..cc581d7c3376 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal @@ -40,7 +40,9 @@ auth:OutboundBasicAuthProvider OutBoundbasicAuthProvider = new({ http:BasicAuthHandler outboundBasicAuthHandler = new(OutBoundbasicAuthProvider); websub:PublisherClient websubHubClientEP = new (webSubHub.publishUrl, { - auth: { authHandler: outboundBasicAuthHandler }, + auth: { + authHandler: outboundBasicAuthHandler + }, secureSocket: { trustStore: { path: config:getAsString("truststore"), @@ -190,20 +192,23 @@ function startHubAndRegisterTopic() returns websub:WebSubHub { function startWebSubHub() returns websub:WebSubHub { var result = websub:startHub(new http:Listener(23191, config = { - auth: { - authHandlers: [basicAuthHandler] - }, - secureSocket: { - keyStore: { - path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", - password: "ballerina" - }, - trustStore: { - path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", - password: "ballerina" - } - } - }), "/websub", "/hub", hubConfiguration = { remotePublish : { enabled : true }}); + auth: { + authHandlers: [basicAuthHandler] + }, + secureSocket: { + keyStore: { + path: "${ballerina.home}/bre/security/ballerinaKeystore.p12", + password: "ballerina" + }, + trustStore: { + path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", + password: "ballerina" + } + } + }), "/websub", "/hub", + serviceAuth = {enabled:true}, subscriptionResourceAuth = {enabled:true, scopes:["scope1"]}, + hubConfiguration = { remotePublish : { enabled : true }} + ); if (result is websub:WebSubHub) { return result; } else { diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml index 9ea465c133dd..3ae5a804983f 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml @@ -1,7 +1,3 @@ -[b7a.websub.hub.auth] -enabled=true -scopes="scope1" - [b7a.users] [b7a.users.tom] From 4dcaddd6edbd50a043d13701a7f6e452a003f159 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Sun, 27 Oct 2019 10:12:59 +0530 Subject: [PATCH 080/167] Update the WebSub Ballerina.toml with missing platform libs --- .../websub/src/main/ballerina/Ballerina.toml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/stdlib/websub/src/main/ballerina/Ballerina.toml b/stdlib/websub/src/main/ballerina/Ballerina.toml index 92463b572931..9bac6279d84c 100644 --- a/stdlib/websub/src/main/ballerina/Ballerina.toml +++ b/stdlib/websub/src/main/ballerina/Ballerina.toml @@ -116,3 +116,52 @@ target = "java8" path = "./lib/netty-tcnative-boringssl-static-2.0.25.Final.jar" groupId = "io.netty" modules = ["web-sub"] + + [[platform.libraries]] + artifactId = "broker-core" + version = "0.970.5" + path = "./lib/broker-core-0.970.5.jar" + groupId = "io.ballerina.messaging" + modules = ["web-sub"] + + [[platform.libraries]] + artifactId = "broker-common" + version = "0.970.0" + path = "./lib/broker-common-0.970.0.jar" + groupId = "io.ballerina.messaging" + modules = ["web-sub"] + + [[platform.libraries]] + artifactId = "broker-auth" + version = "0.970.0" + path = "./lib/broker-auth-0.970.0.jar" + groupId = "io.ballerina.messaging" + modules = ["web-sub"] + + [[platform.libraries]] + artifactId = "broker-rest-runner" + version = "0.970.0" + path = "./lib/broker-rest-runner-0.970.0.jar" + groupId = "io.ballerina.messaging" + modules = ["web-sub"] + + [[platform.libraries]] + artifactId = "broker-coordination" + version = "0.970.0" + path = "./lib/broker-coordination-0.970.0.jar" + groupId = "io.ballerina.messaging" + modules = ["web-sub"] + + [[platform.libraries]] + artifactId = "org.wso2.carbon.metrics.core" + version = "2.3.7" + path = "./lib/org.wso2.carbon.metrics.core-2.3.7.jar" + groupId = "org.wso2.carbon.metrics" + modules = ["web-sub"] + + [[platform.libraries]] + artifactId = "guava" + version = "19.0" + path = "./lib/guava-19.0.jar" + groupId = "com.google.guava" + modules = ["web-sub"] From 3c675ce0a19e59a243def3731f5d9ef621572670 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Sun, 27 Oct 2019 12:17:57 +0530 Subject: [PATCH 081/167] Add authn/authz tests for the publish resource --- .../test/service/websub/WebSubTestUtils.java | 10 ++- .../advanced/WebSubSecureHubTestCase.java | 18 +++-- .../advanced_services/01_websub_publisher.bal | 67 ++++++++++++++++--- .../src/advanced_services/sample-users.toml | 8 ++- 4 files changed, 84 insertions(+), 19 deletions(-) diff --git a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/WebSubTestUtils.java b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/WebSubTestUtils.java index e28a207eb907..2d49a35b0032 100644 --- a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/WebSubTestUtils.java +++ b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/WebSubTestUtils.java @@ -21,6 +21,7 @@ import io.netty.handler.codec.http.HttpHeaderNames; import org.ballerinalang.test.context.BallerinaTestException; import org.ballerinalang.test.util.HttpClientRequest; +import org.ballerinalang.test.util.HttpResponse; import org.ballerinalang.test.util.TestConstant; import java.io.IOException; @@ -43,17 +44,22 @@ public class WebSubTestUtils { public static final String CONTENT_TYPE_STRING = "string"; public static final String PATH_SEPARATOR = "/"; - public static void requestUpdate(String url, String mode, String contentType) throws BallerinaTestException { + public static HttpResponse requestUpdateAndGetResponse(String url, String mode, String contentType) + throws BallerinaTestException { try { HashMap headers = new HashMap<>(1); headers.put(HttpHeaderNames.CONTENT_TYPE.toString(), TestConstant.CONTENT_TYPE_JSON); - HttpClientRequest.doPost(url, "{\"mode\":\"" + mode + "\",\"content_type\":\"" + contentType + "\"}", + return HttpClientRequest.doPost(url, "{\"mode\":\"" + mode + "\",\"content_type\":\"" + contentType + "\"}", headers); } catch (IOException e) { throw new BallerinaTestException("Error requesting content delivery"); } } + public static void requestUpdate(String url, String mode, String contentType) throws BallerinaTestException { + requestUpdateAndGetResponse(url, mode, contentType); + } + public static void requestUpdateWithContent(String url, String content) throws BallerinaTestException { try { HashMap headers = new HashMap<>(1); diff --git a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/advanced/WebSubSecureHubTestCase.java b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/advanced/WebSubSecureHubTestCase.java index fc368ef7864d..f91cb52ecd20 100644 --- a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/advanced/WebSubSecureHubTestCase.java +++ b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/advanced/WebSubSecureHubTestCase.java @@ -22,6 +22,8 @@ import org.ballerinalang.test.context.BServerInstance; import org.ballerinalang.test.context.BallerinaTestException; import org.ballerinalang.test.context.LogLeecher; +import org.ballerinalang.test.util.HttpResponse; +import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -37,6 +39,7 @@ import static org.ballerinalang.test.service.websub.WebSubTestUtils.PUBLISHER_NOTIFY_URL; import static org.ballerinalang.test.service.websub.WebSubTestUtils.PUBLISHER_NOTIFY_URL_THREE; import static org.ballerinalang.test.service.websub.WebSubTestUtils.requestUpdate; +import static org.ballerinalang.test.service.websub.WebSubTestUtils.requestUpdateAndGetResponse; /** * This class tests basic auth support for WebSub Hub. @@ -50,6 +53,7 @@ public class WebSubSecureHubTestCase extends WebSubAdvancedBaseTest { private static final int LOG_LEECHER_TIMEOUT = 45000; private static final int WEBSUB_PORT = 23484; private BServerInstance webSubSubscriber; + private HttpResponse httpResponse = null; private static final String INTENT_VERIFICATION_SUBSCRIBER_ONE_LOG = "ballerina: Intent Verification agreed - " + "Mode [subscribe], Topic [http://one.persistence.topic.com], Lease Seconds [3600]"; @@ -65,7 +69,7 @@ public class WebSubSecureHubTestCase extends WebSubAdvancedBaseTest { "Mode [subscribe], Topic [http://one.websub.topic.com], Lease Seconds [1200]"; private static final String INTERNAL_HUB_NOTIFICATION_SUBSCRIBER_ONE_LOG = "WebSub Notification Received by One: {\"mode\":\"internal\", \"content_type\":\"json\"}"; - private static final String INTERNAL_HUB_NOTIFICATION_SUBSCRIBER_TWO_LOG = + private static final String REMOTE_HUB_NOTIFICATION_SUBSCRIBER_TWO_LOG = "WebSub Notification Received by Four: {\"mode\":\"remote\", \"content_type\":\"xml\"}"; private LogLeecher intentVerificationLogLeecherOne = new LogLeecher(INTENT_VERIFICATION_SUBSCRIBER_ONE_LOG); @@ -74,8 +78,8 @@ public class WebSubSecureHubTestCase extends WebSubAdvancedBaseTest { private LogLeecher intentVerificationLogLeecherFour = new LogLeecher(INTENT_VERIFICATION_SUBSCRIBER_FOUR_LOG); private LogLeecher internalHubNotificationLogLeecherOne = new LogLeecher(INTERNAL_HUB_NOTIFICATION_SUBSCRIBER_ONE_LOG); - private LogLeecher internalHubNotificationLogLeecherTwo = - new LogLeecher(INTERNAL_HUB_NOTIFICATION_SUBSCRIBER_TWO_LOG); + private LogLeecher remoteHubNotificationLogLeecherTwo = + new LogLeecher(REMOTE_HUB_NOTIFICATION_SUBSCRIBER_TWO_LOG); @BeforeClass public void setup() throws BallerinaTestException { @@ -93,7 +97,7 @@ public void setup() throws BallerinaTestException { webSubSubscriber.addErrorLogLeecher(intentVerificationLogLeecherThree); webSubSubscriber.addLogLeecher(intentVerificationLogLeecherFour); webSubSubscriber.addLogLeecher(internalHubNotificationLogLeecherOne); - webSubSubscriber.addLogLeecher(internalHubNotificationLogLeecherTwo); + webSubSubscriber.addLogLeecher(remoteHubNotificationLogLeecherTwo); webSubSubscriber.startServer(subscriberBal, new String[0], args, new int[]{WEBSUB_PORT}); } @@ -105,13 +109,15 @@ public void testDiscoveryAndIntentVerification() throws BallerinaTestException { intentVerificationLogLeecherThree.waitForText(LOG_LEECHER_TIMEOUT); intentVerificationLogLeecherFour.waitForText(LOG_LEECHER_TIMEOUT); requestUpdate(PUBLISHER_NOTIFY_URL + PATH_SEPARATOR + WEBSUB_PORT, HUB_MODE_INTERNAL, CONTENT_TYPE_JSON); - requestUpdate(PUBLISHER_NOTIFY_URL_THREE, HUB_MODE_REMOTE, CONTENT_TYPE_XML); + httpResponse = requestUpdateAndGetResponse(PUBLISHER_NOTIFY_URL_THREE, HUB_MODE_REMOTE, CONTENT_TYPE_XML); } @Test(dependsOnMethods = "testDiscoveryAndIntentVerification") public void testContentReceipt() throws BallerinaTestException { internalHubNotificationLogLeecherOne.waitForText(LOG_LEECHER_TIMEOUT); - internalHubNotificationLogLeecherTwo.waitForText(LOG_LEECHER_TIMEOUT); + remoteHubNotificationLogLeecherTwo.waitForText(LOG_LEECHER_TIMEOUT); + Assert.assertEquals(httpResponse.getData(), "Error occurred publishing update: Authentication failure." + + "Error occurred publishing update: Authorization failure."); } @AfterClass diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal index cc581d7c3376..957007b578de 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal @@ -32,12 +32,10 @@ websub:WebSubHub webSubHub = startHubAndRegisterTopic(); listener http:Listener publisherServiceEP = new http:Listener(23080); -auth:OutboundBasicAuthProvider OutBoundbasicAuthProvider = new({ - username: "peter", - password: "pqr" -}); - -http:BasicAuthHandler outboundBasicAuthHandler = new(OutBoundbasicAuthProvider); +http:BasicAuthHandler outboundBasicAuthHandler = new(new auth:OutboundBasicAuthProvider({ + username: "anne", + password: "abc" + })); websub:PublisherClient websubHubClientEP = new (webSubHub.publishUrl, { auth: { @@ -51,6 +49,40 @@ websub:PublisherClient websubHubClientEP = new (webSubHub.publishUrl, { } }); +http:BasicAuthHandler authnFailingHandler = new(new auth:OutboundBasicAuthProvider({ + username: "anne", + password: "cba" + })); + +websub:PublisherClient authnFailingClient = new (webSubHub.publishUrl, { + auth: { + authHandler: authnFailingHandler + }, + secureSocket: { + trustStore: { + path: config:getAsString("truststore"), + password: "ballerina" + } + } +}); + +http:BasicAuthHandler authzFailingHandler = new(new auth:OutboundBasicAuthProvider({ + username: "peter", + password: "pqr" + })); + +websub:PublisherClient authzFailingClient = new (webSubHub.publishUrl, { + auth: { + authHandler: authzFailingHandler + }, + secureSocket: { + trustStore: { + path: config:getAsString("truststore"), + password: "ballerina" + } + } +}); + service publisher on publisherServiceEP { @http:ResourceConfig { methods: ["GET", "HEAD"] @@ -149,13 +181,28 @@ service publisherThree on publisherServiceEP { panic payload; } checkSubscriberAvailability(WEBSUB_TOPIC_ONE, "http://localhost:23484/websubFour"); + + string publishErrorMessagesConcatenated = ""; + var err = websubHubClientEP->publishUpdate(WEBSUB_TOPIC_ONE, <@untainted> payload); if (err is error) { + publishErrorMessagesConcatenated += err.detail()?.message ?: ""; log:printError("Error publishing update remotely", err); } - http:Response response = new; - err = caller->accepted(response); + err = authnFailingClient->publishUpdate(WEBSUB_TOPIC_ONE, <@untainted> payload); + if (err is error) { + publishErrorMessagesConcatenated += err.detail()?.message ?: ""; + log:printError("Error publishing update remotely", err); + } + + err = authzFailingClient->publishUpdate(WEBSUB_TOPIC_ONE, <@untainted> payload); + if (err is error) { + publishErrorMessagesConcatenated += err.detail()?.message ?: ""; + log:printError("Error publishing update remotely", err); + } + + err = caller->accepted(<@untainted> publishErrorMessagesConcatenated); if (err is error) { log:printError("Error responding on notify request", err); } @@ -206,7 +253,9 @@ function startWebSubHub() returns websub:WebSubHub { } } }), "/websub", "/hub", - serviceAuth = {enabled:true}, subscriptionResourceAuth = {enabled:true, scopes:["scope1"]}, + serviceAuth = {enabled:true}, + subscriptionResourceAuth = {enabled:true, scopes:["subscribe"]}, + publisherResourceAuth = {enabled:true, scopes:["publish"]}, hubConfiguration = { remotePublish : { enabled : true }} ); if (result is websub:WebSubHub) { diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml index 3ae5a804983f..ed4decc53eba 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/sample-users.toml @@ -2,7 +2,7 @@ [b7a.users.tom] password="1234" -scopes="scope1" +scopes="subscribe" [b7a.users.mary] password="xyz" @@ -10,4 +10,8 @@ scopes="scope2" [b7a.users.peter] password="pqr" -scopes="scope1" +scopes="subscribe" + +[b7a.users.anne] +password="abc" +scopes="publish" From bebe299f30d1523462e32f5de34c65033603d970 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Sun, 27 Oct 2019 16:57:09 +0530 Subject: [PATCH 082/167] Allow hub persistence store to return errors --- .../src/main/ballerina/src/websub/commons.bal | 32 ++++-- .../ballerina/src/websub/hub_persistence.bal | 25 +++-- .../main/ballerina/src/websub/hub_service.bal | 102 ++++++++++-------- .../src/main/ballerina/src/websub/natives.bal | 7 +- .../org/ballerinalang/net/websub/hub/Hub.java | 46 ++++---- ...Hub.java => RegisterTopicAtNativeHub.java} | 11 +- .../websub/nativeimpl/StartUpHubService.java | 12 +-- ...b.java => UnregisterTopicAtNativeHub.java} | 8 +- .../advanced_services/01_websub_publisher.bal | 4 +- .../src/services/01_websub_publisher.bal | 4 +- 10 files changed, 141 insertions(+), 110 deletions(-) rename stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/{RegisterTopicAtHub.java => RegisterTopicAtNativeHub.java} (83%) rename stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/{UnregisterTopicAtHub.java => UnregisterTopicAtNativeHub.java} (87%) diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index a56f55243330..f8a5f9825dae 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -482,7 +482,8 @@ public function startHub(http:Listener hubServiceListener, public http:ServiceResourceAuth serviceAuth = {enabled:false}, public http:ServiceResourceAuth subscriptionResourceAuth = {enabled:false}, public http:ServiceResourceAuth publisherResourceAuth = {enabled:false}, - public HubConfiguration hubConfiguration = {}) returns WebSubHub|HubStartedUpError { + public HubConfiguration hubConfiguration = {}) + returns WebSubHub|HubStartedUpError|HubStartupError { hubBasePath = basePath; hubSubscriptionResourcePath = subscriptionResourcePath; @@ -508,9 +509,10 @@ public function startHub(http:Listener hubServiceListener, } - WebSubHub|HubStartedUpError res = startUpHubService(hubBasePath, hubSubscriptionResourcePath, - hubPublishResourcePath, hubTopicRegistrationRequired, - hubPublicUrl, hubServiceListener); + WebSubHub|HubStartedUpError|HubStartupError res = startUpHubService(hubBasePath, hubSubscriptionResourcePath, + hubPublishResourcePath, + hubTopicRegistrationRequired, hubPublicUrl, + hubServiceListener); if (res is WebSubHub) { startHubService(hubServiceListener); } @@ -603,7 +605,7 @@ public type WebSubHub object { error e = error(WEBSUB_ERROR_CODE, message = "Topic registration not allowed/not required at the Hub"); return e; } - return registerTopicAtHub(topic); + return registerTopic(topic); } # Unregisters a topic in the Ballerina Hub. @@ -615,7 +617,7 @@ public type WebSubHub object { error e = error(WEBSUB_ERROR_CODE, message = "Topic unregistration not allowed/not required at the Hub"); return e; } - return unregisterTopicAtHub(topic); + return unregisterTopic(topic); } # Retrieves topics currently recognized by the Hub. @@ -666,6 +668,20 @@ function retrieveSubscriberServiceAnnotations(service serviceType) returns Subsc return serviceTypedesc.@SubscriberServiceConfig; } +function registerTopic(string topic, boolean loadingOnStartUp = false) returns error? { + check registerTopicAtNativeHub(topic); + if (hubPersistenceEnabled && !loadingOnStartUp) { + return persistTopicRegistrationChange(MODE_REGISTER, topic); + } +} + +function unregisterTopic(string topic) returns error? { + check unregisterTopicAtNativeHub(topic); + if (hubPersistenceEnabled) { + return persistTopicRegistrationChange(MODE_UNREGISTER, topic); + } +} + # Record to represent a WebSub content delivery. # # + payload - The payload to be sent @@ -705,3 +721,7 @@ type WebSubError record { string message = ""; }; +# Represents the reason string for the `websub:HubStartupError`. +public const HUB_STARTUP_REASON = "{ballerina/websub}HubStartupError"; +# Represents a hub startup error. +public type HubStartupError error; \ No newline at end of file diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_persistence.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_persistence.bal index 660564514701..906a4b50d4e3 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_persistence.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_persistence.bal @@ -20,30 +20,35 @@ public type HubPersistenceStore abstract object { # Function to add or update subscription details. # # + subscriptionDetails - The details of the subscription to add or update - public function addSubscription(SubscriptionDetails subscriptionDetails); + # + return - `error` if an error occurred while adding the subscription, `()` otherwise + public function addSubscription(SubscriptionDetails subscriptionDetails) returns error?; # Function to remove subscription details. # # + subscriptionDetails - The details of the subscription to remove - public function removeSubscription(SubscriptionDetails subscriptionDetails); + # + return - `error` if an error occurred while removing the subscription, `()` otherwise + public function removeSubscription(SubscriptionDetails subscriptionDetails) returns error?; # Function to add a topic. # # + topic - The topic to add - public function addTopic(string topic); + # + return - `error` if an error occurred while adding the topic, `()` otherwise + public function addTopic(string topic) returns error?; # Function to remove a topic. # # + topic - The topic to remove - public function removeTopic(string topic); + # + return - `error` if an error occurred while removing the topic, `()` otherwise + public function removeTopic(string topic) returns error?; - # Function to retrieve all registered topics. + # Function to retrieve subscription details of all subscribers. # - # + return - An array of topics - public function retrieveTopics() returns string[]; + # + return - `error` if an error occurred while retrieving the subscriptions, an array of subscriber details + # otherwise + public function retrieveAllSubscribers() returns SubscriptionDetails[]|error; - # Function to retrieve subscription details of all subscribers. + # Function to retrieve all registered topics. # - # + return - An array of subscriber details - public function retrieveAllSubscribers() returns SubscriptionDetails[]; + # + return - `error` if an error occurred while retrieving the topics, an array of topics otherwise + public function retrieveTopics() returns string[]|error; }; diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 801a3e36206c..4dd5cca1b60c 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -68,7 +68,7 @@ function getHubService() returns service { return; } - var registerStatus = registerTopicAtHub(topic); + var registerStatus = registerTopic(topic); if (registerStatus is error) { string errorMessage = registerStatus.detail()?.message; response.statusCode = http:STATUS_BAD_REQUEST; @@ -94,7 +94,7 @@ function getHubService() returns service { return; } - var unregisterStatus = unregisterTopicAtHub(topic); + var unregisterStatus = unregisterTopic(topic); if (unregisterStatus is error) { string errorMessage = unregisterStatus.detail()?.message; response.statusCode = http:STATUS_BAD_REQUEST; @@ -334,7 +334,7 @@ function verifyIntentAndAddSubscription(string callback, string topic, map registerStatus.detail()?.message; log:printError("Error registering topic for subscription: " + errCause); @@ -345,11 +345,14 @@ function verifyIntentAndAddSubscription(string callback, string topic, map err.detail()?.message; - log:printInfo("Error sending intent verification request for callback URL: [" + callback + "]: " + errCause); + log:printError("Error sending intent verification request for callback URL: [" + callback + "]: " + errCause); } PendingSubscriptionChangeRequest pendingSubscriptionChangeRequest = new(mode, topic, callback); string key = generateKey(topic, callback); @@ -376,13 +379,14 @@ function verifyIntentAndAddSubscription(string callback, string topic, map hubPersistenceStoreImpl; - addTopicRegistrationsOnStartup(hubServicePersistenceImpl); - addSubscriptionsOnStartup(hubServicePersistenceImpl); //TODO:verify against topics +function setupOnStartup() returns error? { + if (!hubPersistenceEnabled) { + return; } - return; + HubPersistenceStore hubServicePersistenceImpl = hubPersistenceStoreImpl; + check addTopicRegistrationsOnStartup(hubServicePersistenceImpl); + check addSubscriptionsOnStartup(hubServicePersistenceImpl); //TODO:verify against topics } -# Function to load persisted topic registrations. -function addTopicRegistrationsOnStartup(HubPersistenceStore persistenceStore) { - string[] topics = persistenceStore.retrieveTopics(); - foreach string topic in topics { - var registerStatus = registerTopicAtHub(topic, loadingOnStartUp = true); - if (registerStatus is error) { - string errCause = registerStatus.detail()?.message; - log:printError("Error registering retrieved topic details: " + errCause); +function addTopicRegistrationsOnStartup(HubPersistenceStore persistenceStore) returns error? { + string[]|error topics = persistenceStore.retrieveTopics(); + + if (topics is string[]) { + foreach string topic in topics { + var registerStatus = registerTopic(topic, loadingOnStartUp = true); + if (registerStatus is error) { + string errCause = registerStatus.detail()?.message; + log:printError("Error registering retrieved topic details: " + errCause); + } } + } else { + return HubStartupError(message = "Error retrieving persisted topics", cause = topics); } } -# Function to add subscriptions to the broker on startup, if persistence is enabled. -function addSubscriptionsOnStartup(HubPersistenceStore persistenceStore) { - SubscriptionDetails[] subscriptions = persistenceStore.retrieveAllSubscribers(); +function addSubscriptionsOnStartup(HubPersistenceStore persistenceStore) returns error? { + SubscriptionDetails[]|error subscriptions = persistenceStore.retrieveAllSubscribers(); - foreach SubscriptionDetails subscription in subscriptions { - int time = time:currentTime().time; - if (time - subscription.leaseSeconds > subscription.createdAt) { - persistenceStore.removeSubscription(subscription); - continue; + if (subscriptions is SubscriptionDetails[]) { + foreach SubscriptionDetails subscription in subscriptions { + int time = time:currentTime().time; + if (time - subscription.leaseSeconds > subscription.createdAt) { + error? remResult = persistenceStore.removeSubscription(subscription); + log:printError("Error removing expired subscription", remResult); + continue; + } + addSubscription(subscription); } - addSubscription(subscription); + } else { + return HubStartupError(message = "Error retrieving persisted subscriptions", cause = subscriptions); } } @@ -456,13 +468,11 @@ function fetchTopicUpdate(string topic) returns http:Response|error { # + callback - The callback URL registered for the subscriber # + subscriptionDetails - The subscription details for the particular subscriber # + webSubContent - The content to be sent to subscribers -# + return - Nil if successful, error in case of invalid content-type -function distributeContent(string callback, SubscriptionDetails subscriptionDetails, WebSubContent webSubContent) -returns error? { +function distributeContent(string callback, SubscriptionDetails subscriptionDetails, WebSubContent webSubContent) { http:Client callbackEp = getSubcriberCallbackClient(callback); http:Request request = new; request.setPayload(webSubContent.payload); - check request.setContentType(webSubContent.contentType); + checkpanic request.setContentType(webSubContent.contentType); int currentTime = time:currentTime().time; int createdAt = subscriptionDetails.createdAt; @@ -472,7 +482,10 @@ returns error? { //TODO: introduce a separate periodic task, and modify select to select only active subs removeSubscription(subscriptionDetails.topic, callback); if (hubPersistenceEnabled) { - persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); + error? remResult = persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); + if (remResult is error) { + log:printError("Error removing expired subscription", remResult); + } } } else { var result = request.getTextPayload(); @@ -504,7 +517,10 @@ returns error? { } else if (respStatusCode == http:STATUS_GONE) { removeSubscription(subscriptionDetails.topic, callback); if (hubPersistenceEnabled) { - persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); + error? remResult = persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); + if (remResult is error) { + log:printError("Error removing gone subscription", remResult); + } } log:printInfo("HTTP 410 response code received: Subscription deleted for callback[" + callback + "], topic[" + subscriptionDetails.topic + "]"); diff --git a/stdlib/websub/src/main/ballerina/src/websub/natives.bal b/stdlib/websub/src/main/ballerina/src/websub/natives.bal index 689335e2a17b..5651e21ea3c2 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/natives.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/natives.bal @@ -35,7 +35,7 @@ import ballerina/io; # already started up hub function startUpHubService(string basePath, string subscriptionResourcePath, string publishResourcePath, boolean topicRegistrationRequired, string publicUrl, http:Listener hubListener) - returns WebSubHub|HubStartedUpError = external; + returns WebSubHub|HubStartedUpError|HubStartupError = external; # Stop the Ballerina Hub, if started. # @@ -64,15 +64,14 @@ function removeSubscription(string topic, string callback) = external; # Registers a topic in the Ballerina Hub. # # + topic - The topic to register -# + loadingOnStartUp - Whether registration is being called on loading from the database at start up # + return - `error` if an error occurred with registration -function registerTopicAtHub(string topic, boolean loadingOnStartUp = false) returns error? = external; +function registerTopicAtNativeHub(string topic) returns error? = external; # Unregisters a topic in the Ballerina Hub. # # + topic - The topic to unregister # + return - `error` if an error occurred with unregistration -function unregisterTopicAtHub(string topic) returns error? = external; +function unregisterTopicAtNativeHub(string topic) returns error? = external; # Retrieves whether a topic is registered with the Ballerina Hub. # diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java index dbd933e59c02..639865fc653c 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java @@ -19,6 +19,7 @@ package org.ballerinalang.net.websub.hub; import org.ballerinalang.jvm.BallerinaValues; +import org.ballerinalang.jvm.TypeChecker; import org.ballerinalang.jvm.scheduling.Strand; import org.ballerinalang.jvm.util.exceptions.BallerinaException; import org.ballerinalang.jvm.values.MapValue; @@ -28,6 +29,7 @@ import org.ballerinalang.net.websub.broker.BallerinaBrokerByteBuf; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.wso2.ballerinalang.compiler.util.TypeTags; import java.io.PrintStream; import java.util.ArrayList; @@ -54,7 +56,6 @@ public class Hub { private String publishUrl; private String subscribeUrl; private boolean hubTopicRegistrationRequired; - private boolean hubPersistenceEnabled; private volatile boolean started = false; // TODO: 9/23/18 make CopyOnWriteArrayList? @@ -84,32 +85,20 @@ public ObjectValue getHubObject() { return hubObject; } - public void registerTopic(Strand strand, String topic, boolean loadingOnStartUp) throws BallerinaWebSubException { + public void registerTopic(String topic) throws BallerinaWebSubException { if (isTopicRegistered(topic)) { throw new BallerinaWebSubException("Topic registration not allowed at the Hub: topic already exists"); } else if (topic == null || topic.isEmpty()) { throw new BallerinaWebSubException("Topic unavailable/invalid for registration at Hub"); - } else { - topics.add(topic); - if (hubPersistenceEnabled && !loadingOnStartUp) { - Object[] args = {"register", topic}; - executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, HUB_SERVICE, - "persistTopicRegistrationChange", args); - } } + topics.add(topic); } - public void unregisterTopic(Strand strand, String topic) throws BallerinaWebSubException { + public void unregisterTopic(String topic) throws BallerinaWebSubException { if (topic == null || !isTopicRegistered(topic)) { throw new BallerinaWebSubException("Topic unavailable/invalid for unregistration at Hub"); - } else { - topics.remove(topic); - if (hubPersistenceEnabled) { - Object[] args = {"unregister", topic}; - executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, HUB_SERVICE, - "persistTopicRegistrationChange", args); - } } + topics.remove(topic); } public boolean isTopicRegistered(String topic) { @@ -206,9 +195,10 @@ public boolean isStarted() { * publishing/subscribing to the topic * @param publicUrl the URL for the hub to be included in content delivery requests * @param hubListener the http:Listener to which the hub service is attached + * @return the hub object if the hub was started up successfully, error if not */ @SuppressWarnings("unchecked") - public void startUpHubService(Strand strand, String basePath, String subscriptionResourcePath, + public Object startUpHubService(Strand strand, String basePath, String subscriptionResourcePath, String publishResourcePath, boolean topicRegistrationRequired, String publicUrl, ObjectValue hubListener) { synchronized (this) { @@ -226,20 +216,25 @@ public void startUpHubService(Strand strand, String basePath, String subscriptio hubTopicRegistrationRequired = topicRegistrationRequired; String publishUrl = populatePublishUrl(publicUrl, hubListener); String subscribeUrl = populateSubscribeUrl(publicUrl, hubListener); - //TODO: change once made public and available as a param - Object returnValue = executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, - "hub_configuration", "isHubPersistenceEnabled"); - hubPersistenceEnabled = Boolean.parseBoolean(returnValue.toString()); + + Object setupResult = executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, HUB_SERVICE, + "setupOnStartup"); + if (TypeChecker.getType(setupResult).getTag() == TypeTags.ERROR) { + return setupResult; + } PrintStream console = System.err; console.println("[ballerina/websub] Ballerina WebSub Hub started up.\n[ballerina/websub] Publish URL:" + " " + publishUrl + "\n[ballerina/websub] Subscription URL: " + subscribeUrl); started = true; - executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, HUB_SERVICE, "setupOnStartup"); setPublishUrl(publishUrl); setSubscribeUrl(subscribeUrl); - setHubObject(BallerinaValues.createObjectValue(WEBSUB_PACKAGE_ID, STRUCT_WEBSUB_BALLERINA_HUB, - subscribeUrl, publishUrl, hubListener)); + + ObjectValue hubObject = BallerinaValues.createObjectValue(WEBSUB_PACKAGE_ID, + STRUCT_WEBSUB_BALLERINA_HUB, + subscribeUrl, publishUrl, hubListener); + setHubObject(hubObject); + return hubObject; } else { throw new BallerinaWebSubException("Hub Service already started up"); } @@ -283,7 +278,6 @@ public void stopHubService() { setSubscribeUrl(null); setPublishUrl(null); hubTopicRegistrationRequired = false; - hubPersistenceEnabled = false; topics = new ArrayList<>(); for (HubSubscriber subscriber : getSubscribers()) { brokerInstance.removeSubscription(subscriber); diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RegisterTopicAtHub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RegisterTopicAtNativeHub.java similarity index 83% rename from stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RegisterTopicAtHub.java rename to stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RegisterTopicAtNativeHub.java index 4eb36be58263..8c8f700fcaa7 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RegisterTopicAtHub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RegisterTopicAtNativeHub.java @@ -34,17 +34,16 @@ */ @BallerinaFunction( orgName = "ballerina", packageName = "websub", - functionName = "registerTopicAtHub", - args = {@Argument(name = "topic", type = TypeKind.STRING), - @Argument(name = "loadingOnStartUp", type = TypeKind.BOOLEAN)}, + functionName = "registerTopicAtNativeHub", + args = {@Argument(name = "topic", type = TypeKind.STRING)}, returnType = {@ReturnType(type = TypeKind.OBJECT)}, isPublic = true ) -public class RegisterTopicAtHub { +public class RegisterTopicAtNativeHub { - public static Object registerTopicAtHub(Strand strand, String topic, boolean loadingOnStartUp) { + public static Object registerTopicAtNativeHub(Strand strand, String topic) { try { - Hub.getInstance().registerTopic(strand, topic, loadingOnStartUp); + Hub.getInstance().registerTopic(topic); } catch (BallerinaWebSubException e) { return WebSubUtils.createError(e.getMessage()); } diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java index cf61aa0513c0..abd54a94a2d7 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StartUpHubService.java @@ -26,7 +26,6 @@ import org.ballerinalang.natives.annotations.Argument; import org.ballerinalang.natives.annotations.BallerinaFunction; import org.ballerinalang.natives.annotations.ReturnType; -import org.ballerinalang.net.websub.BallerinaWebSubException; import org.ballerinalang.net.websub.hub.Hub; import static org.ballerinalang.net.websub.WebSubSubscriberConstants.STRUCT_WEBSUB_BALLERINA_HUB_STARTED_UP_ERROR; @@ -43,7 +42,7 @@ args = {@Argument(name = "topicRegistrationRequired", type = TypeKind.BOOLEAN), @Argument(name = "publicUrl", type = TypeKind.STRING), @Argument(name = "hubListener", type = TypeKind.OBJECT)}, - returnType = {@ReturnType(type = TypeKind.OBJECT)}, + returnType = {@ReturnType(type = TypeKind.OBJECT), @ReturnType(type = TypeKind.ERROR)}, isPublic = true ) public class StartUpHubService { @@ -55,13 +54,8 @@ public static Object startUpHubService(Strand strand, String basePath, String su if (hubInstance.isStarted()) { return getHubStartedUpError(hubInstance); } - try { - hubInstance.startUpHubService(strand, basePath, subscriptionResourcePath, publishResourcePath, - topicRegistrationRequired, publicUrl, hubListener); - } catch (BallerinaWebSubException e) { - return getHubStartedUpError(hubInstance); - } - return hubInstance.getHubObject(); + return hubInstance.startUpHubService(strand, basePath, subscriptionResourcePath, publishResourcePath, + topicRegistrationRequired, publicUrl, hubListener); } private static MapValue getHubStartedUpError(Hub hubInstance) { diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/UnregisterTopicAtHub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/UnregisterTopicAtNativeHub.java similarity index 87% rename from stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/UnregisterTopicAtHub.java rename to stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/UnregisterTopicAtNativeHub.java index 877ee0eefd08..64aa805a72c2 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/UnregisterTopicAtHub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/UnregisterTopicAtNativeHub.java @@ -34,16 +34,16 @@ */ @BallerinaFunction( orgName = "ballerina", packageName = "websub", - functionName = "unregisterTopicAtHub", + functionName = "unregisterTopicAtNativeHub", args = {@Argument(name = "topic", type = TypeKind.STRING)}, returnType = {@ReturnType(type = TypeKind.OBJECT)}, isPublic = true ) -public class UnregisterTopicAtHub { +public class UnregisterTopicAtNativeHub { - public static Object unregisterTopicAtHub(Strand strand, String topic) { + public static Object unregisterTopicAtNativeHub(Strand strand, String topic) { try { - Hub.getInstance().unregisterTopic(strand, topic); + Hub.getInstance().unregisterTopic(topic); } catch (BallerinaWebSubException e) { return WebSubUtils.createError(e.getMessage()); } diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal index 957007b578de..274ee3929129 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal @@ -260,8 +260,10 @@ function startWebSubHub() returns websub:WebSubHub { ); if (result is websub:WebSubHub) { return result; - } else { + } else if (result is websub:HubStartedUpError) { return result.startedUpHub; + } else { + panic result; } } diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal index f7d9d2cb1938..8c823f22572c 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal @@ -216,8 +216,10 @@ function startWebSubHub() returns websub:WebSubHub { hubConfiguration = { remotePublish : { enabled : true }}); if (result is websub:WebSubHub) { return result; - } else { + } else if (result is websub:HubStartedUpError) { return result.startedUpHub; + } else { + panic result; } } From 4ee6e4d0b5354aba2fc56bf4cda7f6188a6da1d0 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 19:40:23 +0530 Subject: [PATCH 083/167] Add module based class loader urls map --- .../packerina/buildcontext/BuildContext.java | 4 + distribution/libs/build.gradle | 165 ++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 distribution/libs/build.gradle diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java index 8c720a7e1cf9..7a34d5af083a 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java @@ -44,8 +44,10 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Optional; import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BALLERINA_HOME; @@ -68,6 +70,8 @@ public class BuildContext extends HashMap { private SourceType srcType; private transient PrintStream out; private transient PrintStream err; + + public Map> moduleDependencyPathMap = new HashMap<>(); /** * Create a build context with context fields. diff --git a/distribution/libs/build.gradle b/distribution/libs/build.gradle new file mode 100644 index 000000000000..1883ddf8b67f --- /dev/null +++ b/distribution/libs/build.gradle @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +plugins { + id 'base' +} + +apply from: "$rootDir/gradle/repositories.gradle" + +configurations { + dist { + transitive false + } +} + +dependencies { + dist 'com.squareup.okhttp3:okhttp:3.9.1' + dist 'com.squareup.okio:okio:1.13.0' + dist 'com.uber.jaeger:jaeger-core:0.24.0' + dist 'com.uber.jaeger:jaeger-thrift:0.24.0' + dist 'com.zaxxer:HikariCP:3.3.1' + dist 'io.dropwizard.metrics:metrics-core:3.1.0' + dist 'javax.transaction:javax.transaction-api:1.2' + dist 'org.apache.thrift:libthrift:0.10.0' + dist 'org.jvnet.mimepull:mimepull:1.9.7' + dist 'org.quartz-scheduler:quartz-jobs:2.3.0' + dist 'org.quartz-scheduler:quartz:2.3.0' + dist 'org.wso2.carbon:org.wso2.carbon.core:5.1.0' + dist 'org.wso2.securevault:org.wso2.securevault:1.0.0-wso2v2' + dist 'org.wso2.transport.file:org.wso2.transport.local-file-system:6.0.55' + dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.28' + dist 'org.bouncycastle:bcprov-jdk15on:1.61' + dist 'org.bouncycastle:bcpkix-jdk15on:1.61' + + dist 'info.picocli:picocli:4.0.1' + dist 'org.apache.kafka:kafka-clients:2.0.1' + dist 'org.apache.kafka:kafka_2.11:2.0.1' + dist 'io.ballerina.messaging:broker-auth:0.970.0' + dist 'io.ballerina.messaging:broker-common:0.970.0' + dist 'io.ballerina.messaging:broker-coordination:0.970.0' + dist 'io.ballerina.messaging:broker-core:0.970.5' + dist 'io.ballerina.messaging:broker-rest-runner:0.970.0' + dist 'org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.1' + dist 'org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1' + dist 'com.google.code.gson:gson:2.7' + dist 'com.google.guava:guava:19.0' + dist 'com.github.jknack:handlebars:4.0.6' + dist 'jaxen:jaxen:1.1.6' + dist 'io.netty:netty-buffer:4.1.39.Final' + dist 'io.netty:netty-codec-http2:4.1.39.Final' + dist 'io.netty:netty-codec-http:4.1.39.Final' + dist 'io.netty:netty-codec:4.1.39.Final' + dist 'io.netty:netty-common:4.1.39.Final' + dist 'io.netty:netty-handler-proxy:4.1.39.Final' + dist 'io.netty:netty-handler:4.1.39.Final' + dist 'io.netty:netty-resolver:4.1.39.Final' + dist 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final' + dist 'io.netty:netty-transport:4.1.39.Final' + dist 'commons-pool.wso2:commons-pool:1.5.6.wso2v1' + dist 'org.wso2.carbon.messaging:org.wso2.carbon.messaging:2.3.7' + dist 'org.wso2.carbon.metrics:org.wso2.carbon.metrics.core:2.3.7' + dist 'com.google.protobuf:protobuf-java:3.9.1' + dist 'org.wso2.orbit.org.yaml:snakeyaml:1.16.0.wso2v1' + dist 'org.wso2.staxon:staxon-core:1.2.0.wso2v2' + dist 'com.jcraft:jzlib:1.1.3' + dist 'io.nats:java-nats-streaming:2.2.1' + dist 'io.nats:jnats:2.6.0' + dist 'commons-beanutils:commons-beanutils:1.9.3' + dist 'org.jboss.logging:jboss-logging:3.3.1.Final' + dist 'commons-collections:commons-collections:3.2.2' + dist 'org.apache.geronimo.specs:geronimo-json_1.0_spec:1.0-alpha-1' + dist 'io.netty:netty-transport-native-epoll:4.1.39.Final' + dist 'io.netty:netty-transport-native-kqueue:4.1.39.Final' +// dist 'org.codehaus.woodstox:woodstox-core-asl:4.2.0' +// dist 'org.codehaus.woodstox:stax2-api:3.1.1' + + + + // Lang libs + dist project(':ballerina-auth') + dist project(':ballerina-cli-utils') + dist project(':ballerina-config-api') + dist project(':ballerina-core') + dist project(':ballerina-crypto') + dist project(':ballerina-file') + dist project(':ballerina-filepath') + dist project(':ballerina-grpc') + dist project(':ballerina-jdbc') + dist project(':ballerina-http') + dist project(':ballerina-openapi') + dist project(':ballerina-encoding') + dist project(':ballerina-io') + dist project(':ballerina-lang') + dist project(':ballerina-log-api') + dist project(':ballerina-logging') + dist project(':ballerina-math') + dist project(':ballerina-mime') + dist project(':ballerina-observability') + dist project(':ballerina-reflect') + dist project(':ballerina-runtime-api') + dist project(':ballerina-socket') + dist project(':ballerina-streams') + dist project(':ballerina-system') + dist project(':ballerina-task') + dist project(':ballerina-time') + dist project(':ballerina-tool') + dist project(':ballerina-transactions') + dist project(':ballerina-java') + dist project(':ballerina-java-arrays') + dist project(':ballerina-xslt') + dist project(':ballerina-utils') + dist project(':metrics-extensions:ballerina-metrics-extension') + dist project(':metrics-extensions:ballerina-prometheus-extension') + dist project(':tracing-extensions:ballerina-jaeger-extension') + dist project(':ballerina-kafka') + dist project(':ballerina-nats') + dist project(':ballerina-stringutils') + dist project(':ballerina-jwt') + dist project(':ballerina-oauth2') + dist project(':ballerina-xmlutils') + dist project(':ballerina-jsonutils') + dist project(':ballerina-docker') + dist project(':ballerina-kubernetes') + dist project(':ballerina-istio') + dist project(':ballerina-openshift') + + // Lang libs + dist project(':ballerina-lang:internal') + dist project(':ballerina-lang:annotations') + dist project(':ballerina-lang:array') + dist project(':ballerina-lang:decimal') + dist project(':ballerina-lang:error') + dist project(':ballerina-lang:floatingpoint') + dist project(':ballerina-lang:future') + dist project(':ballerina-lang:integer') + dist project(':ballerina-lang:map') + dist project(':ballerina-lang:object') + dist project(':ballerina-lang:stream') + dist project(':ballerina-lang:string') + dist project(':ballerina-lang:table') + dist project(':ballerina-lang:typedesc') + dist project(':ballerina-lang:value') + dist project(':ballerina-lang:xml') + +} + +task copyDependencies(type: Copy) { + from configurations.dist + into 'libs' +} + From 95638ae45500d1818811bd9a6a206154533046fd Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 19:41:16 +0530 Subject: [PATCH 084/167] Remove temp dir and use class loader per module --- .../packerina/task/CompileTask.java | 6 + .../packerina/task/CopyModuleJarTask.java | 66 +++----- .../packerina/task/CopyNativeLibTask.java | 146 +++++++++--------- .../packerina/task/CreateBaloTask.java | 2 +- .../packerina/task/CreateExecutableTask.java | 40 +---- .../packerina/task/CreateJarTask.java | 74 ++++++--- 6 files changed, 160 insertions(+), 174 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CompileTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CompileTask.java index e44e05e62995..c79706a46f34 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CompileTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CompileTask.java @@ -29,6 +29,7 @@ import org.wso2.ballerinalang.compiler.util.CompilerContext; import java.nio.file.Path; +import java.util.HashSet; import java.util.List; import static org.ballerinalang.tool.LauncherUtils.createLauncherException; @@ -50,6 +51,7 @@ public void execute(BuildContext buildContext) { if (null != balFile) { BLangPackage compiledModule = compiler.build(balFile.toString()); singleFileContext.setModule(compiledModule); + buildContext.moduleDependencyPathMap.put(compiledModule.packageID, new HashSet<>()); } else { throw createLauncherException("unable to find ballerina source"); } @@ -57,6 +59,7 @@ public void execute(BuildContext buildContext) { SingleModuleContext moduleContext = buildContext.get(BuildContextField.SOURCE_CONTEXT); BLangPackage compiledModule = compiler.build(moduleContext.getModuleName()); moduleContext.setModule(compiledModule); + buildContext.moduleDependencyPathMap.put(compiledModule.packageID, new HashSet<>()); } else { MultiModuleContext multiModuleContext = buildContext.get(BuildContextField.SOURCE_CONTEXT); List compiledModules = compiler.compilePackages(true); @@ -64,6 +67,9 @@ public void execute(BuildContext buildContext) { throw createLauncherException("no modules found to compile."); } multiModuleContext.setModules(compiledModules); + for (BLangPackage bLangPackage: compiledModules) { + buildContext.moduleDependencyPathMap.put(bLangPackage.packageID, new HashSet<>()); + } } // check if there are any build errors diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyModuleJarTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyModuleJarTask.java index f3e2bebdb725..d1af6cba1e63 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyModuleJarTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyModuleJarTask.java @@ -25,17 +25,15 @@ import org.wso2.ballerinalang.compiler.tree.BLangPackage; import org.wso2.ballerinalang.compiler.util.ProjectDirs; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; -import static org.ballerinalang.tool.LauncherUtils.createLauncherException; import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_COMPILED_JAR_EXT; -import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.TARGET_TMP_DIRECTORY; /** * Copy module jars to target/tmp. @@ -54,64 +52,54 @@ public CopyModuleJarTask() { @Override public void execute(BuildContext buildContext) { - Path targetDir = buildContext.get(BuildContextField.TARGET_DIR); - Path tmpDir = targetDir.resolve(TARGET_TMP_DIRECTORY); Path sourceRootPath = buildContext.get(BuildContextField.SOURCE_ROOT); String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); - try { - if (!tmpDir.toFile().exists()) { - Files.createDirectory(tmpDir); - } - } catch (IOException e) { - throw createLauncherException("unable to create tmp directory in target :" + e.getMessage()); - } // Copy module jar List moduleBirMap = buildContext.getModules(); - copyModuleJar(buildContext, moduleBirMap, tmpDir); + copyModuleJar(buildContext, moduleBirMap); // Copy imported jars. - copyImportedJars(buildContext, moduleBirMap, sourceRootPath, tmpDir, balHomePath); + copyImportedJars(buildContext, moduleBirMap, sourceRootPath, balHomePath); } - private void copyModuleJar(BuildContext buildContext, List moduleBirMap, Path tmpDir) { + private void copyModuleJar(BuildContext buildContext, List moduleBirMap) { for (BLangPackage module : moduleBirMap) { // get the jar path of the module. Path jarOutput = buildContext.getJarPathFromTargetCache(module.packageID); - Path jarTarget = tmpDir.resolve(jarOutput.getFileName()); - try { - Files.copy(jarOutput, jarTarget, StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - throw createLauncherException("unable to copy the module jar :" + e.getMessage()); - } + buildContext.moduleDependencyPathMap.get(module.packageID).add(jarOutput); } } private void copyImportedJars(BuildContext buildContext, List moduleBirMap, Path sourceRootPath, - Path tmpDir, String balHomePath) { + String balHomePath) { // Imported jar - HashSet alreadyImportedSet = new HashSet<>(); + Map alreadyImportedMap = new HashMap<>(); for (BLangPackage pkg : moduleBirMap) { - copyImportedJars(pkg.symbol.imports, buildContext, sourceRootPath, tmpDir, balHomePath, alreadyImportedSet); + copyImportedJars(pkg.symbol.imports, buildContext, sourceRootPath, balHomePath, + buildContext.moduleDependencyPathMap.get(pkg.packageID), alreadyImportedMap); } } - private void copyImportedJars(List imports, BuildContext buildContext, Path sourceRootPath, - Path tmpDir, String balHomePath, HashSet alreadyImportedSet) { + private void copyImportedJars(List imports, BuildContext buildContext, + Path sourceRootPath, String balHomePath, HashSet moduleDependencyList, + Map alreadyImportedMap) { for (BPackageSymbol importSymbol : imports) { PackageID pkgId = importSymbol.pkgID; - String id = pkgId.toString(); - if (alreadyImportedSet.contains(id)) { - continue; + Path importedPath = alreadyImportedMap.get(pkgId); + if (importedPath != null) { + moduleDependencyList.add(importedPath); + } else { + copyImportedJar(buildContext, importSymbol, sourceRootPath, balHomePath, + moduleDependencyList, alreadyImportedMap); } - alreadyImportedSet.add(id); - copyImportedJar(buildContext, importSymbol, sourceRootPath, tmpDir, balHomePath); - copyImportedJars(importSymbol.imports, buildContext, sourceRootPath, - tmpDir, balHomePath, alreadyImportedSet); + copyImportedJars(importSymbol.imports, buildContext, sourceRootPath, balHomePath, moduleDependencyList, + alreadyImportedMap); } } private void copyImportedJar(BuildContext buildContext, BPackageSymbol importz, - Path project, Path tmpDir, String balHomePath) { + Path project, String balHomePath, HashSet moduleDependencyList, + Map alreadyImportedMap) { PackageID id = importz.pkgID; String moduleJarName = id.orgName.value + "-" + id.name.value + "-" + id.version.value + BLANG_COMPILED_JAR_EXT; @@ -138,11 +126,7 @@ private void copyImportedJar(BuildContext buildContext, BPackageSymbol importz, importJar = Paths.get(balHomePath, "bre", "lib", id.name.value + BLANG_COMPILED_JAR_EXT); } } - try { - Path jarTarget = tmpDir.resolve(moduleJarName); - Files.copy(importJar, jarTarget, StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - throw createLauncherException("unable to find the imported jar from the distribution: " + e.getMessage()); - } + moduleDependencyList.add(importJar); + alreadyImportedMap.put(importz.pkgID, importJar); } } diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java index cedd0afc3eeb..d0391f385418 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java @@ -34,10 +34,10 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; @@ -50,8 +50,8 @@ import static org.ballerinalang.packerina.buildcontext.sourcecontext.SourceType.SINGLE_BAL_FILE; import static org.ballerinalang.tool.LauncherUtils.createLauncherException; import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BALO_PLATFORM_LIB_DIR_NAME; +import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_COMPILED_JAR_EXT; import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_PKG_DEFAULT_VERSION; -import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.TARGET_TMP_DIRECTORY; /** * Copy native libraries to target/tmp. @@ -74,72 +74,67 @@ public CopyNativeLibTask() { @Override public void execute(BuildContext buildContext) { - Path targetDir = buildContext.get(BuildContextField.TARGET_DIR); - Path tmpDir = targetDir.resolve(TARGET_TMP_DIRECTORY); Path sourceRootPath = buildContext.get(BuildContextField.SOURCE_ROOT); String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); this.manifest = ManifestProcessor.getInstance(buildContext.get(BuildContextField.COMPILER_CONTEXT)). getManifest(); - // Create target/tmp folder - try { - if (!tmpDir.toFile().exists()) { - Files.createDirectory(tmpDir); - } - } catch (IOException e) { - throw createLauncherException("unable to copy the native library: " + e.getMessage()); - } - List moduleBirMap = buildContext.getModules(); + List moduleBirMap = buildContext.getModules(); if (buildContext.getSourceType() == SINGLE_BAL_FILE) { - copyImportedJarsForSingleBalFile(buildContext, moduleBirMap, sourceRootPath, tmpDir, balHomePath); + copyImportedJarsForSingleBalFile(buildContext, moduleBirMap, sourceRootPath, balHomePath); return; } - copyImportedJarsForModules(buildContext, moduleBirMap, sourceRootPath, tmpDir, balHomePath); + copyImportedJarsForModules(buildContext, moduleBirMap, sourceRootPath, balHomePath); } private void copyImportedJarsForSingleBalFile(BuildContext buildContext, List moduleBirMap, - Path sourceRootPath, Path tmpDir, String balHomePath) { + Path sourceRootPath, String balHomePath) { // Iterate through the imports and copy dependencies. - HashSet alreadyImportedSet = new HashSet<>(); + HashSet alreadyImportedSet = new HashSet<>(); for (BLangPackage pkg : moduleBirMap) { - copyImportedLibs(pkg.symbol.imports, buildContext, sourceRootPath, tmpDir, balHomePath, alreadyImportedSet); + copyImportedLibs(pkg.symbol.imports, buildContext.moduleDependencyPathMap.get(pkg.packageID), + buildContext, sourceRootPath, balHomePath, alreadyImportedSet); } } - private void copyImportedJarsForModules(BuildContext buildContext, List moduleBirMap, - Path sourceRootPath, Path tmpDir, String balHomePath) { + private void copyImportedJarsForModules(BuildContext buildContext, List moduleBirMap, + Path sourceRootPath, String balHomePath) { // Iterate through the imports and copy dependencies. - HashSet alreadyImportedSet = new HashSet<>(); + HashSet alreadyImportedSet = new HashSet<>(); for (BLangPackage pkg : moduleBirMap) { // Copy jars from imported modules. - copyImportedLibs(pkg.symbol.imports, buildContext, sourceRootPath, tmpDir, balHomePath, alreadyImportedSet); - // Copy jars from module balo. - Path baloAbsolutePath = buildContext.getBaloFromTarget(pkg.packageID); - copyLibsFromBalo(baloAbsolutePath.toString(), tmpDir.toString()); + copyImportedLibs(pkg.symbol.imports, buildContext.moduleDependencyPathMap.get(pkg.packageID), + buildContext, sourceRootPath, balHomePath, alreadyImportedSet); + buildContext.moduleDependencyPathMap.get(pkg.packageID).forEach(System.out::println); } } - private void copyImportedLibs(List imports, BuildContext buildContext, Path sourceRootPath, - Path tmpDir, String balHomePath, HashSet alreadyImportedSet) { + private void copyImportedLibs(List imports, HashSet moduleDependencySet, + BuildContext buildContext, Path sourceRootPath, String balHomePath, + HashSet alreadyImportedSet) { for (BPackageSymbol importSymbol : imports) { PackageID pkgId = importSymbol.pkgID; - String id = pkgId.toString(); - if (alreadyImportedSet.contains(id)) { - continue; + HashSet importedPkgJarPaths = buildContext.moduleDependencyPathMap.get(pkgId); + if (!alreadyImportedSet.contains(pkgId)) { + alreadyImportedSet.add(pkgId); + if (importedPkgJarPaths == null) { + importedPkgJarPaths = new HashSet<>(); + buildContext.moduleDependencyPathMap.put(pkgId, importedPkgJarPaths); + } + copyImportedLib(buildContext, importSymbol, sourceRootPath, balHomePath, importedPkgJarPaths); + copyImportedLibs(importSymbol.imports, importedPkgJarPaths, buildContext, sourceRootPath, + balHomePath, alreadyImportedSet); } - alreadyImportedSet.add(id); - copyImportedLib(buildContext, importSymbol, sourceRootPath, tmpDir, balHomePath); - copyImportedLibs(importSymbol.imports, buildContext, sourceRootPath, - tmpDir, balHomePath, alreadyImportedSet); + moduleDependencySet.addAll(importedPkgJarPaths); } } - private void copyImportedLib(BuildContext buildContext, BPackageSymbol importz, Path project, - Path tmpDir, String balHomePath) { + private void copyImportedLib(BuildContext buildContext, BPackageSymbol importz, Path project, String balHomePath, + HashSet moduleDependencySet) { // Get the balo paths for (String platform : supportedPlatforms) { Path importJar = findImportBaloPath(buildContext, importz, project, platform); if (importJar != null && Files.exists(importJar)) { - copyLibsFromBalo(importJar.toString(), tmpDir.toString()); + copyLibsFromBalo(importJar, moduleDependencySet); return; } } @@ -162,26 +157,15 @@ private void copyImportedLib(BuildContext buildContext, BPackageSymbol importz, if (libFileName == null) { continue; } - - Path targetPath = tmpDir.resolve(libFileName.toString()); - - if (targetPath.toFile().exists()) { - return; - } - - try { - Files.copy(libFile, targetPath); - return; - } catch (IOException e) { - throw createLauncherException("dependency jar '" + libFilePath.toString() + "' cannot be " + - "copied due to " + e.getMessage()); - } + Path path = Paths.get(libFile.toUri()); + moduleDependencySet.add(path); + return; } } } // If balo cannot be found from target, cache or platform-libs, get dependencies from distribution toml. - copyDependenciesFromToml(importz, balHomePath, tmpDir); + copyDependenciesFromToml(importz, balHomePath, moduleDependencySet); } private static Path findImportBaloPath(BuildContext buildContext, BPackageSymbol importz, Path project, @@ -202,31 +186,49 @@ private static Path findImportBaloPath(BuildContext buildContext, BPackageSymbol } } - private void copyLibsFromBalo(String jarFileName, String destFile) { - try (JarFile jar = new JarFile(jarFileName)) { - - java.util.Enumeration enumEntries = jar.entries(); + private void copyLibsFromBalo(Path baloFilePath, HashSet moduleDependencySet) { - while (enumEntries.hasMoreElements()) { - JarEntry file = (JarEntry) enumEntries.nextElement(); - if (file.getName().contains(BALO_PLATFORM_LIB_DIR_NAME)) { - File f = new File(destFile + File.separator + - file.getName().split(BALO_PLATFORM_LIB_DIR_NAME)[1]); - if (f.exists() || file.isDirectory()) { // if file already copied or its a directory, ignore - continue; - } - // get the input stream - try (InputStream is = jar.getInputStream(file)) { - Files.copy(is, f.toPath()); + String fileName = baloFilePath.getFileName().toString(); + Path baloFileUnzipDirectory = Paths.get(baloFilePath.getParent().toString(), + fileName.substring(0, fileName.lastIndexOf("."))); + File destFile = baloFileUnzipDirectory.toFile(); + // Read from .balo file if directory not exist. + if (destFile.mkdir()) { + try (JarFile jar = new JarFile(baloFilePath.toFile())) { + java.util.Enumeration enumEntries = jar.entries(); + while (enumEntries.hasMoreElements()) { + JarEntry file = (JarEntry) enumEntries.nextElement(); + if (file.getName().endsWith(BLANG_COMPILED_JAR_EXT)) { + File f = Paths.get(baloFileUnzipDirectory.toString(), + file.getName().split(BALO_PLATFORM_LIB_DIR_NAME)[1]).toFile(); + if (!f.exists()) { // if file already copied or its a directory, ignore + // get the input stream + try (InputStream is = jar.getInputStream(file)) { + Files.copy(is, f.toPath()); + } + } + moduleDependencySet.add(f.toPath()); } } + } catch (IOException e) { + throw createLauncherException("unable to copy native jar: " + e.getMessage()); + } + return; + } + + // Read from already unzipped balo directory. + try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(destFile.toString()))) { + for (Path path : stream) { + moduleDependencySet.add(path); } } catch (IOException e) { throw createLauncherException("unable to copy native jar: " + e.getMessage()); } + } - private void copyDependenciesFromToml(BPackageSymbol importz, String balHomePath, Path tmpDir) { + private void copyDependenciesFromToml(BPackageSymbol importz, String balHomePath, + HashSet moduleDependencySet) { // Get the jar paths PackageID id = importz.pkgID; String version = BLANG_PKG_DEFAULT_VERSION; @@ -254,13 +256,7 @@ private void copyDependenciesFromToml(BPackageSymbol importz, String balHomePath for (Object lib : libraries) { Path fileName = Paths.get(((HashMap) lib).get("path").toString()).getFileName(); Path libPath = Paths.get(balHomePath, "bre", "lib", fileName.toString()); - try { - Path jarTarget = tmpDir.resolve(fileName); - Files.copy(libPath, jarTarget, StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - throw createLauncherException("unable to find the dependency jar from the distribution: " + - e.getMessage()); - } + moduleDependencySet.add(libPath); } } } diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBaloTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBaloTask.java index 3dbdade721c9..559e2cac1a70 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBaloTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateBaloTask.java @@ -39,7 +39,7 @@ public void execute(BuildContext buildContext) { // generate balo for each module. BaloFileWriter baloWriter = BaloFileWriter.getInstance(buildContext); - baloWriter.write(module, baloPath); + baloWriter.write(module, baloPath, buildContext.moduleDependencyPathMap.get(module.packageID)); } } } diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java index c4b1edca4ee1..242b41159de0 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java @@ -23,12 +23,10 @@ import org.ballerinalang.packerina.buildcontext.sourcecontext.SingleFileContext; import org.ballerinalang.packerina.buildcontext.sourcecontext.SingleModuleContext; import org.wso2.ballerinalang.compiler.tree.BLangPackage; -import org.wso2.ballerinalang.compiler.util.ProjectDirConstants; import org.wso2.ballerinalang.util.Lists; import java.io.BufferedReader; import java.io.BufferedWriter; -import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; @@ -58,15 +56,6 @@ public class CreateExecutableTask implements Task { private static HashSet excludeExtensions = new HashSet<>(Lists.of("DSA", "SF")); - private boolean skipCopyLibsFromDist = false; - - public CreateExecutableTask(boolean skipCopyLibsFromDist) { - this.skipCopyLibsFromDist = skipCopyLibsFromDist; - } - - public CreateExecutableTask() { - } - @Override public void execute(BuildContext buildContext) { Optional modulesWithEntryPoints = buildContext.getModules().stream() @@ -84,11 +73,9 @@ public void execute(BuildContext buildContext) { URI uberJarUri = URI.create("jar:" + executablePath.toUri().toString()); // Load the to jar to a file system try (FileSystem toFs = FileSystems.newFileSystem(uberJarUri, Collections.emptyMap())) { - if (!skipCopyLibsFromDist) { - copyRuntimeAllJar(buildContext, toFs); - } - assembleExecutable(buildContext, module, toFs); + assembleExecutable(module, buildContext.moduleDependencyPathMap.get(module.packageID), toFs); } catch (IOException e) { + e.printStackTrace(); throw createLauncherException("unable to extract the uber jar :" + e.getMessage()); } } @@ -121,29 +108,13 @@ private void copyJarFromCachePath(BuildContext buildContext, BLangPackage bLangP throw createLauncherException("unable to copy the jar from cache path :" + e.getMessage()); } } - - private void copyRuntimeAllJar(BuildContext buildContext, FileSystem toFs) { - String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); - String ballerinaVersion = System.getProperty("ballerina.version"); - String runtimeJarName = "ballerina-rt-" + ballerinaVersion + BLANG_COMPILED_JAR_EXT; - Path runtimeAllJar = Paths.get(balHomePath, "bre", "lib", runtimeJarName); - try { - copyFromJarToJar(runtimeAllJar, toFs); - } catch (IOException e) { - throw createLauncherException("unable to copy the ballerina runtime all jar :" + e.getMessage()); - } - } - private void assembleExecutable(BuildContext buildContext, BLangPackage bLangPackage, FileSystem toFs) { + private void assembleExecutable(BLangPackage bLangPackage, HashSet dependencySet, FileSystem toFs) { try { - Path targetDir = buildContext.get(BuildContextField.TARGET_DIR); - Path tmpDir = targetDir.resolve(ProjectDirConstants.TARGET_TMP_DIRECTORY); // Check if the package has an entry point. if (bLangPackage.symbol.entryPointExists) { - for (File file : tmpDir.toFile().listFiles()) { - if (!file.isDirectory()) { - copyFromJarToJar(file.toPath(), toFs); - } + for (Path path : dependencySet) { + copyFromJarToJar(path, toFs); } } // Copy dependency jar @@ -151,6 +122,7 @@ private void assembleExecutable(BuildContext buildContext, BLangPackage bLangPac // Executable is created at give location. // If no entry point is found we do nothing. } catch (IOException | NullPointerException e) { + e.printStackTrace(); throw createLauncherException("unable to create the executable: " + e.getMessage()); } } diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java index f68c99b70044..4b5b7cae2a0b 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java @@ -25,14 +25,15 @@ import org.ballerinalang.util.BootstrapRunner; import org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol; import org.wso2.ballerinalang.compiler.tree.BLangPackage; -import org.wso2.ballerinalang.compiler.util.ProjectDirConstants; import org.wso2.ballerinalang.compiler.util.ProjectDirs; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashSet; import java.util.List; -import static org.ballerinalang.packerina.buildcontext.sourcecontext.SourceType.SINGLE_BAL_FILE; +import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_COMPILED_JAR_EXT; /** * Task for creating jar file. @@ -41,9 +42,16 @@ public class CreateJarTask implements Task { private boolean dumpBir; + private boolean skipCopyLibsFromDist = false; + public CreateJarTask(boolean dumpBir) { this.dumpBir = dumpBir; } + + public CreateJarTask(boolean dumpBir, boolean skipCopyLibsFromDist) { + this.dumpBir = dumpBir; + this.skipCopyLibsFromDist = skipCopyLibsFromDist; + } @Override public void execute(BuildContext buildContext) { @@ -52,25 +60,30 @@ public void execute(BuildContext buildContext) { ConfigRegistry.getInstance().setInitialized(true); Path sourceRoot = buildContext.get(BuildContextField.SOURCE_ROOT); Path projectBIRCache = buildContext.get(BuildContextField.BIR_CACHE_DIR); - Path targetDir = buildContext.get(BuildContextField.TARGET_DIR); - Path tmpDir = targetDir.resolve(ProjectDirConstants.TARGET_TMP_DIRECTORY); Path homeBIRCache = buildContext.getBirCacheFromHome(); Path systemBIRCache = buildContext.getSystemRepoBirCache(); - + Path runtimeJar = getRuntimeAllJar(buildContext); + List moduleBirMap = buildContext.getModules(); for (BLangPackage module : moduleBirMap) { - writeImportJar(tmpDir, module.symbol.imports, sourceRoot, buildContext, - projectBIRCache.toString(), homeBIRCache.toString(), systemBIRCache.toString()); - + HashSet moduleDependencySet = buildContext.moduleDependencyPathMap.get(module.packageID); + if (!skipCopyLibsFromDist) { + moduleDependencySet.add(runtimeJar); + } + writeImportJar(module.symbol.imports, sourceRoot, buildContext, runtimeJar, + projectBIRCache.toString(), homeBIRCache.toString(), systemBIRCache.toString()); + // get the bir path of the module Path entryBir = buildContext.getBirPathFromTargetCache(module.packageID); - + // get the jar path of the module. Path jarOutput = buildContext.getJarPathFromTargetCache(module.packageID); - - BootstrapRunner.loadTargetAndGenerateJarBinary(tmpDir, entryBir.toString(), jarOutput.toString(), - this.dumpBir, buildContext.getSourceType() == SINGLE_BAL_FILE, projectBIRCache.toString(), - homeBIRCache.toString(), systemBIRCache.toString()); + if (!Files.exists(jarOutput)) { + BootstrapRunner + .loadTargetAndGenerateJarBinary(entryBir.toString(), jarOutput.toString(), this.dumpBir, + moduleDependencySet, projectBIRCache.toString(), + homeBIRCache.toString(), systemBIRCache.toString()); + } // If there is a testable package we will create testable jar. if (module.hasTestablePackage()) { @@ -79,18 +92,18 @@ public void execute(BuildContext buildContext) { // get the jar path of the module. Path testJarOutput = buildContext.getTestJarPathFromTargetCache(module.packageID); - - BootstrapRunner.loadTargetAndGenerateJarBinary(tmpDir, - testBir.toString(), testJarOutput.toString(), this.dumpBir, - projectBIRCache.toString(), homeBIRCache.toString(), systemBIRCache.toString()); + BootstrapRunner + .loadTargetAndGenerateJarBinary(testBir.toString(), testJarOutput.toString(), this.dumpBir, + moduleDependencySet, projectBIRCache.toString(), + homeBIRCache.toString(), systemBIRCache.toString()); } } ConfigRegistry.getInstance().setInitialized(false); } - - private void writeImportJar(Path tmpDir, List imports, Path sourceRoot, BuildContext buildContext, - String... reps) { + + private void writeImportJar(List imports, Path sourceRoot, BuildContext buildContext, + Path runtimeJar, String... reps) { for (BPackageSymbol bimport : imports) { PackageID id = bimport.pkgID; if (id.orgName.value.equals("ballerina") || id.orgName.value.equals("ballerinax")) { @@ -110,10 +123,25 @@ private void writeImportJar(Path tmpDir, List imports, Path sour birFilePath = buildContext.getBirPathFromHomeCache(id); } if (!Files.exists(jarFilePath)) { - BootstrapRunner.loadTargetAndGenerateJarBinary(tmpDir, - birFilePath.toString(), jarFilePath.toString(), this.dumpBir, reps); + HashSet moduleDependencySet = buildContext.moduleDependencyPathMap.get(id); + if (!skipCopyLibsFromDist) { + moduleDependencySet.add(runtimeJar); + } + BootstrapRunner.loadTargetAndGenerateJarBinary(birFilePath.toString(), jarFilePath.toString(), + this.dumpBir, moduleDependencySet, reps); } - writeImportJar(tmpDir, bimport.imports, sourceRoot, buildContext, reps); + writeImportJar(bimport.imports, sourceRoot, buildContext, runtimeJar, reps); + } + } + + private Path getRuntimeAllJar(BuildContext buildContext) { + + if (!skipCopyLibsFromDist) { + return null; } + String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); + String ballerinaVersion = System.getProperty("ballerina.version"); + String runtimeJarName = "ballerina-rt-" + ballerinaVersion + BLANG_COMPILED_JAR_EXT; + return Paths.get(balHomePath, "bre", "lib", runtimeJarName); } } From aed301da34ceddce4f044ad6d3e3fc6b7f5f53ad Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 19:42:40 +0530 Subject: [PATCH 085/167] Remove test cases checking temp directory --- .../cmd/CompileFlagWithBuildCommandTest.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/cli/ballerina-packerina/src/test/java/org/ballerinalang/packerina/cmd/CompileFlagWithBuildCommandTest.java b/cli/ballerina-packerina/src/test/java/org/ballerinalang/packerina/cmd/CompileFlagWithBuildCommandTest.java index bcb3f44bd2b1..3c6ba8e9576b 100644 --- a/cli/ballerina-packerina/src/test/java/org/ballerinalang/packerina/cmd/CompileFlagWithBuildCommandTest.java +++ b/cli/ballerina-packerina/src/test/java/org/ballerinalang/packerina/cmd/CompileFlagWithBuildCommandTest.java @@ -231,7 +231,6 @@ public void testBuildCommand() throws IOException { // -- kubernetes/ <- output of kubernetes compiler extension if used // -- potato/ <- output of potato compiler extension // -- cache <- BIR cache directory - // --tmp <- tmp dir that contains the native libs Path target = this.testResources.resolve("valid-project").resolve(ProjectDirConstants.TARGET_DIR_NAME); Assert.assertTrue(Files.exists(target), "Check if target directory is created"); @@ -245,10 +244,6 @@ public void testBuildCommand() throws IOException { Assert.assertTrue(Files.exists(target.resolve(ProjectDirConstants.TARGET_BALO_DIRECTORY)), "Check if balo file exists"); - // Check if tmp folder exists - Path tmpDir = target.resolve(ProjectDirConstants.TARGET_TMP_DIRECTORY); - Assert.assertTrue(Files.exists(tmpDir)); - Path lockFile = this.testResources.resolve("valid-project").resolve(ProjectDirConstants.LOCK_FILE_NAME); Assert.assertTrue(Files.exists(lockFile), "Check if lock file is created"); @@ -337,22 +332,6 @@ public void testBaloContents() throws IOException { } }); - - Path tmpDir = this.testResources.resolve("valid-project").resolve(ProjectDirConstants.TARGET_DIR_NAME). - resolve(ProjectDirConstants.TARGET_TMP_DIRECTORY); - - // Check if the native libs are in the tmp folder - Path tomlJarInTmpDir = tmpDir.resolve("toml4j.jar"); - Assert.assertTrue(Files.exists(tomlJarInTmpDir)); - - // Check if the module libs are in the tmp folder - Path moduleJar = tmpDir.resolve("testOrg-mymodule-0.1.0.jar"); - Assert.assertTrue(Files.exists(moduleJar)); - - // Check if the imported libs are in the tmp folder - Path importJar = tmpDir.resolve("testOrg-myimport-0.1.0.jar"); - Assert.assertTrue(Files.exists(importJar)); - // Check if imported bir is in the project target Path importBir = this.testResources.resolve("valid-project").resolve(ProjectDirConstants.TARGET_DIR_NAME) .resolve(ProjectDirConstants.CACHES_DIR_NAME).resolve(ProjectDirConstants.BIR_CACHE_DIR_NAME) From 9666d01aec84ed78513e829c43c590cc36f48453 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 19:43:37 +0530 Subject: [PATCH 086/167] Move skip runtime all jar skip to createjar task --- .../java/org/ballerinalang/packerina/cmd/BuildCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java index 0cbaf3a7d924..80a80a83f9f8 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java @@ -380,11 +380,11 @@ public void execute() { .addTask(new CreateBaloTask(), isSingleFileBuild) // create the balos for modules(projects only) .addTask(new CreateBirTask()) // create the bir .addTask(new CopyNativeLibTask(skipCopyLibsFromDist)) // copy the native libs(projects only) - .addTask(new CreateJarTask(this.dumpBIR)) // create the jar + .addTask(new CreateJarTask(this.dumpBIR, skipCopyLibsFromDist)) // create the jar .addTask(new CopyModuleJarTask(skipCopyLibsFromDist)) .addTask(new RunTestsTask(), this.skipTests || isSingleFileBuild) // run tests // (projects only) - .addTask(new CreateExecutableTask(skipCopyLibsFromDist), this.compile) // create the executable.jar + .addTask(new CreateExecutableTask(), this.compile) // create the executable.jar // file .addTask(new CopyExecutableTask(outputPath), !isSingleFileBuild) // copy executable .addTask(new PrintExecutablePathTask(), this.compile) // print the location of the executable From 12bd53b4f7a43456dcf3923cbb4cb58ba786e7c9 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:44:32 +0530 Subject: [PATCH 087/167] Use per module classloader for bal writer --- .../packerina/writer/BaloFileWriter.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BaloFileWriter.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BaloFileWriter.java index 494d22e218ba..d4472e5ebff3 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BaloFileWriter.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/writer/BaloFileWriter.java @@ -55,6 +55,7 @@ import java.nio.file.attribute.BasicFileAttributes; import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -98,8 +99,9 @@ private BaloFileWriter(BuildContext buildContext) { * * @param module ballerina module * @param baloFilePath path to the balo file + * @param moduleDependencyList dependent jar path set for module */ - public void write(BLangPackage module, Path baloFilePath) { + public void write(BLangPackage module, Path baloFilePath, HashSet moduleDependencyList) { // Get the project directory Path projectDirectory = this.sourceDirectory.getPath(); @@ -112,7 +114,7 @@ public void write(BLangPackage module, Path baloFilePath) { // Create the archive over write if exists try (FileSystem baloFS = createBaloArchive(baloFilePath)) { // Now lets put stuff in - populateBaloArchive(baloFS, module); + populateBaloArchive(baloFS, module, moduleDependencyList); buildContext.out().println("\t" + projectDirectory.relativize(baloFilePath)); } catch (IOException e) { // todo Check for permission @@ -144,7 +146,8 @@ private FileSystem createBaloArchive(Path path) throws IOException { return FileSystems.newFileSystem(zipDisk, env); } - private void populateBaloArchive(FileSystem baloFS, BLangPackage module) throws IOException { + private void populateBaloArchive(FileSystem baloFS, BLangPackage module, + HashSet moduleDependencyList) throws IOException { Path root = baloFS.getPath("/"); Path projectDirectory = this.sourceDirectory.getPath(); Path moduleSourceDir = projectDirectory.resolve(ProjectDirConstants.SOURCE_DIR_NAME) @@ -170,7 +173,7 @@ private void populateBaloArchive(FileSystem baloFS, BLangPackage module) throws addModuleDoc(root, moduleSourceDir); // Add platform libs only if it is not a template module. if (!this.manifest.isTemplateModule(moduleName)) { - addPlatformLibs(root, projectDirectory, moduleName); + addPlatformLibs(root, projectDirectory, moduleName, moduleDependencyList); } } @@ -282,7 +285,8 @@ private void addModuleDoc(Path root, Path moduleSourceDir) throws IOException { } } - private void addPlatformLibs(Path root, Path projectDirectory, String moduleName) throws IOException { + private void addPlatformLibs(Path root, Path projectDirectory, String moduleName, + HashSet moduleDependencyList) throws IOException { //If platform libs are defined add them to balo if (null != manifest.getPlatform().libraries) { Path platformLibsDir = root.resolve(ProjectDirConstants.BALO_PLATFORM_LIB_DIR_NAME); @@ -299,6 +303,7 @@ private void addPlatformLibs(Path root, Path projectDirectory, String moduleName Path targetPath = platformLibsDir.resolve(libFileName.toString()); try { Files.copy(nativeFile, targetPath, StandardCopyOption.REPLACE_EXISTING); + moduleDependencyList.add(nativeFile); } catch (IOException e) { throw new BLangCompilerException("Dependency jar not found : " + lib.toString()); } From 99d0c2f7448937653fed0c32b6b25c37effa8788 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:45:27 +0530 Subject: [PATCH 088/167] Use interop object for validation --- stdlib/jvm/src/main/ballerina/src/jvm/interop.bal | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/stdlib/jvm/src/main/ballerina/src/jvm/interop.bal b/stdlib/jvm/src/main/ballerina/src/jvm/interop.bal index 8c011e957a5b..c27ff1ce0bc1 100644 --- a/stdlib/jvm/src/main/ballerina/src/jvm/interop.bal +++ b/stdlib/jvm/src/main/ballerina/src/jvm/interop.bal @@ -78,9 +78,20 @@ public type Field record {| JType fType; |}; -public function validateAndGetJMethod(MethodValidationRequest methodValidationReq) returns Method | error = external; -public function validateAndGetJField(FieldValidationRequest fieldValidationReq) returns Field | error = external; +public type InteropValidator object { + + public function __init(string[] jarUrls, boolean useSystemClassLoader) { + self.init(jarUrls, useSystemClassLoader); + } + + function init(string[] jarUrls, boolean useSystemClassLoader) = external; + + public function validateAndGetJMethod(MethodValidationRequest methodValidationReq) returns Method | error = external; + + public function validateAndGetJField(FieldValidationRequest fieldValidationReq) returns Field | error = external; +}; + public function getMethodKindFromAnnotTag(MethodAnnotTag annotTagRef) returns MethodKind { if annotTagRef is CONSTRUCTOR_ANNOT_TAG { From ebd95b7d4582eba6513092c56238a9a30451287f Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:48:58 +0530 Subject: [PATCH 089/167] Refactor interop validation use class loader --- .../ballerinalang/nativeimpl/jvm/ASMUtil.java | 1 + .../nativeimpl/jvm/interop/Init.java | 72 ++++++++ .../nativeimpl/jvm/interop/JInterop.java | 25 +-- .../jvm/interop/JInteropException.java | 1 + .../jvm/interop/JInteropFieldValidator.java | 20 +- .../jvm/interop/JInteropMethodValidator.java | 28 ++- .../nativeimpl/jvm/interop/JMethod.java | 16 +- .../jvm/interop/JMethodRequest.java | 6 +- .../jvm/interop/JMethodResolver.java | 172 ++++++++++-------- 9 files changed, 233 insertions(+), 108 deletions(-) create mode 100644 stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java index d69449a4a83b..98d126046db7 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java @@ -39,6 +39,7 @@ public class ASMUtil { public static final String JVM_PKG_PATH = BALLERINA_PACKAGE_PREFIX + "jvm"; public static final BPackage JVM_PKG_ID = new BPackage(BALLERINA_BUILTIN_PKG_PREFIX, "jvm"); public static final String NATIVE_KEY = "native"; + public static final String INTEROP_VALIDATOR = "InteropValidator"; public static final String OBJECT_DESC = "Ljava/lang/Object;"; public static final String FUNCTION_DESC = "Ljava/util/function/Function;"; diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java new file mode 100644 index 000000000000..3422198c47d5 --- /dev/null +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.nativeimpl.jvm.interop; + +import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.values.ArrayValue; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; +import org.ballerinalang.natives.annotations.Argument; +import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; + +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Paths; + +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.INTEROP_VALIDATOR; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.JVM_PKG_PATH; +import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_LOADER_DATA; + +/** + * Native class for jvm interop validator creation. + */ +@BallerinaFunction( + orgName = "ballerina", packageName = "jvm", + functionName = "init", + receiver = @Receiver(type = TypeKind.OBJECT, structType = INTEROP_VALIDATOR, structPackage = JVM_PKG_PATH), + args = { + @Argument(name = "urls", type = TypeKind.ARRAY) + } +) +public class Init { + + public static void init(Strand strand, ObjectValue interopValidatorStruct, ArrayValue jarUrls, + boolean useSystemClassLoader) { + + try { + String[] moduleDependencySet = jarUrls.getStringArray(); + URL[] urls = new URL[moduleDependencySet.length]; + int i = 0; + for (String jarPath : moduleDependencySet) { + urls[i] = Paths.get(jarPath).toUri().toURL(); + i++; + } + if (useSystemClassLoader) { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls)); + } else { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls, null)); + } + } catch (MalformedURLException e) { + throw new JInteropException(JInteropException.CLASS_LOADER_INIT_FAILED_REASON, + e.getMessage()); + } + } +} + diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java index 1d6863ff9a42..a1f78d9579cd 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java @@ -76,6 +76,7 @@ class JInterop { static final String UNION_TYPE_MEMBERS_FIELD = "members"; static final String TUPLE_TYPE_MEMBERS_FIELD = "tupleTypes"; static final String ARRAY_ELEMENT_TYPE_FIELD = "eType"; + static final String CLASS_LOADER_DATA = "class_loader"; static final String RECORD_TNAME = "record"; static final String OBJECT_TNAME = "object"; @@ -194,7 +195,7 @@ static boolean isHandleType(Object bValue) { return false; } - static ParamTypeConstraint[] buildParamTypeConstraints(ArrayValue javaTypeConstraints) { + static ParamTypeConstraint[] buildParamTypeConstraints(ArrayValue javaTypeConstraints, ClassLoader classLoader) { if (javaTypeConstraints == null) { return new ParamTypeConstraint[0]; } @@ -202,16 +203,16 @@ static ParamTypeConstraint[] buildParamTypeConstraints(ArrayValue javaTypeConstr List constraintList = new ArrayList<>(); for (int paramIndex = 0; paramIndex < javaTypeConstraints.size(); paramIndex++) { Object javaTypeConstraint = javaTypeConstraints.get(paramIndex); - constraintList.add(buildParamTypeConstraint(javaTypeConstraint)); + constraintList.add(buildParamTypeConstraint(javaTypeConstraint, classLoader)); } return constraintList.toArray(new ParamTypeConstraint[0]); } - private static ParamTypeConstraint buildParamTypeConstraint(Object javaTypeConstraint) { + private static ParamTypeConstraint buildParamTypeConstraint(Object javaTypeConstraint, ClassLoader classLoader) { if (isJavaRefType(javaTypeConstraint)) { - return buildConstraintFromJavaRefType((MapValue) javaTypeConstraint); + return buildConstraintFromJavaRefType((MapValue) javaTypeConstraint, classLoader); } else if (isJavaArrayType(javaTypeConstraint)) { - return buildConstraintFromJavaArrayType((MapValue) javaTypeConstraint); + return buildConstraintFromJavaArrayType((MapValue) javaTypeConstraint, classLoader); } else if (isJavaNoType(javaTypeConstraint)) { return ParamTypeConstraint.NO_CONSTRAINT; } else { @@ -219,14 +220,16 @@ private static ParamTypeConstraint buildParamTypeConstraint(Object javaTypeConst } } - private static ParamTypeConstraint buildConstraintFromJavaRefType(MapValue javaRefType) { + private static ParamTypeConstraint buildConstraintFromJavaRefType(MapValue javaRefType, + ClassLoader classLoader) { String constraintBValue = (String) javaRefType.get(TYPE_NAME_FIELD); - return new ParamTypeConstraint(loadClass(constraintBValue)); + return new ParamTypeConstraint(loadClass(constraintBValue, classLoader)); } - private static ParamTypeConstraint buildConstraintFromJavaArrayType(MapValue javaRefType) { + private static ParamTypeConstraint buildConstraintFromJavaArrayType(MapValue javaRefType, + ClassLoader classLoader) { String typeSig = getJavaArrayTypeSig(javaRefType); - return new ParamTypeConstraint(loadClass(typeSig)); + return new ParamTypeConstraint(loadClass(typeSig, classLoader)); } private static String getJavaArrayTypeSig(MapValue javaRefType) { @@ -336,9 +339,9 @@ private static boolean isJavaNoType(Object javaTypeConstraint) { } } - static Class loadClass(String className) { + static Class loadClass(String className, ClassLoader classLoader) { try { - return Class.forName(className.replace("/", ".")); + return Class.forName(className.replace("/", "."), false, classLoader); } catch (ClassNotFoundException | NoClassDefFoundError e) { throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java index f251f6029304..20c82dab5dcc 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java @@ -31,6 +31,7 @@ class JInteropException extends RuntimeException { static final String OVERLOADED_METHODS_REASON = "OVERLOADED_METHODS"; static final String UNSUPPORTED_PRIMITIVE_TYPE_REASON = "UNSUPPORTED_PRIMITIVE_TYPE"; static final String METHOD_SIGNATURE_NOT_MATCH_REASON = "METHOD_SIGNATURE_DOES_NOT_MATCH"; + static final String CLASS_LOADER_INIT_FAILED_REASON = "CLASS_LOADER_INIT_FAILED"; private String reason; diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java index 33c1e3d8302b..29ca438cbc80 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java @@ -19,12 +19,18 @@ import org.ballerinalang.jvm.scheduling.Strand; import org.ballerinalang.jvm.values.MapValue; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; import org.ballerinalang.nativeimpl.jvm.interop.JavaField.JFieldMethod; import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; import java.lang.reflect.Field; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.INTEROP_VALIDATOR; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.JVM_PKG_PATH; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_FIELD; +import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_LOADER_DATA; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.FIELD_TYPE_FIELD; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.IS_STATIC_FIELD; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.METHOD_FIELD; @@ -37,16 +43,20 @@ * @since 1.0.0 */ @BallerinaFunction( - orgName = "ballerina", packageName = "jvm", functionName = "validateAndGetJField" + orgName = "ballerina", packageName = "jvm", + receiver = @Receiver(type = TypeKind.OBJECT, structType = INTEROP_VALIDATOR, structPackage = JVM_PKG_PATH), + functionName = "validateAndGetJField" ) public class JInteropFieldValidator { - public static Object validateAndGetJField(Strand strand, MapValue jFieldValidationRequest) { + public static Object validateAndGetJField(Strand strand, ObjectValue interopValidatorStruct, + MapValue jFieldValidationRequest) { try { // 1) Load Java class - validate - JFieldMethod method = getFieldMethod(jFieldValidationRequest); + ClassLoader classLoader = (ClassLoader) interopValidatorStruct.getNativeData(CLASS_LOADER_DATA); + JavaField.JFieldMethod method = getFieldMethod(jFieldValidationRequest); String className = (String) jFieldValidationRequest.get(CLASS_FIELD); - Class clazz = JInterop.loadClass(className); + Class clazz = JInterop.loadClass(className, classLoader); // 2) Load Java method details - use the method kind in the request - validate kind and the existance of the // method. Possible there may be more than one methods for the given kind and the name @@ -57,7 +67,7 @@ public static Object validateAndGetJField(Strand strand, MapValue jMethodReqBValue) { + public static Object validateAndGetJMethod(Strand strand, ObjectValue interopValidatorStruct, + MapValue jMethodReqBValue) { try { + ClassLoader classLoader = (ClassLoader) interopValidatorStruct.getNativeData(CLASS_LOADER_DATA); // Populate JMethodRequest from the BValue - JMethodRequest jMethodRequest = JMethodRequest.build(jMethodReqBValue); + JMethodRequest jMethodRequest = JMethodRequest.build(jMethodReqBValue, classLoader); // Validate the Ballerina external function signature with the specific Java interoperability annotation validateBExternalFunction(jMethodRequest); // Find the most specific Java method or constructor for the given request - JMethod jMethod = resolveJMethod(jMethodRequest); + JMethod jMethod = resolveJMethod(jMethodRequest, classLoader); // Return the matched Java method or constructor details back to the Ballerina land. - return createJMethodBValue(jMethod); + return createJMethodBValue(jMethod, classLoader); } catch (JInteropException e) { return JInterop.createErrorBValue(e.getReason(), e.getMessage()); } @@ -59,12 +69,12 @@ public static Object validateAndGetJMethod(Strand strand, MapValue jMethodRecord = JInterop.createRecordBValue(METHOD_TYPE_NAME); jMethodRecord.put(NAME_FIELD, jMethod.getName()); jMethodRecord.put(CLASS_FIELD, jMethod.getClassName().replace('.', '/')); @@ -73,7 +83,7 @@ private static MapValue createJMethodBValue(JMethod jMethod) { jMethodRecord.put(IS_STATIC_FIELD, jMethod.isStatic()); jMethodRecord.put(SIG_FIELD, jMethod.getSignature()); jMethodRecord.put(METHOD_TYPE_FIELD, JInterop.createJMethodTypeBValue(jMethod)); - jMethodRecord.put(METHOD_THROWS_FIELD, jMethod.getExceptionTypes()); + jMethodRecord.put(METHOD_THROWS_FIELD, jMethod.getExceptionTypes(classLoader)); return jMethodRecord; } } diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java index 6ba4ae2e2083..b0e365740126 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java @@ -28,6 +28,8 @@ import java.util.ArrayList; import java.util.List; +import static org.ballerinalang.nativeimpl.jvm.interop.JInteropException.CLASS_NOT_FOUND_REASON; + /** * Represents a java method in this implementation. * @@ -100,14 +102,20 @@ Class getReturnType() { } } - ArrayValue getExceptionTypes() { + ArrayValue getExceptionTypes(ClassLoader classLoader) { List checkedExceptions = new ArrayList<>(); - for (Class exceptionType : method.getExceptionTypes()) { - if (!RuntimeException.class.isAssignableFrom(exceptionType)) { - checkedExceptions.add(exceptionType); + try { + Class runtimeException = classLoader.loadClass(RuntimeException.class.getCanonicalName()); + for (Class exceptionType : method.getExceptionTypes()) { + if (!runtimeException.isAssignableFrom(exceptionType)) { + checkedExceptions.add(exceptionType); + } } + } catch (ClassNotFoundException | NoClassDefFoundError e) { + throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } + ArrayValue arrayValue = new ArrayValue(new BArrayType(BTypes.typeString), checkedExceptions.size()); int i = 0; for (Class exceptionType : checkedExceptions) { diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java index cb555bff4f2f..09bbb59e8387 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java @@ -72,13 +72,13 @@ class JMethodRequest { private JMethodRequest() { } - static JMethodRequest build(MapValue jMethodReqBValue) { + static JMethodRequest build(MapValue jMethodReqBValue, ClassLoader classLoader) { JMethodRequest jMethodReq = new JMethodRequest(); jMethodReq.kind = JMethodKind.getKind((String) jMethodReqBValue.get(KIND_FIELD)); jMethodReq.methodName = (String) jMethodReqBValue.get(NAME_FIELD); - jMethodReq.declaringClass = JInterop.loadClass((String) jMethodReqBValue.get(CLASS_FIELD)); + jMethodReq.declaringClass = JInterop.loadClass((String) jMethodReqBValue.get(CLASS_FIELD), classLoader); jMethodReq.paramTypeConstraints = JInterop.buildParamTypeConstraints( - (ArrayValue) jMethodReqBValue.get(PARAM_TYPE_CONSTRAINTS_FIELD)); + (ArrayValue) jMethodReqBValue.get(PARAM_TYPE_CONSTRAINTS_FIELD), classLoader); MapValue bFuncType = (MapValue) jMethodReqBValue.get(B_FUNC_TYPE_FIELD); ArrayValue paramTypes = (ArrayValue) bFuncType.get(PARAM_TYPES_FIELD); diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java index dbfdc574121e..46820a3d9f25 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java @@ -51,6 +51,7 @@ import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.J_PRIMITIVE_LONG_TNAME; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.J_PRIMITIVE_SHORT_TNAME; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.J_VOID_TNAME; +import static org.ballerinalang.nativeimpl.jvm.interop.JInteropException.CLASS_NOT_FOUND_REASON; import static org.ballerinalang.nativeimpl.jvm.interop.JInteropException.OVERLOADED_METHODS_REASON; /** @@ -60,6 +61,12 @@ */ class JMethodResolver { + private ClassLoader classLoader; + + JMethodResolver(ClassLoader classLoader) { + this.classLoader = classLoader; + } + JMethod resolve(JMethodRequest jMethodRequest) { // 1) Get java methods (that matches with the method name) or constructor list List jMethods = resolveByMethodName(jMethodRequest.declaringClass, @@ -133,17 +140,24 @@ private void validateMethodSignature(JMethodRequest jMethodRequest, JMethod jMet private void validateExceptionTypes(JMethodRequest jMethodRequest, JMethod jMethod) { Executable method = jMethod.getMethod(); boolean throwsCheckedException = false; - for (Class exceptionType : method.getExceptionTypes()) { - if (!RuntimeException.class.isAssignableFrom(exceptionType)) { - throwsCheckedException = true; - break; + boolean returnsErrorValue; + try { + for (Class exceptionType : method.getExceptionTypes()) { + if (!this.classLoader.loadClass(RuntimeException.class.getCanonicalName()) + .isAssignableFrom(exceptionType)) { + throwsCheckedException = true; + break; + } } + returnsErrorValue = method instanceof Method && (this.classLoader + .loadClass(ErrorValue.class.getCanonicalName()) + .isAssignableFrom(((Method) method).getReturnType()) || + this.classLoader.loadClass(Object.class.getCanonicalName()) + .isAssignableFrom(((Method) method).getReturnType())); + } catch (ClassNotFoundException | NoClassDefFoundError e) { + throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } - boolean returnsErrorValue = method instanceof Method && ( - ErrorValue.class.isAssignableFrom(((Method) method).getReturnType()) || - Object.class.isAssignableFrom(((Method) method).getReturnType())); - if ((throwsCheckedException && !jMethodRequest.returnsBErrorType) || (jMethodRequest.returnsBErrorType && !throwsCheckedException && !returnsErrorValue)) { throw new JInteropException(JInteropException.METHOD_SIGNATURE_NOT_MATCH_REASON, @@ -188,81 +202,87 @@ private void validateReturnTypes(JMethodRequest jMethodRequest, JMethod jMethod) } private boolean isValidExpectedBType(Class jParamType, BType bParamType, JMethodRequest jMethodRequest) { - String jParamTypeName = jParamType.getTypeName(); - switch (bParamType.getTag()) { - case TypeTags.HANDLE_TAG: - case TypeTags.ANY_TAG: - case TypeTags.ANYDATA_TAG: - return !jParamType.isPrimitive(); - case TypeTags.NULL_TAG: - return jParamTypeName.equals(J_VOID_TNAME); - case TypeTags.INT_TAG: - case TypeTags.BYTE_TAG: - case TypeTags.FLOAT_TAG: - if (jParamTypeName.equals(J_OBJECT_TNAME)) { - return true; - } + try { + String jParamTypeName = jParamType.getTypeName(); + switch (bParamType.getTag()) { + case TypeTags.HANDLE_TAG: + case TypeTags.ANY_TAG: + case TypeTags.ANYDATA_TAG: + return !jParamType.isPrimitive(); + case TypeTags.NULL_TAG: + return jParamTypeName.equals(J_VOID_TNAME); + case TypeTags.INT_TAG: + case TypeTags.BYTE_TAG: + case TypeTags.FLOAT_TAG: + if (jParamTypeName.equals(J_OBJECT_TNAME)) { + return true; + } - if (bParamType.getTag() == TypeTags.INT_TAG && jParamTypeName.equals(J_LONG_OBJ_TNAME)) { - return true; - } + if (bParamType.getTag() == TypeTags.INT_TAG && jParamTypeName.equals(J_LONG_OBJ_TNAME)) { + return true; + } - if (bParamType.getTag() == TypeTags.BYTE_TAG && jParamTypeName.equals(J_INTEGER_OBJ_TNAME)) { - return true; - } + if (bParamType.getTag() == TypeTags.BYTE_TAG && jParamTypeName.equals(J_INTEGER_OBJ_TNAME)) { + return true; + } - if (bParamType.getTag() == TypeTags.FLOAT_TAG && jParamTypeName.equals(J_DOUBLE_OBJ_TNAME)) { - return true; - } + if (bParamType.getTag() == TypeTags.FLOAT_TAG && jParamTypeName.equals(J_DOUBLE_OBJ_TNAME)) { + return true; + } - return jParamType.isPrimitive() && - (jParamTypeName.equals(J_PRIMITIVE_INT_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_BYTE_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_SHORT_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_LONG_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_CHAR_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_FLOAT_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_DOUBLE_TNAME)); - case TypeTags.BOOLEAN_TAG: - if (jParamTypeName.equals(J_OBJECT_TNAME) || jParamTypeName.equals(J_BOOLEAN_OBJ_TNAME)) { - return true; - } - return jParamType.isPrimitive() && jParamTypeName.equals(J_PRIMITIVE_BOOLEAN_TNAME); - case TypeTags.DECIMAL_TAG: - return BigDecimal.class.isAssignableFrom(jParamType); - case TypeTags.STRING_TAG: - return String.class.isAssignableFrom(jParamType); - case TypeTags.MAP_TAG: - case TypeTags.RECORD_TYPE_TAG: - case TypeTags.JSON_TAG: - return MapValue.class.isAssignableFrom(jParamType); - case TypeTags.OBJECT_TYPE_TAG: - case TypeTags.SERVICE_TAG: - return ObjectValue.class.isAssignableFrom(jParamType); - case TypeTags.ERROR_TAG: - return ErrorValue.class.isAssignableFrom(jParamType); - case TypeTags.STREAM_TAG: - return StreamValue.class.isAssignableFrom(jParamType); - case TypeTags.TABLE_TAG: - return TableValue.class.isAssignableFrom(jParamType); - case TypeTags.XML_TAG: - return XMLValue.class.isAssignableFrom(jParamType); - case TypeTags.TUPLE_TAG: - case TypeTags.ARRAY_TAG: - if (jMethodRequest.restParamExist) { - return jParamType.isArray(); - } - return ArrayValue.class.isAssignableFrom(jParamType); - case TypeTags.UNION_TAG: - List members = ((BUnionType) bParamType).getMemberTypes(); - for (BType member : members) { - if (isValidExpectedBType(jParamType, member, jMethodRequest)) { + return jParamType.isPrimitive() && + (jParamTypeName.equals(J_PRIMITIVE_INT_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_BYTE_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_SHORT_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_LONG_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_CHAR_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_FLOAT_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_DOUBLE_TNAME)); + case TypeTags.BOOLEAN_TAG: + if (jParamTypeName.equals(J_OBJECT_TNAME) || jParamTypeName.equals(J_BOOLEAN_OBJ_TNAME)) { return true; } - } - return !jParamType.isPrimitive(); + return jParamType.isPrimitive() && jParamTypeName.equals(J_PRIMITIVE_BOOLEAN_TNAME); + case TypeTags.DECIMAL_TAG: + return this.classLoader.loadClass(BigDecimal.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.STRING_TAG: + return this.classLoader.loadClass(String.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.MAP_TAG: + case TypeTags.RECORD_TYPE_TAG: + case TypeTags.JSON_TAG: + return this.classLoader.loadClass(MapValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.OBJECT_TYPE_TAG: + case TypeTags.SERVICE_TAG: + return this.classLoader.loadClass(ObjectValue.class.getCanonicalName()) + .isAssignableFrom(jParamType); + case TypeTags.ERROR_TAG: + return this.classLoader.loadClass(ErrorValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.STREAM_TAG: + return this.classLoader.loadClass(StreamValue.class.getCanonicalName()) + .isAssignableFrom(jParamType); + case TypeTags.TABLE_TAG: + return this.classLoader.loadClass(TableValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.XML_TAG: + return this.classLoader.loadClass(XMLValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.TUPLE_TAG: + case TypeTags.ARRAY_TAG: + if (jMethodRequest.restParamExist) { + return jParamType.isArray(); + } + return this.classLoader.loadClass(ArrayValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.UNION_TAG: + List members = ((BUnionType) bParamType).getMemberTypes(); + for (BType member : members) { + if (isValidExpectedBType(jParamType, member, jMethodRequest)) { + return true; + } + } + return !jParamType.isPrimitive(); + } + return false; + } catch (ClassNotFoundException | NoClassDefFoundError e) { + throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } - return false; } private JMethod resolveExactMethod(Class clazz, String name, JMethodKind kind, ParamTypeConstraint[] constraints) { From 990fa541601492a1b362a4e8d2bbba6e7e7c4347 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:51:16 +0530 Subject: [PATCH 090/167] Move jvm class loader changes to jvm-old --- .../src/main/ballerina/src/jvm/interop.bal | 13 +- .../ballerinalang/nativeimpl/jvm/ASMUtil.java | 1 + .../nativeimpl/jvm/interop/Init.java | 71 ++++++++ .../nativeimpl/jvm/interop/JInterop.java | 27 +-- .../jvm/interop/JInteropException.java | 1 + .../jvm/interop/JInteropFieldValidator.java | 16 +- .../jvm/interop/JInteropMethodValidator.java | 28 ++- .../nativeimpl/jvm/interop/JMethod.java | 16 +- .../jvm/interop/JMethodRequest.java | 6 +- .../jvm/interop/JMethodResolver.java | 164 ++++++++++-------- 10 files changed, 238 insertions(+), 105 deletions(-) create mode 100644 stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java diff --git a/stdlib/jvm-old/src/main/ballerina/src/jvm/interop.bal b/stdlib/jvm-old/src/main/ballerina/src/jvm/interop.bal index 8c011e957a5b..47b1fda999c7 100644 --- a/stdlib/jvm-old/src/main/ballerina/src/jvm/interop.bal +++ b/stdlib/jvm-old/src/main/ballerina/src/jvm/interop.bal @@ -78,9 +78,18 @@ public type Field record {| JType fType; |}; -public function validateAndGetJMethod(MethodValidationRequest methodValidationReq) returns Method | error = external; +public type InteropValidator object { -public function validateAndGetJField(FieldValidationRequest fieldValidationReq) returns Field | error = external; + public function __init(string[] jarUrls, boolean useSystemClassLoader) { + self.init(jarUrls, useSystemClassLoader); + } + + function init(string[] jarUrls, boolean useSystemClassLoader) = external; + + public function validateAndGetJMethod(MethodValidationRequest methodValidationReq) returns Method | error = external; + + public function validateAndGetJField(FieldValidationRequest fieldValidationReq) returns Field | error = external; +}; public function getMethodKindFromAnnotTag(MethodAnnotTag annotTagRef) returns MethodKind { if annotTagRef is CONSTRUCTOR_ANNOT_TAG { diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java index b34e41c63615..28272271c69a 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/ASMUtil.java @@ -36,6 +36,7 @@ public class ASMUtil { public static final String LABEL = "Label"; public static final String JVM_PKG_PATH = BALLERINA_PACKAGE_PREFIX + "jvm"; public static final String NATIVE_KEY = "native"; + public static final String INTEROP_VALIDATOR = "InteropValidator"; public static final String OBJECT_DESC = "Ljava/lang/Object;"; public static final String FUNCTION_DESC = "Ljava/util/function/Function;"; diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java new file mode 100644 index 000000000000..dd9dbfd4be30 --- /dev/null +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.nativeimpl.jvm.interop; + +import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.values.ArrayValue; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; +import org.ballerinalang.natives.annotations.Argument; +import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; + +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.nio.file.Paths; + +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.INTEROP_VALIDATOR; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.JVM_PKG_PATH; +import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_LOADER_DATA; + +/** + * Native class for jvm interop validator creation. + */ +@BallerinaFunction( + orgName = "ballerina", packageName = "jvm", + functionName = "init", + receiver = @Receiver(type = TypeKind.OBJECT, structType = INTEROP_VALIDATOR, structPackage = JVM_PKG_PATH), + args = { + @Argument(name = "urls", type = TypeKind.ARRAY) + } +) +public class Init { + + public static void init(Strand strand, ObjectValue interopValidatorStruct, ArrayValue jarUrls, + boolean useSystemClassLoader) { + try { + String[] moduleDependencySet = jarUrls.getStringArray(); + URL[] urls = new URL[moduleDependencySet.length]; + int i = 0; + for (String jarPath : moduleDependencySet) { + urls[i] = Paths.get(jarPath).toUri().toURL(); + i++; + } + if (useSystemClassLoader) { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls)); + } else { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls, null)); + } + } catch (MalformedURLException e) { + throw new JInteropException(JInteropException.CLASS_LOADER_INIT_FAILED_REASON, + e.getMessage()); + } + } +} + diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java index 1f6c41cce74d..34d48db145e7 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInterop.java @@ -74,6 +74,7 @@ class JInterop { static final String UNION_TYPE_MEMBERS_FIELD = "members"; static final String TUPLE_TYPE_MEMBERS_FIELD = "tupleTypes"; static final String ARRAY_ELEMENT_TYPE_FIELD = "eType"; + static final String CLASS_LOADER_DATA = "class_loader"; static final String RECORD_TNAME = "record"; static final String OBJECT_TNAME = "object"; @@ -192,7 +193,7 @@ static boolean isHandleType(Object bValue) { return false; } - static ParamTypeConstraint[] buildParamTypeConstraints(ArrayValue javaTypeConstraints) { + static ParamTypeConstraint[] buildParamTypeConstraints(ArrayValue javaTypeConstraints, ClassLoader classLoader) { if (javaTypeConstraints == null) { return new ParamTypeConstraint[0]; } @@ -200,16 +201,16 @@ static ParamTypeConstraint[] buildParamTypeConstraints(ArrayValue javaTypeConstr List constraintList = new ArrayList<>(); for (int paramIndex = 0; paramIndex < javaTypeConstraints.size(); paramIndex++) { Object javaTypeConstraint = javaTypeConstraints.get(paramIndex); - constraintList.add(buildParamTypeConstraint(javaTypeConstraint)); + constraintList.add(buildParamTypeConstraint(javaTypeConstraint, classLoader)); } return constraintList.toArray(new ParamTypeConstraint[0]); } - private static ParamTypeConstraint buildParamTypeConstraint(Object javaTypeConstraint) { + private static ParamTypeConstraint buildParamTypeConstraint(Object javaTypeConstraint, ClassLoader classLoader) { if (isJavaRefType(javaTypeConstraint)) { - return buildConstraintFromJavaRefType((MapValue) javaTypeConstraint); + return buildConstraintFromJavaRefType((MapValue) javaTypeConstraint, classLoader); } else if (isJavaArrayType(javaTypeConstraint)) { - return buildConstraintFromJavaArrayType((MapValue) javaTypeConstraint); + return buildConstraintFromJavaArrayType((MapValue) javaTypeConstraint, classLoader); } else if (isJavaNoType(javaTypeConstraint)) { return ParamTypeConstraint.NO_CONSTRAINT; } else { @@ -217,14 +218,16 @@ private static ParamTypeConstraint buildParamTypeConstraint(Object javaTypeConst } } - private static ParamTypeConstraint buildConstraintFromJavaRefType(MapValue javaRefType) { + private static ParamTypeConstraint buildConstraintFromJavaRefType(MapValue javaRefType, + ClassLoader classLoader) { String constraintBValue = (String) javaRefType.get(TYPE_NAME_FIELD); - return new ParamTypeConstraint(loadClass(constraintBValue)); + return new ParamTypeConstraint(loadClass(constraintBValue, classLoader)); } - private static ParamTypeConstraint buildConstraintFromJavaArrayType(MapValue javaRefType) { + private static ParamTypeConstraint buildConstraintFromJavaArrayType(MapValue javaRefType, + ClassLoader classLoader) { String typeSig = getJavaArrayTypeSig(javaRefType); - return new ParamTypeConstraint(loadClass(typeSig)); + return new ParamTypeConstraint(loadClass(typeSig, classLoader)); } private static String getJavaArrayTypeSig(MapValue javaRefType) { @@ -334,10 +337,10 @@ private static boolean isJavaNoType(Object javaTypeConstraint) { } } - static Class loadClass(String className) { + static Class loadClass(String className, ClassLoader classLoader) { try { - return Class.forName(className.replace("/", ".")); - } catch (ClassNotFoundException e) { + return Class.forName(className.replace("/", "."), false, classLoader); + } catch (ClassNotFoundException | NoClassDefFoundError e) { throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } } diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java index f251f6029304..20c82dab5dcc 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropException.java @@ -31,6 +31,7 @@ class JInteropException extends RuntimeException { static final String OVERLOADED_METHODS_REASON = "OVERLOADED_METHODS"; static final String UNSUPPORTED_PRIMITIVE_TYPE_REASON = "UNSUPPORTED_PRIMITIVE_TYPE"; static final String METHOD_SIGNATURE_NOT_MATCH_REASON = "METHOD_SIGNATURE_DOES_NOT_MATCH"; + static final String CLASS_LOADER_INIT_FAILED_REASON = "CLASS_LOADER_INIT_FAILED"; private String reason; diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java index 33c1e3d8302b..34738c4ff512 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropFieldValidator.java @@ -19,12 +19,18 @@ import org.ballerinalang.jvm.scheduling.Strand; import org.ballerinalang.jvm.values.MapValue; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; import org.ballerinalang.nativeimpl.jvm.interop.JavaField.JFieldMethod; import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; import java.lang.reflect.Field; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.INTEROP_VALIDATOR; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.JVM_PKG_PATH; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_FIELD; +import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_LOADER_DATA; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.FIELD_TYPE_FIELD; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.IS_STATIC_FIELD; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.METHOD_FIELD; @@ -37,16 +43,20 @@ * @since 1.0.0 */ @BallerinaFunction( - orgName = "ballerina", packageName = "jvm", functionName = "validateAndGetJField" + orgName = "ballerina", packageName = "jvm", + receiver = @Receiver(type = TypeKind.OBJECT, structType = INTEROP_VALIDATOR, structPackage = JVM_PKG_PATH), + functionName = "validateAndGetJField" ) public class JInteropFieldValidator { - public static Object validateAndGetJField(Strand strand, MapValue jFieldValidationRequest) { + public static Object validateAndGetJField(Strand strand, ObjectValue interopValidatorStruct, + MapValue jFieldValidationRequest) { try { // 1) Load Java class - validate + ClassLoader classLoader = (ClassLoader) interopValidatorStruct.getNativeData(CLASS_LOADER_DATA); JFieldMethod method = getFieldMethod(jFieldValidationRequest); String className = (String) jFieldValidationRequest.get(CLASS_FIELD); - Class clazz = JInterop.loadClass(className); + Class clazz = JInterop.loadClass(className, classLoader); // 2) Load Java method details - use the method kind in the request - validate kind and the existance of the // method. Possible there may be more than one methods for the given kind and the name diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropMethodValidator.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropMethodValidator.java index 3915c169e788..b242ddd2812e 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropMethodValidator.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JInteropMethodValidator.java @@ -19,9 +19,15 @@ import org.ballerinalang.jvm.scheduling.Strand; import org.ballerinalang.jvm.values.MapValue; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.model.types.TypeKind; import org.ballerinalang.natives.annotations.BallerinaFunction; +import org.ballerinalang.natives.annotations.Receiver; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.INTEROP_VALIDATOR; +import static org.ballerinalang.nativeimpl.jvm.ASMUtil.JVM_PKG_PATH; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_FIELD; +import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.CLASS_LOADER_DATA; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.IS_INTERFACE_FIELD; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.IS_STATIC_FIELD; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.KIND_FIELD; @@ -37,20 +43,24 @@ * @since 1.0.0 */ @BallerinaFunction( - orgName = "ballerina", packageName = "jvm", functionName = "validateAndGetJMethod" + orgName = "ballerina", packageName = "jvm", + receiver = @Receiver(type = TypeKind.OBJECT, structType = INTEROP_VALIDATOR, structPackage = JVM_PKG_PATH), + functionName = "validateAndGetJMethod" ) public class JInteropMethodValidator { - public static Object validateAndGetJMethod(Strand strand, MapValue jMethodReqBValue) { + public static Object validateAndGetJMethod(Strand strand, ObjectValue interopValidatorStruct, + MapValue jMethodReqBValue) { try { + ClassLoader classLoader = (ClassLoader) interopValidatorStruct.getNativeData(CLASS_LOADER_DATA); // Populate JMethodRequest from the BValue - JMethodRequest jMethodRequest = JMethodRequest.build(jMethodReqBValue); + JMethodRequest jMethodRequest = JMethodRequest.build(jMethodReqBValue, classLoader); // Validate the Ballerina external function signature with the specific Java interoperability annotation validateBExternalFunction(jMethodRequest); // Find the most specific Java method or constructor for the given request - JMethod jMethod = resolveJMethod(jMethodRequest); + JMethod jMethod = resolveJMethod(jMethodRequest, classLoader); // Return the matched Java method or constructor details back to the Ballerina land. - return createJMethodBValue(jMethod); + return createJMethodBValue(jMethod, classLoader); } catch (JInteropException e) { return JInterop.createErrorBValue(e.getReason(), e.getMessage()); } @@ -59,12 +69,12 @@ public static Object validateAndGetJMethod(Strand strand, MapValue jMethodRecord = JInterop.createRecordBValue(METHOD_TYPE_NAME); jMethodRecord.put(NAME_FIELD, jMethod.getName()); jMethodRecord.put(CLASS_FIELD, jMethod.getClassName().replace('.', '/')); @@ -73,7 +83,7 @@ private static MapValue createJMethodBValue(JMethod jMethod) { jMethodRecord.put(IS_STATIC_FIELD, jMethod.isStatic()); jMethodRecord.put(SIG_FIELD, jMethod.getSignature()); jMethodRecord.put(METHOD_TYPE_FIELD, JInterop.createJMethodTypeBValue(jMethod)); - jMethodRecord.put(METHOD_THROWS_FIELD, jMethod.getExceptionTypes()); + jMethodRecord.put(METHOD_THROWS_FIELD, jMethod.getExceptionTypes(classLoader)); return jMethodRecord; } } diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java index 6ba4ae2e2083..b0e365740126 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethod.java @@ -28,6 +28,8 @@ import java.util.ArrayList; import java.util.List; +import static org.ballerinalang.nativeimpl.jvm.interop.JInteropException.CLASS_NOT_FOUND_REASON; + /** * Represents a java method in this implementation. * @@ -100,14 +102,20 @@ Class getReturnType() { } } - ArrayValue getExceptionTypes() { + ArrayValue getExceptionTypes(ClassLoader classLoader) { List checkedExceptions = new ArrayList<>(); - for (Class exceptionType : method.getExceptionTypes()) { - if (!RuntimeException.class.isAssignableFrom(exceptionType)) { - checkedExceptions.add(exceptionType); + try { + Class runtimeException = classLoader.loadClass(RuntimeException.class.getCanonicalName()); + for (Class exceptionType : method.getExceptionTypes()) { + if (!runtimeException.isAssignableFrom(exceptionType)) { + checkedExceptions.add(exceptionType); + } } + } catch (ClassNotFoundException | NoClassDefFoundError e) { + throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } + ArrayValue arrayValue = new ArrayValue(new BArrayType(BTypes.typeString), checkedExceptions.size()); int i = 0; for (Class exceptionType : checkedExceptions) { diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java index 13e16748d8cc..5a6e3603ab92 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodRequest.java @@ -72,13 +72,13 @@ class JMethodRequest { private JMethodRequest() { } - static JMethodRequest build(MapValue jMethodReqBValue) { + static JMethodRequest build(MapValue jMethodReqBValue, ClassLoader classLoader) { JMethodRequest jMethodReq = new JMethodRequest(); jMethodReq.kind = JMethodKind.getKind((String) jMethodReqBValue.get(KIND_FIELD)); jMethodReq.methodName = (String) jMethodReqBValue.get(NAME_FIELD); - jMethodReq.declaringClass = JInterop.loadClass((String) jMethodReqBValue.get(CLASS_FIELD)); + jMethodReq.declaringClass = JInterop.loadClass((String) jMethodReqBValue.get(CLASS_FIELD), classLoader); jMethodReq.paramTypeConstraints = JInterop.buildParamTypeConstraints( - (ArrayValue) jMethodReqBValue.get(PARAM_TYPE_CONSTRAINTS_FIELD)); + (ArrayValue) jMethodReqBValue.get(PARAM_TYPE_CONSTRAINTS_FIELD), classLoader); MapValue bFuncType = (MapValue) jMethodReqBValue.get(B_FUNC_TYPE_FIELD); ArrayValue paramTypes = (ArrayValue) bFuncType.get(PARAM_TYPES_FIELD); diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java index dbfdc574121e..3ff7da0cb168 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/JMethodResolver.java @@ -51,6 +51,7 @@ import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.J_PRIMITIVE_LONG_TNAME; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.J_PRIMITIVE_SHORT_TNAME; import static org.ballerinalang.nativeimpl.jvm.interop.JInterop.J_VOID_TNAME; +import static org.ballerinalang.nativeimpl.jvm.interop.JInteropException.CLASS_NOT_FOUND_REASON; import static org.ballerinalang.nativeimpl.jvm.interop.JInteropException.OVERLOADED_METHODS_REASON; /** @@ -60,6 +61,12 @@ */ class JMethodResolver { + private ClassLoader classLoader; + + JMethodResolver(ClassLoader classLoader) { + this.classLoader = classLoader; + } + JMethod resolve(JMethodRequest jMethodRequest) { // 1) Get java methods (that matches with the method name) or constructor list List jMethods = resolveByMethodName(jMethodRequest.declaringClass, @@ -133,17 +140,24 @@ private void validateMethodSignature(JMethodRequest jMethodRequest, JMethod jMet private void validateExceptionTypes(JMethodRequest jMethodRequest, JMethod jMethod) { Executable method = jMethod.getMethod(); boolean throwsCheckedException = false; - for (Class exceptionType : method.getExceptionTypes()) { - if (!RuntimeException.class.isAssignableFrom(exceptionType)) { - throwsCheckedException = true; - break; + boolean returnsErrorValue; + try { + for (Class exceptionType : method.getExceptionTypes()) { + if (!this.classLoader.loadClass(RuntimeException.class.getCanonicalName()) + .isAssignableFrom(exceptionType)) { + throwsCheckedException = true; + break; + } } + returnsErrorValue = method instanceof Method && (this.classLoader + .loadClass(ErrorValue.class.getCanonicalName()) + .isAssignableFrom(((Method) method).getReturnType()) || + this.classLoader.loadClass(Object.class.getCanonicalName()) + .isAssignableFrom(((Method) method).getReturnType())); + } catch (ClassNotFoundException | NoClassDefFoundError e) { + throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } - boolean returnsErrorValue = method instanceof Method && ( - ErrorValue.class.isAssignableFrom(((Method) method).getReturnType()) || - Object.class.isAssignableFrom(((Method) method).getReturnType())); - if ((throwsCheckedException && !jMethodRequest.returnsBErrorType) || (jMethodRequest.returnsBErrorType && !throwsCheckedException && !returnsErrorValue)) { throw new JInteropException(JInteropException.METHOD_SIGNATURE_NOT_MATCH_REASON, @@ -188,81 +202,87 @@ private void validateReturnTypes(JMethodRequest jMethodRequest, JMethod jMethod) } private boolean isValidExpectedBType(Class jParamType, BType bParamType, JMethodRequest jMethodRequest) { - String jParamTypeName = jParamType.getTypeName(); - switch (bParamType.getTag()) { - case TypeTags.HANDLE_TAG: - case TypeTags.ANY_TAG: - case TypeTags.ANYDATA_TAG: - return !jParamType.isPrimitive(); - case TypeTags.NULL_TAG: - return jParamTypeName.equals(J_VOID_TNAME); - case TypeTags.INT_TAG: - case TypeTags.BYTE_TAG: - case TypeTags.FLOAT_TAG: - if (jParamTypeName.equals(J_OBJECT_TNAME)) { - return true; - } + try { + String jParamTypeName = jParamType.getTypeName(); + switch (bParamType.getTag()) { + case TypeTags.HANDLE_TAG: + case TypeTags.ANY_TAG: + case TypeTags.ANYDATA_TAG: + return !jParamType.isPrimitive(); + case TypeTags.NULL_TAG: + return jParamTypeName.equals(J_VOID_TNAME); + case TypeTags.INT_TAG: + case TypeTags.BYTE_TAG: + case TypeTags.FLOAT_TAG: + if (jParamTypeName.equals(J_OBJECT_TNAME)) { + return true; + } - if (bParamType.getTag() == TypeTags.INT_TAG && jParamTypeName.equals(J_LONG_OBJ_TNAME)) { - return true; - } + if (bParamType.getTag() == TypeTags.INT_TAG && jParamTypeName.equals(J_LONG_OBJ_TNAME)) { + return true; + } - if (bParamType.getTag() == TypeTags.BYTE_TAG && jParamTypeName.equals(J_INTEGER_OBJ_TNAME)) { - return true; - } + if (bParamType.getTag() == TypeTags.BYTE_TAG && jParamTypeName.equals(J_INTEGER_OBJ_TNAME)) { + return true; + } if (bParamType.getTag() == TypeTags.FLOAT_TAG && jParamTypeName.equals(J_DOUBLE_OBJ_TNAME)) { return true; } return jParamType.isPrimitive() && - (jParamTypeName.equals(J_PRIMITIVE_INT_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_BYTE_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_SHORT_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_LONG_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_CHAR_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_FLOAT_TNAME) || - jParamTypeName.equals(J_PRIMITIVE_DOUBLE_TNAME)); - case TypeTags.BOOLEAN_TAG: - if (jParamTypeName.equals(J_OBJECT_TNAME) || jParamTypeName.equals(J_BOOLEAN_OBJ_TNAME)) { - return true; - } - return jParamType.isPrimitive() && jParamTypeName.equals(J_PRIMITIVE_BOOLEAN_TNAME); - case TypeTags.DECIMAL_TAG: - return BigDecimal.class.isAssignableFrom(jParamType); - case TypeTags.STRING_TAG: - return String.class.isAssignableFrom(jParamType); - case TypeTags.MAP_TAG: - case TypeTags.RECORD_TYPE_TAG: - case TypeTags.JSON_TAG: - return MapValue.class.isAssignableFrom(jParamType); - case TypeTags.OBJECT_TYPE_TAG: - case TypeTags.SERVICE_TAG: - return ObjectValue.class.isAssignableFrom(jParamType); - case TypeTags.ERROR_TAG: - return ErrorValue.class.isAssignableFrom(jParamType); - case TypeTags.STREAM_TAG: - return StreamValue.class.isAssignableFrom(jParamType); - case TypeTags.TABLE_TAG: - return TableValue.class.isAssignableFrom(jParamType); - case TypeTags.XML_TAG: - return XMLValue.class.isAssignableFrom(jParamType); - case TypeTags.TUPLE_TAG: - case TypeTags.ARRAY_TAG: - if (jMethodRequest.restParamExist) { - return jParamType.isArray(); - } - return ArrayValue.class.isAssignableFrom(jParamType); - case TypeTags.UNION_TAG: - List members = ((BUnionType) bParamType).getMemberTypes(); - for (BType member : members) { - if (isValidExpectedBType(jParamType, member, jMethodRequest)) { + (jParamTypeName.equals(J_PRIMITIVE_INT_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_BYTE_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_SHORT_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_LONG_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_CHAR_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_FLOAT_TNAME) || + jParamTypeName.equals(J_PRIMITIVE_DOUBLE_TNAME)); + case TypeTags.BOOLEAN_TAG: + if (jParamTypeName.equals(J_OBJECT_TNAME) || jParamTypeName.equals(J_BOOLEAN_OBJ_TNAME)) { return true; } - } - return !jParamType.isPrimitive(); + return jParamType.isPrimitive() && jParamTypeName.equals(J_PRIMITIVE_BOOLEAN_TNAME); + case TypeTags.DECIMAL_TAG: + return this.classLoader.loadClass(BigDecimal.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.STRING_TAG: + return this.classLoader.loadClass(String.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.MAP_TAG: + case TypeTags.RECORD_TYPE_TAG: + case TypeTags.JSON_TAG: + return this.classLoader.loadClass(MapValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.OBJECT_TYPE_TAG: + case TypeTags.SERVICE_TAG: + return this.classLoader.loadClass(ObjectValue.class.getCanonicalName()) + .isAssignableFrom(jParamType); + case TypeTags.ERROR_TAG: + return this.classLoader.loadClass(ErrorValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.STREAM_TAG: + return this.classLoader.loadClass(StreamValue.class.getCanonicalName()) + .isAssignableFrom(jParamType); + case TypeTags.TABLE_TAG: + return this.classLoader.loadClass(TableValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.XML_TAG: + return this.classLoader.loadClass(XMLValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.TUPLE_TAG: + case TypeTags.ARRAY_TAG: + if (jMethodRequest.restParamExist) { + return jParamType.isArray(); + } + return this.classLoader.loadClass(ArrayValue.class.getCanonicalName()).isAssignableFrom(jParamType); + case TypeTags.UNION_TAG: + List members = ((BUnionType) bParamType).getMemberTypes(); + for (BType member : members) { + if (isValidExpectedBType(jParamType, member, jMethodRequest)) { + return true; + } + } + return !jParamType.isPrimitive(); + } + return false; + } catch (ClassNotFoundException | NoClassDefFoundError e) { + throw new JInteropException(CLASS_NOT_FOUND_REASON, e.getMessage(), e); } - return false; } private JMethod resolveExactMethod(Class clazz, String name, JMethodKind kind, ParamTypeConstraint[] constraints) { From d1e4213014e80f570d9b320f6a7cd46c89037d1b Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:52:55 +0530 Subject: [PATCH 091/167] Add ballerina libs module --- distribution/libs/build.gradle | 139 +------------------- distribution/zip/jballerina/build.gradle | 126 +----------------- gradle/javaLibsProject.gradle | 155 +++++++++++++++++++++++ settings.gradle | 2 + 4 files changed, 159 insertions(+), 263 deletions(-) create mode 100644 gradle/javaLibsProject.gradle diff --git a/distribution/libs/build.gradle b/distribution/libs/build.gradle index 1883ddf8b67f..e056818fdbf1 100644 --- a/distribution/libs/build.gradle +++ b/distribution/libs/build.gradle @@ -19,144 +19,7 @@ plugins { id 'base' } -apply from: "$rootDir/gradle/repositories.gradle" - -configurations { - dist { - transitive false - } -} - -dependencies { - dist 'com.squareup.okhttp3:okhttp:3.9.1' - dist 'com.squareup.okio:okio:1.13.0' - dist 'com.uber.jaeger:jaeger-core:0.24.0' - dist 'com.uber.jaeger:jaeger-thrift:0.24.0' - dist 'com.zaxxer:HikariCP:3.3.1' - dist 'io.dropwizard.metrics:metrics-core:3.1.0' - dist 'javax.transaction:javax.transaction-api:1.2' - dist 'org.apache.thrift:libthrift:0.10.0' - dist 'org.jvnet.mimepull:mimepull:1.9.7' - dist 'org.quartz-scheduler:quartz-jobs:2.3.0' - dist 'org.quartz-scheduler:quartz:2.3.0' - dist 'org.wso2.carbon:org.wso2.carbon.core:5.1.0' - dist 'org.wso2.securevault:org.wso2.securevault:1.0.0-wso2v2' - dist 'org.wso2.transport.file:org.wso2.transport.local-file-system:6.0.55' - dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.28' - dist 'org.bouncycastle:bcprov-jdk15on:1.61' - dist 'org.bouncycastle:bcpkix-jdk15on:1.61' - - dist 'info.picocli:picocli:4.0.1' - dist 'org.apache.kafka:kafka-clients:2.0.1' - dist 'org.apache.kafka:kafka_2.11:2.0.1' - dist 'io.ballerina.messaging:broker-auth:0.970.0' - dist 'io.ballerina.messaging:broker-common:0.970.0' - dist 'io.ballerina.messaging:broker-coordination:0.970.0' - dist 'io.ballerina.messaging:broker-core:0.970.5' - dist 'io.ballerina.messaging:broker-rest-runner:0.970.0' - dist 'org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.1' - dist 'org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1' - dist 'com.google.code.gson:gson:2.7' - dist 'com.google.guava:guava:19.0' - dist 'com.github.jknack:handlebars:4.0.6' - dist 'jaxen:jaxen:1.1.6' - dist 'io.netty:netty-buffer:4.1.39.Final' - dist 'io.netty:netty-codec-http2:4.1.39.Final' - dist 'io.netty:netty-codec-http:4.1.39.Final' - dist 'io.netty:netty-codec:4.1.39.Final' - dist 'io.netty:netty-common:4.1.39.Final' - dist 'io.netty:netty-handler-proxy:4.1.39.Final' - dist 'io.netty:netty-handler:4.1.39.Final' - dist 'io.netty:netty-resolver:4.1.39.Final' - dist 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final' - dist 'io.netty:netty-transport:4.1.39.Final' - dist 'commons-pool.wso2:commons-pool:1.5.6.wso2v1' - dist 'org.wso2.carbon.messaging:org.wso2.carbon.messaging:2.3.7' - dist 'org.wso2.carbon.metrics:org.wso2.carbon.metrics.core:2.3.7' - dist 'com.google.protobuf:protobuf-java:3.9.1' - dist 'org.wso2.orbit.org.yaml:snakeyaml:1.16.0.wso2v1' - dist 'org.wso2.staxon:staxon-core:1.2.0.wso2v2' - dist 'com.jcraft:jzlib:1.1.3' - dist 'io.nats:java-nats-streaming:2.2.1' - dist 'io.nats:jnats:2.6.0' - dist 'commons-beanutils:commons-beanutils:1.9.3' - dist 'org.jboss.logging:jboss-logging:3.3.1.Final' - dist 'commons-collections:commons-collections:3.2.2' - dist 'org.apache.geronimo.specs:geronimo-json_1.0_spec:1.0-alpha-1' - dist 'io.netty:netty-transport-native-epoll:4.1.39.Final' - dist 'io.netty:netty-transport-native-kqueue:4.1.39.Final' -// dist 'org.codehaus.woodstox:woodstox-core-asl:4.2.0' -// dist 'org.codehaus.woodstox:stax2-api:3.1.1' - - - - // Lang libs - dist project(':ballerina-auth') - dist project(':ballerina-cli-utils') - dist project(':ballerina-config-api') - dist project(':ballerina-core') - dist project(':ballerina-crypto') - dist project(':ballerina-file') - dist project(':ballerina-filepath') - dist project(':ballerina-grpc') - dist project(':ballerina-jdbc') - dist project(':ballerina-http') - dist project(':ballerina-openapi') - dist project(':ballerina-encoding') - dist project(':ballerina-io') - dist project(':ballerina-lang') - dist project(':ballerina-log-api') - dist project(':ballerina-logging') - dist project(':ballerina-math') - dist project(':ballerina-mime') - dist project(':ballerina-observability') - dist project(':ballerina-reflect') - dist project(':ballerina-runtime-api') - dist project(':ballerina-socket') - dist project(':ballerina-streams') - dist project(':ballerina-system') - dist project(':ballerina-task') - dist project(':ballerina-time') - dist project(':ballerina-tool') - dist project(':ballerina-transactions') - dist project(':ballerina-java') - dist project(':ballerina-java-arrays') - dist project(':ballerina-xslt') - dist project(':ballerina-utils') - dist project(':metrics-extensions:ballerina-metrics-extension') - dist project(':metrics-extensions:ballerina-prometheus-extension') - dist project(':tracing-extensions:ballerina-jaeger-extension') - dist project(':ballerina-kafka') - dist project(':ballerina-nats') - dist project(':ballerina-stringutils') - dist project(':ballerina-jwt') - dist project(':ballerina-oauth2') - dist project(':ballerina-xmlutils') - dist project(':ballerina-jsonutils') - dist project(':ballerina-docker') - dist project(':ballerina-kubernetes') - dist project(':ballerina-istio') - dist project(':ballerina-openshift') - - // Lang libs - dist project(':ballerina-lang:internal') - dist project(':ballerina-lang:annotations') - dist project(':ballerina-lang:array') - dist project(':ballerina-lang:decimal') - dist project(':ballerina-lang:error') - dist project(':ballerina-lang:floatingpoint') - dist project(':ballerina-lang:future') - dist project(':ballerina-lang:integer') - dist project(':ballerina-lang:map') - dist project(':ballerina-lang:object') - dist project(':ballerina-lang:stream') - dist project(':ballerina-lang:string') - dist project(':ballerina-lang:table') - dist project(':ballerina-lang:typedesc') - dist project(':ballerina-lang:value') - dist project(':ballerina-lang:xml') - -} +apply from: "$rootDir/gradle/javaLibsProject.gradle" task copyDependencies(type: Copy) { from configurations.dist diff --git a/distribution/zip/jballerina/build.gradle b/distribution/zip/jballerina/build.gradle index 6dbf1bebc840..0b15108fc485 100644 --- a/distribution/zip/jballerina/build.gradle +++ b/distribution/zip/jballerina/build.gradle @@ -20,6 +20,7 @@ plugins { } apply from: "$rootDir/gradle/repositories.gradle" +apply from: "$rootDir/gradle/javaLibsProject.gradle" configurations { dist { @@ -45,65 +46,6 @@ configurations { } dependencies { - dist 'com.squareup.okhttp3:okhttp:3.9.1' - dist 'com.squareup.okio:okio:1.13.0' - dist 'com.uber.jaeger:jaeger-core:0.24.0' - dist 'com.uber.jaeger:jaeger-thrift:0.24.0' - dist 'com.zaxxer:HikariCP:3.3.1' - dist 'io.dropwizard.metrics:metrics-core:3.1.0' - dist 'javax.transaction:javax.transaction-api:1.2' - dist 'org.apache.thrift:libthrift:0.10.0' - dist 'org.jvnet.mimepull:mimepull:1.9.7' - dist 'org.quartz-scheduler:quartz-jobs:2.3.0' - dist 'org.quartz-scheduler:quartz:2.3.0' - dist 'org.wso2.carbon:org.wso2.carbon.core:5.1.0' - dist 'org.wso2.securevault:org.wso2.securevault:1.0.0-wso2v2' - dist 'org.wso2.transport.file:org.wso2.transport.local-file-system:6.0.55' - dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.28' - dist 'org.bouncycastle:bcprov-jdk15on:1.61' - dist 'org.bouncycastle:bcpkix-jdk15on:1.61' - - dist 'info.picocli:picocli:4.0.1' - dist 'org.apache.kafka:kafka-clients:2.0.1' - dist 'org.apache.kafka:kafka_2.11:2.0.1' - dist 'io.ballerina.messaging:broker-auth:0.970.0' - dist 'io.ballerina.messaging:broker-common:0.970.0' - dist 'io.ballerina.messaging:broker-coordination:0.970.0' - dist 'io.ballerina.messaging:broker-core:0.970.5' - dist 'io.ballerina.messaging:broker-rest-runner:0.970.0' - dist 'org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.1' - dist 'org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1' - dist 'com.google.code.gson:gson:2.7' - dist 'com.google.guava:guava:19.0' - dist 'com.github.jknack:handlebars:4.0.6' - dist 'jaxen:jaxen:1.1.6' - dist 'io.netty:netty-buffer:4.1.39.Final' - dist 'io.netty:netty-codec-http2:4.1.39.Final' - dist 'io.netty:netty-codec-http:4.1.39.Final' - dist 'io.netty:netty-codec:4.1.39.Final' - dist 'io.netty:netty-common:4.1.39.Final' - dist 'io.netty:netty-handler-proxy:4.1.39.Final' - dist 'io.netty:netty-handler:4.1.39.Final' - dist 'io.netty:netty-resolver:4.1.39.Final' - dist 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final' - dist 'io.netty:netty-transport:4.1.39.Final' - dist 'commons-pool.wso2:commons-pool:1.5.6.wso2v1' - dist 'org.wso2.carbon.messaging:org.wso2.carbon.messaging:2.3.7' - dist 'org.wso2.carbon.metrics:org.wso2.carbon.metrics.core:2.3.7' - dist 'com.google.protobuf:protobuf-java:3.9.1' - dist 'org.wso2.orbit.org.yaml:snakeyaml:1.16.0.wso2v1' - dist 'org.wso2.staxon:staxon-core:1.2.0.wso2v2' - dist 'com.jcraft:jzlib:1.1.3' - dist 'io.nats:java-nats-streaming:2.2.1' - dist 'io.nats:jnats:2.6.0' - dist 'commons-beanutils:commons-beanutils:1.9.3' - dist 'org.jboss.logging:jboss-logging:3.3.1.Final' - dist 'commons-collections:commons-collections:3.2.2' - dist 'org.apache.geronimo.specs:geronimo-json_1.0_spec:1.0-alpha-1' - dist 'io.netty:netty-transport-native-epoll:4.1.39.Final' - dist 'io.netty:netty-transport-native-kqueue:4.1.39.Final' -// dist 'org.codehaus.woodstox:woodstox-core-asl:4.2.0' -// dist 'org.codehaus.woodstox:stax2-api:3.1.1' distBal project(path: ':ballerina-auth', configuration: 'baloImplementation') distBal project(path: ':ballerina-cache', configuration: 'baloImplementation') @@ -223,72 +165,6 @@ dependencies { balSource project(path: ':ballerina-java', configuration: 'balSource') balSource project(path: ':ballerina-java-arrays', configuration: 'balSource') - dist project(':ballerina-auth') - dist project(':ballerina-cli-utils') - dist project(':ballerina-config-api') - dist project(':ballerina-core') - dist project(':ballerina-crypto') - dist project(':ballerina-file') - dist project(':ballerina-filepath') - dist project(':ballerina-grpc') - dist project(':ballerina-jdbc') - dist project(':ballerina-http') - dist project(':ballerina-openapi') - dist project(':ballerina-encoding') - dist project(':ballerina-io') - dist project(':ballerina-lang') - dist project(':ballerina-log-api') - dist project(':ballerina-logging') - dist project(':ballerina-math') - dist project(':ballerina-mime') - dist project(':ballerina-observability') - dist project(':ballerina-reflect') - dist project(':ballerina-runtime-api') - dist project(':ballerina-rt') - dist project(':ballerina-socket') - dist project(':ballerina-streams') - dist project(':ballerina-system') - dist project(':ballerina-task') - dist project(':ballerina-time') - dist project(':ballerina-tool') - dist project(':ballerina-transactions') - dist project(':ballerina-java') - dist project(':ballerina-java-arrays') - dist project(':ballerina-xslt') - dist project(':ballerina-utils') - dist project(':metrics-extensions:ballerina-metrics-extension') - dist project(':metrics-extensions:ballerina-prometheus-extension') - dist project(':tracing-extensions:ballerina-jaeger-extension') - dist project(':ballerina-kafka') - dist project(':ballerina-nats') - dist project(':ballerina-stringutils') - dist project(':ballerina-jwt') - dist project(':ballerina-oauth2') - dist project(':ballerina-xmlutils') - dist project(':ballerina-jsonutils') - dist project(':ballerina-docker') - dist project(':ballerina-kubernetes') - dist project(':ballerina-istio') - dist project(':ballerina-openshift') - - // Lang libs - dist project(':ballerina-lang:internal') - dist project(':ballerina-lang:annotations') - dist project(':ballerina-lang:array') - dist project(':ballerina-lang:decimal') - dist project(':ballerina-lang:error') - dist project(':ballerina-lang:floatingpoint') - dist project(':ballerina-lang:future') - dist project(':ballerina-lang:integer') - dist project(':ballerina-lang:map') - dist project(':ballerina-lang:object') - dist project(':ballerina-lang:stream') - dist project(':ballerina-lang:string') - dist project(':ballerina-lang:table') - dist project(':ballerina-lang:typedesc') - dist project(':ballerina-lang:value') - dist project(':ballerina-lang:xml') - birJar project(path: ':metrics-extensions:ballerina-prometheus-extension', configuration: 'prometheusJar') staticArtifacts files('COPYRIGHT', 'LICENSE', 'README.md') diff --git a/gradle/javaLibsProject.gradle b/gradle/javaLibsProject.gradle new file mode 100644 index 000000000000..1f9cd864ad7c --- /dev/null +++ b/gradle/javaLibsProject.gradle @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +apply from: "$rootDir/gradle/repositories.gradle" + +configurations { + dist { + transitive false + } +} + +dependencies { + dist 'com.squareup.okhttp3:okhttp:3.9.1' + dist 'com.squareup.okio:okio:1.13.0' + dist 'com.uber.jaeger:jaeger-core:0.24.0' + dist 'com.uber.jaeger:jaeger-thrift:0.24.0' + dist 'com.zaxxer:HikariCP:3.3.1' + dist 'io.dropwizard.metrics:metrics-core:3.1.0' + dist 'javax.transaction:javax.transaction-api:1.2' + dist 'org.apache.thrift:libthrift:0.10.0' + dist 'org.jvnet.mimepull:mimepull:1.9.7' + dist 'org.quartz-scheduler:quartz-jobs:2.3.0' + dist 'org.quartz-scheduler:quartz:2.3.0' + dist 'org.wso2.carbon:org.wso2.carbon.core:5.1.0' + dist 'org.wso2.securevault:org.wso2.securevault:1.0.0-wso2v2' + dist 'org.wso2.transport.file:org.wso2.transport.local-file-system:6.0.55' + dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.28' + dist 'org.bouncycastle:bcprov-jdk15on:1.61' + dist 'org.bouncycastle:bcpkix-jdk15on:1.61' + + dist 'info.picocli:picocli:4.0.1' + dist 'org.apache.kafka:kafka-clients:2.0.1' + dist 'org.apache.kafka:kafka_2.11:2.0.1' + dist 'io.ballerina.messaging:broker-auth:0.970.0' + dist 'io.ballerina.messaging:broker-common:0.970.0' + dist 'io.ballerina.messaging:broker-coordination:0.970.0' + dist 'io.ballerina.messaging:broker-core:0.970.5' + dist 'io.ballerina.messaging:broker-rest-runner:0.970.0' + dist 'org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.1' + dist 'org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:1.0.1' + dist 'com.google.code.gson:gson:2.7' + dist 'com.google.guava:guava:19.0' + dist 'com.github.jknack:handlebars:4.0.6' + dist 'jaxen:jaxen:1.1.6' + dist 'io.netty:netty-buffer:4.1.39.Final' + dist 'io.netty:netty-codec-http2:4.1.39.Final' + dist 'io.netty:netty-codec-http:4.1.39.Final' + dist 'io.netty:netty-codec:4.1.39.Final' + dist 'io.netty:netty-common:4.1.39.Final' + dist 'io.netty:netty-handler-proxy:4.1.39.Final' + dist 'io.netty:netty-handler:4.1.39.Final' + dist 'io.netty:netty-resolver:4.1.39.Final' + dist 'io.netty:netty-tcnative-boringssl-static:2.0.25.Final' + dist 'io.netty:netty-transport:4.1.39.Final' + dist 'commons-pool.wso2:commons-pool:1.5.6.wso2v1' + dist 'org.wso2.carbon.messaging:org.wso2.carbon.messaging:2.3.7' + dist 'org.wso2.carbon.metrics:org.wso2.carbon.metrics.core:2.3.7' + dist 'com.google.protobuf:protobuf-java:3.9.1' + dist 'org.wso2.orbit.org.yaml:snakeyaml:1.16.0.wso2v1' + dist 'org.wso2.staxon:staxon-core:1.2.0.wso2v2' + dist 'com.jcraft:jzlib:1.1.3' + dist 'io.nats:java-nats-streaming:2.2.1' + dist 'io.nats:jnats:2.6.0' + dist 'commons-beanutils:commons-beanutils:1.9.3' + dist 'org.jboss.logging:jboss-logging:3.3.1.Final' + dist 'commons-collections:commons-collections:3.2.2' + dist 'org.apache.geronimo.specs:geronimo-json_1.0_spec:1.0-alpha-1' + dist 'io.netty:netty-transport-native-epoll:4.1.39.Final' + dist 'io.netty:netty-transport-native-kqueue:4.1.39.Final' +// dist 'org.codehaus.woodstox:woodstox-core-asl:4.2.0' +// dist 'org.codehaus.woodstox:stax2-api:3.1.1' + + + + // Lang libs + dist project(':ballerina-auth') + dist project(':ballerina-cli-utils') + dist project(':ballerina-config-api') + dist project(':ballerina-core') + dist project(':ballerina-crypto') + dist project(':ballerina-file') + dist project(':ballerina-filepath') + dist project(':ballerina-grpc') + dist project(':ballerina-jdbc') + dist project(':ballerina-http') + dist project(':ballerina-openapi') + dist project(':ballerina-encoding') + dist project(':ballerina-io') + dist project(':ballerina-lang') + dist project(':ballerina-log-api') + dist project(':ballerina-logging') + dist project(':ballerina-math') + dist project(':ballerina-mime') + dist project(':ballerina-observability') + dist project(':ballerina-reflect') + dist project(':ballerina-runtime-api') + dist project(':ballerina-socket') + dist project(':ballerina-streams') + dist project(':ballerina-system') + dist project(':ballerina-task') + dist project(':ballerina-time') + dist project(':ballerina-tool') + dist project(':ballerina-transactions') + dist project(':ballerina-java') + dist project(':ballerina-java-arrays') + dist project(':ballerina-xslt') + dist project(':ballerina-utils') + dist project(':metrics-extensions:ballerina-metrics-extension') + dist project(':metrics-extensions:ballerina-prometheus-extension') + dist project(':tracing-extensions:ballerina-jaeger-extension') + dist project(':ballerina-kafka') + dist project(':ballerina-nats') + dist project(':ballerina-stringutils') + dist project(':ballerina-jwt') + dist project(':ballerina-oauth2') + dist project(':ballerina-xmlutils') + dist project(':ballerina-jsonutils') + dist project(':ballerina-docker') + dist project(':ballerina-kubernetes') + dist project(':ballerina-istio') + dist project(':ballerina-openshift') + + // Lang libs + dist project(':ballerina-lang:internal') + dist project(':ballerina-lang:annotations') + dist project(':ballerina-lang:array') + dist project(':ballerina-lang:decimal') + dist project(':ballerina-lang:error') + dist project(':ballerina-lang:floatingpoint') + dist project(':ballerina-lang:future') + dist project(':ballerina-lang:integer') + dist project(':ballerina-lang:map') + dist project(':ballerina-lang:object') + dist project(':ballerina-lang:stream') + dist project(':ballerina-lang:string') + dist project(':ballerina-lang:table') + dist project(':ballerina-lang:typedesc') + dist project(':ballerina-lang:value') + dist project(':ballerina-lang:xml') + +} diff --git a/settings.gradle b/settings.gradle index 680696b92f92..10d1fbcdb1b2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -129,6 +129,7 @@ include(':ballerina-oauth2') include(':build-config:checkstyle') include(':debug-adapter') include(':ballerina-bootstrapper') +include(':ballerina-libs') project(':ballerina-lang').projectDir = file('compiler/ballerina-lang') project(':ballerina-lang:internal').projectDir = file('langlib/lang.__internal') project(':ballerina-lang:annotations').projectDir = file('langlib/lang.annotations') @@ -244,6 +245,7 @@ project(':ballerina-ldap').projectDir = file('stdlib/ldap') project(':ballerina-oauth2').projectDir = file('stdlib/oauth2') project(':ballerina-jsonutils').projectDir = file('stdlib/jsonutils') project(':ballerina-bootstrapper').projectDir = file('distribution/bootstrapper') +project(':ballerina-libs').projectDir = file('distribution/libs') project(':ballerina-docker').projectDir = file('stdlib/docker') project(':ballerina-kubernetes').projectDir = file('stdlib/kubernetes') project(':ballerina-openshift').projectDir = file('stdlib/openshift') From 578af2e4c12bbef5673eb698635b1a1ff59ed602 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:53:36 +0530 Subject: [PATCH 092/167] Refactor compilebackend to use module class loader --- .../interop/external_method_gen.bal | 9 ++++--- .../interop/interop_method_gen.bal | 25 +++++++++--------- .../compiler_backend_jvm/jvm_package_gen.bal | 22 +++++++++------- .../src/compiler_backend_jvm/main.bal | 26 ++++++++++++++----- 4 files changed, 50 insertions(+), 32 deletions(-) diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal index 0ad859c59d2b..0f801a279a49 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal @@ -152,8 +152,9 @@ function lookupBIRFunctionWrapper(bir:Package birModule, bir:Function birFunc, } } -function createExternalFunctionWrapper(bir:Function birFunc, string orgName ,string moduleName, string versionValue, - string birModuleClassName) returns BIRFunctionWrapper | error { +function createExternalFunctionWrapper(jvm:InteropValidator interopValidator, bir:Function birFunc, + string orgName ,string moduleName, string versionValue, + string birModuleClassName) returns BIRFunctionWrapper | error { BIRFunctionWrapper birFuncWrapper; jvm:InteropValidationRequest? jInteropValidationReq = getInteropAnnotValue(birFunc); if (jInteropValidationReq is ()) { @@ -173,8 +174,8 @@ function createExternalFunctionWrapper(bir:Function birFunc, string orgName ,str panic err; } } else { - birFuncWrapper = check createJInteropFunctionWrapper(jInteropValidationReq, birFunc, orgName, moduleName, - versionValue, birModuleClassName); + birFuncWrapper = check createJInteropFunctionWrapper(interopValidator, jInteropValidationReq, birFunc, orgName, + moduleName, versionValue, birModuleClassName); } return birFuncWrapper; diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal index 76d099d31c6e..7a20a310baa5 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal @@ -30,7 +30,8 @@ type JFieldFunctionWrapper record {| type JInteropFunctionWrapper JMethodFunctionWrapper | JFieldFunctionWrapper; -function createJInteropFunctionWrapper(jvm:InteropValidationRequest jInteropValidationReq, +function createJInteropFunctionWrapper(jvm:InteropValidator interopValidator, + jvm:InteropValidationRequest jInteropValidationReq, bir:Function birFunc, string orgName, string moduleName, @@ -43,15 +44,15 @@ function createJInteropFunctionWrapper(jvm:InteropValidationRequest jInteropVali versionValue, birModuleClassName); if (jInteropValidationReq is jvm:MethodValidationRequest) { jInteropValidationReq.restParamExist = birFunc.restParamExist; - return createJMethodWrapper(jInteropValidationReq, birFuncWrapper); + return createJMethodWrapper(interopValidator, jInteropValidationReq, birFuncWrapper); } else { - return createJFieldWrapper(jInteropValidationReq, birFuncWrapper); + return createJFieldWrapper(interopValidator, jInteropValidationReq, birFuncWrapper); } } -function createJMethodWrapper(jvm:MethodValidationRequest jMethodValidationReq, +function createJMethodWrapper(jvm:InteropValidator interopValidator, jvm:MethodValidationRequest jMethodValidationReq, BIRFunctionWrapper birFuncWrapper) returns JMethodFunctionWrapper | error { - var jMethod = check jvm:validateAndGetJMethod(jMethodValidationReq); + var jMethod = check interopValidator.validateAndGetJMethod(jMethodValidationReq); return { orgName : birFuncWrapper.orgName, @@ -64,9 +65,9 @@ function createJMethodWrapper(jvm:MethodValidationRequest jMethodValidationReq, }; } -function createJFieldWrapper(jvm:FieldValidationRequest jFieldValidationReq, +function createJFieldWrapper(jvm:InteropValidator interopValidator, jvm:FieldValidationRequest jFieldValidationReq, BIRFunctionWrapper birFuncWrapper) returns JFieldFunctionWrapper | error { - var jField = check jvm:validateAndGetJField(jFieldValidationReq); + var jField = check interopValidator.validateAndGetJField(jFieldValidationReq); return { orgName : birFuncWrapper.orgName, @@ -437,16 +438,14 @@ function genJMethodForInteropMethod(JMethodFunctionWrapper extFuncWrapper, mv.visitTypeInsn(INSTANCEOF, "java/lang/Boolean"); mv.visitJumpInsn(IFNE, afterHandle); + mv.visitInsn(DUP); + mv.visitTypeInsn(INSTANCEOF, REF_VALUE); + mv.visitJumpInsn(IFNE, afterHandle); + mv.visitInsn(DUP); mv.visitTypeInsn(INSTANCEOF, "java/lang/Byte"); mv.visitJumpInsn(IFNE, afterHandle); } - - // if the returned value is a Ballerina Value, do nothing - mv.visitInsn(DUP); - mv.visitTypeInsn(INSTANCEOF, REF_VALUE); - mv.visitJumpInsn(IFNE, afterHandle); - bir:VariableDcl retJObjectVarDcl = { typeValue: "any", name: { value: "$_ret_jobject_var_$" }, kind: "LOCAL" }; int returnJObjectVarRefIndex = indexMap.getIndex(retJObjectVarDcl); mv.visitVarInsn(ASTORE, returnJObjectVarRefIndex); diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal index 20e26f74ca53..0ead0189e8df 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal @@ -115,15 +115,17 @@ function lookupGlobalVarClassName(string key) returns string { } } -function generateDependencyList(bir:ModuleID moduleId, @tainted JarFile jarFile) { - generatePackage(moduleId, jarFile, false); +function generateDependencyList(bir:ModuleID moduleId, @tainted JarFile jarFile, + jvm:InteropValidator interopValidator) { + generatePackage(moduleId, jarFile, interopValidator, false); string pkgName = getPackageName(moduleId.org, moduleId.name); if (!dependentModules.hasKey(pkgName)) { dependentModules[pkgName] = moduleId; } } -public function generatePackage(bir:ModuleID moduleId, @tainted JarFile jarFile, boolean isEntry) { +public function generatePackage(bir:ModuleID moduleId, @tainted JarFile jarFile, + jvm:InteropValidator interopValidator, boolean isEntry) { string orgName = moduleId.org; string moduleName = moduleId.name; string pkgName = getPackageName(orgName, moduleName); @@ -137,14 +139,15 @@ public function generatePackage(bir:ModuleID moduleId, @tainted JarFile jarFile, // generate imported modules recursively foreach var mod in module.importModules { - generateDependencyList(importModuleToModuleId(mod), jarFile); + generateDependencyList(importModuleToModuleId(mod), jarFile, interopValidator); if (dlogger.getErrorCount() > 0) { return; } } typeOwnerClass = getModuleLevelClassName(<@untainted> orgName, <@untainted> moduleName, MODULE_INIT_CLASS_NAME); - map jvmClassMap = generateClassNameMappings(module, pkgName, typeOwnerClass, <@untainted> lambdas); + map jvmClassMap = generateClassNameMappings(module, pkgName, typeOwnerClass, + <@untainted> lambdas, interopValidator); if (!isEntry || dlogger.getErrorCount() > 0) { return; } @@ -401,9 +404,10 @@ function cleanupPackageName(string pkgName) returns string { # + initClass - The module init class # + lambdaCalls - The lambdas # + return - The map of javaClass records on given source file name -function generateClassNameMappings(bir:Package module, string pkgName, string initClass, - map lambdaCalls) returns map { - +function generateClassNameMappings(bir:Package module, string pkgName, string initClass, + map lambdaCalls, + jvm:InteropValidator interopValidator) returns map { + string orgName = module.org.value; string moduleName = module.name.value; string versionValue = module.versionValue.value; @@ -470,7 +474,7 @@ function generateClassNameMappings(bir:Package module, string pkgName, string in BIRFunctionWrapper | error birFuncWrapperOrError; if (isExternFunc(getFunction(birFunc))) { - birFuncWrapperOrError = createExternalFunctionWrapper(birFunc, orgName, moduleName, + birFuncWrapperOrError = createExternalFunctionWrapper(interopValidator, birFunc, orgName, moduleName, versionValue, birModuleClassName); } else { addDefaultableBooleanVarsToSignature(birFunc); diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal index 369180966b37..f3dc464a493e 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal @@ -16,7 +16,9 @@ import ballerina/io; import ballerina/bir; +import ballerina/jvm; import ballerina/stringutils; +import ballerina/lang.'int as lint; public type JarFile record {| map manifestEntries = {}; @@ -30,31 +32,42 @@ public type JavaClass record {| |}; string[] birCacheDirs = []; +string[] jarLibraries = []; public function main(string... args) { string pathToEntryBir = <@untainted> args[0]; string mapPath = <@untainted> args[1]; string targetPath = args[2]; boolean dumpBir = stringutils:equalsIgnoreCase(args[3], "true"); + boolean useSystemClassLoader = stringutils:equalsIgnoreCase(args[4], "true"); + int numCacheDirs = lint:fromString(args[5]); - var numCacheDirs = args.length() - 4; int i = 0; while (i < numCacheDirs) { - birCacheDirs[i] = <@untainted> args[4 + i]; + birCacheDirs[i] = <@untainted> args[6 + i]; + i = i + 1; + } + + int argsCount = 6 + numCacheDirs; + int dependentJarCnt = args.length() - argsCount; + i = 0; + while (i < dependentJarCnt) { + jarLibraries[i] = <@untainted> args[argsCount + i]; i = i + 1; } - var jarFile = generateJarBinary(pathToEntryBir, mapPath, dumpBir); + var jarFile = generateJarBinary(pathToEntryBir, mapPath, dumpBir, jarLibraries, useSystemClassLoader); if (dlogger.getErrorCount() > 0) { dlogger.printErrors(); - exit(1); + jvm:systemExit(1); return; } writeJarFile(jarFile, targetPath); } -function generateJarBinary(string pathToEntryBir, string mapPath, boolean dumpBir) returns JarFile { +function generateJarBinary(string pathToEntryBir, string mapPath, boolean dumpBir, + string[] jarLibraries, boolean useSystemClassLoader) returns JarFile { if (mapPath != "") { externalMapCache = readMap(mapPath); } @@ -69,8 +82,9 @@ function generateJarBinary(string pathToEntryBir, string mapPath, boolean dumpBi } JarFile jarFile = {}; + jvm:InteropValidator interopValidator = new(jarLibraries, useSystemClassLoader); generatePackage(createModuleId(entryMod.org.value, entryMod.name.value, - entryMod.versionValue.value), <@untainted> jarFile, true); + entryMod.versionValue.value), <@untainted> jarFile, interopValidator, true); return jarFile; } From cbe83b89f6be21b8e4a7dd802eaf96b53da01504 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:56:06 +0530 Subject: [PATCH 093/167] Move interop validator changes to backend jvm old --- .../interop/external_method_gen.bal | 9 ++++---- .../interop/interop_method_gen.bal | 15 ++++++------ .../compiler_backend_jvm/jvm_package_gen.bal | 18 +++++++++------ .../src/compiler_backend_jvm/main.bal | 23 +++++++++++++++---- 4 files changed, 42 insertions(+), 23 deletions(-) diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal index ed3fe41e5d73..597f94de8933 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/external_method_gen.bal @@ -152,8 +152,9 @@ function lookupBIRFunctionWrapper(bir:Package birModule, bir:Function birFunc, } } -function createExternalFunctionWrapper(bir:Function birFunc, string orgName ,string moduleName, string versionValue, - string birModuleClassName) returns BIRFunctionWrapper | error { +function createExternalFunctionWrapper(jvm:InteropValidator interopValidator, bir:Function birFunc, + string orgName ,string moduleName, string versionValue, + string birModuleClassName) returns BIRFunctionWrapper | error { BIRFunctionWrapper birFuncWrapper; jvm:InteropValidationRequest? jInteropValidationReq = getInteropAnnotValue(birFunc); if (jInteropValidationReq is ()) { @@ -173,8 +174,8 @@ function createExternalFunctionWrapper(bir:Function birFunc, string orgName ,str panic err; } } else { - birFuncWrapper = check createJInteropFunctionWrapper(jInteropValidationReq, birFunc, orgName, moduleName, - versionValue, birModuleClassName); + birFuncWrapper = check createJInteropFunctionWrapper(interopValidator, jInteropValidationReq, birFunc, orgName, + moduleName, versionValue, birModuleClassName); } return birFuncWrapper; diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal index f6f0c5930dae..7a20a310baa5 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/interop/interop_method_gen.bal @@ -30,7 +30,8 @@ type JFieldFunctionWrapper record {| type JInteropFunctionWrapper JMethodFunctionWrapper | JFieldFunctionWrapper; -function createJInteropFunctionWrapper(jvm:InteropValidationRequest jInteropValidationReq, +function createJInteropFunctionWrapper(jvm:InteropValidator interopValidator, + jvm:InteropValidationRequest jInteropValidationReq, bir:Function birFunc, string orgName, string moduleName, @@ -43,15 +44,15 @@ function createJInteropFunctionWrapper(jvm:InteropValidationRequest jInteropVali versionValue, birModuleClassName); if (jInteropValidationReq is jvm:MethodValidationRequest) { jInteropValidationReq.restParamExist = birFunc.restParamExist; - return createJMethodWrapper(jInteropValidationReq, birFuncWrapper); + return createJMethodWrapper(interopValidator, jInteropValidationReq, birFuncWrapper); } else { - return createJFieldWrapper(jInteropValidationReq, birFuncWrapper); + return createJFieldWrapper(interopValidator, jInteropValidationReq, birFuncWrapper); } } -function createJMethodWrapper(jvm:MethodValidationRequest jMethodValidationReq, +function createJMethodWrapper(jvm:InteropValidator interopValidator, jvm:MethodValidationRequest jMethodValidationReq, BIRFunctionWrapper birFuncWrapper) returns JMethodFunctionWrapper | error { - var jMethod = check jvm:validateAndGetJMethod(jMethodValidationReq); + var jMethod = check interopValidator.validateAndGetJMethod(jMethodValidationReq); return { orgName : birFuncWrapper.orgName, @@ -64,9 +65,9 @@ function createJMethodWrapper(jvm:MethodValidationRequest jMethodValidationReq, }; } -function createJFieldWrapper(jvm:FieldValidationRequest jFieldValidationReq, +function createJFieldWrapper(jvm:InteropValidator interopValidator, jvm:FieldValidationRequest jFieldValidationReq, BIRFunctionWrapper birFuncWrapper) returns JFieldFunctionWrapper | error { - var jField = check jvm:validateAndGetJField(jFieldValidationReq); + var jField = check interopValidator.validateAndGetJField(jFieldValidationReq); return { orgName : birFuncWrapper.orgName, diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal index 781069ab71e2..369d9e12c221 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/jvm_package_gen.bal @@ -113,15 +113,17 @@ function lookupGlobalVarClassName(string key) returns string { } } -function generateDependencyList(bir:ModuleID moduleId, @tainted JarFile jarFile) { - generatePackage(moduleId, jarFile, false); +function generateDependencyList(bir:ModuleID moduleId, @tainted JarFile jarFile, + jvm:InteropValidator interopValidator) { + generatePackage(moduleId, jarFile, interopValidator, false); string pkgName = getPackageName(moduleId.org, moduleId.name); if (!dependentModules.hasKey(pkgName)) { dependentModules[pkgName] = moduleId; } } -public function generatePackage(bir:ModuleID moduleId, @tainted JarFile jarFile, boolean isEntry) { +public function generatePackage(bir:ModuleID moduleId, @tainted JarFile jarFile, + jvm:InteropValidator interopValidator, boolean isEntry) { string orgName = moduleId.org; string moduleName = moduleId.name; string pkgName = getPackageName(orgName, moduleName); @@ -134,7 +136,7 @@ public function generatePackage(bir:ModuleID moduleId, @tainted JarFile jarFile, // generate imported modules recursively foreach var mod in module.importModules { - generateDependencyList(importModuleToModuleId(mod), jarFile); + generateDependencyList(importModuleToModuleId(mod), jarFile, interopValidator); if (dlogger.getErrorCount() > 0) { return; } @@ -145,7 +147,8 @@ public function generatePackage(bir:ModuleID moduleId, @tainted JarFile jarFile, } typeOwnerClass = getModuleLevelClassName(<@untainted> orgName, <@untainted> moduleName, MODULE_INIT_CLASS_NAME); - map jvmClassMap = generateClassNameMappings(module, pkgName, typeOwnerClass, <@untainted> lambdas); + map jvmClassMap = generateClassNameMappings(module, pkgName, typeOwnerClass, + <@untainted> lambdas, interopValidator); if (!isEntry || dlogger.getErrorCount() > 0) { return; } @@ -400,7 +403,8 @@ function cleanupPackageName(string pkgName) returns string { # + lambdaCalls - The lambdas # + return - The map of javaClass records on given source file name function generateClassNameMappings(bir:Package module, string pkgName, string initClass, - map lambdaCalls) returns map { + map lambdaCalls, + jvm:InteropValidator interopValidator) returns map { string orgName = module.org.value; string moduleName = module.name.value; @@ -468,7 +472,7 @@ function generateClassNameMappings(bir:Package module, string pkgName, string in BIRFunctionWrapper | error birFuncWrapperOrError; if (isExternFunc(getFunction(birFunc))) { - birFuncWrapperOrError = createExternalFunctionWrapper(birFunc, orgName, moduleName, + birFuncWrapperOrError = createExternalFunctionWrapper(interopValidator, birFunc, orgName, moduleName, versionValue, birModuleClassName); } else { addDefaultableBooleanVarsToSignature(birFunc); diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal index 8434106cef66..b38189ce6ea2 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal @@ -18,6 +18,7 @@ import ballerina/io; import ballerina/bir; import ballerina/jvm; import ballerina/internal; +import ballerina/lang.'int as lint; public type JarFile record {| map manifestEntries = {}; @@ -31,21 +32,31 @@ public type JavaClass record {| |}; string[] birCacheDirs = []; +string[] jarLibraries = []; public function main(string... args) { string pathToEntryBir = <@untainted> args[0]; string mapPath = <@untainted> args[1]; string targetPath = args[2]; boolean dumpBir = internal:equalsIgnoreCase(args[3], "true"); + boolean useSystemClassLoader = internal:equalsIgnoreCase(args[4], "true"); + int numCacheDirs = lint:fromString(args[5]); - var numCacheDirs = args.length() - 4; int i = 0; while (i < numCacheDirs) { - birCacheDirs[i] = args[4 + i]; + birCacheDirs[i] = <@untainted> args[6 + i]; i = i + 1; } - var jarFile = generateJarBinary(pathToEntryBir, mapPath, dumpBir); + int argsCount = 6 + numCacheDirs; + int dependentJarCnt = args.length() - argsCount; + i = 0; + while (i < dependentJarCnt) { + jarLibraries[i] = <@untainted> args[argsCount + i]; + i = i + 1; + } + + var jarFile = generateJarBinary(pathToEntryBir, mapPath, dumpBir, jarLibraries, useSystemClassLoader); if (dlogger.getErrorCount() > 0) { dlogger.printErrors(); jvm:systemExit(1); @@ -55,7 +66,8 @@ public function main(string... args) { writeJarFile(jarFile, targetPath); } -function generateJarBinary(string pathToEntryBir, string mapPath, boolean dumpBir) returns JarFile { +function generateJarBinary(string pathToEntryBir, string mapPath, boolean dumpBir, + string[] jarLibraries, boolean useSystemClassLoader) returns JarFile { if (mapPath != "") { externalMapCache = readMap(mapPath); } @@ -70,8 +82,9 @@ function generateJarBinary(string pathToEntryBir, string mapPath, boolean dumpBi } JarFile jarFile = {}; + jvm:InteropValidator interopValidator = new(jarLibraries, useSystemClassLoader); generatePackage(createModuleId(entryMod.org.value, entryMod.name.value, - entryMod.versionValue.value), <@untainted> jarFile, true); + entryMod.versionValue.value), <@untainted> jarFile, interopValidator, true); return jarFile; } From a69cba978bfd7ffdb87300902765dc95368d8891 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:57:23 +0530 Subject: [PATCH 094/167] Refactor generate jar binary with interop changes --- .../ballerinalang/util/BootstrapRunner.java | 66 +++++++------------ .../compiler/util/ProjectDirConstants.java | 1 - 2 files changed, 24 insertions(+), 43 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java index 83cad5db16d9..3c3f02739be3 100644 --- a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java +++ b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java @@ -25,20 +25,18 @@ import org.wso2.ballerinalang.programfile.PackageFileWriter; import java.io.BufferedReader; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.StringJoiner; @@ -51,35 +49,23 @@ public class BootstrapRunner { private static final PrintStream out = System.out; private static final PrintStream err = System.err; - - public static void loadTargetAndGenerateJarBinary(Path tmpDir, String entryBir, String jarOutputPath, - boolean dumpBir, boolean skipJarLoading, - String... birCachePaths) { - //Load all Jars from target/tmp - if (!skipJarLoading && Files.exists(tmpDir)) { - File file = new File(tmpDir.toString()); - try { - loadAllJarsInTarget(file); - } catch (MalformedURLException | NoSuchMethodException | - InvocationTargetException | IllegalAccessException e) { - throw new RuntimeException("could not load pre-compiled jars for invoking the compiler backend", e); - } - } - - generateJarBinary(entryBir, jarOutputPath, dumpBir, birCachePaths); - } - - public static void loadTargetAndGenerateJarBinary(Path tmpDir, String entryBir, String jarOutputPath, - boolean dumpBir, String... birCachePaths) { - loadTargetAndGenerateJarBinary(tmpDir, entryBir, jarOutputPath, dumpBir, false, birCachePaths); + + public static void loadTargetAndGenerateJarBinary(String entryBir, String jarOutputPath, boolean dumpBir, + HashSet moduleDependencySet, String... birCachePaths) { + //Load all Jars from module dependency set. + List jarFilePaths = new ArrayList<>(moduleDependencySet.size()); + moduleDependencySet.forEach(path -> jarFilePaths.add(path.toString())); + generateJarBinary(entryBir, jarOutputPath, dumpBir, false, jarFilePaths, birCachePaths); } private static void generateJarBinary(String entryBir, String jarOutputPath, boolean dumpBir, + boolean useSystemClassLoader, List jarFilePaths, String... birCachePaths) { try { Class backendMain = Class.forName("ballerina.compiler_backend_jvm.___init"); Method backendMainMethod = backendMain.getMethod("main", String[].class); - List params = createArgsForCompilerBackend(entryBir, jarOutputPath, dumpBir, birCachePaths); + List params = createArgsForCompilerBackend(entryBir, jarOutputPath, dumpBir, + useSystemClassLoader, birCachePaths, jarFilePaths); backendMainMethod.invoke(null, new Object[]{params.toArray(new String[0])}); } catch (InvocationTargetException e) { throw new BLangCompilerException(e.getTargetException().getMessage(), e); @@ -88,6 +74,11 @@ private static void generateJarBinary(String entryBir, String jarOutputPath, boo } } + private static void generateJarBinary(String entryBir, String jarOutputPath, boolean dumpBir, + String... birCachePaths) { + generateJarBinary(entryBir, jarOutputPath, dumpBir, true, Collections.emptyList(), birCachePaths); + } + private static void generateJarBinaryInProc(String entryBir, String jarOutputPath, boolean dumpBir, String... birCachePaths) { try { @@ -96,7 +87,8 @@ private static void generateJarBinaryInProc(String entryBir, String jarOutputPat commands.add("-cp"); commands.add(System.getProperty("java.class.path")); commands.add("ballerina.compiler_backend_jvm.___init"); - commands.addAll(createArgsForCompilerBackend(entryBir, jarOutputPath, dumpBir, birCachePaths)); + commands.addAll(createArgsForCompilerBackend(entryBir, jarOutputPath, dumpBir, true, + birCachePaths, Collections.emptyList())); Process process = new ProcessBuilder(commands).start(); @@ -127,30 +119,20 @@ private static String getConsoleOutput(InputStream inputStream, PrintStream prin } private static List createArgsForCompilerBackend(String entryBir, String jarOutputPath, boolean dumpBir, - String[] birCachePaths) { + boolean useSystemClassLoader, String[] birCachePaths, + List jarFilePaths) { List commands = new ArrayList<>(); commands.add(entryBir); commands.add(getMapPath()); commands.add(jarOutputPath); commands.add(dumpBir ? "true" : "false"); // dump bir + commands.add(useSystemClassLoader ? "true" : "false"); // useSystemClassLoader + commands.add(String.valueOf(birCachePaths.length)); commands.addAll(Arrays.asList(birCachePaths)); + commands.addAll(jarFilePaths); return commands; } - private static void loadAllJarsInTarget(final File targetFolder) throws MalformedURLException, - NoSuchMethodException, InvocationTargetException, IllegalAccessException { - for (final File file : targetFolder.listFiles()) { - if (file.isDirectory()) { - loadAllJarsInTarget(file); - } else { - URL url = file.toURI().toURL(); - URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); - Method method = URLClassLoader.class.getDeclaredMethod("addURL", URL.class); - method.setAccessible(true); - method.invoke(classLoader, url); - } - } - } private static String getMapPath() { String ballerinaNativeMap = System.getenv("BALLERINA_NATIVE_MAP"); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java index 6084c83d3aba..77ae2481d94c 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/util/ProjectDirConstants.java @@ -46,7 +46,6 @@ private ProjectDirConstants() { public static final String BIN_DIR_NAME = "bin"; public static final String TARGET_DIR_NAME = "target"; public static final String TARGET_BALO_DIRECTORY = "balo"; - public static final String TARGET_TMP_DIRECTORY = "tmp"; public static final String TARGET_API_DOC_DIRECTORY = "apidocs"; public static final String RESOURCE_DIR_NAME = "resources"; From acd08fc203808e39a152dd8b3678be8ea73fe1ef Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Sun, 27 Oct 2019 20:57:55 +0530 Subject: [PATCH 095/167] Refactor gradle build to pass class loader urls --- gradle/birProject.gradle | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/gradle/birProject.gradle b/gradle/birProject.gradle index 09336a940d91..37ed3a5de025 100644 --- a/gradle/birProject.gradle +++ b/gradle/birProject.gradle @@ -56,20 +56,32 @@ task createBirJar(type: Exec) { dependsOn createBir dependsOn createBirCache dependsOn copyExternalMappingNextToBir - + dependsOn ':ballerina-libs:copyDependencies' + workingDir "$buildDir/generated-bir-jar" onlyIf { file(generatedBirDir + project.ext.moduleName + '.bir').exists() } doFirst { + def commands = []; + def jarsToBeLoaded = []; def mapPath = OperatingSystem.current().isWindows() ? "\"\"" : "" if (!sourceSets.main.allJava.isEmpty()) { mapPath = generatedBirDir + project.ext.moduleName + '.map.json' } + jarsToBeLoaded.add("$rootDir" + "/bvm/ballerina-runtime/build/libs/ballerina-runtime-${project.version}.jar"); + new File("$projectDir/src/main/ballerina/Ballerina.toml").readLines(). + findAll({x -> x ==~ /.*path = ".\/lib\/.*/ }). + collect { + def jarPath = it.split(/"/)[1].replace('@project.version@', "${project.version}"). + replace('./lib', "") + jarsToBeLoaded.add("$rootDir" + "/distribution/libs/libs" + jarPath); + } + configurations.birJarCompile.each { if (OperatingSystem.current().isWindows()) { - commandLine 'cmd.exe', '/c', + commands = [ 'cmd.exe', '/c', new File(it, '/bin/ballerina.bat'), 'run', new File(it, '/bre/lib/compiler_backend_jvm.jar'), @@ -77,9 +89,11 @@ task createBirJar(type: Exec) { mapPath, "$buildDir/generated-bir-jar/" + project.ext.moduleName + ".jar", 'false', - "$buildDir/bir-cache" + 'false', + "1", + "$buildDir/bir-cache"]; } else { - commandLine 'sh', + commands = [ 'sh', new File(it, '/bin/ballerina'), 'run', new File(it, '/bre/lib/compiler_backend_jvm.jar'), @@ -87,8 +101,12 @@ task createBirJar(type: Exec) { mapPath, "$buildDir/generated-bir-jar/" + project.ext.moduleName + ".jar", 'false', - "$buildDir/bir-cache" + 'false', + "1", + "$buildDir/bir-cache"]; } + commands.addAll(jarsToBeLoaded) + commandLine commands println commandLine } } From 8972ffaad7608d0a1cc7e55169c3122b7d24b4f6 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Mon, 28 Oct 2019 00:40:21 +0530 Subject: [PATCH 096/167] Fix spotbugs errors --- .../packerina/buildcontext/BuildContext.java | 2 +- .../packerina/task/CreateExecutableTask.java | 4 ---- .../nativeimpl/jvm/interop/Init.java | 15 ++++++++++----- .../nativeimpl/jvm/interop/Init.java | 15 ++++++++++----- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java index 7a34d5af083a..3add8ca66854 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java @@ -71,7 +71,7 @@ public class BuildContext extends HashMap { private transient PrintStream out; private transient PrintStream err; - public Map> moduleDependencyPathMap = new HashMap<>(); + public transient Map> moduleDependencyPathMap = new HashMap<>(); /** * Create a build context with context fields. diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java index 242b41159de0..03ba73990ffb 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateExecutableTask.java @@ -37,7 +37,6 @@ import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.nio.file.SimpleFileVisitor; import java.nio.file.StandardCopyOption; import java.nio.file.StandardOpenOption; @@ -47,7 +46,6 @@ import java.util.Optional; import static org.ballerinalang.tool.LauncherUtils.createLauncherException; -import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_COMPILED_JAR_EXT; /** * Task for creating the executable jar file. @@ -75,7 +73,6 @@ public void execute(BuildContext buildContext) { try (FileSystem toFs = FileSystems.newFileSystem(uberJarUri, Collections.emptyMap())) { assembleExecutable(module, buildContext.moduleDependencyPathMap.get(module.packageID), toFs); } catch (IOException e) { - e.printStackTrace(); throw createLauncherException("unable to extract the uber jar :" + e.getMessage()); } } @@ -122,7 +119,6 @@ private void assembleExecutable(BLangPackage bLangPackage, HashSet depende // Executable is created at give location. // If no entry point is found we do nothing. } catch (IOException | NullPointerException e) { - e.printStackTrace(); throw createLauncherException("unable to create the executable: " + e.getMessage()); } } diff --git a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java index dd9dbfd4be30..2cb7af75ed3a 100644 --- a/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java +++ b/stdlib/jvm-old/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java @@ -29,6 +29,8 @@ import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Paths; +import java.security.AccessController; +import java.security.PrivilegedAction; import static org.ballerinalang.nativeimpl.jvm.ASMUtil.INTEROP_VALIDATOR; import static org.ballerinalang.nativeimpl.jvm.ASMUtil.JVM_PKG_PATH; @@ -57,11 +59,14 @@ public static void init(Strand strand, ObjectValue interopValidatorStruct, Array urls[i] = Paths.get(jarPath).toUri().toURL(); i++; } - if (useSystemClassLoader) { - interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls)); - } else { - interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls, null)); - } + AccessController.doPrivileged((PrivilegedAction) () -> { + if (useSystemClassLoader) { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls)); + } else { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls, null)); + } + return null; + }); } catch (MalformedURLException e) { throw new JInteropException(JInteropException.CLASS_LOADER_INIT_FAILED_REASON, e.getMessage()); diff --git a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java index 3422198c47d5..cb348721292a 100644 --- a/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java +++ b/stdlib/jvm/src/main/java/org/ballerinalang/nativeimpl/jvm/interop/Init.java @@ -29,6 +29,8 @@ import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Paths; +import java.security.AccessController; +import java.security.PrivilegedAction; import static org.ballerinalang.nativeimpl.jvm.ASMUtil.INTEROP_VALIDATOR; import static org.ballerinalang.nativeimpl.jvm.ASMUtil.JVM_PKG_PATH; @@ -58,11 +60,14 @@ public static void init(Strand strand, ObjectValue interopValidatorStruct, Array urls[i] = Paths.get(jarPath).toUri().toURL(); i++; } - if (useSystemClassLoader) { - interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls)); - } else { - interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls, null)); - } + AccessController.doPrivileged((PrivilegedAction) () -> { + if (useSystemClassLoader) { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls)); + } else { + interopValidatorStruct.addNativeData(CLASS_LOADER_DATA, new URLClassLoader(urls, null)); + } + return null; + }); } catch (MalformedURLException e) { throw new JInteropException(JInteropException.CLASS_LOADER_INIT_FAILED_REASON, e.getMessage()); From c2382036e2cc814d492e60c956c4bc7928b57374 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Mon, 28 Oct 2019 07:48:50 +0530 Subject: [PATCH 097/167] Return err on same pub/sub resource path and address review suggestions --- .../src/main/ballerina/src/websub/Module.md | 4 +-- .../src/main/ballerina/src/websub/commons.bal | 13 +++---- .../src/main/ballerina/src/websub/errors.bal | 11 +++++- ...artUpTest.java => WebSubHubStartTest.java} | 34 ++++++++++++------- ...st.java => WebSubSubscriberStartTest.java} | 2 +- .../test-src/hub/test_hub_startup.bal | 22 ++++++++++-- stdlib/websub/src/test/resources/testng.xml | 10 ++++-- 7 files changed, 65 insertions(+), 31 deletions(-) rename stdlib/websub/src/test/java/org.ballerinalang.net.websub/{WebSubHubStartUpTest.java => WebSubHubStartTest.java} (73%) rename stdlib/websub/src/test/java/org.ballerinalang.net.websub/{WebSubSubscriberStartUpTest.java => WebSubSubscriberStartTest.java} (97%) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index aa7d001e68f9..94f419b21221 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -243,7 +243,7 @@ public function main() { } ``` -Ballerina publishers can also use the publisher client to register topics at Ballerina WebSub hubs +Ballerina publishers can also use the `websub:PublisherClient` to register topics at Ballerina WebSub hubs and publish/notify updates to the remote hubs. ```ballerina import ballerina/log; @@ -275,7 +275,7 @@ public function main() { } ``` -The subscription client can be used by subscribers to send subscription and unsubscription requests explicitly. +The `websub:SubscriptionClient` can be used by subscribers to send subscription and unsubscription requests explicitly. ```ballerina import ballerina/log; import ballerina/websub; diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index f8a5f9825dae..627b1a1ffff7 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -489,6 +489,10 @@ public function startHub(http:Listener hubServiceListener, hubSubscriptionResourcePath = subscriptionResourcePath; hubPublishResourcePath = publishResourcePath; + if (hubSubscriptionResourcePath == hubPublishResourcePath) { + return HubStartupError(message = "publisher and subscription resource paths cannot be the same"); + } + hubServiceAuth = serviceAuth; hubSubscriptionResourceAuth = subscriptionResourceAuth; hubPublisherResourceAuth = publisherResourceAuth; @@ -716,12 +720,3 @@ public type SubscriberDetails record {| int leaseSeconds = 0; int createdAt = 0; |}; - -type WebSubError record { - string message = ""; -}; - -# Represents the reason string for the `websub:HubStartupError`. -public const HUB_STARTUP_REASON = "{ballerina/websub}HubStartupError"; -# Represents a hub startup error. -public type HubStartupError error; \ No newline at end of file diff --git a/stdlib/websub/src/main/ballerina/src/websub/errors.bal b/stdlib/websub/src/main/ballerina/src/websub/errors.bal index 69ab42fcd2fa..ef6dc5f4f984 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/errors.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/errors.bal @@ -14,7 +14,7 @@ // specific language governing permissions and limitations // under the License. -# Holds the details of an WebSub error +# Holds the details of a WebSub error. # # + message - Specific error message for the error # + cause - Cause of the error; If this error occurred due to another error (Probably from another module) @@ -25,5 +25,14 @@ public type Detail record { # Represents the reason string for the `websub:ListenerStartupError`. public const LISTENER_STARTUP_ERROR = "{ballerina/websub}ListenerStartupError"; + # Represents a listener startup error. public type ListenerStartupError error; + + +# Represents the reason string for the `websub:HubStartupError`. +public const HUB_STARTUP_REASON = "{ballerina/websub}HubStartupError"; + +# Represents a hub startup error. +public type HubStartupError error; + diff --git a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartUpTest.java b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartTest.java similarity index 73% rename from stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartUpTest.java rename to stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartTest.java index 30dc79907698..5fe718d11136 100644 --- a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartUpTest.java +++ b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartTest.java @@ -30,12 +30,14 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import static org.testng.Assert.assertEquals; + /** * Class to test WebSub Hub startup. */ -public class WebSubHubStartUpTest { +public class WebSubHubStartTest { - private static final String HUB_URL_FIELD = "hubUrl"; + private static final String HUB_SUBS_URL_FIELD = "subscriptionUrl"; private static final String STARTED_UP_HUB_FIELD = "startedUpHub"; private CompileResult result; @@ -50,44 +52,52 @@ public void setup() { @Test(description = "Test hub start up and URL identification") public void testHubStartUp() { BValue[] returns = BRunUtil.invoke(result, "startupHub", new BValue[]{new BInteger(port)}); - Assert.assertEquals(returns.length, 1); + assertEquals(returns.length, 1); Assert.assertTrue(returns[0] instanceof BMap); hubStartUpObject = (BMap) returns[0]; - Assert.assertEquals(hubStartUpObject.get(HUB_URL_FIELD).stringValue(), + assertEquals(hubStartUpObject.get(HUB_SUBS_URL_FIELD).stringValue(), "http://localhost:" + port + "/websub/hub"); } @Test(description = "Test hub start up call when already started", dependsOnMethods = "testHubStartUp") public void testHubStartUpWhenStarted() { BValue[] returns = BRunUtil.invoke(result, "startupHub", new BValue[]{new BInteger(9292)}); - Assert.assertEquals(returns.length, 1); + assertEquals(returns.length, 1); Assert.assertTrue(returns[0] instanceof BMap); hubStartUpObject = (BMap) returns[0]; - Assert.assertEquals(hubStartUpObject.get("message").stringValue(), "Ballerina Hub already started up"); + assertEquals(hubStartUpObject.get("message").stringValue(), "Ballerina Hub already started up"); Assert.assertTrue(hubStartUpObject.get(STARTED_UP_HUB_FIELD) instanceof BMap); BMap hubObject = (BMap) hubStartUpObject.get(STARTED_UP_HUB_FIELD); - Assert.assertEquals(hubObject.get(HUB_URL_FIELD).stringValue(), "http://localhost:" + port + "/websub/hub"); + assertEquals(hubObject.get(HUB_SUBS_URL_FIELD).stringValue(), "http://localhost:" + port + "/websub/hub"); } @Test(description = "Test shut down and restart", dependsOnMethods = "testHubStartUpWhenStarted") public void testHubShutdownAndStart() { int port = 9393; - BValue[] returns = BRunUtil.invoke(result, "stopHub", new BValue[]{new BInteger(9494)}); - Assert.assertEquals(returns.length, 1); + BValue[] returns = BRunUtil.invoke(result, "stopHub", new Object[]{hubStartUpObject}); + assertEquals(returns.length, 1); Assert.assertTrue(returns[0] instanceof BBoolean); Assert.assertTrue((((BBoolean) returns[0]).value())); returns = BRunUtil.invoke(result, "startupHub", new BValue[]{new BInteger(port)}); - Assert.assertEquals(returns.length, 1); + assertEquals(returns.length, 1); Assert.assertTrue(returns[0] instanceof BMap); hubStartUpObject = (BMap) returns[0]; - Assert.assertEquals(hubStartUpObject.get(HUB_URL_FIELD).stringValue(), + assertEquals(hubStartUpObject.get(HUB_SUBS_URL_FIELD).stringValue(), "http://localhost:" + port + "/websub/hub"); } + @Test + public void testPublisherAndSubscriptionInvalidSameResourcePath() { + BValue[] returns = BRunUtil.invoke(result, "testPublisherAndSubscriptionInvalidSameResourcePath"); + assertEquals(returns.length, 1); + Assert.assertTrue(returns[0] instanceof BBoolean); + Assert.assertTrue((((BBoolean) returns[0]).value())); + } + @AfterClass public void tearDown() { - BRunUtil.invoke(result, "stopHub", new BValue[]{hubStartUpObject}); + BRunUtil.invoke(result, "stopHub", new Object[]{hubStartUpObject}); } } diff --git a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartTest.java similarity index 97% rename from stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java rename to stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartTest.java index 5461210f3423..d5f40f32266b 100644 --- a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartUpTest.java +++ b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubSubscriberStartTest.java @@ -29,7 +29,7 @@ /** * Class to test WebSub listener startup. */ -public class WebSubSubscriberStartUpTest { +public class WebSubSubscriberStartTest { private CompileResult result; diff --git a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal index 1a5b2b42f6d4..7d068c5c88cf 100644 --- a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal +++ b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal @@ -17,14 +17,30 @@ import ballerina/websub; import ballerina/http; -function startupHub(int hubPort) returns websub:WebSubHub|websub:HubStartedUpError { +function startupHub(int hubPort) returns websub:WebSubHub|websub:HubStartedUpError|websub:HubStartupError { return websub:startHub(new http:Listener(hubPort), "/websub", "/hub"); } -function stopHub(websub:WebSubHub|websub:HubStartedUpError hubStartUpResult) { +function stopHub(websub:WebSubHub|websub:HubStartedUpError|websub:HubStartupError hubStartUpResult) { if (hubStartUpResult is websub:WebSubHub) { checkpanic hubStartUpResult.stop(); - } else { + } else if (hubStartUpResult is websub:HubStartedUpError) { checkpanic hubStartUpResult.startedUpHub.stop(); + } else { + panic hubStartUpResult; + } +} + +function testPublisherAndSubscriptionInvalidSameResourcePath() returns boolean { + http:Listener lis = new (9393); + websub:WebSubHub|websub:HubStartedUpError|websub:HubStartupError res = + websub:startHub(lis, "/websub", "/hub", "/hub"); + + var err = lis.__immediateStop(); + + if (res is websub:HubStartupError) { + return res.reason() == "{ballerina/websub}HubStartupError" && + res.detail().message == "publisher and subscription resource paths cannot be the same"; } + return false; } diff --git a/stdlib/websub/src/test/resources/testng.xml b/stdlib/websub/src/test/resources/testng.xml index f0a575eb9710..e798fd69de66 100644 --- a/stdlib/websub/src/test/resources/testng.xml +++ b/stdlib/websub/src/test/resources/testng.xml @@ -22,8 +22,12 @@ - - - + + + + + + + From a29470035deaa74d1da7f1d3864247789316b172 Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Mon, 28 Oct 2019 09:30:28 +0530 Subject: [PATCH 098/167] Add auth module dependency to the tests --- stdlib/auth/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/auth/build.gradle b/stdlib/auth/build.gradle index 03bd91962a5e..29a70101a810 100644 --- a/stdlib/auth/build.gradle +++ b/stdlib/auth/build.gradle @@ -60,6 +60,7 @@ dependencies { testCompile project(':ballerina-reflect') testCompile project(':ballerina-crypto') testCompile project(':ballerina-file') + testCompile project(':ballerina-auth') } configurations.all { From cff3a41c2566cc53cb256e8eb399472ae939a22e Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Mon, 28 Oct 2019 10:30:01 +0530 Subject: [PATCH 099/167] Update code snippets on WebSub sample --- stdlib/websub/src/main/ballerina/src/websub/Module.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index d12be127d145..f395c7c7e499 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -489,9 +489,16 @@ public type WebhookListener object { return self.websubListener.__start(); } - public function __stop() returns error? { - return self.websubListener.__stop(); + public function __gracefulStop() returns error? { + return (); } + + public function __immediateStop() returns error? { + http:Listener? sListener = self.serviceEndpoint; + if (sListener is http:Listener) { + return sListener.__immediateStop(); + } + return (); }; ``` From 8b03e418fb964c036c4b86cda8062e091738ea6d Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Mon, 28 Oct 2019 10:34:48 +0530 Subject: [PATCH 100/167] Rename WebSubHub -> Hub --- examples/websub-hub-client-sample/publisher.bal | 2 +- examples/websub-internal-hub-sample/publisher.bal | 2 +- examples/websub-remote-hub-sample/hub.bal | 2 +- .../order_mgmt_service.bal | 6 +++--- .../websub/src/main/ballerina/src/websub/Module.md | 2 +- .../src/main/ballerina/src/websub/commons.bal | 14 +++++++------- .../src/main/ballerina/src/websub/natives.bal | 12 ++++++------ .../net/websub/WebSubSubscriberConstants.java | 2 +- .../net/websub/nativeimpl/GetAvailableTopics.java | 2 +- .../net/websub/nativeimpl/GetSubscribers.java | 2 +- .../resources/test-src/hub/test_hub_startup.bal | 8 ++++---- .../src/advanced_services/01_websub_publisher.bal | 10 +++++----- .../publisher/src/services/01_websub_publisher.bal | 10 +++++----- 13 files changed, 37 insertions(+), 37 deletions(-) diff --git a/examples/websub-hub-client-sample/publisher.bal b/examples/websub-hub-client-sample/publisher.bal index 5232539f0ae4..fe95850dbde6 100644 --- a/examples/websub-hub-client-sample/publisher.bal +++ b/examples/websub-hub-client-sample/publisher.bal @@ -11,7 +11,7 @@ public function main() { io:println("Starting up the Ballerina Hub Service"); var result = websub:startHub(new http:Listener(9191), "/websub", "/hub"); - websub:WebSubHub webSubHub = result is websub:HubStartedUpError + websub:Hub webSubHub = result is websub:HubStartedUpError ? result.startedUpHub : result; // Registers a topic at the hub. var registrationResponse = webSubHub.registerTopic( diff --git a/examples/websub-internal-hub-sample/publisher.bal b/examples/websub-internal-hub-sample/publisher.bal index 58168bcc2faf..916384e8365b 100644 --- a/examples/websub-internal-hub-sample/publisher.bal +++ b/examples/websub-internal-hub-sample/publisher.bal @@ -10,7 +10,7 @@ public function main() { io:println("Starting up the Ballerina Hub Service"); var result = websub:startHub(new http:Listener(9191), "/websub", "/hub"); - websub:WebSubHub webSubHub = result is websub:HubStartedUpError ? + websub:Hub webSubHub = result is websub:HubStartedUpError ? result.startedUpHub : result; // Registers a topic at the hub. diff --git a/examples/websub-remote-hub-sample/hub.bal b/examples/websub-remote-hub-sample/hub.bal index 3a47e019cdb9..ab6c2525b308 100644 --- a/examples/websub-remote-hub-sample/hub.bal +++ b/examples/websub-remote-hub-sample/hub.bal @@ -14,7 +14,7 @@ public function main() { remotePublish : { enabled : true }}); - websub:WebSubHub webSubHub = result is websub:HubStartedUpError ? + websub:Hub webSubHub = result is websub:HubStartedUpError ? result.startedUpHub : result; // Waits for the subscriber to subscribe at this hub and for the publisher to publish the notifications. diff --git a/examples/websub-service-integration-sample/order_mgmt_service.bal b/examples/websub-service-integration-sample/order_mgmt_service.bal index 6e5725198eea..068517870014 100644 --- a/examples/websub-service-integration-sample/order_mgmt_service.bal +++ b/examples/websub-service-integration-sample/order_mgmt_service.bal @@ -16,7 +16,7 @@ map orderMap = {}; // Invokes the function that starts up a Ballerina WebSub Hub, registers the topic // against which updates will be published, and maintains a reference to the // returned hub object to publish updates. -websub:WebSubHub webSubHub = startHubAndRegisterTopic(); +websub:Hub webSubHub = startHubAndRegisterTopic(); @http:ServiceConfig { basePath: "/ordermgt" @@ -79,9 +79,9 @@ service orderMgt on httpListener { // Starts up a Ballerina WebSub Hub on port 9191 and registers the topic against // which updates will be published. -function startHubAndRegisterTopic() returns websub:WebSubHub { +function startHubAndRegisterTopic() returns websub:Hub { var hubStartUpResult = websub:startHub(new http:Listener(9191), "/websub", "/hub"); - websub:WebSubHub internalHub = hubStartUpResult is websub:HubStartedUpError + websub:Hub internalHub = hubStartUpResult is websub:HubStartedUpError ? hubStartUpResult.startedUpHub : hubStartUpResult; var result = internalHub.registerTopic(ORDER_TOPIC); diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index 94f419b21221..2d8f0f3f2d1d 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -218,7 +218,7 @@ public function main() { log:printInfo("Starting up the Ballerina Hub Service"); var result = websub:startHub(new http:Listener(9191)); - websub:WebSubHub webSubHub = result is websub:WebSubHub ? result : result.startedUpHub; + websub:Hub webSubHub = result is websub:Hub ? result : result.startedUpHub; var registrationResponse = webSubHub.registerTopic(""); if (registrationResponse is error) { diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index 627b1a1ffff7..613cb589a778 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -472,8 +472,8 @@ public type RemotePublishConfig record {| # + subscriptionResourceAuth - The auth configuration for the subscription resource of the hub service # + publisherResourceAuth - The auth configuration for the publisher resource of the hub service # + hubConfiguration - The hub specific configuration -# + return - `WebSubHub` The WebSubHub object representing the newly started up hub, or `HubStartedUpError` indicating -# that the hub is already started, and including the WebSubHub object representing the +# + return - `Hub` The WebSub Hub object representing the newly started up hub, or `HubStartedUpError` indicating +# that the hub is already started, and including the `websub:Hub` object representing the # already started up hub public function startHub(http:Listener hubServiceListener, public string basePath = "/", @@ -483,7 +483,7 @@ public function startHub(http:Listener hubServiceListener, public http:ServiceResourceAuth subscriptionResourceAuth = {enabled:false}, public http:ServiceResourceAuth publisherResourceAuth = {enabled:false}, public HubConfiguration hubConfiguration = {}) - returns WebSubHub|HubStartedUpError|HubStartupError { + returns Hub|HubStartedUpError|HubStartupError { hubBasePath = basePath; hubSubscriptionResourcePath = subscriptionResourcePath; @@ -513,11 +513,11 @@ public function startHub(http:Listener hubServiceListener, } - WebSubHub|HubStartedUpError|HubStartupError res = startUpHubService(hubBasePath, hubSubscriptionResourcePath, + Hub|HubStartedUpError|HubStartupError res = startUpHubService(hubBasePath, hubSubscriptionResourcePath, hubPublishResourcePath, hubTopicRegistrationRequired, hubPublicUrl, hubServiceListener); - if (res is WebSubHub) { + if (res is Hub) { startHubService(hubServiceListener); } @@ -528,7 +528,7 @@ public function startHub(http:Listener hubServiceListener, # # + subscriptionUrl - The URL for subscription changes # + publishUrl - The URL for publishing and topic registration -public type WebSubHub object { +public type Hub object { public string subscriptionUrl; public string publishUrl; @@ -707,7 +707,7 @@ function isSuccessStatusCode(int statusCode) returns boolean { public type HubStartedUpError record {| string message = ""; error? cause = (); - WebSubHub startedUpHub; + Hub startedUpHub; |}; # Record to represent Subscriber Details. diff --git a/stdlib/websub/src/main/ballerina/src/websub/natives.bal b/stdlib/websub/src/main/ballerina/src/websub/natives.bal index 5651e21ea3c2..092931f5f73a 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/natives.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/natives.bal @@ -30,18 +30,18 @@ import ballerina/io; # + publicUrl - The URL for the hub to be included in content delivery requests, defaults to # `http(s)://localhost:{port}/websub/hub` if unspecified # + hubListener - The `http:Listener` to which the hub service is attached -# + return - `WebSubHub` The WebSubHub object representing the newly started up hub, or `HubStartedUpError` indicating -# that the hub is already started, and including the WebSubHub object representing the +# + return - `Hub` The WebSub Hub object representing the newly started up hub, or `HubStartedUpError` indicating +# that the hub is already started, and including the WebSub Hub object representing the # already started up hub function startUpHubService(string basePath, string subscriptionResourcePath, string publishResourcePath, boolean topicRegistrationRequired, string publicUrl, http:Listener hubListener) - returns WebSubHub|HubStartedUpError|HubStartupError = external; + returns Hub|HubStartedUpError|HubStartupError = external; # Stop the Ballerina Hub, if started. # -# + hub - The WebSubHub object returned when starting the hub +# + hub - The `websub:Hub` object returned when starting the hub # + return - `()` if the Ballerina Hub had been started up and was stopped now, `error` if not -function stopHubService(WebSubHub hub) returns error? = external; +function stopHubService(Hub hub) returns error? = external; # Adds a new subscription for the specified topic in the Ballerina Hub. # @@ -84,7 +84,7 @@ function isTopicRegistered(string topic) returns boolean = external; /////////////////////////////////////////////////////////////////// # Publishes an update against the topic in the Ballerina Hub. # -# + publishUrl - The publisher URL of the Ballerina WebSub Hub as included in the WebSubHub object +# + publishUrl - The publisher URL of the Ballerina WebSub Hub as included in the `websub:Hub` object # + topic - The topic for which the update should happen # + content - The content to send to subscribers, with the payload and content-type specified # + return - `error` if an error occurred during publishing diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java index 6dbe660d432d..dbeb07ae9bfb 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java @@ -60,7 +60,7 @@ public class WebSubSubscriberConstants { public static final String TOPIC_ID_PAYLOAD_KEY = "TOPIC_ID_PAYLOAD_KEY"; public static final String TOPIC_ID_HEADER_AND_PAYLOAD = "TOPIC_ID_HEADER_AND_PAYLOAD"; - public static final String STRUCT_WEBSUB_BALLERINA_HUB = "WebSubHub"; + public static final String STRUCT_WEBSUB_BALLERINA_HUB = "Hub"; public static final String STRUCT_WEBSUB_BALLERINA_HUB_STARTED_UP_ERROR = "HubStartedUpError"; static final String PARAM_HUB_MODE = "hub.mode"; diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetAvailableTopics.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetAvailableTopics.java index 18cfa2725ed6..9316da266d50 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetAvailableTopics.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetAvailableTopics.java @@ -35,7 +35,7 @@ @BallerinaFunction( orgName = "ballerina", packageName = "websub", functionName = "getAvailableTopics", - receiver = @Receiver(type = TypeKind.OBJECT, structType = "WebSubHub", structPackage = "ballerina/websub"), + receiver = @Receiver(type = TypeKind.OBJECT, structType = "Hub", structPackage = "ballerina/websub"), returnType = {@ReturnType(type = TypeKind.ARRAY, elementType = TypeKind.STRING)}, isPublic = true ) diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetSubscribers.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetSubscribers.java index 8fc316149cad..009c6235fb19 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetSubscribers.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/GetSubscribers.java @@ -51,7 +51,7 @@ orgName = "ballerina", packageName = "websub", functionName = "getSubscribers", args = {@Argument(name = "topic", type = TypeKind.STRING)}, - receiver = @Receiver(type = TypeKind.OBJECT, structType = "WebSubHub", structPackage = WEBSUB_PACKAGE), + receiver = @Receiver(type = TypeKind.OBJECT, structType = "Hub", structPackage = WEBSUB_PACKAGE), returnType = @ReturnType(type = TypeKind.ARRAY, elementType = TypeKind.RECORD, structType = SUBSCRIPTION_DETAILS, structPackage = WEBSUB_PACKAGE), isPublic = true diff --git a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal index 7d068c5c88cf..2444909d7900 100644 --- a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal +++ b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal @@ -17,12 +17,12 @@ import ballerina/websub; import ballerina/http; -function startupHub(int hubPort) returns websub:WebSubHub|websub:HubStartedUpError|websub:HubStartupError { +function startupHub(int hubPort) returns websub:Hub|websub:HubStartedUpError|websub:HubStartupError { return websub:startHub(new http:Listener(hubPort), "/websub", "/hub"); } -function stopHub(websub:WebSubHub|websub:HubStartedUpError|websub:HubStartupError hubStartUpResult) { - if (hubStartUpResult is websub:WebSubHub) { +function stopHub(websub:Hub|websub:HubStartedUpError|websub:HubStartupError hubStartUpResult) { + if (hubStartUpResult is websub:Hub) { checkpanic hubStartUpResult.stop(); } else if (hubStartUpResult is websub:HubStartedUpError) { checkpanic hubStartUpResult.startedUpHub.stop(); @@ -33,7 +33,7 @@ function stopHub(websub:WebSubHub|websub:HubStartedUpError|websub:HubStartupErro function testPublisherAndSubscriptionInvalidSameResourcePath() returns boolean { http:Listener lis = new (9393); - websub:WebSubHub|websub:HubStartedUpError|websub:HubStartupError res = + websub:Hub|websub:HubStartedUpError|websub:HubStartupError res = websub:startHub(lis, "/websub", "/hub", "/hub"); var err = lis.__immediateStop(); diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal index 274ee3929129..581b1d020219 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/advanced_services/01_websub_publisher.bal @@ -28,7 +28,7 @@ const string WEBSUB_TOPIC_ONE = "http://one.websub.topic.com"; auth:InboundBasicAuthProvider basicAuthProvider = new; http:BasicAuthHandler basicAuthHandler = new(basicAuthProvider); -websub:WebSubHub webSubHub = startHubAndRegisterTopic(); +websub:Hub webSubHub = startHubAndRegisterTopic(); listener http:Listener publisherServiceEP = new http:Listener(23080); @@ -220,8 +220,8 @@ service helperService on publisherServiceEP { } } -function startHubAndRegisterTopic() returns websub:WebSubHub { - websub:WebSubHub internalHub = startWebSubHub(); +function startHubAndRegisterTopic() returns websub:Hub { + websub:Hub internalHub = startWebSubHub(); var err = internalHub.registerTopic(WEBSUB_PERSISTENCE_TOPIC_ONE); if (err is error) { log:printError("Error registering topic", err); @@ -237,7 +237,7 @@ function startHubAndRegisterTopic() returns websub:WebSubHub { return internalHub; } -function startWebSubHub() returns websub:WebSubHub { +function startWebSubHub() returns websub:Hub { var result = websub:startHub(new http:Listener(23191, config = { auth: { authHandlers: [basicAuthHandler] @@ -258,7 +258,7 @@ function startWebSubHub() returns websub:WebSubHub { publisherResourceAuth = {enabled:true, scopes:["publish"]}, hubConfiguration = { remotePublish : { enabled : true }} ); - if (result is websub:WebSubHub) { + if (result is websub:Hub) { return result; } else if (result is websub:HubStartedUpError) { return result.startedUpHub; diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal index 8c823f22572c..4dced70ec7e7 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal @@ -29,7 +29,7 @@ const string WEBSUB_TOPIC_SIX = "http://two.redir.topic.com"; boolean remoteTopicRegistered = false; -websub:WebSubHub webSubHub = startHubAndRegisterTopic(); +websub:Hub webSubHub = startHubAndRegisterTopic(); websub:PublisherClient websubHubClientEP = new (webSubHub.publishUrl); @@ -186,8 +186,8 @@ function checkSubscrberAvailabilityAndPublishDirectly(string topic, string subsc } } -function startHubAndRegisterTopic() returns websub:WebSubHub { - websub:WebSubHub internalHub = startWebSubHub(); +function startHubAndRegisterTopic() returns websub:Hub { + websub:Hub internalHub = startWebSubHub(); var err = internalHub.registerTopic(WEBSUB_TOPIC_ONE); if (err is error) { log:printError("Error registering topic directly", err); @@ -211,10 +211,10 @@ function startHubAndRegisterTopic() returns websub:WebSubHub { return internalHub; } -function startWebSubHub() returns websub:WebSubHub { +function startWebSubHub() returns websub:Hub { var result = websub:startHub(new http:Listener(23191), "/websub", "/hub", hubConfiguration = { remotePublish : { enabled : true }}); - if (result is websub:WebSubHub) { + if (result is websub:Hub) { return result; } else if (result is websub:HubStartedUpError) { return result.startedUpHub; From 116aad0867b3ccb1a355134d20b2f7561d4ed12a Mon Sep 17 00:00:00 2001 From: praneesha Date: Mon, 28 Oct 2019 11:09:16 +0530 Subject: [PATCH 101/167] Update stdlib/websub/src/main/ballerina/src/websub/Module.md Co-Authored-By: Chamil Elladeniya --- stdlib/websub/src/main/ballerina/src/websub/Module.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index f395c7c7e499..1a5b178c7bba 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -490,7 +490,7 @@ public type WebhookListener object { } public function __gracefulStop() returns error? { - return (); + return self.websubListener.__gracefulStop(); } public function __immediateStop() returns error? { From 6cede4dda5cad6dd7b363c485d2e760c49242f43 Mon Sep 17 00:00:00 2001 From: praneesha Date: Mon, 28 Oct 2019 11:09:42 +0530 Subject: [PATCH 102/167] Update stdlib/websub/src/main/ballerina/src/websub/Module.md Co-Authored-By: Chamil Elladeniya --- stdlib/websub/src/main/ballerina/src/websub/Module.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index 1a5b178c7bba..bb6eeddbdaf0 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -498,7 +498,7 @@ public type WebhookListener object { if (sListener is http:Listener) { return sListener.__immediateStop(); } - return (); + return self.websubListener.__immediateStop(); }; ``` From bdce982a15e32fa4492652354b9838ef69cf7423 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Mon, 28 Oct 2019 11:10:59 +0530 Subject: [PATCH 103/167] Address review comments --- .../src/main/ballerina/src/websub/Module.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index f395c7c7e499..8440b04c6c78 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -489,16 +489,17 @@ public type WebhookListener object { return self.websubListener.__start(); } - public function __gracefulStop() returns error? { - return (); + public function __detach(service s) returns error? { + return self.websubListener.__detach(s); } - + public function __immediateStop() returns error? { - http:Listener? sListener = self.serviceEndpoint; - if (sListener is http:Listener) { - return sListener.__immediateStop(); - } - return (); + return self.websubListener.__immediateStop(); + } + + public function __gracefulStop() returns error? { + return self.websubListener.__gracefulStop(); + } }; ``` From 18050a582f131125521e66b1b731d3ec39967aa5 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Mon, 28 Oct 2019 11:18:53 +0530 Subject: [PATCH 104/167] Address unapplied review comments --- .../websub/src/main/ballerina/src/websub/Module.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index 17d2c725044d..391b0beb93a5 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -489,17 +489,17 @@ public type WebhookListener object { return self.websubListener.__start(); } - public function __gracefulStop() returns error? { - return self.websubListener.__gracefulStop(); + public function __detach(service s) returns error? { + return self.websubListener.__detach(s); } public function __immediateStop() returns error? { - http:Listener? sListener = self.serviceEndpoint; - if (sListener is http:Listener) { - return sListener.__immediateStop(); - } return self.websubListener.__immediateStop(); -}; + } + + public function __gracefulStop() returns error? { + return self.websubListener.__gracefulStop(); + } ``` A service can now be introduced for the above service provider as follows. From 9b59fb4f27c6671803821c294a190938f6761288 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Mon, 28 Oct 2019 11:25:52 +0530 Subject: [PATCH 105/167] Add latest dependency changes missed when merging --- distribution/zip/jballerina/build.gradle | 1 + gradle/javaLibsProject.gradle | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/distribution/zip/jballerina/build.gradle b/distribution/zip/jballerina/build.gradle index 5e86b5f71b3c..91e75109c8a1 100644 --- a/distribution/zip/jballerina/build.gradle +++ b/distribution/zip/jballerina/build.gradle @@ -46,6 +46,7 @@ configurations { } dependencies { + dist project(':ballerina-rt') distBal project(path: ':ballerina-auth', configuration: 'baloImplementation') distBal project(path: ':ballerina-cache', configuration: 'baloImplementation') diff --git a/gradle/javaLibsProject.gradle b/gradle/javaLibsProject.gradle index 1f9cd864ad7c..6e1cc1fb6f75 100644 --- a/gradle/javaLibsProject.gradle +++ b/gradle/javaLibsProject.gradle @@ -38,7 +38,7 @@ dependencies { dist 'org.wso2.carbon:org.wso2.carbon.core:5.1.0' dist 'org.wso2.securevault:org.wso2.securevault:1.0.0-wso2v2' dist 'org.wso2.transport.file:org.wso2.transport.local-file-system:6.0.55' - dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.28' + dist 'org.wso2.transport.http:org.wso2.transport.http.netty:6.2.30' dist 'org.bouncycastle:bcprov-jdk15on:1.61' dist 'org.bouncycastle:bcpkix-jdk15on:1.61' @@ -72,6 +72,7 @@ dependencies { dist 'com.google.protobuf:protobuf-java:3.9.1' dist 'org.wso2.orbit.org.yaml:snakeyaml:1.16.0.wso2v1' dist 'org.wso2.staxon:staxon-core:1.2.0.wso2v2' + dist 'com.rabbitmq:amqp-client:5.7.3' dist 'com.jcraft:jzlib:1.1.3' dist 'io.nats:java-nats-streaming:2.2.1' dist 'io.nats:jnats:2.6.0' @@ -84,9 +85,6 @@ dependencies { // dist 'org.codehaus.woodstox:woodstox-core-asl:4.2.0' // dist 'org.codehaus.woodstox:stax2-api:3.1.1' - - - // Lang libs dist project(':ballerina-auth') dist project(':ballerina-cli-utils') dist project(':ballerina-config-api') @@ -105,6 +103,7 @@ dependencies { dist project(':ballerina-logging') dist project(':ballerina-math') dist project(':ballerina-mime') + dist project(':ballerina-websub') dist project(':ballerina-observability') dist project(':ballerina-reflect') dist project(':ballerina-runtime-api') @@ -124,8 +123,10 @@ dependencies { dist project(':tracing-extensions:ballerina-jaeger-extension') dist project(':ballerina-kafka') dist project(':ballerina-nats') + dist project(':ballerina-rabbitmq') dist project(':ballerina-stringutils') dist project(':ballerina-jwt') + dist project(':ballerina-ldap') dist project(':ballerina-oauth2') dist project(':ballerina-xmlutils') dist project(':ballerina-jsonutils') From 7252dbd60071e5c7eaa07421c02e43a397d4d184 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Mon, 28 Oct 2019 11:26:47 +0530 Subject: [PATCH 106/167] Fix NPE when getting runtime all jar --- .../java/org/ballerinalang/packerina/task/CreateJarTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java index 4b5b7cae2a0b..10ff82832567 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java @@ -136,7 +136,7 @@ private void writeImportJar(List imports, Path sourceRoot, Build private Path getRuntimeAllJar(BuildContext buildContext) { - if (!skipCopyLibsFromDist) { + if (skipCopyLibsFromDist) { return null; } String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); From f20846e087e9f9e4476155a4b0114e23e3441694 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Mon, 28 Oct 2019 11:32:40 +0530 Subject: [PATCH 107/167] Fix brackets in the code --- stdlib/websub/src/main/ballerina/src/websub/Module.md | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index 391b0beb93a5..56e83fe31f06 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -500,6 +500,7 @@ public type WebhookListener object { public function __gracefulStop() returns error? { return self.websubListener.__gracefulStop(); } +}; ``` A service can now be introduced for the above service provider as follows. From 6dc924d65054629f9d81396e4234e4c0a3c571d9 Mon Sep 17 00:00:00 2001 From: praneesha Date: Mon, 28 Oct 2019 11:43:23 +0530 Subject: [PATCH 108/167] Update stdlib/websub/src/main/ballerina/src/websub/Module.md Co-Authored-By: Maryam Ziyad --- stdlib/websub/src/main/ballerina/src/websub/Module.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/Module.md b/stdlib/websub/src/main/ballerina/src/websub/Module.md index 56e83fe31f06..2c79f6a07abb 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/Module.md +++ b/stdlib/websub/src/main/ballerina/src/websub/Module.md @@ -489,7 +489,7 @@ public type WebhookListener object { return self.websubListener.__start(); } - public function __detach(service s) returns error? { + public function __detach(service s) returns error? { return self.websubListener.__detach(s); } From cad675c1d06711195762b301d54e004f6b10c4fa Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Mon, 28 Oct 2019 13:37:31 +0530 Subject: [PATCH 109/167] Temoparily add 'clean' and '--no-build-cache' options --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef08a8522e49..ddec7a174305 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ jobs: name: "Run Build + tests (without integration) - Linux" script: - while sleep 9m; do echo "=====[ $SECONDS seconds still running ]====="; done & - - ./gradlew build -x :jballerina-integration-test:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon + - ./gradlew clean build --no-build-cache -x :jballerina-integration-test:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon # Killing background sleep loop - kill %1 os: linux @@ -75,7 +75,7 @@ jobs: - script: - while sleep 9m; do echo "=====[ $SECONDS seconds still running ]====="; done & # TODO enable tests for all projects - - ./gradlew.bat build -Dorg.gradle.parallel=false -x :language-server:language-server-core:test -x :ballerina-packerina:test -x :ballerina-lang:test -x :ballerina-http:test -x :ballerina-file:test -x :ballerina-task:test -x :ballerina-socket:test -x :jballerina-unit-test:test -x :jballerina-integration-test:test -x :plugin-vscode:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon + - ./gradlew.bat clean build --no-build-cache -Dorg.gradle.parallel=false -x :language-server:language-server-core:test -x :ballerina-packerina:test -x :ballerina-lang:test -x :ballerina-http:test -x :ballerina-file:test -x :ballerina-task:test -x :ballerina-socket:test -x :jballerina-unit-test:test -x :jballerina-integration-test:test -x :plugin-vscode:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon # Killing background sleep loop - kill %1 name: "Tests - windows" @@ -87,7 +87,7 @@ jobs: - export JAVA_HOME="c:\\java8" - script: - while sleep 9m; do echo "=====[ $SECONDS seconds still running ]====="; done & - - ./gradlew :jballerina-integration-test:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon + - ./gradlew clean -no-build-cache :jballerina-integration-test:test -x createJavadoc --stacktrace -scan --console=plain --no-daemon # Killing background sleep loop - kill %1 os: linux From aa9775ecfee7d0d23039dc9e0a32071f58763fb2 Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Mon, 28 Oct 2019 08:06:59 +0530 Subject: [PATCH 110/167] Optimize http object creation --- .../net/http/HttpDispatcher.java | 12 +- .../org/ballerinalang/net/http/HttpUtil.java | 21 ++-- .../net/http/ValueCreatorUtils.java | 109 ++++++++++++++++++ .../httpclient/AbstractHTTPAction.java | 5 +- .../cachingclient/HttpCachingClientTest.java | 8 +- .../multipart/MultipartEncoderTest.java | 2 +- .../PushPromiseNativeFunctionTest.java | 2 +- .../RequestNativeFunctionNegativeTest.java | 4 +- .../RequestNativeFunctionSuccessTest.java | 4 +- .../ResponseNativeFunctionNegativeTest.java | 4 +- .../ResponseNativeFunctionSuccessTest.java | 4 +- .../stdlib/utils/MultipartUtils.java | 6 +- .../stdlib/utils/ValueCreatorUtils.java | 67 ----------- .../nativeimpl/InvocationContextUtils.java | 6 +- 14 files changed, 141 insertions(+), 113 deletions(-) create mode 100644 stdlib/http/src/main/java/org/ballerinalang/net/http/ValueCreatorUtils.java delete mode 100644 stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/ValueCreatorUtils.java diff --git a/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpDispatcher.java b/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpDispatcher.java index 800abbf9a8aa..49c1334fdf0b 100644 --- a/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpDispatcher.java +++ b/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpDispatcher.java @@ -18,7 +18,6 @@ package org.ballerinalang.net.http; import io.netty.handler.codec.http.HttpHeaderNames; -import org.ballerinalang.jvm.BallerinaValues; import org.ballerinalang.jvm.types.BArrayType; import org.ballerinalang.jvm.types.BType; import org.ballerinalang.jvm.types.TypeTags; @@ -41,12 +40,7 @@ import java.util.List; import java.util.Map; -import static org.ballerinalang.mime.util.MimeConstants.ENTITY; -import static org.ballerinalang.mime.util.MimeConstants.PROTOCOL_MIME_PKG_ID; -import static org.ballerinalang.net.http.HttpConstants.CALLER; import static org.ballerinalang.net.http.HttpConstants.DEFAULT_HOST; -import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTP_PKG_ID; -import static org.ballerinalang.net.http.HttpConstants.REQUEST; import static org.ballerinalang.net.http.compiler.ResourceSignatureValidator.COMPULSORY_PARAM_COUNT; /** @@ -145,9 +139,9 @@ public static HttpResource findResource(HTTPServicesRegistry servicesRegistry, H public static Object[] getSignatureParameters(HttpResource httpResource, HttpCarbonMessage httpCarbonMessage, MapValue endpointConfig) { - ObjectValue httpCaller = BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, CALLER); - ObjectValue inRequest = BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, REQUEST); - ObjectValue inRequestEntity = BallerinaValues.createObjectValue(PROTOCOL_MIME_PKG_ID, ENTITY); + ObjectValue httpCaller = ValueCreatorUtils.createCallerObject(); + ObjectValue inRequest = ValueCreatorUtils.createRequestObject(); + ObjectValue inRequestEntity = ValueCreatorUtils.createEntityObject(); HttpUtil.enrichHttpCallerWithConnectionInfo(httpCaller, httpCarbonMessage, httpResource, endpointConfig); HttpUtil.enrichHttpCallerWithNativeData(httpCaller, httpCarbonMessage, endpointConfig); diff --git a/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpUtil.java b/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpUtil.java index 815617b847d2..3fa7cb5e2e13 100644 --- a/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpUtil.java +++ b/stdlib/http/src/main/java/org/ballerinalang/net/http/HttpUtil.java @@ -106,13 +106,11 @@ import static org.ballerinalang.jvm.runtime.RuntimeConstants.BALLERINA_VERSION; import static org.ballerinalang.mime.util.EntityBodyHandler.checkEntityBodyAvailability; import static org.ballerinalang.mime.util.MimeConstants.BOUNDARY; -import static org.ballerinalang.mime.util.MimeConstants.ENTITY; import static org.ballerinalang.mime.util.MimeConstants.ENTITY_BYTE_CHANNEL; import static org.ballerinalang.mime.util.MimeConstants.ENTITY_HEADERS; import static org.ballerinalang.mime.util.MimeConstants.IS_BODY_BYTE_CHANNEL_ALREADY_SET; import static org.ballerinalang.mime.util.MimeConstants.MULTIPART_AS_PRIMARY_TYPE; import static org.ballerinalang.mime.util.MimeConstants.OCTET_STREAM; -import static org.ballerinalang.mime.util.MimeConstants.PROTOCOL_MIME_PKG_ID; import static org.ballerinalang.mime.util.MimeConstants.REQUEST_ENTITY_FIELD; import static org.ballerinalang.mime.util.MimeConstants.RESPONSE_ENTITY_FIELD; import static org.ballerinalang.net.http.HttpConstants.ALWAYS; @@ -147,7 +145,6 @@ import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTPS; import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTP_PKG_ID; import static org.ballerinalang.net.http.HttpConstants.REQUEST; -import static org.ballerinalang.net.http.HttpConstants.REQUEST_CACHE_CONTROL; import static org.ballerinalang.net.http.HttpConstants.REQUEST_CACHE_CONTROL_FIELD; import static org.ballerinalang.net.http.HttpConstants.REQUEST_MUTUAL_SSL_HANDSHAKE_FIELD; import static org.ballerinalang.net.http.HttpConstants.REQUEST_MUTUAL_SSL_HANDSHAKE_STATUS; @@ -206,7 +203,7 @@ public class HttpUtil { * @return created entity. */ public static ObjectValue createNewEntity(ObjectValue httpMessageStruct) { - ObjectValue entity = BallerinaValues.createObjectValue(PROTOCOL_MIME_PKG_ID, ENTITY); + ObjectValue entity = ValueCreatorUtils.createEntityObject(); HttpCarbonMessage httpCarbonMessage = HttpUtil.getCarbonMsg(httpMessageStruct, HttpUtil.createHttpCarbonMessage(isRequest(httpMessageStruct))); entity.addNativeData(ENTITY_HEADERS, httpCarbonMessage.getHeaders()); @@ -640,8 +637,7 @@ public static void populateInboundRequest(ObjectValue inboundRequest, ObjectValu inboundRequest.addNativeData(REQUEST, true); if (inboundRequestMsg.getProperty(HttpConstants.MUTUAL_SSL_RESULT) != null) { - MapValue mutualSslRecord = BallerinaValues.createRecordValue(PROTOCOL_HTTP_PKG_ID, - MUTUAL_SSL_HANDSHAKE_RECORD); + MapValue mutualSslRecord = ValueCreatorUtils.createHTTPRecordValue(MUTUAL_SSL_HANDSHAKE_RECORD); mutualSslRecord.put(REQUEST_MUTUAL_SSL_HANDSHAKE_STATUS, inboundRequestMsg.getProperty(HttpConstants.MUTUAL_SSL_RESULT)); inboundRequest.set(REQUEST_MUTUAL_SSL_HANDSHAKE_FIELD, mutualSslRecord); @@ -656,8 +652,7 @@ public static void populateInboundRequest(ObjectValue inboundRequest, ObjectValu String cacheControlHeader = inboundRequestMsg.getHeader(CACHE_CONTROL.toString()); if (cacheControlHeader != null) { - ObjectValue cacheControlObj = BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, - REQUEST_CACHE_CONTROL); + ObjectValue cacheControlObj = ValueCreatorUtils.createRequestCacheControlObject(); RequestCacheControlObj requestCacheControl = new RequestCacheControlObj(cacheControlObj); requestCacheControl.populateStruct(cacheControlHeader); inboundRequest.set(REQUEST_CACHE_CONTROL_FIELD, requestCacheControl.getObj()); @@ -708,9 +703,8 @@ public static void enrichHttpCallerWithNativeData(ObjectValue caller, HttpCarbon */ public static void enrichHttpCallerWithConnectionInfo(ObjectValue httpCaller, HttpCarbonMessage inboundMsg, HttpResource httpResource, MapValue config) { - MapValue remote = BallerinaValues.createRecordValue(PROTOCOL_HTTP_PKG_ID, - HttpConstants.REMOTE); - MapValue local = BallerinaValues.createRecordValue(PROTOCOL_HTTP_PKG_ID, HttpConstants.LOCAL); + MapValue remote = ValueCreatorUtils.createHTTPRecordValue(HttpConstants.REMOTE); + MapValue local = ValueCreatorUtils.createHTTPRecordValue(HttpConstants.LOCAL); Object remoteSocketAddress = inboundMsg.getProperty(HttpConstants.REMOTE_ADDRESS); if (remoteSocketAddress instanceof InetSocketAddress) { @@ -1144,9 +1138,8 @@ private static void setChunkingHeader(String transferValue, HttpCarbonMessage ou * @return the Response struct */ public static ObjectValue createResponseStruct(HttpCarbonMessage httpCarbonMessage) { - ObjectValue responseObj = BallerinaValues.createObjectValue(HttpConstants.PROTOCOL_HTTP_PKG_ID, - HttpConstants.RESPONSE); - ObjectValue entity = BallerinaValues.createObjectValue(PROTOCOL_MIME_PKG_ID, HttpConstants.ENTITY); + ObjectValue responseObj = ValueCreatorUtils.createResponseObject(); + ObjectValue entity = ValueCreatorUtils.createEntityObject(); HttpUtil.populateInboundResponse(responseObj, entity, httpCarbonMessage); return responseObj; diff --git a/stdlib/http/src/main/java/org/ballerinalang/net/http/ValueCreatorUtils.java b/stdlib/http/src/main/java/org/ballerinalang/net/http/ValueCreatorUtils.java new file mode 100644 index 000000000000..f2430036bb5e --- /dev/null +++ b/stdlib/http/src/main/java/org/ballerinalang/net/http/ValueCreatorUtils.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.net.http; + +import org.ballerinalang.jvm.values.MapValue; +import org.ballerinalang.jvm.values.ObjectValue; +import org.ballerinalang.jvm.values.ValueCreator; + +import static org.ballerinalang.mime.util.MimeConstants.MEDIA_TYPE; +import static org.ballerinalang.mime.util.MimeConstants.PROTOCOL_MIME_PKG_ID; +import static org.ballerinalang.net.http.HttpConstants.CALLER; +import static org.ballerinalang.net.http.HttpConstants.ENTITY; +import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTP_PKG_ID; +import static org.ballerinalang.net.http.HttpConstants.PUSH_PROMISE; +import static org.ballerinalang.net.http.HttpConstants.REQUEST; +import static org.ballerinalang.net.http.HttpConstants.REQUEST_CACHE_CONTROL; +import static org.ballerinalang.net.http.HttpConstants.RESPONSE; +import static org.ballerinalang.net.http.HttpConstants.RESPONSE_CACHE_CONTROL; + +/** + * Utility functions to create JVM values. + * + * @since 1.0 + */ +public class ValueCreatorUtils { + + private static final ValueCreator httpValueCreator = ValueCreator.getValueCreator(PROTOCOL_HTTP_PKG_ID.toString()); + private static final ValueCreator mimeValueCreator = ValueCreator.getValueCreator(PROTOCOL_MIME_PKG_ID.toString()); + + public static ObjectValue createRequestObject() { + return createObjectValue(httpValueCreator, REQUEST); + } + + public static ObjectValue createResponseObject() { + return createObjectValue(httpValueCreator, RESPONSE); + } + + public static ObjectValue createEntityObject() { + return createObjectValue(mimeValueCreator, ENTITY); + } + + public static ObjectValue createMediaTypeObject() { + return createObjectValue(mimeValueCreator, MEDIA_TYPE); + } + + public static ObjectValue createPushPromiseObject() { + return createObjectValue(httpValueCreator, PUSH_PROMISE, "/", "GET"); + } + + public static ObjectValue createRequestCacheControlObject() { + return createObjectValue(httpValueCreator, REQUEST_CACHE_CONTROL); + } + + public static ObjectValue createResponseCacheControlObject() { + return createObjectValue(httpValueCreator, RESPONSE_CACHE_CONTROL); + } + + public static ObjectValue createCallerObject() { + return createObjectValue(httpValueCreator, CALLER); + } + + /** + * Method that creates a runtime record value using the given record type in the http package. + * + * @param recordTypeName name of the record type. + * @return value of the record. + */ + public static MapValue createHTTPRecordValue(String recordTypeName) { + return httpValueCreator.createRecordValue(recordTypeName); + } + + /** + * Method that creates a runtime object value using the given package id and object type name. + * + * @param valueCreator value creator specific for the package. + * @param objectTypeName name of the object type. + * @param fieldValues values to be used for fields when creating the object value instance. + * @return value of the object. + */ + private static ObjectValue createObjectValue(ValueCreator valueCreator, String objectTypeName, + Object... fieldValues) { + + Object[] fields = new Object[fieldValues.length * 2]; + + // Adding boolean values for each arg + for (int i = 0, j = 0; i < fieldValues.length; i++) { + fields[j++] = fieldValues[i]; + fields[j++] = true; + } + + // passing scheduler, strand and properties as null for the moment, but better to expose them via this method + return valueCreator.createObjectValue(objectTypeName, null, null, null, fields); + } +} diff --git a/stdlib/http/src/main/java/org/ballerinalang/net/http/actions/httpclient/AbstractHTTPAction.java b/stdlib/http/src/main/java/org/ballerinalang/net/http/actions/httpclient/AbstractHTTPAction.java index 09ba900f6308..3b410ee3bc7c 100644 --- a/stdlib/http/src/main/java/org/ballerinalang/net/http/actions/httpclient/AbstractHTTPAction.java +++ b/stdlib/http/src/main/java/org/ballerinalang/net/http/actions/httpclient/AbstractHTTPAction.java @@ -42,6 +42,7 @@ import org.ballerinalang.net.http.HttpConstants; import org.ballerinalang.net.http.HttpErrorType; import org.ballerinalang.net.http.HttpUtil; +import org.ballerinalang.net.http.ValueCreatorUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.wso2.transport.http.netty.contract.Constants; @@ -63,8 +64,6 @@ import static io.netty.handler.codec.http.HttpHeaderNames.ACCEPT_ENCODING; import static org.ballerinalang.jvm.runtime.RuntimeConstants.BALLERINA_VERSION; import static org.ballerinalang.net.http.HttpConstants.ANN_CONFIG_ATTR_COMPRESSION; -import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTP_PKG_ID; -import static org.ballerinalang.net.http.HttpConstants.REQUEST; import static org.ballerinalang.net.http.HttpUtil.extractEntity; import static org.ballerinalang.net.http.HttpUtil.getCompressionState; import static org.wso2.transport.http.netty.contract.Constants.ENCODING_DEFLATE; @@ -86,7 +85,7 @@ public abstract class AbstractHTTPAction { protected static HttpCarbonMessage createOutboundRequestMsg(Strand strand, String serviceUri, MapValue config, String path, ObjectValue request) { if (request == null) { - request = BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, REQUEST); + request = ValueCreatorUtils.createRequestObject(); } HttpCarbonMessage requestMsg = HttpUtil.getCarbonMsg(request, HttpUtil.createHttpCarbonMessage(true)); diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/cachingclient/HttpCachingClientTest.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/cachingclient/HttpCachingClientTest.java index 6e2dd93c435f..aae8fa84818d 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/cachingclient/HttpCachingClientTest.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/cachingclient/HttpCachingClientTest.java @@ -48,10 +48,10 @@ import static org.ballerinalang.mime.util.MimeConstants.REQUEST_ENTITY_FIELD; import static org.ballerinalang.net.http.HttpConstants.REQUEST_CACHE_CONTROL_FIELD; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createEntityObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createRequestCacheControlObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createResponseCacheControlObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createResponseObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createEntityObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createRequestCacheControlObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createResponseCacheControlObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createResponseObject; /** * Test cases for the HTTP caching client. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/multipart/MultipartEncoderTest.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/multipart/MultipartEncoderTest.java index ed988edee706..32432e414810 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/multipart/MultipartEncoderTest.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/multipart/MultipartEncoderTest.java @@ -59,12 +59,12 @@ import static org.ballerinalang.mime.util.MimeConstants.CONTENT_DISPOSITION_FILENAME_FIELD; import static org.ballerinalang.mime.util.MimeConstants.CONTENT_DISPOSITION_NAME_FIELD; import static org.ballerinalang.mime.util.MimeConstants.DISPOSITION_FIELD; +import static org.ballerinalang.net.http.ValueCreatorUtils.createEntityObject; import static org.ballerinalang.stdlib.mime.Util.getContentDispositionStruct; import static org.ballerinalang.stdlib.mime.Util.getMultipartEntity; import static org.ballerinalang.stdlib.mime.Util.getNestedMultipartEntity; import static org.ballerinalang.stdlib.mime.Util.validateBodyPartContent; import static org.ballerinalang.stdlib.utils.MultipartUtils.createNestedPartRequest; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createEntityObject; /** * Unit tests for multipart encoder. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/promise/PushPromiseNativeFunctionTest.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/promise/PushPromiseNativeFunctionTest.java index 2a44606f7017..03b58947ee78 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/promise/PushPromiseNativeFunctionTest.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/promise/PushPromiseNativeFunctionTest.java @@ -32,7 +32,7 @@ import org.testng.annotations.Test; import org.wso2.transport.http.netty.message.Http2PushPromise; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createPushPromiseObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createPushPromiseObject; /** * Test cases for ballerina/http inbound inResponse success native functions. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionNegativeTest.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionNegativeTest.java index 810e8a9afa6e..fe5ba70f458e 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionNegativeTest.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionNegativeTest.java @@ -43,8 +43,8 @@ import static org.ballerinalang.mime.util.MimeConstants.IS_BODY_BYTE_CHANNEL_ALREADY_SET; import static org.ballerinalang.mime.util.MimeConstants.REQUEST_ENTITY_FIELD; import static org.ballerinalang.mime.util.MimeConstants.TEXT_PLAIN; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createEntityObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createRequestObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createEntityObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createRequestObject; /** * Test cases for ballerina/http request negative native functions. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionSuccessTest.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionSuccessTest.java index 1a90d7a711e4..464d79c91930 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionSuccessTest.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/request/RequestNativeFunctionSuccessTest.java @@ -73,11 +73,11 @@ import static org.ballerinalang.mime.util.MimeConstants.REQUEST_ENTITY_FIELD; import static org.ballerinalang.mime.util.MimeConstants.TEXT_PLAIN; import static org.ballerinalang.mime.util.MimeUtil.isNotNullAndEmpty; +import static org.ballerinalang.net.http.ValueCreatorUtils.createEntityObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createRequestObject; import static org.ballerinalang.stdlib.utils.TestEntityUtils.enrichEntityWithDefaultMsg; import static org.ballerinalang.stdlib.utils.TestEntityUtils.enrichTestEntity; import static org.ballerinalang.stdlib.utils.TestEntityUtils.enrichTestEntityHeaders; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createEntityObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createRequestObject; /** * Test cases for ballerina/http request success native functions. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionNegativeTest.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionNegativeTest.java index ac5de30b7d02..83aad40acd0a 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionNegativeTest.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionNegativeTest.java @@ -42,8 +42,8 @@ import static org.ballerinalang.mime.util.MimeConstants.PROTOCOL_PACKAGE_MIME; import static org.ballerinalang.mime.util.MimeConstants.RESPONSE_ENTITY_FIELD; import static org.ballerinalang.mime.util.MimeConstants.TEXT_PLAIN; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createEntityObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createResponseObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createEntityObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createResponseObject; /** * Test cases for ballerina/http inbound response negative native functions. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionSuccessTest.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionSuccessTest.java index 1958427fbeef..e7803202b313 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionSuccessTest.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/services/nativeimpl/response/ResponseNativeFunctionSuccessTest.java @@ -57,11 +57,11 @@ import static org.ballerinalang.mime.util.MimeConstants.REQUEST_ENTITY_FIELD; import static org.ballerinalang.mime.util.MimeConstants.RESPONSE_ENTITY_FIELD; import static org.ballerinalang.mime.util.MimeConstants.TEXT_PLAIN; +import static org.ballerinalang.net.http.ValueCreatorUtils.createEntityObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createResponseObject; import static org.ballerinalang.stdlib.utils.TestEntityUtils.enrichEntityWithDefaultMsg; import static org.ballerinalang.stdlib.utils.TestEntityUtils.enrichTestEntity; import static org.ballerinalang.stdlib.utils.TestEntityUtils.enrichTestEntityHeaders; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createEntityObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createResponseObject; /** * Test cases for ballerina/http inbound inResponse success native functions. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/MultipartUtils.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/MultipartUtils.java index ef7e8fd6d7c9..2f17aad3c7c0 100644 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/MultipartUtils.java +++ b/stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/MultipartUtils.java @@ -59,9 +59,9 @@ import static org.ballerinalang.mime.util.MimeConstants.REQUEST_ENTITY_FIELD; import static org.ballerinalang.mime.util.MimeConstants.TEMP_FILE_EXTENSION; import static org.ballerinalang.mime.util.MimeConstants.TEMP_FILE_NAME; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createEntityObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createMediaTypeObject; -import static org.ballerinalang.stdlib.utils.ValueCreatorUtils.createRequestObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createEntityObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createMediaTypeObject; +import static org.ballerinalang.net.http.ValueCreatorUtils.createRequestObject; /** * Utility functions for multipart handling. diff --git a/stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/ValueCreatorUtils.java b/stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/ValueCreatorUtils.java deleted file mode 100644 index 5ef79de68549..000000000000 --- a/stdlib/http/src/test/java/org/ballerinalang/stdlib/utils/ValueCreatorUtils.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.ballerinalang.stdlib.utils; - -import org.ballerinalang.jvm.BallerinaValues; -import org.ballerinalang.jvm.values.ObjectValue; - -import static org.ballerinalang.mime.util.MimeConstants.MEDIA_TYPE; -import static org.ballerinalang.mime.util.MimeConstants.PROTOCOL_MIME_PKG_ID; -import static org.ballerinalang.net.http.HttpConstants.ENTITY; -import static org.ballerinalang.net.http.HttpConstants.PROTOCOL_HTTP_PKG_ID; -import static org.ballerinalang.net.http.HttpConstants.PUSH_PROMISE; -import static org.ballerinalang.net.http.HttpConstants.REQUEST; -import static org.ballerinalang.net.http.HttpConstants.REQUEST_CACHE_CONTROL; -import static org.ballerinalang.net.http.HttpConstants.RESPONSE; -import static org.ballerinalang.net.http.HttpConstants.RESPONSE_CACHE_CONTROL; - -/** - * Utility functions to create JVM values. - * - * @since 1.0 - */ -public class ValueCreatorUtils { - - public static ObjectValue createRequestObject() { - return BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, REQUEST); - } - - public static ObjectValue createResponseObject() { - return BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, RESPONSE); - } - - public static ObjectValue createEntityObject() { - return BallerinaValues.createObjectValue(PROTOCOL_MIME_PKG_ID, ENTITY); - } - - public static ObjectValue createMediaTypeObject() { - return BallerinaValues.createObjectValue(PROTOCOL_MIME_PKG_ID, MEDIA_TYPE); - } - - public static ObjectValue createPushPromiseObject() { - return BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, PUSH_PROMISE, "/", "GET"); - } - - public static ObjectValue createRequestCacheControlObject() { - return BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, REQUEST_CACHE_CONTROL); - } - - public static ObjectValue createResponseCacheControlObject() { - return BallerinaValues.createObjectValue(PROTOCOL_HTTP_PKG_ID, RESPONSE_CACHE_CONTROL); - } -} diff --git a/stdlib/runtime-api/src/main/java/org/ballerinalang/stdlib/runtime/nativeimpl/InvocationContextUtils.java b/stdlib/runtime-api/src/main/java/org/ballerinalang/stdlib/runtime/nativeimpl/InvocationContextUtils.java index d55d490cb310..df02674f5672 100644 --- a/stdlib/runtime-api/src/main/java/org/ballerinalang/stdlib/runtime/nativeimpl/InvocationContextUtils.java +++ b/stdlib/runtime-api/src/main/java/org/ballerinalang/stdlib/runtime/nativeimpl/InvocationContextUtils.java @@ -18,10 +18,10 @@ package org.ballerinalang.stdlib.runtime.nativeimpl; -import org.ballerinalang.jvm.BallerinaValues; import org.ballerinalang.jvm.scheduling.Strand; import org.ballerinalang.jvm.values.MapValue; import org.ballerinalang.jvm.values.MapValueImpl; +import org.ballerinalang.jvm.values.ValueCreator; import java.util.UUID; @@ -38,6 +38,7 @@ public class InvocationContextUtils { private static final String STRUCT_TYPE_INVOCATION_CONTEXT = "InvocationContext"; private static final String INVOCATION_ID_KEY = "id"; private static final String INVOCATION_ATTRIBUTES = "attributes"; + private static final ValueCreator valueCreator = ValueCreator.getValueCreator(BALLERINA_RUNTIME_PKG_ID.toString()); public static MapValue getInvocationContextRecord(Strand strand) { MapValue invocationContext = @@ -50,8 +51,7 @@ public static MapValue getInvocationContextRecord(Strand strand) } private static MapValue initInvocationContext(Strand strand) { - MapValue invocationContextInfo = BallerinaValues. - createRecordValue(BALLERINA_RUNTIME_PKG_ID, STRUCT_TYPE_INVOCATION_CONTEXT); + MapValue invocationContextInfo = valueCreator.createRecordValue(STRUCT_TYPE_INVOCATION_CONTEXT); UUID invocationId = UUID.randomUUID(); invocationContextInfo.put(INVOCATION_ID_KEY, invocationId.toString()); invocationContextInfo.put(INVOCATION_ATTRIBUTES, new MapValueImpl()); From dc9d2901a25a7ab33893777c7f4f78e52aed82c3 Mon Sep 17 00:00:00 2001 From: Dhananjaya Wickramasingha Date: Mon, 28 Oct 2019 14:53:05 +0530 Subject: [PATCH 111/167] Fix xml unit test failure --- .../compiler/semantics/analyzer/SymbolEnter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java index d47e08b8f61a..f8c9ba34cb5a 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java @@ -497,7 +497,7 @@ public void visit(BLangImportPackage importPkgNode) { public void visit(BLangXMLNS xmlnsNode) { String nsURI = (String) ((BLangLiteral) xmlnsNode.namespaceURI).value; - if (xmlnsNode.prefix.value != null && nsURI.isEmpty()) { + if (!nullOrEmpty(xmlnsNode.prefix.value) && nsURI.isEmpty()) { dlog.error(xmlnsNode.pos, DiagnosticCode.INVALID_NAMESPACE_DECLARATION, xmlnsNode.prefix); } @@ -524,6 +524,10 @@ public void visit(BLangXMLNS xmlnsNode) { defineSymbol(xmlnsNode.prefix.pos, xmlnsSymbol); } + private boolean nullOrEmpty(String value) { + return value == null || value.isEmpty(); + } + public void visit(BLangXMLNSStatement xmlnsStmtNode) { defineNode(xmlnsStmtNode.xmlnsDecl, env); } From 61dd48a1f471ed746742599baa0d18f48bff84a3 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Mon, 28 Oct 2019 15:30:47 +0530 Subject: [PATCH 112/167] Rename Character I/O BBE --- examples/index.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/index.json b/examples/index.json index 7ebdc1ac795a..139c69771663 100644 --- a/examples/index.json +++ b/examples/index.json @@ -431,10 +431,6 @@ "name": "Byte I/O", "url": "byte-io" }, - { - "name": "Character I/O", - "url": "character-io" - }, { "name": "Record I/O", "url": "record-io" @@ -451,6 +447,10 @@ "name": "XML I/O", "url": "xml-io" }, + { + "name": "Read/Write Files", + "url": "character-io" + }, { "name": "JSON to CSV Transform", "url": "json-csv" From 4b3630c9c863b6da31a7c3e2523a90e419855f23 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Mon, 28 Oct 2019 19:46:47 +0530 Subject: [PATCH 113/167] Fix merge conflicts --- .../packerina/task/CopyNativeLibTask.java | 1 - .../interop/interop_method_gen.bal | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java index d0391f385418..73d649355340 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java @@ -104,7 +104,6 @@ private void copyImportedJarsForModules(BuildContext buildContext, List Date: Mon, 28 Oct 2019 20:07:16 +0530 Subject: [PATCH 114/167] Minor refactoring --- .../src/main/ballerina/src/websub/errors.bal | 4 ++-- .../src/main/ballerina/src/websub/hub_service.bal | 14 ++++++++------ .../main/ballerina/src/websub/publisher_client.bal | 3 --- .../ballerina/src/websub/subscriber_client.bal | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/errors.bal b/stdlib/websub/src/main/ballerina/src/websub/errors.bal index ef6dc5f4f984..d1e9f2703f87 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/errors.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/errors.bal @@ -31,8 +31,8 @@ public type ListenerStartupError error; # Represents the reason string for the `websub:HubStartupError`. -public const HUB_STARTUP_REASON = "{ballerina/websub}HubStartupError"; +public const HUB_STARTUP_ERROR_REASON = "{ballerina/websub}HubStartupError"; # Represents a hub startup error. -public type HubStartupError error; +public type HubStartupError error; diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 4dd5cca1b60c..973548d69371 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -440,7 +440,9 @@ function addSubscriptionsOnStartup(HubPersistenceStore persistenceStore) returns int time = time:currentTime().time; if (time - subscription.leaseSeconds > subscription.createdAt) { error? remResult = persistenceStore.removeSubscription(subscription); - log:printError("Error removing expired subscription", remResult); + if (remResult is error) { + log:printError("Error removing expired subscription", remResult); + } continue; } addSubscription(subscription); @@ -483,9 +485,9 @@ function distributeContent(string callback, SubscriptionDetails subscriptionDeta removeSubscription(subscriptionDetails.topic, callback); if (hubPersistenceEnabled) { error? remResult = persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); - if (remResult is error) { - log:printError("Error removing expired subscription", remResult); - } + if (remResult is error) { + log:printError("Error removing expired subscription", remResult); + } } } else { var result = request.getTextPayload(); @@ -519,8 +521,8 @@ function distributeContent(string callback, SubscriptionDetails subscriptionDeta if (hubPersistenceEnabled) { error? remResult = persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); if (remResult is error) { - log:printError("Error removing gone subscription", remResult); - } + log:printError("Error removing gone subscription", remResult); + } } log:printInfo("HTTP 410 response code received: Subscription deleted for callback[" + callback + "], topic[" + subscriptionDetails.topic + "]"); diff --git a/stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal b/stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal index 4d25d0e2c888..d92b34a7fc5e 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/publisher_client.bal @@ -78,7 +78,6 @@ public type PublisherClient client object { error webSubError = error(WEBSUB_ERROR_CODE, message = "Error sending topic unregistration request: " + errCause); return webSubError; } - return; } # Publishes an update to a remote Ballerina WebSub Hub. @@ -117,7 +116,6 @@ public type PublisherClient client object { error webSubError = error(WEBSUB_ERROR_CODE, message = "Publish failed for topic [" + topic + "]"); return webSubError; } - return; } # Notifies a remote WebSub Hub that an update is available to fetch, for hubs that require publishing to @@ -151,7 +149,6 @@ public type PublisherClient client object { message = "Update availability notification failed for topic [" + topic + "]"); return webSubError; } - return; } }; diff --git a/stdlib/websub/src/main/ballerina/src/websub/subscriber_client.bal b/stdlib/websub/src/main/ballerina/src/websub/subscriber_client.bal index d44e81e30038..13458936ea4c 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/subscriber_client.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/subscriber_client.bal @@ -28,7 +28,7 @@ public type SubscriptionClient client object { # Initializer function for the client. # - # + url - The URL to publish/notify updates to + # + url - The URL to change subscription at # + config - The `http:ClientConfiguration` for the underlying client or `()` public function __init(string url, http:ClientConfiguration? config = ()) { self.url = url; From 5f4b7632471c9f64932b6310138816ffc9efcd66 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Tue, 29 Oct 2019 07:15:33 +0530 Subject: [PATCH 115/167] Fix hub startup in BBE --- .../order_mgmt_service.bal | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/websub-service-integration-sample/order_mgmt_service.bal b/examples/websub-service-integration-sample/order_mgmt_service.bal index 068517870014..0241ab64bab5 100644 --- a/examples/websub-service-integration-sample/order_mgmt_service.bal +++ b/examples/websub-service-integration-sample/order_mgmt_service.bal @@ -33,7 +33,7 @@ service orderMgt on httpListener { resource function discoverPlaceOrder(http:Caller caller, http:Request req) { http:Response response = new; // Adds a link header indicating the hub and topic. - websub:addWebSubLinkHeader(response, [webSubHub.hubUrl], ORDER_TOPIC); + websub:addWebSubLinkHeader(response, [webSubHub.subscriptionUrl], ORDER_TOPIC); response.statusCode = 202; var result = caller->respond(response); if (result is error) { @@ -81,9 +81,16 @@ service orderMgt on httpListener { // which updates will be published. function startHubAndRegisterTopic() returns websub:Hub { var hubStartUpResult = websub:startHub(new http:Listener(9191), "/websub", "/hub"); - websub:Hub internalHub = hubStartUpResult is websub:HubStartedUpError - ? hubStartUpResult.startedUpHub : hubStartUpResult; + websub:Hub? hubVar = (); + if hubStartUpResult is websub:HubStartupError { + panic hubStartUpResult; + } else { + hubVar = hubStartUpResult is websub:HubStartedUpError + ? hubStartUpResult.startedUpHub : hubStartUpResult; + } + + websub:Hub internalHub = hubVar; var result = internalHub.registerTopic(ORDER_TOPIC); if (result is error) { log:printError("Error registering topic", result); From 5eba8f5851eed04148a1c756f972228ec78693ea Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Tue, 29 Oct 2019 07:16:43 +0530 Subject: [PATCH 116/167] Fix adding subscriptions on startup --- .../src/main/java/org/ballerinalang/net/websub/hub/Hub.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java index 639865fc653c..7067177be97a 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java @@ -217,16 +217,17 @@ public Object startUpHubService(Strand strand, String basePath, String subscript String publishUrl = populatePublishUrl(publicUrl, hubListener); String subscribeUrl = populateSubscribeUrl(publicUrl, hubListener); + started = true; Object setupResult = executeFunction(strand.scheduler, classLoader, BALLERINA, WEBSUB, HUB_SERVICE, "setupOnStartup"); if (TypeChecker.getType(setupResult).getTag() == TypeTags.ERROR) { + started = false; return setupResult; } PrintStream console = System.err; console.println("[ballerina/websub] Ballerina WebSub Hub started up.\n[ballerina/websub] Publish URL:" + " " + publishUrl + "\n[ballerina/websub] Subscription URL: " + subscribeUrl); - started = true; setPublishUrl(publishUrl); setSubscribeUrl(subscribeUrl); From ac88d6a84a4a65e42867cc74c9035ca506fbd5d9 Mon Sep 17 00:00:00 2001 From: Nipuna Marcus Date: Tue, 29 Oct 2019 15:33:37 +0530 Subject: [PATCH 117/167] Add preserve whitespace flag to compiler on build --- .../main/java/org/ballerinalang/packerina/cmd/BuildCommand.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java index 0cbaf3a7d924..5ef2481e3754 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/BuildCommand.java @@ -56,6 +56,7 @@ import static org.ballerinalang.compiler.CompilerOptionName.EXPERIMENTAL_FEATURES_ENABLED; import static org.ballerinalang.compiler.CompilerOptionName.LOCK_ENABLED; import static org.ballerinalang.compiler.CompilerOptionName.OFFLINE; +import static org.ballerinalang.compiler.CompilerOptionName.PRESERVE_WHITESPACE; import static org.ballerinalang.compiler.CompilerOptionName.PROJECT_DIR; import static org.ballerinalang.compiler.CompilerOptionName.SKIP_TESTS; import static org.ballerinalang.compiler.CompilerOptionName.TEST_ENABLED; @@ -362,6 +363,7 @@ public void execute() { options.put(SKIP_TESTS, Boolean.toString(this.skipTests)); options.put(TEST_ENABLED, "true"); options.put(EXPERIMENTAL_FEATURES_ENABLED, Boolean.toString(this.experimentalFlag)); + options.put(PRESERVE_WHITESPACE, "true"); // create builder context BuildContext buildContext = new BuildContext(this.sourceRootPath, targetPath, sourcePath, compilerContext); buildContext.setOut(outStream); From 5ffc64a5a70a08de30f9396ee6f6140e07f17c5b Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Tue, 29 Oct 2019 15:33:49 +0530 Subject: [PATCH 118/167] Review HTTP-Related BBEs --- .../http-disable-chunking/http_disable_chunking.bal | 10 +++++----- .../http_disable_chunking.client.out | 4 ++-- .../http_disable_chunking.description | 2 +- .../http_disable_chunking.server.out | 2 +- examples/https-listener/https_listener.bal | 2 +- examples/https-listener/https_listener.client.out | 2 +- examples/https-listener/https_listener.server.out | 2 +- examples/mutual-ssl/mutual_ssl.description | 2 +- examples/mutual-ssl/mutual_ssl_service.bal | 4 ++-- examples/mutual-ssl/mutual_ssl_service.out | 2 +- examples/mutual-ssl/ssl_client.bal | 4 ++-- examples/mutual-ssl/ssl_client.out | 2 +- .../restrict-by-media-type/restrict_by_media_type.bal | 10 +++++----- .../restrict_by_media_type.client.out | 10 +++++----- .../restrict_by_media_type.description | 2 +- .../restrict_by_media_type.server.out | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/examples/http-disable-chunking/http_disable_chunking.bal b/examples/http-disable-chunking/http_disable_chunking.bal index 02c4762fba75..4acd0c3462c8 100644 --- a/examples/http-disable-chunking/http_disable_chunking.bal +++ b/examples/http-disable-chunking/http_disable_chunking.bal @@ -2,7 +2,7 @@ import ballerina/http; import ballerina/log; //The HTTP client's chunking behaviour can be configured as auto, always, or never. -//In this example, it is set to as never, which means that chunking never happens irrespective of how it is specified +//In this example, it is set to never, which means that chunking never happens irrespective of how it is specified //in the request. When chunking is set to auto, chunking is done as specified in the request. http:Client clientEndpoint = new("http://localhost:9090", @@ -13,14 +13,14 @@ service chunkingSample on new http:Listener(9092) { @http:ResourceConfig { path: "/" } - //Parameters include a reference to the caller endpoint and an object with the request data. + //Parameters include a reference to the caller endpoint and an object containing the request data. resource function invokeEndpoint(http:Caller caller, http:Request req) { //Create a new outbound request and set the payload. http:Request newReq = new; newReq.setPayload({ "name": "Ballerina" }); var clientResponse = clientEndpoint->post("/echo/", newReq); if (clientResponse is http:Response) { - //send the response back to the caller. + //Send the response back to the caller. var result = caller->respond(clientResponse); if (result is error) { log:printError("Error sending response", err = result); @@ -37,7 +37,7 @@ service chunkingSample on new http:Listener(9092) { } } -// A sample backend that responds according to chunking behaviour. +// A sample backend, which responds according to the chunking behaviour. service echo on new http:Listener(9090) { @http:ResourceConfig { path: "/" @@ -66,7 +66,7 @@ service echo on new http:Listener(9090) { } if (!validationErrorFound) { - // Since there is no validation error, mark the `value` as trusted data and set to the response. + // Since there is no validation error, mark the `value` as trusted data and set it to the response. res.setPayload({ "Outbound request content": <@untainted> value }); } var result = caller->respond(res); diff --git a/examples/http-disable-chunking/http_disable_chunking.client.out b/examples/http-disable-chunking/http_disable_chunking.client.out index 90c7588ac5d4..a8168107a2a1 100644 --- a/examples/http-disable-chunking/http_disable_chunking.client.out +++ b/examples/http-disable-chunking/http_disable_chunking.client.out @@ -1,6 +1,6 @@ -Run this curl command to use the client. +To use the client, execute the below cURL command. $ curl http://localhost:9092/chunkingSample {"Outbound request content":"Length-20"} -To enable chunking, change the chunking option of the `clientEndpoint` in the `.bal` file, to `http:CHUNKING_ALWAYS`. +To enable chunking, change the chunking option of the `clientEndpoint` in the `.bal` file to `http:CHUNKING_ALWAYS`. {"Outbound request content":"chunked"} diff --git a/examples/http-disable-chunking/http_disable_chunking.description b/examples/http-disable-chunking/http_disable_chunking.description index c7bdf1dd6287..d7722d2a6e78 100644 --- a/examples/http-disable-chunking/http_disable_chunking.description +++ b/examples/http-disable-chunking/http_disable_chunking.description @@ -1,2 +1,2 @@ -//This sample demonstrates how to change the chunking behavior of a Ballerina HTTP client endpoint. By default, the HTTP client sends content-length messages. +//This sample demonstrates how to change the chunking behavior of a Ballerina HTTP client endpoint. By default, the HTTP client sends messages of the length of the content. //If the message size is larger than the buffer size (8K), messages are chunked. Chunking can be disabled using the connector options. diff --git a/examples/http-disable-chunking/http_disable_chunking.server.out b/examples/http-disable-chunking/http_disable_chunking.server.out index 1fe7dea514fc..1141daad1edd 100644 --- a/examples/http-disable-chunking/http_disable_chunking.server.out +++ b/examples/http-disable-chunking/http_disable_chunking.server.out @@ -1,5 +1,5 @@ # To start the services, navigate to the directory that contains the -# `.bal` file and use the `ballerina run` command. +# `.bal` file and execute the `ballerina run` command. $ ballerina run http_disable_chunking.bal # Service deployment [ballerina/http] started HTTP/WS listener 0.0.0.0:9090 diff --git a/examples/https-listener/https_listener.bal b/examples/https-listener/https_listener.bal index c7fac2849bc0..81427a6afd68 100644 --- a/examples/https-listener/https_listener.bal +++ b/examples/https-listener/https_listener.bal @@ -3,7 +3,7 @@ import ballerina/log; // An HTTP endpoint can be configured to communicate through HTTPS as well. // To secure an endpoint using HTTPS, the endpoint needs to be configured with -// a keystore a certificate and private key for the endpoint. +// a keystore, a certificate, and a private key for the endpoint. http:ListenerConfiguration helloWorldEPConfig = { secureSocket: { keyStore: { diff --git a/examples/https-listener/https_listener.client.out b/examples/https-listener/https_listener.client.out index ad5579b0d95d..10d304661142 100644 --- a/examples/https-listener/https_listener.client.out +++ b/examples/https-listener/https_listener.client.out @@ -1,3 +1,3 @@ -#Run this curl command with the `-k` option to invoke the service. +# To invoke the service, execute the below cURL command with the `-k` option. $ curl -k https://localhost:9095/hello Hello World! diff --git a/examples/https-listener/https_listener.server.out b/examples/https-listener/https_listener.server.out index a2df5f8ceb0a..bec1c8242f37 100644 --- a/examples/https-listener/https_listener.server.out +++ b/examples/https-listener/https_listener.server.out @@ -1,4 +1,4 @@ # To start the service, navigate to the directory that contains the -# `.bal` file and use the `ballerina run` command. +# `.bal` file and execute the `ballerina run` command. $ ballerina run https_listener.bal [ballerina/http] started HTTPS/WSS listener 0.0.0.0:9095 diff --git a/examples/mutual-ssl/mutual_ssl.description b/examples/mutual-ssl/mutual_ssl.description index ac096d1393ca..2425020051b1 100644 --- a/examples/mutual-ssl/mutual_ssl.description +++ b/examples/mutual-ssl/mutual_ssl.description @@ -1,3 +1,3 @@ -//Ballerina supports mutual SSL, which is a certificate based authentication process where two parties (client and +//Ballerina supports mutual SSL, which is a certificate-based authentication process where two parties (client and //server) authenticate each other by verifying the digital certificates. It ensures that both parties are assured of //each other's identity. diff --git a/examples/mutual-ssl/mutual_ssl_service.bal b/examples/mutual-ssl/mutual_ssl_service.bal index e4bbeaac3114..68830896dcaf 100644 --- a/examples/mutual-ssl/mutual_ssl_service.bal +++ b/examples/mutual-ssl/mutual_ssl_service.bal @@ -13,7 +13,7 @@ http:ListenerConfiguration helloWorldEPConfig = { path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", password: "ballerina" }, - // Configure the preferred SSL protocol and the versions to enable. + // Configure the preferred SSL protocol and the versions to enable the HTTP Listener. protocol: { name: "TLS", versions: ["TLSv1.2", "TLSv1.1"] @@ -39,7 +39,7 @@ service helloWorld on helloWorldEP { path: "/" } resource function sayHello(http:Caller caller, http:Request req) { - // Send response to the caller. + // Send the response to the caller. var result = caller->respond("Successful"); if (result is error) { log:printError("Error in responding", err = result); diff --git a/examples/mutual-ssl/mutual_ssl_service.out b/examples/mutual-ssl/mutual_ssl_service.out index 7e8f6cf52359..b7007e4ffc19 100644 --- a/examples/mutual-ssl/mutual_ssl_service.out +++ b/examples/mutual-ssl/mutual_ssl_service.out @@ -1,4 +1,4 @@ # To start the service, navigate to the directory that contains the -# `.bal` file and use the `ballerina run` command. +# `.bal` file and execute the `ballerina run` command. $ ballerina run mutual_ssl_service.bal [ballerina/http] started HTTPS/WSS listener 0.0.0.0:9095 diff --git a/examples/mutual-ssl/ssl_client.bal b/examples/mutual-ssl/ssl_client.bal index d2d3afb9481a..d669df3a43a4 100644 --- a/examples/mutual-ssl/ssl_client.bal +++ b/examples/mutual-ssl/ssl_client.bal @@ -3,7 +3,7 @@ import ballerina/log; // Create a client configuration to be passed to the client endpoint. // Configure the `keyStoreFile`, `keyStorePassword`, `trustStoreFile`, and -// The`trustStorePassword`, which is required to enable mutual SSL. +// the`trustStorePassword`, which are required to enable mutual SSL. http:ClientConfiguration clientEPConfig = { secureSocket: { keyStore: { @@ -39,7 +39,7 @@ public function main() { log:printError(payload.detail()["message"]); } } else { - // If an error occurs when getting the response, log the error. + // If an error occurs while getting the response, log the error. log:printError(resp.detail()["message"]); } } diff --git a/examples/mutual-ssl/ssl_client.out b/examples/mutual-ssl/ssl_client.out index 745adab30951..f8cbecd5f509 100644 --- a/examples/mutual-ssl/ssl_client.out +++ b/examples/mutual-ssl/ssl_client.out @@ -1,4 +1,4 @@ # To start the service, navigate to the directory that contains the -# `.bal` file and use the `ballerina run` command. +# `.bal` file and execute the `ballerina run` command. $ ballerina run ssl_client.bal INFO [] - Successful diff --git a/examples/restrict-by-media-type/restrict_by_media_type.bal b/examples/restrict-by-media-type/restrict_by_media_type.bal index 58414e391299..5d833dadfb7f 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.bal +++ b/examples/restrict-by-media-type/restrict_by_media_type.bal @@ -3,8 +3,8 @@ import ballerina/log; service infoService on new http:Listener(9092) { // The `consumes` and `produces` annotations contain MIME types as an - // array of strings. The resource can consume/accept `text/json` and - // `application/json` media types only. Therefore, the `Content-Type` header + // array of strings. The resource can consume/accept only the `text/json` and + // `application/json` media types. Therefore, the `Content-Type` header // of the request must be in one of these two types. The resource can produce // `application/xml` payloads. Therefore, you need to set the `Accept` header accordingly. @http:ResourceConfig { @@ -14,13 +14,13 @@ service infoService on new http:Listener(9092) { produces: ["application/xml"] } resource function student(http:Caller caller, http:Request req) { - // Get JSON payload from the request message. + // Get the JSON payload from the request message. http:Response res = new; var msg = req.getJsonPayload(); if (msg is json) { - // Get the `string` value that is relevant to the key "name". + // Get the `string` value, which is relevant to the key "name". string nameString = msg.name; - // Create XML payload and send back a response. + // Create the XML payload and send back a response. xml name = xml `${nameString}`; res.setXmlPayload(<@untained> name); } else { diff --git a/examples/restrict-by-media-type/restrict_by_media_type.client.out b/examples/restrict-by-media-type/restrict_by_media_type.client.out index 836b7bd1b5d8..f58508d0ed6d 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.client.out +++ b/examples/restrict-by-media-type/restrict_by_media_type.client.out @@ -1,4 +1,4 @@ -# To invoke the service, use the following client. +# To invoke the service, execute the following client. $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Content-Type:application/json" -d '{"name":"Ballerina"}' # The server response. < HTTP/1.1 200 OK @@ -8,8 +8,8 @@ $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Cont * Connection #0 to host localhost left intact Ballerina -# Use the following client to invoke the service using unsupported media type. The Content type of the -# request is not listed under consumes resource configuration. +# To invoke the service using unsupported media type, execute the following client. The Content type of the +# request is not listed under the consumer's resource configuration. $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Content-Type:text/plain" -d "Hello ballerina" # The server response. < HTTP/1.1 415 Unsupported Media Type @@ -18,8 +18,8 @@ $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Cont < * Connection #0 to host localhost left intact -# Use the following client to invoke the service with a media type that is not acceptable. The media type mentioned -# in the Accept header is not listed under produces resource configuration. +# To invoke the service with a media type that is not acceptable, execute the following client. The media type mentioned +# in the Accept header is not listed under the producer's resource configuration. $ curl -v http://localhost:9092/infoService -H "Accept:text/html" -H "Content-Type:application/json" -d '{"name":"Ballerina"}' # The server response. < HTTP/1.1 406 Not Acceptable diff --git a/examples/restrict-by-media-type/restrict_by_media_type.description b/examples/restrict-by-media-type/restrict_by_media_type.description index 2e9f3b437b7f..e366b2970e08 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.description +++ b/examples/restrict-by-media-type/restrict_by_media_type.description @@ -1,2 +1,2 @@ -// You can configure resources of HTTP services to restrict the types of media it consumes and produces. +// You can configure resources of HTTP services to restrict the types of media they consume and produce. // This is done through the 'consumes' and 'produces' annotation attributes of the ResourceConfig annotation, which is used with resources. diff --git a/examples/restrict-by-media-type/restrict_by_media_type.server.out b/examples/restrict-by-media-type/restrict_by_media_type.server.out index 0849623b7572..a0961179498a 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.server.out +++ b/examples/restrict-by-media-type/restrict_by_media_type.server.out @@ -1,5 +1,5 @@ # To start the service, navigate to the directory that contains the -# `.bal` file and use the `ballerina run` command. +# `.bal` file and execute the `ballerina run` command. $ ballerina run restrict_by_media_type.bal # Service deployment [ballerina/http] started HTTP/WS listener 0.0.0.0:9092 From 55eebfca92135ed54458f66b1ef96440b14fc372 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Wed, 30 Oct 2019 09:36:24 +0530 Subject: [PATCH 119/167] Refactor testerina to use module class loader --- .../packerina/task/RunTestsTask.java | 7 +++--- .../testerina/util/TestarinaClassLoader.java | 22 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunTestsTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunTestsTask.java index 2dd1edde2f12..e5cefb1b4c9c 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunTestsTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunTestsTask.java @@ -29,8 +29,8 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -69,9 +69,8 @@ public void execute(BuildContext buildContext) { jarPath = modulejarPath; } String modulejarName = modulejarPath != null ? modulejarPath.toString() : ""; - TestarinaClassLoader classLoader = new TestarinaClassLoader(jarPath, - Paths.get(sourceRootPath.toString(), "target", "tmp").toFile(), - modulejarName); + HashSet dependencyJarPaths = buildContext.moduleDependencyPathMap.get(bLangPackage.packageID); + TestarinaClassLoader classLoader = new TestarinaClassLoader(jarPath, dependencyJarPaths, modulejarName); programFileMap.put(bLangPackage, classLoader); } // Create a class loader to diff --git a/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java b/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java index 4337004166b1..214080f8ec10 100644 --- a/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java +++ b/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java @@ -20,12 +20,12 @@ import org.ballerinalang.compiler.BLangCompilerException; -import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Path; -import java.nio.file.Paths; +import java.util.Arrays; +import java.util.HashSet; import java.util.StringJoiner; @@ -38,23 +38,17 @@ public class TestarinaClassLoader { private URLClassLoader cl; - public TestarinaClassLoader(Path testJarPath, File importsCache, String skip) { + public TestarinaClassLoader(Path testJarPath, HashSet dependencyJarPaths, String skip) { try { int index = 0; URL[] jars; - if (importsCache.isDirectory()) { - String[] jarFIles = importsCache.list(); - jars = new URL[jarFIles.length + 1]; - for (String file : jarFIles) { - if (file.contains(skip)) { - continue; - } - jars[index++] = Paths.get(importsCache.getPath(), file).toUri().toURL(); + jars = new URL[dependencyJarPaths.size() + 1]; + for (Path file : dependencyJarPaths) { + if (file == null || file.getFileName().toString().contains(skip)) { + continue; } - } else { - jars = new URL[1]; + jars[index++] = file.toUri().toURL(); } - jars[index] = testJarPath.toFile().toURI().toURL(); cl = new URLClassLoader(jars); } catch (MalformedURLException e) { From af3d44e25f490f9e8ac7b30f5c6011178a315b7c Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Wed, 30 Oct 2019 09:37:26 +0530 Subject: [PATCH 120/167] Add tests to class loading fix --- .../packaging/PathDependencyTestCase.java | 43 +++++++++++++++-- .../case4/TestProject1/Ballerina.toml | 8 ++++ .../case4/TestProject1/src/bee/utils.bal | 31 +++++++++++++ .../case4/TestProject3/Ballerina.toml | 2 +- .../TestProject1/src/foo/tests/main_test.bal | 46 +++++++++++++++++++ .../packaging/balopath/case8/interop_file.bal | 10 ++++ .../ballerina-internal.log.lck | 0 7 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/src/bee/utils.bal create mode 100644 tests/jballerina-integration-test/src/test/resources/packaging/balopath/case7/TestProject1/src/foo/tests/main_test.bal create mode 100644 tests/jballerina-integration-test/src/test/resources/packaging/balopath/case8/interop_file.bal create mode 100644 tests/jballerina-unit-test/ballerina-internal.log.lck diff --git a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java index fd7b24594658..3a8ea146a2e9 100644 --- a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java +++ b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java @@ -45,6 +45,7 @@ import static org.ballerinalang.test.packaging.PackerinaTestUtils.deleteFiles; import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_COMPILED_JAR_EXT; import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_COMPILED_PKG_BINARY_EXT; +import static org.wso2.ballerinalang.compiler.util.ProjectDirConstants.BLANG_SOURCE_EXT; /** * Test cases related to solving dependencies using paths in Ballerina.toml. @@ -55,6 +56,7 @@ public class PathDependencyTestCase extends BaseTest { private Map envVariables; private BMainInstance balClient; private String orgName = "bcintegrationtest"; + private String beeModuleName = "bee" + PackerinaTestUtils.randomModuleName(10); @BeforeClass() public void setUp() throws IOException, BallerinaTestException { @@ -200,14 +202,13 @@ public void testBaloPathCase4() throws BallerinaTestException, IOException { Path caseResources = tempTestResources.resolve("case4"); // Build bee module of TestProject1 //// change module name - String beeModuleName = "bee" + PackerinaTestUtils.randomModuleName(10); Path testProjBeeModulePath = caseResources.resolve("TestProject1").resolve("src").resolve(beeModuleName); Files.createDirectories(caseResources.resolve("TestProject1").resolve("src").resolve(beeModuleName)); copyFolder(caseResources.resolve("TestProject1").resolve("src").resolve("bee"), testProjBeeModulePath); deleteFiles(caseResources.resolve("TestProject1").resolve("src").resolve("bee")); - String beeModuleBaloFileName = beeModuleName + "-" + ProgramFileConstants.IMPLEMENTATION_VERSION + "-any-1.2.0" - + BLANG_COMPILED_PKG_BINARY_EXT; + String beeModuleBaloFileName = beeModuleName + "-" + ProgramFileConstants.IMPLEMENTATION_VERSION + "-java8-1" + + ".2.0" + BLANG_COMPILED_PKG_BINARY_EXT; String module1BuildMsg = "target" + File.separator + "balo" + File.separator + beeModuleBaloFileName; LogLeecher beeModuleBuildLeecher = new LogLeecher(module1BuildMsg); @@ -443,6 +444,42 @@ public void testBaloPathCase7() throws BallerinaTestException { bazRunLeecher.waitForText(10000); } + /** + * Case8: Build the utils single bal file which is using previusly pushed utils module with interop jar. + * Then run the jar. + * + * @throws BallerinaTestException Error when executing the commands. + */ + @Test(description = "Case8: Test single bal file using external module with interop dependency", + dependsOnMethods = "testBaloPathCase7") + public void testBaloSingleBalFileCase8() throws BallerinaTestException, IOException { + + Path caseResources = tempTestResources.resolve("case8"); + + String interopFileName = "interop_file"; + String interopBalFileName = interopFileName + BLANG_SOURCE_EXT; + String interopBalJarFileName = interopFileName + BLANG_COMPILED_JAR_EXT; + //// replace import + Path feeBalPath = caseResources.resolve(interopBalFileName); + Stream lines = Files.lines(feeBalPath); + List replaced = lines.map(line -> line.replaceAll("bee", beeModuleName)) + .collect(Collectors.toList()); + Files.write(feeBalPath, replaced); + + String testMsg = "Tested utils getString method using interop and received: This is a test string value !!!"; + LogLeecher fileBuildLeecher = new LogLeecher(interopBalJarFileName); + LogLeecher fileTestLeecher = new LogLeecher(testMsg); + balClient.runMain("build", new String[]{interopBalFileName}, envVariables, new String[]{}, + new LogLeecher[]{fileBuildLeecher, fileTestLeecher}, caseResources.toString()); + fileBuildLeecher.waitForText(5000); + + String msg = "This is a test string value !!!"; + + LogLeecher bazRunLeecher = new LogLeecher(msg); + balClient.runMain("run", new String[]{interopBalJarFileName}, envVariables, new String[0], + new LogLeecher[]{bazRunLeecher}, caseResources.toString()); + bazRunLeecher.waitForText(10000); + } /** * Get environment variables and add ballerina_home as a env variable the tmp directory. diff --git a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/Ballerina.toml b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/Ballerina.toml index 6cdbdb10bf3d..eea8526ce6de 100644 --- a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/Ballerina.toml +++ b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/Ballerina.toml @@ -1,3 +1,11 @@ [project] org-name = "bcintegrationtest" version = "1.2.0" + +[platform] +target = "java8" + + [[platform.libraries]] + artifactId = "utils" + path = "./utils-lib/utils.jar" + groupId = "wso2" diff --git a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/src/bee/utils.bal b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/src/bee/utils.bal new file mode 100644 index 000000000000..b9369a023da8 --- /dev/null +++ b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/src/bee/utils.bal @@ -0,0 +1,31 @@ +import ballerinax/java; + +// Interop functions +public function acceptNothingAndReturnNothing() = @java:Method { + class:"org.wso2.test.StaticMethods" +} external; + +public function interopFunctionWithDifferentName() = @java:Method { + class:"org.wso2.test.StaticMethods", + name:"acceptNothingAndReturnNothing" +} external; + +public function acceptNothingButReturnDate() returns handle = @java:Method { + class:"org.wso2.test.StaticMethods" +} external; + +public function acceptSomethingAndReturnSomething(handle h) returns handle = @java:Method { + class:"org.wso2.test.StaticMethods" +} external; + +public function acceptTwoParamsAndReturnSomething(handle h1, handle h2) returns handle = @java:Method { + class:"org.wso2.test.StaticMethods" +} external; + +public function acceptThreeParamsAndReturnSomething(handle h1, handle h2, handle h3) returns handle = @java:Method { + class:"org.wso2.test.StaticMethods" +} external; + +public function getString() returns handle = @java:Method { + class:"org.wso2.test.StaticMethods" +} external; \ No newline at end of file diff --git a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject3/Ballerina.toml b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject3/Ballerina.toml index f3a96af8c2ce..2608d9ef0601 100644 --- a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject3/Ballerina.toml +++ b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject3/Ballerina.toml @@ -3,4 +3,4 @@ org-name = "jaz" version = "2.5.0" [dependencies] -#"bcintegrationtest/bee" = { path = "../TestProject1/target/balo/bee-2019r3-any-1.2.0.balo"} \ No newline at end of file +#"bcintegrationtest/bee" = { path = "../TestProject1/target/balo/bee-2019r3-java8-1.2.0.balo"} diff --git a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case7/TestProject1/src/foo/tests/main_test.bal b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case7/TestProject1/src/foo/tests/main_test.bal new file mode 100644 index 000000000000..8bf451b464ed --- /dev/null +++ b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case7/TestProject1/src/foo/tests/main_test.bal @@ -0,0 +1,46 @@ +import ballerina/io; +import ballerina/test; +import wso2/utils; +import ballerinax/java; + +function testAcceptNothingButReturnString() returns handle { + return utils:getString(); +} + +# Before Suite Function + +@test:BeforeSuite +function beforeSuiteFunc() { + io:println("I'm the before suite function!"); +} + +# Before test function + +function beforeFunc() { + io:println("I'm the before function!"); +} + +# Test function + +@test:Config { + before: "beforeFunc", + after: "afterFunc" +} +function testFunction() { + string result = java:toString(testAcceptNothingButReturnString()); + test:assertEquals(result, "This is a test string value !!!", msg = "Interop method call failed!"); + io:println("Tested utils getString method using interop and received: " + result); +} + +# After test function + +function afterFunc() { + io:println("I'm the after function!"); +} + +# After Suite Function + +@test:AfterSuite +function afterSuiteFunc() { + io:println("I'm the after suite function!"); +} diff --git a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case8/interop_file.bal b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case8/interop_file.bal new file mode 100644 index 000000000000..daba72d2ae72 --- /dev/null +++ b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case8/interop_file.bal @@ -0,0 +1,10 @@ +import bcintegrationtest/bee; +import ballerina/io; + +function testAcceptNothingButReturnString() returns handle { + return bee:getString(); +} + +public function main() { + io:println(testAcceptNothingButReturnString()); +} diff --git a/tests/jballerina-unit-test/ballerina-internal.log.lck b/tests/jballerina-unit-test/ballerina-internal.log.lck new file mode 100644 index 000000000000..e69de29bb2d1 From 377e6a6f8a4a808837e4d785d07a7f14501f655b Mon Sep 17 00:00:00 2001 From: Hemika Kodikara Date: Thu, 24 Oct 2019 10:36:46 +0530 Subject: [PATCH 121/167] add cmd field for kubernetes annotation defs --- .../main/ballerina/src/kubernetes/annotation.bal | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal b/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal index 45498e2e9ebf..5ab2a7857a49 100644 --- a/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal +++ b/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal @@ -144,18 +144,18 @@ public type PodTolerationConfiguration record {| # Kubernetes deployment configuration. # -# + dockerHost - Docker host IP and docker PORT. ( e.g minikube IP and docker PORT). +# + dockerHost - Docker host IP and docker PORT. (e.g minikube IP and docker PORT). # Default is to use DOCKER_HOST environment variable. # If DOCKER_HOST is unavailable, use `"unix:///var/run/docker.sock"` for Unix or use `"npipe:////./pipe/docker_engine"` for Windows 10 or use `"localhost:2375"`. # + dockerCertPath - Docker certificate path. Default is "DOCKER_CERT_PATH" environment variable. # + registry - Docker registry url. # + username - Username for docker registry. # + password - Password for docker registry. -# + baseImage - Base image for docker image building. Default value is `"ballerina/ballerina-runtime:"`. -# Use `"ballerina/ballerina-runtime:latest"` to use the latest stable ballerina runtime docker image. +# + baseImage - Base image to create the docker image. Default value is `"openjdk:8-jre-alpine"`. # + image - Docker image name with tag. Default is `":latest"`. If field `registry` is set then it will be prepended to the docker image name as `/:latest`. # + buildImage - Docker image to be build or not. Default is `true`. # + push - Enable pushing docker image to registry. Field `buildImage` must be set to `true` to be effective. Default value is `false`. +# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar [--b7a.config.file=] [--debug]`. # + copyFiles - Array of [External files](kubernetes#FileConfig) for docker image. # + singleYAML - Generate a single yaml file with all kubernetes artifacts (services, deployment, ingress and etc). Default is `true`. # + namespace - Kubernetes namespace to be used on all artifacts. @@ -180,6 +180,7 @@ public type DeploymentConfiguration record {| string image?; boolean buildImage = true; boolean push = false; + string cmd?; FileConfig[] copyFiles?; boolean singleYAML = true; string namespace?; @@ -366,18 +367,18 @@ public type RestartPolicy "OnFailure"|"Always"|"Never"; # Kubernetes job configuration. # -# + dockerHost - Docker host IP and docker PORT. ( e.g minikube IP and docker PORT). +# + dockerHost - Docker host IP and docker PORT. (e.g minikube IP and docker PORT). # Default is to use DOCKER_HOST environment variable. # If DOCKER_HOST is unavailable, use `"unix:///var/run/docker.sock"` for Unix or use `"npipe:////./pipe/docker_engine"` for Windows 10 or use `"localhost:2375"`. # + dockerCertPath - Docker certificate path. Default is "DOCKER_CERT_PATH" environment variable. # + registry - Docker registry url. # + username - Username for docker registry. # + password - Password for docker registry. -# + baseImage - Base image for docker image building. Default value is `"ballerina/ballerina-runtime:"`. -# Use `"ballerina/ballerina-runtime:latest"` to use the latest stable ballerina runtime docker image. +# + baseImage - Base image to create the docker image. Default value is `"openjdk:8-jre-alpine"`. # + image - Docker image name with tag. Default is `":latest"`. If field `registry` is set then it will be prepended to the docker image name as `/:latest`. # + buildImage - Docker image to be build or not. Default is `true`. # + push - Enable pushing docker image to registry. Field `buildImage` must be set to `true`. Default value is `false`. +# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar [--b7a.config.file=] [--debug]`. # + copyFiles - Array of [External files](kubernetes#FileConfig) for docker image. # + singleYAML - Generate a single yaml file with all kubernetes artifacts (ingress, configmaps, secrets and etc). Default is `true`. # + namespace - Kubernetes namespace to be used on all artifacts. @@ -399,6 +400,7 @@ public type JobConfig record {| string image?; boolean buildImage = true; boolean push = false; + string cmd?; FileConfig[] copyFiles?; boolean singleYAML = true; string namespace?; From 3ef9a4ad57cbfb1cd6b19a9c7ef25ecf4635c0c8 Mon Sep 17 00:00:00 2001 From: Hemika Kodikara Date: Fri, 18 Oct 2019 10:58:40 +0530 Subject: [PATCH 122/167] add cmd field for docker annotation --- .../docker/src/main/ballerina/src/docker/annotation.bal | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stdlib/docker/src/main/ballerina/src/docker/annotation.bal b/stdlib/docker/src/main/ballerina/src/docker/annotation.bal index 16f1ad06f287..a27ed24f0898 100644 --- a/stdlib/docker/src/main/ballerina/src/docker/annotation.bal +++ b/stdlib/docker/src/main/ballerina/src/docker/annotation.bal @@ -17,18 +17,18 @@ # Docker annotation configuration. # # + registry - Docker registry url. -# + name - Name of the docker image. Default value is the file name of the generated balx file. +# + name - Name of the docker image. Default value is the file name of the executable .jar file. # + tag - Docker image tag. Default value is `"latest"`. # + username - Username for docker registry. # + password - Password for docker registry. -# + baseImage - Base image to create the docker image. Default value is `"ballerina/ballerina-runtime:"`. -# Use `"ballerina/ballerina-runtime:latest"` to use the latest stable ballerina runtime docker image. +# + baseImage - Base image to create the docker image. Default value is `"openjdk:8-jre-alpine"`. # + buildImage - Enable building docker image. Default value is `true`. # + push - Enable pushing docker image to registry. Field `buildImage` must be set to `true` to be effective. Default value is `false`. +# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar [--b7a.config.file=] [--debug]`. # + enableDebug - Enable ballerina debug. Default is `false`. # + debugPort - Ballerina remote debug port. Default is `5005`. # + dockerAPIVersion - Docker API version. -# + dockerHost - Docker host IP and docker PORT. ( e.g minikube IP and docker PORT). +# + dockerHost - Docker host IP and docker PORT. (e.g minikube IP and docker PORT). # Default is to use DOCKER_HOST environment variable. # If DOCKER_HOST is unavailable, use `"unix:///var/run/docker.sock"` for Unix or use `"npipe:////./pipe/docker_engine"` for Windows 10 or use `"localhost:2375"`. # + dockerCertPath - Docker certificate path. Default is to use `"DOCKER_CERT_PATH"` environment variable. @@ -41,6 +41,7 @@ public type DockerConfiguration record {| string baseImage?; boolean buildImage = true; boolean push = false; + string cmd?; boolean enableDebug = false; int debugPort = 5005; string dockerAPIVersion?; From 991ec5e6df1c86067e8f92ced4c1b2169dc9f1c0 Mon Sep 17 00:00:00 2001 From: kavindu Date: Wed, 23 Oct 2019 12:30:11 +0530 Subject: [PATCH 123/167] Add multiple versions support --- .../util/diagnostic/DiagnosticCode.java | 1 - .../ballerinalang/compiler/PackageLoader.java | 71 +- .../compiler/parser/BLangPackageBuilder.java | 5 +- .../compiler/parser/BLangParserListener.java | 2 +- .../parser/antlr4/BallerinaLexer.java | 2561 +++---- .../parser/antlr4/BallerinaLexer.tokens | 171 +- .../parser/antlr4/BallerinaParser.java | 6276 +++++++++-------- .../parser/antlr4/BallerinaParser.tokens | 171 +- .../antlr4/BallerinaParserBaseListener.java | 14 +- .../antlr4/BallerinaParserListener.java | 12 +- .../semantics/analyzer/SymbolEnter.java | 43 +- .../compiler/tree/BLangImportPackage.java | 4 +- .../src/main/resources/compiler.properties | 3 - .../main/resources/grammar/BallerinaLexer.g4 | 4 + .../main/resources/grammar/BallerinaParser.g4 | 8 +- .../ballerinalang/test/util/BCompileUtil.java | 2 + .../ballerinalang/test/util/BFileUtil.java | 20 + .../test/balo/imports/ImportsTests.java | 139 + .../balo/imports/test-case1/Ballerina.toml | 5 + .../imports/test-case1/src/testCase1/main.bal | 21 + .../balo/imports/test-case2/Ballerina.toml | 6 + .../imports/test-case2/src/testCase2/main.bal | 21 + .../balo/imports/test-case3/Ballerina.lock | 9 + .../balo/imports/test-case3/Ballerina.toml | 6 + .../imports/test-case3/src/testCase3/main.bal | 21 + .../test-src/balo/imports/test-case4/main.bal | 21 + .../test-src/balo/imports/test-case5/main.bal | 21 + .../test_module1/test_module/Ballerina.toml | 5 + .../test_module/src/testModule/calculate.bal | 19 + .../test_module2/test_module/Ballerina.toml | 5 + .../test_module/src/testModule/calculate.bal | 19 + .../test_module3/test_module/Ballerina.toml | 5 + .../test_module/src/testModule/calculate.bal | 19 + 33 files changed, 5083 insertions(+), 4627 deletions(-) create mode 100644 tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/Ballerina.toml create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/src/testCase1/main.bal create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/Ballerina.toml create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/src/testCase2/main.bal create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.lock create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.toml create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/src/testCase3/main.bal create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case4/main.bal create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case5/main.bal create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/Ballerina.toml create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/src/testModule/calculate.bal create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/Ballerina.toml create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/src/testModule/calculate.bal create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/Ballerina.toml create mode 100644 tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/src/testModule/calculate.bal diff --git a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java index c26e1b003a47..87c29e2fc587 100644 --- a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java +++ b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/diagnostic/DiagnosticCode.java @@ -465,7 +465,6 @@ public enum DiagnosticCode { // Type Param related error codes. TYPE_PARAM_OUTSIDE_LANG_MODULE("type.param.outside.lang.module"), - VERSIONED_IMPORT_NOT_SUPPORTED("versioned.import.not.supported"), INVALID_INVOCATION_LVALUE_ASSIGNMENT("invalid.lvalue.lhs.of.assignment"), INVALID_INVOCATION_LVALUE_COMPOUND_ASSIGNMENT("invalid.lvalue.lhs.of.compound.assignment"), diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java index 47b4801bea69..a94d3c076073 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java @@ -303,55 +303,56 @@ private Resolution resolveModuleByPath(PackageID moduleID) { * 2. If a version is available on the Ballerina.toml * 3. If a version is available in the Ballerina.toml of the enclosing module's balo. * - * @param moduleID The ID of the module. + * @param moduleID The ID of the module. * @param enclPackageId The ID of the parent module. */ private void updateModuleIDVersion(PackageID moduleID, PackageID enclPackageId) { String orgName = moduleID.orgName.value; String moduleName = moduleID.name.value; - + String moduleVersion; + // Set the version from the Ballerina.lock file found in the current project. - if (enclPackageId != null && moduleID.version.value.isEmpty() && - this.hasLockFile(Paths.get(this.options.get(PROJECT_DIR)))) { + if (enclPackageId != null && this.hasLockFile(Paths.get(this.options.get(PROJECT_DIR)))) { // Not a top level package or bal if (this.lockFile.getImports().containsKey(enclPackageId.toString())) { List foundBaseImport = lockFile.getImports().get(enclPackageId.toString()); - Optional foundNestedImport = foundBaseImport - .stream() - .filter(nestedImport -> - moduleID.orgName.value.equals(nestedImport.getOrgName()) && - moduleID.name.value.equals(nestedImport.getName())) - .findFirst(); - foundNestedImport.ifPresent(dependencyPkg -> moduleID.version = - new Name(dependencyPkg.getVersion())); + + for (LockFileImport nestedImport : foundBaseImport) { + if (moduleID.orgName.value.equals(nestedImport.getOrgName()) && + moduleID.name.value.equals(nestedImport.getName())) { + moduleID.version = new Name(nestedImport.getVersion()); + return; + } + } } } - + // Set version from the Ballerina.toml of the current project. - if (enclPackageId != null && moduleID.version.value.isEmpty() && null != this.manifest) { - // TODO: make getDependencies return a map - Optional dependency = this.manifest.getDependencies().stream() - .filter(d -> d.getModuleName().equals(moduleName) && d.getOrgName().equals(orgName) && - null != d.getMetadata().getVersion() && - !"*".equals(d.getMetadata().getVersion())) - .findFirst(); - dependency.ifPresent(value -> moduleID.version = new Name(value.getMetadata().getVersion())); + if (enclPackageId != null && this.manifest != null) { + + for (Dependency dependency : this.manifest.getDependencies()) { + if (dependency.getModuleName().equals(moduleName) && dependency.getOrgName().equals(orgName) && + dependency.getMetadata().getVersion() != null && + !"*".equals(dependency.getMetadata().getVersion())) { + moduleID.version = new Name(dependency.getMetadata().getVersion()); + return; + } + } } - + // Set the version from Ballerina.toml found in dependent balos. - if (null != enclPackageId && moduleID.version.value.isEmpty() && this.dependencyManifests.size() > 0 && - this.dependencyManifests.containsKey(enclPackageId)) { - - Optional manifestDependency = this.dependencyManifests.get(enclPackageId).getDependencies() - .stream() - .filter(dep -> dep.getOrgName().equals(moduleID.orgName.value) && - dep.getModuleName().equals(moduleID.name.value) && - null != dep.getMetadata().getVersion() && - !"*".equals(dep.getMetadata().getVersion())) - .findFirst(); - - manifestDependency.ifPresent(dependency -> moduleID.version = - new Name(dependency.getMetadata().getVersion())); + if (enclPackageId != null && this.dependencyManifests.size() > 0 + && this.dependencyManifests.containsKey(enclPackageId)) { + + for (Dependency manifestDependency : this.dependencyManifests.get(enclPackageId).getDependencies()) { + if (manifestDependency.getOrgName().equals(moduleID.orgName.value) && + manifestDependency.getModuleName().equals(moduleID.name.value) && + manifestDependency.getMetadata().getVersion() != null && + !"*".equals(manifestDependency.getMetadata().getVersion())) { + moduleID.version = new Name(manifestDependency.getMetadata().getVersion()); + return; + } + } } } diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java index c9b58dc4255d..ad64b138a9ec 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangPackageBuilder.java @@ -1889,10 +1889,7 @@ void addImportPackageDeclaration(DiagnosticPos pos, List nameComps, String version, String alias) { - // Disabling versioned import until compiler support semvar versioned imports - if (!(version == null || version.isEmpty())) { - this.dlog.error(pos, DiagnosticCode.VERSIONED_IMPORT_NOT_SUPPORTED); - } + BLangImportPackage importDcl = getImportPackage(pos, ws, orgName, nameComps, version, alias); this.compUnit.addTopLevelNode(importDcl); this.imports.add(importDcl); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangParserListener.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangParserListener.java index f58b5061aa97..6348c77ba89e 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangParserListener.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangParserListener.java @@ -179,7 +179,7 @@ public void exitPackageName(BallerinaParser.PackageNameContext ctx) { this.pkgNameComps = new ArrayList<>(); ctx.Identifier().forEach(e -> pkgNameComps.add(e.getText())); - this.pkgVersion = ctx.version() != null ? ctx.version().Identifier().getText() : null; + this.pkgVersion = ctx.version() != null ? ctx.version().versionPattern().getText() : null; } /** diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java index 252a71444d26..f61cc6de9c0d 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java @@ -1,4 +1,4 @@ -// Generated from BallerinaLexer.g4 by ANTLR 4.5.3 +// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.CharStream; @@ -48,28 +48,28 @@ public class BallerinaLexer extends Lexer { COMPOUND_BIT_AND=174, COMPOUND_BIT_OR=175, COMPOUND_BIT_XOR=176, COMPOUND_LEFT_SHIFT=177, COMPOUND_RIGHT_SHIFT=178, COMPOUND_LOGICAL_SHIFT=179, HALF_OPEN_RANGE=180, ANNOTATION_ACCESS=181, DecimalIntegerLiteral=182, HexIntegerLiteral=183, - HexadecimalFloatingPointLiteral=184, DecimalFloatingPointNumber=185, BooleanLiteral=186, - QuotedStringLiteral=187, Base16BlobLiteral=188, Base64BlobLiteral=189, - NullLiteral=190, Identifier=191, XMLLiteralStart=192, StringTemplateLiteralStart=193, - DocumentationLineStart=194, ParameterDocumentationStart=195, ReturnParameterDocumentationStart=196, - WS=197, NEW_LINE=198, LINE_COMMENT=199, VARIABLE=200, MODULE=201, ReferenceType=202, - DocumentationText=203, SingleBacktickStart=204, DoubleBacktickStart=205, - TripleBacktickStart=206, DefinitionReference=207, DocumentationEscapedCharacters=208, - DocumentationSpace=209, DocumentationEnd=210, ParameterName=211, DescriptionSeparator=212, - DocumentationParamEnd=213, SingleBacktickContent=214, SingleBacktickEnd=215, - DoubleBacktickContent=216, DoubleBacktickEnd=217, TripleBacktickContent=218, - TripleBacktickEnd=219, XML_COMMENT_START=220, CDATA=221, DTD=222, EntityRef=223, - CharRef=224, XML_TAG_OPEN=225, XML_TAG_OPEN_SLASH=226, XML_TAG_SPECIAL_OPEN=227, - XMLLiteralEnd=228, XMLTemplateText=229, XMLText=230, XML_TAG_CLOSE=231, - XML_TAG_SPECIAL_CLOSE=232, XML_TAG_SLASH_CLOSE=233, SLASH=234, QNAME_SEPARATOR=235, - EQUALS=236, DOUBLE_QUOTE=237, SINGLE_QUOTE=238, XMLQName=239, XML_TAG_WS=240, - DOUBLE_QUOTE_END=241, XMLDoubleQuotedTemplateString=242, XMLDoubleQuotedString=243, - SINGLE_QUOTE_END=244, XMLSingleQuotedTemplateString=245, XMLSingleQuotedString=246, - XMLPIText=247, XMLPITemplateText=248, XML_COMMENT_END=249, XMLCommentTemplateText=250, - XMLCommentText=251, TripleBackTickInlineCodeEnd=252, TripleBackTickInlineCode=253, - DoubleBackTickInlineCodeEnd=254, DoubleBackTickInlineCode=255, SingleBackTickInlineCodeEnd=256, - SingleBackTickInlineCode=257, StringTemplateLiteralEnd=258, StringTemplateExpressionStart=259, - StringTemplateText=260; + HexadecimalFloatingPointLiteral=184, DecimalFloatingPointNumber=185, DecimalExtendedFloatingPointNumber=186, + BooleanLiteral=187, QuotedStringLiteral=188, Base16BlobLiteral=189, Base64BlobLiteral=190, + NullLiteral=191, Identifier=192, XMLLiteralStart=193, StringTemplateLiteralStart=194, + DocumentationLineStart=195, ParameterDocumentationStart=196, ReturnParameterDocumentationStart=197, + WS=198, NEW_LINE=199, LINE_COMMENT=200, VARIABLE=201, MODULE=202, ReferenceType=203, + DocumentationText=204, SingleBacktickStart=205, DoubleBacktickStart=206, + TripleBacktickStart=207, DefinitionReference=208, DocumentationEscapedCharacters=209, + DocumentationSpace=210, DocumentationEnd=211, ParameterName=212, DescriptionSeparator=213, + DocumentationParamEnd=214, SingleBacktickContent=215, SingleBacktickEnd=216, + DoubleBacktickContent=217, DoubleBacktickEnd=218, TripleBacktickContent=219, + TripleBacktickEnd=220, XML_COMMENT_START=221, CDATA=222, DTD=223, EntityRef=224, + CharRef=225, XML_TAG_OPEN=226, XML_TAG_OPEN_SLASH=227, XML_TAG_SPECIAL_OPEN=228, + XMLLiteralEnd=229, XMLTemplateText=230, XMLText=231, XML_TAG_CLOSE=232, + XML_TAG_SPECIAL_CLOSE=233, XML_TAG_SLASH_CLOSE=234, SLASH=235, QNAME_SEPARATOR=236, + EQUALS=237, DOUBLE_QUOTE=238, SINGLE_QUOTE=239, XMLQName=240, XML_TAG_WS=241, + DOUBLE_QUOTE_END=242, XMLDoubleQuotedTemplateString=243, XMLDoubleQuotedString=244, + SINGLE_QUOTE_END=245, XMLSingleQuotedTemplateString=246, XMLSingleQuotedString=247, + XMLPIText=248, XMLPITemplateText=249, XML_COMMENT_END=250, XMLCommentTemplateText=251, + XMLCommentText=252, TripleBackTickInlineCodeEnd=253, TripleBackTickInlineCode=254, + DoubleBackTickInlineCodeEnd=255, DoubleBackTickInlineCode=256, SingleBackTickInlineCodeEnd=257, + SingleBackTickInlineCode=258, StringTemplateLiteralEnd=259, StringTemplateExpressionStart=260, + StringTemplateText=261; public static final int MARKDOWN_DOCUMENTATION = 1; public static final int MARKDOWN_DOCUMENTATION_PARAM = 2; public static final int SINGLE_BACKTICKED_DOCUMENTATION = 3; @@ -123,25 +123,26 @@ public class BallerinaLexer extends Lexer { "HALF_OPEN_RANGE", "ANNOTATION_ACCESS", "DecimalIntegerLiteral", "HexIntegerLiteral", "DecimalNumeral", "Digits", "Digit", "NonZeroDigit", "HexNumeral", "DottedHexNumber", "DottedDecimalNumber", "HexDigits", "HexDigit", "HexadecimalFloatingPointLiteral", - "DecimalFloatingPointNumber", "ExponentPart", "ExponentIndicator", "SignedInteger", - "Sign", "DecimalFloatSelector", "HexIndicator", "HexFloatingPointNumber", - "BinaryExponent", "BinaryExponentIndicator", "BooleanLiteral", "QuotedStringLiteral", - "StringCharacters", "StringCharacter", "EscapeSequence", "UnicodeEscape", - "Base16BlobLiteral", "HexGroup", "Base64BlobLiteral", "Base64Group", "PaddedBase64Group", - "Base64Char", "PaddingChar", "NullLiteral", "Identifier", "UnquotedIdentifier", - "QuotedIdentifier", "QuotedIdentifierChar", "IdentifierInitialChar", "IdentifierFollowingChar", - "QuotedIdentifierEscape", "StringNumericEscape", "Letter", "LetterOrDigit", - "XMLLiteralStart", "StringTemplateLiteralStart", "DocumentationLineStart", - "ParameterDocumentationStart", "ReturnParameterDocumentationStart", "WS", - "NEW_LINE", "LINE_COMMENT", "VARIABLE", "MODULE", "ReferenceType", "DocumentationText", - "SingleBacktickStart", "DoubleBacktickStart", "TripleBacktickStart", "DefinitionReference", - "DocumentationTextCharacter", "DocumentationEscapedCharacters", "DocumentationSpace", - "DocumentationEnd", "ParameterName", "DescriptionSeparator", "DocumentationParamEnd", - "SingleBacktickContent", "SingleBacktickEnd", "DoubleBacktickContent", - "DoubleBacktickEnd", "TripleBacktickContent", "TripleBacktickEnd", "XML_COMMENT_START", - "CDATA", "DTD", "EntityRef", "CharRef", "XML_WS", "XML_TAG_OPEN", "XML_TAG_OPEN_SLASH", - "XML_TAG_SPECIAL_OPEN", "XMLLiteralEnd", "INTERPOLATION_START", "XMLTemplateText", - "XMLText", "XMLTextChar", "DollarSequence", "XMLEscapedSequence", "XMLBracesSequence", + "DecimalFloatingPointNumber", "DecimalExtendedFloatingPointNumber", "ExponentPart", + "ExponentIndicator", "SignedInteger", "Sign", "DecimalFloatSelector", + "HexIndicator", "HexFloatingPointNumber", "BinaryExponent", "BinaryExponentIndicator", + "BooleanLiteral", "QuotedStringLiteral", "StringCharacters", "StringCharacter", + "EscapeSequence", "UnicodeEscape", "Base16BlobLiteral", "HexGroup", "Base64BlobLiteral", + "Base64Group", "PaddedBase64Group", "Base64Char", "PaddingChar", "NullLiteral", + "Identifier", "UnquotedIdentifier", "QuotedIdentifier", "QuotedIdentifierChar", + "IdentifierInitialChar", "IdentifierFollowingChar", "QuotedIdentifierEscape", + "StringNumericEscape", "Letter", "LetterOrDigit", "XMLLiteralStart", "StringTemplateLiteralStart", + "DocumentationLineStart", "ParameterDocumentationStart", "ReturnParameterDocumentationStart", + "WS", "NEW_LINE", "LINE_COMMENT", "VARIABLE", "MODULE", "ReferenceType", + "DocumentationText", "SingleBacktickStart", "DoubleBacktickStart", "TripleBacktickStart", + "DefinitionReference", "DocumentationTextCharacter", "DocumentationEscapedCharacters", + "DocumentationSpace", "DocumentationEnd", "ParameterName", "DescriptionSeparator", + "DocumentationParamEnd", "SingleBacktickContent", "SingleBacktickEnd", + "DoubleBacktickContent", "DoubleBacktickEnd", "TripleBacktickContent", + "TripleBacktickEnd", "XML_COMMENT_START", "CDATA", "DTD", "EntityRef", + "CharRef", "XML_WS", "XML_TAG_OPEN", "XML_TAG_OPEN_SLASH", "XML_TAG_SPECIAL_OPEN", + "XMLLiteralEnd", "INTERPOLATION_START", "XMLTemplateText", "XMLText", + "XMLTextChar", "DollarSequence", "XMLEscapedSequence", "XMLBracesSequence", "XML_TAG_CLOSE", "XML_TAG_SPECIAL_CLOSE", "XML_TAG_SLASH_CLOSE", "SLASH", "QNAME_SEPARATOR", "EQUALS", "DOUBLE_QUOTE", "SINGLE_QUOTE", "XMLQName", "XML_TAG_WS", "HEXDIGIT", "DIGIT", "NameChar", "NameStartChar", "DOUBLE_QUOTE_END", @@ -184,13 +185,13 @@ public class BallerinaLexer extends Lexer { "'&&'", "'||'", "'==='", "'!=='", "'&'", "'^'", "'~'", "'->'", "'<-'", "'@'", "'`'", "'..'", "'...'", "'|'", "'=>'", "'?:'", "'->>'", "'+='", "'-='", "'*='", "'/='", "'&='", "'|='", "'^='", "'<<='", "'>>='", "'>>>='", - "'..<'", "'.@'", null, null, null, null, null, null, null, null, "'null'", - null, null, null, null, null, null, null, null, null, "'variable'", "'module'", - null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, "''" + "'..<'", "'.@'", null, null, null, null, null, null, null, null, null, + "'null'", null, null, null, null, null, null, null, null, null, "'variable'", + "'module'", null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, "''" }; private static final String[] _SYMBOLIC_NAMES = { null, "IMPORT", "AS", "PUBLIC", "PRIVATE", "EXTERNAL", "FINAL", "SERVICE", @@ -220,26 +221,27 @@ public class BallerinaLexer extends Lexer { "COMPOUND_SUB", "COMPOUND_MUL", "COMPOUND_DIV", "COMPOUND_BIT_AND", "COMPOUND_BIT_OR", "COMPOUND_BIT_XOR", "COMPOUND_LEFT_SHIFT", "COMPOUND_RIGHT_SHIFT", "COMPOUND_LOGICAL_SHIFT", "HALF_OPEN_RANGE", "ANNOTATION_ACCESS", "DecimalIntegerLiteral", "HexIntegerLiteral", - "HexadecimalFloatingPointLiteral", "DecimalFloatingPointNumber", "BooleanLiteral", - "QuotedStringLiteral", "Base16BlobLiteral", "Base64BlobLiteral", "NullLiteral", - "Identifier", "XMLLiteralStart", "StringTemplateLiteralStart", "DocumentationLineStart", - "ParameterDocumentationStart", "ReturnParameterDocumentationStart", "WS", - "NEW_LINE", "LINE_COMMENT", "VARIABLE", "MODULE", "ReferenceType", "DocumentationText", - "SingleBacktickStart", "DoubleBacktickStart", "TripleBacktickStart", "DefinitionReference", - "DocumentationEscapedCharacters", "DocumentationSpace", "DocumentationEnd", - "ParameterName", "DescriptionSeparator", "DocumentationParamEnd", "SingleBacktickContent", - "SingleBacktickEnd", "DoubleBacktickContent", "DoubleBacktickEnd", "TripleBacktickContent", - "TripleBacktickEnd", "XML_COMMENT_START", "CDATA", "DTD", "EntityRef", - "CharRef", "XML_TAG_OPEN", "XML_TAG_OPEN_SLASH", "XML_TAG_SPECIAL_OPEN", - "XMLLiteralEnd", "XMLTemplateText", "XMLText", "XML_TAG_CLOSE", "XML_TAG_SPECIAL_CLOSE", - "XML_TAG_SLASH_CLOSE", "SLASH", "QNAME_SEPARATOR", "EQUALS", "DOUBLE_QUOTE", - "SINGLE_QUOTE", "XMLQName", "XML_TAG_WS", "DOUBLE_QUOTE_END", "XMLDoubleQuotedTemplateString", - "XMLDoubleQuotedString", "SINGLE_QUOTE_END", "XMLSingleQuotedTemplateString", - "XMLSingleQuotedString", "XMLPIText", "XMLPITemplateText", "XML_COMMENT_END", - "XMLCommentTemplateText", "XMLCommentText", "TripleBackTickInlineCodeEnd", - "TripleBackTickInlineCode", "DoubleBackTickInlineCodeEnd", "DoubleBackTickInlineCode", - "SingleBackTickInlineCodeEnd", "SingleBackTickInlineCode", "StringTemplateLiteralEnd", - "StringTemplateExpressionStart", "StringTemplateText" + "HexadecimalFloatingPointLiteral", "DecimalFloatingPointNumber", "DecimalExtendedFloatingPointNumber", + "BooleanLiteral", "QuotedStringLiteral", "Base16BlobLiteral", "Base64BlobLiteral", + "NullLiteral", "Identifier", "XMLLiteralStart", "StringTemplateLiteralStart", + "DocumentationLineStart", "ParameterDocumentationStart", "ReturnParameterDocumentationStart", + "WS", "NEW_LINE", "LINE_COMMENT", "VARIABLE", "MODULE", "ReferenceType", + "DocumentationText", "SingleBacktickStart", "DoubleBacktickStart", "TripleBacktickStart", + "DefinitionReference", "DocumentationEscapedCharacters", "DocumentationSpace", + "DocumentationEnd", "ParameterName", "DescriptionSeparator", "DocumentationParamEnd", + "SingleBacktickContent", "SingleBacktickEnd", "DoubleBacktickContent", + "DoubleBacktickEnd", "TripleBacktickContent", "TripleBacktickEnd", "XML_COMMENT_START", + "CDATA", "DTD", "EntityRef", "CharRef", "XML_TAG_OPEN", "XML_TAG_OPEN_SLASH", + "XML_TAG_SPECIAL_OPEN", "XMLLiteralEnd", "XMLTemplateText", "XMLText", + "XML_TAG_CLOSE", "XML_TAG_SPECIAL_CLOSE", "XML_TAG_SLASH_CLOSE", "SLASH", + "QNAME_SEPARATOR", "EQUALS", "DOUBLE_QUOTE", "SINGLE_QUOTE", "XMLQName", + "XML_TAG_WS", "DOUBLE_QUOTE_END", "XMLDoubleQuotedTemplateString", "XMLDoubleQuotedString", + "SINGLE_QUOTE_END", "XMLSingleQuotedTemplateString", "XMLSingleQuotedString", + "XMLPIText", "XMLPITemplateText", "XML_COMMENT_END", "XMLCommentTemplateText", + "XMLCommentText", "TripleBackTickInlineCodeEnd", "TripleBackTickInlineCode", + "DoubleBackTickInlineCodeEnd", "DoubleBackTickInlineCode", "SingleBackTickInlineCodeEnd", + "SingleBackTickInlineCode", "StringTemplateLiteralEnd", "StringTemplateExpressionStart", + "StringTemplateText" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -369,16 +371,16 @@ public void action(RuleContext _localctx, int ruleIndex, int actionIndex) { case 130: RIGHT_BRACE_action((RuleContext)_localctx, actionIndex); break; - case 228: + case 229: XMLLiteralStart_action((RuleContext)_localctx, actionIndex); break; - case 229: + case 230: StringTemplateLiteralStart_action((RuleContext)_localctx, actionIndex); break; - case 266: + case 267: XMLLiteralEnd_action((RuleContext)_localctx, actionIndex); break; - case 321: + case 322: StringTemplateLiteralEnd_action((RuleContext)_localctx, actionIndex); break; } @@ -600,9 +602,9 @@ public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { return MONTHS_sempred((RuleContext)_localctx, predIndex); case 61: return YEARS_sempred((RuleContext)_localctx, predIndex); - case 308: + case 309: return LookAheadTokenIsNotOpenBrace_sempred((RuleContext)_localctx, predIndex); - case 311: + case 312: return LookAheadTokenIsNotHypen_sempred((RuleContext)_localctx, predIndex); } return true; @@ -743,7 +745,7 @@ private boolean LookAheadTokenIsNotHypen_sempred(RuleContext _localctx, int pred private static final int _serializedATNSegments = 2; private static final String _serializedATNSegment0 = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\u0106\u0bda\b\1\b"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2\u0107\u0be0\b\1\b"+ "\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\b\1\4\2\t\2\4\3"+ "\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13"+ "\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23"+ @@ -802,1211 +804,1212 @@ private boolean LookAheadTokenIsNotHypen_sempred(RuleContext _localctx, int pred "\t\u0139\4\u013a\t\u013a\4\u013b\t\u013b\4\u013c\t\u013c\4\u013d\t\u013d"+ "\4\u013e\t\u013e\4\u013f\t\u013f\4\u0140\t\u0140\4\u0141\t\u0141\4\u0142"+ "\t\u0142\4\u0143\t\u0143\4\u0144\t\u0144\4\u0145\t\u0145\4\u0146\t\u0146"+ - "\4\u0147\t\u0147\4\u0148\t\u0148\3\2\3\2\3\2\3\2\3\2\3\2\3\2\3\3\3\3\3"+ - "\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\5\3\6\3\6"+ - "\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3"+ - "\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n"+ - "\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3\f\3\f\3\f\3\f\3"+ - "\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16"+ - "\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17"+ - "\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20\3\20\3\21\3\21"+ - "\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\22\3\22\3\22"+ - "\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+ - "\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3\26\3\26\3\26"+ - "\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30"+ - "\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\32\3\32\3\32\3\32"+ - "\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34"+ - "\3\34\3\34\3\34\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36\3\36\3\36\3\36"+ - "\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3!\3!\3!\3!\3!\3!\3"+ - "!\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#\3#\3$\3$\3$\3$\3$\3$\3$\3$\3"+ - "$\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3&\3&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3"+ - "\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3)\3)\3)\3)\3*\3*\3*\3*\3"+ - "*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3,\3,\3,\3,\3,\3,\3,\3,\3,\3-\3"+ - "-\3-\3-\3-\3-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3/\3/\3/\3/\3/\3/\3\60\3\60"+ - "\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\62\3\62\3\62\3\62\3\62"+ - "\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63"+ - "\3\63\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\65\3\65\3\65"+ - "\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\66\3\66\3\66\3\66\3\66\3\66\3\66"+ - "\3\66\3\67\3\67\3\67\3\67\3\67\3\67\3\67\38\38\38\38\38\38\38\38\38\3"+ - "9\39\39\39\39\39\39\39\3:\3:\3:\3:\3:\3:\3:\3:\3:\3:\3:\3;\3;\3;\3;\3"+ - ";\3;\3;\3;\3;\3;\3;\3<\3<\3<\3<\3<\3<\3<\3<\3<\3=\3=\3=\3=\3=\3=\3=\3"+ - "=\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3?\3?\3?\3?\3?\3?\3?\3?\3?\3@\3@\3@\3"+ - "@\3@\3@\3@\3@\3A\3A\3A\3A\3A\3A\3B\3B\3B\3B\3B\3B\3B\3B\3B\3B\3C\3C\3"+ - "C\3C\3C\3C\3C\3C\3C\3C\3C\3D\3D\3D\3D\3E\3E\3E\3E\3E\3F\3F\3F\3F\3F\3"+ - "F\3G\3G\3G\3G\3G\3G\3G\3G\3H\3H\3H\3H\3H\3H\3H\3H\3I\3I\3I\3I\3I\3I\3"+ - "I\3J\3J\3J\3J\3J\3J\3K\3K\3K\3K\3L\3L\3L\3L\3L\3M\3M\3M\3M\3N\3N\3N\3"+ - "N\3N\3N\3O\3O\3O\3O\3O\3O\3O\3P\3P\3P\3P\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3Q\3"+ - "R\3R\3R\3R\3R\3S\3S\3S\3S\3S\3S\3S\3T\3T\3T\3T\3T\3T\3T\3T\3U\3U\3U\3"+ - "U\3U\3U\3U\3V\3V\3V\3V\3W\3W\3W\3W\3X\3X\3X\3X\3X\3X\3X\3Y\3Y\3Y\3Z\3"+ - "Z\3Z\3Z\3Z\3Z\3[\3[\3[\3[\3[\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3\\\3]\3]\3]"+ - "\3]\3]\3]\3^\3^\3^\3^\3^\3^\3^\3^\3^\3_\3_\3_\3_\3_\3_\3`\3`\3`\3`\3`"+ - "\3a\3a\3a\3a\3a\3b\3b\3b\3b\3b\3c\3c\3c\3c\3d\3d\3d\3d\3e\3e\3e\3e\3e"+ - "\3e\3f\3f\3f\3f\3f\3f\3f\3f\3g\3g\3g\3g\3g\3g\3h\3h\3h\3h\3h\3h\3i\3i"+ - "\3i\3i\3i\3j\3j\3j\3j\3j\3j\3j\3k\3k\3k\3k\3k\3k\3k\3k\3k\3k\3k\3k\3l"+ - "\3l\3l\3l\3l\3l\3m\3m\3m\3m\3m\3m\3n\3n\3n\3n\3n\3n\3n\3n\3o\3o\3o\3o"+ - "\3o\3o\3o\3o\3p\3p\3p\3p\3p\3p\3p\3p\3p\3p\3q\3q\3q\3q\3q\3q\3q\3q\3r"+ - "\3r\3r\3r\3r\3s\3s\3s\3t\3t\3t\3t\3t\3u\3u\3u\3u\3u\3u\3u\3u\3v\3v\3v"+ - "\3v\3v\3v\3w\3w\3w\3w\3x\3x\3x\3x\3x\3x\3y\3y\3y\3y\3y\3y\3y\3y\3y\3y"+ - "\3y\3z\3z\3z\3z\3z\3z\3z\3z\3z\3z\3z\3{\3{\3{\3|\3|\3|\3|\3|\3|\3}\3}"+ - "\3}\3}\3}\3~\3~\3~\3~\3~\3~\3~\3~\3\177\3\177\3\u0080\3\u0080\3\u0081"+ - "\3\u0081\3\u0082\3\u0082\3\u0083\3\u0083\3\u0084\3\u0084\3\u0084\3\u0085"+ - "\3\u0085\3\u0086\3\u0086\3\u0087\3\u0087\3\u0088\3\u0088\3\u0089\3\u0089"+ - "\3\u008a\3\u008a\3\u008a\3\u008b\3\u008b\3\u008b\3\u008c\3\u008c\3\u008c"+ - "\3\u008d\3\u008d\3\u008e\3\u008e\3\u008f\3\u008f\3\u0090\3\u0090\3\u0091"+ - "\3\u0091\3\u0092\3\u0092\3\u0093\3\u0093\3\u0094\3\u0094\3\u0095\3\u0095"+ - "\3\u0095\3\u0096\3\u0096\3\u0096\3\u0097\3\u0097\3\u0098\3\u0098\3\u0099"+ - "\3\u0099\3\u0099\3\u009a\3\u009a\3\u009a\3\u009b\3\u009b\3\u009b\3\u009c"+ - "\3\u009c\3\u009c\3\u009d\3\u009d\3\u009d\3\u009d\3\u009e\3\u009e\3\u009e"+ - "\3\u009e\3\u009f\3\u009f\3\u00a0\3\u00a0\3\u00a1\3\u00a1\3\u00a2\3\u00a2"+ - "\3\u00a2\3\u00a3\3\u00a3\3\u00a3\3\u00a4\3\u00a4\3\u00a5\3\u00a5\3\u00a6"+ - "\3\u00a6\3\u00a6\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a8\3\u00a8\3\u00a9"+ - "\3\u00a9\3\u00a9\3\u00aa\3\u00aa\3\u00aa\3\u00ab\3\u00ab\3\u00ab\3\u00ab"+ - "\3\u00ac\3\u00ac\3\u00ac\3\u00ad\3\u00ad\3\u00ad\3\u00ae\3\u00ae\3\u00ae"+ - "\3\u00af\3\u00af\3\u00af\3\u00b0\3\u00b0\3\u00b0\3\u00b1\3\u00b1\3\u00b1"+ - "\3\u00b2\3\u00b2\3\u00b2\3\u00b3\3\u00b3\3\u00b3\3\u00b3\3\u00b4\3\u00b4"+ - "\3\u00b4\3\u00b4\3\u00b5\3\u00b5\3\u00b5\3\u00b5\3\u00b5\3\u00b6\3\u00b6"+ - "\3\u00b6\3\u00b6\3\u00b7\3\u00b7\3\u00b7\3\u00b8\3\u00b8\3\u00b9\3\u00b9"+ - "\3\u00ba\3\u00ba\3\u00ba\5\u00ba\u06bb\n\u00ba\5\u00ba\u06bd\n\u00ba\3"+ - "\u00bb\6\u00bb\u06c0\n\u00bb\r\u00bb\16\u00bb\u06c1\3\u00bc\3\u00bc\5"+ - "\u00bc\u06c6\n\u00bc\3\u00bd\3\u00bd\3\u00be\3\u00be\3\u00be\3\u00be\3"+ - "\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf\5\u00bf\u06d5\n"+ - "\u00bf\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c0\5\u00c0"+ - "\u06de\n\u00c0\3\u00c1\6\u00c1\u06e1\n\u00c1\r\u00c1\16\u00c1\u06e2\3"+ - "\u00c2\3\u00c2\3\u00c3\3\u00c3\3\u00c3\3\u00c4\3\u00c4\3\u00c4\5\u00c4"+ - "\u06ed\n\u00c4\3\u00c4\3\u00c4\5\u00c4\u06f1\n\u00c4\3\u00c4\5\u00c4\u06f4"+ - "\n\u00c4\5\u00c4\u06f6\n\u00c4\3\u00c5\3\u00c5\3\u00c5\3\u00c6\3\u00c6"+ - "\3\u00c7\5\u00c7\u06fe\n\u00c7\3\u00c7\3\u00c7\3\u00c8\3\u00c8\3\u00c9"+ - "\3\u00c9\3\u00ca\3\u00ca\3\u00ca\3\u00cb\3\u00cb\3\u00cb\3\u00cb\3\u00cb"+ - "\5\u00cb\u070e\n\u00cb\5\u00cb\u0710\n\u00cb\3\u00cc\3\u00cc\3\u00cc\3"+ - "\u00cd\3\u00cd\3\u00ce\3\u00ce\3\u00ce\3\u00ce\3\u00ce\3\u00ce\3\u00ce"+ - "\3\u00ce\3\u00ce\5\u00ce\u0720\n\u00ce\3\u00cf\3\u00cf\5\u00cf\u0724\n"+ - "\u00cf\3\u00cf\3\u00cf\3\u00d0\6\u00d0\u0729\n\u00d0\r\u00d0\16\u00d0"+ - "\u072a\3\u00d1\3\u00d1\5\u00d1\u072f\n\u00d1\3\u00d2\3\u00d2\3\u00d2\5"+ - "\u00d2\u0734\n\u00d2\3\u00d3\3\u00d3\3\u00d3\3\u00d3\3\u00d3\3\u00d3\3"+ - "\u00d3\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d4"+ - "\7\u00d4\u0745\n\u00d4\f\u00d4\16\u00d4\u0748\13\u00d4\3\u00d4\3\u00d4"+ - "\7\u00d4\u074c\n\u00d4\f\u00d4\16\u00d4\u074f\13\u00d4\3\u00d4\7\u00d4"+ - "\u0752\n\u00d4\f\u00d4\16\u00d4\u0755\13\u00d4\3\u00d4\3\u00d4\3\u00d5"+ - "\7\u00d5\u075a\n\u00d5\f\u00d5\16\u00d5\u075d\13\u00d5\3\u00d5\3\u00d5"+ - "\7\u00d5\u0761\n\u00d5\f\u00d5\16\u00d5\u0764\13\u00d5\3\u00d5\3\u00d5"+ - "\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\7\u00d6"+ - "\u0770\n\u00d6\f\u00d6\16\u00d6\u0773\13\u00d6\3\u00d6\3\u00d6\7\u00d6"+ - "\u0777\n\u00d6\f\u00d6\16\u00d6\u077a\13\u00d6\3\u00d6\5\u00d6\u077d\n"+ - "\u00d6\3\u00d6\7\u00d6\u0780\n\u00d6\f\u00d6\16\u00d6\u0783\13\u00d6\3"+ - "\u00d6\3\u00d6\3\u00d7\7\u00d7\u0788\n\u00d7\f\u00d7\16\u00d7\u078b\13"+ - "\u00d7\3\u00d7\3\u00d7\7\u00d7\u078f\n\u00d7\f\u00d7\16\u00d7\u0792\13"+ - "\u00d7\3\u00d7\3\u00d7\7\u00d7\u0796\n\u00d7\f\u00d7\16\u00d7\u0799\13"+ - "\u00d7\3\u00d7\3\u00d7\7\u00d7\u079d\n\u00d7\f\u00d7\16\u00d7\u07a0\13"+ - "\u00d7\3\u00d7\3\u00d7\3\u00d8\7\u00d8\u07a5\n\u00d8\f\u00d8\16\u00d8"+ - "\u07a8\13\u00d8\3\u00d8\3\u00d8\7\u00d8\u07ac\n\u00d8\f\u00d8\16\u00d8"+ - "\u07af\13\u00d8\3\u00d8\3\u00d8\7\u00d8\u07b3\n\u00d8\f\u00d8\16\u00d8"+ - "\u07b6\13\u00d8\3\u00d8\3\u00d8\7\u00d8\u07ba\n\u00d8\f\u00d8\16\u00d8"+ - "\u07bd\13\u00d8\3\u00d8\3\u00d8\3\u00d8\7\u00d8\u07c2\n\u00d8\f\u00d8"+ - "\16\u00d8\u07c5\13\u00d8\3\u00d8\3\u00d8\7\u00d8\u07c9\n\u00d8\f\u00d8"+ - "\16\u00d8\u07cc\13\u00d8\3\u00d8\3\u00d8\7\u00d8\u07d0\n\u00d8\f\u00d8"+ - "\16\u00d8\u07d3\13\u00d8\3\u00d8\3\u00d8\7\u00d8\u07d7\n\u00d8\f\u00d8"+ - "\16\u00d8\u07da\13\u00d8\3\u00d8\3\u00d8\5\u00d8\u07de\n\u00d8\3\u00d9"+ - "\3\u00d9\3\u00da\3\u00da\3\u00db\3\u00db\3\u00db\3\u00db\3\u00db\3\u00dc"+ - "\3\u00dc\5\u00dc\u07eb\n\u00dc\3\u00dd\3\u00dd\7\u00dd\u07ef\n\u00dd\f"+ - "\u00dd\16\u00dd\u07f2\13\u00dd\3\u00de\3\u00de\6\u00de\u07f6\n\u00de\r"+ - "\u00de\16\u00de\u07f7\3\u00df\3\u00df\3\u00df\5\u00df\u07fd\n\u00df\3"+ - "\u00e0\3\u00e0\5\u00e0\u0801\n\u00e0\3\u00e1\3\u00e1\5\u00e1\u0805\n\u00e1"+ - "\3\u00e2\3\u00e2\3\u00e2\3\u00e3\3\u00e3\3\u00e3\3\u00e3\3\u00e3\3\u00e3"+ - "\3\u00e3\5\u00e3\u0811\n\u00e3\3\u00e4\3\u00e4\3\u00e4\3\u00e4\5\u00e4"+ - "\u0817\n\u00e4\3\u00e5\3\u00e5\3\u00e5\3\u00e5\5\u00e5\u081d\n\u00e5\3"+ - "\u00e6\3\u00e6\7\u00e6\u0821\n\u00e6\f\u00e6\16\u00e6\u0824\13\u00e6\3"+ - "\u00e6\3\u00e6\3\u00e6\3\u00e6\3\u00e6\3\u00e7\3\u00e7\7\u00e7\u082d\n"+ - "\u00e7\f\u00e7\16\u00e7\u0830\13\u00e7\3\u00e7\3\u00e7\3\u00e7\3\u00e7"+ - "\3\u00e7\3\u00e8\3\u00e8\5\u00e8\u0839\n\u00e8\3\u00e8\3\u00e8\3\u00e9"+ - "\3\u00e9\5\u00e9\u083f\n\u00e9\3\u00e9\3\u00e9\7\u00e9\u0843\n\u00e9\f"+ - "\u00e9\16\u00e9\u0846\13\u00e9\3\u00e9\3\u00e9\3\u00ea\3\u00ea\5\u00ea"+ - "\u084c\n\u00ea\3\u00ea\3\u00ea\7\u00ea\u0850\n\u00ea\f\u00ea\16\u00ea"+ - "\u0853\13\u00ea\3\u00ea\3\u00ea\7\u00ea\u0857\n\u00ea\f\u00ea\16\u00ea"+ - "\u085a\13\u00ea\3\u00ea\3\u00ea\7\u00ea\u085e\n\u00ea\f\u00ea\16\u00ea"+ - "\u0861\13\u00ea\3\u00ea\3\u00ea\3\u00eb\6\u00eb\u0866\n\u00eb\r\u00eb"+ - "\16\u00eb\u0867\3\u00eb\3\u00eb\3\u00ec\6\u00ec\u086d\n\u00ec\r\u00ec"+ - "\16\u00ec\u086e\3\u00ec\3\u00ec\3\u00ed\3\u00ed\3\u00ed\3\u00ed\7\u00ed"+ - "\u0877\n\u00ed\f\u00ed\16\u00ed\u087a\13\u00ed\3\u00ed\3\u00ed\3\u00ee"+ - "\3\u00ee\3\u00ee\3\u00ee\3\u00ee\3\u00ee\3\u00ee\3\u00ee\3\u00ee\3\u00ef"+ - "\3\u00ef\3\u00ef\3\u00ef\3\u00ef\3\u00ef\3\u00ef\3\u00f0\3\u00f0\3\u00f0"+ - "\3\u00f0\3\u00f0\3\u00f0\3\u00f0\3\u00f0\5\u00f0\u0896\n\u00f0\3\u00f1"+ - "\3\u00f1\6\u00f1\u089a\n\u00f1\r\u00f1\16\u00f1\u089b\3\u00f2\3\u00f2"+ - "\3\u00f2\3\u00f2\3\u00f3\3\u00f3\3\u00f3\3\u00f3\3\u00f3\3\u00f4\3\u00f4"+ - "\3\u00f4\3\u00f4\3\u00f4\3\u00f4\3\u00f5\3\u00f5\6\u00f5\u08af\n\u00f5"+ - "\r\u00f5\16\u00f5\u08b0\3\u00f6\3\u00f6\3\u00f6\5\u00f6\u08b6\n\u00f6"+ - "\3\u00f7\3\u00f7\3\u00f8\3\u00f8\3\u00f9\3\u00f9\3\u00f9\3\u00f9\3\u00f9"+ - "\3\u00fa\3\u00fa\3\u00fb\7\u00fb\u08c4\n\u00fb\f\u00fb\16\u00fb\u08c7"+ - "\13\u00fb\3\u00fb\3\u00fb\7\u00fb\u08cb\n\u00fb\f\u00fb\16\u00fb\u08ce"+ - "\13\u00fb\3\u00fb\3\u00fb\3\u00fb\3\u00fc\3\u00fc\3\u00fc\3\u00fc\3\u00fc"+ - "\3\u00fd\3\u00fd\3\u00fd\7\u00fd\u08db\n\u00fd\f\u00fd\16\u00fd\u08de"+ - "\13\u00fd\3\u00fd\5\u00fd\u08e1\n\u00fd\3\u00fd\3\u00fd\3\u00fd\3\u00fd"+ - "\7\u00fd\u08e7\n\u00fd\f\u00fd\16\u00fd\u08ea\13\u00fd\3\u00fd\5\u00fd"+ - "\u08ed\n\u00fd\6\u00fd\u08ef\n\u00fd\r\u00fd\16\u00fd\u08f0\3\u00fd\3"+ - "\u00fd\3\u00fd\6\u00fd\u08f6\n\u00fd\r\u00fd\16\u00fd\u08f7\5\u00fd\u08fa"+ - "\n\u00fd\3\u00fe\3\u00fe\3\u00fe\3\u00fe\3\u00ff\3\u00ff\3\u00ff\3\u00ff"+ - "\7\u00ff\u0904\n\u00ff\f\u00ff\16\u00ff\u0907\13\u00ff\3\u00ff\5\u00ff"+ - "\u090a\n\u00ff\3\u00ff\3\u00ff\3\u00ff\3\u00ff\3\u00ff\7\u00ff\u0911\n"+ - "\u00ff\f\u00ff\16\u00ff\u0914\13\u00ff\3\u00ff\5\u00ff\u0917\n\u00ff\6"+ - "\u00ff\u0919\n\u00ff\r\u00ff\16\u00ff\u091a\3\u00ff\3\u00ff\3\u00ff\3"+ - "\u00ff\6\u00ff\u0921\n\u00ff\r\u00ff\16\u00ff\u0922\5\u00ff\u0925\n\u00ff"+ - "\3\u0100\3\u0100\3\u0100\3\u0100\3\u0100\3\u0101\3\u0101\3\u0101\3\u0101"+ - "\3\u0101\3\u0101\3\u0101\3\u0101\7\u0101\u0934\n\u0101\f\u0101\16\u0101"+ - "\u0937\13\u0101\3\u0101\5\u0101\u093a\n\u0101\3\u0101\3\u0101\3\u0101"+ - "\3\u0101\3\u0101\3\u0101\3\u0101\3\u0101\3\u0101\7\u0101\u0945\n\u0101"+ - "\f\u0101\16\u0101\u0948\13\u0101\3\u0101\5\u0101\u094b\n\u0101\6\u0101"+ - "\u094d\n\u0101\r\u0101\16\u0101\u094e\3\u0101\3\u0101\3\u0101\3\u0101"+ - "\3\u0101\3\u0101\3\u0101\3\u0101\6\u0101\u0959\n\u0101\r\u0101\16\u0101"+ - "\u095a\5\u0101\u095d\n\u0101\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102\3"+ - "\u0102\3\u0103\3\u0103\3\u0103\3\u0103\3\u0103\3\u0103\3\u0103\3\u0104"+ - "\3\u0104\3\u0104\3\u0104\3\u0104\3\u0104\3\u0104\3\u0104\3\u0104\3\u0104"+ - "\3\u0104\7\u0104\u0977\n\u0104\f\u0104\16\u0104\u097a\13\u0104\3\u0104"+ - "\3\u0104\3\u0104\3\u0104\3\u0105\3\u0105\3\u0105\3\u0105\3\u0105\3\u0105"+ - "\3\u0105\5\u0105\u0987\n\u0105\3\u0105\7\u0105\u098a\n\u0105\f\u0105\16"+ - "\u0105\u098d\13\u0105\3\u0105\3\u0105\3\u0105\3\u0105\3\u0106\3\u0106"+ - "\3\u0106\3\u0106\3\u0107\3\u0107\3\u0107\3\u0107\6\u0107\u099b\n\u0107"+ - "\r\u0107\16\u0107\u099c\3\u0107\3\u0107\3\u0107\3\u0107\3\u0107\3\u0107"+ - "\3\u0107\6\u0107\u09a6\n\u0107\r\u0107\16\u0107\u09a7\3\u0107\3\u0107"+ - "\5\u0107\u09ac\n\u0107\3\u0108\3\u0108\5\u0108\u09b0\n\u0108\3\u0108\5"+ - "\u0108\u09b3\n\u0108\3\u0109\3\u0109\3\u0109\3\u0109\3\u010a\3\u010a\3"+ - "\u010a\3\u010a\3\u010a\3\u010b\3\u010b\3\u010b\3\u010b\3\u010b\3\u010b"+ - "\5\u010b\u09c4\n\u010b\3\u010b\3\u010b\3\u010b\3\u010b\3\u010b\3\u010c"+ - "\3\u010c\3\u010c\3\u010c\3\u010c\3\u010d\3\u010d\3\u010d\3\u010e\5\u010e"+ - "\u09d4\n\u010e\3\u010e\3\u010e\3\u010e\3\u010e\3\u010f\6\u010f\u09db\n"+ - "\u010f\r\u010f\16\u010f\u09dc\3\u0110\3\u0110\3\u0110\3\u0110\3\u0110"+ - "\3\u0110\3\u0110\5\u0110\u09e6\n\u0110\3\u0111\6\u0111\u09e9\n\u0111\r"+ - "\u0111\16\u0111\u09ea\3\u0111\3\u0111\3\u0112\3\u0112\3\u0112\3\u0112"+ - "\3\u0112\3\u0112\3\u0112\3\u0112\3\u0112\3\u0112\3\u0112\3\u0112\3\u0112"+ - "\3\u0112\3\u0112\3\u0112\3\u0112\5\u0112\u0a00\n\u0112\3\u0112\5\u0112"+ - "\u0a03\n\u0112\3\u0113\3\u0113\6\u0113\u0a07\n\u0113\r\u0113\16\u0113"+ - "\u0a08\3\u0113\7\u0113\u0a0c\n\u0113\f\u0113\16\u0113\u0a0f\13\u0113\3"+ - "\u0113\7\u0113\u0a12\n\u0113\f\u0113\16\u0113\u0a15\13\u0113\3\u0113\3"+ - "\u0113\6\u0113\u0a19\n\u0113\r\u0113\16\u0113\u0a1a\3\u0113\7\u0113\u0a1e"+ - "\n\u0113\f\u0113\16\u0113\u0a21\13\u0113\3\u0113\7\u0113\u0a24\n\u0113"+ - "\f\u0113\16\u0113\u0a27\13\u0113\3\u0113\3\u0113\6\u0113\u0a2b\n\u0113"+ - "\r\u0113\16\u0113\u0a2c\3\u0113\7\u0113\u0a30\n\u0113\f\u0113\16\u0113"+ - "\u0a33\13\u0113\3\u0113\7\u0113\u0a36\n\u0113\f\u0113\16\u0113\u0a39\13"+ - "\u0113\3\u0113\3\u0113\6\u0113\u0a3d\n\u0113\r\u0113\16\u0113\u0a3e\3"+ - "\u0113\7\u0113\u0a42\n\u0113\f\u0113\16\u0113\u0a45\13\u0113\3\u0113\7"+ - "\u0113\u0a48\n\u0113\f\u0113\16\u0113\u0a4b\13\u0113\3\u0113\3\u0113\7"+ - "\u0113\u0a4f\n\u0113\f\u0113\16\u0113\u0a52\13\u0113\3\u0113\3\u0113\3"+ - "\u0113\3\u0113\7\u0113\u0a58\n\u0113\f\u0113\16\u0113\u0a5b\13\u0113\5"+ - "\u0113\u0a5d\n\u0113\3\u0114\3\u0114\3\u0114\3\u0114\3\u0115\3\u0115\3"+ - "\u0115\3\u0115\3\u0115\3\u0116\3\u0116\3\u0116\3\u0116\3\u0116\3\u0117"+ - "\3\u0117\3\u0118\3\u0118\3\u0119\3\u0119\3\u011a\3\u011a\3\u011a\3\u011a"+ - "\3\u011b\3\u011b\3\u011b\3\u011b\3\u011c\3\u011c\7\u011c\u0a7d\n\u011c"+ - "\f\u011c\16\u011c\u0a80\13\u011c\3\u011d\3\u011d\3\u011d\3\u011d\3\u011e"+ - "\3\u011e\3\u011f\3\u011f\3\u0120\3\u0120\3\u0120\3\u0120\5\u0120\u0a8e"+ - "\n\u0120\3\u0121\5\u0121\u0a91\n\u0121\3\u0122\3\u0122\3\u0122\3\u0122"+ - "\3\u0123\5\u0123\u0a98\n\u0123\3\u0123\3\u0123\3\u0123\3\u0123\3\u0124"+ - "\5\u0124\u0a9f\n\u0124\3\u0124\3\u0124\5\u0124\u0aa3\n\u0124\6\u0124\u0aa5"+ - "\n\u0124\r\u0124\16\u0124\u0aa6\3\u0124\3\u0124\3\u0124\5\u0124\u0aac"+ - "\n\u0124\7\u0124\u0aae\n\u0124\f\u0124\16\u0124\u0ab1\13\u0124\5\u0124"+ - "\u0ab3\n\u0124\3\u0125\3\u0125\3\u0125\5\u0125\u0ab8\n\u0125\3\u0126\3"+ - "\u0126\3\u0126\3\u0126\3\u0127\5\u0127\u0abf\n\u0127\3\u0127\3\u0127\3"+ - "\u0127\3\u0127\3\u0128\5\u0128\u0ac6\n\u0128\3\u0128\3\u0128\5\u0128\u0aca"+ - "\n\u0128\6\u0128\u0acc\n\u0128\r\u0128\16\u0128\u0acd\3\u0128\3\u0128"+ - "\3\u0128\5\u0128\u0ad3\n\u0128\7\u0128\u0ad5\n\u0128\f\u0128\16\u0128"+ - "\u0ad8\13\u0128\5\u0128\u0ada\n\u0128\3\u0129\3\u0129\5\u0129\u0ade\n"+ - "\u0129\3\u012a\3\u012a\3\u012b\3\u012b\3\u012b\3\u012b\3\u012b\3\u012c"+ - "\3\u012c\3\u012c\3\u012c\3\u012c\3\u012d\5\u012d\u0aed\n\u012d\3\u012d"+ - "\3\u012d\5\u012d\u0af1\n\u012d\7\u012d\u0af3\n\u012d\f\u012d\16\u012d"+ - "\u0af6\13\u012d\3\u012e\3\u012e\5\u012e\u0afa\n\u012e\3\u012f\3\u012f"+ - "\3\u012f\3\u012f\3\u012f\6\u012f\u0b01\n\u012f\r\u012f\16\u012f\u0b02"+ - "\3\u012f\5\u012f\u0b06\n\u012f\3\u012f\3\u012f\3\u012f\6\u012f\u0b0b\n"+ - "\u012f\r\u012f\16\u012f\u0b0c\3\u012f\5\u012f\u0b10\n\u012f\5\u012f\u0b12"+ - "\n\u012f\3\u0130\6\u0130\u0b15\n\u0130\r\u0130\16\u0130\u0b16\3\u0130"+ - "\7\u0130\u0b1a\n\u0130\f\u0130\16\u0130\u0b1d\13\u0130\3\u0130\6\u0130"+ - "\u0b20\n\u0130\r\u0130\16\u0130\u0b21\5\u0130\u0b24\n\u0130\3\u0131\3"+ - "\u0131\3\u0131\3\u0131\3\u0131\3\u0131\3\u0132\3\u0132\3\u0132\3\u0132"+ - "\3\u0132\3\u0133\5\u0133\u0b32\n\u0133\3\u0133\3\u0133\5\u0133\u0b36\n"+ - "\u0133\7\u0133\u0b38\n\u0133\f\u0133\16\u0133\u0b3b\13\u0133\3\u0134\5"+ - "\u0134\u0b3e\n\u0134\3\u0134\6\u0134\u0b41\n\u0134\r\u0134\16\u0134\u0b42"+ - "\3\u0134\5\u0134\u0b46\n\u0134\3\u0135\3\u0135\3\u0135\3\u0135\3\u0135"+ - "\3\u0135\3\u0135\5\u0135\u0b4f\n\u0135\3\u0136\3\u0136\3\u0137\3\u0137"+ - "\3\u0137\3\u0137\3\u0137\6\u0137\u0b58\n\u0137\r\u0137\16\u0137\u0b59"+ - "\3\u0137\5\u0137\u0b5d\n\u0137\3\u0137\3\u0137\3\u0137\6\u0137\u0b62\n"+ - "\u0137\r\u0137\16\u0137\u0b63\3\u0137\5\u0137\u0b67\n\u0137\5\u0137\u0b69"+ - "\n\u0137\3\u0138\6\u0138\u0b6c\n\u0138\r\u0138\16\u0138\u0b6d\3\u0138"+ - "\5\u0138\u0b71\n\u0138\3\u0138\3\u0138\5\u0138\u0b75\n\u0138\3\u0139\3"+ - "\u0139\3\u013a\3\u013a\3\u013a\3\u013a\3\u013a\3\u013a\3\u013b\6\u013b"+ - "\u0b80\n\u013b\r\u013b\16\u013b\u0b81\3\u013c\3\u013c\3\u013c\3\u013c"+ - "\3\u013c\3\u013c\5\u013c\u0b8a\n\u013c\3\u013d\3\u013d\3\u013d\3\u013d"+ - "\3\u013d\3\u013e\6\u013e\u0b92\n\u013e\r\u013e\16\u013e\u0b93\3\u013f"+ - "\3\u013f\3\u013f\5\u013f\u0b99\n\u013f\3\u0140\3\u0140\3\u0140\3\u0140"+ - "\3\u0141\6\u0141\u0ba0\n\u0141\r\u0141\16\u0141\u0ba1\3\u0142\3\u0142"+ - "\3\u0143\3\u0143\3\u0143\3\u0143\3\u0143\3\u0144\5\u0144\u0bac\n\u0144"+ - "\3\u0144\3\u0144\3\u0144\3\u0144\3\u0145\6\u0145\u0bb3\n\u0145\r\u0145"+ - "\16\u0145\u0bb4\3\u0145\7\u0145\u0bb8\n\u0145\f\u0145\16\u0145\u0bbb\13"+ - "\u0145\3\u0145\6\u0145\u0bbe\n\u0145\r\u0145\16\u0145\u0bbf\5\u0145\u0bc2"+ - "\n\u0145\3\u0146\3\u0146\3\u0147\3\u0147\6\u0147\u0bc8\n\u0147\r\u0147"+ - "\16\u0147\u0bc9\3\u0147\3\u0147\3\u0147\3\u0147\5\u0147\u0bd0\n\u0147"+ - "\3\u0148\7\u0148\u0bd3\n\u0148\f\u0148\16\u0148\u0bd6\13\u0148\3\u0148"+ - "\3\u0148\3\u0148\4\u0978\u098b\2\u0149\22\3\24\4\26\5\30\6\32\7\34\b\36"+ - "\t \n\"\13$\f&\r(\16*\17,\20.\21\60\22\62\23\64\24\66\258\26:\27<\30>"+ - "\31@\32B\33D\34F\35H\36J\37L N!P\"R#T$V%X&Z\'\\(^)`*b+d,f-h.j/l\60n\61"+ - "p\62r\63t\64v\65x\66z\67|8~9\u0080:\u0082;\u0084<\u0086=\u0088>\u008a"+ - "?\u008c@\u008eA\u0090B\u0092C\u0094D\u0096E\u0098F\u009aG\u009cH\u009e"+ - "I\u00a0J\u00a2K\u00a4L\u00a6M\u00a8N\u00aaO\u00acP\u00aeQ\u00b0R\u00b2"+ - "S\u00b4T\u00b6U\u00b8V\u00baW\u00bcX\u00beY\u00c0Z\u00c2[\u00c4\\\u00c6"+ - "]\u00c8^\u00ca_\u00cc`\u00cea\u00d0b\u00d2c\u00d4d\u00d6e\u00d8f\u00da"+ - "g\u00dch\u00dei\u00e0j\u00e2k\u00e4l\u00e6m\u00e8n\u00eao\u00ecp\u00ee"+ - "q\u00f0r\u00f2s\u00f4t\u00f6u\u00f8v\u00faw\u00fcx\u00fey\u0100z\u0102"+ - "{\u0104|\u0106}\u0108~\u010a\177\u010c\u0080\u010e\u0081\u0110\u0082\u0112"+ - "\u0083\u0114\u0084\u0116\u0085\u0118\u0086\u011a\u0087\u011c\u0088\u011e"+ - "\u0089\u0120\u008a\u0122\u008b\u0124\u008c\u0126\u008d\u0128\2\u012a\u008e"+ - "\u012c\u008f\u012e\u0090\u0130\u0091\u0132\u0092\u0134\u0093\u0136\u0094"+ - "\u0138\u0095\u013a\u0096\u013c\u0097\u013e\u0098\u0140\u0099\u0142\u009a"+ - "\u0144\u009b\u0146\u009c\u0148\u009d\u014a\u009e\u014c\u009f\u014e\u00a0"+ - "\u0150\u00a1\u0152\u00a2\u0154\u00a3\u0156\u00a4\u0158\u00a5\u015a\u00a6"+ - "\u015c\u00a7\u015e\u00a8\u0160\u00a9\u0162\u00aa\u0164\u00ab\u0166\u00ac"+ - "\u0168\u00ad\u016a\u00ae\u016c\u00af\u016e\u00b0\u0170\u00b1\u0172\u00b2"+ - "\u0174\u00b3\u0176\u00b4\u0178\u00b5\u017a\u00b6\u017c\u00b7\u017e\u00b8"+ - "\u0180\u00b9\u0182\2\u0184\2\u0186\2\u0188\2\u018a\2\u018c\2\u018e\2\u0190"+ - "\2\u0192\2\u0194\u00ba\u0196\u00bb\u0198\2\u019a\2\u019c\2\u019e\2\u01a0"+ - "\2\u01a2\2\u01a4\2\u01a6\2\u01a8\2\u01aa\u00bc\u01ac\u00bd\u01ae\2\u01b0"+ - "\2\u01b2\2\u01b4\2\u01b6\u00be\u01b8\2\u01ba\u00bf\u01bc\2\u01be\2\u01c0"+ - "\2\u01c2\2\u01c4\u00c0\u01c6\u00c1\u01c8\2\u01ca\2\u01cc\2\u01ce\2\u01d0"+ - "\2\u01d2\2\u01d4\2\u01d6\2\u01d8\2\u01da\u00c2\u01dc\u00c3\u01de\u00c4"+ - "\u01e0\u00c5\u01e2\u00c6\u01e4\u00c7\u01e6\u00c8\u01e8\u00c9\u01ea\u00ca"+ - "\u01ec\u00cb\u01ee\u00cc\u01f0\u00cd\u01f2\u00ce\u01f4\u00cf\u01f6\u00d0"+ - "\u01f8\u00d1\u01fa\2\u01fc\u00d2\u01fe\u00d3\u0200\u00d4\u0202\u00d5\u0204"+ - "\u00d6\u0206\u00d7\u0208\u00d8\u020a\u00d9\u020c\u00da\u020e\u00db\u0210"+ - "\u00dc\u0212\u00dd\u0214\u00de\u0216\u00df\u0218\u00e0\u021a\u00e1\u021c"+ - "\u00e2\u021e\2\u0220\u00e3\u0222\u00e4\u0224\u00e5\u0226\u00e6\u0228\2"+ - "\u022a\u00e7\u022c\u00e8\u022e\2\u0230\2\u0232\2\u0234\2\u0236\u00e9\u0238"+ - "\u00ea\u023a\u00eb\u023c\u00ec\u023e\u00ed\u0240\u00ee\u0242\u00ef\u0244"+ - "\u00f0\u0246\u00f1\u0248\u00f2\u024a\2\u024c\2\u024e\2\u0250\2\u0252\u00f3"+ - "\u0254\u00f4\u0256\u00f5\u0258\2\u025a\u00f6\u025c\u00f7\u025e\u00f8\u0260"+ - "\2\u0262\2\u0264\u00f9\u0266\u00fa\u0268\2\u026a\2\u026c\2\u026e\2\u0270"+ - "\u00fb\u0272\u00fc\u0274\2\u0276\u00fd\u0278\2\u027a\2\u027c\2\u027e\2"+ - "\u0280\2\u0282\u00fe\u0284\u00ff\u0286\2\u0288\u0100\u028a\u0101\u028c"+ - "\2\u028e\u0102\u0290\u0103\u0292\2\u0294\u0104\u0296\u0105\u0298\u0106"+ - "\u029a\2\u029c\2\u029e\2\22\2\3\4\5\6\7\b\t\n\13\f\r\16\17\20\21*\3\2"+ - "\63;\4\2ZZzz\5\2\62;CHch\4\2GGgg\4\2--//\6\2FFHHffhh\4\2RRrr\4\2$$^^\n"+ - "\2$$))^^ddhhppttvv\6\2--\61;C\\c|\5\2C\\aac|\26\2\2\u0081\u00a3\u00a9"+ - "\u00ab\u00ab\u00ad\u00ae\u00b0\u00b0\u00b2\u00b3\u00b8\u00b9\u00bd\u00bd"+ - "\u00c1\u00c1\u00d9\u00d9\u00f9\u00f9\u2010\u202b\u2032\u2060\u2192\u2c01"+ - "\u3003\u3005\u300a\u3022\u3032\u3032\udb82\uf901\ufd40\ufd41\ufe47\ufe48"+ - "\b\2\13\f\17\17C\\c|\u2010\u2011\u202a\u202b\6\2$$\61\61^^~~\7\2ddhhp"+ - "pttvv\4\2\2\u0081\ud802\udc01\3\2\ud802\udc01\3\2\udc02\ue001\6\2\62;"+ - "C\\aac|\4\2\13\13\"\"\4\2\f\f\16\17\4\2\f\f\17\17\5\2\f\f\"\"bb\3\2\""+ - "\"\3\2\f\f\4\2\f\fbb\3\2bb\3\2//\7\2&&((>>bb}}\5\2\13\f\17\17\"\"\3\2"+ - "\62;\5\2\u00b9\u00b9\u0302\u0371\u2041\u2042\n\2C\\aac|\u2072\u2191\u2c02"+ - "\u2ff1\u3003\ud801\uf902\ufdd1\ufdf2\uffff\b\2$$&&>>^^}}\177\177\b\2&"+ - "&))>>^^}}\177\177\6\2&&@A}}\177\177\6\2&&//@@}}\5\2&&^^bb\6\2&&^^bb}}"+ - "\f\2$$))^^bbddhhppttvv}}\u0c69\2\22\3\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2"+ - "\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2\2\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3"+ - "\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2\2\2\2*\3\2\2\2\2,\3\2\2\2\2.\3\2\2"+ - "\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3\2\2\2\2\66\3\2\2\2\28\3\2\2\2\2:\3"+ - "\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2\2\2B\3\2\2\2\2D\3\2\2\2\2F\3\2\2"+ - "\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2N\3\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2"+ - "T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3\2\2\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3"+ - "\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2\2\2\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2"+ - "\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2\2t\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2"+ - "z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080\3\2\2\2\2\u0082\3\2\2\2\2\u0084"+ - "\3\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2\2\2\u008a\3\2\2\2\2\u008c\3\2\2"+ - "\2\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092\3\2\2\2\2\u0094\3\2\2\2\2\u0096"+ - "\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2\2\2\u009c\3\2\2\2\2\u009e\3\2\2"+ - "\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\2\u00a4\3\2\2\2\2\u00a6\3\2\2\2\2\u00a8"+ - "\3\2\2\2\2\u00aa\3\2\2\2\2\u00ac\3\2\2\2\2\u00ae\3\2\2\2\2\u00b0\3\2\2"+ - "\2\2\u00b2\3\2\2\2\2\u00b4\3\2\2\2\2\u00b6\3\2\2\2\2\u00b8\3\2\2\2\2\u00ba"+ - "\3\2\2\2\2\u00bc\3\2\2\2\2\u00be\3\2\2\2\2\u00c0\3\2\2\2\2\u00c2\3\2\2"+ - "\2\2\u00c4\3\2\2\2\2\u00c6\3\2\2\2\2\u00c8\3\2\2\2\2\u00ca\3\2\2\2\2\u00cc"+ - "\3\2\2\2\2\u00ce\3\2\2\2\2\u00d0\3\2\2\2\2\u00d2\3\2\2\2\2\u00d4\3\2\2"+ - "\2\2\u00d6\3\2\2\2\2\u00d8\3\2\2\2\2\u00da\3\2\2\2\2\u00dc\3\2\2\2\2\u00de"+ - "\3\2\2\2\2\u00e0\3\2\2\2\2\u00e2\3\2\2\2\2\u00e4\3\2\2\2\2\u00e6\3\2\2"+ - "\2\2\u00e8\3\2\2\2\2\u00ea\3\2\2\2\2\u00ec\3\2\2\2\2\u00ee\3\2\2\2\2\u00f0"+ - "\3\2\2\2\2\u00f2\3\2\2\2\2\u00f4\3\2\2\2\2\u00f6\3\2\2\2\2\u00f8\3\2\2"+ - "\2\2\u00fa\3\2\2\2\2\u00fc\3\2\2\2\2\u00fe\3\2\2\2\2\u0100\3\2\2\2\2\u0102"+ - "\3\2\2\2\2\u0104\3\2\2\2\2\u0106\3\2\2\2\2\u0108\3\2\2\2\2\u010a\3\2\2"+ - "\2\2\u010c\3\2\2\2\2\u010e\3\2\2\2\2\u0110\3\2\2\2\2\u0112\3\2\2\2\2\u0114"+ - "\3\2\2\2\2\u0116\3\2\2\2\2\u0118\3\2\2\2\2\u011a\3\2\2\2\2\u011c\3\2\2"+ - "\2\2\u011e\3\2\2\2\2\u0120\3\2\2\2\2\u0122\3\2\2\2\2\u0124\3\2\2\2\2\u0126"+ - "\3\2\2\2\2\u012a\3\2\2\2\2\u012c\3\2\2\2\2\u012e\3\2\2\2\2\u0130\3\2\2"+ - "\2\2\u0132\3\2\2\2\2\u0134\3\2\2\2\2\u0136\3\2\2\2\2\u0138\3\2\2\2\2\u013a"+ - "\3\2\2\2\2\u013c\3\2\2\2\2\u013e\3\2\2\2\2\u0140\3\2\2\2\2\u0142\3\2\2"+ - "\2\2\u0144\3\2\2\2\2\u0146\3\2\2\2\2\u0148\3\2\2\2\2\u014a\3\2\2\2\2\u014c"+ - "\3\2\2\2\2\u014e\3\2\2\2\2\u0150\3\2\2\2\2\u0152\3\2\2\2\2\u0154\3\2\2"+ - "\2\2\u0156\3\2\2\2\2\u0158\3\2\2\2\2\u015a\3\2\2\2\2\u015c\3\2\2\2\2\u015e"+ - "\3\2\2\2\2\u0160\3\2\2\2\2\u0162\3\2\2\2\2\u0164\3\2\2\2\2\u0166\3\2\2"+ - "\2\2\u0168\3\2\2\2\2\u016a\3\2\2\2\2\u016c\3\2\2\2\2\u016e\3\2\2\2\2\u0170"+ - "\3\2\2\2\2\u0172\3\2\2\2\2\u0174\3\2\2\2\2\u0176\3\2\2\2\2\u0178\3\2\2"+ - "\2\2\u017a\3\2\2\2\2\u017c\3\2\2\2\2\u017e\3\2\2\2\2\u0180\3\2\2\2\2\u0194"+ - "\3\2\2\2\2\u0196\3\2\2\2\2\u01aa\3\2\2\2\2\u01ac\3\2\2\2\2\u01b6\3\2\2"+ - "\2\2\u01ba\3\2\2\2\2\u01c4\3\2\2\2\2\u01c6\3\2\2\2\2\u01da\3\2\2\2\2\u01dc"+ - "\3\2\2\2\2\u01de\3\2\2\2\2\u01e0\3\2\2\2\2\u01e2\3\2\2\2\2\u01e4\3\2\2"+ - "\2\2\u01e6\3\2\2\2\2\u01e8\3\2\2\2\3\u01ea\3\2\2\2\3\u01ec\3\2\2\2\3\u01ee"+ - "\3\2\2\2\3\u01f0\3\2\2\2\3\u01f2\3\2\2\2\3\u01f4\3\2\2\2\3\u01f6\3\2\2"+ - "\2\3\u01f8\3\2\2\2\3\u01fc\3\2\2\2\3\u01fe\3\2\2\2\3\u0200\3\2\2\2\4\u0202"+ - "\3\2\2\2\4\u0204\3\2\2\2\4\u0206\3\2\2\2\5\u0208\3\2\2\2\5\u020a\3\2\2"+ - "\2\6\u020c\3\2\2\2\6\u020e\3\2\2\2\7\u0210\3\2\2\2\7\u0212\3\2\2\2\b\u0214"+ - "\3\2\2\2\b\u0216\3\2\2\2\b\u0218\3\2\2\2\b\u021a\3\2\2\2\b\u021c\3\2\2"+ - "\2\b\u0220\3\2\2\2\b\u0222\3\2\2\2\b\u0224\3\2\2\2\b\u0226\3\2\2\2\b\u022a"+ - "\3\2\2\2\b\u022c\3\2\2\2\t\u0236\3\2\2\2\t\u0238\3\2\2\2\t\u023a\3\2\2"+ - "\2\t\u023c\3\2\2\2\t\u023e\3\2\2\2\t\u0240\3\2\2\2\t\u0242\3\2\2\2\t\u0244"+ - "\3\2\2\2\t\u0246\3\2\2\2\t\u0248\3\2\2\2\n\u0252\3\2\2\2\n\u0254\3\2\2"+ - "\2\n\u0256\3\2\2\2\13\u025a\3\2\2\2\13\u025c\3\2\2\2\13\u025e\3\2\2\2"+ - "\f\u0264\3\2\2\2\f\u0266\3\2\2\2\r\u0270\3\2\2\2\r\u0272\3\2\2\2\r\u0276"+ - "\3\2\2\2\16\u0282\3\2\2\2\16\u0284\3\2\2\2\17\u0288\3\2\2\2\17\u028a\3"+ - "\2\2\2\20\u028e\3\2\2\2\20\u0290\3\2\2\2\21\u0294\3\2\2\2\21\u0296\3\2"+ - "\2\2\21\u0298\3\2\2\2\22\u02a0\3\2\2\2\24\u02a7\3\2\2\2\26\u02aa\3\2\2"+ - "\2\30\u02b1\3\2\2\2\32\u02b9\3\2\2\2\34\u02c2\3\2\2\2\36\u02c8\3\2\2\2"+ - " \u02d0\3\2\2\2\"\u02d9\3\2\2\2$\u02e2\3\2\2\2&\u02e9\3\2\2\2(\u02f0\3"+ - "\2\2\2*\u02fb\3\2\2\2,\u0305\3\2\2\2.\u0311\3\2\2\2\60\u0318\3\2\2\2\62"+ - "\u0321\3\2\2\2\64\u0328\3\2\2\2\66\u032e\3\2\2\28\u0336\3\2\2\2:\u033e"+ - "\3\2\2\2<\u0346\3\2\2\2>\u034f\3\2\2\2@\u0356\3\2\2\2B\u035c\3\2\2\2D"+ - "\u0363\3\2\2\2F\u036a\3\2\2\2H\u0371\3\2\2\2J\u0374\3\2\2\2L\u037e\3\2"+ - "\2\2N\u0384\3\2\2\2P\u0387\3\2\2\2R\u038e\3\2\2\2T\u0394\3\2\2\2V\u039a"+ - "\3\2\2\2X\u03a3\3\2\2\2Z\u03a9\3\2\2\2\\\u03b0\3\2\2\2^\u03ba\3\2\2\2"+ - "`\u03c0\3\2\2\2b\u03c9\3\2\2\2d\u03d1\3\2\2\2f\u03da\3\2\2\2h\u03e3\3"+ - "\2\2\2j\u03ed\3\2\2\2l\u03f3\3\2\2\2n\u03f9\3\2\2\2p\u03ff\3\2\2\2r\u0404"+ - "\3\2\2\2t\u0409\3\2\2\2v\u0418\3\2\2\2x\u0422\3\2\2\2z\u042c\3\2\2\2|"+ - "\u0434\3\2\2\2~\u043b\3\2\2\2\u0080\u0444\3\2\2\2\u0082\u044c\3\2\2\2"+ - "\u0084\u0457\3\2\2\2\u0086\u0462\3\2\2\2\u0088\u046b\3\2\2\2\u008a\u0473"+ - "\3\2\2\2\u008c\u047d\3\2\2\2\u008e\u0486\3\2\2\2\u0090\u048e\3\2\2\2\u0092"+ - "\u0494\3\2\2\2\u0094\u049e\3\2\2\2\u0096\u04a9\3\2\2\2\u0098\u04ad\3\2"+ - "\2\2\u009a\u04b2\3\2\2\2\u009c\u04b8\3\2\2\2\u009e\u04c0\3\2\2\2\u00a0"+ - "\u04c8\3\2\2\2\u00a2\u04cf\3\2\2\2\u00a4\u04d5\3\2\2\2\u00a6\u04d9\3\2"+ - "\2\2\u00a8\u04de\3\2\2\2\u00aa\u04e2\3\2\2\2\u00ac\u04e8\3\2\2\2\u00ae"+ - "\u04ef\3\2\2\2\u00b0\u04f3\3\2\2\2\u00b2\u04fc\3\2\2\2\u00b4\u0501\3\2"+ - "\2\2\u00b6\u0508\3\2\2\2\u00b8\u0510\3\2\2\2\u00ba\u0517\3\2\2\2\u00bc"+ - "\u051b\3\2\2\2\u00be\u051f\3\2\2\2\u00c0\u0526\3\2\2\2\u00c2\u0529\3\2"+ - "\2\2\u00c4\u052f\3\2\2\2\u00c6\u0534\3\2\2\2\u00c8\u053c\3\2\2\2\u00ca"+ - "\u0542\3\2\2\2\u00cc\u054b\3\2\2\2\u00ce\u0551\3\2\2\2\u00d0\u0556\3\2"+ - "\2\2\u00d2\u055b\3\2\2\2\u00d4\u0560\3\2\2\2\u00d6\u0564\3\2\2\2\u00d8"+ - "\u0568\3\2\2\2\u00da\u056e\3\2\2\2\u00dc\u0576\3\2\2\2\u00de\u057c\3\2"+ - "\2\2\u00e0\u0582\3\2\2\2\u00e2\u0587\3\2\2\2\u00e4\u058e\3\2\2\2\u00e6"+ - "\u059a\3\2\2\2\u00e8\u05a0\3\2\2\2\u00ea\u05a6\3\2\2\2\u00ec\u05ae\3\2"+ - "\2\2\u00ee\u05b6\3\2\2\2\u00f0\u05c0\3\2\2\2\u00f2\u05c8\3\2\2\2\u00f4"+ - "\u05cd\3\2\2\2\u00f6\u05d0\3\2\2\2\u00f8\u05d5\3\2\2\2\u00fa\u05dd\3\2"+ - "\2\2\u00fc\u05e3\3\2\2\2\u00fe\u05e7\3\2\2\2\u0100\u05ed\3\2\2\2\u0102"+ - "\u05f8\3\2\2\2\u0104\u0603\3\2\2\2\u0106\u0606\3\2\2\2\u0108\u060c\3\2"+ - "\2\2\u010a\u0611\3\2\2\2\u010c\u0619\3\2\2\2\u010e\u061b\3\2\2\2\u0110"+ - "\u061d\3\2\2\2\u0112\u061f\3\2\2\2\u0114\u0621\3\2\2\2\u0116\u0623\3\2"+ - "\2\2\u0118\u0626\3\2\2\2\u011a\u0628\3\2\2\2\u011c\u062a\3\2\2\2\u011e"+ - "\u062c\3\2\2\2\u0120\u062e\3\2\2\2\u0122\u0630\3\2\2\2\u0124\u0633\3\2"+ - "\2\2\u0126\u0636\3\2\2\2\u0128\u0639\3\2\2\2\u012a\u063b\3\2\2\2\u012c"+ - "\u063d\3\2\2\2\u012e\u063f\3\2\2\2\u0130\u0641\3\2\2\2\u0132\u0643\3\2"+ - "\2\2\u0134\u0645\3\2\2\2\u0136\u0647\3\2\2\2\u0138\u0649\3\2\2\2\u013a"+ - "\u064c\3\2\2\2\u013c\u064f\3\2\2\2\u013e\u0651\3\2\2\2\u0140\u0653\3\2"+ - "\2\2\u0142\u0656\3\2\2\2\u0144\u0659\3\2\2\2\u0146\u065c\3\2\2\2\u0148"+ - "\u065f\3\2\2\2\u014a\u0663\3\2\2\2\u014c\u0667\3\2\2\2\u014e\u0669\3\2"+ - "\2\2\u0150\u066b\3\2\2\2\u0152\u066d\3\2\2\2\u0154\u0670\3\2\2\2\u0156"+ - "\u0673\3\2\2\2\u0158\u0675\3\2\2\2\u015a\u0677\3\2\2\2\u015c\u067a\3\2"+ - "\2\2\u015e\u067e\3\2\2\2\u0160\u0680\3\2\2\2\u0162\u0683\3\2\2\2\u0164"+ - "\u0686\3\2\2\2\u0166\u068a\3\2\2\2\u0168\u068d\3\2\2\2\u016a\u0690\3\2"+ - "\2\2\u016c\u0693\3\2\2\2\u016e\u0696\3\2\2\2\u0170\u0699\3\2\2\2\u0172"+ - "\u069c\3\2\2\2\u0174\u069f\3\2\2\2\u0176\u06a3\3\2\2\2\u0178\u06a7\3\2"+ - "\2\2\u017a\u06ac\3\2\2\2\u017c\u06b0\3\2\2\2\u017e\u06b3\3\2\2\2\u0180"+ - "\u06b5\3\2\2\2\u0182\u06bc\3\2\2\2\u0184\u06bf\3\2\2\2\u0186\u06c5\3\2"+ - "\2\2\u0188\u06c7\3\2\2\2\u018a\u06c9\3\2\2\2\u018c\u06d4\3\2\2\2\u018e"+ - "\u06dd\3\2\2\2\u0190\u06e0\3\2\2\2\u0192\u06e4\3\2\2\2\u0194\u06e6\3\2"+ - "\2\2\u0196\u06f5\3\2\2\2\u0198\u06f7\3\2\2\2\u019a\u06fa\3\2\2\2\u019c"+ - "\u06fd\3\2\2\2\u019e\u0701\3\2\2\2\u01a0\u0703\3\2\2\2\u01a2\u0705\3\2"+ - "\2\2\u01a4\u070f\3\2\2\2\u01a6\u0711\3\2\2\2\u01a8\u0714\3\2\2\2\u01aa"+ - "\u071f\3\2\2\2\u01ac\u0721\3\2\2\2\u01ae\u0728\3\2\2\2\u01b0\u072e\3\2"+ - "\2\2\u01b2\u0733\3\2\2\2\u01b4\u0735\3\2\2\2\u01b6\u073c\3\2\2\2\u01b8"+ - "\u075b\3\2\2\2\u01ba\u0767\3\2\2\2\u01bc\u0789\3\2\2\2\u01be\u07dd\3\2"+ - "\2\2\u01c0\u07df\3\2\2\2\u01c2\u07e1\3\2\2\2\u01c4\u07e3\3\2\2\2\u01c6"+ - "\u07ea\3\2\2\2\u01c8\u07ec\3\2\2\2\u01ca\u07f3\3\2\2\2\u01cc\u07fc\3\2"+ - "\2\2\u01ce\u0800\3\2\2\2\u01d0\u0804\3\2\2\2\u01d2\u0806\3\2\2\2\u01d4"+ - "\u0810\3\2\2\2\u01d6\u0816\3\2\2\2\u01d8\u081c\3\2\2\2\u01da\u081e\3\2"+ - "\2\2\u01dc\u082a\3\2\2\2\u01de\u0836\3\2\2\2\u01e0\u083c\3\2\2\2\u01e2"+ - "\u0849\3\2\2\2\u01e4\u0865\3\2\2\2\u01e6\u086c\3\2\2\2\u01e8\u0872\3\2"+ - "\2\2\u01ea\u087d\3\2\2\2\u01ec\u0886\3\2\2\2\u01ee\u0895\3\2\2\2\u01f0"+ - "\u0899\3\2\2\2\u01f2\u089d\3\2\2\2\u01f4\u08a1\3\2\2\2\u01f6\u08a6\3\2"+ - "\2\2\u01f8\u08ac\3\2\2\2\u01fa\u08b5\3\2\2\2\u01fc\u08b7\3\2\2\2\u01fe"+ - "\u08b9\3\2\2\2\u0200\u08bb\3\2\2\2\u0202\u08c0\3\2\2\2\u0204\u08c5\3\2"+ - "\2\2\u0206\u08d2\3\2\2\2\u0208\u08f9\3\2\2\2\u020a\u08fb\3\2\2\2\u020c"+ - "\u0924\3\2\2\2\u020e\u0926\3\2\2\2\u0210\u095c\3\2\2\2\u0212\u095e\3\2"+ - "\2\2\u0214\u0964\3\2\2\2\u0216\u096b\3\2\2\2\u0218\u097f\3\2\2\2\u021a"+ - "\u0992\3\2\2\2\u021c\u09ab\3\2\2\2\u021e\u09b2\3\2\2\2\u0220\u09b4\3\2"+ - "\2\2\u0222\u09b8\3\2\2\2\u0224\u09bd\3\2\2\2\u0226\u09ca\3\2\2\2\u0228"+ - "\u09cf\3\2\2\2\u022a\u09d3\3\2\2\2\u022c\u09da\3\2\2\2\u022e\u09e5\3\2"+ - "\2\2\u0230\u09e8\3\2\2\2\u0232\u0a02\3\2\2\2\u0234\u0a5c\3\2\2\2\u0236"+ - "\u0a5e\3\2\2\2\u0238\u0a62\3\2\2\2\u023a\u0a67\3\2\2\2\u023c\u0a6c\3\2"+ - "\2\2\u023e\u0a6e\3\2\2\2\u0240\u0a70\3\2\2\2\u0242\u0a72\3\2\2\2\u0244"+ - "\u0a76\3\2\2\2\u0246\u0a7a\3\2\2\2\u0248\u0a81\3\2\2\2\u024a\u0a85\3\2"+ - "\2\2\u024c\u0a87\3\2\2\2\u024e\u0a8d\3\2\2\2\u0250\u0a90\3\2\2\2\u0252"+ - "\u0a92\3\2\2\2\u0254\u0a97\3\2\2\2\u0256\u0ab2\3\2\2\2\u0258\u0ab7\3\2"+ - "\2\2\u025a\u0ab9\3\2\2\2\u025c\u0abe\3\2\2\2\u025e\u0ad9\3\2\2\2\u0260"+ - "\u0add\3\2\2\2\u0262\u0adf\3\2\2\2\u0264\u0ae1\3\2\2\2\u0266\u0ae6\3\2"+ - "\2\2\u0268\u0aec\3\2\2\2\u026a\u0af9\3\2\2\2\u026c\u0b11\3\2\2\2\u026e"+ - "\u0b23\3\2\2\2\u0270\u0b25\3\2\2\2\u0272\u0b2b\3\2\2\2\u0274\u0b31\3\2"+ - "\2\2\u0276\u0b3d\3\2\2\2\u0278\u0b4e\3\2\2\2\u027a\u0b50\3\2\2\2\u027c"+ - "\u0b68\3\2\2\2\u027e\u0b74\3\2\2\2\u0280\u0b76\3\2\2\2\u0282\u0b78\3\2"+ - "\2\2\u0284\u0b7f\3\2\2\2\u0286\u0b89\3\2\2\2\u0288\u0b8b\3\2\2\2\u028a"+ - "\u0b91\3\2\2\2\u028c\u0b98\3\2\2\2\u028e\u0b9a\3\2\2\2\u0290\u0b9f\3\2"+ - "\2\2\u0292\u0ba3\3\2\2\2\u0294\u0ba5\3\2\2\2\u0296\u0bab\3\2\2\2\u0298"+ - "\u0bc1\3\2\2\2\u029a\u0bc3\3\2\2\2\u029c\u0bcf\3\2\2\2\u029e\u0bd4\3\2"+ - "\2\2\u02a0\u02a1\7k\2\2\u02a1\u02a2\7o\2\2\u02a2\u02a3\7r\2\2\u02a3\u02a4"+ - "\7q\2\2\u02a4\u02a5\7t\2\2\u02a5\u02a6\7v\2\2\u02a6\23\3\2\2\2\u02a7\u02a8"+ - "\7c\2\2\u02a8\u02a9\7u\2\2\u02a9\25\3\2\2\2\u02aa\u02ab\7r\2\2\u02ab\u02ac"+ - "\7w\2\2\u02ac\u02ad\7d\2\2\u02ad\u02ae\7n\2\2\u02ae\u02af\7k\2\2\u02af"+ - "\u02b0\7e\2\2\u02b0\27\3\2\2\2\u02b1\u02b2\7r\2\2\u02b2\u02b3\7t\2\2\u02b3"+ - "\u02b4\7k\2\2\u02b4\u02b5\7x\2\2\u02b5\u02b6\7c\2\2\u02b6\u02b7\7v\2\2"+ - "\u02b7\u02b8\7g\2\2\u02b8\31\3\2\2\2\u02b9\u02ba\7g\2\2\u02ba\u02bb\7"+ - "z\2\2\u02bb\u02bc\7v\2\2\u02bc\u02bd\7g\2\2\u02bd\u02be\7t\2\2\u02be\u02bf"+ - "\7p\2\2\u02bf\u02c0\7c\2\2\u02c0\u02c1\7n\2\2\u02c1\33\3\2\2\2\u02c2\u02c3"+ - "\7h\2\2\u02c3\u02c4\7k\2\2\u02c4\u02c5\7p\2\2\u02c5\u02c6\7c\2\2\u02c6"+ - "\u02c7\7n\2\2\u02c7\35\3\2\2\2\u02c8\u02c9\7u\2\2\u02c9\u02ca\7g\2\2\u02ca"+ - "\u02cb\7t\2\2\u02cb\u02cc\7x\2\2\u02cc\u02cd\7k\2\2\u02cd\u02ce\7e\2\2"+ - "\u02ce\u02cf\7g\2\2\u02cf\37\3\2\2\2\u02d0\u02d1\7t\2\2\u02d1\u02d2\7"+ - "g\2\2\u02d2\u02d3\7u\2\2\u02d3\u02d4\7q\2\2\u02d4\u02d5\7w\2\2\u02d5\u02d6"+ - "\7t\2\2\u02d6\u02d7\7e\2\2\u02d7\u02d8\7g\2\2\u02d8!\3\2\2\2\u02d9\u02da"+ - "\7h\2\2\u02da\u02db\7w\2\2\u02db\u02dc\7p\2\2\u02dc\u02dd\7e\2\2\u02dd"+ - "\u02de\7v\2\2\u02de\u02df\7k\2\2\u02df\u02e0\7q\2\2\u02e0\u02e1\7p\2\2"+ - "\u02e1#\3\2\2\2\u02e2\u02e3\7q\2\2\u02e3\u02e4\7d\2\2\u02e4\u02e5\7l\2"+ - "\2\u02e5\u02e6\7g\2\2\u02e6\u02e7\7e\2\2\u02e7\u02e8\7v\2\2\u02e8%\3\2"+ - "\2\2\u02e9\u02ea\7t\2\2\u02ea\u02eb\7g\2\2\u02eb\u02ec\7e\2\2\u02ec\u02ed"+ - "\7q\2\2\u02ed\u02ee\7t\2\2\u02ee\u02ef\7f\2\2\u02ef\'\3\2\2\2\u02f0\u02f1"+ - "\7c\2\2\u02f1\u02f2\7p\2\2\u02f2\u02f3\7p\2\2\u02f3\u02f4\7q\2\2\u02f4"+ - "\u02f5\7v\2\2\u02f5\u02f6\7c\2\2\u02f6\u02f7\7v\2\2\u02f7\u02f8\7k\2\2"+ - "\u02f8\u02f9\7q\2\2\u02f9\u02fa\7p\2\2\u02fa)\3\2\2\2\u02fb\u02fc\7r\2"+ - "\2\u02fc\u02fd\7c\2\2\u02fd\u02fe\7t\2\2\u02fe\u02ff\7c\2\2\u02ff\u0300"+ - "\7o\2\2\u0300\u0301\7g\2\2\u0301\u0302\7v\2\2\u0302\u0303\7g\2\2\u0303"+ - "\u0304\7t\2\2\u0304+\3\2\2\2\u0305\u0306\7v\2\2\u0306\u0307\7t\2\2\u0307"+ - "\u0308\7c\2\2\u0308\u0309\7p\2\2\u0309\u030a\7u\2\2\u030a\u030b\7h\2\2"+ - "\u030b\u030c\7q\2\2\u030c\u030d\7t\2\2\u030d\u030e\7o\2\2\u030e\u030f"+ - "\7g\2\2\u030f\u0310\7t\2\2\u0310-\3\2\2\2\u0311\u0312\7y\2\2\u0312\u0313"+ - "\7q\2\2\u0313\u0314\7t\2\2\u0314\u0315\7m\2\2\u0315\u0316\7g\2\2\u0316"+ - "\u0317\7t\2\2\u0317/\3\2\2\2\u0318\u0319\7n\2\2\u0319\u031a\7k\2\2\u031a"+ - "\u031b\7u\2\2\u031b\u031c\7v\2\2\u031c\u031d\7g\2\2\u031d\u031e\7p\2\2"+ - "\u031e\u031f\7g\2\2\u031f\u0320\7t\2\2\u0320\61\3\2\2\2\u0321\u0322\7"+ - "t\2\2\u0322\u0323\7g\2\2\u0323\u0324\7o\2\2\u0324\u0325\7q\2\2\u0325\u0326"+ - "\7v\2\2\u0326\u0327\7g\2\2\u0327\63\3\2\2\2\u0328\u0329\7z\2\2\u0329\u032a"+ - "\7o\2\2\u032a\u032b\7n\2\2\u032b\u032c\7p\2\2\u032c\u032d\7u\2\2\u032d"+ - "\65\3\2\2\2\u032e\u032f\7t\2\2\u032f\u0330\7g\2\2\u0330\u0331\7v\2\2\u0331"+ - "\u0332\7w\2\2\u0332\u0333\7t\2\2\u0333\u0334\7p\2\2\u0334\u0335\7u\2\2"+ - "\u0335\67\3\2\2\2\u0336\u0337\7x\2\2\u0337\u0338\7g\2\2\u0338\u0339\7"+ - "t\2\2\u0339\u033a\7u\2\2\u033a\u033b\7k\2\2\u033b\u033c\7q\2\2\u033c\u033d"+ - "\7p\2\2\u033d9\3\2\2\2\u033e\u033f\7e\2\2\u033f\u0340\7j\2\2\u0340\u0341"+ - "\7c\2\2\u0341\u0342\7p\2\2\u0342\u0343\7p\2\2\u0343\u0344\7g\2\2\u0344"+ - "\u0345\7n\2\2\u0345;\3\2\2\2\u0346\u0347\7c\2\2\u0347\u0348\7d\2\2\u0348"+ - "\u0349\7u\2\2\u0349\u034a\7v\2\2\u034a\u034b\7t\2\2\u034b\u034c\7c\2\2"+ - "\u034c\u034d\7e\2\2\u034d\u034e\7v\2\2\u034e=\3\2\2\2\u034f\u0350\7e\2"+ - "\2\u0350\u0351\7n\2\2\u0351\u0352\7k\2\2\u0352\u0353\7g\2\2\u0353\u0354"+ - "\7p\2\2\u0354\u0355\7v\2\2\u0355?\3\2\2\2\u0356\u0357\7e\2\2\u0357\u0358"+ - "\7q\2\2\u0358\u0359\7p\2\2\u0359\u035a\7u\2\2\u035a\u035b\7v\2\2\u035b"+ - "A\3\2\2\2\u035c\u035d\7v\2\2\u035d\u035e\7{\2\2\u035e\u035f\7r\2\2\u035f"+ - "\u0360\7g\2\2\u0360\u0361\7q\2\2\u0361\u0362\7h\2\2\u0362C\3\2\2\2\u0363"+ - "\u0364\7u\2\2\u0364\u0365\7q\2\2\u0365\u0366\7w\2\2\u0366\u0367\7t\2\2"+ - "\u0367\u0368\7e\2\2\u0368\u0369\7g\2\2\u0369E\3\2\2\2\u036a\u036b\7h\2"+ - "\2\u036b\u036c\7t\2\2\u036c\u036d\7q\2\2\u036d\u036e\7o\2\2\u036e\u036f"+ - "\3\2\2\2\u036f\u0370\b\34\2\2\u0370G\3\2\2\2\u0371\u0372\7q\2\2\u0372"+ - "\u0373\7p\2\2\u0373I\3\2\2\2\u0374\u0375\6\36\2\2\u0375\u0376\7u\2\2\u0376"+ - "\u0377\7g\2\2\u0377\u0378\7n\2\2\u0378\u0379\7g\2\2\u0379\u037a\7e\2\2"+ - "\u037a\u037b\7v\2\2\u037b\u037c\3\2\2\2\u037c\u037d\b\36\3\2\u037dK\3"+ - "\2\2\2\u037e\u037f\7i\2\2\u037f\u0380\7t\2\2\u0380\u0381\7q\2\2\u0381"+ - "\u0382\7w\2\2\u0382\u0383\7r\2\2\u0383M\3\2\2\2\u0384\u0385\7d\2\2\u0385"+ - "\u0386\7{\2\2\u0386O\3\2\2\2\u0387\u0388\7j\2\2\u0388\u0389\7c\2\2\u0389"+ - "\u038a\7x\2\2\u038a\u038b\7k\2\2\u038b\u038c\7p\2\2\u038c\u038d\7i\2\2"+ - "\u038dQ\3\2\2\2\u038e\u038f\7q\2\2\u038f\u0390\7t\2\2\u0390\u0391\7f\2"+ - "\2\u0391\u0392\7g\2\2\u0392\u0393\7t\2\2\u0393S\3\2\2\2\u0394\u0395\7"+ - "y\2\2\u0395\u0396\7j\2\2\u0396\u0397\7g\2\2\u0397\u0398\7t\2\2\u0398\u0399"+ - "\7g\2\2\u0399U\3\2\2\2\u039a\u039b\7h\2\2\u039b\u039c\7q\2\2\u039c\u039d"+ - "\7n\2\2\u039d\u039e\7n\2\2\u039e\u039f\7q\2\2\u039f\u03a0\7y\2\2\u03a0"+ - "\u03a1\7g\2\2\u03a1\u03a2\7f\2\2\u03a2W\3\2\2\2\u03a3\u03a4\7h\2\2\u03a4"+ - "\u03a5\7q\2\2\u03a5\u03a6\7t\2\2\u03a6\u03a7\3\2\2\2\u03a7\u03a8\b%\4"+ - "\2\u03a8Y\3\2\2\2\u03a9\u03aa\7y\2\2\u03aa\u03ab\7k\2\2\u03ab\u03ac\7"+ - "p\2\2\u03ac\u03ad\7f\2\2\u03ad\u03ae\7q\2\2\u03ae\u03af\7y\2\2\u03af["+ - "\3\2\2\2\u03b0\u03b1\6\'\3\2\u03b1\u03b2\7g\2\2\u03b2\u03b3\7x\2\2\u03b3"+ - "\u03b4\7g\2\2\u03b4\u03b5\7p\2\2\u03b5\u03b6\7v\2\2\u03b6\u03b7\7u\2\2"+ - "\u03b7\u03b8\3\2\2\2\u03b8\u03b9\b\'\5\2\u03b9]\3\2\2\2\u03ba\u03bb\7"+ - "g\2\2\u03bb\u03bc\7x\2\2\u03bc\u03bd\7g\2\2\u03bd\u03be\7t\2\2\u03be\u03bf"+ - "\7{\2\2\u03bf_\3\2\2\2\u03c0\u03c1\7y\2\2\u03c1\u03c2\7k\2\2\u03c2\u03c3"+ - "\7v\2\2\u03c3\u03c4\7j\2\2\u03c4\u03c5\7k\2\2\u03c5\u03c6\7p\2\2\u03c6"+ - "\u03c7\3\2\2\2\u03c7\u03c8\b)\6\2\u03c8a\3\2\2\2\u03c9\u03ca\6*\4\2\u03ca"+ - "\u03cb\7n\2\2\u03cb\u03cc\7c\2\2\u03cc\u03cd\7u\2\2\u03cd\u03ce\7v\2\2"+ - "\u03ce\u03cf\3\2\2\2\u03cf\u03d0\b*\7\2\u03d0c\3\2\2\2\u03d1\u03d2\6+"+ - "\5\2\u03d2\u03d3\7h\2\2\u03d3\u03d4\7k\2\2\u03d4\u03d5\7t\2\2\u03d5\u03d6"+ - "\7u\2\2\u03d6\u03d7\7v\2\2\u03d7\u03d8\3\2\2\2\u03d8\u03d9\b+\b\2\u03d9"+ - "e\3\2\2\2\u03da\u03db\7u\2\2\u03db\u03dc\7p\2\2\u03dc\u03dd\7c\2\2\u03dd"+ - "\u03de\7r\2\2\u03de\u03df\7u\2\2\u03df\u03e0\7j\2\2\u03e0\u03e1\7q\2\2"+ - "\u03e1\u03e2\7v\2\2\u03e2g\3\2\2\2\u03e3\u03e4\6-\6\2\u03e4\u03e5\7q\2"+ - "\2\u03e5\u03e6\7w\2\2\u03e6\u03e7\7v\2\2\u03e7\u03e8\7r\2\2\u03e8\u03e9"+ - "\7w\2\2\u03e9\u03ea\7v\2\2\u03ea\u03eb\3\2\2\2\u03eb\u03ec\b-\t\2\u03ec"+ - "i\3\2\2\2\u03ed\u03ee\7k\2\2\u03ee\u03ef\7p\2\2\u03ef\u03f0\7p\2\2\u03f0"+ - "\u03f1\7g\2\2\u03f1\u03f2\7t\2\2\u03f2k\3\2\2\2\u03f3\u03f4\7q\2\2\u03f4"+ - "\u03f5\7w\2\2\u03f5\u03f6\7v\2\2\u03f6\u03f7\7g\2\2\u03f7\u03f8\7t\2\2"+ - "\u03f8m\3\2\2\2\u03f9\u03fa\7t\2\2\u03fa\u03fb\7k\2\2\u03fb\u03fc\7i\2"+ - "\2\u03fc\u03fd\7j\2\2\u03fd\u03fe\7v\2\2\u03feo\3\2\2\2\u03ff\u0400\7"+ - "n\2\2\u0400\u0401\7g\2\2\u0401\u0402\7h\2\2\u0402\u0403\7v\2\2\u0403q"+ - "\3\2\2\2\u0404\u0405\7h\2\2\u0405\u0406\7w\2\2\u0406\u0407\7n\2\2\u0407"+ - "\u0408\7n\2\2\u0408s\3\2\2\2\u0409\u040a\7w\2\2\u040a\u040b\7p\2\2\u040b"+ - "\u040c\7k\2\2\u040c\u040d\7f\2\2\u040d\u040e\7k\2\2\u040e\u040f\7t\2\2"+ - "\u040f\u0410\7g\2\2\u0410\u0411\7e\2\2\u0411\u0412\7v\2\2\u0412\u0413"+ - "\7k\2\2\u0413\u0414\7q\2\2\u0414\u0415\7p\2\2\u0415\u0416\7c\2\2\u0416"+ - "\u0417\7n\2\2\u0417u\3\2\2\2\u0418\u0419\6\64\7\2\u0419\u041a\7u\2\2\u041a"+ - "\u041b\7g\2\2\u041b\u041c\7e\2\2\u041c\u041d\7q\2\2\u041d\u041e\7p\2\2"+ - "\u041e\u041f\7f\2\2\u041f\u0420\3\2\2\2\u0420\u0421\b\64\n\2\u0421w\3"+ - "\2\2\2\u0422\u0423\6\65\b\2\u0423\u0424\7o\2\2\u0424\u0425\7k\2\2\u0425"+ - "\u0426\7p\2\2\u0426\u0427\7w\2\2\u0427\u0428\7v\2\2\u0428\u0429\7g\2\2"+ - "\u0429\u042a\3\2\2\2\u042a\u042b\b\65\13\2\u042by\3\2\2\2\u042c\u042d"+ - "\6\66\t\2\u042d\u042e\7j\2\2\u042e\u042f\7q\2\2\u042f\u0430\7w\2\2\u0430"+ - "\u0431\7t\2\2\u0431\u0432\3\2\2\2\u0432\u0433\b\66\f\2\u0433{\3\2\2\2"+ - "\u0434\u0435\6\67\n\2\u0435\u0436\7f\2\2\u0436\u0437\7c\2\2\u0437\u0438"+ - "\7{\2\2\u0438\u0439\3\2\2\2\u0439\u043a\b\67\r\2\u043a}\3\2\2\2\u043b"+ - "\u043c\68\13\2\u043c\u043d\7o\2\2\u043d\u043e\7q\2\2\u043e\u043f\7p\2"+ - "\2\u043f\u0440\7v\2\2\u0440\u0441\7j\2\2\u0441\u0442\3\2\2\2\u0442\u0443"+ - "\b8\16\2\u0443\177\3\2\2\2\u0444\u0445\69\f\2\u0445\u0446\7{\2\2\u0446"+ - "\u0447\7g\2\2\u0447\u0448\7c\2\2\u0448\u0449\7t\2\2\u0449\u044a\3\2\2"+ - "\2\u044a\u044b\b9\17\2\u044b\u0081\3\2\2\2\u044c\u044d\6:\r\2\u044d\u044e"+ - "\7u\2\2\u044e\u044f\7g\2\2\u044f\u0450\7e\2\2\u0450\u0451\7q\2\2\u0451"+ - "\u0452\7p\2\2\u0452\u0453\7f\2\2\u0453\u0454\7u\2\2\u0454\u0455\3\2\2"+ - "\2\u0455\u0456\b:\20\2\u0456\u0083\3\2\2\2\u0457\u0458\6;\16\2\u0458\u0459"+ - "\7o\2\2\u0459\u045a\7k\2\2\u045a\u045b\7p\2\2\u045b\u045c\7w\2\2\u045c"+ - "\u045d\7v\2\2\u045d\u045e\7g\2\2\u045e\u045f\7u\2\2\u045f\u0460\3\2\2"+ - "\2\u0460\u0461\b;\21\2\u0461\u0085\3\2\2\2\u0462\u0463\6<\17\2\u0463\u0464"+ - "\7j\2\2\u0464\u0465\7q\2\2\u0465\u0466\7w\2\2\u0466\u0467\7t\2\2\u0467"+ - "\u0468\7u\2\2\u0468\u0469\3\2\2\2\u0469\u046a\b<\22\2\u046a\u0087\3\2"+ - "\2\2\u046b\u046c\6=\20\2\u046c\u046d\7f\2\2\u046d\u046e\7c\2\2\u046e\u046f"+ - "\7{\2\2\u046f\u0470\7u\2\2\u0470\u0471\3\2\2\2\u0471\u0472\b=\23\2\u0472"+ - "\u0089\3\2\2\2\u0473\u0474\6>\21\2\u0474\u0475\7o\2\2\u0475\u0476\7q\2"+ - "\2\u0476\u0477\7p\2\2\u0477\u0478\7v\2\2\u0478\u0479\7j\2\2\u0479\u047a"+ - "\7u\2\2\u047a\u047b\3\2\2\2\u047b\u047c\b>\24\2\u047c\u008b\3\2\2\2\u047d"+ - "\u047e\6?\22\2\u047e\u047f\7{\2\2\u047f\u0480\7g\2\2\u0480\u0481\7c\2"+ - "\2\u0481\u0482\7t\2\2\u0482\u0483\7u\2\2\u0483\u0484\3\2\2\2\u0484\u0485"+ - "\b?\25\2\u0485\u008d\3\2\2\2\u0486\u0487\7h\2\2\u0487\u0488\7q\2\2\u0488"+ - "\u0489\7t\2\2\u0489\u048a\7g\2\2\u048a\u048b\7x\2\2\u048b\u048c\7g\2\2"+ - "\u048c\u048d\7t\2\2\u048d\u008f\3\2\2\2\u048e\u048f\7n\2\2\u048f\u0490"+ - "\7k\2\2\u0490\u0491\7o\2\2\u0491\u0492\7k\2\2\u0492\u0493\7v\2\2\u0493"+ - "\u0091\3\2\2\2\u0494\u0495\7c\2\2\u0495\u0496\7u\2\2\u0496\u0497\7e\2"+ - "\2\u0497\u0498\7g\2\2\u0498\u0499\7p\2\2\u0499\u049a\7f\2\2\u049a\u049b"+ - "\7k\2\2\u049b\u049c\7p\2\2\u049c\u049d\7i\2\2\u049d\u0093\3\2\2\2\u049e"+ - "\u049f\7f\2\2\u049f\u04a0\7g\2\2\u04a0\u04a1\7u\2\2\u04a1\u04a2\7e\2\2"+ - "\u04a2\u04a3\7g\2\2\u04a3\u04a4\7p\2\2\u04a4\u04a5\7f\2\2\u04a5\u04a6"+ - "\7k\2\2\u04a6\u04a7\7p\2\2\u04a7\u04a8\7i\2\2\u04a8\u0095\3\2\2\2\u04a9"+ - "\u04aa\7k\2\2\u04aa\u04ab\7p\2\2\u04ab\u04ac\7v\2\2\u04ac\u0097\3\2\2"+ - "\2\u04ad\u04ae\7d\2\2\u04ae\u04af\7{\2\2\u04af\u04b0\7v\2\2\u04b0\u04b1"+ - "\7g\2\2\u04b1\u0099\3\2\2\2\u04b2\u04b3\7h\2\2\u04b3\u04b4\7n\2\2\u04b4"+ - "\u04b5\7q\2\2\u04b5\u04b6\7c\2\2\u04b6\u04b7\7v\2\2\u04b7\u009b\3\2\2"+ - "\2\u04b8\u04b9\7f\2\2\u04b9\u04ba\7g\2\2\u04ba\u04bb\7e\2\2\u04bb\u04bc"+ - "\7k\2\2\u04bc\u04bd\7o\2\2\u04bd\u04be\7c\2\2\u04be\u04bf\7n\2\2\u04bf"+ - "\u009d\3\2\2\2\u04c0\u04c1\7d\2\2\u04c1\u04c2\7q\2\2\u04c2\u04c3\7q\2"+ - "\2\u04c3\u04c4\7n\2\2\u04c4\u04c5\7g\2\2\u04c5\u04c6\7c\2\2\u04c6\u04c7"+ - "\7p\2\2\u04c7\u009f\3\2\2\2\u04c8\u04c9\7u\2\2\u04c9\u04ca\7v\2\2\u04ca"+ - "\u04cb\7t\2\2\u04cb\u04cc\7k\2\2\u04cc\u04cd\7p\2\2\u04cd\u04ce\7i\2\2"+ - "\u04ce\u00a1\3\2\2\2\u04cf\u04d0\7g\2\2\u04d0\u04d1\7t\2\2\u04d1\u04d2"+ - "\7t\2\2\u04d2\u04d3\7q\2\2\u04d3\u04d4\7t\2\2\u04d4\u00a3\3\2\2\2\u04d5"+ - "\u04d6\7o\2\2\u04d6\u04d7\7c\2\2\u04d7\u04d8\7r\2\2\u04d8\u00a5\3\2\2"+ - "\2\u04d9\u04da\7l\2\2\u04da\u04db\7u\2\2\u04db\u04dc\7q\2\2\u04dc\u04dd"+ - "\7p\2\2\u04dd\u00a7\3\2\2\2\u04de\u04df\7z\2\2\u04df\u04e0\7o\2\2\u04e0"+ - "\u04e1\7n\2\2\u04e1\u00a9\3\2\2\2\u04e2\u04e3\7v\2\2\u04e3\u04e4\7c\2"+ - "\2\u04e4\u04e5\7d\2\2\u04e5\u04e6\7n\2\2\u04e6\u04e7\7g\2\2\u04e7\u00ab"+ - "\3\2\2\2\u04e8\u04e9\7u\2\2\u04e9\u04ea\7v\2\2\u04ea\u04eb\7t\2\2\u04eb"+ - "\u04ec\7g\2\2\u04ec\u04ed\7c\2\2\u04ed\u04ee\7o\2\2\u04ee\u00ad\3\2\2"+ - "\2\u04ef\u04f0\7c\2\2\u04f0\u04f1\7p\2\2\u04f1\u04f2\7{\2\2\u04f2\u00af"+ - "\3\2\2\2\u04f3\u04f4\7v\2\2\u04f4\u04f5\7{\2\2\u04f5\u04f6\7r\2\2\u04f6"+ - "\u04f7\7g\2\2\u04f7\u04f8\7f\2\2\u04f8\u04f9\7g\2\2\u04f9\u04fa\7u\2\2"+ - "\u04fa\u04fb\7e\2\2\u04fb\u00b1\3\2\2\2\u04fc\u04fd\7v\2\2\u04fd\u04fe"+ - "\7{\2\2\u04fe\u04ff\7r\2\2\u04ff\u0500\7g\2\2\u0500\u00b3\3\2\2\2\u0501"+ - "\u0502\7h\2\2\u0502\u0503\7w\2\2\u0503\u0504\7v\2\2\u0504\u0505\7w\2\2"+ - "\u0505\u0506\7t\2\2\u0506\u0507\7g\2\2\u0507\u00b5\3\2\2\2\u0508\u0509"+ - "\7c\2\2\u0509\u050a\7p\2\2\u050a\u050b\7{\2\2\u050b\u050c\7f\2\2\u050c"+ - "\u050d\7c\2\2\u050d\u050e\7v\2\2\u050e\u050f\7c\2\2\u050f\u00b7\3\2\2"+ - "\2\u0510\u0511\7j\2\2\u0511\u0512\7c\2\2\u0512\u0513\7p\2\2\u0513\u0514"+ - "\7f\2\2\u0514\u0515\7n\2\2\u0515\u0516\7g\2\2\u0516\u00b9\3\2\2\2\u0517"+ - "\u0518\7x\2\2\u0518\u0519\7c\2\2\u0519\u051a\7t\2\2\u051a\u00bb\3\2\2"+ - "\2\u051b\u051c\7p\2\2\u051c\u051d\7g\2\2\u051d\u051e\7y\2\2\u051e\u00bd"+ - "\3\2\2\2\u051f\u0520\7a\2\2\u0520\u0521\7a\2\2\u0521\u0522\7k\2\2\u0522"+ - "\u0523\7p\2\2\u0523\u0524\7k\2\2\u0524\u0525\7v\2\2\u0525\u00bf\3\2\2"+ - "\2\u0526\u0527\7k\2\2\u0527\u0528\7h\2\2\u0528\u00c1\3\2\2\2\u0529\u052a"+ - "\7o\2\2\u052a\u052b\7c\2\2\u052b\u052c\7v\2\2\u052c\u052d\7e\2\2\u052d"+ - "\u052e\7j\2\2\u052e\u00c3\3\2\2\2\u052f\u0530\7g\2\2\u0530\u0531\7n\2"+ - "\2\u0531\u0532\7u\2\2\u0532\u0533\7g\2\2\u0533\u00c5\3\2\2\2\u0534\u0535"+ - "\7h\2\2\u0535\u0536\7q\2\2\u0536\u0537\7t\2\2\u0537\u0538\7g\2\2\u0538"+ - "\u0539\7c\2\2\u0539\u053a\7e\2\2\u053a\u053b\7j\2\2\u053b\u00c7\3\2\2"+ - "\2\u053c\u053d\7y\2\2\u053d\u053e\7j\2\2\u053e\u053f\7k\2\2\u053f\u0540"+ - "\7n\2\2\u0540\u0541\7g\2\2\u0541\u00c9\3\2\2\2\u0542\u0543\7e\2\2\u0543"+ - "\u0544\7q\2\2\u0544\u0545\7p\2\2\u0545\u0546\7v\2\2\u0546\u0547\7k\2\2"+ - "\u0547\u0548\7p\2\2\u0548\u0549\7w\2\2\u0549\u054a\7g\2\2\u054a\u00cb"+ - "\3\2\2\2\u054b\u054c\7d\2\2\u054c\u054d\7t\2\2\u054d\u054e\7g\2\2\u054e"+ - "\u054f\7c\2\2\u054f\u0550\7m\2\2\u0550\u00cd\3\2\2\2\u0551\u0552\7h\2"+ - "\2\u0552\u0553\7q\2\2\u0553\u0554\7t\2\2\u0554\u0555\7m\2\2\u0555\u00cf"+ - "\3\2\2\2\u0556\u0557\7l\2\2\u0557\u0558\7q\2\2\u0558\u0559\7k\2\2\u0559"+ - "\u055a\7p\2\2\u055a\u00d1\3\2\2\2\u055b\u055c\7u\2\2\u055c\u055d\7q\2"+ - "\2\u055d\u055e\7o\2\2\u055e\u055f\7g\2\2\u055f\u00d3\3\2\2\2\u0560\u0561"+ - "\7c\2\2\u0561\u0562\7n\2\2\u0562\u0563\7n\2\2\u0563\u00d5\3\2\2\2\u0564"+ - "\u0565\7v\2\2\u0565\u0566\7t\2\2\u0566\u0567\7{\2\2\u0567\u00d7\3\2\2"+ - "\2\u0568\u0569\7e\2\2\u0569\u056a\7c\2\2\u056a\u056b\7v\2\2\u056b\u056c"+ - "\7e\2\2\u056c\u056d\7j\2\2\u056d\u00d9\3\2\2\2\u056e\u056f\7h\2\2\u056f"+ - "\u0570\7k\2\2\u0570\u0571\7p\2\2\u0571\u0572\7c\2\2\u0572\u0573\7n\2\2"+ - "\u0573\u0574\7n\2\2\u0574\u0575\7{\2\2\u0575\u00db\3\2\2\2\u0576\u0577"+ - "\7v\2\2\u0577\u0578\7j\2\2\u0578\u0579\7t\2\2\u0579\u057a\7q\2\2\u057a"+ - "\u057b\7y\2\2\u057b\u00dd\3\2\2\2\u057c\u057d\7r\2\2\u057d\u057e\7c\2"+ - "\2\u057e\u057f\7p\2\2\u057f\u0580\7k\2\2\u0580\u0581\7e\2\2\u0581\u00df"+ - "\3\2\2\2\u0582\u0583\7v\2\2\u0583\u0584\7t\2\2\u0584\u0585\7c\2\2\u0585"+ - "\u0586\7r\2\2\u0586\u00e1\3\2\2\2\u0587\u0588\7t\2\2\u0588\u0589\7g\2"+ - "\2\u0589\u058a\7v\2\2\u058a\u058b\7w\2\2\u058b\u058c\7t\2\2\u058c\u058d"+ - "\7p\2\2\u058d\u00e3\3\2\2\2\u058e\u058f\7v\2\2\u058f\u0590\7t\2\2\u0590"+ - "\u0591\7c\2\2\u0591\u0592\7p\2\2\u0592\u0593\7u\2\2\u0593\u0594\7c\2\2"+ - "\u0594\u0595\7e\2\2\u0595\u0596\7v\2\2\u0596\u0597\7k\2\2\u0597\u0598"+ - "\7q\2\2\u0598\u0599\7p\2\2\u0599\u00e5\3\2\2\2\u059a\u059b\7c\2\2\u059b"+ - "\u059c\7d\2\2\u059c\u059d\7q\2\2\u059d\u059e\7t\2\2\u059e\u059f\7v\2\2"+ - "\u059f\u00e7\3\2\2\2\u05a0\u05a1\7t\2\2\u05a1\u05a2\7g\2\2\u05a2\u05a3"+ - "\7v\2\2\u05a3\u05a4\7t\2\2\u05a4\u05a5\7{\2\2\u05a5\u00e9\3\2\2\2\u05a6"+ - "\u05a7\7q\2\2\u05a7\u05a8\7p\2\2\u05a8\u05a9\7t\2\2\u05a9\u05aa\7g\2\2"+ - "\u05aa\u05ab\7v\2\2\u05ab\u05ac\7t\2\2\u05ac\u05ad\7{\2\2\u05ad\u00eb"+ - "\3\2\2\2\u05ae\u05af\7t\2\2\u05af\u05b0\7g\2\2\u05b0\u05b1\7v\2\2\u05b1"+ - "\u05b2\7t\2\2\u05b2\u05b3\7k\2\2\u05b3\u05b4\7g\2\2\u05b4\u05b5\7u\2\2"+ - "\u05b5\u00ed\3\2\2\2\u05b6\u05b7\7e\2\2\u05b7\u05b8\7q\2\2\u05b8\u05b9"+ - "\7o\2\2\u05b9\u05ba\7o\2\2\u05ba\u05bb\7k\2\2\u05bb\u05bc\7v\2\2\u05bc"+ - "\u05bd\7v\2\2\u05bd\u05be\7g\2\2\u05be\u05bf\7f\2\2\u05bf\u00ef\3\2\2"+ - "\2\u05c0\u05c1\7c\2\2\u05c1\u05c2\7d\2\2\u05c2\u05c3\7q\2\2\u05c3\u05c4"+ - "\7t\2\2\u05c4\u05c5\7v\2\2\u05c5\u05c6\7g\2\2\u05c6\u05c7\7f\2\2\u05c7"+ - "\u00f1\3\2\2\2\u05c8\u05c9\7y\2\2\u05c9\u05ca\7k\2\2\u05ca\u05cb\7v\2"+ - "\2\u05cb\u05cc\7j\2\2\u05cc\u00f3\3\2\2\2\u05cd\u05ce\7k\2\2\u05ce\u05cf"+ - "\7p\2\2\u05cf\u00f5\3\2\2\2\u05d0\u05d1\7n\2\2\u05d1\u05d2\7q\2\2\u05d2"+ - "\u05d3\7e\2\2\u05d3\u05d4\7m\2\2\u05d4\u00f7\3\2\2\2\u05d5\u05d6\7w\2"+ - "\2\u05d6\u05d7\7p\2\2\u05d7\u05d8\7v\2\2\u05d8\u05d9\7c\2\2\u05d9\u05da"+ - "\7k\2\2\u05da\u05db\7p\2\2\u05db\u05dc\7v\2\2\u05dc\u00f9\3\2\2\2\u05dd"+ - "\u05de\7u\2\2\u05de\u05df\7v\2\2\u05df\u05e0\7c\2\2\u05e0\u05e1\7t\2\2"+ - "\u05e1\u05e2\7v\2\2\u05e2\u00fb\3\2\2\2\u05e3\u05e4\7d\2\2\u05e4\u05e5"+ - "\7w\2\2\u05e5\u05e6\7v\2\2\u05e6\u00fd\3\2\2\2\u05e7\u05e8\7e\2\2\u05e8"+ - "\u05e9\7j\2\2\u05e9\u05ea\7g\2\2\u05ea\u05eb\7e\2\2\u05eb\u05ec\7m\2\2"+ - "\u05ec\u00ff\3\2\2\2\u05ed\u05ee\7e\2\2\u05ee\u05ef\7j\2\2\u05ef\u05f0"+ - "\7g\2\2\u05f0\u05f1\7e\2\2\u05f1\u05f2\7m\2\2\u05f2\u05f3\7r\2\2\u05f3"+ - "\u05f4\7c\2\2\u05f4\u05f5\7p\2\2\u05f5\u05f6\7k\2\2\u05f6\u05f7\7e\2\2"+ - "\u05f7\u0101\3\2\2\2\u05f8\u05f9\7r\2\2\u05f9\u05fa\7t\2\2\u05fa\u05fb"+ - "\7k\2\2\u05fb\u05fc\7o\2\2\u05fc\u05fd\7c\2\2\u05fd\u05fe\7t\2\2\u05fe"+ - "\u05ff\7{\2\2\u05ff\u0600\7m\2\2\u0600\u0601\7g\2\2\u0601\u0602\7{\2\2"+ - "\u0602\u0103\3\2\2\2\u0603\u0604\7k\2\2\u0604\u0605\7u\2\2\u0605\u0105"+ - "\3\2\2\2\u0606\u0607\7h\2\2\u0607\u0608\7n\2\2\u0608\u0609\7w\2\2\u0609"+ - "\u060a\7u\2\2\u060a\u060b\7j\2\2\u060b\u0107\3\2\2\2\u060c\u060d\7y\2"+ - "\2\u060d\u060e\7c\2\2\u060e\u060f\7k\2\2\u060f\u0610\7v\2\2\u0610\u0109"+ - "\3\2\2\2\u0611\u0612\7f\2\2\u0612\u0613\7g\2\2\u0613\u0614\7h\2\2\u0614"+ - "\u0615\7c\2\2\u0615\u0616\7w\2\2\u0616\u0617\7n\2\2\u0617\u0618\7v\2\2"+ - "\u0618\u010b\3\2\2\2\u0619\u061a\7=\2\2\u061a\u010d\3\2\2\2\u061b\u061c"+ - "\7<\2\2\u061c\u010f\3\2\2\2\u061d\u061e\7\60\2\2\u061e\u0111\3\2\2\2\u061f"+ - "\u0620\7.\2\2\u0620\u0113\3\2\2\2\u0621\u0622\7}\2\2\u0622\u0115\3\2\2"+ - "\2\u0623\u0624\7\177\2\2\u0624\u0625\b\u0084\26\2\u0625\u0117\3\2\2\2"+ - "\u0626\u0627\7*\2\2\u0627\u0119\3\2\2\2\u0628\u0629\7+\2\2\u0629\u011b"+ - "\3\2\2\2\u062a\u062b\7]\2\2\u062b\u011d\3\2\2\2\u062c\u062d\7_\2\2\u062d"+ - "\u011f\3\2\2\2\u062e\u062f\7A\2\2\u062f\u0121\3\2\2\2\u0630\u0631\7A\2"+ - "\2\u0631\u0632\7\60\2\2\u0632\u0123\3\2\2\2\u0633\u0634\7}\2\2\u0634\u0635"+ - "\7~\2\2\u0635\u0125\3\2\2\2\u0636\u0637\7~\2\2\u0637\u0638\7\177\2\2\u0638"+ - "\u0127\3\2\2\2\u0639\u063a\7%\2\2\u063a\u0129\3\2\2\2\u063b\u063c\7?\2"+ - "\2\u063c\u012b\3\2\2\2\u063d\u063e\7-\2\2\u063e\u012d\3\2\2\2\u063f\u0640"+ - "\7/\2\2\u0640\u012f\3\2\2\2\u0641\u0642\7,\2\2\u0642\u0131\3\2\2\2\u0643"+ - "\u0644\7\61\2\2\u0644\u0133\3\2\2\2\u0645\u0646\7\'\2\2\u0646\u0135\3"+ - "\2\2\2\u0647\u0648\7#\2\2\u0648\u0137\3\2\2\2\u0649\u064a\7?\2\2\u064a"+ - "\u064b\7?\2\2\u064b\u0139\3\2\2\2\u064c\u064d\7#\2\2\u064d\u064e\7?\2"+ - "\2\u064e\u013b\3\2\2\2\u064f\u0650\7@\2\2\u0650\u013d\3\2\2\2\u0651\u0652"+ - "\7>\2\2\u0652\u013f\3\2\2\2\u0653\u0654\7@\2\2\u0654\u0655\7?\2\2\u0655"+ - "\u0141\3\2\2\2\u0656\u0657\7>\2\2\u0657\u0658\7?\2\2\u0658\u0143\3\2\2"+ - "\2\u0659\u065a\7(\2\2\u065a\u065b\7(\2\2\u065b\u0145\3\2\2\2\u065c\u065d"+ - "\7~\2\2\u065d\u065e\7~\2\2\u065e\u0147\3\2\2\2\u065f\u0660\7?\2\2\u0660"+ - "\u0661\7?\2\2\u0661\u0662\7?\2\2\u0662\u0149\3\2\2\2\u0663\u0664\7#\2"+ - "\2\u0664\u0665\7?\2\2\u0665\u0666\7?\2\2\u0666\u014b\3\2\2\2\u0667\u0668"+ - "\7(\2\2\u0668\u014d\3\2\2\2\u0669\u066a\7`\2\2\u066a\u014f\3\2\2\2\u066b"+ - "\u066c\7\u0080\2\2\u066c\u0151\3\2\2\2\u066d\u066e\7/\2\2\u066e\u066f"+ - "\7@\2\2\u066f\u0153\3\2\2\2\u0670\u0671\7>\2\2\u0671\u0672\7/\2\2\u0672"+ - "\u0155\3\2\2\2\u0673\u0674\7B\2\2\u0674\u0157\3\2\2\2\u0675\u0676\7b\2"+ - "\2\u0676\u0159\3\2\2\2\u0677\u0678\7\60\2\2\u0678\u0679\7\60\2\2\u0679"+ - "\u015b\3\2\2\2\u067a\u067b\7\60\2\2\u067b\u067c\7\60\2\2\u067c\u067d\7"+ - "\60\2\2\u067d\u015d\3\2\2\2\u067e\u067f\7~\2\2\u067f\u015f\3\2\2\2\u0680"+ - "\u0681\7?\2\2\u0681\u0682\7@\2\2\u0682\u0161\3\2\2\2\u0683\u0684\7A\2"+ - "\2\u0684\u0685\7<\2\2\u0685\u0163\3\2\2\2\u0686\u0687\7/\2\2\u0687\u0688"+ - "\7@\2\2\u0688\u0689\7@\2\2\u0689\u0165\3\2\2\2\u068a\u068b\7-\2\2\u068b"+ - "\u068c\7?\2\2\u068c\u0167\3\2\2\2\u068d\u068e\7/\2\2\u068e\u068f\7?\2"+ - "\2\u068f\u0169\3\2\2\2\u0690\u0691\7,\2\2\u0691\u0692\7?\2\2\u0692\u016b"+ - "\3\2\2\2\u0693\u0694\7\61\2\2\u0694\u0695\7?\2\2\u0695\u016d\3\2\2\2\u0696"+ - "\u0697\7(\2\2\u0697\u0698\7?\2\2\u0698\u016f\3\2\2\2\u0699\u069a\7~\2"+ - "\2\u069a\u069b\7?\2\2\u069b\u0171\3\2\2\2\u069c\u069d\7`\2\2\u069d\u069e"+ - "\7?\2\2\u069e\u0173\3\2\2\2\u069f\u06a0\7>\2\2\u06a0\u06a1\7>\2\2\u06a1"+ - "\u06a2\7?\2\2\u06a2\u0175\3\2\2\2\u06a3\u06a4\7@\2\2\u06a4\u06a5\7@\2"+ - "\2\u06a5\u06a6\7?\2\2\u06a6\u0177\3\2\2\2\u06a7\u06a8\7@\2\2\u06a8\u06a9"+ - "\7@\2\2\u06a9\u06aa\7@\2\2\u06aa\u06ab\7?\2\2\u06ab\u0179\3\2\2\2\u06ac"+ - "\u06ad\7\60\2\2\u06ad\u06ae\7\60\2\2\u06ae\u06af\7>\2\2\u06af\u017b\3"+ - "\2\2\2\u06b0\u06b1\7\60\2\2\u06b1\u06b2\7B\2\2\u06b2\u017d\3\2\2\2\u06b3"+ - "\u06b4\5\u0182\u00ba\2\u06b4\u017f\3\2\2\2\u06b5\u06b6\5\u018a\u00be\2"+ - "\u06b6\u0181\3\2\2\2\u06b7\u06bd\7\62\2\2\u06b8\u06ba\5\u0188\u00bd\2"+ - "\u06b9\u06bb\5\u0184\u00bb\2\u06ba\u06b9\3\2\2\2\u06ba\u06bb\3\2\2\2\u06bb"+ - "\u06bd\3\2\2\2\u06bc\u06b7\3\2\2\2\u06bc\u06b8\3\2\2\2\u06bd\u0183\3\2"+ - "\2\2\u06be\u06c0\5\u0186\u00bc\2\u06bf\u06be\3\2\2\2\u06c0\u06c1\3\2\2"+ - "\2\u06c1\u06bf\3\2\2\2\u06c1\u06c2\3\2\2\2\u06c2\u0185\3\2\2\2\u06c3\u06c6"+ - "\7\62\2\2\u06c4\u06c6\5\u0188\u00bd\2\u06c5\u06c3\3\2\2\2\u06c5\u06c4"+ - "\3\2\2\2\u06c6\u0187\3\2\2\2\u06c7\u06c8\t\2\2\2\u06c8\u0189\3\2\2\2\u06c9"+ - "\u06ca\7\62\2\2\u06ca\u06cb\t\3\2\2\u06cb\u06cc\5\u0190\u00c1\2\u06cc"+ - "\u018b\3\2\2\2\u06cd\u06ce\5\u0190\u00c1\2\u06ce\u06cf\5\u0110\u0081\2"+ - "\u06cf\u06d0\5\u0190\u00c1\2\u06d0\u06d5\3\2\2\2\u06d1\u06d2\5\u0110\u0081"+ - "\2\u06d2\u06d3\5\u0190\u00c1\2\u06d3\u06d5\3\2\2\2\u06d4\u06cd\3\2\2\2"+ - "\u06d4\u06d1\3\2\2\2\u06d5\u018d\3\2\2\2\u06d6\u06d7\5\u0182\u00ba\2\u06d7"+ - "\u06d8\5\u0110\u0081\2\u06d8\u06d9\5\u0184\u00bb\2\u06d9\u06de\3\2\2\2"+ - "\u06da\u06db\5\u0110\u0081\2\u06db\u06dc\5\u0184\u00bb\2\u06dc\u06de\3"+ - "\2\2\2\u06dd\u06d6\3\2\2\2\u06dd\u06da\3\2\2\2\u06de\u018f\3\2\2\2\u06df"+ - "\u06e1\5\u0192\u00c2\2\u06e0\u06df\3\2\2\2\u06e1\u06e2\3\2\2\2\u06e2\u06e0"+ - "\3\2\2\2\u06e2\u06e3\3\2\2\2\u06e3\u0191\3\2\2\2\u06e4\u06e5\t\4\2\2\u06e5"+ - "\u0193\3\2\2\2\u06e6\u06e7\5\u01a2\u00ca\2\u06e7\u06e8\5\u01a4\u00cb\2"+ - "\u06e8\u0195\3\2\2\2\u06e9\u06ea\5\u0182\u00ba\2\u06ea\u06ec\5\u0198\u00c5"+ - "\2\u06eb\u06ed\5\u01a0\u00c9\2\u06ec\u06eb\3\2\2\2\u06ec\u06ed\3\2\2\2"+ - "\u06ed\u06f6\3\2\2\2\u06ee\u06f0\5\u018e\u00c0\2\u06ef\u06f1\5\u0198\u00c5"+ - "\2\u06f0\u06ef\3\2\2\2\u06f0\u06f1\3\2\2\2\u06f1\u06f3\3\2\2\2\u06f2\u06f4"+ - "\5\u01a0\u00c9\2\u06f3\u06f2\3\2\2\2\u06f3\u06f4\3\2\2\2\u06f4\u06f6\3"+ - "\2\2\2\u06f5\u06e9\3\2\2\2\u06f5\u06ee\3\2\2\2\u06f6\u0197\3\2\2\2\u06f7"+ - "\u06f8\5\u019a\u00c6\2\u06f8\u06f9\5\u019c\u00c7\2\u06f9\u0199\3\2\2\2"+ - "\u06fa\u06fb\t\5\2\2\u06fb\u019b\3\2\2\2\u06fc\u06fe\5\u019e\u00c8\2\u06fd"+ - "\u06fc\3\2\2\2\u06fd\u06fe\3\2\2\2\u06fe\u06ff\3\2\2\2\u06ff\u0700\5\u0184"+ - "\u00bb\2\u0700\u019d\3\2\2\2\u0701\u0702\t\6\2\2\u0702\u019f\3\2\2\2\u0703"+ - "\u0704\t\7\2\2\u0704\u01a1\3\2\2\2\u0705\u0706\7\62\2\2\u0706\u0707\t"+ - "\3\2\2\u0707\u01a3\3\2\2\2\u0708\u0709\5\u0190\u00c1\2\u0709\u070a\5\u01a6"+ - "\u00cc\2\u070a\u0710\3\2\2\2\u070b\u070d\5\u018c\u00bf\2\u070c\u070e\5"+ - "\u01a6\u00cc\2\u070d\u070c\3\2\2\2\u070d\u070e\3\2\2\2\u070e\u0710\3\2"+ - "\2\2\u070f\u0708\3\2\2\2\u070f\u070b\3\2\2\2\u0710\u01a5\3\2\2\2\u0711"+ - "\u0712\5\u01a8\u00cd\2\u0712\u0713\5\u019c\u00c7\2\u0713\u01a7\3\2\2\2"+ - "\u0714\u0715\t\b\2\2\u0715\u01a9\3\2\2\2\u0716\u0717\7v\2\2\u0717\u0718"+ - "\7t\2\2\u0718\u0719\7w\2\2\u0719\u0720\7g\2\2\u071a\u071b\7h\2\2\u071b"+ - "\u071c\7c\2\2\u071c\u071d\7n\2\2\u071d\u071e\7u\2\2\u071e\u0720\7g\2\2"+ - "\u071f\u0716\3\2\2\2\u071f\u071a\3\2\2\2\u0720\u01ab\3\2\2\2\u0721\u0723"+ - "\7$\2\2\u0722\u0724\5\u01ae\u00d0\2\u0723\u0722\3\2\2\2\u0723\u0724\3"+ - "\2\2\2\u0724\u0725\3\2\2\2\u0725\u0726\7$\2\2\u0726\u01ad\3\2\2\2\u0727"+ - "\u0729\5\u01b0\u00d1\2\u0728\u0727\3\2\2\2\u0729\u072a\3\2\2\2\u072a\u0728"+ - "\3\2\2\2\u072a\u072b\3\2\2\2\u072b\u01af\3\2\2\2\u072c\u072f\n\t\2\2\u072d"+ - "\u072f\5\u01b2\u00d2\2\u072e\u072c\3\2\2\2\u072e\u072d\3\2\2\2\u072f\u01b1"+ - "\3\2\2\2\u0730\u0731\7^\2\2\u0731\u0734\t\n\2\2\u0732\u0734\5\u01b4\u00d3"+ - "\2\u0733\u0730\3\2\2\2\u0733\u0732\3\2\2\2\u0734\u01b3\3\2\2\2\u0735\u0736"+ - "\7^\2\2\u0736\u0737\7w\2\2\u0737\u0738\5\u0192\u00c2\2\u0738\u0739\5\u0192"+ - "\u00c2\2\u0739\u073a\5\u0192\u00c2\2\u073a\u073b\5\u0192\u00c2\2\u073b"+ - "\u01b5\3\2\2\2\u073c\u073d\7d\2\2\u073d\u073e\7c\2\2\u073e\u073f\7u\2"+ - "\2\u073f\u0740\7g\2\2\u0740\u0741\7\63\2\2\u0741\u0742\78\2\2\u0742\u0746"+ - "\3\2\2\2\u0743\u0745\5\u01e4\u00eb\2\u0744\u0743\3\2\2\2\u0745\u0748\3"+ - "\2\2\2\u0746\u0744\3\2\2\2\u0746\u0747\3\2\2\2\u0747\u0749\3\2\2\2\u0748"+ - "\u0746\3\2\2\2\u0749\u074d\5\u0158\u00a5\2\u074a\u074c\5\u01b8\u00d5\2"+ - "\u074b\u074a\3\2\2\2\u074c\u074f\3\2\2\2\u074d\u074b\3\2\2\2\u074d\u074e"+ - "\3\2\2\2\u074e\u0753\3\2\2\2\u074f\u074d\3\2\2\2\u0750\u0752\5\u01e4\u00eb"+ - "\2\u0751\u0750\3\2\2\2\u0752\u0755\3\2\2\2\u0753\u0751\3\2\2\2\u0753\u0754"+ - "\3\2\2\2\u0754\u0756\3\2\2\2\u0755\u0753\3\2\2\2\u0756\u0757\5\u0158\u00a5"+ - "\2\u0757\u01b7\3\2\2\2\u0758\u075a\5\u01e4\u00eb\2\u0759\u0758\3\2\2\2"+ - "\u075a\u075d\3\2\2\2\u075b\u0759\3\2\2\2\u075b\u075c\3\2\2\2\u075c\u075e"+ - "\3\2\2\2\u075d\u075b\3\2\2\2\u075e\u0762\5\u0192\u00c2\2\u075f\u0761\5"+ - "\u01e4\u00eb\2\u0760\u075f\3\2\2\2\u0761\u0764\3\2\2\2\u0762\u0760\3\2"+ - "\2\2\u0762\u0763\3\2\2\2\u0763\u0765\3\2\2\2\u0764\u0762\3\2\2\2\u0765"+ - "\u0766\5\u0192\u00c2\2\u0766\u01b9\3\2\2\2\u0767\u0768\7d\2\2\u0768\u0769"+ - "\7c\2\2\u0769\u076a\7u\2\2\u076a\u076b\7g\2\2\u076b\u076c\78\2\2\u076c"+ - "\u076d\7\66\2\2\u076d\u0771\3\2\2\2\u076e\u0770\5\u01e4\u00eb\2\u076f"+ - "\u076e\3\2\2\2\u0770\u0773\3\2\2\2\u0771\u076f\3\2\2\2\u0771\u0772\3\2"+ - "\2\2\u0772\u0774\3\2\2\2\u0773\u0771\3\2\2\2\u0774\u0778\5\u0158\u00a5"+ - "\2\u0775\u0777\5\u01bc\u00d7\2\u0776\u0775\3\2\2\2\u0777\u077a\3\2\2\2"+ - "\u0778\u0776\3\2\2\2\u0778\u0779\3\2\2\2\u0779\u077c\3\2\2\2\u077a\u0778"+ - "\3\2\2\2\u077b\u077d\5\u01be\u00d8\2\u077c\u077b\3\2\2\2\u077c\u077d\3"+ - "\2\2\2\u077d\u0781\3\2\2\2\u077e\u0780\5\u01e4\u00eb\2\u077f\u077e\3\2"+ - "\2\2\u0780\u0783\3\2\2\2\u0781\u077f\3\2\2\2\u0781\u0782\3\2\2\2\u0782"+ - "\u0784\3\2\2\2\u0783\u0781\3\2\2\2\u0784\u0785\5\u0158\u00a5\2\u0785\u01bb"+ - "\3\2\2\2\u0786\u0788\5\u01e4\u00eb\2\u0787\u0786\3\2\2\2\u0788\u078b\3"+ - "\2\2\2\u0789\u0787\3\2\2\2\u0789\u078a\3\2\2\2\u078a\u078c\3\2\2\2\u078b"+ - "\u0789\3\2\2\2\u078c\u0790\5\u01c0\u00d9\2\u078d\u078f\5\u01e4\u00eb\2"+ - "\u078e\u078d\3\2\2\2\u078f\u0792\3\2\2\2\u0790\u078e\3\2\2\2\u0790\u0791"+ - "\3\2\2\2\u0791\u0793\3\2\2\2\u0792\u0790\3\2\2\2\u0793\u0797\5\u01c0\u00d9"+ - "\2\u0794\u0796\5\u01e4\u00eb\2\u0795\u0794\3\2\2\2\u0796\u0799\3\2\2\2"+ - "\u0797\u0795\3\2\2\2\u0797\u0798\3\2\2\2\u0798\u079a\3\2\2\2\u0799\u0797"+ - "\3\2\2\2\u079a\u079e\5\u01c0\u00d9\2\u079b\u079d\5\u01e4\u00eb\2\u079c"+ - "\u079b\3\2\2\2\u079d\u07a0\3\2\2\2\u079e\u079c\3\2\2\2\u079e\u079f\3\2"+ - "\2\2\u079f\u07a1\3\2\2\2\u07a0\u079e\3\2\2\2\u07a1\u07a2\5\u01c0\u00d9"+ - "\2\u07a2\u01bd\3\2\2\2\u07a3\u07a5\5\u01e4\u00eb\2\u07a4\u07a3\3\2\2\2"+ - "\u07a5\u07a8\3\2\2\2\u07a6\u07a4\3\2\2\2\u07a6\u07a7\3\2\2\2\u07a7\u07a9"+ - "\3\2\2\2\u07a8\u07a6\3\2\2\2\u07a9\u07ad\5\u01c0\u00d9\2\u07aa\u07ac\5"+ - "\u01e4\u00eb\2\u07ab\u07aa\3\2\2\2\u07ac\u07af\3\2\2\2\u07ad\u07ab\3\2"+ - "\2\2\u07ad\u07ae\3\2\2\2\u07ae\u07b0\3\2\2\2\u07af\u07ad\3\2\2\2\u07b0"+ - "\u07b4\5\u01c0\u00d9\2\u07b1\u07b3\5\u01e4\u00eb\2\u07b2\u07b1\3\2\2\2"+ - "\u07b3\u07b6\3\2\2\2\u07b4\u07b2\3\2\2\2\u07b4\u07b5\3\2\2\2\u07b5\u07b7"+ - "\3\2\2\2\u07b6\u07b4\3\2\2\2\u07b7\u07bb\5\u01c0\u00d9\2\u07b8\u07ba\5"+ - "\u01e4\u00eb\2\u07b9\u07b8\3\2\2\2\u07ba\u07bd\3\2\2\2\u07bb\u07b9\3\2"+ - "\2\2\u07bb\u07bc\3\2\2\2\u07bc\u07be\3\2\2\2\u07bd\u07bb\3\2\2\2\u07be"+ - "\u07bf\5\u01c2\u00da\2\u07bf\u07de\3\2\2\2\u07c0\u07c2\5\u01e4\u00eb\2"+ - "\u07c1\u07c0\3\2\2\2\u07c2\u07c5\3\2\2\2\u07c3\u07c1\3\2\2\2\u07c3\u07c4"+ - "\3\2\2\2\u07c4\u07c6\3\2\2\2\u07c5\u07c3\3\2\2\2\u07c6\u07ca\5\u01c0\u00d9"+ - "\2\u07c7\u07c9\5\u01e4\u00eb\2\u07c8\u07c7\3\2\2\2\u07c9\u07cc\3\2\2\2"+ - "\u07ca\u07c8\3\2\2\2\u07ca\u07cb\3\2\2\2\u07cb\u07cd\3\2\2\2\u07cc\u07ca"+ - "\3\2\2\2\u07cd\u07d1\5\u01c0\u00d9\2\u07ce\u07d0\5\u01e4\u00eb\2\u07cf"+ - "\u07ce\3\2\2\2\u07d0\u07d3\3\2\2\2\u07d1\u07cf\3\2\2\2\u07d1\u07d2\3\2"+ - "\2\2\u07d2\u07d4\3\2\2\2\u07d3\u07d1\3\2\2\2\u07d4\u07d8\5\u01c2\u00da"+ - "\2\u07d5\u07d7\5\u01e4\u00eb\2\u07d6\u07d5\3\2\2\2\u07d7\u07da\3\2\2\2"+ - "\u07d8\u07d6\3\2\2\2\u07d8\u07d9\3\2\2\2\u07d9\u07db\3\2\2\2\u07da\u07d8"+ - "\3\2\2\2\u07db\u07dc\5\u01c2\u00da\2\u07dc\u07de\3\2\2\2\u07dd\u07a6\3"+ - "\2\2\2\u07dd\u07c3\3\2\2\2\u07de\u01bf\3\2\2\2\u07df\u07e0\t\13\2\2\u07e0"+ - "\u01c1\3\2\2\2\u07e1\u07e2\7?\2\2\u07e2\u01c3\3\2\2\2\u07e3\u07e4\7p\2"+ - "\2\u07e4\u07e5\7w\2\2\u07e5\u07e6\7n\2\2\u07e6\u07e7\7n\2\2\u07e7\u01c5"+ - "\3\2\2\2\u07e8\u07eb\5\u01c8\u00dd\2\u07e9\u07eb\5\u01ca\u00de\2\u07ea"+ - "\u07e8\3\2\2\2\u07ea\u07e9\3\2\2\2\u07eb\u01c7\3\2\2\2\u07ec\u07f0\5\u01ce"+ - "\u00e0\2\u07ed\u07ef\5\u01d0\u00e1\2\u07ee\u07ed\3\2\2\2\u07ef\u07f2\3"+ - "\2\2\2\u07f0\u07ee\3\2\2\2\u07f0\u07f1\3\2\2\2\u07f1\u01c9\3\2\2\2\u07f2"+ - "\u07f0\3\2\2\2\u07f3\u07f5\7)\2\2\u07f4\u07f6\5\u01cc\u00df\2\u07f5\u07f4"+ - "\3\2\2\2\u07f6\u07f7\3\2\2\2\u07f7\u07f5\3\2\2\2\u07f7\u07f8\3\2\2\2\u07f8"+ - "\u01cb\3\2\2\2\u07f9\u07fd\5\u01d0\u00e1\2\u07fa\u07fd\5\u01d2\u00e2\2"+ - "\u07fb\u07fd\5\u01d4\u00e3\2\u07fc\u07f9\3\2\2\2\u07fc\u07fa\3\2\2\2\u07fc"+ - "\u07fb\3\2\2\2\u07fd\u01cd\3\2\2\2\u07fe\u0801\t\f\2\2\u07ff\u0801\n\r"+ - "\2\2\u0800\u07fe\3\2\2\2\u0800\u07ff\3\2\2\2\u0801\u01cf\3\2\2\2\u0802"+ - "\u0805\5\u01ce\u00e0\2\u0803\u0805\5\u024c\u011f\2\u0804\u0802\3\2\2\2"+ - "\u0804\u0803\3\2\2\2\u0805\u01d1\3\2\2\2\u0806\u0807\7^\2\2\u0807\u0808"+ - "\n\16\2\2\u0808\u01d3\3\2\2\2\u0809\u080a\7^\2\2\u080a\u0811\t\17\2\2"+ - "\u080b\u080c\7^\2\2\u080c\u080d\7^\2\2\u080d\u080e\3\2\2\2\u080e\u0811"+ - "\t\20\2\2\u080f\u0811\5\u01b4\u00d3\2\u0810\u0809\3\2\2\2\u0810\u080b"+ - "\3\2\2\2\u0810\u080f\3\2\2\2\u0811\u01d5\3\2\2\2\u0812\u0817\t\f\2\2\u0813"+ - "\u0817\n\21\2\2\u0814\u0815\t\22\2\2\u0815\u0817\t\23\2\2\u0816\u0812"+ - "\3\2\2\2\u0816\u0813\3\2\2\2\u0816\u0814\3\2\2\2\u0817\u01d7\3\2\2\2\u0818"+ - "\u081d\t\24\2\2\u0819\u081d\n\21\2\2\u081a\u081b\t\22\2\2\u081b\u081d"+ - "\t\23\2\2\u081c\u0818\3\2\2\2\u081c\u0819\3\2\2\2\u081c\u081a\3\2\2\2"+ - "\u081d\u01d9\3\2\2\2\u081e\u0822\5\u00a8M\2\u081f\u0821\5\u01e4\u00eb"+ - "\2\u0820\u081f\3\2\2\2\u0821\u0824\3\2\2\2\u0822\u0820\3\2\2\2\u0822\u0823"+ - "\3\2\2\2\u0823\u0825\3\2\2\2\u0824\u0822\3\2\2\2\u0825\u0826\5\u0158\u00a5"+ - "\2\u0826\u0827\b\u00e6\27\2\u0827\u0828\3\2\2\2\u0828\u0829\b\u00e6\30"+ - "\2\u0829\u01db\3\2\2\2\u082a\u082e\5\u00a0I\2\u082b\u082d\5\u01e4\u00eb"+ - "\2\u082c\u082b\3\2\2\2\u082d\u0830\3\2\2\2\u082e\u082c\3\2\2\2\u082e\u082f"+ - "\3\2\2\2\u082f\u0831\3\2\2\2\u0830\u082e\3\2\2\2\u0831\u0832\5\u0158\u00a5"+ - "\2\u0832\u0833\b\u00e7\31\2\u0833\u0834\3\2\2\2\u0834\u0835\b\u00e7\32"+ - "\2\u0835\u01dd\3\2\2\2\u0836\u0838\5\u0128\u008d\2\u0837\u0839\5\u01fe"+ - "\u00f8\2\u0838\u0837\3\2\2\2\u0838\u0839\3\2\2\2\u0839\u083a\3\2\2\2\u083a"+ - "\u083b\b\u00e8\33\2\u083b\u01df\3\2\2\2\u083c\u083e\5\u0128\u008d\2\u083d"+ - "\u083f\5\u01fe\u00f8\2\u083e\u083d\3\2\2\2\u083e\u083f\3\2\2\2\u083f\u0840"+ - "\3\2\2\2\u0840\u0844\5\u012c\u008f\2\u0841\u0843\5\u01fe\u00f8\2\u0842"+ - "\u0841\3\2\2\2\u0843\u0846\3\2\2\2\u0844\u0842\3\2\2\2\u0844\u0845\3\2"+ - "\2\2\u0845\u0847\3\2\2\2\u0846\u0844\3\2\2\2\u0847\u0848\b\u00e9\34\2"+ - "\u0848\u01e1\3\2\2\2\u0849\u084b\5\u0128\u008d\2\u084a\u084c\5\u01fe\u00f8"+ - "\2\u084b\u084a\3\2\2\2\u084b\u084c\3\2\2\2\u084c\u084d\3\2\2\2\u084d\u0851"+ - "\5\u012c\u008f\2\u084e\u0850\5\u01fe\u00f8\2\u084f\u084e\3\2\2\2\u0850"+ - "\u0853\3\2\2\2\u0851\u084f\3\2\2\2\u0851\u0852\3\2\2\2\u0852\u0854\3\2"+ - "\2\2\u0853\u0851\3\2\2\2\u0854\u0858\5\u00e2j\2\u0855\u0857\5\u01fe\u00f8"+ - "\2\u0856\u0855\3\2\2\2\u0857\u085a\3\2\2\2\u0858\u0856\3\2\2\2\u0858\u0859"+ - "\3\2\2\2\u0859\u085b\3\2\2\2\u085a\u0858\3\2\2\2\u085b\u085f\5\u012e\u0090"+ - "\2\u085c\u085e\5\u01fe\u00f8\2\u085d\u085c\3\2\2\2\u085e\u0861\3\2\2\2"+ - "\u085f\u085d\3\2\2\2\u085f\u0860\3\2\2\2\u0860\u0862\3\2\2\2\u0861\u085f"+ - "\3\2\2\2\u0862\u0863\b\u00ea\33\2\u0863\u01e3\3\2\2\2\u0864\u0866\t\25"+ - "\2\2\u0865\u0864\3\2\2\2\u0866\u0867\3\2\2\2\u0867\u0865\3\2\2\2\u0867"+ - "\u0868\3\2\2\2\u0868\u0869\3\2\2\2\u0869\u086a\b\u00eb\35\2\u086a\u01e5"+ - "\3\2\2\2\u086b\u086d\t\26\2\2\u086c\u086b\3\2\2\2\u086d\u086e\3\2\2\2"+ - "\u086e\u086c\3\2\2\2\u086e\u086f\3\2\2\2\u086f\u0870\3\2\2\2\u0870\u0871"+ - "\b\u00ec\35\2\u0871\u01e7\3\2\2\2\u0872\u0873\7\61\2\2\u0873\u0874\7\61"+ - "\2\2\u0874\u0878\3\2\2\2\u0875\u0877\n\27\2\2\u0876\u0875\3\2\2\2\u0877"+ - "\u087a\3\2\2\2\u0878\u0876\3\2\2\2\u0878\u0879\3\2\2\2\u0879\u087b\3\2"+ - "\2\2\u087a\u0878\3\2\2\2\u087b\u087c\b\u00ed\35\2\u087c\u01e9\3\2\2\2"+ - "\u087d\u087e\7x\2\2\u087e\u087f\7c\2\2\u087f\u0880\7t\2\2\u0880\u0881"+ - "\7k\2\2\u0881\u0882\7c\2\2\u0882\u0883\7d\2\2\u0883\u0884\7n\2\2\u0884"+ - "\u0885\7g\2\2\u0885\u01eb\3\2\2\2\u0886\u0887\7o\2\2\u0887\u0888\7q\2"+ - "\2\u0888\u0889\7f\2\2\u0889\u088a\7w\2\2\u088a\u088b\7n\2\2\u088b\u088c"+ - "\7g\2\2\u088c\u01ed\3\2\2\2\u088d\u0896\5\u00b2R\2\u088e\u0896\5\36\b"+ - "\2\u088f\u0896\5\u01ea\u00ee\2\u0890\u0896\5\u00baV\2\u0891\u0896\5(\r"+ - "\2\u0892\u0896\5\u01ec\u00ef\2\u0893\u0896\5\"\n\2\u0894\u0896\5*\16\2"+ - "\u0895\u088d\3\2\2\2\u0895\u088e\3\2\2\2\u0895\u088f\3\2\2\2\u0895\u0890"+ - "\3\2\2\2\u0895\u0891\3\2\2\2\u0895\u0892\3\2\2\2\u0895\u0893\3\2\2\2\u0895"+ - "\u0894\3\2\2\2\u0896\u01ef\3\2\2\2\u0897\u089a\5\u01fa\u00f6\2\u0898\u089a"+ - "\5\u01fc\u00f7\2\u0899\u0897\3\2\2\2\u0899\u0898\3\2\2\2\u089a\u089b\3"+ - "\2\2\2\u089b\u0899\3\2\2\2\u089b\u089c\3\2\2\2\u089c\u01f1\3\2\2\2\u089d"+ - "\u089e\5\u0158\u00a5\2\u089e\u089f\3\2\2\2\u089f\u08a0\b\u00f2\36\2\u08a0"+ - "\u01f3\3\2\2\2\u08a1\u08a2\5\u0158\u00a5\2\u08a2\u08a3\5\u0158\u00a5\2"+ - "\u08a3\u08a4\3\2\2\2\u08a4\u08a5\b\u00f3\37\2\u08a5\u01f5\3\2\2\2\u08a6"+ - "\u08a7\5\u0158\u00a5\2\u08a7\u08a8\5\u0158\u00a5\2\u08a8\u08a9\5\u0158"+ - "\u00a5\2\u08a9\u08aa\3\2\2\2\u08aa\u08ab\b\u00f4 \2\u08ab\u01f7\3\2\2"+ - "\2\u08ac\u08ae\5\u01ee\u00f0\2\u08ad\u08af\5\u01fe\u00f8\2\u08ae\u08ad"+ - "\3\2\2\2\u08af\u08b0\3\2\2\2\u08b0\u08ae\3\2\2\2\u08b0\u08b1\3\2\2\2\u08b1"+ - "\u01f9\3\2\2\2\u08b2\u08b6\n\30\2\2\u08b3\u08b4\7^\2\2\u08b4\u08b6\5\u0158"+ - "\u00a5\2\u08b5\u08b2\3\2\2\2\u08b5\u08b3\3\2\2\2\u08b6\u01fb\3\2\2\2\u08b7"+ - "\u08b8\5\u01fe\u00f8\2\u08b8\u01fd\3\2\2\2\u08b9\u08ba\t\31\2\2\u08ba"+ - "\u01ff\3\2\2\2\u08bb\u08bc\t\32\2\2\u08bc\u08bd\3\2\2\2\u08bd\u08be\b"+ - "\u00f9\35\2\u08be\u08bf\b\u00f9!\2\u08bf\u0201\3\2\2\2\u08c0\u08c1\5\u01c6"+ - "\u00dc\2\u08c1\u0203\3\2\2\2\u08c2\u08c4\5\u01fe\u00f8\2\u08c3\u08c2\3"+ - "\2\2\2\u08c4\u08c7\3\2\2\2\u08c5\u08c3\3\2\2\2\u08c5\u08c6\3\2\2\2\u08c6"+ - "\u08c8\3\2\2\2\u08c7\u08c5\3\2\2\2\u08c8\u08cc\5\u012e\u0090\2\u08c9\u08cb"+ - "\5\u01fe\u00f8\2\u08ca\u08c9\3\2\2\2\u08cb\u08ce\3\2\2\2\u08cc\u08ca\3"+ - "\2\2\2\u08cc\u08cd\3\2\2\2\u08cd\u08cf\3\2\2\2\u08ce\u08cc\3\2\2\2\u08cf"+ - "\u08d0\b\u00fb!\2\u08d0\u08d1\b\u00fb\33\2\u08d1\u0205\3\2\2\2\u08d2\u08d3"+ - "\t\32\2\2\u08d3\u08d4\3\2\2\2\u08d4\u08d5\b\u00fc\35\2\u08d5\u08d6\b\u00fc"+ - "!\2\u08d6\u0207\3\2\2\2\u08d7\u08db\n\33\2\2\u08d8\u08d9\7^\2\2\u08d9"+ - "\u08db\5\u0158\u00a5\2\u08da\u08d7\3\2\2\2\u08da\u08d8\3\2\2\2\u08db\u08de"+ - "\3\2\2\2\u08dc\u08da\3\2\2\2\u08dc\u08dd\3\2\2\2\u08dd\u08df\3\2\2\2\u08de"+ - "\u08dc\3\2\2\2\u08df\u08e1\t\32\2\2\u08e0\u08dc\3\2\2\2\u08e0\u08e1\3"+ - "\2\2\2\u08e1\u08ee\3\2\2\2\u08e2\u08e8\5\u01de\u00e8\2\u08e3\u08e7\n\33"+ - "\2\2\u08e4\u08e5\7^\2\2\u08e5\u08e7\5\u0158\u00a5\2\u08e6\u08e3\3\2\2"+ - "\2\u08e6\u08e4\3\2\2\2\u08e7\u08ea\3\2\2\2\u08e8\u08e6\3\2\2\2\u08e8\u08e9"+ - "\3\2\2\2\u08e9\u08ec\3\2\2\2\u08ea\u08e8\3\2\2\2\u08eb\u08ed\t\32\2\2"+ - "\u08ec\u08eb\3\2\2\2\u08ec\u08ed\3\2\2\2\u08ed\u08ef\3\2\2\2\u08ee\u08e2"+ - "\3\2\2\2\u08ef\u08f0\3\2\2\2\u08f0\u08ee\3\2\2\2\u08f0\u08f1\3\2\2\2\u08f1"+ - "\u08fa\3\2\2\2\u08f2\u08f6\n\33\2\2\u08f3\u08f4\7^\2\2\u08f4\u08f6\5\u0158"+ - "\u00a5\2\u08f5\u08f2\3\2\2\2\u08f5\u08f3\3\2\2\2\u08f6\u08f7\3\2\2\2\u08f7"+ - "\u08f5\3\2\2\2\u08f7\u08f8\3\2\2\2\u08f8\u08fa\3\2\2\2\u08f9\u08e0\3\2"+ - "\2\2\u08f9\u08f5\3\2\2\2\u08fa\u0209\3\2\2\2\u08fb\u08fc\5\u0158\u00a5"+ - "\2\u08fc\u08fd\3\2\2\2\u08fd\u08fe\b\u00fe!\2\u08fe\u020b\3\2\2\2\u08ff"+ - "\u0904\n\33\2\2\u0900\u0901\5\u0158\u00a5\2\u0901\u0902\n\34\2\2\u0902"+ - "\u0904\3\2\2\2\u0903\u08ff\3\2\2\2\u0903\u0900\3\2\2\2\u0904\u0907\3\2"+ - "\2\2\u0905\u0903\3\2\2\2\u0905\u0906\3\2\2\2\u0906\u0908\3\2\2\2\u0907"+ - "\u0905\3\2\2\2\u0908\u090a\t\32\2\2\u0909\u0905\3\2\2\2\u0909\u090a\3"+ - "\2\2\2\u090a\u0918\3\2\2\2\u090b\u0912\5\u01de\u00e8\2\u090c\u0911\n\33"+ - "\2\2\u090d\u090e\5\u0158\u00a5\2\u090e\u090f\n\34\2\2\u090f\u0911\3\2"+ - "\2\2\u0910\u090c\3\2\2\2\u0910\u090d\3\2\2\2\u0911\u0914\3\2\2\2\u0912"+ - "\u0910\3\2\2\2\u0912\u0913\3\2\2\2\u0913\u0916\3\2\2\2\u0914\u0912\3\2"+ - "\2\2\u0915\u0917\t\32\2\2\u0916\u0915\3\2\2\2\u0916\u0917\3\2\2\2\u0917"+ - "\u0919\3\2\2\2\u0918\u090b\3\2\2\2\u0919\u091a\3\2\2\2\u091a\u0918\3\2"+ - "\2\2\u091a\u091b\3\2\2\2\u091b\u0925\3\2\2\2\u091c\u0921\n\33\2\2\u091d"+ - "\u091e\5\u0158\u00a5\2\u091e\u091f\n\34\2\2\u091f\u0921\3\2\2\2\u0920"+ - "\u091c\3\2\2\2\u0920\u091d\3\2\2\2\u0921\u0922\3\2\2\2\u0922\u0920\3\2"+ - "\2\2\u0922\u0923\3\2\2\2\u0923\u0925\3\2\2\2\u0924\u0909\3\2\2\2\u0924"+ - "\u0920\3\2\2\2\u0925\u020d\3\2\2\2\u0926\u0927\5\u0158\u00a5\2\u0927\u0928"+ - "\5\u0158\u00a5\2\u0928\u0929\3\2\2\2\u0929\u092a\b\u0100!\2\u092a\u020f"+ - "\3\2\2\2\u092b\u0934\n\33\2\2\u092c\u092d\5\u0158\u00a5\2\u092d\u092e"+ - "\n\34\2\2\u092e\u0934\3\2\2\2\u092f\u0930\5\u0158\u00a5\2\u0930\u0931"+ - "\5\u0158\u00a5\2\u0931\u0932\n\34\2\2\u0932\u0934\3\2\2\2\u0933\u092b"+ - "\3\2\2\2\u0933\u092c\3\2\2\2\u0933\u092f\3\2\2\2\u0934\u0937\3\2\2\2\u0935"+ - "\u0933\3\2\2\2\u0935\u0936\3\2\2\2\u0936\u0938\3\2\2\2\u0937\u0935\3\2"+ - "\2\2\u0938\u093a\t\32\2\2\u0939\u0935\3\2\2\2\u0939\u093a\3\2\2\2\u093a"+ - "\u094c\3\2\2\2\u093b\u0946\5\u01de\u00e8\2\u093c\u0945\n\33\2\2\u093d"+ - "\u093e\5\u0158\u00a5\2\u093e\u093f\n\34\2\2\u093f\u0945\3\2\2\2\u0940"+ - "\u0941\5\u0158\u00a5\2\u0941\u0942\5\u0158\u00a5\2\u0942\u0943\n\34\2"+ - "\2\u0943\u0945\3\2\2\2\u0944\u093c\3\2\2\2\u0944\u093d\3\2\2\2\u0944\u0940"+ - "\3\2\2\2\u0945\u0948\3\2\2\2\u0946\u0944\3\2\2\2\u0946\u0947\3\2\2\2\u0947"+ - "\u094a\3\2\2\2\u0948\u0946\3\2\2\2\u0949\u094b\t\32\2\2\u094a\u0949\3"+ - "\2\2\2\u094a\u094b\3\2\2\2\u094b\u094d\3\2\2\2\u094c\u093b\3\2\2\2\u094d"+ - "\u094e\3\2\2\2\u094e\u094c\3\2\2\2\u094e\u094f\3\2\2\2\u094f\u095d\3\2"+ - "\2\2"; + "\4\u0147\t\u0147\4\u0148\t\u0148\4\u0149\t\u0149\3\2\3\2\3\2\3\2\3\2\3"+ + "\2\3\2\3\3\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4\3\4\3\5\3\5\3\5\3\5\3\5\3\5"+ + "\3\5\3\5\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\7\3\7\3"+ + "\b\3\b\3\b\3\b\3\b\3\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n"+ + "\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13\3\13\3\13\3\13\3\13\3"+ + "\f\3\f\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r"+ + "\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\17\3\17\3\17\3\17"+ + "\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\20\3\20\3\20\3\20\3\20\3\20"+ + "\3\20\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22"+ + "\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3\24\3\24"+ + "\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26"+ + "\3\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\27"+ + "\3\30\3\30\3\30\3\30\3\30\3\30\3\30\3\31\3\31\3\31\3\31\3\31\3\31\3\32"+ + "\3\32\3\32\3\32\3\32\3\32\3\32\3\33\3\33\3\33\3\33\3\33\3\33\3\33\3\34"+ + "\3\34\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3\35\3\36\3\36\3\36\3\36\3\36"+ + "\3\36\3\36\3\36\3\36\3\36\3\37\3\37\3\37\3\37\3\37\3\37\3 \3 \3 \3!\3"+ + "!\3!\3!\3!\3!\3!\3\"\3\"\3\"\3\"\3\"\3\"\3#\3#\3#\3#\3#\3#\3$\3$\3$\3"+ + "$\3$\3$\3$\3$\3$\3%\3%\3%\3%\3%\3%\3&\3&\3&\3&\3&\3&\3&\3\'\3\'\3\'\3"+ + "\'\3\'\3\'\3\'\3\'\3\'\3\'\3(\3(\3(\3(\3(\3(\3)\3)\3)\3)\3)\3)\3)\3)\3"+ + ")\3*\3*\3*\3*\3*\3*\3*\3*\3+\3+\3+\3+\3+\3+\3+\3+\3+\3,\3,\3,\3,\3,\3"+ + ",\3,\3,\3,\3-\3-\3-\3-\3-\3-\3-\3-\3-\3-\3.\3.\3.\3.\3.\3.\3/\3/\3/\3"+ + "/\3/\3/\3\60\3\60\3\60\3\60\3\60\3\60\3\61\3\61\3\61\3\61\3\61\3\62\3"+ + "\62\3\62\3\62\3\62\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3\63\3"+ + "\63\3\63\3\63\3\63\3\63\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3\64\3"+ + "\64\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\65\3\66\3\66\3\66\3"+ + "\66\3\66\3\66\3\66\3\66\3\67\3\67\3\67\3\67\3\67\3\67\3\67\38\38\38\3"+ + "8\38\38\38\38\38\39\39\39\39\39\39\39\39\3:\3:\3:\3:\3:\3:\3:\3:\3:\3"+ + ":\3:\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3;\3<\3<\3<\3<\3<\3<\3<\3<\3<\3=\3"+ + "=\3=\3=\3=\3=\3=\3=\3>\3>\3>\3>\3>\3>\3>\3>\3>\3>\3?\3?\3?\3?\3?\3?\3"+ + "?\3?\3?\3@\3@\3@\3@\3@\3@\3@\3@\3A\3A\3A\3A\3A\3A\3B\3B\3B\3B\3B\3B\3"+ + "B\3B\3B\3B\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3C\3D\3D\3D\3D\3E\3E\3E\3E\3"+ + "E\3F\3F\3F\3F\3F\3F\3G\3G\3G\3G\3G\3G\3G\3G\3H\3H\3H\3H\3H\3H\3H\3H\3"+ + "I\3I\3I\3I\3I\3I\3I\3J\3J\3J\3J\3J\3J\3K\3K\3K\3K\3L\3L\3L\3L\3L\3M\3"+ + "M\3M\3M\3N\3N\3N\3N\3N\3N\3O\3O\3O\3O\3O\3O\3O\3P\3P\3P\3P\3Q\3Q\3Q\3"+ + "Q\3Q\3Q\3Q\3Q\3Q\3R\3R\3R\3R\3R\3S\3S\3S\3S\3S\3S\3S\3T\3T\3T\3T\3T\3"+ + "T\3T\3T\3U\3U\3U\3U\3U\3U\3U\3V\3V\3V\3V\3W\3W\3W\3W\3X\3X\3X\3X\3X\3"+ + "X\3X\3Y\3Y\3Y\3Z\3Z\3Z\3Z\3Z\3Z\3[\3[\3[\3[\3[\3\\\3\\\3\\\3\\\3\\\3\\"+ + "\3\\\3\\\3]\3]\3]\3]\3]\3]\3^\3^\3^\3^\3^\3^\3^\3^\3^\3_\3_\3_\3_\3_\3"+ + "_\3`\3`\3`\3`\3`\3a\3a\3a\3a\3a\3b\3b\3b\3b\3b\3c\3c\3c\3c\3d\3d\3d\3"+ + "d\3e\3e\3e\3e\3e\3e\3f\3f\3f\3f\3f\3f\3f\3f\3g\3g\3g\3g\3g\3g\3h\3h\3"+ + "h\3h\3h\3h\3i\3i\3i\3i\3i\3j\3j\3j\3j\3j\3j\3j\3k\3k\3k\3k\3k\3k\3k\3"+ + "k\3k\3k\3k\3k\3l\3l\3l\3l\3l\3l\3m\3m\3m\3m\3m\3m\3n\3n\3n\3n\3n\3n\3"+ + "n\3n\3o\3o\3o\3o\3o\3o\3o\3o\3p\3p\3p\3p\3p\3p\3p\3p\3p\3p\3q\3q\3q\3"+ + "q\3q\3q\3q\3q\3r\3r\3r\3r\3r\3s\3s\3s\3t\3t\3t\3t\3t\3u\3u\3u\3u\3u\3"+ + "u\3u\3u\3v\3v\3v\3v\3v\3v\3w\3w\3w\3w\3x\3x\3x\3x\3x\3x\3y\3y\3y\3y\3"+ + "y\3y\3y\3y\3y\3y\3y\3z\3z\3z\3z\3z\3z\3z\3z\3z\3z\3z\3{\3{\3{\3|\3|\3"+ + "|\3|\3|\3|\3}\3}\3}\3}\3}\3~\3~\3~\3~\3~\3~\3~\3~\3\177\3\177\3\u0080"+ + "\3\u0080\3\u0081\3\u0081\3\u0082\3\u0082\3\u0083\3\u0083\3\u0084\3\u0084"+ + "\3\u0084\3\u0085\3\u0085\3\u0086\3\u0086\3\u0087\3\u0087\3\u0088\3\u0088"+ + "\3\u0089\3\u0089\3\u008a\3\u008a\3\u008a\3\u008b\3\u008b\3\u008b\3\u008c"+ + "\3\u008c\3\u008c\3\u008d\3\u008d\3\u008e\3\u008e\3\u008f\3\u008f\3\u0090"+ + "\3\u0090\3\u0091\3\u0091\3\u0092\3\u0092\3\u0093\3\u0093\3\u0094\3\u0094"+ + "\3\u0095\3\u0095\3\u0095\3\u0096\3\u0096\3\u0096\3\u0097\3\u0097\3\u0098"+ + "\3\u0098\3\u0099\3\u0099\3\u0099\3\u009a\3\u009a\3\u009a\3\u009b\3\u009b"+ + "\3\u009b\3\u009c\3\u009c\3\u009c\3\u009d\3\u009d\3\u009d\3\u009d\3\u009e"+ + "\3\u009e\3\u009e\3\u009e\3\u009f\3\u009f\3\u00a0\3\u00a0\3\u00a1\3\u00a1"+ + "\3\u00a2\3\u00a2\3\u00a2\3\u00a3\3\u00a3\3\u00a3\3\u00a4\3\u00a4\3\u00a5"+ + "\3\u00a5\3\u00a6\3\u00a6\3\u00a6\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a8"+ + "\3\u00a8\3\u00a9\3\u00a9\3\u00a9\3\u00aa\3\u00aa\3\u00aa\3\u00ab\3\u00ab"+ + "\3\u00ab\3\u00ab\3\u00ac\3\u00ac\3\u00ac\3\u00ad\3\u00ad\3\u00ad\3\u00ae"+ + "\3\u00ae\3\u00ae\3\u00af\3\u00af\3\u00af\3\u00b0\3\u00b0\3\u00b0\3\u00b1"+ + "\3\u00b1\3\u00b1\3\u00b2\3\u00b2\3\u00b2\3\u00b3\3\u00b3\3\u00b3\3\u00b3"+ + "\3\u00b4\3\u00b4\3\u00b4\3\u00b4\3\u00b5\3\u00b5\3\u00b5\3\u00b5\3\u00b5"+ + "\3\u00b6\3\u00b6\3\u00b6\3\u00b6\3\u00b7\3\u00b7\3\u00b7\3\u00b8\3\u00b8"+ + "\3\u00b9\3\u00b9\3\u00ba\3\u00ba\3\u00ba\5\u00ba\u06bd\n\u00ba\5\u00ba"+ + "\u06bf\n\u00ba\3\u00bb\6\u00bb\u06c2\n\u00bb\r\u00bb\16\u00bb\u06c3\3"+ + "\u00bc\3\u00bc\5\u00bc\u06c8\n\u00bc\3\u00bd\3\u00bd\3\u00be\3\u00be\3"+ + "\u00be\3\u00be\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf\3\u00bf"+ + "\5\u00bf\u06d7\n\u00bf\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c0\3\u00c0"+ + "\3\u00c0\5\u00c0\u06e0\n\u00c0\3\u00c1\6\u00c1\u06e3\n\u00c1\r\u00c1\16"+ + "\u00c1\u06e4\3\u00c2\3\u00c2\3\u00c3\3\u00c3\3\u00c3\3\u00c4\3\u00c4\3"+ + "\u00c4\5\u00c4\u06ef\n\u00c4\3\u00c4\3\u00c4\5\u00c4\u06f3\n\u00c4\3\u00c4"+ + "\5\u00c4\u06f6\n\u00c4\5\u00c4\u06f8\n\u00c4\3\u00c5\3\u00c5\3\u00c5\3"+ + "\u00c5\3\u00c6\3\u00c6\3\u00c6\3\u00c7\3\u00c7\3\u00c8\5\u00c8\u0704\n"+ + "\u00c8\3\u00c8\3\u00c8\3\u00c9\3\u00c9\3\u00ca\3\u00ca\3\u00cb\3\u00cb"+ + "\3\u00cb\3\u00cc\3\u00cc\3\u00cc\3\u00cc\3\u00cc\5\u00cc\u0714\n\u00cc"+ + "\5\u00cc\u0716\n\u00cc\3\u00cd\3\u00cd\3\u00cd\3\u00ce\3\u00ce\3\u00cf"+ + "\3\u00cf\3\u00cf\3\u00cf\3\u00cf\3\u00cf\3\u00cf\3\u00cf\3\u00cf\5\u00cf"+ + "\u0726\n\u00cf\3\u00d0\3\u00d0\5\u00d0\u072a\n\u00d0\3\u00d0\3\u00d0\3"+ + "\u00d1\6\u00d1\u072f\n\u00d1\r\u00d1\16\u00d1\u0730\3\u00d2\3\u00d2\5"+ + "\u00d2\u0735\n\u00d2\3\u00d3\3\u00d3\3\u00d3\5\u00d3\u073a\n\u00d3\3\u00d4"+ + "\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d4\3\u00d5\3\u00d5\3\u00d5"+ + "\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\7\u00d5\u074b\n\u00d5\f\u00d5"+ + "\16\u00d5\u074e\13\u00d5\3\u00d5\3\u00d5\7\u00d5\u0752\n\u00d5\f\u00d5"+ + "\16\u00d5\u0755\13\u00d5\3\u00d5\7\u00d5\u0758\n\u00d5\f\u00d5\16\u00d5"+ + "\u075b\13\u00d5\3\u00d5\3\u00d5\3\u00d6\7\u00d6\u0760\n\u00d6\f\u00d6"+ + "\16\u00d6\u0763\13\u00d6\3\u00d6\3\u00d6\7\u00d6\u0767\n\u00d6\f\u00d6"+ + "\16\u00d6\u076a\13\u00d6\3\u00d6\3\u00d6\3\u00d7\3\u00d7\3\u00d7\3\u00d7"+ + "\3\u00d7\3\u00d7\3\u00d7\3\u00d7\7\u00d7\u0776\n\u00d7\f\u00d7\16\u00d7"+ + "\u0779\13\u00d7\3\u00d7\3\u00d7\7\u00d7\u077d\n\u00d7\f\u00d7\16\u00d7"+ + "\u0780\13\u00d7\3\u00d7\5\u00d7\u0783\n\u00d7\3\u00d7\7\u00d7\u0786\n"+ + "\u00d7\f\u00d7\16\u00d7\u0789\13\u00d7\3\u00d7\3\u00d7\3\u00d8\7\u00d8"+ + "\u078e\n\u00d8\f\u00d8\16\u00d8\u0791\13\u00d8\3\u00d8\3\u00d8\7\u00d8"+ + "\u0795\n\u00d8\f\u00d8\16\u00d8\u0798\13\u00d8\3\u00d8\3\u00d8\7\u00d8"+ + "\u079c\n\u00d8\f\u00d8\16\u00d8\u079f\13\u00d8\3\u00d8\3\u00d8\7\u00d8"+ + "\u07a3\n\u00d8\f\u00d8\16\u00d8\u07a6\13\u00d8\3\u00d8\3\u00d8\3\u00d9"+ + "\7\u00d9\u07ab\n\u00d9\f\u00d9\16\u00d9\u07ae\13\u00d9\3\u00d9\3\u00d9"+ + "\7\u00d9\u07b2\n\u00d9\f\u00d9\16\u00d9\u07b5\13\u00d9\3\u00d9\3\u00d9"+ + "\7\u00d9\u07b9\n\u00d9\f\u00d9\16\u00d9\u07bc\13\u00d9\3\u00d9\3\u00d9"+ + "\7\u00d9\u07c0\n\u00d9\f\u00d9\16\u00d9\u07c3\13\u00d9\3\u00d9\3\u00d9"+ + "\3\u00d9\7\u00d9\u07c8\n\u00d9\f\u00d9\16\u00d9\u07cb\13\u00d9\3\u00d9"+ + "\3\u00d9\7\u00d9\u07cf\n\u00d9\f\u00d9\16\u00d9\u07d2\13\u00d9\3\u00d9"+ + "\3\u00d9\7\u00d9\u07d6\n\u00d9\f\u00d9\16\u00d9\u07d9\13\u00d9\3\u00d9"+ + "\3\u00d9\7\u00d9\u07dd\n\u00d9\f\u00d9\16\u00d9\u07e0\13\u00d9\3\u00d9"+ + "\3\u00d9\5\u00d9\u07e4\n\u00d9\3\u00da\3\u00da\3\u00db\3\u00db\3\u00dc"+ + "\3\u00dc\3\u00dc\3\u00dc\3\u00dc\3\u00dd\3\u00dd\5\u00dd\u07f1\n\u00dd"+ + "\3\u00de\3\u00de\7\u00de\u07f5\n\u00de\f\u00de\16\u00de\u07f8\13\u00de"+ + "\3\u00df\3\u00df\6\u00df\u07fc\n\u00df\r\u00df\16\u00df\u07fd\3\u00e0"+ + "\3\u00e0\3\u00e0\5\u00e0\u0803\n\u00e0\3\u00e1\3\u00e1\5\u00e1\u0807\n"+ + "\u00e1\3\u00e2\3\u00e2\5\u00e2\u080b\n\u00e2\3\u00e3\3\u00e3\3\u00e3\3"+ + "\u00e4\3\u00e4\3\u00e4\3\u00e4\3\u00e4\3\u00e4\3\u00e4\5\u00e4\u0817\n"+ + "\u00e4\3\u00e5\3\u00e5\3\u00e5\3\u00e5\5\u00e5\u081d\n\u00e5\3\u00e6\3"+ + "\u00e6\3\u00e6\3\u00e6\5\u00e6\u0823\n\u00e6\3\u00e7\3\u00e7\7\u00e7\u0827"+ + "\n\u00e7\f\u00e7\16\u00e7\u082a\13\u00e7\3\u00e7\3\u00e7\3\u00e7\3\u00e7"+ + "\3\u00e7\3\u00e8\3\u00e8\7\u00e8\u0833\n\u00e8\f\u00e8\16\u00e8\u0836"+ + "\13\u00e8\3\u00e8\3\u00e8\3\u00e8\3\u00e8\3\u00e8\3\u00e9\3\u00e9\5\u00e9"+ + "\u083f\n\u00e9\3\u00e9\3\u00e9\3\u00ea\3\u00ea\5\u00ea\u0845\n\u00ea\3"+ + "\u00ea\3\u00ea\7\u00ea\u0849\n\u00ea\f\u00ea\16\u00ea\u084c\13\u00ea\3"+ + "\u00ea\3\u00ea\3\u00eb\3\u00eb\5\u00eb\u0852\n\u00eb\3\u00eb\3\u00eb\7"+ + "\u00eb\u0856\n\u00eb\f\u00eb\16\u00eb\u0859\13\u00eb\3\u00eb\3\u00eb\7"+ + "\u00eb\u085d\n\u00eb\f\u00eb\16\u00eb\u0860\13\u00eb\3\u00eb\3\u00eb\7"+ + "\u00eb\u0864\n\u00eb\f\u00eb\16\u00eb\u0867\13\u00eb\3\u00eb\3\u00eb\3"+ + "\u00ec\6\u00ec\u086c\n\u00ec\r\u00ec\16\u00ec\u086d\3\u00ec\3\u00ec\3"+ + "\u00ed\6\u00ed\u0873\n\u00ed\r\u00ed\16\u00ed\u0874\3\u00ed\3\u00ed\3"+ + "\u00ee\3\u00ee\3\u00ee\3\u00ee\7\u00ee\u087d\n\u00ee\f\u00ee\16\u00ee"+ + "\u0880\13\u00ee\3\u00ee\3\u00ee\3\u00ef\3\u00ef\3\u00ef\3\u00ef\3\u00ef"+ + "\3\u00ef\3\u00ef\3\u00ef\3\u00ef\3\u00f0\3\u00f0\3\u00f0\3\u00f0\3\u00f0"+ + "\3\u00f0\3\u00f0\3\u00f1\3\u00f1\3\u00f1\3\u00f1\3\u00f1\3\u00f1\3\u00f1"+ + "\3\u00f1\5\u00f1\u089c\n\u00f1\3\u00f2\3\u00f2\6\u00f2\u08a0\n\u00f2\r"+ + "\u00f2\16\u00f2\u08a1\3\u00f3\3\u00f3\3\u00f3\3\u00f3\3\u00f4\3\u00f4"+ + "\3\u00f4\3\u00f4\3\u00f4\3\u00f5\3\u00f5\3\u00f5\3\u00f5\3\u00f5\3\u00f5"+ + "\3\u00f6\3\u00f6\6\u00f6\u08b5\n\u00f6\r\u00f6\16\u00f6\u08b6\3\u00f7"+ + "\3\u00f7\3\u00f7\5\u00f7\u08bc\n\u00f7\3\u00f8\3\u00f8\3\u00f9\3\u00f9"+ + "\3\u00fa\3\u00fa\3\u00fa\3\u00fa\3\u00fa\3\u00fb\3\u00fb\3\u00fc\7\u00fc"+ + "\u08ca\n\u00fc\f\u00fc\16\u00fc\u08cd\13\u00fc\3\u00fc\3\u00fc\7\u00fc"+ + "\u08d1\n\u00fc\f\u00fc\16\u00fc\u08d4\13\u00fc\3\u00fc\3\u00fc\3\u00fc"+ + "\3\u00fd\3\u00fd\3\u00fd\3\u00fd\3\u00fd\3\u00fe\3\u00fe\3\u00fe\7\u00fe"+ + "\u08e1\n\u00fe\f\u00fe\16\u00fe\u08e4\13\u00fe\3\u00fe\5\u00fe\u08e7\n"+ + "\u00fe\3\u00fe\3\u00fe\3\u00fe\3\u00fe\7\u00fe\u08ed\n\u00fe\f\u00fe\16"+ + "\u00fe\u08f0\13\u00fe\3\u00fe\5\u00fe\u08f3\n\u00fe\6\u00fe\u08f5\n\u00fe"+ + "\r\u00fe\16\u00fe\u08f6\3\u00fe\3\u00fe\3\u00fe\6\u00fe\u08fc\n\u00fe"+ + "\r\u00fe\16\u00fe\u08fd\5\u00fe\u0900\n\u00fe\3\u00ff\3\u00ff\3\u00ff"+ + "\3\u00ff\3\u0100\3\u0100\3\u0100\3\u0100\7\u0100\u090a\n\u0100\f\u0100"+ + "\16\u0100\u090d\13\u0100\3\u0100\5\u0100\u0910\n\u0100\3\u0100\3\u0100"+ + "\3\u0100\3\u0100\3\u0100\7\u0100\u0917\n\u0100\f\u0100\16\u0100\u091a"+ + "\13\u0100\3\u0100\5\u0100\u091d\n\u0100\6\u0100\u091f\n\u0100\r\u0100"+ + "\16\u0100\u0920\3\u0100\3\u0100\3\u0100\3\u0100\6\u0100\u0927\n\u0100"+ + "\r\u0100\16\u0100\u0928\5\u0100\u092b\n\u0100\3\u0101\3\u0101\3\u0101"+ + "\3\u0101\3\u0101\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102"+ + "\3\u0102\7\u0102\u093a\n\u0102\f\u0102\16\u0102\u093d\13\u0102\3\u0102"+ + "\5\u0102\u0940\n\u0102\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102"+ + "\3\u0102\3\u0102\3\u0102\7\u0102\u094b\n\u0102\f\u0102\16\u0102\u094e"+ + "\13\u0102\3\u0102\5\u0102\u0951\n\u0102\6\u0102\u0953\n\u0102\r\u0102"+ + "\16\u0102\u0954\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102\3\u0102"+ + "\3\u0102\6\u0102\u095f\n\u0102\r\u0102\16\u0102\u0960\5\u0102\u0963\n"+ + "\u0102\3\u0103\3\u0103\3\u0103\3\u0103\3\u0103\3\u0103\3\u0104\3\u0104"+ + "\3\u0104\3\u0104\3\u0104\3\u0104\3\u0104\3\u0105\3\u0105\3\u0105\3\u0105"+ + "\3\u0105\3\u0105\3\u0105\3\u0105\3\u0105\3\u0105\3\u0105\7\u0105\u097d"+ + "\n\u0105\f\u0105\16\u0105\u0980\13\u0105\3\u0105\3\u0105\3\u0105\3\u0105"+ + "\3\u0106\3\u0106\3\u0106\3\u0106\3\u0106\3\u0106\3\u0106\5\u0106\u098d"+ + "\n\u0106\3\u0106\7\u0106\u0990\n\u0106\f\u0106\16\u0106\u0993\13\u0106"+ + "\3\u0106\3\u0106\3\u0106\3\u0106\3\u0107\3\u0107\3\u0107\3\u0107\3\u0108"+ + "\3\u0108\3\u0108\3\u0108\6\u0108\u09a1\n\u0108\r\u0108\16\u0108\u09a2"+ + "\3\u0108\3\u0108\3\u0108\3\u0108\3\u0108\3\u0108\3\u0108\6\u0108\u09ac"+ + "\n\u0108\r\u0108\16\u0108\u09ad\3\u0108\3\u0108\5\u0108\u09b2\n\u0108"+ + "\3\u0109\3\u0109\5\u0109\u09b6\n\u0109\3\u0109\5\u0109\u09b9\n\u0109\3"+ + "\u010a\3\u010a\3\u010a\3\u010a\3\u010b\3\u010b\3\u010b\3\u010b\3\u010b"+ + "\3\u010c\3\u010c\3\u010c\3\u010c\3\u010c\3\u010c\5\u010c\u09ca\n\u010c"+ + "\3\u010c\3\u010c\3\u010c\3\u010c\3\u010c\3\u010d\3\u010d\3\u010d\3\u010d"+ + "\3\u010d\3\u010e\3\u010e\3\u010e\3\u010f\5\u010f\u09da\n\u010f\3\u010f"+ + "\3\u010f\3\u010f\3\u010f\3\u0110\6\u0110\u09e1\n\u0110\r\u0110\16\u0110"+ + "\u09e2\3\u0111\3\u0111\3\u0111\3\u0111\3\u0111\3\u0111\3\u0111\5\u0111"+ + "\u09ec\n\u0111\3\u0112\6\u0112\u09ef\n\u0112\r\u0112\16\u0112\u09f0\3"+ + "\u0112\3\u0112\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113"+ + "\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113\3\u0113"+ + "\3\u0113\5\u0113\u0a06\n\u0113\3\u0113\5\u0113\u0a09\n\u0113\3\u0114\3"+ + "\u0114\6\u0114\u0a0d\n\u0114\r\u0114\16\u0114\u0a0e\3\u0114\7\u0114\u0a12"+ + "\n\u0114\f\u0114\16\u0114\u0a15\13\u0114\3\u0114\7\u0114\u0a18\n\u0114"+ + "\f\u0114\16\u0114\u0a1b\13\u0114\3\u0114\3\u0114\6\u0114\u0a1f\n\u0114"+ + "\r\u0114\16\u0114\u0a20\3\u0114\7\u0114\u0a24\n\u0114\f\u0114\16\u0114"+ + "\u0a27\13\u0114\3\u0114\7\u0114\u0a2a\n\u0114\f\u0114\16\u0114\u0a2d\13"+ + "\u0114\3\u0114\3\u0114\6\u0114\u0a31\n\u0114\r\u0114\16\u0114\u0a32\3"+ + "\u0114\7\u0114\u0a36\n\u0114\f\u0114\16\u0114\u0a39\13\u0114\3\u0114\7"+ + "\u0114\u0a3c\n\u0114\f\u0114\16\u0114\u0a3f\13\u0114\3\u0114\3\u0114\6"+ + "\u0114\u0a43\n\u0114\r\u0114\16\u0114\u0a44\3\u0114\7\u0114\u0a48\n\u0114"+ + "\f\u0114\16\u0114\u0a4b\13\u0114\3\u0114\7\u0114\u0a4e\n\u0114\f\u0114"+ + "\16\u0114\u0a51\13\u0114\3\u0114\3\u0114\7\u0114\u0a55\n\u0114\f\u0114"+ + "\16\u0114\u0a58\13\u0114\3\u0114\3\u0114\3\u0114\3\u0114\7\u0114\u0a5e"+ + "\n\u0114\f\u0114\16\u0114\u0a61\13\u0114\5\u0114\u0a63\n\u0114\3\u0115"+ + "\3\u0115\3\u0115\3\u0115\3\u0116\3\u0116\3\u0116\3\u0116\3\u0116\3\u0117"+ + "\3\u0117\3\u0117\3\u0117\3\u0117\3\u0118\3\u0118\3\u0119\3\u0119\3\u011a"+ + "\3\u011a\3\u011b\3\u011b\3\u011b\3\u011b\3\u011c\3\u011c\3\u011c\3\u011c"+ + "\3\u011d\3\u011d\7\u011d\u0a83\n\u011d\f\u011d\16\u011d\u0a86\13\u011d"+ + "\3\u011e\3\u011e\3\u011e\3\u011e\3\u011f\3\u011f\3\u0120\3\u0120\3\u0121"+ + "\3\u0121\3\u0121\3\u0121\5\u0121\u0a94\n\u0121\3\u0122\5\u0122\u0a97\n"+ + "\u0122\3\u0123\3\u0123\3\u0123\3\u0123\3\u0124\5\u0124\u0a9e\n\u0124\3"+ + "\u0124\3\u0124\3\u0124\3\u0124\3\u0125\5\u0125\u0aa5\n\u0125\3\u0125\3"+ + "\u0125\5\u0125\u0aa9\n\u0125\6\u0125\u0aab\n\u0125\r\u0125\16\u0125\u0aac"+ + "\3\u0125\3\u0125\3\u0125\5\u0125\u0ab2\n\u0125\7\u0125\u0ab4\n\u0125\f"+ + "\u0125\16\u0125\u0ab7\13\u0125\5\u0125\u0ab9\n\u0125\3\u0126\3\u0126\3"+ + "\u0126\5\u0126\u0abe\n\u0126\3\u0127\3\u0127\3\u0127\3\u0127\3\u0128\5"+ + "\u0128\u0ac5\n\u0128\3\u0128\3\u0128\3\u0128\3\u0128\3\u0129\5\u0129\u0acc"+ + "\n\u0129\3\u0129\3\u0129\5\u0129\u0ad0\n\u0129\6\u0129\u0ad2\n\u0129\r"+ + "\u0129\16\u0129\u0ad3\3\u0129\3\u0129\3\u0129\5\u0129\u0ad9\n\u0129\7"+ + "\u0129\u0adb\n\u0129\f\u0129\16\u0129\u0ade\13\u0129\5\u0129\u0ae0\n\u0129"+ + "\3\u012a\3\u012a\5\u012a\u0ae4\n\u012a\3\u012b\3\u012b\3\u012c\3\u012c"+ + "\3\u012c\3\u012c\3\u012c\3\u012d\3\u012d\3\u012d\3\u012d\3\u012d\3\u012e"+ + "\5\u012e\u0af3\n\u012e\3\u012e\3\u012e\5\u012e\u0af7\n\u012e\7\u012e\u0af9"+ + "\n\u012e\f\u012e\16\u012e\u0afc\13\u012e\3\u012f\3\u012f\5\u012f\u0b00"+ + "\n\u012f\3\u0130\3\u0130\3\u0130\3\u0130\3\u0130\6\u0130\u0b07\n\u0130"+ + "\r\u0130\16\u0130\u0b08\3\u0130\5\u0130\u0b0c\n\u0130\3\u0130\3\u0130"+ + "\3\u0130\6\u0130\u0b11\n\u0130\r\u0130\16\u0130\u0b12\3\u0130\5\u0130"+ + "\u0b16\n\u0130\5\u0130\u0b18\n\u0130\3\u0131\6\u0131\u0b1b\n\u0131\r\u0131"+ + "\16\u0131\u0b1c\3\u0131\7\u0131\u0b20\n\u0131\f\u0131\16\u0131\u0b23\13"+ + "\u0131\3\u0131\6\u0131\u0b26\n\u0131\r\u0131\16\u0131\u0b27\5\u0131\u0b2a"+ + "\n\u0131\3\u0132\3\u0132\3\u0132\3\u0132\3\u0132\3\u0132\3\u0133\3\u0133"+ + "\3\u0133\3\u0133\3\u0133\3\u0134\5\u0134\u0b38\n\u0134\3\u0134\3\u0134"+ + "\5\u0134\u0b3c\n\u0134\7\u0134\u0b3e\n\u0134\f\u0134\16\u0134\u0b41\13"+ + "\u0134\3\u0135\5\u0135\u0b44\n\u0135\3\u0135\6\u0135\u0b47\n\u0135\r\u0135"+ + "\16\u0135\u0b48\3\u0135\5\u0135\u0b4c\n\u0135\3\u0136\3\u0136\3\u0136"+ + "\3\u0136\3\u0136\3\u0136\3\u0136\5\u0136\u0b55\n\u0136\3\u0137\3\u0137"+ + "\3\u0138\3\u0138\3\u0138\3\u0138\3\u0138\6\u0138\u0b5e\n\u0138\r\u0138"+ + "\16\u0138\u0b5f\3\u0138\5\u0138\u0b63\n\u0138\3\u0138\3\u0138\3\u0138"+ + "\6\u0138\u0b68\n\u0138\r\u0138\16\u0138\u0b69\3\u0138\5\u0138\u0b6d\n"+ + "\u0138\5\u0138\u0b6f\n\u0138\3\u0139\6\u0139\u0b72\n\u0139\r\u0139\16"+ + "\u0139\u0b73\3\u0139\5\u0139\u0b77\n\u0139\3\u0139\3\u0139\5\u0139\u0b7b"+ + "\n\u0139\3\u013a\3\u013a\3\u013b\3\u013b\3\u013b\3\u013b\3\u013b\3\u013b"+ + "\3\u013c\6\u013c\u0b86\n\u013c\r\u013c\16\u013c\u0b87\3\u013d\3\u013d"+ + "\3\u013d\3\u013d\3\u013d\3\u013d\5\u013d\u0b90\n\u013d\3\u013e\3\u013e"+ + "\3\u013e\3\u013e\3\u013e\3\u013f\6\u013f\u0b98\n\u013f\r\u013f\16\u013f"+ + "\u0b99\3\u0140\3\u0140\3\u0140\5\u0140\u0b9f\n\u0140\3\u0141\3\u0141\3"+ + "\u0141\3\u0141\3\u0142\6\u0142\u0ba6\n\u0142\r\u0142\16\u0142\u0ba7\3"+ + "\u0143\3\u0143\3\u0144\3\u0144\3\u0144\3\u0144\3\u0144\3\u0145\5\u0145"+ + "\u0bb2\n\u0145\3\u0145\3\u0145\3\u0145\3\u0145\3\u0146\6\u0146\u0bb9\n"+ + "\u0146\r\u0146\16\u0146\u0bba\3\u0146\7\u0146\u0bbe\n\u0146\f\u0146\16"+ + "\u0146\u0bc1\13\u0146\3\u0146\6\u0146\u0bc4\n\u0146\r\u0146\16\u0146\u0bc5"+ + "\5\u0146\u0bc8\n\u0146\3\u0147\3\u0147\3\u0148\3\u0148\6\u0148\u0bce\n"+ + "\u0148\r\u0148\16\u0148\u0bcf\3\u0148\3\u0148\3\u0148\3\u0148\5\u0148"+ + "\u0bd6\n\u0148\3\u0149\7\u0149\u0bd9\n\u0149\f\u0149\16\u0149\u0bdc\13"+ + "\u0149\3\u0149\3\u0149\3\u0149\4\u097e\u0991\2\u014a\22\3\24\4\26\5\30"+ + "\6\32\7\34\b\36\t \n\"\13$\f&\r(\16*\17,\20.\21\60\22\62\23\64\24\66\25"+ + "8\26:\27<\30>\31@\32B\33D\34F\35H\36J\37L N!P\"R#T$V%X&Z\'\\(^)`*b+d,"+ + "f-h.j/l\60n\61p\62r\63t\64v\65x\66z\67|8~9\u0080:\u0082;\u0084<\u0086"+ + "=\u0088>\u008a?\u008c@\u008eA\u0090B\u0092C\u0094D\u0096E\u0098F\u009a"+ + "G\u009cH\u009eI\u00a0J\u00a2K\u00a4L\u00a6M\u00a8N\u00aaO\u00acP\u00ae"+ + "Q\u00b0R\u00b2S\u00b4T\u00b6U\u00b8V\u00baW\u00bcX\u00beY\u00c0Z\u00c2"+ + "[\u00c4\\\u00c6]\u00c8^\u00ca_\u00cc`\u00cea\u00d0b\u00d2c\u00d4d\u00d6"+ + "e\u00d8f\u00dag\u00dch\u00dei\u00e0j\u00e2k\u00e4l\u00e6m\u00e8n\u00ea"+ + "o\u00ecp\u00eeq\u00f0r\u00f2s\u00f4t\u00f6u\u00f8v\u00faw\u00fcx\u00fe"+ + "y\u0100z\u0102{\u0104|\u0106}\u0108~\u010a\177\u010c\u0080\u010e\u0081"+ + "\u0110\u0082\u0112\u0083\u0114\u0084\u0116\u0085\u0118\u0086\u011a\u0087"+ + "\u011c\u0088\u011e\u0089\u0120\u008a\u0122\u008b\u0124\u008c\u0126\u008d"+ + "\u0128\2\u012a\u008e\u012c\u008f\u012e\u0090\u0130\u0091\u0132\u0092\u0134"+ + "\u0093\u0136\u0094\u0138\u0095\u013a\u0096\u013c\u0097\u013e\u0098\u0140"+ + "\u0099\u0142\u009a\u0144\u009b\u0146\u009c\u0148\u009d\u014a\u009e\u014c"+ + "\u009f\u014e\u00a0\u0150\u00a1\u0152\u00a2\u0154\u00a3\u0156\u00a4\u0158"+ + "\u00a5\u015a\u00a6\u015c\u00a7\u015e\u00a8\u0160\u00a9\u0162\u00aa\u0164"+ + "\u00ab\u0166\u00ac\u0168\u00ad\u016a\u00ae\u016c\u00af\u016e\u00b0\u0170"+ + "\u00b1\u0172\u00b2\u0174\u00b3\u0176\u00b4\u0178\u00b5\u017a\u00b6\u017c"+ + "\u00b7\u017e\u00b8\u0180\u00b9\u0182\2\u0184\2\u0186\2\u0188\2\u018a\2"+ + "\u018c\2\u018e\2\u0190\2\u0192\2\u0194\u00ba\u0196\u00bb\u0198\u00bc\u019a"+ + "\2\u019c\2\u019e\2\u01a0\2\u01a2\2\u01a4\2\u01a6\2\u01a8\2\u01aa\2\u01ac"+ + "\u00bd\u01ae\u00be\u01b0\2\u01b2\2\u01b4\2\u01b6\2\u01b8\u00bf\u01ba\2"+ + "\u01bc\u00c0\u01be\2\u01c0\2\u01c2\2\u01c4\2\u01c6\u00c1\u01c8\u00c2\u01ca"+ + "\2\u01cc\2\u01ce\2\u01d0\2\u01d2\2\u01d4\2\u01d6\2\u01d8\2\u01da\2\u01dc"+ + "\u00c3\u01de\u00c4\u01e0\u00c5\u01e2\u00c6\u01e4\u00c7\u01e6\u00c8\u01e8"+ + "\u00c9\u01ea\u00ca\u01ec\u00cb\u01ee\u00cc\u01f0\u00cd\u01f2\u00ce\u01f4"+ + "\u00cf\u01f6\u00d0\u01f8\u00d1\u01fa\u00d2\u01fc\2\u01fe\u00d3\u0200\u00d4"+ + "\u0202\u00d5\u0204\u00d6\u0206\u00d7\u0208\u00d8\u020a\u00d9\u020c\u00da"+ + "\u020e\u00db\u0210\u00dc\u0212\u00dd\u0214\u00de\u0216\u00df\u0218\u00e0"+ + "\u021a\u00e1\u021c\u00e2\u021e\u00e3\u0220\2\u0222\u00e4\u0224\u00e5\u0226"+ + "\u00e6\u0228\u00e7\u022a\2\u022c\u00e8\u022e\u00e9\u0230\2\u0232\2\u0234"+ + "\2\u0236\2\u0238\u00ea\u023a\u00eb\u023c\u00ec\u023e\u00ed\u0240\u00ee"+ + "\u0242\u00ef\u0244\u00f0\u0246\u00f1\u0248\u00f2\u024a\u00f3\u024c\2\u024e"+ + "\2\u0250\2\u0252\2\u0254\u00f4\u0256\u00f5\u0258\u00f6\u025a\2\u025c\u00f7"+ + "\u025e\u00f8\u0260\u00f9\u0262\2\u0264\2\u0266\u00fa\u0268\u00fb\u026a"+ + "\2\u026c\2\u026e\2\u0270\2\u0272\u00fc\u0274\u00fd\u0276\2\u0278\u00fe"+ + "\u027a\2\u027c\2\u027e\2\u0280\2\u0282\2\u0284\u00ff\u0286\u0100\u0288"+ + "\2\u028a\u0101\u028c\u0102\u028e\2\u0290\u0103\u0292\u0104\u0294\2\u0296"+ + "\u0105\u0298\u0106\u029a\u0107\u029c\2\u029e\2\u02a0\2\22\2\3\4\5\6\7"+ + "\b\t\n\13\f\r\16\17\20\21*\3\2\63;\4\2ZZzz\5\2\62;CHch\4\2GGgg\4\2--/"+ + "/\6\2FFHHffhh\4\2RRrr\6\2\f\f\17\17$$^^\n\2$$))^^ddhhppttvv\6\2--\61;"+ + "C\\c|\5\2C\\aac|\26\2\2\u0081\u00a3\u00a9\u00ab\u00ab\u00ad\u00ae\u00b0"+ + "\u00b0\u00b2\u00b3\u00b8\u00b9\u00bd\u00bd\u00c1\u00c1\u00d9\u00d9\u00f9"+ + "\u00f9\u2010\u202b\u2032\u2060\u2192\u2c01\u3003\u3005\u300a\u3022\u3032"+ + "\u3032\udb82\uf901\ufd40\ufd41\ufe47\ufe48\b\2\13\f\17\17C\\c|\u2010\u2011"+ + "\u202a\u202b\6\2$$\61\61^^~~\7\2ddhhppttvv\4\2\2\u0081\ud802\udc01\3\2"+ + "\ud802\udc01\3\2\udc02\ue001\6\2\62;C\\aac|\4\2\13\13\"\"\4\2\f\f\16\17"+ + "\4\2\f\f\17\17\5\2\f\f\"\"bb\3\2\"\"\3\2\f\f\4\2\f\fbb\3\2bb\3\2//\7\2"+ + "&&((>>bb}}\5\2\13\f\17\17\"\"\3\2\62;\5\2\u00b9\u00b9\u0302\u0371\u2041"+ + "\u2042\n\2C\\aac|\u2072\u2191\u2c02\u2ff1\u3003\ud801\uf902\ufdd1\ufdf2"+ + "\uffff\b\2$$&&>>^^}}\177\177\b\2&&))>>^^}}\177\177\6\2&&@A}}\177\177\6"+ + "\2&&//@@}}\5\2&&^^bb\6\2&&^^bb}}\f\2$$))^^bbddhhppttvv}}\u0c6f\2\22\3"+ + "\2\2\2\2\24\3\2\2\2\2\26\3\2\2\2\2\30\3\2\2\2\2\32\3\2\2\2\2\34\3\2\2"+ + "\2\2\36\3\2\2\2\2 \3\2\2\2\2\"\3\2\2\2\2$\3\2\2\2\2&\3\2\2\2\2(\3\2\2"+ + "\2\2*\3\2\2\2\2,\3\2\2\2\2.\3\2\2\2\2\60\3\2\2\2\2\62\3\2\2\2\2\64\3\2"+ + "\2\2\2\66\3\2\2\2\28\3\2\2\2\2:\3\2\2\2\2<\3\2\2\2\2>\3\2\2\2\2@\3\2\2"+ + "\2\2B\3\2\2\2\2D\3\2\2\2\2F\3\2\2\2\2H\3\2\2\2\2J\3\2\2\2\2L\3\2\2\2\2"+ + "N\3\2\2\2\2P\3\2\2\2\2R\3\2\2\2\2T\3\2\2\2\2V\3\2\2\2\2X\3\2\2\2\2Z\3"+ + "\2\2\2\2\\\3\2\2\2\2^\3\2\2\2\2`\3\2\2\2\2b\3\2\2\2\2d\3\2\2\2\2f\3\2"+ + "\2\2\2h\3\2\2\2\2j\3\2\2\2\2l\3\2\2\2\2n\3\2\2\2\2p\3\2\2\2\2r\3\2\2\2"+ + "\2t\3\2\2\2\2v\3\2\2\2\2x\3\2\2\2\2z\3\2\2\2\2|\3\2\2\2\2~\3\2\2\2\2\u0080"+ + "\3\2\2\2\2\u0082\3\2\2\2\2\u0084\3\2\2\2\2\u0086\3\2\2\2\2\u0088\3\2\2"+ + "\2\2\u008a\3\2\2\2\2\u008c\3\2\2\2\2\u008e\3\2\2\2\2\u0090\3\2\2\2\2\u0092"+ + "\3\2\2\2\2\u0094\3\2\2\2\2\u0096\3\2\2\2\2\u0098\3\2\2\2\2\u009a\3\2\2"+ + "\2\2\u009c\3\2\2\2\2\u009e\3\2\2\2\2\u00a0\3\2\2\2\2\u00a2\3\2\2\2\2\u00a4"+ + "\3\2\2\2\2\u00a6\3\2\2\2\2\u00a8\3\2\2\2\2\u00aa\3\2\2\2\2\u00ac\3\2\2"+ + "\2\2\u00ae\3\2\2\2\2\u00b0\3\2\2\2\2\u00b2\3\2\2\2\2\u00b4\3\2\2\2\2\u00b6"+ + "\3\2\2\2\2\u00b8\3\2\2\2\2\u00ba\3\2\2\2\2\u00bc\3\2\2\2\2\u00be\3\2\2"+ + "\2\2\u00c0\3\2\2\2\2\u00c2\3\2\2\2\2\u00c4\3\2\2\2\2\u00c6\3\2\2\2\2\u00c8"+ + "\3\2\2\2\2\u00ca\3\2\2\2\2\u00cc\3\2\2\2\2\u00ce\3\2\2\2\2\u00d0\3\2\2"+ + "\2\2\u00d2\3\2\2\2\2\u00d4\3\2\2\2\2\u00d6\3\2\2\2\2\u00d8\3\2\2\2\2\u00da"+ + "\3\2\2\2\2\u00dc\3\2\2\2\2\u00de\3\2\2\2\2\u00e0\3\2\2\2\2\u00e2\3\2\2"+ + "\2\2\u00e4\3\2\2\2\2\u00e6\3\2\2\2\2\u00e8\3\2\2\2\2\u00ea\3\2\2\2\2\u00ec"+ + "\3\2\2\2\2\u00ee\3\2\2\2\2\u00f0\3\2\2\2\2\u00f2\3\2\2\2\2\u00f4\3\2\2"+ + "\2\2\u00f6\3\2\2\2\2\u00f8\3\2\2\2\2\u00fa\3\2\2\2\2\u00fc\3\2\2\2\2\u00fe"+ + "\3\2\2\2\2\u0100\3\2\2\2\2\u0102\3\2\2\2\2\u0104\3\2\2\2\2\u0106\3\2\2"+ + "\2\2\u0108\3\2\2\2\2\u010a\3\2\2\2\2\u010c\3\2\2\2\2\u010e\3\2\2\2\2\u0110"+ + "\3\2\2\2\2\u0112\3\2\2\2\2\u0114\3\2\2\2\2\u0116\3\2\2\2\2\u0118\3\2\2"+ + "\2\2\u011a\3\2\2\2\2\u011c\3\2\2\2\2\u011e\3\2\2\2\2\u0120\3\2\2\2\2\u0122"+ + "\3\2\2\2\2\u0124\3\2\2\2\2\u0126\3\2\2\2\2\u012a\3\2\2\2\2\u012c\3\2\2"+ + "\2\2\u012e\3\2\2\2\2\u0130\3\2\2\2\2\u0132\3\2\2\2\2\u0134\3\2\2\2\2\u0136"+ + "\3\2\2\2\2\u0138\3\2\2\2\2\u013a\3\2\2\2\2\u013c\3\2\2\2\2\u013e\3\2\2"+ + "\2\2\u0140\3\2\2\2\2\u0142\3\2\2\2\2\u0144\3\2\2\2\2\u0146\3\2\2\2\2\u0148"+ + "\3\2\2\2\2\u014a\3\2\2\2\2\u014c\3\2\2\2\2\u014e\3\2\2\2\2\u0150\3\2\2"+ + "\2\2\u0152\3\2\2\2\2\u0154\3\2\2\2\2\u0156\3\2\2\2\2\u0158\3\2\2\2\2\u015a"+ + "\3\2\2\2\2\u015c\3\2\2\2\2\u015e\3\2\2\2\2\u0160\3\2\2\2\2\u0162\3\2\2"+ + "\2\2\u0164\3\2\2\2\2\u0166\3\2\2\2\2\u0168\3\2\2\2\2\u016a\3\2\2\2\2\u016c"+ + "\3\2\2\2\2\u016e\3\2\2\2\2\u0170\3\2\2\2\2\u0172\3\2\2\2\2\u0174\3\2\2"+ + "\2\2\u0176\3\2\2\2\2\u0178\3\2\2\2\2\u017a\3\2\2\2\2\u017c\3\2\2\2\2\u017e"+ + "\3\2\2\2\2\u0180\3\2\2\2\2\u0194\3\2\2\2\2\u0196\3\2\2\2\2\u0198\3\2\2"+ + "\2\2\u01ac\3\2\2\2\2\u01ae\3\2\2\2\2\u01b8\3\2\2\2\2\u01bc\3\2\2\2\2\u01c6"+ + "\3\2\2\2\2\u01c8\3\2\2\2\2\u01dc\3\2\2\2\2\u01de\3\2\2\2\2\u01e0\3\2\2"+ + "\2\2\u01e2\3\2\2\2\2\u01e4\3\2\2\2\2\u01e6\3\2\2\2\2\u01e8\3\2\2\2\2\u01ea"+ + "\3\2\2\2\3\u01ec\3\2\2\2\3\u01ee\3\2\2\2\3\u01f0\3\2\2\2\3\u01f2\3\2\2"+ + "\2\3\u01f4\3\2\2\2\3\u01f6\3\2\2\2\3\u01f8\3\2\2\2\3\u01fa\3\2\2\2\3\u01fe"+ + "\3\2\2\2\3\u0200\3\2\2\2\3\u0202\3\2\2\2\4\u0204\3\2\2\2\4\u0206\3\2\2"+ + "\2\4\u0208\3\2\2\2\5\u020a\3\2\2\2\5\u020c\3\2\2\2\6\u020e\3\2\2\2\6\u0210"+ + "\3\2\2\2\7\u0212\3\2\2\2\7\u0214\3\2\2\2\b\u0216\3\2\2\2\b\u0218\3\2\2"+ + "\2\b\u021a\3\2\2\2\b\u021c\3\2\2\2\b\u021e\3\2\2\2\b\u0222\3\2\2\2\b\u0224"+ + "\3\2\2\2\b\u0226\3\2\2\2\b\u0228\3\2\2\2\b\u022c\3\2\2\2\b\u022e\3\2\2"+ + "\2\t\u0238\3\2\2\2\t\u023a\3\2\2\2\t\u023c\3\2\2\2\t\u023e\3\2\2\2\t\u0240"+ + "\3\2\2\2\t\u0242\3\2\2\2\t\u0244\3\2\2\2\t\u0246\3\2\2\2\t\u0248\3\2\2"+ + "\2\t\u024a\3\2\2\2\n\u0254\3\2\2\2\n\u0256\3\2\2\2\n\u0258\3\2\2\2\13"+ + "\u025c\3\2\2\2\13\u025e\3\2\2\2\13\u0260\3\2\2\2\f\u0266\3\2\2\2\f\u0268"+ + "\3\2\2\2\r\u0272\3\2\2\2\r\u0274\3\2\2\2\r\u0278\3\2\2\2\16\u0284\3\2"+ + "\2\2\16\u0286\3\2\2\2\17\u028a\3\2\2\2\17\u028c\3\2\2\2\20\u0290\3\2\2"+ + "\2\20\u0292\3\2\2\2\21\u0296\3\2\2\2\21\u0298\3\2\2\2\21\u029a\3\2\2\2"+ + "\22\u02a2\3\2\2\2\24\u02a9\3\2\2\2\26\u02ac\3\2\2\2\30\u02b3\3\2\2\2\32"+ + "\u02bb\3\2\2\2\34\u02c4\3\2\2\2\36\u02ca\3\2\2\2 \u02d2\3\2\2\2\"\u02db"+ + "\3\2\2\2$\u02e4\3\2\2\2&\u02eb\3\2\2\2(\u02f2\3\2\2\2*\u02fd\3\2\2\2,"+ + "\u0307\3\2\2\2.\u0313\3\2\2\2\60\u031a\3\2\2\2\62\u0323\3\2\2\2\64\u032a"+ + "\3\2\2\2\66\u0330\3\2\2\28\u0338\3\2\2\2:\u0340\3\2\2\2<\u0348\3\2\2\2"+ + ">\u0351\3\2\2\2@\u0358\3\2\2\2B\u035e\3\2\2\2D\u0365\3\2\2\2F\u036c\3"+ + "\2\2\2H\u0373\3\2\2\2J\u0376\3\2\2\2L\u0380\3\2\2\2N\u0386\3\2\2\2P\u0389"+ + "\3\2\2\2R\u0390\3\2\2\2T\u0396\3\2\2\2V\u039c\3\2\2\2X\u03a5\3\2\2\2Z"+ + "\u03ab\3\2\2\2\\\u03b2\3\2\2\2^\u03bc\3\2\2\2`\u03c2\3\2\2\2b\u03cb\3"+ + "\2\2\2d\u03d3\3\2\2\2f\u03dc\3\2\2\2h\u03e5\3\2\2\2j\u03ef\3\2\2\2l\u03f5"+ + "\3\2\2\2n\u03fb\3\2\2\2p\u0401\3\2\2\2r\u0406\3\2\2\2t\u040b\3\2\2\2v"+ + "\u041a\3\2\2\2x\u0424\3\2\2\2z\u042e\3\2\2\2|\u0436\3\2\2\2~\u043d\3\2"+ + "\2\2\u0080\u0446\3\2\2\2\u0082\u044e\3\2\2\2\u0084\u0459\3\2\2\2\u0086"+ + "\u0464\3\2\2\2\u0088\u046d\3\2\2\2\u008a\u0475\3\2\2\2\u008c\u047f\3\2"+ + "\2\2\u008e\u0488\3\2\2\2\u0090\u0490\3\2\2\2\u0092\u0496\3\2\2\2\u0094"+ + "\u04a0\3\2\2\2\u0096\u04ab\3\2\2\2\u0098\u04af\3\2\2\2\u009a\u04b4\3\2"+ + "\2\2\u009c\u04ba\3\2\2\2\u009e\u04c2\3\2\2\2\u00a0\u04ca\3\2\2\2\u00a2"+ + "\u04d1\3\2\2\2\u00a4\u04d7\3\2\2\2\u00a6\u04db\3\2\2\2\u00a8\u04e0\3\2"+ + "\2\2\u00aa\u04e4\3\2\2\2\u00ac\u04ea\3\2\2\2\u00ae\u04f1\3\2\2\2\u00b0"+ + "\u04f5\3\2\2\2\u00b2\u04fe\3\2\2\2\u00b4\u0503\3\2\2\2\u00b6\u050a\3\2"+ + "\2\2\u00b8\u0512\3\2\2\2\u00ba\u0519\3\2\2\2\u00bc\u051d\3\2\2\2\u00be"+ + "\u0521\3\2\2\2\u00c0\u0528\3\2\2\2\u00c2\u052b\3\2\2\2\u00c4\u0531\3\2"+ + "\2\2\u00c6\u0536\3\2\2\2\u00c8\u053e\3\2\2\2\u00ca\u0544\3\2\2\2\u00cc"+ + "\u054d\3\2\2\2\u00ce\u0553\3\2\2\2\u00d0\u0558\3\2\2\2\u00d2\u055d\3\2"+ + "\2\2\u00d4\u0562\3\2\2\2\u00d6\u0566\3\2\2\2\u00d8\u056a\3\2\2\2\u00da"+ + "\u0570\3\2\2\2\u00dc\u0578\3\2\2\2\u00de\u057e\3\2\2\2\u00e0\u0584\3\2"+ + "\2\2\u00e2\u0589\3\2\2\2\u00e4\u0590\3\2\2\2\u00e6\u059c\3\2\2\2\u00e8"+ + "\u05a2\3\2\2\2\u00ea\u05a8\3\2\2\2\u00ec\u05b0\3\2\2\2\u00ee\u05b8\3\2"+ + "\2\2\u00f0\u05c2\3\2\2\2\u00f2\u05ca\3\2\2\2\u00f4\u05cf\3\2\2\2\u00f6"+ + "\u05d2\3\2\2\2\u00f8\u05d7\3\2\2\2\u00fa\u05df\3\2\2\2\u00fc\u05e5\3\2"+ + "\2\2\u00fe\u05e9\3\2\2\2\u0100\u05ef\3\2\2\2\u0102\u05fa\3\2\2\2\u0104"+ + "\u0605\3\2\2\2\u0106\u0608\3\2\2\2\u0108\u060e\3\2\2\2\u010a\u0613\3\2"+ + "\2\2\u010c\u061b\3\2\2\2\u010e\u061d\3\2\2\2\u0110\u061f\3\2\2\2\u0112"+ + "\u0621\3\2\2\2\u0114\u0623\3\2\2\2\u0116\u0625\3\2\2\2\u0118\u0628\3\2"+ + "\2\2\u011a\u062a\3\2\2\2\u011c\u062c\3\2\2\2\u011e\u062e\3\2\2\2\u0120"+ + "\u0630\3\2\2\2\u0122\u0632\3\2\2\2\u0124\u0635\3\2\2\2\u0126\u0638\3\2"+ + "\2\2\u0128\u063b\3\2\2\2\u012a\u063d\3\2\2\2\u012c\u063f\3\2\2\2\u012e"+ + "\u0641\3\2\2\2\u0130\u0643\3\2\2\2\u0132\u0645\3\2\2\2\u0134\u0647\3\2"+ + "\2\2\u0136\u0649\3\2\2\2\u0138\u064b\3\2\2\2\u013a\u064e\3\2\2\2\u013c"+ + "\u0651\3\2\2\2\u013e\u0653\3\2\2\2\u0140\u0655\3\2\2\2\u0142\u0658\3\2"+ + "\2\2\u0144\u065b\3\2\2\2\u0146\u065e\3\2\2\2\u0148\u0661\3\2\2\2\u014a"+ + "\u0665\3\2\2\2\u014c\u0669\3\2\2\2\u014e\u066b\3\2\2\2\u0150\u066d\3\2"+ + "\2\2\u0152\u066f\3\2\2\2\u0154\u0672\3\2\2\2\u0156\u0675\3\2\2\2\u0158"+ + "\u0677\3\2\2\2\u015a\u0679\3\2\2\2\u015c\u067c\3\2\2\2\u015e\u0680\3\2"+ + "\2\2\u0160\u0682\3\2\2\2\u0162\u0685\3\2\2\2\u0164\u0688\3\2\2\2\u0166"+ + "\u068c\3\2\2\2\u0168\u068f\3\2\2\2\u016a\u0692\3\2\2\2\u016c\u0695\3\2"+ + "\2\2\u016e\u0698\3\2\2\2\u0170\u069b\3\2\2\2\u0172\u069e\3\2\2\2\u0174"+ + "\u06a1\3\2\2\2\u0176\u06a5\3\2\2\2\u0178\u06a9\3\2\2\2\u017a\u06ae\3\2"+ + "\2\2\u017c\u06b2\3\2\2\2\u017e\u06b5\3\2\2\2\u0180\u06b7\3\2\2\2\u0182"+ + "\u06be\3\2\2\2\u0184\u06c1\3\2\2\2\u0186\u06c7\3\2\2\2\u0188\u06c9\3\2"+ + "\2\2\u018a\u06cb\3\2\2\2\u018c\u06d6\3\2\2\2\u018e\u06df\3\2\2\2\u0190"+ + "\u06e2\3\2\2\2\u0192\u06e6\3\2\2\2\u0194\u06e8\3\2\2\2\u0196\u06f7\3\2"+ + "\2\2\u0198\u06f9\3\2\2\2\u019a\u06fd\3\2\2\2\u019c\u0700\3\2\2\2\u019e"+ + "\u0703\3\2\2\2\u01a0\u0707\3\2\2\2\u01a2\u0709\3\2\2\2\u01a4\u070b\3\2"+ + "\2\2\u01a6\u0715\3\2\2\2\u01a8\u0717\3\2\2\2\u01aa\u071a\3\2\2\2\u01ac"+ + "\u0725\3\2\2\2\u01ae\u0727\3\2\2\2\u01b0\u072e\3\2\2\2\u01b2\u0734\3\2"+ + "\2\2\u01b4\u0739\3\2\2\2\u01b6\u073b\3\2\2\2\u01b8\u0742\3\2\2\2\u01ba"+ + "\u0761\3\2\2\2\u01bc\u076d\3\2\2\2\u01be\u078f\3\2\2\2\u01c0\u07e3\3\2"+ + "\2\2\u01c2\u07e5\3\2\2\2\u01c4\u07e7\3\2\2\2\u01c6\u07e9\3\2\2\2\u01c8"+ + "\u07f0\3\2\2\2\u01ca\u07f2\3\2\2\2\u01cc\u07f9\3\2\2\2\u01ce\u0802\3\2"+ + "\2\2\u01d0\u0806\3\2\2\2\u01d2\u080a\3\2\2\2\u01d4\u080c\3\2\2\2\u01d6"+ + "\u0816\3\2\2\2\u01d8\u081c\3\2\2\2\u01da\u0822\3\2\2\2\u01dc\u0824\3\2"+ + "\2\2\u01de\u0830\3\2\2\2\u01e0\u083c\3\2\2\2\u01e2\u0842\3\2\2\2\u01e4"+ + "\u084f\3\2\2\2\u01e6\u086b\3\2\2\2\u01e8\u0872\3\2\2\2\u01ea\u0878\3\2"+ + "\2\2\u01ec\u0883\3\2\2\2\u01ee\u088c\3\2\2\2\u01f0\u089b\3\2\2\2\u01f2"+ + "\u089f\3\2\2\2\u01f4\u08a3\3\2\2\2\u01f6\u08a7\3\2\2\2\u01f8\u08ac\3\2"+ + "\2\2\u01fa\u08b2\3\2\2\2\u01fc\u08bb\3\2\2\2\u01fe\u08bd\3\2\2\2\u0200"+ + "\u08bf\3\2\2\2\u0202\u08c1\3\2\2\2\u0204\u08c6\3\2\2\2\u0206\u08cb\3\2"+ + "\2\2\u0208\u08d8\3\2\2\2\u020a\u08ff\3\2\2\2\u020c\u0901\3\2\2\2\u020e"+ + "\u092a\3\2\2\2\u0210\u092c\3\2\2\2\u0212\u0962\3\2\2\2\u0214\u0964\3\2"+ + "\2\2\u0216\u096a\3\2\2\2\u0218\u0971\3\2\2\2\u021a\u0985\3\2\2\2\u021c"+ + "\u0998\3\2\2\2\u021e\u09b1\3\2\2\2\u0220\u09b8\3\2\2\2\u0222\u09ba\3\2"+ + "\2\2\u0224\u09be\3\2\2\2\u0226\u09c3\3\2\2\2\u0228\u09d0\3\2\2\2\u022a"+ + "\u09d5\3\2\2\2\u022c\u09d9\3\2\2\2\u022e\u09e0\3\2\2\2\u0230\u09eb\3\2"+ + "\2\2\u0232\u09ee\3\2\2\2\u0234\u0a08\3\2\2\2\u0236\u0a62\3\2\2\2\u0238"+ + "\u0a64\3\2\2\2\u023a\u0a68\3\2\2\2\u023c\u0a6d\3\2\2\2\u023e\u0a72\3\2"+ + "\2\2\u0240\u0a74\3\2\2\2\u0242\u0a76\3\2\2\2\u0244\u0a78\3\2\2\2\u0246"+ + "\u0a7c\3\2\2\2\u0248\u0a80\3\2\2\2\u024a\u0a87\3\2\2\2\u024c\u0a8b\3\2"+ + "\2\2\u024e\u0a8d\3\2\2\2\u0250\u0a93\3\2\2\2\u0252\u0a96\3\2\2\2\u0254"+ + "\u0a98\3\2\2\2\u0256\u0a9d\3\2\2\2\u0258\u0ab8\3\2\2\2\u025a\u0abd\3\2"+ + "\2\2\u025c\u0abf\3\2\2\2\u025e\u0ac4\3\2\2\2\u0260\u0adf\3\2\2\2\u0262"+ + "\u0ae3\3\2\2\2\u0264\u0ae5\3\2\2\2\u0266\u0ae7\3\2\2\2\u0268\u0aec\3\2"+ + "\2\2\u026a\u0af2\3\2\2\2\u026c\u0aff\3\2\2\2\u026e\u0b17\3\2\2\2\u0270"+ + "\u0b29\3\2\2\2\u0272\u0b2b\3\2\2\2\u0274\u0b31\3\2\2\2\u0276\u0b37\3\2"+ + "\2\2\u0278\u0b43\3\2\2\2\u027a\u0b54\3\2\2\2\u027c\u0b56\3\2\2\2\u027e"+ + "\u0b6e\3\2\2\2\u0280\u0b7a\3\2\2\2\u0282\u0b7c\3\2\2\2\u0284\u0b7e\3\2"+ + "\2\2\u0286\u0b85\3\2\2\2\u0288\u0b8f\3\2\2\2\u028a\u0b91\3\2\2\2\u028c"+ + "\u0b97\3\2\2\2\u028e\u0b9e\3\2\2\2\u0290\u0ba0\3\2\2\2\u0292\u0ba5\3\2"+ + "\2\2\u0294\u0ba9\3\2\2\2\u0296\u0bab\3\2\2\2\u0298\u0bb1\3\2\2\2\u029a"+ + "\u0bc7\3\2\2\2\u029c\u0bc9\3\2\2\2\u029e\u0bd5\3\2\2\2\u02a0\u0bda\3\2"+ + "\2\2\u02a2\u02a3\7k\2\2\u02a3\u02a4\7o\2\2\u02a4\u02a5\7r\2\2\u02a5\u02a6"+ + "\7q\2\2\u02a6\u02a7\7t\2\2\u02a7\u02a8\7v\2\2\u02a8\23\3\2\2\2\u02a9\u02aa"+ + "\7c\2\2\u02aa\u02ab\7u\2\2\u02ab\25\3\2\2\2\u02ac\u02ad\7r\2\2\u02ad\u02ae"+ + "\7w\2\2\u02ae\u02af\7d\2\2\u02af\u02b0\7n\2\2\u02b0\u02b1\7k\2\2\u02b1"+ + "\u02b2\7e\2\2\u02b2\27\3\2\2\2\u02b3\u02b4\7r\2\2\u02b4\u02b5\7t\2\2\u02b5"+ + "\u02b6\7k\2\2\u02b6\u02b7\7x\2\2\u02b7\u02b8\7c\2\2\u02b8\u02b9\7v\2\2"+ + "\u02b9\u02ba\7g\2\2\u02ba\31\3\2\2\2\u02bb\u02bc\7g\2\2\u02bc\u02bd\7"+ + "z\2\2\u02bd\u02be\7v\2\2\u02be\u02bf\7g\2\2\u02bf\u02c0\7t\2\2\u02c0\u02c1"+ + "\7p\2\2\u02c1\u02c2\7c\2\2\u02c2\u02c3\7n\2\2\u02c3\33\3\2\2\2\u02c4\u02c5"+ + "\7h\2\2\u02c5\u02c6\7k\2\2\u02c6\u02c7\7p\2\2\u02c7\u02c8\7c\2\2\u02c8"+ + "\u02c9\7n\2\2\u02c9\35\3\2\2\2\u02ca\u02cb\7u\2\2\u02cb\u02cc\7g\2\2\u02cc"+ + "\u02cd\7t\2\2\u02cd\u02ce\7x\2\2\u02ce\u02cf\7k\2\2\u02cf\u02d0\7e\2\2"+ + "\u02d0\u02d1\7g\2\2\u02d1\37\3\2\2\2\u02d2\u02d3\7t\2\2\u02d3\u02d4\7"+ + "g\2\2\u02d4\u02d5\7u\2\2\u02d5\u02d6\7q\2\2\u02d6\u02d7\7w\2\2\u02d7\u02d8"+ + "\7t\2\2\u02d8\u02d9\7e\2\2\u02d9\u02da\7g\2\2\u02da!\3\2\2\2\u02db\u02dc"+ + "\7h\2\2\u02dc\u02dd\7w\2\2\u02dd\u02de\7p\2\2\u02de\u02df\7e\2\2\u02df"+ + "\u02e0\7v\2\2\u02e0\u02e1\7k\2\2\u02e1\u02e2\7q\2\2\u02e2\u02e3\7p\2\2"+ + "\u02e3#\3\2\2\2\u02e4\u02e5\7q\2\2\u02e5\u02e6\7d\2\2\u02e6\u02e7\7l\2"+ + "\2\u02e7\u02e8\7g\2\2\u02e8\u02e9\7e\2\2\u02e9\u02ea\7v\2\2\u02ea%\3\2"+ + "\2\2\u02eb\u02ec\7t\2\2\u02ec\u02ed\7g\2\2\u02ed\u02ee\7e\2\2\u02ee\u02ef"+ + "\7q\2\2\u02ef\u02f0\7t\2\2\u02f0\u02f1\7f\2\2\u02f1\'\3\2\2\2\u02f2\u02f3"+ + "\7c\2\2\u02f3\u02f4\7p\2\2\u02f4\u02f5\7p\2\2\u02f5\u02f6\7q\2\2\u02f6"+ + "\u02f7\7v\2\2\u02f7\u02f8\7c\2\2\u02f8\u02f9\7v\2\2\u02f9\u02fa\7k\2\2"+ + "\u02fa\u02fb\7q\2\2\u02fb\u02fc\7p\2\2\u02fc)\3\2\2\2\u02fd\u02fe\7r\2"+ + "\2\u02fe\u02ff\7c\2\2\u02ff\u0300\7t\2\2\u0300\u0301\7c\2\2\u0301\u0302"+ + "\7o\2\2\u0302\u0303\7g\2\2\u0303\u0304\7v\2\2\u0304\u0305\7g\2\2\u0305"+ + "\u0306\7t\2\2\u0306+\3\2\2\2\u0307\u0308\7v\2\2\u0308\u0309\7t\2\2\u0309"+ + "\u030a\7c\2\2\u030a\u030b\7p\2\2\u030b\u030c\7u\2\2\u030c\u030d\7h\2\2"+ + "\u030d\u030e\7q\2\2\u030e\u030f\7t\2\2\u030f\u0310\7o\2\2\u0310\u0311"+ + "\7g\2\2\u0311\u0312\7t\2\2\u0312-\3\2\2\2\u0313\u0314\7y\2\2\u0314\u0315"+ + "\7q\2\2\u0315\u0316\7t\2\2\u0316\u0317\7m\2\2\u0317\u0318\7g\2\2\u0318"+ + "\u0319\7t\2\2\u0319/\3\2\2\2\u031a\u031b\7n\2\2\u031b\u031c\7k\2\2\u031c"+ + "\u031d\7u\2\2\u031d\u031e\7v\2\2\u031e\u031f\7g\2\2\u031f\u0320\7p\2\2"+ + "\u0320\u0321\7g\2\2\u0321\u0322\7t\2\2\u0322\61\3\2\2\2\u0323\u0324\7"+ + "t\2\2\u0324\u0325\7g\2\2\u0325\u0326\7o\2\2\u0326\u0327\7q\2\2\u0327\u0328"+ + "\7v\2\2\u0328\u0329\7g\2\2\u0329\63\3\2\2\2\u032a\u032b\7z\2\2\u032b\u032c"+ + "\7o\2\2\u032c\u032d\7n\2\2\u032d\u032e\7p\2\2\u032e\u032f\7u\2\2\u032f"+ + "\65\3\2\2\2\u0330\u0331\7t\2\2\u0331\u0332\7g\2\2\u0332\u0333\7v\2\2\u0333"+ + "\u0334\7w\2\2\u0334\u0335\7t\2\2\u0335\u0336\7p\2\2\u0336\u0337\7u\2\2"+ + "\u0337\67\3\2\2\2\u0338\u0339\7x\2\2\u0339\u033a\7g\2\2\u033a\u033b\7"+ + "t\2\2\u033b\u033c\7u\2\2\u033c\u033d\7k\2\2\u033d\u033e\7q\2\2\u033e\u033f"+ + "\7p\2\2\u033f9\3\2\2\2\u0340\u0341\7e\2\2\u0341\u0342\7j\2\2\u0342\u0343"+ + "\7c\2\2\u0343\u0344\7p\2\2\u0344\u0345\7p\2\2\u0345\u0346\7g\2\2\u0346"+ + "\u0347\7n\2\2\u0347;\3\2\2\2\u0348\u0349\7c\2\2\u0349\u034a\7d\2\2\u034a"+ + "\u034b\7u\2\2\u034b\u034c\7v\2\2\u034c\u034d\7t\2\2\u034d\u034e\7c\2\2"+ + "\u034e\u034f\7e\2\2\u034f\u0350\7v\2\2\u0350=\3\2\2\2\u0351\u0352\7e\2"+ + "\2\u0352\u0353\7n\2\2\u0353\u0354\7k\2\2\u0354\u0355\7g\2\2\u0355\u0356"+ + "\7p\2\2\u0356\u0357\7v\2\2\u0357?\3\2\2\2\u0358\u0359\7e\2\2\u0359\u035a"+ + "\7q\2\2\u035a\u035b\7p\2\2\u035b\u035c\7u\2\2\u035c\u035d\7v\2\2\u035d"+ + "A\3\2\2\2\u035e\u035f\7v\2\2\u035f\u0360\7{\2\2\u0360\u0361\7r\2\2\u0361"+ + "\u0362\7g\2\2\u0362\u0363\7q\2\2\u0363\u0364\7h\2\2\u0364C\3\2\2\2\u0365"+ + "\u0366\7u\2\2\u0366\u0367\7q\2\2\u0367\u0368\7w\2\2\u0368\u0369\7t\2\2"+ + "\u0369\u036a\7e\2\2\u036a\u036b\7g\2\2\u036bE\3\2\2\2\u036c\u036d\7h\2"+ + "\2\u036d\u036e\7t\2\2\u036e\u036f\7q\2\2\u036f\u0370\7o\2\2\u0370\u0371"+ + "\3\2\2\2\u0371\u0372\b\34\2\2\u0372G\3\2\2\2\u0373\u0374\7q\2\2\u0374"+ + "\u0375\7p\2\2\u0375I\3\2\2\2\u0376\u0377\6\36\2\2\u0377\u0378\7u\2\2\u0378"+ + "\u0379\7g\2\2\u0379\u037a\7n\2\2\u037a\u037b\7g\2\2\u037b\u037c\7e\2\2"+ + "\u037c\u037d\7v\2\2\u037d\u037e\3\2\2\2\u037e\u037f\b\36\3\2\u037fK\3"+ + "\2\2\2\u0380\u0381\7i\2\2\u0381\u0382\7t\2\2\u0382\u0383\7q\2\2\u0383"+ + "\u0384\7w\2\2\u0384\u0385\7r\2\2\u0385M\3\2\2\2\u0386\u0387\7d\2\2\u0387"+ + "\u0388\7{\2\2\u0388O\3\2\2\2\u0389\u038a\7j\2\2\u038a\u038b\7c\2\2\u038b"+ + "\u038c\7x\2\2\u038c\u038d\7k\2\2\u038d\u038e\7p\2\2\u038e\u038f\7i\2\2"+ + "\u038fQ\3\2\2\2\u0390\u0391\7q\2\2\u0391\u0392\7t\2\2\u0392\u0393\7f\2"+ + "\2\u0393\u0394\7g\2\2\u0394\u0395\7t\2\2\u0395S\3\2\2\2\u0396\u0397\7"+ + "y\2\2\u0397\u0398\7j\2\2\u0398\u0399\7g\2\2\u0399\u039a\7t\2\2\u039a\u039b"+ + "\7g\2\2\u039bU\3\2\2\2\u039c\u039d\7h\2\2\u039d\u039e\7q\2\2\u039e\u039f"+ + "\7n\2\2\u039f\u03a0\7n\2\2\u03a0\u03a1\7q\2\2\u03a1\u03a2\7y\2\2\u03a2"+ + "\u03a3\7g\2\2\u03a3\u03a4\7f\2\2\u03a4W\3\2\2\2\u03a5\u03a6\7h\2\2\u03a6"+ + "\u03a7\7q\2\2\u03a7\u03a8\7t\2\2\u03a8\u03a9\3\2\2\2\u03a9\u03aa\b%\4"+ + "\2\u03aaY\3\2\2\2\u03ab\u03ac\7y\2\2\u03ac\u03ad\7k\2\2\u03ad\u03ae\7"+ + "p\2\2\u03ae\u03af\7f\2\2\u03af\u03b0\7q\2\2\u03b0\u03b1\7y\2\2\u03b1["+ + "\3\2\2\2\u03b2\u03b3\6\'\3\2\u03b3\u03b4\7g\2\2\u03b4\u03b5\7x\2\2\u03b5"+ + "\u03b6\7g\2\2\u03b6\u03b7\7p\2\2\u03b7\u03b8\7v\2\2\u03b8\u03b9\7u\2\2"+ + "\u03b9\u03ba\3\2\2\2\u03ba\u03bb\b\'\5\2\u03bb]\3\2\2\2\u03bc\u03bd\7"+ + "g\2\2\u03bd\u03be\7x\2\2\u03be\u03bf\7g\2\2\u03bf\u03c0\7t\2\2\u03c0\u03c1"+ + "\7{\2\2\u03c1_\3\2\2\2\u03c2\u03c3\7y\2\2\u03c3\u03c4\7k\2\2\u03c4\u03c5"+ + "\7v\2\2\u03c5\u03c6\7j\2\2\u03c6\u03c7\7k\2\2\u03c7\u03c8\7p\2\2\u03c8"+ + "\u03c9\3\2\2\2\u03c9\u03ca\b)\6\2\u03caa\3\2\2\2\u03cb\u03cc\6*\4\2\u03cc"+ + "\u03cd\7n\2\2\u03cd\u03ce\7c\2\2\u03ce\u03cf\7u\2\2\u03cf\u03d0\7v\2\2"+ + "\u03d0\u03d1\3\2\2\2\u03d1\u03d2\b*\7\2\u03d2c\3\2\2\2\u03d3\u03d4\6+"+ + "\5\2\u03d4\u03d5\7h\2\2\u03d5\u03d6\7k\2\2\u03d6\u03d7\7t\2\2\u03d7\u03d8"+ + "\7u\2\2\u03d8\u03d9\7v\2\2\u03d9\u03da\3\2\2\2\u03da\u03db\b+\b\2\u03db"+ + "e\3\2\2\2\u03dc\u03dd\7u\2\2\u03dd\u03de\7p\2\2\u03de\u03df\7c\2\2\u03df"+ + "\u03e0\7r\2\2\u03e0\u03e1\7u\2\2\u03e1\u03e2\7j\2\2\u03e2\u03e3\7q\2\2"+ + "\u03e3\u03e4\7v\2\2\u03e4g\3\2\2\2\u03e5\u03e6\6-\6\2\u03e6\u03e7\7q\2"+ + "\2\u03e7\u03e8\7w\2\2\u03e8\u03e9\7v\2\2\u03e9\u03ea\7r\2\2\u03ea\u03eb"+ + "\7w\2\2\u03eb\u03ec\7v\2\2\u03ec\u03ed\3\2\2\2\u03ed\u03ee\b-\t\2\u03ee"+ + "i\3\2\2\2\u03ef\u03f0\7k\2\2\u03f0\u03f1\7p\2\2\u03f1\u03f2\7p\2\2\u03f2"+ + "\u03f3\7g\2\2\u03f3\u03f4\7t\2\2\u03f4k\3\2\2\2\u03f5\u03f6\7q\2\2\u03f6"+ + "\u03f7\7w\2\2\u03f7\u03f8\7v\2\2\u03f8\u03f9\7g\2\2\u03f9\u03fa\7t\2\2"+ + "\u03fam\3\2\2\2\u03fb\u03fc\7t\2\2\u03fc\u03fd\7k\2\2\u03fd\u03fe\7i\2"+ + "\2\u03fe\u03ff\7j\2\2\u03ff\u0400\7v\2\2\u0400o\3\2\2\2\u0401\u0402\7"+ + "n\2\2\u0402\u0403\7g\2\2\u0403\u0404\7h\2\2\u0404\u0405\7v\2\2\u0405q"+ + "\3\2\2\2\u0406\u0407\7h\2\2\u0407\u0408\7w\2\2\u0408\u0409\7n\2\2\u0409"+ + "\u040a\7n\2\2\u040as\3\2\2\2\u040b\u040c\7w\2\2\u040c\u040d\7p\2\2\u040d"+ + "\u040e\7k\2\2\u040e\u040f\7f\2\2\u040f\u0410\7k\2\2\u0410\u0411\7t\2\2"+ + "\u0411\u0412\7g\2\2\u0412\u0413\7e\2\2\u0413\u0414\7v\2\2\u0414\u0415"+ + "\7k\2\2\u0415\u0416\7q\2\2\u0416\u0417\7p\2\2\u0417\u0418\7c\2\2\u0418"+ + "\u0419\7n\2\2\u0419u\3\2\2\2\u041a\u041b\6\64\7\2\u041b\u041c\7u\2\2\u041c"+ + "\u041d\7g\2\2\u041d\u041e\7e\2\2\u041e\u041f\7q\2\2\u041f\u0420\7p\2\2"+ + "\u0420\u0421\7f\2\2\u0421\u0422\3\2\2\2\u0422\u0423\b\64\n\2\u0423w\3"+ + "\2\2\2\u0424\u0425\6\65\b\2\u0425\u0426\7o\2\2\u0426\u0427\7k\2\2\u0427"+ + "\u0428\7p\2\2\u0428\u0429\7w\2\2\u0429\u042a\7v\2\2\u042a\u042b\7g\2\2"+ + "\u042b\u042c\3\2\2\2\u042c\u042d\b\65\13\2\u042dy\3\2\2\2\u042e\u042f"+ + "\6\66\t\2\u042f\u0430\7j\2\2\u0430\u0431\7q\2\2\u0431\u0432\7w\2\2\u0432"+ + "\u0433\7t\2\2\u0433\u0434\3\2\2\2\u0434\u0435\b\66\f\2\u0435{\3\2\2\2"+ + "\u0436\u0437\6\67\n\2\u0437\u0438\7f\2\2\u0438\u0439\7c\2\2\u0439\u043a"+ + "\7{\2\2\u043a\u043b\3\2\2\2\u043b\u043c\b\67\r\2\u043c}\3\2\2\2\u043d"+ + "\u043e\68\13\2\u043e\u043f\7o\2\2\u043f\u0440\7q\2\2\u0440\u0441\7p\2"+ + "\2\u0441\u0442\7v\2\2\u0442\u0443\7j\2\2\u0443\u0444\3\2\2\2\u0444\u0445"+ + "\b8\16\2\u0445\177\3\2\2\2\u0446\u0447\69\f\2\u0447\u0448\7{\2\2\u0448"+ + "\u0449\7g\2\2\u0449\u044a\7c\2\2\u044a\u044b\7t\2\2\u044b\u044c\3\2\2"+ + "\2\u044c\u044d\b9\17\2\u044d\u0081\3\2\2\2\u044e\u044f\6:\r\2\u044f\u0450"+ + "\7u\2\2\u0450\u0451\7g\2\2\u0451\u0452\7e\2\2\u0452\u0453\7q\2\2\u0453"+ + "\u0454\7p\2\2\u0454\u0455\7f\2\2\u0455\u0456\7u\2\2\u0456\u0457\3\2\2"+ + "\2\u0457\u0458\b:\20\2\u0458\u0083\3\2\2\2\u0459\u045a\6;\16\2\u045a\u045b"+ + "\7o\2\2\u045b\u045c\7k\2\2\u045c\u045d\7p\2\2\u045d\u045e\7w\2\2\u045e"+ + "\u045f\7v\2\2\u045f\u0460\7g\2\2\u0460\u0461\7u\2\2\u0461\u0462\3\2\2"+ + "\2\u0462\u0463\b;\21\2\u0463\u0085\3\2\2\2\u0464\u0465\6<\17\2\u0465\u0466"+ + "\7j\2\2\u0466\u0467\7q\2\2\u0467\u0468\7w\2\2\u0468\u0469\7t\2\2\u0469"+ + "\u046a\7u\2\2\u046a\u046b\3\2\2\2\u046b\u046c\b<\22\2\u046c\u0087\3\2"+ + "\2\2\u046d\u046e\6=\20\2\u046e\u046f\7f\2\2\u046f\u0470\7c\2\2\u0470\u0471"+ + "\7{\2\2\u0471\u0472\7u\2\2\u0472\u0473\3\2\2\2\u0473\u0474\b=\23\2\u0474"+ + "\u0089\3\2\2\2\u0475\u0476\6>\21\2\u0476\u0477\7o\2\2\u0477\u0478\7q\2"+ + "\2\u0478\u0479\7p\2\2\u0479\u047a\7v\2\2\u047a\u047b\7j\2\2\u047b\u047c"+ + "\7u\2\2\u047c\u047d\3\2\2\2\u047d\u047e\b>\24\2\u047e\u008b\3\2\2\2\u047f"+ + "\u0480\6?\22\2\u0480\u0481\7{\2\2\u0481\u0482\7g\2\2\u0482\u0483\7c\2"+ + "\2\u0483\u0484\7t\2\2\u0484\u0485\7u\2\2\u0485\u0486\3\2\2\2\u0486\u0487"+ + "\b?\25\2\u0487\u008d\3\2\2\2\u0488\u0489\7h\2\2\u0489\u048a\7q\2\2\u048a"+ + "\u048b\7t\2\2\u048b\u048c\7g\2\2\u048c\u048d\7x\2\2\u048d\u048e\7g\2\2"+ + "\u048e\u048f\7t\2\2\u048f\u008f\3\2\2\2\u0490\u0491\7n\2\2\u0491\u0492"+ + "\7k\2\2\u0492\u0493\7o\2\2\u0493\u0494\7k\2\2\u0494\u0495\7v\2\2\u0495"+ + "\u0091\3\2\2\2\u0496\u0497\7c\2\2\u0497\u0498\7u\2\2\u0498\u0499\7e\2"+ + "\2\u0499\u049a\7g\2\2\u049a\u049b\7p\2\2\u049b\u049c\7f\2\2\u049c\u049d"+ + "\7k\2\2\u049d\u049e\7p\2\2\u049e\u049f\7i\2\2\u049f\u0093\3\2\2\2\u04a0"+ + "\u04a1\7f\2\2\u04a1\u04a2\7g\2\2\u04a2\u04a3\7u\2\2\u04a3\u04a4\7e\2\2"+ + "\u04a4\u04a5\7g\2\2\u04a5\u04a6\7p\2\2\u04a6\u04a7\7f\2\2\u04a7\u04a8"+ + "\7k\2\2\u04a8\u04a9\7p\2\2\u04a9\u04aa\7i\2\2\u04aa\u0095\3\2\2\2\u04ab"+ + "\u04ac\7k\2\2\u04ac\u04ad\7p\2\2\u04ad\u04ae\7v\2\2\u04ae\u0097\3\2\2"+ + "\2\u04af\u04b0\7d\2\2\u04b0\u04b1\7{\2\2\u04b1\u04b2\7v\2\2\u04b2\u04b3"+ + "\7g\2\2\u04b3\u0099\3\2\2\2\u04b4\u04b5\7h\2\2\u04b5\u04b6\7n\2\2\u04b6"+ + "\u04b7\7q\2\2\u04b7\u04b8\7c\2\2\u04b8\u04b9\7v\2\2\u04b9\u009b\3\2\2"+ + "\2\u04ba\u04bb\7f\2\2\u04bb\u04bc\7g\2\2\u04bc\u04bd\7e\2\2\u04bd\u04be"+ + "\7k\2\2\u04be\u04bf\7o\2\2\u04bf\u04c0\7c\2\2\u04c0\u04c1\7n\2\2\u04c1"+ + "\u009d\3\2\2\2\u04c2\u04c3\7d\2\2\u04c3\u04c4\7q\2\2\u04c4\u04c5\7q\2"+ + "\2\u04c5\u04c6\7n\2\2\u04c6\u04c7\7g\2\2\u04c7\u04c8\7c\2\2\u04c8\u04c9"+ + "\7p\2\2\u04c9\u009f\3\2\2\2\u04ca\u04cb\7u\2\2\u04cb\u04cc\7v\2\2\u04cc"+ + "\u04cd\7t\2\2\u04cd\u04ce\7k\2\2\u04ce\u04cf\7p\2\2\u04cf\u04d0\7i\2\2"+ + "\u04d0\u00a1\3\2\2\2\u04d1\u04d2\7g\2\2\u04d2\u04d3\7t\2\2\u04d3\u04d4"+ + "\7t\2\2\u04d4\u04d5\7q\2\2\u04d5\u04d6\7t\2\2\u04d6\u00a3\3\2\2\2\u04d7"+ + "\u04d8\7o\2\2\u04d8\u04d9\7c\2\2\u04d9\u04da\7r\2\2\u04da\u00a5\3\2\2"+ + "\2\u04db\u04dc\7l\2\2\u04dc\u04dd\7u\2\2\u04dd\u04de\7q\2\2\u04de\u04df"+ + "\7p\2\2\u04df\u00a7\3\2\2\2\u04e0\u04e1\7z\2\2\u04e1\u04e2\7o\2\2\u04e2"+ + "\u04e3\7n\2\2\u04e3\u00a9\3\2\2\2\u04e4\u04e5\7v\2\2\u04e5\u04e6\7c\2"+ + "\2\u04e6\u04e7\7d\2\2\u04e7\u04e8\7n\2\2\u04e8\u04e9\7g\2\2\u04e9\u00ab"+ + "\3\2\2\2\u04ea\u04eb\7u\2\2\u04eb\u04ec\7v\2\2\u04ec\u04ed\7t\2\2\u04ed"+ + "\u04ee\7g\2\2\u04ee\u04ef\7c\2\2\u04ef\u04f0\7o\2\2\u04f0\u00ad\3\2\2"+ + "\2\u04f1\u04f2\7c\2\2\u04f2\u04f3\7p\2\2\u04f3\u04f4\7{\2\2\u04f4\u00af"+ + "\3\2\2\2\u04f5\u04f6\7v\2\2\u04f6\u04f7\7{\2\2\u04f7\u04f8\7r\2\2\u04f8"+ + "\u04f9\7g\2\2\u04f9\u04fa\7f\2\2\u04fa\u04fb\7g\2\2\u04fb\u04fc\7u\2\2"+ + "\u04fc\u04fd\7e\2\2\u04fd\u00b1\3\2\2\2\u04fe\u04ff\7v\2\2\u04ff\u0500"+ + "\7{\2\2\u0500\u0501\7r\2\2\u0501\u0502\7g\2\2\u0502\u00b3\3\2\2\2\u0503"+ + "\u0504\7h\2\2\u0504\u0505\7w\2\2\u0505\u0506\7v\2\2\u0506\u0507\7w\2\2"+ + "\u0507\u0508\7t\2\2\u0508\u0509\7g\2\2\u0509\u00b5\3\2\2\2\u050a\u050b"+ + "\7c\2\2\u050b\u050c\7p\2\2\u050c\u050d\7{\2\2\u050d\u050e\7f\2\2\u050e"+ + "\u050f\7c\2\2\u050f\u0510\7v\2\2\u0510\u0511\7c\2\2\u0511\u00b7\3\2\2"+ + "\2\u0512\u0513\7j\2\2\u0513\u0514\7c\2\2\u0514\u0515\7p\2\2\u0515\u0516"+ + "\7f\2\2\u0516\u0517\7n\2\2\u0517\u0518\7g\2\2\u0518\u00b9\3\2\2\2\u0519"+ + "\u051a\7x\2\2\u051a\u051b\7c\2\2\u051b\u051c\7t\2\2\u051c\u00bb\3\2\2"+ + "\2\u051d\u051e\7p\2\2\u051e\u051f\7g\2\2\u051f\u0520\7y\2\2\u0520\u00bd"+ + "\3\2\2\2\u0521\u0522\7a\2\2\u0522\u0523\7a\2\2\u0523\u0524\7k\2\2\u0524"+ + "\u0525\7p\2\2\u0525\u0526\7k\2\2\u0526\u0527\7v\2\2\u0527\u00bf\3\2\2"+ + "\2\u0528\u0529\7k\2\2\u0529\u052a\7h\2\2\u052a\u00c1\3\2\2\2\u052b\u052c"+ + "\7o\2\2\u052c\u052d\7c\2\2\u052d\u052e\7v\2\2\u052e\u052f\7e\2\2\u052f"+ + "\u0530\7j\2\2\u0530\u00c3\3\2\2\2\u0531\u0532\7g\2\2\u0532\u0533\7n\2"+ + "\2\u0533\u0534\7u\2\2\u0534\u0535\7g\2\2\u0535\u00c5\3\2\2\2\u0536\u0537"+ + "\7h\2\2\u0537\u0538\7q\2\2\u0538\u0539\7t\2\2\u0539\u053a\7g\2\2\u053a"+ + "\u053b\7c\2\2\u053b\u053c\7e\2\2\u053c\u053d\7j\2\2\u053d\u00c7\3\2\2"+ + "\2\u053e\u053f\7y\2\2\u053f\u0540\7j\2\2\u0540\u0541\7k\2\2\u0541\u0542"+ + "\7n\2\2\u0542\u0543\7g\2\2\u0543\u00c9\3\2\2\2\u0544\u0545\7e\2\2\u0545"+ + "\u0546\7q\2\2\u0546\u0547\7p\2\2\u0547\u0548\7v\2\2\u0548\u0549\7k\2\2"+ + "\u0549\u054a\7p\2\2\u054a\u054b\7w\2\2\u054b\u054c\7g\2\2\u054c\u00cb"+ + "\3\2\2\2\u054d\u054e\7d\2\2\u054e\u054f\7t\2\2\u054f\u0550\7g\2\2\u0550"+ + "\u0551\7c\2\2\u0551\u0552\7m\2\2\u0552\u00cd\3\2\2\2\u0553\u0554\7h\2"+ + "\2\u0554\u0555\7q\2\2\u0555\u0556\7t\2\2\u0556\u0557\7m\2\2\u0557\u00cf"+ + "\3\2\2\2\u0558\u0559\7l\2\2\u0559\u055a\7q\2\2\u055a\u055b\7k\2\2\u055b"+ + "\u055c\7p\2\2\u055c\u00d1\3\2\2\2\u055d\u055e\7u\2\2\u055e\u055f\7q\2"+ + "\2\u055f\u0560\7o\2\2\u0560\u0561\7g\2\2\u0561\u00d3\3\2\2\2\u0562\u0563"+ + "\7c\2\2\u0563\u0564\7n\2\2\u0564\u0565\7n\2\2\u0565\u00d5\3\2\2\2\u0566"+ + "\u0567\7v\2\2\u0567\u0568\7t\2\2\u0568\u0569\7{\2\2\u0569\u00d7\3\2\2"+ + "\2\u056a\u056b\7e\2\2\u056b\u056c\7c\2\2\u056c\u056d\7v\2\2\u056d\u056e"+ + "\7e\2\2\u056e\u056f\7j\2\2\u056f\u00d9\3\2\2\2\u0570\u0571\7h\2\2\u0571"+ + "\u0572\7k\2\2\u0572\u0573\7p\2\2\u0573\u0574\7c\2\2\u0574\u0575\7n\2\2"+ + "\u0575\u0576\7n\2\2\u0576\u0577\7{\2\2\u0577\u00db\3\2\2\2\u0578\u0579"+ + "\7v\2\2\u0579\u057a\7j\2\2\u057a\u057b\7t\2\2\u057b\u057c\7q\2\2\u057c"+ + "\u057d\7y\2\2\u057d\u00dd\3\2\2\2\u057e\u057f\7r\2\2\u057f\u0580\7c\2"+ + "\2\u0580\u0581\7p\2\2\u0581\u0582\7k\2\2\u0582\u0583\7e\2\2\u0583\u00df"+ + "\3\2\2\2\u0584\u0585\7v\2\2\u0585\u0586\7t\2\2\u0586\u0587\7c\2\2\u0587"+ + "\u0588\7r\2\2\u0588\u00e1\3\2\2\2\u0589\u058a\7t\2\2\u058a\u058b\7g\2"+ + "\2\u058b\u058c\7v\2\2\u058c\u058d\7w\2\2\u058d\u058e\7t\2\2\u058e\u058f"+ + "\7p\2\2\u058f\u00e3\3\2\2\2\u0590\u0591\7v\2\2\u0591\u0592\7t\2\2\u0592"+ + "\u0593\7c\2\2\u0593\u0594\7p\2\2\u0594\u0595\7u\2\2\u0595\u0596\7c\2\2"+ + "\u0596\u0597\7e\2\2\u0597\u0598\7v\2\2\u0598\u0599\7k\2\2\u0599\u059a"+ + "\7q\2\2\u059a\u059b\7p\2\2\u059b\u00e5\3\2\2\2\u059c\u059d\7c\2\2\u059d"+ + "\u059e\7d\2\2\u059e\u059f\7q\2\2\u059f\u05a0\7t\2\2\u05a0\u05a1\7v\2\2"+ + "\u05a1\u00e7\3\2\2\2\u05a2\u05a3\7t\2\2\u05a3\u05a4\7g\2\2\u05a4\u05a5"+ + "\7v\2\2\u05a5\u05a6\7t\2\2\u05a6\u05a7\7{\2\2\u05a7\u00e9\3\2\2\2\u05a8"+ + "\u05a9\7q\2\2\u05a9\u05aa\7p\2\2\u05aa\u05ab\7t\2\2\u05ab\u05ac\7g\2\2"+ + "\u05ac\u05ad\7v\2\2\u05ad\u05ae\7t\2\2\u05ae\u05af\7{\2\2\u05af\u00eb"+ + "\3\2\2\2\u05b0\u05b1\7t\2\2\u05b1\u05b2\7g\2\2\u05b2\u05b3\7v\2\2\u05b3"+ + "\u05b4\7t\2\2\u05b4\u05b5\7k\2\2\u05b5\u05b6\7g\2\2\u05b6\u05b7\7u\2\2"+ + "\u05b7\u00ed\3\2\2\2\u05b8\u05b9\7e\2\2\u05b9\u05ba\7q\2\2\u05ba\u05bb"+ + "\7o\2\2\u05bb\u05bc\7o\2\2\u05bc\u05bd\7k\2\2\u05bd\u05be\7v\2\2\u05be"+ + "\u05bf\7v\2\2\u05bf\u05c0\7g\2\2\u05c0\u05c1\7f\2\2\u05c1\u00ef\3\2\2"+ + "\2\u05c2\u05c3\7c\2\2\u05c3\u05c4\7d\2\2\u05c4\u05c5\7q\2\2\u05c5\u05c6"+ + "\7t\2\2\u05c6\u05c7\7v\2\2\u05c7\u05c8\7g\2\2\u05c8\u05c9\7f\2\2\u05c9"+ + "\u00f1\3\2\2\2\u05ca\u05cb\7y\2\2\u05cb\u05cc\7k\2\2\u05cc\u05cd\7v\2"+ + "\2\u05cd\u05ce\7j\2\2\u05ce\u00f3\3\2\2\2\u05cf\u05d0\7k\2\2\u05d0\u05d1"+ + "\7p\2\2\u05d1\u00f5\3\2\2\2\u05d2\u05d3\7n\2\2\u05d3\u05d4\7q\2\2\u05d4"+ + "\u05d5\7e\2\2\u05d5\u05d6\7m\2\2\u05d6\u00f7\3\2\2\2\u05d7\u05d8\7w\2"+ + "\2\u05d8\u05d9\7p\2\2\u05d9\u05da\7v\2\2\u05da\u05db\7c\2\2\u05db\u05dc"+ + "\7k\2\2\u05dc\u05dd\7p\2\2\u05dd\u05de\7v\2\2\u05de\u00f9\3\2\2\2\u05df"+ + "\u05e0\7u\2\2\u05e0\u05e1\7v\2\2\u05e1\u05e2\7c\2\2\u05e2\u05e3\7t\2\2"+ + "\u05e3\u05e4\7v\2\2\u05e4\u00fb\3\2\2\2\u05e5\u05e6\7d\2\2\u05e6\u05e7"+ + "\7w\2\2\u05e7\u05e8\7v\2\2\u05e8\u00fd\3\2\2\2\u05e9\u05ea\7e\2\2\u05ea"+ + "\u05eb\7j\2\2\u05eb\u05ec\7g\2\2\u05ec\u05ed\7e\2\2\u05ed\u05ee\7m\2\2"+ + "\u05ee\u00ff\3\2\2\2\u05ef\u05f0\7e\2\2\u05f0\u05f1\7j\2\2\u05f1\u05f2"+ + "\7g\2\2\u05f2\u05f3\7e\2\2\u05f3\u05f4\7m\2\2\u05f4\u05f5\7r\2\2\u05f5"+ + "\u05f6\7c\2\2\u05f6\u05f7\7p\2\2\u05f7\u05f8\7k\2\2\u05f8\u05f9\7e\2\2"+ + "\u05f9\u0101\3\2\2\2\u05fa\u05fb\7r\2\2\u05fb\u05fc\7t\2\2\u05fc\u05fd"+ + "\7k\2\2\u05fd\u05fe\7o\2\2\u05fe\u05ff\7c\2\2\u05ff\u0600\7t\2\2\u0600"+ + "\u0601\7{\2\2\u0601\u0602\7m\2\2\u0602\u0603\7g\2\2\u0603\u0604\7{\2\2"+ + "\u0604\u0103\3\2\2\2\u0605\u0606\7k\2\2\u0606\u0607\7u\2\2\u0607\u0105"+ + "\3\2\2\2\u0608\u0609\7h\2\2\u0609\u060a\7n\2\2\u060a\u060b\7w\2\2\u060b"+ + "\u060c\7u\2\2\u060c\u060d\7j\2\2\u060d\u0107\3\2\2\2\u060e\u060f\7y\2"+ + "\2\u060f\u0610\7c\2\2\u0610\u0611\7k\2\2\u0611\u0612\7v\2\2\u0612\u0109"+ + "\3\2\2\2\u0613\u0614\7f\2\2\u0614\u0615\7g\2\2\u0615\u0616\7h\2\2\u0616"+ + "\u0617\7c\2\2\u0617\u0618\7w\2\2\u0618\u0619\7n\2\2\u0619\u061a\7v\2\2"+ + "\u061a\u010b\3\2\2\2\u061b\u061c\7=\2\2\u061c\u010d\3\2\2\2\u061d\u061e"+ + "\7<\2\2\u061e\u010f\3\2\2\2\u061f\u0620\7\60\2\2\u0620\u0111\3\2\2\2\u0621"+ + "\u0622\7.\2\2\u0622\u0113\3\2\2\2\u0623\u0624\7}\2\2\u0624\u0115\3\2\2"+ + "\2\u0625\u0626\7\177\2\2\u0626\u0627\b\u0084\26\2\u0627\u0117\3\2\2\2"+ + "\u0628\u0629\7*\2\2\u0629\u0119\3\2\2\2\u062a\u062b\7+\2\2\u062b\u011b"+ + "\3\2\2\2\u062c\u062d\7]\2\2\u062d\u011d\3\2\2\2\u062e\u062f\7_\2\2\u062f"+ + "\u011f\3\2\2\2\u0630\u0631\7A\2\2\u0631\u0121\3\2\2\2\u0632\u0633\7A\2"+ + "\2\u0633\u0634\7\60\2\2\u0634\u0123\3\2\2\2\u0635\u0636\7}\2\2\u0636\u0637"+ + "\7~\2\2\u0637\u0125\3\2\2\2\u0638\u0639\7~\2\2\u0639\u063a\7\177\2\2\u063a"+ + "\u0127\3\2\2\2\u063b\u063c\7%\2\2\u063c\u0129\3\2\2\2\u063d\u063e\7?\2"+ + "\2\u063e\u012b\3\2\2\2\u063f\u0640\7-\2\2\u0640\u012d\3\2\2\2\u0641\u0642"+ + "\7/\2\2\u0642\u012f\3\2\2\2\u0643\u0644\7,\2\2\u0644\u0131\3\2\2\2\u0645"+ + "\u0646\7\61\2\2\u0646\u0133\3\2\2\2\u0647\u0648\7\'\2\2\u0648\u0135\3"+ + "\2\2\2\u0649\u064a\7#\2\2\u064a\u0137\3\2\2\2\u064b\u064c\7?\2\2\u064c"+ + "\u064d\7?\2\2\u064d\u0139\3\2\2\2\u064e\u064f\7#\2\2\u064f\u0650\7?\2"+ + "\2\u0650\u013b\3\2\2\2\u0651\u0652\7@\2\2\u0652\u013d\3\2\2\2\u0653\u0654"+ + "\7>\2\2\u0654\u013f\3\2\2\2\u0655\u0656\7@\2\2\u0656\u0657\7?\2\2\u0657"+ + "\u0141\3\2\2\2\u0658\u0659\7>\2\2\u0659\u065a\7?\2\2\u065a\u0143\3\2\2"+ + "\2\u065b\u065c\7(\2\2\u065c\u065d\7(\2\2\u065d\u0145\3\2\2\2\u065e\u065f"+ + "\7~\2\2\u065f\u0660\7~\2\2\u0660\u0147\3\2\2\2\u0661\u0662\7?\2\2\u0662"+ + "\u0663\7?\2\2\u0663\u0664\7?\2\2\u0664\u0149\3\2\2\2\u0665\u0666\7#\2"+ + "\2\u0666\u0667\7?\2\2\u0667\u0668\7?\2\2\u0668\u014b\3\2\2\2\u0669\u066a"+ + "\7(\2\2\u066a\u014d\3\2\2\2\u066b\u066c\7`\2\2\u066c\u014f\3\2\2\2\u066d"+ + "\u066e\7\u0080\2\2\u066e\u0151\3\2\2\2\u066f\u0670\7/\2\2\u0670\u0671"+ + "\7@\2\2\u0671\u0153\3\2\2\2\u0672\u0673\7>\2\2\u0673\u0674\7/\2\2\u0674"+ + "\u0155\3\2\2\2\u0675\u0676\7B\2\2\u0676\u0157\3\2\2\2\u0677\u0678\7b\2"+ + "\2\u0678\u0159\3\2\2\2\u0679\u067a\7\60\2\2\u067a\u067b\7\60\2\2\u067b"+ + "\u015b\3\2\2\2\u067c\u067d\7\60\2\2\u067d\u067e\7\60\2\2\u067e\u067f\7"+ + "\60\2\2\u067f\u015d\3\2\2\2\u0680\u0681\7~\2\2\u0681\u015f\3\2\2\2\u0682"+ + "\u0683\7?\2\2\u0683\u0684\7@\2\2\u0684\u0161\3\2\2\2\u0685\u0686\7A\2"+ + "\2\u0686\u0687\7<\2\2\u0687\u0163\3\2\2\2\u0688\u0689\7/\2\2\u0689\u068a"+ + "\7@\2\2\u068a\u068b\7@\2\2\u068b\u0165\3\2\2\2\u068c\u068d\7-\2\2\u068d"+ + "\u068e\7?\2\2\u068e\u0167\3\2\2\2\u068f\u0690\7/\2\2\u0690\u0691\7?\2"+ + "\2\u0691\u0169\3\2\2\2\u0692\u0693\7,\2\2\u0693\u0694\7?\2\2\u0694\u016b"+ + "\3\2\2\2\u0695\u0696\7\61\2\2\u0696\u0697\7?\2\2\u0697\u016d\3\2\2\2\u0698"+ + "\u0699\7(\2\2\u0699\u069a\7?\2\2\u069a\u016f\3\2\2\2\u069b\u069c\7~\2"+ + "\2\u069c\u069d\7?\2\2\u069d\u0171\3\2\2\2\u069e\u069f\7`\2\2\u069f\u06a0"+ + "\7?\2\2\u06a0\u0173\3\2\2\2\u06a1\u06a2\7>\2\2\u06a2\u06a3\7>\2\2\u06a3"+ + "\u06a4\7?\2\2\u06a4\u0175\3\2\2\2\u06a5\u06a6\7@\2\2\u06a6\u06a7\7@\2"+ + "\2\u06a7\u06a8\7?\2\2\u06a8\u0177\3\2\2\2\u06a9\u06aa\7@\2\2\u06aa\u06ab"+ + "\7@\2\2\u06ab\u06ac\7@\2\2\u06ac\u06ad\7?\2\2\u06ad\u0179\3\2\2\2\u06ae"+ + "\u06af\7\60\2\2\u06af\u06b0\7\60\2\2\u06b0\u06b1\7>\2\2\u06b1\u017b\3"+ + "\2\2\2\u06b2\u06b3\7\60\2\2\u06b3\u06b4\7B\2\2\u06b4\u017d\3\2\2\2\u06b5"+ + "\u06b6\5\u0182\u00ba\2\u06b6\u017f\3\2\2\2\u06b7\u06b8\5\u018a\u00be\2"+ + "\u06b8\u0181\3\2\2\2\u06b9\u06bf\7\62\2\2\u06ba\u06bc\5\u0188\u00bd\2"+ + "\u06bb\u06bd\5\u0184\u00bb\2\u06bc\u06bb\3\2\2\2\u06bc\u06bd\3\2\2\2\u06bd"+ + "\u06bf\3\2\2\2\u06be\u06b9\3\2\2\2\u06be\u06ba\3\2\2\2\u06bf\u0183\3\2"+ + "\2\2\u06c0\u06c2\5\u0186\u00bc\2\u06c1\u06c0\3\2\2\2\u06c2\u06c3\3\2\2"+ + "\2\u06c3\u06c1\3\2\2\2\u06c3\u06c4\3\2\2\2\u06c4\u0185\3\2\2\2\u06c5\u06c8"+ + "\7\62\2\2\u06c6\u06c8\5\u0188\u00bd\2\u06c7\u06c5\3\2\2\2\u06c7\u06c6"+ + "\3\2\2\2\u06c8\u0187\3\2\2\2\u06c9\u06ca\t\2\2\2\u06ca\u0189\3\2\2\2\u06cb"+ + "\u06cc\7\62\2\2\u06cc\u06cd\t\3\2\2\u06cd\u06ce\5\u0190\u00c1\2\u06ce"+ + "\u018b\3\2\2\2\u06cf\u06d0\5\u0190\u00c1\2\u06d0\u06d1\5\u0110\u0081\2"+ + "\u06d1\u06d2\5\u0190\u00c1\2\u06d2\u06d7\3\2\2\2\u06d3\u06d4\5\u0110\u0081"+ + "\2\u06d4\u06d5\5\u0190\u00c1\2\u06d5\u06d7\3\2\2\2\u06d6\u06cf\3\2\2\2"+ + "\u06d6\u06d3\3\2\2\2\u06d7\u018d\3\2\2\2\u06d8\u06d9\5\u0182\u00ba\2\u06d9"+ + "\u06da\5\u0110\u0081\2\u06da\u06db\5\u0184\u00bb\2\u06db\u06e0\3\2\2\2"+ + "\u06dc\u06dd\5\u0110\u0081\2\u06dd\u06de\5\u0184\u00bb\2\u06de\u06e0\3"+ + "\2\2\2\u06df\u06d8\3\2\2\2\u06df\u06dc\3\2\2\2\u06e0\u018f\3\2\2\2\u06e1"+ + "\u06e3\5\u0192\u00c2\2\u06e2\u06e1\3\2\2\2\u06e3\u06e4\3\2\2\2\u06e4\u06e2"+ + "\3\2\2\2\u06e4\u06e5\3\2\2\2\u06e5\u0191\3\2\2\2\u06e6\u06e7\t\4\2\2\u06e7"+ + "\u0193\3\2\2\2\u06e8\u06e9\5\u01a4\u00cb\2\u06e9\u06ea\5\u01a6\u00cc\2"+ + "\u06ea\u0195\3\2\2\2\u06eb\u06ec\5\u0182\u00ba\2\u06ec\u06ee\5\u019a\u00c6"+ + "\2\u06ed\u06ef\5\u01a2\u00ca\2\u06ee\u06ed\3\2\2\2\u06ee\u06ef\3\2\2\2"+ + "\u06ef\u06f8\3\2\2\2\u06f0\u06f2\5\u018e\u00c0\2\u06f1\u06f3\5\u019a\u00c6"+ + "\2\u06f2\u06f1\3\2\2\2\u06f2\u06f3\3\2\2\2\u06f3\u06f5\3\2\2\2\u06f4\u06f6"+ + "\5\u01a2\u00ca\2\u06f5\u06f4\3\2\2\2\u06f5\u06f6\3\2\2\2\u06f6\u06f8\3"+ + "\2\2\2\u06f7\u06eb\3\2\2\2\u06f7\u06f0\3\2\2\2\u06f8\u0197\3\2\2\2\u06f9"+ + "\u06fa\5\u0196\u00c4\2\u06fa\u06fb\5\u0110\u0081\2\u06fb\u06fc\5\u0182"+ + "\u00ba\2\u06fc\u0199\3\2\2\2\u06fd\u06fe\5\u019c\u00c7\2\u06fe\u06ff\5"+ + "\u019e\u00c8\2\u06ff\u019b\3\2\2\2\u0700\u0701\t\5\2\2\u0701\u019d\3\2"+ + "\2\2\u0702\u0704\5\u01a0\u00c9\2\u0703\u0702\3\2\2\2\u0703\u0704\3\2\2"+ + "\2\u0704\u0705\3\2\2\2\u0705\u0706\5\u0184\u00bb\2\u0706\u019f\3\2\2\2"+ + "\u0707\u0708\t\6\2\2\u0708\u01a1\3\2\2\2\u0709\u070a\t\7\2\2\u070a\u01a3"+ + "\3\2\2\2\u070b\u070c\7\62\2\2\u070c\u070d\t\3\2\2\u070d\u01a5\3\2\2\2"+ + "\u070e\u070f\5\u0190\u00c1\2\u070f\u0710\5\u01a8\u00cd\2\u0710\u0716\3"+ + "\2\2\2\u0711\u0713\5\u018c\u00bf\2\u0712\u0714\5\u01a8\u00cd\2\u0713\u0712"+ + "\3\2\2\2\u0713\u0714\3\2\2\2\u0714\u0716\3\2\2\2\u0715\u070e\3\2\2\2\u0715"+ + "\u0711\3\2\2\2\u0716\u01a7\3\2\2\2\u0717\u0718\5\u01aa\u00ce\2\u0718\u0719"+ + "\5\u019e\u00c8\2\u0719\u01a9\3\2\2\2\u071a\u071b\t\b\2\2\u071b\u01ab\3"+ + "\2\2\2\u071c\u071d\7v\2\2\u071d\u071e\7t\2\2\u071e\u071f\7w\2\2\u071f"+ + "\u0726\7g\2\2\u0720\u0721\7h\2\2\u0721\u0722\7c\2\2\u0722\u0723\7n\2\2"+ + "\u0723\u0724\7u\2\2\u0724\u0726\7g\2\2\u0725\u071c\3\2\2\2\u0725\u0720"+ + "\3\2\2\2\u0726\u01ad\3\2\2\2\u0727\u0729\7$\2\2\u0728\u072a\5\u01b0\u00d1"+ + "\2\u0729\u0728\3\2\2\2\u0729\u072a\3\2\2\2\u072a\u072b\3\2\2\2\u072b\u072c"+ + "\7$\2\2\u072c\u01af\3\2\2\2\u072d\u072f\5\u01b2\u00d2\2\u072e\u072d\3"+ + "\2\2\2\u072f\u0730\3\2\2\2\u0730\u072e\3\2\2\2\u0730\u0731\3\2\2\2\u0731"+ + "\u01b1\3\2\2\2\u0732\u0735\n\t\2\2\u0733\u0735\5\u01b4\u00d3\2\u0734\u0732"+ + "\3\2\2\2\u0734\u0733\3\2\2\2\u0735\u01b3\3\2\2\2\u0736\u0737\7^\2\2\u0737"+ + "\u073a\t\n\2\2\u0738\u073a\5\u01b6\u00d4\2\u0739\u0736\3\2\2\2\u0739\u0738"+ + "\3\2\2\2\u073a\u01b5\3\2\2\2\u073b\u073c\7^\2\2\u073c\u073d\7w\2\2\u073d"+ + "\u073e\5\u0192\u00c2\2\u073e\u073f\5\u0192\u00c2\2\u073f\u0740\5\u0192"+ + "\u00c2\2\u0740\u0741\5\u0192\u00c2\2\u0741\u01b7\3\2\2\2\u0742\u0743\7"+ + "d\2\2\u0743\u0744\7c\2\2\u0744\u0745\7u\2\2\u0745\u0746\7g\2\2\u0746\u0747"+ + "\7\63\2\2\u0747\u0748\78\2\2\u0748\u074c\3\2\2\2\u0749\u074b\5\u01e6\u00ec"+ + "\2\u074a\u0749\3\2\2\2\u074b\u074e\3\2\2\2\u074c\u074a\3\2\2\2\u074c\u074d"+ + "\3\2\2\2\u074d\u074f\3\2\2\2\u074e\u074c\3\2\2\2\u074f\u0753\5\u0158\u00a5"+ + "\2\u0750\u0752\5\u01ba\u00d6\2\u0751\u0750\3\2\2\2\u0752\u0755\3\2\2\2"+ + "\u0753\u0751\3\2\2\2\u0753\u0754\3\2\2\2\u0754\u0759\3\2\2\2\u0755\u0753"+ + "\3\2\2\2\u0756\u0758\5\u01e6\u00ec\2\u0757\u0756\3\2\2\2\u0758\u075b\3"+ + "\2\2\2\u0759\u0757\3\2\2\2\u0759\u075a\3\2\2\2\u075a\u075c\3\2\2\2\u075b"+ + "\u0759\3\2\2\2\u075c\u075d\5\u0158\u00a5\2\u075d\u01b9\3\2\2\2\u075e\u0760"+ + "\5\u01e6\u00ec\2\u075f\u075e\3\2\2\2\u0760\u0763\3\2\2\2\u0761\u075f\3"+ + "\2\2\2\u0761\u0762\3\2\2\2\u0762\u0764\3\2\2\2\u0763\u0761\3\2\2\2\u0764"+ + "\u0768\5\u0192\u00c2\2\u0765\u0767\5\u01e6\u00ec\2\u0766\u0765\3\2\2\2"+ + "\u0767\u076a\3\2\2\2\u0768\u0766\3\2\2\2\u0768\u0769\3\2\2\2\u0769\u076b"+ + "\3\2\2\2\u076a\u0768\3\2\2\2\u076b\u076c\5\u0192\u00c2\2\u076c\u01bb\3"+ + "\2\2\2\u076d\u076e\7d\2\2\u076e\u076f\7c\2\2\u076f\u0770\7u\2\2\u0770"+ + "\u0771\7g\2\2\u0771\u0772\78\2\2\u0772\u0773\7\66\2\2\u0773\u0777\3\2"+ + "\2\2\u0774\u0776\5\u01e6\u00ec\2\u0775\u0774\3\2\2\2\u0776\u0779\3\2\2"+ + "\2\u0777\u0775\3\2\2\2\u0777\u0778\3\2\2\2\u0778\u077a\3\2\2\2\u0779\u0777"+ + "\3\2\2\2\u077a\u077e\5\u0158\u00a5\2\u077b\u077d\5\u01be\u00d8\2\u077c"+ + "\u077b\3\2\2\2\u077d\u0780\3\2\2\2\u077e\u077c\3\2\2\2\u077e\u077f\3\2"+ + "\2\2\u077f\u0782\3\2\2\2\u0780\u077e\3\2\2\2\u0781\u0783\5\u01c0\u00d9"+ + "\2\u0782\u0781\3\2\2\2\u0782\u0783\3\2\2\2\u0783\u0787\3\2\2\2\u0784\u0786"+ + "\5\u01e6\u00ec\2\u0785\u0784\3\2\2\2\u0786\u0789\3\2\2\2\u0787\u0785\3"+ + "\2\2\2\u0787\u0788\3\2\2\2\u0788\u078a\3\2\2\2\u0789\u0787\3\2\2\2\u078a"+ + "\u078b\5\u0158\u00a5\2\u078b\u01bd\3\2\2\2\u078c\u078e\5\u01e6\u00ec\2"+ + "\u078d\u078c\3\2\2\2\u078e\u0791\3\2\2\2\u078f\u078d\3\2\2\2\u078f\u0790"+ + "\3\2\2\2\u0790\u0792\3\2\2\2\u0791\u078f\3\2\2\2\u0792\u0796\5\u01c2\u00da"+ + "\2\u0793\u0795\5\u01e6\u00ec\2\u0794\u0793\3\2\2\2\u0795\u0798\3\2\2\2"+ + "\u0796\u0794\3\2\2\2\u0796\u0797\3\2\2\2\u0797\u0799\3\2\2\2\u0798\u0796"+ + "\3\2\2\2\u0799\u079d\5\u01c2\u00da\2\u079a\u079c\5\u01e6\u00ec\2\u079b"+ + "\u079a\3\2\2\2\u079c\u079f\3\2\2\2\u079d\u079b\3\2\2\2\u079d\u079e\3\2"+ + "\2\2\u079e\u07a0\3\2\2\2\u079f\u079d\3\2\2\2\u07a0\u07a4\5\u01c2\u00da"+ + "\2\u07a1\u07a3\5\u01e6\u00ec\2\u07a2\u07a1\3\2\2\2\u07a3\u07a6\3\2\2\2"+ + "\u07a4\u07a2\3\2\2\2\u07a4\u07a5\3\2\2\2\u07a5\u07a7\3\2\2\2\u07a6\u07a4"+ + "\3\2\2\2\u07a7\u07a8\5\u01c2\u00da\2\u07a8\u01bf\3\2\2\2\u07a9\u07ab\5"+ + "\u01e6\u00ec\2\u07aa\u07a9\3\2\2\2\u07ab\u07ae\3\2\2\2\u07ac\u07aa\3\2"+ + "\2\2\u07ac\u07ad\3\2\2\2\u07ad\u07af\3\2\2\2\u07ae\u07ac\3\2\2\2\u07af"+ + "\u07b3\5\u01c2\u00da\2\u07b0\u07b2\5\u01e6\u00ec\2\u07b1\u07b0\3\2\2\2"+ + "\u07b2\u07b5\3\2\2\2\u07b3\u07b1\3\2\2\2\u07b3\u07b4\3\2\2\2\u07b4\u07b6"+ + "\3\2\2\2\u07b5\u07b3\3\2\2\2\u07b6\u07ba\5\u01c2\u00da\2\u07b7\u07b9\5"+ + "\u01e6\u00ec\2\u07b8\u07b7\3\2\2\2\u07b9\u07bc\3\2\2\2\u07ba\u07b8\3\2"+ + "\2\2\u07ba\u07bb\3\2\2\2\u07bb\u07bd\3\2\2\2\u07bc\u07ba\3\2\2\2\u07bd"+ + "\u07c1\5\u01c2\u00da\2\u07be\u07c0\5\u01e6\u00ec\2\u07bf\u07be\3\2\2\2"+ + "\u07c0\u07c3\3\2\2\2\u07c1\u07bf\3\2\2\2\u07c1\u07c2\3\2\2\2\u07c2\u07c4"+ + "\3\2\2\2\u07c3\u07c1\3\2\2\2\u07c4\u07c5\5\u01c4\u00db\2\u07c5\u07e4\3"+ + "\2\2\2\u07c6\u07c8\5\u01e6\u00ec\2\u07c7\u07c6\3\2\2\2\u07c8\u07cb\3\2"+ + "\2\2\u07c9\u07c7\3\2\2\2\u07c9\u07ca\3\2\2\2\u07ca\u07cc\3\2\2\2\u07cb"+ + "\u07c9\3\2\2\2\u07cc\u07d0\5\u01c2\u00da\2\u07cd\u07cf\5\u01e6\u00ec\2"+ + "\u07ce\u07cd\3\2\2\2\u07cf\u07d2\3\2\2\2\u07d0\u07ce\3\2\2\2\u07d0\u07d1"+ + "\3\2\2\2\u07d1\u07d3\3\2\2\2\u07d2\u07d0\3\2\2\2\u07d3\u07d7\5\u01c2\u00da"+ + "\2\u07d4\u07d6\5\u01e6\u00ec\2\u07d5\u07d4\3\2\2\2\u07d6\u07d9\3\2\2\2"+ + "\u07d7\u07d5\3\2\2\2\u07d7\u07d8\3\2\2\2\u07d8\u07da\3\2\2\2\u07d9\u07d7"+ + "\3\2\2\2\u07da\u07de\5\u01c4\u00db\2\u07db\u07dd\5\u01e6\u00ec\2\u07dc"+ + "\u07db\3\2\2\2\u07dd\u07e0\3\2\2\2\u07de\u07dc\3\2\2\2\u07de\u07df\3\2"+ + "\2\2\u07df\u07e1\3\2\2\2\u07e0\u07de\3\2\2\2\u07e1\u07e2\5\u01c4\u00db"+ + "\2\u07e2\u07e4\3\2\2\2\u07e3\u07ac\3\2\2\2\u07e3\u07c9\3\2\2\2\u07e4\u01c1"+ + "\3\2\2\2\u07e5\u07e6\t\13\2\2\u07e6\u01c3\3\2\2\2\u07e7\u07e8\7?\2\2\u07e8"+ + "\u01c5\3\2\2\2\u07e9\u07ea\7p\2\2\u07ea\u07eb\7w\2\2\u07eb\u07ec\7n\2"+ + "\2\u07ec\u07ed\7n\2\2\u07ed\u01c7\3\2\2\2\u07ee\u07f1\5\u01ca\u00de\2"+ + "\u07ef\u07f1\5\u01cc\u00df\2\u07f0\u07ee\3\2\2\2\u07f0\u07ef\3\2\2\2\u07f1"+ + "\u01c9\3\2\2\2\u07f2\u07f6\5\u01d0\u00e1\2\u07f3\u07f5\5\u01d2\u00e2\2"+ + "\u07f4\u07f3\3\2\2\2\u07f5\u07f8\3\2\2\2\u07f6\u07f4\3\2\2\2\u07f6\u07f7"+ + "\3\2\2\2\u07f7\u01cb\3\2\2\2\u07f8\u07f6\3\2\2\2\u07f9\u07fb\7)\2\2\u07fa"+ + "\u07fc\5\u01ce\u00e0\2\u07fb\u07fa\3\2\2\2\u07fc\u07fd\3\2\2\2\u07fd\u07fb"+ + "\3\2\2\2\u07fd\u07fe\3\2\2\2\u07fe\u01cd\3\2\2\2\u07ff\u0803\5\u01d2\u00e2"+ + "\2\u0800\u0803\5\u01d4\u00e3\2\u0801\u0803\5\u01d6\u00e4\2\u0802\u07ff"+ + "\3\2\2\2\u0802\u0800\3\2\2\2\u0802\u0801\3\2\2\2\u0803\u01cf\3\2\2\2\u0804"+ + "\u0807\t\f\2\2\u0805\u0807\n\r\2\2\u0806\u0804\3\2\2\2\u0806\u0805\3\2"+ + "\2\2\u0807\u01d1\3\2\2\2\u0808\u080b\5\u01d0\u00e1\2\u0809\u080b\5\u024e"+ + "\u0120\2\u080a\u0808\3\2\2\2\u080a\u0809\3\2\2\2\u080b\u01d3\3\2\2\2\u080c"+ + "\u080d\7^\2\2\u080d\u080e\n\16\2\2\u080e\u01d5\3\2\2\2\u080f\u0810\7^"+ + "\2\2\u0810\u0817\t\17\2\2\u0811\u0812\7^\2\2\u0812\u0813\7^\2\2\u0813"+ + "\u0814\3\2\2\2\u0814\u0817\t\20\2\2\u0815\u0817\5\u01b6\u00d4\2\u0816"+ + "\u080f\3\2\2\2\u0816\u0811\3\2\2\2\u0816\u0815\3\2\2\2\u0817\u01d7\3\2"+ + "\2\2\u0818\u081d\t\f\2\2\u0819\u081d\n\21\2\2\u081a\u081b\t\22\2\2\u081b"+ + "\u081d\t\23\2\2\u081c\u0818\3\2\2\2\u081c\u0819\3\2\2\2\u081c\u081a\3"+ + "\2\2\2\u081d\u01d9\3\2\2\2\u081e\u0823\t\24\2\2\u081f\u0823\n\21\2\2\u0820"+ + "\u0821\t\22\2\2\u0821\u0823\t\23\2\2\u0822\u081e\3\2\2\2\u0822\u081f\3"+ + "\2\2\2\u0822\u0820\3\2\2\2\u0823\u01db\3\2\2\2\u0824\u0828\5\u00a8M\2"+ + "\u0825\u0827\5\u01e6\u00ec\2\u0826\u0825\3\2\2\2\u0827\u082a\3\2\2\2\u0828"+ + "\u0826\3\2\2\2\u0828\u0829\3\2\2\2\u0829\u082b\3\2\2\2\u082a\u0828\3\2"+ + "\2\2\u082b\u082c\5\u0158\u00a5\2\u082c\u082d\b\u00e7\27\2\u082d\u082e"+ + "\3\2\2\2\u082e\u082f\b\u00e7\30\2\u082f\u01dd\3\2\2\2\u0830\u0834\5\u00a0"+ + "I\2\u0831\u0833\5\u01e6\u00ec\2\u0832\u0831\3\2\2\2\u0833\u0836\3\2\2"+ + "\2\u0834\u0832\3\2\2\2\u0834\u0835\3\2\2\2\u0835\u0837\3\2\2\2\u0836\u0834"+ + "\3\2\2\2\u0837\u0838\5\u0158\u00a5\2\u0838\u0839\b\u00e8\31\2\u0839\u083a"+ + "\3\2\2\2\u083a\u083b\b\u00e8\32\2\u083b\u01df\3\2\2\2\u083c\u083e\5\u0128"+ + "\u008d\2\u083d\u083f\5\u0200\u00f9\2\u083e\u083d\3\2\2\2\u083e\u083f\3"+ + "\2\2\2\u083f\u0840\3\2\2\2\u0840\u0841\b\u00e9\33\2\u0841\u01e1\3\2\2"+ + "\2\u0842\u0844\5\u0128\u008d\2\u0843\u0845\5\u0200\u00f9\2\u0844\u0843"+ + "\3\2\2\2\u0844\u0845\3\2\2\2\u0845\u0846\3\2\2\2\u0846\u084a\5\u012c\u008f"+ + "\2\u0847\u0849\5\u0200\u00f9\2\u0848\u0847\3\2\2\2\u0849\u084c\3\2\2\2"+ + "\u084a\u0848\3\2\2\2\u084a\u084b\3\2\2\2\u084b\u084d\3\2\2\2\u084c\u084a"+ + "\3\2\2\2\u084d\u084e\b\u00ea\34\2\u084e\u01e3\3\2\2\2\u084f\u0851\5\u0128"+ + "\u008d\2\u0850\u0852\5\u0200\u00f9\2\u0851\u0850\3\2\2\2\u0851\u0852\3"+ + "\2\2\2\u0852\u0853\3\2\2\2\u0853\u0857\5\u012c\u008f\2\u0854\u0856\5\u0200"+ + "\u00f9\2\u0855\u0854\3\2\2\2\u0856\u0859\3\2\2\2\u0857\u0855\3\2\2\2\u0857"+ + "\u0858\3\2\2\2\u0858\u085a\3\2\2\2\u0859\u0857\3\2\2\2\u085a\u085e\5\u00e2"+ + "j\2\u085b\u085d\5\u0200\u00f9\2\u085c\u085b\3\2\2\2\u085d\u0860\3\2\2"+ + "\2\u085e\u085c\3\2\2\2\u085e\u085f\3\2\2\2\u085f\u0861\3\2\2\2\u0860\u085e"+ + "\3\2\2\2\u0861\u0865\5\u012e\u0090\2\u0862\u0864\5\u0200\u00f9\2\u0863"+ + "\u0862\3\2\2\2\u0864\u0867\3\2\2\2\u0865\u0863\3\2\2\2\u0865\u0866\3\2"+ + "\2\2\u0866\u0868\3\2\2\2\u0867\u0865\3\2\2\2\u0868\u0869\b\u00eb\33\2"+ + "\u0869\u01e5\3\2\2\2\u086a\u086c\t\25\2\2\u086b\u086a\3\2\2\2\u086c\u086d"+ + "\3\2\2\2\u086d\u086b\3\2\2\2\u086d\u086e\3\2\2\2\u086e\u086f\3\2\2\2\u086f"+ + "\u0870\b\u00ec\35\2\u0870\u01e7\3\2\2\2\u0871\u0873\t\26\2\2\u0872\u0871"+ + "\3\2\2\2\u0873\u0874\3\2\2\2\u0874\u0872\3\2\2\2\u0874\u0875\3\2\2\2\u0875"+ + "\u0876\3\2\2\2\u0876\u0877\b\u00ed\35\2\u0877\u01e9\3\2\2\2\u0878\u0879"+ + "\7\61\2\2\u0879\u087a\7\61\2\2\u087a\u087e\3\2\2\2\u087b\u087d\n\27\2"+ + "\2\u087c\u087b\3\2\2\2\u087d\u0880\3\2\2\2\u087e\u087c\3\2\2\2\u087e\u087f"+ + "\3\2\2\2\u087f\u0881\3\2\2\2\u0880\u087e\3\2\2\2\u0881\u0882\b\u00ee\35"+ + "\2\u0882\u01eb\3\2\2\2\u0883\u0884\7x\2\2\u0884\u0885\7c\2\2\u0885\u0886"+ + "\7t\2\2\u0886\u0887\7k\2\2\u0887\u0888\7c\2\2\u0888\u0889\7d\2\2\u0889"+ + "\u088a\7n\2\2\u088a\u088b\7g\2\2\u088b\u01ed\3\2\2\2\u088c\u088d\7o\2"+ + "\2\u088d\u088e\7q\2\2\u088e\u088f\7f\2\2\u088f\u0890\7w\2\2\u0890\u0891"+ + "\7n\2\2\u0891\u0892\7g\2\2\u0892\u01ef\3\2\2\2\u0893\u089c\5\u00b2R\2"+ + "\u0894\u089c\5\36\b\2\u0895\u089c\5\u01ec\u00ef\2\u0896\u089c\5\u00ba"+ + "V\2\u0897\u089c\5(\r\2\u0898\u089c\5\u01ee\u00f0\2\u0899\u089c\5\"\n\2"+ + "\u089a\u089c\5*\16\2\u089b\u0893\3\2\2\2\u089b\u0894\3\2\2\2\u089b\u0895"+ + "\3\2\2\2\u089b\u0896\3\2\2\2\u089b\u0897\3\2\2\2\u089b\u0898\3\2\2\2\u089b"+ + "\u0899\3\2\2\2\u089b\u089a\3\2\2\2\u089c\u01f1\3\2\2\2\u089d\u08a0\5\u01fc"+ + "\u00f7\2\u089e\u08a0\5\u01fe\u00f8\2\u089f\u089d\3\2\2\2\u089f\u089e\3"+ + "\2\2\2\u08a0\u08a1\3\2\2\2\u08a1\u089f\3\2\2\2\u08a1\u08a2\3\2\2\2\u08a2"+ + "\u01f3\3\2\2\2\u08a3\u08a4\5\u0158\u00a5\2\u08a4\u08a5\3\2\2\2\u08a5\u08a6"+ + "\b\u00f3\36\2\u08a6\u01f5\3\2\2\2\u08a7\u08a8\5\u0158\u00a5\2\u08a8\u08a9"+ + "\5\u0158\u00a5\2\u08a9\u08aa\3\2\2\2\u08aa\u08ab\b\u00f4\37\2\u08ab\u01f7"+ + "\3\2\2\2\u08ac\u08ad\5\u0158\u00a5\2\u08ad\u08ae\5\u0158\u00a5\2\u08ae"+ + "\u08af\5\u0158\u00a5\2\u08af\u08b0\3\2\2\2\u08b0\u08b1\b\u00f5 \2\u08b1"+ + "\u01f9\3\2\2\2\u08b2\u08b4\5\u01f0\u00f1\2\u08b3\u08b5\5\u0200\u00f9\2"+ + "\u08b4\u08b3\3\2\2\2\u08b5\u08b6\3\2\2\2\u08b6\u08b4\3\2\2\2\u08b6\u08b7"+ + "\3\2\2\2\u08b7\u01fb\3\2\2\2\u08b8\u08bc\n\30\2\2\u08b9\u08ba\7^\2\2\u08ba"+ + "\u08bc\5\u0158\u00a5\2\u08bb\u08b8\3\2\2\2\u08bb\u08b9\3\2\2\2\u08bc\u01fd"+ + "\3\2\2\2\u08bd\u08be\5\u0200\u00f9\2\u08be\u01ff\3\2\2\2\u08bf\u08c0\t"+ + "\31\2\2\u08c0\u0201\3\2\2\2\u08c1\u08c2\t\32\2\2\u08c2\u08c3\3\2\2\2\u08c3"+ + "\u08c4\b\u00fa\35\2\u08c4\u08c5\b\u00fa!\2\u08c5\u0203\3\2\2\2\u08c6\u08c7"+ + "\5\u01c8\u00dd\2\u08c7\u0205\3\2\2\2\u08c8\u08ca\5\u0200\u00f9\2\u08c9"+ + "\u08c8\3\2\2\2\u08ca\u08cd\3\2\2\2\u08cb\u08c9\3\2\2\2\u08cb\u08cc\3\2"+ + "\2\2\u08cc\u08ce\3\2\2\2\u08cd\u08cb\3\2\2\2\u08ce\u08d2\5\u012e\u0090"+ + "\2\u08cf\u08d1\5\u0200\u00f9\2\u08d0\u08cf\3\2\2\2\u08d1\u08d4\3\2\2\2"+ + "\u08d2\u08d0\3\2\2\2\u08d2\u08d3\3\2\2\2\u08d3\u08d5\3\2\2\2\u08d4\u08d2"+ + "\3\2\2\2\u08d5\u08d6\b\u00fc!\2\u08d6\u08d7\b\u00fc\33\2\u08d7\u0207\3"+ + "\2\2\2\u08d8\u08d9\t\32\2\2\u08d9\u08da\3\2\2\2\u08da\u08db\b\u00fd\35"+ + "\2\u08db\u08dc\b\u00fd!\2\u08dc\u0209\3\2\2\2\u08dd\u08e1\n\33\2\2\u08de"+ + "\u08df\7^\2\2\u08df\u08e1\5\u0158\u00a5\2\u08e0\u08dd\3\2\2\2\u08e0\u08de"+ + "\3\2\2\2\u08e1\u08e4\3\2\2\2\u08e2\u08e0\3\2\2\2\u08e2\u08e3\3\2\2\2\u08e3"+ + "\u08e5\3\2\2\2\u08e4\u08e2\3\2\2\2\u08e5\u08e7\t\32\2\2\u08e6\u08e2\3"+ + "\2\2\2\u08e6\u08e7\3\2\2\2\u08e7\u08f4\3\2\2\2\u08e8\u08ee\5\u01e0\u00e9"+ + "\2\u08e9\u08ed\n\33\2\2\u08ea\u08eb\7^\2\2\u08eb\u08ed\5\u0158\u00a5\2"+ + "\u08ec\u08e9\3\2\2\2\u08ec\u08ea\3\2\2\2\u08ed\u08f0\3\2\2\2\u08ee\u08ec"+ + "\3\2\2\2\u08ee\u08ef\3\2\2\2\u08ef\u08f2\3\2\2\2\u08f0\u08ee\3\2\2\2\u08f1"+ + "\u08f3\t\32\2\2\u08f2\u08f1\3\2\2\2\u08f2\u08f3\3\2\2\2\u08f3\u08f5\3"+ + "\2\2\2\u08f4\u08e8\3\2\2\2\u08f5\u08f6\3\2\2\2\u08f6\u08f4\3\2\2\2\u08f6"+ + "\u08f7\3\2\2\2\u08f7\u0900\3\2\2\2\u08f8\u08fc\n\33\2\2\u08f9\u08fa\7"+ + "^\2\2\u08fa\u08fc\5\u0158\u00a5\2\u08fb\u08f8\3\2\2\2\u08fb\u08f9\3\2"+ + "\2\2\u08fc\u08fd\3\2\2\2\u08fd\u08fb\3\2\2\2\u08fd\u08fe\3\2\2\2\u08fe"+ + "\u0900\3\2\2\2\u08ff\u08e6\3\2\2\2\u08ff\u08fb\3\2\2\2\u0900\u020b\3\2"+ + "\2\2\u0901\u0902\5\u0158\u00a5\2\u0902\u0903\3\2\2\2\u0903\u0904\b\u00ff"+ + "!\2\u0904\u020d\3\2\2\2\u0905\u090a\n\33\2\2\u0906\u0907\5\u0158\u00a5"+ + "\2\u0907\u0908\n\34\2\2\u0908\u090a\3\2\2\2\u0909\u0905\3\2\2\2\u0909"+ + "\u0906\3\2\2\2\u090a\u090d\3\2\2\2\u090b\u0909\3\2\2\2\u090b\u090c\3\2"+ + "\2\2\u090c\u090e\3\2\2\2\u090d\u090b\3\2\2\2\u090e\u0910\t\32\2\2\u090f"+ + "\u090b\3\2\2\2\u090f\u0910\3\2\2\2\u0910\u091e\3\2\2\2\u0911\u0918\5\u01e0"+ + "\u00e9\2\u0912\u0917\n\33\2\2\u0913\u0914\5\u0158\u00a5\2\u0914\u0915"+ + "\n\34\2\2\u0915\u0917\3\2\2\2\u0916\u0912\3\2\2\2\u0916\u0913\3\2\2\2"+ + "\u0917\u091a\3\2\2\2\u0918\u0916\3\2\2\2\u0918\u0919\3\2\2\2\u0919\u091c"+ + "\3\2\2\2\u091a\u0918\3\2\2\2\u091b\u091d\t\32\2\2\u091c\u091b\3\2\2\2"+ + "\u091c\u091d\3\2\2\2\u091d\u091f\3\2\2\2\u091e\u0911\3\2\2\2\u091f\u0920"+ + "\3\2\2\2\u0920\u091e\3\2\2\2\u0920\u0921\3\2\2\2\u0921\u092b\3\2\2\2\u0922"+ + "\u0927\n\33\2\2\u0923\u0924\5\u0158\u00a5\2\u0924\u0925\n\34\2\2\u0925"+ + "\u0927\3\2\2\2\u0926\u0922\3\2\2\2\u0926\u0923\3\2\2\2\u0927\u0928\3\2"+ + "\2\2\u0928\u0926\3\2\2\2\u0928\u0929\3\2\2\2\u0929\u092b\3\2\2\2\u092a"+ + "\u090f\3\2\2\2\u092a\u0926\3\2\2\2\u092b\u020f\3\2\2\2\u092c\u092d\5\u0158"+ + "\u00a5\2\u092d\u092e\5\u0158\u00a5\2\u092e\u092f\3\2\2\2\u092f\u0930\b"+ + "\u0101!\2\u0930\u0211\3\2\2\2\u0931\u093a\n\33\2\2\u0932\u0933\5\u0158"+ + "\u00a5\2\u0933\u0934\n\34\2\2\u0934\u093a\3\2\2\2\u0935\u0936\5\u0158"+ + "\u00a5\2\u0936\u0937\5\u0158\u00a5\2\u0937\u0938\n\34\2\2\u0938\u093a"+ + "\3\2\2\2\u0939\u0931\3\2\2\2\u0939\u0932\3\2\2\2\u0939\u0935\3\2\2\2\u093a"+ + "\u093d\3\2\2\2\u093b\u0939\3\2\2\2\u093b\u093c\3\2\2\2\u093c\u093e\3\2"+ + "\2\2\u093d\u093b\3\2\2\2\u093e\u0940\t\32\2\2\u093f\u093b\3\2\2\2\u093f"+ + "\u0940\3\2\2\2\u0940\u0952\3\2\2\2\u0941\u094c\5\u01e0\u00e9\2\u0942\u094b"+ + "\n\33\2\2\u0943\u0944\5\u0158\u00a5\2\u0944\u0945\n\34\2\2\u0945\u094b"+ + "\3\2\2\2\u0946\u0947\5\u0158\u00a5\2\u0947\u0948\5\u0158\u00a5\2\u0948"+ + "\u0949\n\34\2\2\u0949\u094b\3\2\2\2\u094a\u0942\3\2\2\2\u094a\u0943\3"+ + "\2\2\2\u094a\u0946\3\2\2\2\u094b\u094e\3\2\2\2\u094c\u094a\3\2\2\2\u094c"+ + "\u094d\3\2\2\2\u094d\u0950\3\2\2\2\u094e\u094c\3\2\2\2"; private static final String _serializedATNSegment1 = - "\u0950\u0959\n\33\2\2\u0951\u0952\5\u0158\u00a5\2\u0952\u0953\n\34\2\2"+ - "\u0953\u0959\3\2\2\2\u0954\u0955\5\u0158\u00a5\2\u0955\u0956\5\u0158\u00a5"+ - "\2\u0956\u0957\n\34\2\2\u0957\u0959\3\2\2\2\u0958\u0950\3\2\2\2\u0958"+ - "\u0951\3\2\2\2\u0958\u0954\3\2\2\2\u0959\u095a\3\2\2\2\u095a\u0958\3\2"+ - "\2\2\u095a\u095b\3\2\2\2\u095b\u095d\3\2\2\2\u095c\u0939\3\2\2\2\u095c"+ - "\u0958\3\2\2\2\u095d\u0211\3\2\2\2\u095e\u095f\5\u0158\u00a5\2\u095f\u0960"+ - "\5\u0158\u00a5\2\u0960\u0961\5\u0158\u00a5\2\u0961\u0962\3\2\2\2\u0962"+ - "\u0963\b\u0102!\2\u0963\u0213\3\2\2\2\u0964\u0965\7>\2\2\u0965\u0966\7"+ - "#\2\2\u0966\u0967\7/\2\2\u0967\u0968\7/\2\2\u0968\u0969\3\2\2\2\u0969"+ - "\u096a\b\u0103\"\2\u096a\u0215\3\2\2\2\u096b\u096c\7>\2\2\u096c\u096d"+ - "\7#\2\2\u096d\u096e\7]\2\2\u096e\u096f\7E\2\2\u096f\u0970\7F\2\2\u0970"+ - "\u0971\7C\2\2\u0971\u0972\7V\2\2\u0972\u0973\7C\2\2\u0973\u0974\7]\2\2"+ - "\u0974\u0978\3\2\2\2\u0975\u0977\13\2\2\2\u0976\u0975\3\2\2\2\u0977\u097a"+ - "\3\2\2\2\u0978\u0979\3\2\2\2\u0978\u0976\3\2\2\2\u0979\u097b\3\2\2\2\u097a"+ - "\u0978\3\2\2\2\u097b\u097c\7_\2\2\u097c\u097d\7_\2\2\u097d\u097e\7@\2"+ - "\2\u097e\u0217\3\2\2\2\u097f\u0980\7>\2\2\u0980\u0981\7#\2\2\u0981\u0986"+ - "\3\2\2\2\u0982\u0983\n\35\2\2\u0983\u0987\13\2\2\2\u0984\u0985\13\2\2"+ - "\2\u0985\u0987\n\35\2\2\u0986\u0982\3\2\2\2\u0986\u0984\3\2\2\2\u0987"+ - "\u098b\3\2\2\2\u0988\u098a\13\2\2\2\u0989\u0988\3\2\2\2\u098a\u098d\3"+ - "\2\2\2\u098b\u098c\3\2\2\2\u098b\u0989\3\2\2\2\u098c\u098e\3\2\2\2\u098d"+ - "\u098b\3\2\2\2\u098e\u098f\7@\2\2\u098f\u0990\3\2\2\2\u0990\u0991\b\u0105"+ - "#\2\u0991\u0219\3\2\2\2\u0992\u0993\7(\2\2\u0993\u0994\5\u0246\u011c\2"+ - "\u0994\u0995\7=\2\2\u0995\u021b\3\2\2\2\u0996\u0997\7(\2\2\u0997\u0998"+ - "\7%\2\2\u0998\u099a\3\2\2\2\u0999\u099b\5\u0186\u00bc\2\u099a\u0999\3"+ - "\2\2\2\u099b\u099c\3\2\2\2\u099c\u099a\3\2\2\2\u099c\u099d\3\2\2\2\u099d"+ - "\u099e\3\2\2\2\u099e\u099f\7=\2\2\u099f\u09ac\3\2\2\2\u09a0\u09a1\7(\2"+ - "\2\u09a1\u09a2\7%\2\2\u09a2\u09a3\7z\2\2\u09a3\u09a5\3\2\2\2\u09a4\u09a6"+ - "\5\u0190\u00c1\2\u09a5\u09a4\3\2\2\2\u09a6\u09a7\3\2\2\2\u09a7\u09a5\3"+ - "\2\2\2\u09a7\u09a8\3\2\2\2\u09a8\u09a9\3\2\2\2\u09a9\u09aa\7=\2\2\u09aa"+ - "\u09ac\3\2\2\2\u09ab\u0996\3\2\2\2\u09ab\u09a0\3\2\2\2\u09ac\u021d\3\2"+ - "\2\2\u09ad\u09b3\t\25\2\2\u09ae\u09b0\7\17\2\2\u09af\u09ae\3\2\2\2\u09af"+ - "\u09b0\3\2\2\2\u09b0\u09b1\3\2\2\2\u09b1\u09b3\7\f\2\2\u09b2\u09ad\3\2"+ - "\2\2\u09b2\u09af\3\2\2\2\u09b3\u021f\3\2\2\2\u09b4\u09b5\5\u013e\u0098"+ - "\2\u09b5\u09b6\3\2\2\2\u09b6\u09b7\b\u0109$\2\u09b7\u0221\3\2\2\2\u09b8"+ - "\u09b9\7>\2\2\u09b9\u09ba\7\61\2\2\u09ba\u09bb\3\2\2\2\u09bb\u09bc\b\u010a"+ - "$\2\u09bc\u0223\3\2\2\2\u09bd\u09be\7>\2\2\u09be\u09bf\7A\2\2\u09bf\u09c3"+ - "\3\2\2\2\u09c0\u09c1\5\u0246\u011c\2\u09c1\u09c2\5\u023e\u0118\2\u09c2"+ - "\u09c4\3\2\2\2\u09c3\u09c0\3\2\2\2\u09c3\u09c4\3\2\2\2\u09c4\u09c5\3\2"+ - "\2\2\u09c5\u09c6\5\u0246\u011c\2\u09c6\u09c7\5\u021e\u0108\2\u09c7\u09c8"+ - "\3\2\2\2\u09c8\u09c9\b\u010b%\2\u09c9\u0225\3\2\2\2\u09ca\u09cb\7b\2\2"+ - "\u09cb\u09cc\b\u010c&\2\u09cc\u09cd\3\2\2\2\u09cd\u09ce\b\u010c!\2\u09ce"+ - "\u0227\3\2\2\2\u09cf\u09d0\7&\2\2\u09d0\u09d1\7}\2\2\u09d1\u0229\3\2\2"+ - "\2\u09d2\u09d4\5\u022c\u010f\2\u09d3\u09d2\3\2\2\2\u09d3\u09d4\3\2\2\2"+ - "\u09d4\u09d5\3\2\2\2\u09d5\u09d6\5\u0228\u010d\2\u09d6\u09d7\3\2\2\2\u09d7"+ - "\u09d8\b\u010e\'\2\u09d8\u022b\3\2\2\2\u09d9\u09db\5\u022e\u0110\2\u09da"+ - "\u09d9\3\2\2\2\u09db\u09dc\3\2\2\2\u09dc\u09da\3\2\2\2\u09dc\u09dd\3\2"+ - "\2\2\u09dd\u022d\3\2\2\2\u09de\u09e6\n\36\2\2\u09df\u09e0\7^\2\2\u09e0"+ - "\u09e6\t\34\2\2\u09e1\u09e6\5\u021e\u0108\2\u09e2\u09e6\5\u0232\u0112"+ - "\2\u09e3\u09e6\5\u0230\u0111\2\u09e4\u09e6\5\u0234\u0113\2\u09e5\u09de"+ - "\3\2\2\2\u09e5\u09df\3\2\2\2\u09e5\u09e1\3\2\2\2\u09e5\u09e2\3\2\2\2\u09e5"+ - "\u09e3\3\2\2\2\u09e5\u09e4\3\2\2\2\u09e6\u022f\3\2\2\2\u09e7\u09e9\7&"+ - "\2\2\u09e8\u09e7\3\2\2\2\u09e9\u09ea\3\2\2\2\u09ea\u09e8\3\2\2\2\u09ea"+ - "\u09eb\3\2\2\2\u09eb\u09ec\3\2\2\2\u09ec\u09ed\5\u027a\u0136\2\u09ed\u0231"+ - "\3\2\2\2\u09ee\u09ef\7^\2\2\u09ef\u0a03\7^\2\2\u09f0\u09f1\7^\2\2\u09f1"+ - "\u09f2\7&\2\2\u09f2\u0a03\7}\2\2\u09f3\u09f4\7^\2\2\u09f4\u0a03\7\177"+ - "\2\2\u09f5\u09f6\7^\2\2\u09f6\u0a03\7}\2\2\u09f7\u09ff\7(\2\2\u09f8\u09f9"+ - "\7i\2\2\u09f9\u0a00\7v\2\2\u09fa\u09fb\7n\2\2\u09fb\u0a00\7v\2\2\u09fc"+ - "\u09fd\7c\2\2\u09fd\u09fe\7o\2\2\u09fe\u0a00\7r\2\2\u09ff\u09f8\3\2\2"+ - "\2\u09ff\u09fa\3\2\2\2\u09ff\u09fc\3\2\2\2\u0a00\u0a01\3\2\2\2\u0a01\u0a03"+ - "\7=\2\2\u0a02\u09ee\3\2\2\2\u0a02\u09f0\3\2\2\2\u0a02\u09f3\3\2\2\2\u0a02"+ - "\u09f5\3\2\2\2\u0a02\u09f7\3\2\2\2\u0a03\u0233\3\2\2\2\u0a04\u0a05\7}"+ - "\2\2\u0a05\u0a07\7\177\2\2\u0a06\u0a04\3\2\2\2\u0a07\u0a08\3\2\2\2\u0a08"+ - "\u0a06\3\2\2\2\u0a08\u0a09\3\2\2\2\u0a09\u0a0d\3\2\2\2\u0a0a\u0a0c\7}"+ - "\2\2\u0a0b\u0a0a\3\2\2\2\u0a0c\u0a0f\3\2\2\2\u0a0d\u0a0b\3\2\2\2\u0a0d"+ - "\u0a0e\3\2\2\2\u0a0e\u0a13\3\2\2\2\u0a0f\u0a0d\3\2\2\2\u0a10\u0a12\7\177"+ - "\2\2\u0a11\u0a10\3\2\2\2\u0a12\u0a15\3\2\2\2\u0a13\u0a11\3\2\2\2\u0a13"+ - "\u0a14\3\2\2\2\u0a14\u0a5d\3\2\2\2\u0a15\u0a13\3\2\2\2\u0a16\u0a17\7\177"+ - "\2\2\u0a17\u0a19\7}\2\2\u0a18\u0a16\3\2\2\2\u0a19\u0a1a\3\2\2\2\u0a1a"+ - "\u0a18\3\2\2\2\u0a1a\u0a1b\3\2\2\2\u0a1b\u0a1f\3\2\2\2\u0a1c\u0a1e\7}"+ - "\2\2\u0a1d\u0a1c\3\2\2\2\u0a1e\u0a21\3\2\2\2\u0a1f\u0a1d\3\2\2\2\u0a1f"+ - "\u0a20\3\2\2\2\u0a20\u0a25\3\2\2\2\u0a21\u0a1f\3\2\2\2\u0a22\u0a24\7\177"+ - "\2\2\u0a23\u0a22\3\2\2\2\u0a24\u0a27\3\2\2\2\u0a25\u0a23\3\2\2\2\u0a25"+ - "\u0a26\3\2\2\2\u0a26\u0a5d\3\2\2\2\u0a27\u0a25\3\2\2\2\u0a28\u0a29\7}"+ - "\2\2\u0a29\u0a2b\7}\2\2\u0a2a\u0a28\3\2\2\2\u0a2b\u0a2c\3\2\2\2\u0a2c"+ - "\u0a2a\3\2\2\2\u0a2c\u0a2d\3\2\2\2\u0a2d\u0a31\3\2\2\2\u0a2e\u0a30\7}"+ - "\2\2\u0a2f\u0a2e\3\2\2\2\u0a30\u0a33\3\2\2\2\u0a31\u0a2f\3\2\2\2\u0a31"+ - "\u0a32\3\2\2\2\u0a32\u0a37\3\2\2\2\u0a33\u0a31\3\2\2\2\u0a34\u0a36\7\177"+ - "\2\2\u0a35\u0a34\3\2\2\2\u0a36\u0a39\3\2\2\2\u0a37\u0a35\3\2\2\2\u0a37"+ - "\u0a38\3\2\2\2\u0a38\u0a5d\3\2\2\2\u0a39\u0a37\3\2\2\2\u0a3a\u0a3b\7\177"+ - "\2\2\u0a3b\u0a3d\7\177\2\2\u0a3c\u0a3a\3\2\2\2\u0a3d\u0a3e\3\2\2\2\u0a3e"+ - "\u0a3c\3\2\2\2\u0a3e\u0a3f\3\2\2\2\u0a3f\u0a43\3\2\2\2\u0a40\u0a42\7}"+ - "\2\2\u0a41\u0a40\3\2\2\2\u0a42\u0a45\3\2\2\2\u0a43\u0a41\3\2\2\2\u0a43"+ - "\u0a44\3\2\2\2\u0a44\u0a49\3\2\2\2\u0a45\u0a43\3\2\2\2\u0a46\u0a48\7\177"+ - "\2\2\u0a47\u0a46\3\2\2\2\u0a48\u0a4b\3\2\2\2\u0a49\u0a47\3\2\2\2\u0a49"+ - "\u0a4a\3\2\2\2\u0a4a\u0a5d\3\2\2\2\u0a4b\u0a49\3\2\2\2\u0a4c\u0a4d\7}"+ - "\2\2\u0a4d\u0a4f\7\177\2\2\u0a4e\u0a4c\3\2\2\2\u0a4f\u0a52\3\2\2\2\u0a50"+ - "\u0a4e\3\2\2\2\u0a50\u0a51\3\2\2\2\u0a51\u0a53\3\2\2\2\u0a52\u0a50\3\2"+ - "\2\2\u0a53\u0a5d\7}\2\2\u0a54\u0a59\7\177\2\2\u0a55\u0a56\7}\2\2\u0a56"+ - "\u0a58\7\177\2\2\u0a57\u0a55\3\2\2\2\u0a58\u0a5b\3\2\2\2\u0a59\u0a57\3"+ - "\2\2\2\u0a59\u0a5a\3\2\2\2\u0a5a\u0a5d\3\2\2\2\u0a5b\u0a59\3\2\2\2\u0a5c"+ - "\u0a06\3\2\2\2\u0a5c\u0a18\3\2\2\2\u0a5c\u0a2a\3\2\2\2\u0a5c\u0a3c\3\2"+ - "\2\2\u0a5c\u0a50\3\2\2\2\u0a5c\u0a54\3\2\2\2\u0a5d\u0235\3\2\2\2\u0a5e"+ - "\u0a5f\5\u013c\u0097\2\u0a5f\u0a60\3\2\2\2\u0a60\u0a61\b\u0114!\2\u0a61"+ - "\u0237\3\2\2\2\u0a62\u0a63\7A\2\2\u0a63\u0a64\7@\2\2\u0a64\u0a65\3\2\2"+ - "\2\u0a65\u0a66\b\u0115!\2\u0a66\u0239\3\2\2\2\u0a67\u0a68\7\61\2\2\u0a68"+ - "\u0a69\7@\2\2\u0a69\u0a6a\3\2\2\2\u0a6a\u0a6b\b\u0116!\2\u0a6b\u023b\3"+ - "\2\2\2\u0a6c\u0a6d\5\u0132\u0092\2\u0a6d\u023d\3\2\2\2\u0a6e\u0a6f\5\u010e"+ - "\u0080\2\u0a6f\u023f\3\2\2\2\u0a70\u0a71\5\u012a\u008e\2\u0a71\u0241\3"+ - "\2\2\2\u0a72\u0a73\7$\2\2\u0a73\u0a74\3\2\2\2\u0a74\u0a75\b\u011a(\2\u0a75"+ - "\u0243\3\2\2\2\u0a76\u0a77\7)\2\2\u0a77\u0a78\3\2\2\2\u0a78\u0a79\b\u011b"+ - ")\2\u0a79\u0245\3\2\2\2\u0a7a\u0a7e\5\u0250\u0121\2\u0a7b\u0a7d\5\u024e"+ - "\u0120\2\u0a7c\u0a7b\3\2\2\2\u0a7d\u0a80\3\2\2\2\u0a7e\u0a7c\3\2\2\2\u0a7e"+ - "\u0a7f\3\2\2\2\u0a7f\u0247\3\2\2\2\u0a80\u0a7e\3\2\2\2\u0a81\u0a82\t\37"+ - "\2\2\u0a82\u0a83\3\2\2\2\u0a83\u0a84\b\u011d\35\2\u0a84\u0249\3\2\2\2"+ - "\u0a85\u0a86\t\4\2\2\u0a86\u024b\3\2\2\2\u0a87\u0a88\t \2\2\u0a88\u024d"+ - "\3\2\2\2\u0a89\u0a8e\5\u0250\u0121\2\u0a8a\u0a8e\4/\60\2\u0a8b\u0a8e\5"+ - "\u024c\u011f\2\u0a8c\u0a8e\t!\2\2\u0a8d\u0a89\3\2\2\2\u0a8d\u0a8a\3\2"+ - "\2\2\u0a8d\u0a8b\3\2\2\2\u0a8d\u0a8c\3\2\2\2\u0a8e\u024f\3\2\2\2\u0a8f"+ - "\u0a91\t\"\2\2\u0a90\u0a8f\3\2\2\2\u0a91\u0251\3\2\2\2\u0a92\u0a93\5\u0242"+ - "\u011a\2\u0a93\u0a94\3\2\2\2\u0a94\u0a95\b\u0122!\2\u0a95\u0253\3\2\2"+ - "\2\u0a96\u0a98\5\u0256\u0124\2\u0a97\u0a96\3\2\2\2\u0a97\u0a98\3\2\2\2"+ - "\u0a98\u0a99\3\2\2\2\u0a99\u0a9a\5\u0228\u010d\2\u0a9a\u0a9b\3\2\2\2\u0a9b"+ - "\u0a9c\b\u0123\'\2\u0a9c\u0255\3\2\2\2\u0a9d\u0a9f\5\u0234\u0113\2\u0a9e"+ - "\u0a9d\3\2\2\2\u0a9e\u0a9f\3\2\2\2\u0a9f\u0aa4\3\2\2\2\u0aa0\u0aa2\5\u0258"+ - "\u0125\2\u0aa1\u0aa3\5\u0234\u0113\2\u0aa2\u0aa1\3\2\2\2\u0aa2\u0aa3\3"+ - "\2\2\2\u0aa3\u0aa5\3\2\2\2\u0aa4\u0aa0\3\2\2\2\u0aa5\u0aa6\3\2\2\2\u0aa6"+ - "\u0aa4\3\2\2\2\u0aa6\u0aa7\3\2\2\2\u0aa7\u0ab3\3\2\2\2\u0aa8\u0aaf\5\u0234"+ - "\u0113\2\u0aa9\u0aab\5\u0258\u0125\2\u0aaa\u0aac\5\u0234\u0113\2\u0aab"+ - "\u0aaa\3\2\2\2\u0aab\u0aac\3\2\2\2\u0aac\u0aae\3\2\2\2\u0aad\u0aa9\3\2"+ - "\2\2\u0aae\u0ab1\3\2\2\2\u0aaf\u0aad\3\2\2\2\u0aaf\u0ab0\3\2\2\2\u0ab0"+ - "\u0ab3\3\2\2\2\u0ab1\u0aaf\3\2\2\2\u0ab2\u0a9e\3\2\2\2\u0ab2\u0aa8\3\2"+ - "\2\2\u0ab3\u0257\3\2\2\2\u0ab4\u0ab8\n#\2\2\u0ab5\u0ab8\5\u0232\u0112"+ - "\2\u0ab6\u0ab8\5\u0230\u0111\2\u0ab7\u0ab4\3\2\2\2\u0ab7\u0ab5\3\2\2\2"+ - "\u0ab7\u0ab6\3\2\2\2\u0ab8\u0259\3\2\2\2\u0ab9\u0aba\5\u0244\u011b\2\u0aba"+ - "\u0abb\3\2\2\2\u0abb\u0abc\b\u0126!\2\u0abc\u025b\3\2\2\2\u0abd\u0abf"+ - "\5\u025e\u0128\2\u0abe\u0abd\3\2\2\2\u0abe\u0abf\3\2\2\2\u0abf\u0ac0\3"+ - "\2\2\2\u0ac0\u0ac1\5\u0228\u010d\2\u0ac1\u0ac2\3\2\2\2\u0ac2\u0ac3\b\u0127"+ - "\'\2\u0ac3\u025d\3\2\2\2\u0ac4\u0ac6\5\u0234\u0113\2\u0ac5\u0ac4\3\2\2"+ - "\2\u0ac5\u0ac6\3\2\2\2\u0ac6\u0acb\3\2\2\2\u0ac7\u0ac9\5\u0260\u0129\2"+ - "\u0ac8\u0aca\5\u0234\u0113\2\u0ac9\u0ac8\3\2\2\2\u0ac9\u0aca\3\2\2\2\u0aca"+ - "\u0acc\3\2\2\2\u0acb\u0ac7\3\2\2\2\u0acc\u0acd\3\2\2\2\u0acd\u0acb\3\2"+ - "\2\2\u0acd\u0ace\3\2\2\2\u0ace\u0ada\3\2\2\2\u0acf\u0ad6\5\u0234\u0113"+ - "\2\u0ad0\u0ad2\5\u0260\u0129\2\u0ad1\u0ad3\5\u0234\u0113\2\u0ad2\u0ad1"+ - "\3\2\2\2\u0ad2\u0ad3\3\2\2\2\u0ad3\u0ad5\3\2\2\2\u0ad4\u0ad0\3\2\2\2\u0ad5"+ - "\u0ad8\3\2\2\2\u0ad6\u0ad4\3\2\2\2\u0ad6\u0ad7\3\2\2\2\u0ad7\u0ada\3\2"+ - "\2\2\u0ad8\u0ad6\3\2\2\2\u0ad9\u0ac5\3\2\2\2\u0ad9\u0acf\3\2\2\2\u0ada"+ - "\u025f\3\2\2\2\u0adb\u0ade\n$\2\2\u0adc\u0ade\5\u0232\u0112\2\u0add\u0adb"+ - "\3\2\2\2\u0add\u0adc\3\2\2\2\u0ade\u0261\3\2\2\2\u0adf\u0ae0\5\u0238\u0115"+ - "\2\u0ae0\u0263\3\2\2\2\u0ae1\u0ae2\5\u0268\u012d\2\u0ae2\u0ae3\5\u0262"+ - "\u012a\2\u0ae3\u0ae4\3\2\2\2\u0ae4\u0ae5\b\u012b!\2\u0ae5\u0265\3\2\2"+ - "\2\u0ae6\u0ae7\5\u0268\u012d\2\u0ae7\u0ae8\5\u0228\u010d\2\u0ae8\u0ae9"+ - "\3\2\2\2\u0ae9\u0aea\b\u012c\'\2\u0aea\u0267\3\2\2\2\u0aeb\u0aed\5\u026c"+ - "\u012f\2\u0aec\u0aeb\3\2\2\2\u0aec\u0aed\3\2\2\2\u0aed\u0af4\3\2\2\2\u0aee"+ - "\u0af0\5\u026a\u012e\2\u0aef\u0af1\5\u026c\u012f\2\u0af0\u0aef\3\2\2\2"+ - "\u0af0\u0af1\3\2\2\2\u0af1\u0af3\3\2\2\2\u0af2\u0aee\3\2\2\2\u0af3\u0af6"+ - "\3\2\2\2\u0af4\u0af2\3\2\2\2\u0af4\u0af5\3\2\2\2\u0af5\u0269\3\2\2\2\u0af6"+ - "\u0af4\3\2\2\2\u0af7\u0afa\n%\2\2\u0af8\u0afa\5\u0232\u0112\2\u0af9\u0af7"+ - "\3\2\2\2\u0af9\u0af8\3\2\2\2\u0afa\u026b\3\2\2\2\u0afb\u0b12\5\u0234\u0113"+ - "\2\u0afc\u0b12\5\u026e\u0130\2\u0afd\u0afe\5\u0234\u0113\2\u0afe\u0aff"+ - "\5\u026e\u0130\2\u0aff\u0b01\3\2\2\2\u0b00\u0afd\3\2\2\2\u0b01\u0b02\3"+ - "\2\2\2\u0b02\u0b00\3\2\2\2\u0b02\u0b03\3\2\2\2\u0b03\u0b05\3\2\2\2\u0b04"+ - "\u0b06\5\u0234\u0113\2\u0b05\u0b04\3\2\2\2\u0b05\u0b06\3\2\2\2\u0b06\u0b12"+ - "\3\2\2\2\u0b07\u0b08\5\u026e\u0130\2\u0b08\u0b09\5\u0234\u0113\2\u0b09"+ - "\u0b0b\3\2\2\2\u0b0a\u0b07\3\2\2\2\u0b0b\u0b0c\3\2\2\2\u0b0c\u0b0a\3\2"+ - "\2\2\u0b0c\u0b0d\3\2\2\2\u0b0d\u0b0f\3\2\2\2\u0b0e\u0b10\5\u026e\u0130"+ - "\2\u0b0f\u0b0e\3\2\2\2\u0b0f\u0b10\3\2\2\2\u0b10\u0b12\3\2\2\2\u0b11\u0afb"+ - "\3\2\2\2\u0b11\u0afc\3\2\2\2\u0b11\u0b00\3\2\2\2\u0b11\u0b0a\3\2\2\2\u0b12"+ - "\u026d\3\2\2\2\u0b13\u0b15\7@\2\2\u0b14\u0b13\3\2\2\2\u0b15\u0b16\3\2"+ - "\2\2\u0b16\u0b14\3\2\2\2\u0b16\u0b17\3\2\2\2\u0b17\u0b24\3\2\2\2\u0b18"+ - "\u0b1a\7@\2\2\u0b19\u0b18\3\2\2\2\u0b1a\u0b1d\3\2\2\2\u0b1b\u0b19\3\2"+ - "\2\2\u0b1b\u0b1c\3\2\2\2\u0b1c\u0b1f\3\2\2\2\u0b1d\u0b1b\3\2\2\2\u0b1e"+ - "\u0b20\7A\2\2\u0b1f\u0b1e\3\2\2\2\u0b20\u0b21\3\2\2\2\u0b21\u0b1f\3\2"+ - "\2\2\u0b21\u0b22\3\2\2\2\u0b22\u0b24\3\2\2\2\u0b23\u0b14\3\2\2\2\u0b23"+ - "\u0b1b\3\2\2\2\u0b24\u026f\3\2\2\2\u0b25\u0b26\7/\2\2\u0b26\u0b27\7/\2"+ - "\2\u0b27\u0b28\7@\2\2\u0b28\u0b29\3\2\2\2\u0b29\u0b2a\b\u0131!\2\u0b2a"+ - "\u0271\3\2\2\2\u0b2b\u0b2c\5\u0274\u0133\2\u0b2c\u0b2d\5\u0228\u010d\2"+ - "\u0b2d\u0b2e\3\2\2\2\u0b2e\u0b2f\b\u0132\'\2\u0b2f\u0273\3\2\2\2\u0b30"+ - "\u0b32\5\u027c\u0137\2\u0b31\u0b30\3\2\2\2\u0b31\u0b32\3\2\2\2\u0b32\u0b39"+ - "\3\2\2\2\u0b33\u0b35\5\u0278\u0135\2\u0b34\u0b36\5\u027c\u0137\2\u0b35"+ - "\u0b34\3\2\2\2\u0b35\u0b36\3\2\2\2\u0b36\u0b38\3\2\2\2\u0b37\u0b33\3\2"+ - "\2\2\u0b38\u0b3b\3\2\2\2\u0b39\u0b37\3\2\2\2\u0b39\u0b3a\3\2\2\2\u0b3a"+ - "\u0275\3\2\2\2\u0b3b\u0b39\3\2\2\2\u0b3c\u0b3e\5\u027c\u0137\2\u0b3d\u0b3c"+ - "\3\2\2\2\u0b3d\u0b3e\3\2\2\2\u0b3e\u0b40\3\2\2\2\u0b3f\u0b41\5\u0278\u0135"+ - "\2\u0b40\u0b3f\3\2\2\2\u0b41\u0b42\3\2\2\2\u0b42\u0b40\3\2\2\2\u0b42\u0b43"+ - "\3\2\2\2\u0b43\u0b45\3\2\2\2\u0b44\u0b46\5\u027c\u0137\2\u0b45\u0b44\3"+ - "\2\2\2\u0b45\u0b46\3\2\2\2\u0b46\u0277\3\2\2\2\u0b47\u0b4f\n&\2\2\u0b48"+ - "\u0b4f\5\u0234\u0113\2\u0b49\u0b4f\5\u0232\u0112\2\u0b4a\u0b4b\7^\2\2"+ - "\u0b4b\u0b4f\t\34\2\2\u0b4c\u0b4d\7&\2\2\u0b4d\u0b4f\5\u027a\u0136\2\u0b4e"+ - "\u0b47\3\2\2\2\u0b4e\u0b48\3\2\2\2\u0b4e\u0b49\3\2\2\2\u0b4e\u0b4a\3\2"+ - "\2\2\u0b4e\u0b4c\3\2\2\2\u0b4f\u0279\3\2\2\2\u0b50\u0b51\6\u0136\23\2"+ - "\u0b51\u027b\3\2\2\2\u0b52\u0b69\5\u0234\u0113\2\u0b53\u0b69\5\u027e\u0138"+ - "\2\u0b54\u0b55\5\u0234\u0113\2\u0b55\u0b56\5\u027e\u0138\2\u0b56\u0b58"+ - "\3\2\2\2\u0b57\u0b54\3\2\2\2\u0b58\u0b59\3\2\2\2\u0b59\u0b57\3\2\2\2\u0b59"+ - "\u0b5a\3\2\2\2\u0b5a\u0b5c\3\2\2\2\u0b5b\u0b5d\5\u0234\u0113\2\u0b5c\u0b5b"+ - "\3\2\2\2\u0b5c\u0b5d\3\2\2\2\u0b5d\u0b69\3\2\2\2\u0b5e\u0b5f\5\u027e\u0138"+ - "\2\u0b5f\u0b60\5\u0234\u0113\2\u0b60\u0b62\3\2\2\2\u0b61\u0b5e\3\2\2\2"+ - "\u0b62\u0b63\3\2\2\2\u0b63\u0b61\3\2\2\2\u0b63\u0b64\3\2\2\2\u0b64\u0b66"+ - "\3\2\2\2\u0b65\u0b67\5\u027e\u0138\2\u0b66\u0b65\3\2\2\2\u0b66\u0b67\3"+ - "\2\2\2\u0b67\u0b69\3\2\2\2\u0b68\u0b52\3\2\2\2\u0b68\u0b53\3\2\2\2\u0b68"+ - "\u0b57\3\2\2\2\u0b68\u0b61\3\2\2\2\u0b69\u027d\3\2\2\2\u0b6a\u0b6c\7@"+ - "\2\2\u0b6b\u0b6a\3\2\2\2\u0b6c\u0b6d\3\2\2\2\u0b6d\u0b6b\3\2\2\2\u0b6d"+ - "\u0b6e\3\2\2\2\u0b6e\u0b75\3\2\2\2\u0b6f\u0b71\7@\2\2\u0b70\u0b6f\3\2"+ - "\2\2\u0b70\u0b71\3\2\2\2\u0b71\u0b72\3\2\2\2\u0b72\u0b73\7/\2\2\u0b73"+ - "\u0b75\5\u0280\u0139\2\u0b74\u0b6b\3\2\2\2\u0b74\u0b70\3\2\2\2\u0b75\u027f"+ - "\3\2\2\2\u0b76\u0b77\6\u0139\24\2\u0b77\u0281\3\2\2\2\u0b78\u0b79\5\u0158"+ - "\u00a5\2\u0b79\u0b7a\5\u0158\u00a5\2\u0b7a\u0b7b\5\u0158\u00a5\2\u0b7b"+ - "\u0b7c\3\2\2\2\u0b7c\u0b7d\b\u013a!\2\u0b7d\u0283\3\2\2\2\u0b7e\u0b80"+ - "\5\u0286\u013c\2\u0b7f\u0b7e\3\2\2\2\u0b80\u0b81\3\2\2\2\u0b81\u0b7f\3"+ - "\2\2\2\u0b81\u0b82\3\2\2\2\u0b82\u0285\3\2\2\2\u0b83\u0b8a\n\34\2\2\u0b84"+ - "\u0b85\t\34\2\2\u0b85\u0b8a\n\34\2\2\u0b86\u0b87\t\34\2\2\u0b87\u0b88"+ - "\t\34\2\2\u0b88\u0b8a\n\34\2\2\u0b89\u0b83\3\2\2\2\u0b89\u0b84\3\2\2\2"+ - "\u0b89\u0b86\3\2\2\2\u0b8a\u0287\3\2\2\2\u0b8b\u0b8c\5\u0158\u00a5\2\u0b8c"+ - "\u0b8d\5\u0158\u00a5\2\u0b8d\u0b8e\3\2\2\2\u0b8e\u0b8f\b\u013d!\2\u0b8f"+ - "\u0289\3\2\2\2\u0b90\u0b92\5\u028c\u013f\2\u0b91\u0b90\3\2\2\2\u0b92\u0b93"+ - "\3\2\2\2\u0b93\u0b91\3\2\2\2\u0b93\u0b94\3\2\2\2\u0b94\u028b\3\2\2\2\u0b95"+ - "\u0b99\n\34\2\2\u0b96\u0b97\t\34\2\2\u0b97\u0b99\n\34\2\2\u0b98\u0b95"+ - "\3\2\2\2\u0b98\u0b96\3\2\2\2\u0b99\u028d\3\2\2\2\u0b9a\u0b9b\5\u0158\u00a5"+ - "\2\u0b9b\u0b9c\3\2\2\2\u0b9c\u0b9d\b\u0140!\2\u0b9d\u028f\3\2\2\2\u0b9e"+ - "\u0ba0\5\u0292\u0142\2\u0b9f\u0b9e\3\2\2\2\u0ba0\u0ba1\3\2\2\2\u0ba1\u0b9f"+ - "\3\2\2\2\u0ba1\u0ba2\3\2\2\2\u0ba2\u0291\3\2\2\2\u0ba3\u0ba4\n\34\2\2"+ - "\u0ba4\u0293\3\2\2\2\u0ba5\u0ba6\7b\2\2\u0ba6\u0ba7\b\u0143*\2\u0ba7\u0ba8"+ - "\3\2\2\2\u0ba8\u0ba9\b\u0143!\2\u0ba9\u0295\3\2\2\2\u0baa\u0bac\5\u0298"+ - "\u0145\2\u0bab\u0baa\3\2\2\2\u0bab\u0bac\3\2\2\2\u0bac\u0bad\3\2\2\2\u0bad"+ - "\u0bae\5\u0228\u010d\2\u0bae\u0baf\3\2\2\2\u0baf\u0bb0\b\u0144\'\2\u0bb0"+ - "\u0297\3\2\2\2\u0bb1\u0bb3\5\u029c\u0147\2\u0bb2\u0bb1\3\2\2\2\u0bb3\u0bb4"+ - "\3\2\2\2\u0bb4\u0bb2\3\2\2\2\u0bb4\u0bb5\3\2\2\2\u0bb5\u0bb9\3\2\2\2\u0bb6"+ - "\u0bb8\5\u029a\u0146\2\u0bb7\u0bb6\3\2\2\2\u0bb8\u0bbb\3\2\2\2\u0bb9\u0bb7"+ - "\3\2\2\2\u0bb9\u0bba\3\2\2\2\u0bba\u0bc2\3\2\2\2\u0bbb\u0bb9\3\2\2\2\u0bbc"+ - "\u0bbe\5\u029a\u0146\2\u0bbd\u0bbc\3\2\2\2\u0bbe\u0bbf\3\2\2\2\u0bbf\u0bbd"+ - "\3\2\2\2\u0bbf\u0bc0\3\2\2\2\u0bc0\u0bc2\3\2\2\2\u0bc1\u0bb2\3\2\2\2\u0bc1"+ - "\u0bbd\3\2\2\2\u0bc2\u0299\3\2\2\2\u0bc3\u0bc4\7&\2\2\u0bc4\u029b\3\2"+ - "\2\2\u0bc5\u0bd0\n\'\2\2\u0bc6\u0bc8\5\u029a\u0146\2\u0bc7\u0bc6\3\2\2"+ - "\2\u0bc8\u0bc9\3\2\2\2\u0bc9\u0bc7\3\2\2\2\u0bc9\u0bca\3\2\2\2\u0bca\u0bcb"+ - "\3\2\2\2\u0bcb\u0bcc\n(\2\2\u0bcc\u0bd0\3\2\2\2\u0bcd\u0bd0\5\u01e4\u00eb"+ - "\2\u0bce\u0bd0\5\u029e\u0148\2\u0bcf\u0bc5\3\2\2\2\u0bcf\u0bc7\3\2\2\2"+ - "\u0bcf\u0bcd\3\2\2\2\u0bcf\u0bce\3\2\2\2\u0bd0\u029d\3\2\2\2\u0bd1\u0bd3"+ - "\5\u029a\u0146\2\u0bd2\u0bd1\3\2\2\2\u0bd3\u0bd6\3\2\2\2\u0bd4\u0bd2\3"+ - "\2\2\2\u0bd4\u0bd5\3\2\2\2\u0bd5\u0bd7\3\2\2\2\u0bd6\u0bd4\3\2\2\2\u0bd7"+ - "\u0bd8\7^\2\2\u0bd8\u0bd9\t)\2\2\u0bd9\u029f\3\2\2\2\u00cf\2\3\4\5\6\7"+ - "\b\t\n\13\f\r\16\17\20\21\u06ba\u06bc\u06c1\u06c5\u06d4\u06dd\u06e2\u06ec"+ - "\u06f0\u06f3\u06f5\u06fd\u070d\u070f\u071f\u0723\u072a\u072e\u0733\u0746"+ - "\u074d\u0753\u075b\u0762\u0771\u0778\u077c\u0781\u0789\u0790\u0797\u079e"+ - "\u07a6\u07ad\u07b4\u07bb\u07c3\u07ca\u07d1\u07d8\u07dd\u07ea\u07f0\u07f7"+ - "\u07fc\u0800\u0804\u0810\u0816\u081c\u0822\u082e\u0838\u083e\u0844\u084b"+ - "\u0851\u0858\u085f\u0867\u086e\u0878\u0895\u0899\u089b\u08b0\u08b5\u08c5"+ - "\u08cc\u08da\u08dc\u08e0\u08e6\u08e8\u08ec\u08f0\u08f5\u08f7\u08f9\u0903"+ - "\u0905\u0909\u0910\u0912\u0916\u091a\u0920\u0922\u0924\u0933\u0935\u0939"+ - "\u0944\u0946\u094a\u094e\u0958\u095a\u095c\u0978\u0986\u098b\u099c\u09a7"+ - "\u09ab\u09af\u09b2\u09c3\u09d3\u09dc\u09e5\u09ea\u09ff\u0a02\u0a08\u0a0d"+ - "\u0a13\u0a1a\u0a1f\u0a25\u0a2c\u0a31\u0a37\u0a3e\u0a43\u0a49\u0a50\u0a59"+ - "\u0a5c\u0a7e\u0a8d\u0a90\u0a97\u0a9e\u0aa2\u0aa6\u0aab\u0aaf\u0ab2\u0ab7"+ - "\u0abe\u0ac5\u0ac9\u0acd\u0ad2\u0ad6\u0ad9\u0add\u0aec\u0af0\u0af4\u0af9"+ - "\u0b02\u0b05\u0b0c\u0b0f\u0b11\u0b16\u0b1b\u0b21\u0b23\u0b31\u0b35\u0b39"+ - "\u0b3d\u0b42\u0b45\u0b4e\u0b59\u0b5c\u0b63\u0b66\u0b68\u0b6d\u0b70\u0b74"+ - "\u0b81\u0b89\u0b93\u0b98\u0ba1\u0bab\u0bb4\u0bb9\u0bbf\u0bc1\u0bc9\u0bcf"+ - "\u0bd4+\3\34\2\3\36\3\3%\4\3\'\5\3)\6\3*\7\3+\b\3-\t\3\64\n\3\65\13\3"+ + "\u094f\u0951\t\32\2\2\u0950\u094f\3\2\2\2\u0950\u0951\3\2\2\2\u0951\u0953"+ + "\3\2\2\2\u0952\u0941\3\2\2\2\u0953\u0954\3\2\2\2\u0954\u0952\3\2\2\2\u0954"+ + "\u0955\3\2\2\2\u0955\u0963\3\2\2\2\u0956\u095f\n\33\2\2\u0957\u0958\5"+ + "\u0158\u00a5\2\u0958\u0959\n\34\2\2\u0959\u095f\3\2\2\2\u095a\u095b\5"+ + "\u0158\u00a5\2\u095b\u095c\5\u0158\u00a5\2\u095c\u095d\n\34\2\2\u095d"+ + "\u095f\3\2\2\2\u095e\u0956\3\2\2\2\u095e\u0957\3\2\2\2\u095e\u095a\3\2"+ + "\2\2\u095f\u0960\3\2\2\2\u0960\u095e\3\2\2\2\u0960\u0961\3\2\2\2\u0961"+ + "\u0963\3\2\2\2\u0962\u093f\3\2\2\2\u0962\u095e\3\2\2\2\u0963\u0213\3\2"+ + "\2\2\u0964\u0965\5\u0158\u00a5\2\u0965\u0966\5\u0158\u00a5\2\u0966\u0967"+ + "\5\u0158\u00a5\2\u0967\u0968\3\2\2\2\u0968\u0969\b\u0103!\2\u0969\u0215"+ + "\3\2\2\2\u096a\u096b\7>\2\2\u096b\u096c\7#\2\2\u096c\u096d\7/\2\2\u096d"+ + "\u096e\7/\2\2\u096e\u096f\3\2\2\2\u096f\u0970\b\u0104\"\2\u0970\u0217"+ + "\3\2\2\2\u0971\u0972\7>\2\2\u0972\u0973\7#\2\2\u0973\u0974\7]\2\2\u0974"+ + "\u0975\7E\2\2\u0975\u0976\7F\2\2\u0976\u0977\7C\2\2\u0977\u0978\7V\2\2"+ + "\u0978\u0979\7C\2\2\u0979\u097a\7]\2\2\u097a\u097e\3\2\2\2\u097b\u097d"+ + "\13\2\2\2\u097c\u097b\3\2\2\2\u097d\u0980\3\2\2\2\u097e\u097f\3\2\2\2"+ + "\u097e\u097c\3\2\2\2\u097f\u0981\3\2\2\2\u0980\u097e\3\2\2\2\u0981\u0982"+ + "\7_\2\2\u0982\u0983\7_\2\2\u0983\u0984\7@\2\2\u0984\u0219\3\2\2\2\u0985"+ + "\u0986\7>\2\2\u0986\u0987\7#\2\2\u0987\u098c\3\2\2\2\u0988\u0989\n\35"+ + "\2\2\u0989\u098d\13\2\2\2\u098a\u098b\13\2\2\2\u098b\u098d\n\35\2\2\u098c"+ + "\u0988\3\2\2\2\u098c\u098a\3\2\2\2\u098d\u0991\3\2\2\2\u098e\u0990\13"+ + "\2\2\2\u098f\u098e\3\2\2\2\u0990\u0993\3\2\2\2\u0991\u0992\3\2\2\2\u0991"+ + "\u098f\3\2\2\2\u0992\u0994\3\2\2\2\u0993\u0991\3\2\2\2\u0994\u0995\7@"+ + "\2\2\u0995\u0996\3\2\2\2\u0996\u0997\b\u0106#\2\u0997\u021b\3\2\2\2\u0998"+ + "\u0999\7(\2\2\u0999\u099a\5\u0248\u011d\2\u099a\u099b\7=\2\2\u099b\u021d"+ + "\3\2\2\2\u099c\u099d\7(\2\2\u099d\u099e\7%\2\2\u099e\u09a0\3\2\2\2\u099f"+ + "\u09a1\5\u0186\u00bc\2\u09a0\u099f\3\2\2\2\u09a1\u09a2\3\2\2\2\u09a2\u09a0"+ + "\3\2\2\2\u09a2\u09a3\3\2\2\2\u09a3\u09a4\3\2\2\2\u09a4\u09a5\7=\2\2\u09a5"+ + "\u09b2\3\2\2\2\u09a6\u09a7\7(\2\2\u09a7\u09a8\7%\2\2\u09a8\u09a9\7z\2"+ + "\2\u09a9\u09ab\3\2\2\2\u09aa\u09ac\5\u0190\u00c1\2\u09ab\u09aa\3\2\2\2"+ + "\u09ac\u09ad\3\2\2\2\u09ad\u09ab\3\2\2\2\u09ad\u09ae\3\2\2\2\u09ae\u09af"+ + "\3\2\2\2\u09af\u09b0\7=\2\2\u09b0\u09b2\3\2\2\2\u09b1\u099c\3\2\2\2\u09b1"+ + "\u09a6\3\2\2\2\u09b2\u021f\3\2\2\2\u09b3\u09b9\t\25\2\2\u09b4\u09b6\7"+ + "\17\2\2\u09b5\u09b4\3\2\2\2\u09b5\u09b6\3\2\2\2\u09b6\u09b7\3\2\2\2\u09b7"+ + "\u09b9\7\f\2\2\u09b8\u09b3\3\2\2\2\u09b8\u09b5\3\2\2\2\u09b9\u0221\3\2"+ + "\2\2\u09ba\u09bb\5\u013e\u0098\2\u09bb\u09bc\3\2\2\2\u09bc\u09bd\b\u010a"+ + "$\2\u09bd\u0223\3\2\2\2\u09be\u09bf\7>\2\2\u09bf\u09c0\7\61\2\2\u09c0"+ + "\u09c1\3\2\2\2\u09c1\u09c2\b\u010b$\2\u09c2\u0225\3\2\2\2\u09c3\u09c4"+ + "\7>\2\2\u09c4\u09c5\7A\2\2\u09c5\u09c9\3\2\2\2\u09c6\u09c7\5\u0248\u011d"+ + "\2\u09c7\u09c8\5\u0240\u0119\2\u09c8\u09ca\3\2\2\2\u09c9\u09c6\3\2\2\2"+ + "\u09c9\u09ca\3\2\2\2\u09ca\u09cb\3\2\2\2\u09cb\u09cc\5\u0248\u011d\2\u09cc"+ + "\u09cd\5\u0220\u0109\2\u09cd\u09ce\3\2\2\2\u09ce\u09cf\b\u010c%\2\u09cf"+ + "\u0227\3\2\2\2\u09d0\u09d1\7b\2\2\u09d1\u09d2\b\u010d&\2\u09d2\u09d3\3"+ + "\2\2\2\u09d3\u09d4\b\u010d!\2\u09d4\u0229\3\2\2\2\u09d5\u09d6\7&\2\2\u09d6"+ + "\u09d7\7}\2\2\u09d7\u022b\3\2\2\2\u09d8\u09da\5\u022e\u0110\2\u09d9\u09d8"+ + "\3\2\2\2\u09d9\u09da\3\2\2\2\u09da\u09db\3\2\2\2\u09db\u09dc\5\u022a\u010e"+ + "\2\u09dc\u09dd\3\2\2\2\u09dd\u09de\b\u010f\'\2\u09de\u022d\3\2\2\2\u09df"+ + "\u09e1\5\u0230\u0111\2\u09e0\u09df\3\2\2\2\u09e1\u09e2\3\2\2\2\u09e2\u09e0"+ + "\3\2\2\2\u09e2\u09e3\3\2\2\2\u09e3\u022f\3\2\2\2\u09e4\u09ec\n\36\2\2"+ + "\u09e5\u09e6\7^\2\2\u09e6\u09ec\t\34\2\2\u09e7\u09ec\5\u0220\u0109\2\u09e8"+ + "\u09ec\5\u0234\u0113\2\u09e9\u09ec\5\u0232\u0112\2\u09ea\u09ec\5\u0236"+ + "\u0114\2\u09eb\u09e4\3\2\2\2\u09eb\u09e5\3\2\2\2\u09eb\u09e7\3\2\2\2\u09eb"+ + "\u09e8\3\2\2\2\u09eb\u09e9\3\2\2\2\u09eb\u09ea\3\2\2\2\u09ec\u0231\3\2"+ + "\2\2\u09ed\u09ef\7&\2\2\u09ee\u09ed\3\2\2\2\u09ef\u09f0\3\2\2\2\u09f0"+ + "\u09ee\3\2\2\2\u09f0\u09f1\3\2\2\2\u09f1\u09f2\3\2\2\2\u09f2\u09f3\5\u027c"+ + "\u0137\2\u09f3\u0233\3\2\2\2\u09f4\u09f5\7^\2\2\u09f5\u0a09\7^\2\2\u09f6"+ + "\u09f7\7^\2\2\u09f7\u09f8\7&\2\2\u09f8\u0a09\7}\2\2\u09f9\u09fa\7^\2\2"+ + "\u09fa\u0a09\7\177\2\2\u09fb\u09fc\7^\2\2\u09fc\u0a09\7}\2\2\u09fd\u0a05"+ + "\7(\2\2\u09fe\u09ff\7i\2\2\u09ff\u0a06\7v\2\2\u0a00\u0a01\7n\2\2\u0a01"+ + "\u0a06\7v\2\2\u0a02\u0a03\7c\2\2\u0a03\u0a04\7o\2\2\u0a04\u0a06\7r\2\2"+ + "\u0a05\u09fe\3\2\2\2\u0a05\u0a00\3\2\2\2\u0a05\u0a02\3\2\2\2\u0a06\u0a07"+ + "\3\2\2\2\u0a07\u0a09\7=\2\2\u0a08\u09f4\3\2\2\2\u0a08\u09f6\3\2\2\2\u0a08"+ + "\u09f9\3\2\2\2\u0a08\u09fb\3\2\2\2\u0a08\u09fd\3\2\2\2\u0a09\u0235\3\2"+ + "\2\2\u0a0a\u0a0b\7}\2\2\u0a0b\u0a0d\7\177\2\2\u0a0c\u0a0a\3\2\2\2\u0a0d"+ + "\u0a0e\3\2\2\2\u0a0e\u0a0c\3\2\2\2\u0a0e\u0a0f\3\2\2\2\u0a0f\u0a13\3\2"+ + "\2\2\u0a10\u0a12\7}\2\2\u0a11\u0a10\3\2\2\2\u0a12\u0a15\3\2\2\2\u0a13"+ + "\u0a11\3\2\2\2\u0a13\u0a14\3\2\2\2\u0a14\u0a19\3\2\2\2\u0a15\u0a13\3\2"+ + "\2\2\u0a16\u0a18\7\177\2\2\u0a17\u0a16\3\2\2\2\u0a18\u0a1b\3\2\2\2\u0a19"+ + "\u0a17\3\2\2\2\u0a19\u0a1a\3\2\2\2\u0a1a\u0a63\3\2\2\2\u0a1b\u0a19\3\2"+ + "\2\2\u0a1c\u0a1d\7\177\2\2\u0a1d\u0a1f\7}\2\2\u0a1e\u0a1c\3\2\2\2\u0a1f"+ + "\u0a20\3\2\2\2\u0a20\u0a1e\3\2\2\2\u0a20\u0a21\3\2\2\2\u0a21\u0a25\3\2"+ + "\2\2\u0a22\u0a24\7}\2\2\u0a23\u0a22\3\2\2\2\u0a24\u0a27\3\2\2\2\u0a25"+ + "\u0a23\3\2\2\2\u0a25\u0a26\3\2\2\2\u0a26\u0a2b\3\2\2\2\u0a27\u0a25\3\2"+ + "\2\2\u0a28\u0a2a\7\177\2\2\u0a29\u0a28\3\2\2\2\u0a2a\u0a2d\3\2\2\2\u0a2b"+ + "\u0a29\3\2\2\2\u0a2b\u0a2c\3\2\2\2\u0a2c\u0a63\3\2\2\2\u0a2d\u0a2b\3\2"+ + "\2\2\u0a2e\u0a2f\7}\2\2\u0a2f\u0a31\7}\2\2\u0a30\u0a2e\3\2\2\2\u0a31\u0a32"+ + "\3\2\2\2\u0a32\u0a30\3\2\2\2\u0a32\u0a33\3\2\2\2\u0a33\u0a37\3\2\2\2\u0a34"+ + "\u0a36\7}\2\2\u0a35\u0a34\3\2\2\2\u0a36\u0a39\3\2\2\2\u0a37\u0a35\3\2"+ + "\2\2\u0a37\u0a38\3\2\2\2\u0a38\u0a3d\3\2\2\2\u0a39\u0a37\3\2\2\2\u0a3a"+ + "\u0a3c\7\177\2\2\u0a3b\u0a3a\3\2\2\2\u0a3c\u0a3f\3\2\2\2\u0a3d\u0a3b\3"+ + "\2\2\2\u0a3d\u0a3e\3\2\2\2\u0a3e\u0a63\3\2\2\2\u0a3f\u0a3d\3\2\2\2\u0a40"+ + "\u0a41\7\177\2\2\u0a41\u0a43\7\177\2\2\u0a42\u0a40\3\2\2\2\u0a43\u0a44"+ + "\3\2\2\2\u0a44\u0a42\3\2\2\2\u0a44\u0a45\3\2\2\2\u0a45\u0a49\3\2\2\2\u0a46"+ + "\u0a48\7}\2\2\u0a47\u0a46\3\2\2\2\u0a48\u0a4b\3\2\2\2\u0a49\u0a47\3\2"+ + "\2\2\u0a49\u0a4a\3\2\2\2\u0a4a\u0a4f\3\2\2\2\u0a4b\u0a49\3\2\2\2\u0a4c"+ + "\u0a4e\7\177\2\2\u0a4d\u0a4c\3\2\2\2\u0a4e\u0a51\3\2\2\2\u0a4f\u0a4d\3"+ + "\2\2\2\u0a4f\u0a50\3\2\2\2\u0a50\u0a63\3\2\2\2\u0a51\u0a4f\3\2\2\2\u0a52"+ + "\u0a53\7}\2\2\u0a53\u0a55\7\177\2\2\u0a54\u0a52\3\2\2\2\u0a55\u0a58\3"+ + "\2\2\2\u0a56\u0a54\3\2\2\2\u0a56\u0a57\3\2\2\2\u0a57\u0a59\3\2\2\2\u0a58"+ + "\u0a56\3\2\2\2\u0a59\u0a63\7}\2\2\u0a5a\u0a5f\7\177\2\2\u0a5b\u0a5c\7"+ + "}\2\2\u0a5c\u0a5e\7\177\2\2\u0a5d\u0a5b\3\2\2\2\u0a5e\u0a61\3\2\2\2\u0a5f"+ + "\u0a5d\3\2\2\2\u0a5f\u0a60\3\2\2\2\u0a60\u0a63\3\2\2\2\u0a61\u0a5f\3\2"+ + "\2\2\u0a62\u0a0c\3\2\2\2\u0a62\u0a1e\3\2\2\2\u0a62\u0a30\3\2\2\2\u0a62"+ + "\u0a42\3\2\2\2\u0a62\u0a56\3\2\2\2\u0a62\u0a5a\3\2\2\2\u0a63\u0237\3\2"+ + "\2\2\u0a64\u0a65\5\u013c\u0097\2\u0a65\u0a66\3\2\2\2\u0a66\u0a67\b\u0115"+ + "!\2\u0a67\u0239\3\2\2\2\u0a68\u0a69\7A\2\2\u0a69\u0a6a\7@\2\2\u0a6a\u0a6b"+ + "\3\2\2\2\u0a6b\u0a6c\b\u0116!\2\u0a6c\u023b\3\2\2\2\u0a6d\u0a6e\7\61\2"+ + "\2\u0a6e\u0a6f\7@\2\2\u0a6f\u0a70\3\2\2\2\u0a70\u0a71\b\u0117!\2\u0a71"+ + "\u023d\3\2\2\2\u0a72\u0a73\5\u0132\u0092\2\u0a73\u023f\3\2\2\2\u0a74\u0a75"+ + "\5\u010e\u0080\2\u0a75\u0241\3\2\2\2\u0a76\u0a77\5\u012a\u008e\2\u0a77"+ + "\u0243\3\2\2\2\u0a78\u0a79\7$\2\2\u0a79\u0a7a\3\2\2\2\u0a7a\u0a7b\b\u011b"+ + "(\2\u0a7b\u0245\3\2\2\2\u0a7c\u0a7d\7)\2\2\u0a7d\u0a7e\3\2\2\2\u0a7e\u0a7f"+ + "\b\u011c)\2\u0a7f\u0247\3\2\2\2\u0a80\u0a84\5\u0252\u0122\2\u0a81\u0a83"+ + "\5\u0250\u0121\2\u0a82\u0a81\3\2\2\2\u0a83\u0a86\3\2\2\2\u0a84\u0a82\3"+ + "\2\2\2\u0a84\u0a85\3\2\2\2\u0a85\u0249\3\2\2\2\u0a86\u0a84\3\2\2\2\u0a87"+ + "\u0a88\t\37\2\2\u0a88\u0a89\3\2\2\2\u0a89\u0a8a\b\u011e\35\2\u0a8a\u024b"+ + "\3\2\2\2\u0a8b\u0a8c\t\4\2\2\u0a8c\u024d\3\2\2\2\u0a8d\u0a8e\t \2\2\u0a8e"+ + "\u024f\3\2\2\2\u0a8f\u0a94\5\u0252\u0122\2\u0a90\u0a94\4/\60\2\u0a91\u0a94"+ + "\5\u024e\u0120\2\u0a92\u0a94\t!\2\2\u0a93\u0a8f\3\2\2\2\u0a93\u0a90\3"+ + "\2\2\2\u0a93\u0a91\3\2\2\2\u0a93\u0a92\3\2\2\2\u0a94\u0251\3\2\2\2\u0a95"+ + "\u0a97\t\"\2\2\u0a96\u0a95\3\2\2\2\u0a97\u0253\3\2\2\2\u0a98\u0a99\5\u0244"+ + "\u011b\2\u0a99\u0a9a\3\2\2\2\u0a9a\u0a9b\b\u0123!\2\u0a9b\u0255\3\2\2"+ + "\2\u0a9c\u0a9e\5\u0258\u0125\2\u0a9d\u0a9c\3\2\2\2\u0a9d\u0a9e\3\2\2\2"+ + "\u0a9e\u0a9f\3\2\2\2\u0a9f\u0aa0\5\u022a\u010e\2\u0aa0\u0aa1\3\2\2\2\u0aa1"+ + "\u0aa2\b\u0124\'\2\u0aa2\u0257\3\2\2\2\u0aa3\u0aa5\5\u0236\u0114\2\u0aa4"+ + "\u0aa3\3\2\2\2\u0aa4\u0aa5\3\2\2\2\u0aa5\u0aaa\3\2\2\2\u0aa6\u0aa8\5\u025a"+ + "\u0126\2\u0aa7\u0aa9\5\u0236\u0114\2\u0aa8\u0aa7\3\2\2\2\u0aa8\u0aa9\3"+ + "\2\2\2\u0aa9\u0aab\3\2\2\2\u0aaa\u0aa6\3\2\2\2\u0aab\u0aac\3\2\2\2\u0aac"+ + "\u0aaa\3\2\2\2\u0aac\u0aad\3\2\2\2\u0aad\u0ab9\3\2\2\2\u0aae\u0ab5\5\u0236"+ + "\u0114\2\u0aaf\u0ab1\5\u025a\u0126\2\u0ab0\u0ab2\5\u0236\u0114\2\u0ab1"+ + "\u0ab0\3\2\2\2\u0ab1\u0ab2\3\2\2\2\u0ab2\u0ab4\3\2\2\2\u0ab3\u0aaf\3\2"+ + "\2\2\u0ab4\u0ab7\3\2\2\2\u0ab5\u0ab3\3\2\2\2\u0ab5\u0ab6\3\2\2\2\u0ab6"+ + "\u0ab9\3\2\2\2\u0ab7\u0ab5\3\2\2\2\u0ab8\u0aa4\3\2\2\2\u0ab8\u0aae\3\2"+ + "\2\2\u0ab9\u0259\3\2\2\2\u0aba\u0abe\n#\2\2\u0abb\u0abe\5\u0234\u0113"+ + "\2\u0abc\u0abe\5\u0232\u0112\2\u0abd\u0aba\3\2\2\2\u0abd\u0abb\3\2\2\2"+ + "\u0abd\u0abc\3\2\2\2\u0abe\u025b\3\2\2\2\u0abf\u0ac0\5\u0246\u011c\2\u0ac0"+ + "\u0ac1\3\2\2\2\u0ac1\u0ac2\b\u0127!\2\u0ac2\u025d\3\2\2\2\u0ac3\u0ac5"+ + "\5\u0260\u0129\2\u0ac4\u0ac3\3\2\2\2\u0ac4\u0ac5\3\2\2\2\u0ac5\u0ac6\3"+ + "\2\2\2\u0ac6\u0ac7\5\u022a\u010e\2\u0ac7\u0ac8\3\2\2\2\u0ac8\u0ac9\b\u0128"+ + "\'\2\u0ac9\u025f\3\2\2\2\u0aca\u0acc\5\u0236\u0114\2\u0acb\u0aca\3\2\2"+ + "\2\u0acb\u0acc\3\2\2\2\u0acc\u0ad1\3\2\2\2\u0acd\u0acf\5\u0262\u012a\2"+ + "\u0ace\u0ad0\5\u0236\u0114\2\u0acf\u0ace\3\2\2\2\u0acf\u0ad0\3\2\2\2\u0ad0"+ + "\u0ad2\3\2\2\2\u0ad1\u0acd\3\2\2\2\u0ad2\u0ad3\3\2\2\2\u0ad3\u0ad1\3\2"+ + "\2\2\u0ad3\u0ad4\3\2\2\2\u0ad4\u0ae0\3\2\2\2\u0ad5\u0adc\5\u0236\u0114"+ + "\2\u0ad6\u0ad8\5\u0262\u012a\2\u0ad7\u0ad9\5\u0236\u0114\2\u0ad8\u0ad7"+ + "\3\2\2\2\u0ad8\u0ad9\3\2\2\2\u0ad9\u0adb\3\2\2\2\u0ada\u0ad6\3\2\2\2\u0adb"+ + "\u0ade\3\2\2\2\u0adc\u0ada\3\2\2\2\u0adc\u0add\3\2\2\2\u0add\u0ae0\3\2"+ + "\2\2\u0ade\u0adc\3\2\2\2\u0adf\u0acb\3\2\2\2\u0adf\u0ad5\3\2\2\2\u0ae0"+ + "\u0261\3\2\2\2\u0ae1\u0ae4\n$\2\2\u0ae2\u0ae4\5\u0234\u0113\2\u0ae3\u0ae1"+ + "\3\2\2\2\u0ae3\u0ae2\3\2\2\2\u0ae4\u0263\3\2\2\2\u0ae5\u0ae6\5\u023a\u0116"+ + "\2\u0ae6\u0265\3\2\2\2\u0ae7\u0ae8\5\u026a\u012e\2\u0ae8\u0ae9\5\u0264"+ + "\u012b\2\u0ae9\u0aea\3\2\2\2\u0aea\u0aeb\b\u012c!\2\u0aeb\u0267\3\2\2"+ + "\2\u0aec\u0aed\5\u026a\u012e\2\u0aed\u0aee\5\u022a\u010e\2\u0aee\u0aef"+ + "\3\2\2\2\u0aef\u0af0\b\u012d\'\2\u0af0\u0269\3\2\2\2\u0af1\u0af3\5\u026e"+ + "\u0130\2\u0af2\u0af1\3\2\2\2\u0af2\u0af3\3\2\2\2\u0af3\u0afa\3\2\2\2\u0af4"+ + "\u0af6\5\u026c\u012f\2\u0af5\u0af7\5\u026e\u0130\2\u0af6\u0af5\3\2\2\2"+ + "\u0af6\u0af7\3\2\2\2\u0af7\u0af9\3\2\2\2\u0af8\u0af4\3\2\2\2\u0af9\u0afc"+ + "\3\2\2\2\u0afa\u0af8\3\2\2\2\u0afa\u0afb\3\2\2\2\u0afb\u026b\3\2\2\2\u0afc"+ + "\u0afa\3\2\2\2\u0afd\u0b00\n%\2\2\u0afe\u0b00\5\u0234\u0113\2\u0aff\u0afd"+ + "\3\2\2\2\u0aff\u0afe\3\2\2\2\u0b00\u026d\3\2\2\2\u0b01\u0b18\5\u0236\u0114"+ + "\2\u0b02\u0b18\5\u0270\u0131\2\u0b03\u0b04\5\u0236\u0114\2\u0b04\u0b05"+ + "\5\u0270\u0131\2\u0b05\u0b07\3\2\2\2\u0b06\u0b03\3\2\2\2\u0b07\u0b08\3"+ + "\2\2\2\u0b08\u0b06\3\2\2\2\u0b08\u0b09\3\2\2\2\u0b09\u0b0b\3\2\2\2\u0b0a"+ + "\u0b0c\5\u0236\u0114\2\u0b0b\u0b0a\3\2\2\2\u0b0b\u0b0c\3\2\2\2\u0b0c\u0b18"+ + "\3\2\2\2\u0b0d\u0b0e\5\u0270\u0131\2\u0b0e\u0b0f\5\u0236\u0114\2\u0b0f"+ + "\u0b11\3\2\2\2\u0b10\u0b0d\3\2\2\2\u0b11\u0b12\3\2\2\2\u0b12\u0b10\3\2"+ + "\2\2\u0b12\u0b13\3\2\2\2\u0b13\u0b15\3\2\2\2\u0b14\u0b16\5\u0270\u0131"+ + "\2\u0b15\u0b14\3\2\2\2\u0b15\u0b16\3\2\2\2\u0b16\u0b18\3\2\2\2\u0b17\u0b01"+ + "\3\2\2\2\u0b17\u0b02\3\2\2\2\u0b17\u0b06\3\2\2\2\u0b17\u0b10\3\2\2\2\u0b18"+ + "\u026f\3\2\2\2\u0b19\u0b1b\7@\2\2\u0b1a\u0b19\3\2\2\2\u0b1b\u0b1c\3\2"+ + "\2\2\u0b1c\u0b1a\3\2\2\2\u0b1c\u0b1d\3\2\2\2\u0b1d\u0b2a\3\2\2\2\u0b1e"+ + "\u0b20\7@\2\2\u0b1f\u0b1e\3\2\2\2\u0b20\u0b23\3\2\2\2\u0b21\u0b1f\3\2"+ + "\2\2\u0b21\u0b22\3\2\2\2\u0b22\u0b25\3\2\2\2\u0b23\u0b21\3\2\2\2\u0b24"+ + "\u0b26\7A\2\2\u0b25\u0b24\3\2\2\2\u0b26\u0b27\3\2\2\2\u0b27\u0b25\3\2"+ + "\2\2\u0b27\u0b28\3\2\2\2\u0b28\u0b2a\3\2\2\2\u0b29\u0b1a\3\2\2\2\u0b29"+ + "\u0b21\3\2\2\2\u0b2a\u0271\3\2\2\2\u0b2b\u0b2c\7/\2\2\u0b2c\u0b2d\7/\2"+ + "\2\u0b2d\u0b2e\7@\2\2\u0b2e\u0b2f\3\2\2\2\u0b2f\u0b30\b\u0132!\2\u0b30"+ + "\u0273\3\2\2\2\u0b31\u0b32\5\u0276\u0134\2\u0b32\u0b33\5\u022a\u010e\2"+ + "\u0b33\u0b34\3\2\2\2\u0b34\u0b35\b\u0133\'\2\u0b35\u0275\3\2\2\2\u0b36"+ + "\u0b38\5\u027e\u0138\2\u0b37\u0b36\3\2\2\2\u0b37\u0b38\3\2\2\2\u0b38\u0b3f"+ + "\3\2\2\2\u0b39\u0b3b\5\u027a\u0136\2\u0b3a\u0b3c\5\u027e\u0138\2\u0b3b"+ + "\u0b3a\3\2\2\2\u0b3b\u0b3c\3\2\2\2\u0b3c\u0b3e\3\2\2\2\u0b3d\u0b39\3\2"+ + "\2\2\u0b3e\u0b41\3\2\2\2\u0b3f\u0b3d\3\2\2\2\u0b3f\u0b40\3\2\2\2\u0b40"+ + "\u0277\3\2\2\2\u0b41\u0b3f\3\2\2\2\u0b42\u0b44\5\u027e\u0138\2\u0b43\u0b42"+ + "\3\2\2\2\u0b43\u0b44\3\2\2\2\u0b44\u0b46\3\2\2\2\u0b45\u0b47\5\u027a\u0136"+ + "\2\u0b46\u0b45\3\2\2\2\u0b47\u0b48\3\2\2\2\u0b48\u0b46\3\2\2\2\u0b48\u0b49"+ + "\3\2\2\2\u0b49\u0b4b\3\2\2\2\u0b4a\u0b4c\5\u027e\u0138\2\u0b4b\u0b4a\3"+ + "\2\2\2\u0b4b\u0b4c\3\2\2\2\u0b4c\u0279\3\2\2\2\u0b4d\u0b55\n&\2\2\u0b4e"+ + "\u0b55\5\u0236\u0114\2\u0b4f\u0b55\5\u0234\u0113\2\u0b50\u0b51\7^\2\2"+ + "\u0b51\u0b55\t\34\2\2\u0b52\u0b53\7&\2\2\u0b53\u0b55\5\u027c\u0137\2\u0b54"+ + "\u0b4d\3\2\2\2\u0b54\u0b4e\3\2\2\2\u0b54\u0b4f\3\2\2\2\u0b54\u0b50\3\2"+ + "\2\2\u0b54\u0b52\3\2\2\2\u0b55\u027b\3\2\2\2\u0b56\u0b57\6\u0137\23\2"+ + "\u0b57\u027d\3\2\2\2\u0b58\u0b6f\5\u0236\u0114\2\u0b59\u0b6f\5\u0280\u0139"+ + "\2\u0b5a\u0b5b\5\u0236\u0114\2\u0b5b\u0b5c\5\u0280\u0139\2\u0b5c\u0b5e"+ + "\3\2\2\2\u0b5d\u0b5a\3\2\2\2\u0b5e\u0b5f\3\2\2\2\u0b5f\u0b5d\3\2\2\2\u0b5f"+ + "\u0b60\3\2\2\2\u0b60\u0b62\3\2\2\2\u0b61\u0b63\5\u0236\u0114\2\u0b62\u0b61"+ + "\3\2\2\2\u0b62\u0b63\3\2\2\2\u0b63\u0b6f\3\2\2\2\u0b64\u0b65\5\u0280\u0139"+ + "\2\u0b65\u0b66\5\u0236\u0114\2\u0b66\u0b68\3\2\2\2\u0b67\u0b64\3\2\2\2"+ + "\u0b68\u0b69\3\2\2\2\u0b69\u0b67\3\2\2\2\u0b69\u0b6a\3\2\2\2\u0b6a\u0b6c"+ + "\3\2\2\2\u0b6b\u0b6d\5\u0280\u0139\2\u0b6c\u0b6b\3\2\2\2\u0b6c\u0b6d\3"+ + "\2\2\2\u0b6d\u0b6f\3\2\2\2\u0b6e\u0b58\3\2\2\2\u0b6e\u0b59\3\2\2\2\u0b6e"+ + "\u0b5d\3\2\2\2\u0b6e\u0b67\3\2\2\2\u0b6f\u027f\3\2\2\2\u0b70\u0b72\7@"+ + "\2\2\u0b71\u0b70\3\2\2\2\u0b72\u0b73\3\2\2\2\u0b73\u0b71\3\2\2\2\u0b73"+ + "\u0b74\3\2\2\2\u0b74\u0b7b\3\2\2\2\u0b75\u0b77\7@\2\2\u0b76\u0b75\3\2"+ + "\2\2\u0b76\u0b77\3\2\2\2\u0b77\u0b78\3\2\2\2\u0b78\u0b79\7/\2\2\u0b79"+ + "\u0b7b\5\u0282\u013a\2\u0b7a\u0b71\3\2\2\2\u0b7a\u0b76\3\2\2\2\u0b7b\u0281"+ + "\3\2\2\2\u0b7c\u0b7d\6\u013a\24\2\u0b7d\u0283\3\2\2\2\u0b7e\u0b7f\5\u0158"+ + "\u00a5\2\u0b7f\u0b80\5\u0158\u00a5\2\u0b80\u0b81\5\u0158\u00a5\2\u0b81"+ + "\u0b82\3\2\2\2\u0b82\u0b83\b\u013b!\2\u0b83\u0285\3\2\2\2\u0b84\u0b86"+ + "\5\u0288\u013d\2\u0b85\u0b84\3\2\2\2\u0b86\u0b87\3\2\2\2\u0b87\u0b85\3"+ + "\2\2\2\u0b87\u0b88\3\2\2\2\u0b88\u0287\3\2\2\2\u0b89\u0b90\n\34\2\2\u0b8a"+ + "\u0b8b\t\34\2\2\u0b8b\u0b90\n\34\2\2\u0b8c\u0b8d\t\34\2\2\u0b8d\u0b8e"+ + "\t\34\2\2\u0b8e\u0b90\n\34\2\2\u0b8f\u0b89\3\2\2\2\u0b8f\u0b8a\3\2\2\2"+ + "\u0b8f\u0b8c\3\2\2\2\u0b90\u0289\3\2\2\2\u0b91\u0b92\5\u0158\u00a5\2\u0b92"+ + "\u0b93\5\u0158\u00a5\2\u0b93\u0b94\3\2\2\2\u0b94\u0b95\b\u013e!\2\u0b95"+ + "\u028b\3\2\2\2\u0b96\u0b98\5\u028e\u0140\2\u0b97\u0b96\3\2\2\2\u0b98\u0b99"+ + "\3\2\2\2\u0b99\u0b97\3\2\2\2\u0b99\u0b9a\3\2\2\2\u0b9a\u028d\3\2\2\2\u0b9b"+ + "\u0b9f\n\34\2\2\u0b9c\u0b9d\t\34\2\2\u0b9d\u0b9f\n\34\2\2\u0b9e\u0b9b"+ + "\3\2\2\2\u0b9e\u0b9c\3\2\2\2\u0b9f\u028f\3\2\2\2\u0ba0\u0ba1\5\u0158\u00a5"+ + "\2\u0ba1\u0ba2\3\2\2\2\u0ba2\u0ba3\b\u0141!\2\u0ba3\u0291\3\2\2\2\u0ba4"+ + "\u0ba6\5\u0294\u0143\2\u0ba5\u0ba4\3\2\2\2\u0ba6\u0ba7\3\2\2\2\u0ba7\u0ba5"+ + "\3\2\2\2\u0ba7\u0ba8\3\2\2\2\u0ba8\u0293\3\2\2\2\u0ba9\u0baa\n\34\2\2"+ + "\u0baa\u0295\3\2\2\2\u0bab\u0bac\7b\2\2\u0bac\u0bad\b\u0144*\2\u0bad\u0bae"+ + "\3\2\2\2\u0bae\u0baf\b\u0144!\2\u0baf\u0297\3\2\2\2\u0bb0\u0bb2\5\u029a"+ + "\u0146\2\u0bb1\u0bb0\3\2\2\2\u0bb1\u0bb2\3\2\2\2\u0bb2\u0bb3\3\2\2\2\u0bb3"+ + "\u0bb4\5\u022a\u010e\2\u0bb4\u0bb5\3\2\2\2\u0bb5\u0bb6\b\u0145\'\2\u0bb6"+ + "\u0299\3\2\2\2\u0bb7\u0bb9\5\u029e\u0148\2\u0bb8\u0bb7\3\2\2\2\u0bb9\u0bba"+ + "\3\2\2\2\u0bba\u0bb8\3\2\2\2\u0bba\u0bbb\3\2\2\2\u0bbb\u0bbf\3\2\2\2\u0bbc"+ + "\u0bbe\5\u029c\u0147\2\u0bbd\u0bbc\3\2\2\2\u0bbe\u0bc1\3\2\2\2\u0bbf\u0bbd"+ + "\3\2\2\2\u0bbf\u0bc0\3\2\2\2\u0bc0\u0bc8\3\2\2\2\u0bc1\u0bbf\3\2\2\2\u0bc2"+ + "\u0bc4\5\u029c\u0147\2\u0bc3\u0bc2\3\2\2\2\u0bc4\u0bc5\3\2\2\2\u0bc5\u0bc3"+ + "\3\2\2\2\u0bc5\u0bc6\3\2\2\2\u0bc6\u0bc8\3\2\2\2\u0bc7\u0bb8\3\2\2\2\u0bc7"+ + "\u0bc3\3\2\2\2\u0bc8\u029b\3\2\2\2\u0bc9\u0bca\7&\2\2\u0bca\u029d\3\2"+ + "\2\2\u0bcb\u0bd6\n\'\2\2\u0bcc\u0bce\5\u029c\u0147\2\u0bcd\u0bcc\3\2\2"+ + "\2\u0bce\u0bcf\3\2\2\2\u0bcf\u0bcd\3\2\2\2\u0bcf\u0bd0\3\2\2\2\u0bd0\u0bd1"+ + "\3\2\2\2\u0bd1\u0bd2\n(\2\2\u0bd2\u0bd6\3\2\2\2\u0bd3\u0bd6\5\u01e6\u00ec"+ + "\2\u0bd4\u0bd6\5\u02a0\u0149\2\u0bd5\u0bcb\3\2\2\2\u0bd5\u0bcd\3\2\2\2"+ + "\u0bd5\u0bd3\3\2\2\2\u0bd5\u0bd4\3\2\2\2\u0bd6\u029f\3\2\2\2\u0bd7\u0bd9"+ + "\5\u029c\u0147\2\u0bd8\u0bd7\3\2\2\2\u0bd9\u0bdc\3\2\2\2\u0bda\u0bd8\3"+ + "\2\2\2\u0bda\u0bdb\3\2\2\2\u0bdb\u0bdd\3\2\2\2\u0bdc\u0bda\3\2\2\2\u0bdd"+ + "\u0bde\7^\2\2\u0bde\u0bdf\t)\2\2\u0bdf\u02a1\3\2\2\2\u00cf\2\3\4\5\6\7"+ + "\b\t\n\13\f\r\16\17\20\21\u06bc\u06be\u06c3\u06c7\u06d6\u06df\u06e4\u06ee"+ + "\u06f2\u06f5\u06f7\u0703\u0713\u0715\u0725\u0729\u0730\u0734\u0739\u074c"+ + "\u0753\u0759\u0761\u0768\u0777\u077e\u0782\u0787\u078f\u0796\u079d\u07a4"+ + "\u07ac\u07b3\u07ba\u07c1\u07c9\u07d0\u07d7\u07de\u07e3\u07f0\u07f6\u07fd"+ + "\u0802\u0806\u080a\u0816\u081c\u0822\u0828\u0834\u083e\u0844\u084a\u0851"+ + "\u0857\u085e\u0865\u086d\u0874\u087e\u089b\u089f\u08a1\u08b6\u08bb\u08cb"+ + "\u08d2\u08e0\u08e2\u08e6\u08ec\u08ee\u08f2\u08f6\u08fb\u08fd\u08ff\u0909"+ + "\u090b\u090f\u0916\u0918\u091c\u0920\u0926\u0928\u092a\u0939\u093b\u093f"+ + "\u094a\u094c\u0950\u0954\u095e\u0960\u0962\u097e\u098c\u0991\u09a2\u09ad"+ + "\u09b1\u09b5\u09b8\u09c9\u09d9\u09e2\u09eb\u09f0\u0a05\u0a08\u0a0e\u0a13"+ + "\u0a19\u0a20\u0a25\u0a2b\u0a32\u0a37\u0a3d\u0a44\u0a49\u0a4f\u0a56\u0a5f"+ + "\u0a62\u0a84\u0a93\u0a96\u0a9d\u0aa4\u0aa8\u0aac\u0ab1\u0ab5\u0ab8\u0abd"+ + "\u0ac4\u0acb\u0acf\u0ad3\u0ad8\u0adc\u0adf\u0ae3\u0af2\u0af6\u0afa\u0aff"+ + "\u0b08\u0b0b\u0b12\u0b15\u0b17\u0b1c\u0b21\u0b27\u0b29\u0b37\u0b3b\u0b3f"+ + "\u0b43\u0b48\u0b4b\u0b54\u0b5f\u0b62\u0b69\u0b6c\u0b6e\u0b73\u0b76\u0b7a"+ + "\u0b87\u0b8f\u0b99\u0b9e\u0ba7\u0bb1\u0bba\u0bbf\u0bc5\u0bc7\u0bcf\u0bd5"+ + "\u0bda+\3\34\2\3\36\3\3%\4\3\'\5\3)\6\3*\7\3+\b\3-\t\3\64\n\3\65\13\3"+ "\66\f\3\67\r\38\16\39\17\3:\20\3;\21\3<\22\3=\23\3>\24\3?\25\3\u0084\26"+ - "\3\u00e6\27\7\b\2\3\u00e7\30\7\21\2\7\3\2\7\4\2\2\3\2\7\5\2\7\6\2\7\7"+ - "\2\6\2\2\7\r\2\b\2\2\7\t\2\7\f\2\3\u010c\31\7\2\2\7\n\2\7\13\2\3\u0143"+ + "\3\u00e7\27\7\b\2\3\u00e8\30\7\21\2\7\3\2\7\4\2\2\3\2\7\5\2\7\6\2\7\7"+ + "\2\6\2\2\7\r\2\b\2\2\7\t\2\7\f\2\3\u010d\31\7\2\2\7\n\2\7\13\2\3\u0144"+ "\32"; public static final String _serializedATN = Utils.join( new String[] { diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.tokens b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.tokens index 935c5fadafc6..b546cef24915 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.tokens +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.tokens @@ -183,81 +183,82 @@ DecimalIntegerLiteral=182 HexIntegerLiteral=183 HexadecimalFloatingPointLiteral=184 DecimalFloatingPointNumber=185 -BooleanLiteral=186 -QuotedStringLiteral=187 -Base16BlobLiteral=188 -Base64BlobLiteral=189 -NullLiteral=190 -Identifier=191 -XMLLiteralStart=192 -StringTemplateLiteralStart=193 -DocumentationLineStart=194 -ParameterDocumentationStart=195 -ReturnParameterDocumentationStart=196 -WS=197 -NEW_LINE=198 -LINE_COMMENT=199 -VARIABLE=200 -MODULE=201 -ReferenceType=202 -DocumentationText=203 -SingleBacktickStart=204 -DoubleBacktickStart=205 -TripleBacktickStart=206 -DefinitionReference=207 -DocumentationEscapedCharacters=208 -DocumentationSpace=209 -DocumentationEnd=210 -ParameterName=211 -DescriptionSeparator=212 -DocumentationParamEnd=213 -SingleBacktickContent=214 -SingleBacktickEnd=215 -DoubleBacktickContent=216 -DoubleBacktickEnd=217 -TripleBacktickContent=218 -TripleBacktickEnd=219 -XML_COMMENT_START=220 -CDATA=221 -DTD=222 -EntityRef=223 -CharRef=224 -XML_TAG_OPEN=225 -XML_TAG_OPEN_SLASH=226 -XML_TAG_SPECIAL_OPEN=227 -XMLLiteralEnd=228 -XMLTemplateText=229 -XMLText=230 -XML_TAG_CLOSE=231 -XML_TAG_SPECIAL_CLOSE=232 -XML_TAG_SLASH_CLOSE=233 -SLASH=234 -QNAME_SEPARATOR=235 -EQUALS=236 -DOUBLE_QUOTE=237 -SINGLE_QUOTE=238 -XMLQName=239 -XML_TAG_WS=240 -DOUBLE_QUOTE_END=241 -XMLDoubleQuotedTemplateString=242 -XMLDoubleQuotedString=243 -SINGLE_QUOTE_END=244 -XMLSingleQuotedTemplateString=245 -XMLSingleQuotedString=246 -XMLPIText=247 -XMLPITemplateText=248 -XML_COMMENT_END=249 -XMLCommentTemplateText=250 -XMLCommentText=251 -TripleBackTickInlineCodeEnd=252 -TripleBackTickInlineCode=253 -DoubleBackTickInlineCodeEnd=254 -DoubleBackTickInlineCode=255 -SingleBackTickInlineCodeEnd=256 -SingleBackTickInlineCode=257 -StringTemplateLiteralEnd=258 -StringTemplateExpressionStart=259 -StringTemplateText=260 +DecimalExtendedFloatingPointNumber=186 +BooleanLiteral=187 +QuotedStringLiteral=188 +Base16BlobLiteral=189 +Base64BlobLiteral=190 +NullLiteral=191 +Identifier=192 +XMLLiteralStart=193 +StringTemplateLiteralStart=194 +DocumentationLineStart=195 +ParameterDocumentationStart=196 +ReturnParameterDocumentationStart=197 +WS=198 +NEW_LINE=199 +LINE_COMMENT=200 +VARIABLE=201 +MODULE=202 +ReferenceType=203 +DocumentationText=204 +SingleBacktickStart=205 +DoubleBacktickStart=206 +TripleBacktickStart=207 +DefinitionReference=208 +DocumentationEscapedCharacters=209 +DocumentationSpace=210 +DocumentationEnd=211 +ParameterName=212 +DescriptionSeparator=213 +DocumentationParamEnd=214 +SingleBacktickContent=215 +SingleBacktickEnd=216 +DoubleBacktickContent=217 +DoubleBacktickEnd=218 +TripleBacktickContent=219 +TripleBacktickEnd=220 +XML_COMMENT_START=221 +CDATA=222 +DTD=223 +EntityRef=224 +CharRef=225 +XML_TAG_OPEN=226 +XML_TAG_OPEN_SLASH=227 +XML_TAG_SPECIAL_OPEN=228 +XMLLiteralEnd=229 +XMLTemplateText=230 +XMLText=231 +XML_TAG_CLOSE=232 +XML_TAG_SPECIAL_CLOSE=233 +XML_TAG_SLASH_CLOSE=234 +SLASH=235 +QNAME_SEPARATOR=236 +EQUALS=237 +DOUBLE_QUOTE=238 +SINGLE_QUOTE=239 +XMLQName=240 +XML_TAG_WS=241 +DOUBLE_QUOTE_END=242 +XMLDoubleQuotedTemplateString=243 +XMLDoubleQuotedString=244 +SINGLE_QUOTE_END=245 +XMLSingleQuotedTemplateString=246 +XMLSingleQuotedString=247 +XMLPIText=248 +XMLPITemplateText=249 +XML_COMMENT_END=250 +XMLCommentTemplateText=251 +XMLCommentText=252 +TripleBackTickInlineCodeEnd=253 +TripleBackTickInlineCode=254 +DoubleBackTickInlineCodeEnd=255 +DoubleBackTickInlineCode=256 +SingleBackTickInlineCodeEnd=257 +SingleBackTickInlineCode=258 +StringTemplateLiteralEnd=259 +StringTemplateExpressionStart=260 +StringTemplateText=261 'import'=1 'as'=2 'public'=3 @@ -422,13 +423,13 @@ StringTemplateText=260 '>>>='=179 '..<'=180 '.@'=181 -'null'=190 -'variable'=200 -'module'=201 -''=249 +'null'=191 +'variable'=201 +'module'=202 +''=250 diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java index d6aa1c974676..bc4409d6ad97 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java @@ -1,4 +1,4 @@ -// Generated from BallerinaParser.g4 by ANTLR 4.5.3 +// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; @@ -48,112 +48,113 @@ public class BallerinaParser extends Parser { COMPOUND_BIT_AND=174, COMPOUND_BIT_OR=175, COMPOUND_BIT_XOR=176, COMPOUND_LEFT_SHIFT=177, COMPOUND_RIGHT_SHIFT=178, COMPOUND_LOGICAL_SHIFT=179, HALF_OPEN_RANGE=180, ANNOTATION_ACCESS=181, DecimalIntegerLiteral=182, HexIntegerLiteral=183, - HexadecimalFloatingPointLiteral=184, DecimalFloatingPointNumber=185, BooleanLiteral=186, - QuotedStringLiteral=187, Base16BlobLiteral=188, Base64BlobLiteral=189, - NullLiteral=190, Identifier=191, XMLLiteralStart=192, StringTemplateLiteralStart=193, - DocumentationLineStart=194, ParameterDocumentationStart=195, ReturnParameterDocumentationStart=196, - WS=197, NEW_LINE=198, LINE_COMMENT=199, VARIABLE=200, MODULE=201, ReferenceType=202, - DocumentationText=203, SingleBacktickStart=204, DoubleBacktickStart=205, - TripleBacktickStart=206, DefinitionReference=207, DocumentationEscapedCharacters=208, - DocumentationSpace=209, DocumentationEnd=210, ParameterName=211, DescriptionSeparator=212, - DocumentationParamEnd=213, SingleBacktickContent=214, SingleBacktickEnd=215, - DoubleBacktickContent=216, DoubleBacktickEnd=217, TripleBacktickContent=218, - TripleBacktickEnd=219, XML_COMMENT_START=220, CDATA=221, DTD=222, EntityRef=223, - CharRef=224, XML_TAG_OPEN=225, XML_TAG_OPEN_SLASH=226, XML_TAG_SPECIAL_OPEN=227, - XMLLiteralEnd=228, XMLTemplateText=229, XMLText=230, XML_TAG_CLOSE=231, - XML_TAG_SPECIAL_CLOSE=232, XML_TAG_SLASH_CLOSE=233, SLASH=234, QNAME_SEPARATOR=235, - EQUALS=236, DOUBLE_QUOTE=237, SINGLE_QUOTE=238, XMLQName=239, XML_TAG_WS=240, - DOUBLE_QUOTE_END=241, XMLDoubleQuotedTemplateString=242, XMLDoubleQuotedString=243, - SINGLE_QUOTE_END=244, XMLSingleQuotedTemplateString=245, XMLSingleQuotedString=246, - XMLPIText=247, XMLPITemplateText=248, XML_COMMENT_END=249, XMLCommentTemplateText=250, - XMLCommentText=251, TripleBackTickInlineCodeEnd=252, TripleBackTickInlineCode=253, - DoubleBackTickInlineCodeEnd=254, DoubleBackTickInlineCode=255, SingleBackTickInlineCodeEnd=256, - SingleBackTickInlineCode=257, StringTemplateLiteralEnd=258, StringTemplateExpressionStart=259, - StringTemplateText=260; + HexadecimalFloatingPointLiteral=184, DecimalFloatingPointNumber=185, DecimalExtendedFloatingPointNumber=186, + BooleanLiteral=187, QuotedStringLiteral=188, Base16BlobLiteral=189, Base64BlobLiteral=190, + NullLiteral=191, Identifier=192, XMLLiteralStart=193, StringTemplateLiteralStart=194, + DocumentationLineStart=195, ParameterDocumentationStart=196, ReturnParameterDocumentationStart=197, + WS=198, NEW_LINE=199, LINE_COMMENT=200, VARIABLE=201, MODULE=202, ReferenceType=203, + DocumentationText=204, SingleBacktickStart=205, DoubleBacktickStart=206, + TripleBacktickStart=207, DefinitionReference=208, DocumentationEscapedCharacters=209, + DocumentationSpace=210, DocumentationEnd=211, ParameterName=212, DescriptionSeparator=213, + DocumentationParamEnd=214, SingleBacktickContent=215, SingleBacktickEnd=216, + DoubleBacktickContent=217, DoubleBacktickEnd=218, TripleBacktickContent=219, + TripleBacktickEnd=220, XML_COMMENT_START=221, CDATA=222, DTD=223, EntityRef=224, + CharRef=225, XML_TAG_OPEN=226, XML_TAG_OPEN_SLASH=227, XML_TAG_SPECIAL_OPEN=228, + XMLLiteralEnd=229, XMLTemplateText=230, XMLText=231, XML_TAG_CLOSE=232, + XML_TAG_SPECIAL_CLOSE=233, XML_TAG_SLASH_CLOSE=234, SLASH=235, QNAME_SEPARATOR=236, + EQUALS=237, DOUBLE_QUOTE=238, SINGLE_QUOTE=239, XMLQName=240, XML_TAG_WS=241, + DOUBLE_QUOTE_END=242, XMLDoubleQuotedTemplateString=243, XMLDoubleQuotedString=244, + SINGLE_QUOTE_END=245, XMLSingleQuotedTemplateString=246, XMLSingleQuotedString=247, + XMLPIText=248, XMLPITemplateText=249, XML_COMMENT_END=250, XMLCommentTemplateText=251, + XMLCommentText=252, TripleBackTickInlineCodeEnd=253, TripleBackTickInlineCode=254, + DoubleBackTickInlineCodeEnd=255, DoubleBackTickInlineCode=256, SingleBackTickInlineCodeEnd=257, + SingleBackTickInlineCode=258, StringTemplateLiteralEnd=259, StringTemplateExpressionStart=260, + StringTemplateText=261; public static final int - RULE_compilationUnit = 0, RULE_packageName = 1, RULE_version = 2, RULE_importDeclaration = 3, - RULE_orgName = 4, RULE_definition = 5, RULE_serviceDefinition = 6, RULE_serviceBody = 7, - RULE_callableUnitBody = 8, RULE_externalFunctionBody = 9, RULE_functionDefinition = 10, - RULE_lambdaFunction = 11, RULE_arrowFunction = 12, RULE_arrowParam = 13, - RULE_callableUnitSignature = 14, RULE_typeDefinition = 15, RULE_objectBody = 16, - RULE_typeReference = 17, RULE_objectFieldDefinition = 18, RULE_fieldDefinition = 19, - RULE_recordRestFieldDefinition = 20, RULE_sealedLiteral = 21, RULE_restDescriptorPredicate = 22, - RULE_objectFunctionDefinition = 23, RULE_annotationDefinition = 24, RULE_constantDefinition = 25, - RULE_globalVariableDefinition = 26, RULE_attachmentPoint = 27, RULE_dualAttachPoint = 28, - RULE_dualAttachPointIdent = 29, RULE_sourceOnlyAttachPoint = 30, RULE_sourceOnlyAttachPointIdent = 31, - RULE_workerDeclaration = 32, RULE_workerDefinition = 33, RULE_finiteType = 34, - RULE_finiteTypeUnit = 35, RULE_typeName = 36, RULE_inclusiveRecordTypeDescriptor = 37, - RULE_tupleTypeDescriptor = 38, RULE_tupleRestDescriptor = 39, RULE_exclusiveRecordTypeDescriptor = 40, - RULE_fieldDescriptor = 41, RULE_simpleTypeName = 42, RULE_referenceTypeName = 43, - RULE_userDefineTypeName = 44, RULE_valueTypeName = 45, RULE_builtInReferenceTypeName = 46, - RULE_functionTypeName = 47, RULE_errorTypeName = 48, RULE_xmlNamespaceName = 49, - RULE_xmlLocalName = 50, RULE_annotationAttachment = 51, RULE_statement = 52, - RULE_variableDefinitionStatement = 53, RULE_recordLiteral = 54, RULE_staticMatchLiterals = 55, - RULE_recordKeyValue = 56, RULE_recordKey = 57, RULE_tableLiteral = 58, - RULE_tableColumnDefinition = 59, RULE_tableColumn = 60, RULE_tableDataArray = 61, - RULE_tableDataList = 62, RULE_tableData = 63, RULE_listConstructorExpr = 64, - RULE_assignmentStatement = 65, RULE_listDestructuringStatement = 66, RULE_recordDestructuringStatement = 67, - RULE_errorDestructuringStatement = 68, RULE_compoundAssignmentStatement = 69, - RULE_compoundOperator = 70, RULE_variableReferenceList = 71, RULE_ifElseStatement = 72, - RULE_ifClause = 73, RULE_elseIfClause = 74, RULE_elseClause = 75, RULE_matchStatement = 76, - RULE_matchPatternClause = 77, RULE_bindingPattern = 78, RULE_structuredBindingPattern = 79, - RULE_errorBindingPattern = 80, RULE_errorFieldBindingPatterns = 81, RULE_errorMatchPattern = 82, - RULE_errorArgListMatchPattern = 83, RULE_errorFieldMatchPatterns = 84, - RULE_errorRestBindingPattern = 85, RULE_restMatchPattern = 86, RULE_simpleMatchPattern = 87, - RULE_errorDetailBindingPattern = 88, RULE_listBindingPattern = 89, RULE_recordBindingPattern = 90, - RULE_entryBindingPattern = 91, RULE_fieldBindingPattern = 92, RULE_restBindingPattern = 93, - RULE_bindingRefPattern = 94, RULE_structuredRefBindingPattern = 95, RULE_listRefBindingPattern = 96, - RULE_listRefRestPattern = 97, RULE_recordRefBindingPattern = 98, RULE_errorRefBindingPattern = 99, - RULE_errorNamedArgRefPattern = 100, RULE_errorRefRestPattern = 101, RULE_entryRefBindingPattern = 102, - RULE_fieldRefBindingPattern = 103, RULE_restRefBindingPattern = 104, RULE_foreachStatement = 105, - RULE_intRangeExpression = 106, RULE_whileStatement = 107, RULE_continueStatement = 108, - RULE_breakStatement = 109, RULE_forkJoinStatement = 110, RULE_tryCatchStatement = 111, - RULE_catchClauses = 112, RULE_catchClause = 113, RULE_finallyClause = 114, - RULE_throwStatement = 115, RULE_panicStatement = 116, RULE_returnStatement = 117, - RULE_workerSendAsyncStatement = 118, RULE_peerWorker = 119, RULE_workerName = 120, - RULE_flushWorker = 121, RULE_waitForCollection = 122, RULE_waitKeyValue = 123, - RULE_variableReference = 124, RULE_field = 125, RULE_index = 126, RULE_xmlAttrib = 127, - RULE_functionInvocation = 128, RULE_invocation = 129, RULE_invocationArgList = 130, - RULE_invocationArg = 131, RULE_actionInvocation = 132, RULE_expressionList = 133, - RULE_expressionStmt = 134, RULE_transactionStatement = 135, RULE_committedAbortedClauses = 136, - RULE_transactionClause = 137, RULE_transactionPropertyInitStatement = 138, - RULE_transactionPropertyInitStatementList = 139, RULE_lockStatement = 140, - RULE_onretryClause = 141, RULE_committedClause = 142, RULE_abortedClause = 143, - RULE_abortStatement = 144, RULE_retryStatement = 145, RULE_retriesStatement = 146, - RULE_namespaceDeclarationStatement = 147, RULE_namespaceDeclaration = 148, - RULE_expression = 149, RULE_constantExpression = 150, RULE_typeDescExpr = 151, - RULE_typeInitExpr = 152, RULE_serviceConstructorExpr = 153, RULE_trapExpr = 154, - RULE_shiftExpression = 155, RULE_shiftExprPredicate = 156, RULE_nameReference = 157, - RULE_functionNameReference = 158, RULE_returnParameter = 159, RULE_lambdaReturnParameter = 160, - RULE_parameterTypeNameList = 161, RULE_parameterTypeName = 162, RULE_parameterList = 163, - RULE_parameter = 164, RULE_defaultableParameter = 165, RULE_restParameter = 166, - RULE_formalParameterList = 167, RULE_simpleLiteral = 168, RULE_floatingPointLiteral = 169, - RULE_integerLiteral = 170, RULE_nilLiteral = 171, RULE_blobLiteral = 172, - RULE_namedArgs = 173, RULE_restArgs = 174, RULE_xmlLiteral = 175, RULE_xmlItem = 176, - RULE_content = 177, RULE_comment = 178, RULE_element = 179, RULE_startTag = 180, - RULE_closeTag = 181, RULE_emptyTag = 182, RULE_procIns = 183, RULE_attribute = 184, - RULE_text = 185, RULE_xmlQuotedString = 186, RULE_xmlSingleQuotedString = 187, - RULE_xmlDoubleQuotedString = 188, RULE_xmlQualifiedName = 189, RULE_stringTemplateLiteral = 190, - RULE_stringTemplateContent = 191, RULE_anyIdentifierName = 192, RULE_reservedWord = 193, - RULE_tableQuery = 194, RULE_foreverStatement = 195, RULE_streamingQueryStatement = 196, - RULE_patternClause = 197, RULE_withinClause = 198, RULE_orderByClause = 199, - RULE_orderByVariable = 200, RULE_limitClause = 201, RULE_selectClause = 202, - RULE_selectExpressionList = 203, RULE_selectExpression = 204, RULE_groupByClause = 205, - RULE_havingClause = 206, RULE_streamingAction = 207, RULE_streamingInput = 208, - RULE_joinStreamingInput = 209, RULE_outputRateLimit = 210, RULE_patternStreamingInput = 211, - RULE_patternStreamingEdgeInput = 212, RULE_whereClause = 213, RULE_windowClause = 214, - RULE_orderByType = 215, RULE_joinType = 216, RULE_timeScale = 217, RULE_documentationString = 218, - RULE_documentationLine = 219, RULE_parameterDocumentationLine = 220, RULE_returnParameterDocumentationLine = 221, - RULE_documentationContent = 222, RULE_parameterDescriptionLine = 223, - RULE_returnParameterDescriptionLine = 224, RULE_documentationText = 225, - RULE_documentationReference = 226, RULE_definitionReference = 227, RULE_definitionReferenceType = 228, - RULE_parameterDocumentation = 229, RULE_returnParameterDocumentation = 230, - RULE_docParameterName = 231, RULE_singleBacktickedBlock = 232, RULE_singleBacktickedContent = 233, - RULE_doubleBacktickedBlock = 234, RULE_doubleBacktickedContent = 235, - RULE_tripleBacktickedBlock = 236, RULE_tripleBacktickedContent = 237; + RULE_compilationUnit = 0, RULE_packageName = 1, RULE_version = 2, RULE_versionPattern = 3, + RULE_importDeclaration = 4, RULE_orgName = 5, RULE_definition = 6, RULE_serviceDefinition = 7, + RULE_serviceBody = 8, RULE_callableUnitBody = 9, RULE_externalFunctionBody = 10, + RULE_functionDefinition = 11, RULE_lambdaFunction = 12, RULE_arrowFunction = 13, + RULE_arrowParam = 14, RULE_callableUnitSignature = 15, RULE_typeDefinition = 16, + RULE_objectBody = 17, RULE_typeReference = 18, RULE_objectFieldDefinition = 19, + RULE_fieldDefinition = 20, RULE_recordRestFieldDefinition = 21, RULE_sealedLiteral = 22, + RULE_restDescriptorPredicate = 23, RULE_objectFunctionDefinition = 24, + RULE_annotationDefinition = 25, RULE_constantDefinition = 26, RULE_globalVariableDefinition = 27, + RULE_attachmentPoint = 28, RULE_dualAttachPoint = 29, RULE_dualAttachPointIdent = 30, + RULE_sourceOnlyAttachPoint = 31, RULE_sourceOnlyAttachPointIdent = 32, + RULE_workerDeclaration = 33, RULE_workerDefinition = 34, RULE_finiteType = 35, + RULE_finiteTypeUnit = 36, RULE_typeName = 37, RULE_inclusiveRecordTypeDescriptor = 38, + RULE_tupleTypeDescriptor = 39, RULE_tupleRestDescriptor = 40, RULE_exclusiveRecordTypeDescriptor = 41, + RULE_fieldDescriptor = 42, RULE_simpleTypeName = 43, RULE_referenceTypeName = 44, + RULE_userDefineTypeName = 45, RULE_valueTypeName = 46, RULE_builtInReferenceTypeName = 47, + RULE_functionTypeName = 48, RULE_errorTypeName = 49, RULE_xmlNamespaceName = 50, + RULE_xmlLocalName = 51, RULE_annotationAttachment = 52, RULE_statement = 53, + RULE_variableDefinitionStatement = 54, RULE_recordLiteral = 55, RULE_staticMatchLiterals = 56, + RULE_recordKeyValue = 57, RULE_recordKey = 58, RULE_tableLiteral = 59, + RULE_tableColumnDefinition = 60, RULE_tableColumn = 61, RULE_tableDataArray = 62, + RULE_tableDataList = 63, RULE_tableData = 64, RULE_listConstructorExpr = 65, + RULE_assignmentStatement = 66, RULE_listDestructuringStatement = 67, RULE_recordDestructuringStatement = 68, + RULE_errorDestructuringStatement = 69, RULE_compoundAssignmentStatement = 70, + RULE_compoundOperator = 71, RULE_variableReferenceList = 72, RULE_ifElseStatement = 73, + RULE_ifClause = 74, RULE_elseIfClause = 75, RULE_elseClause = 76, RULE_matchStatement = 77, + RULE_matchPatternClause = 78, RULE_bindingPattern = 79, RULE_structuredBindingPattern = 80, + RULE_errorBindingPattern = 81, RULE_errorFieldBindingPatterns = 82, RULE_errorMatchPattern = 83, + RULE_errorArgListMatchPattern = 84, RULE_errorFieldMatchPatterns = 85, + RULE_errorRestBindingPattern = 86, RULE_restMatchPattern = 87, RULE_simpleMatchPattern = 88, + RULE_errorDetailBindingPattern = 89, RULE_listBindingPattern = 90, RULE_recordBindingPattern = 91, + RULE_entryBindingPattern = 92, RULE_fieldBindingPattern = 93, RULE_restBindingPattern = 94, + RULE_bindingRefPattern = 95, RULE_structuredRefBindingPattern = 96, RULE_listRefBindingPattern = 97, + RULE_listRefRestPattern = 98, RULE_recordRefBindingPattern = 99, RULE_errorRefBindingPattern = 100, + RULE_errorNamedArgRefPattern = 101, RULE_errorRefRestPattern = 102, RULE_entryRefBindingPattern = 103, + RULE_fieldRefBindingPattern = 104, RULE_restRefBindingPattern = 105, RULE_foreachStatement = 106, + RULE_intRangeExpression = 107, RULE_whileStatement = 108, RULE_continueStatement = 109, + RULE_breakStatement = 110, RULE_forkJoinStatement = 111, RULE_tryCatchStatement = 112, + RULE_catchClauses = 113, RULE_catchClause = 114, RULE_finallyClause = 115, + RULE_throwStatement = 116, RULE_panicStatement = 117, RULE_returnStatement = 118, + RULE_workerSendAsyncStatement = 119, RULE_peerWorker = 120, RULE_workerName = 121, + RULE_flushWorker = 122, RULE_waitForCollection = 123, RULE_waitKeyValue = 124, + RULE_variableReference = 125, RULE_field = 126, RULE_index = 127, RULE_xmlAttrib = 128, + RULE_functionInvocation = 129, RULE_invocation = 130, RULE_invocationArgList = 131, + RULE_invocationArg = 132, RULE_actionInvocation = 133, RULE_expressionList = 134, + RULE_expressionStmt = 135, RULE_transactionStatement = 136, RULE_committedAbortedClauses = 137, + RULE_transactionClause = 138, RULE_transactionPropertyInitStatement = 139, + RULE_transactionPropertyInitStatementList = 140, RULE_lockStatement = 141, + RULE_onretryClause = 142, RULE_committedClause = 143, RULE_abortedClause = 144, + RULE_abortStatement = 145, RULE_retryStatement = 146, RULE_retriesStatement = 147, + RULE_namespaceDeclarationStatement = 148, RULE_namespaceDeclaration = 149, + RULE_expression = 150, RULE_constantExpression = 151, RULE_typeDescExpr = 152, + RULE_typeInitExpr = 153, RULE_serviceConstructorExpr = 154, RULE_trapExpr = 155, + RULE_shiftExpression = 156, RULE_shiftExprPredicate = 157, RULE_nameReference = 158, + RULE_functionNameReference = 159, RULE_returnParameter = 160, RULE_lambdaReturnParameter = 161, + RULE_parameterTypeNameList = 162, RULE_parameterTypeName = 163, RULE_parameterList = 164, + RULE_parameter = 165, RULE_defaultableParameter = 166, RULE_restParameter = 167, + RULE_formalParameterList = 168, RULE_simpleLiteral = 169, RULE_floatingPointLiteral = 170, + RULE_integerLiteral = 171, RULE_nilLiteral = 172, RULE_blobLiteral = 173, + RULE_namedArgs = 174, RULE_restArgs = 175, RULE_xmlLiteral = 176, RULE_xmlItem = 177, + RULE_content = 178, RULE_comment = 179, RULE_element = 180, RULE_startTag = 181, + RULE_closeTag = 182, RULE_emptyTag = 183, RULE_procIns = 184, RULE_attribute = 185, + RULE_text = 186, RULE_xmlQuotedString = 187, RULE_xmlSingleQuotedString = 188, + RULE_xmlDoubleQuotedString = 189, RULE_xmlQualifiedName = 190, RULE_stringTemplateLiteral = 191, + RULE_stringTemplateContent = 192, RULE_anyIdentifierName = 193, RULE_reservedWord = 194, + RULE_tableQuery = 195, RULE_foreverStatement = 196, RULE_streamingQueryStatement = 197, + RULE_patternClause = 198, RULE_withinClause = 199, RULE_orderByClause = 200, + RULE_orderByVariable = 201, RULE_limitClause = 202, RULE_selectClause = 203, + RULE_selectExpressionList = 204, RULE_selectExpression = 205, RULE_groupByClause = 206, + RULE_havingClause = 207, RULE_streamingAction = 208, RULE_streamingInput = 209, + RULE_joinStreamingInput = 210, RULE_outputRateLimit = 211, RULE_patternStreamingInput = 212, + RULE_patternStreamingEdgeInput = 213, RULE_whereClause = 214, RULE_windowClause = 215, + RULE_orderByType = 216, RULE_joinType = 217, RULE_timeScale = 218, RULE_documentationString = 219, + RULE_documentationLine = 220, RULE_parameterDocumentationLine = 221, RULE_returnParameterDocumentationLine = 222, + RULE_documentationContent = 223, RULE_parameterDescriptionLine = 224, + RULE_returnParameterDescriptionLine = 225, RULE_documentationText = 226, + RULE_documentationReference = 227, RULE_definitionReference = 228, RULE_definitionReferenceType = 229, + RULE_parameterDocumentation = 230, RULE_returnParameterDocumentation = 231, + RULE_docParameterName = 232, RULE_singleBacktickedBlock = 233, RULE_singleBacktickedContent = 234, + RULE_doubleBacktickedBlock = 235, RULE_doubleBacktickedContent = 236, + RULE_tripleBacktickedBlock = 237, RULE_tripleBacktickedContent = 238; public static final String[] ruleNames = { - "compilationUnit", "packageName", "version", "importDeclaration", "orgName", - "definition", "serviceDefinition", "serviceBody", "callableUnitBody", + "compilationUnit", "packageName", "version", "versionPattern", "importDeclaration", + "orgName", "definition", "serviceDefinition", "serviceBody", "callableUnitBody", "externalFunctionBody", "functionDefinition", "lambdaFunction", "arrowFunction", "arrowParam", "callableUnitSignature", "typeDefinition", "objectBody", "typeReference", "objectFieldDefinition", "fieldDefinition", "recordRestFieldDefinition", @@ -242,13 +243,13 @@ public class BallerinaParser extends Parser { "'&&'", "'||'", "'==='", "'!=='", "'&'", "'^'", "'~'", "'->'", "'<-'", "'@'", "'`'", "'..'", "'...'", "'|'", "'=>'", "'?:'", "'->>'", "'+='", "'-='", "'*='", "'/='", "'&='", "'|='", "'^='", "'<<='", "'>>='", "'>>>='", - "'..<'", "'.@'", null, null, null, null, null, null, null, null, "'null'", - null, null, null, null, null, null, null, null, null, "'variable'", "'module'", - null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, null, null, "''" + "'..<'", "'.@'", null, null, null, null, null, null, null, null, null, + "'null'", null, null, null, null, null, null, null, null, null, "'variable'", + "'module'", null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, "''" }; private static final String[] _SYMBOLIC_NAMES = { null, "IMPORT", "AS", "PUBLIC", "PRIVATE", "EXTERNAL", "FINAL", "SERVICE", @@ -278,26 +279,27 @@ public class BallerinaParser extends Parser { "COMPOUND_SUB", "COMPOUND_MUL", "COMPOUND_DIV", "COMPOUND_BIT_AND", "COMPOUND_BIT_OR", "COMPOUND_BIT_XOR", "COMPOUND_LEFT_SHIFT", "COMPOUND_RIGHT_SHIFT", "COMPOUND_LOGICAL_SHIFT", "HALF_OPEN_RANGE", "ANNOTATION_ACCESS", "DecimalIntegerLiteral", "HexIntegerLiteral", - "HexadecimalFloatingPointLiteral", "DecimalFloatingPointNumber", "BooleanLiteral", - "QuotedStringLiteral", "Base16BlobLiteral", "Base64BlobLiteral", "NullLiteral", - "Identifier", "XMLLiteralStart", "StringTemplateLiteralStart", "DocumentationLineStart", - "ParameterDocumentationStart", "ReturnParameterDocumentationStart", "WS", - "NEW_LINE", "LINE_COMMENT", "VARIABLE", "MODULE", "ReferenceType", "DocumentationText", - "SingleBacktickStart", "DoubleBacktickStart", "TripleBacktickStart", "DefinitionReference", - "DocumentationEscapedCharacters", "DocumentationSpace", "DocumentationEnd", - "ParameterName", "DescriptionSeparator", "DocumentationParamEnd", "SingleBacktickContent", - "SingleBacktickEnd", "DoubleBacktickContent", "DoubleBacktickEnd", "TripleBacktickContent", - "TripleBacktickEnd", "XML_COMMENT_START", "CDATA", "DTD", "EntityRef", - "CharRef", "XML_TAG_OPEN", "XML_TAG_OPEN_SLASH", "XML_TAG_SPECIAL_OPEN", - "XMLLiteralEnd", "XMLTemplateText", "XMLText", "XML_TAG_CLOSE", "XML_TAG_SPECIAL_CLOSE", - "XML_TAG_SLASH_CLOSE", "SLASH", "QNAME_SEPARATOR", "EQUALS", "DOUBLE_QUOTE", - "SINGLE_QUOTE", "XMLQName", "XML_TAG_WS", "DOUBLE_QUOTE_END", "XMLDoubleQuotedTemplateString", - "XMLDoubleQuotedString", "SINGLE_QUOTE_END", "XMLSingleQuotedTemplateString", - "XMLSingleQuotedString", "XMLPIText", "XMLPITemplateText", "XML_COMMENT_END", - "XMLCommentTemplateText", "XMLCommentText", "TripleBackTickInlineCodeEnd", - "TripleBackTickInlineCode", "DoubleBackTickInlineCodeEnd", "DoubleBackTickInlineCode", - "SingleBackTickInlineCodeEnd", "SingleBackTickInlineCode", "StringTemplateLiteralEnd", - "StringTemplateExpressionStart", "StringTemplateText" + "HexadecimalFloatingPointLiteral", "DecimalFloatingPointNumber", "DecimalExtendedFloatingPointNumber", + "BooleanLiteral", "QuotedStringLiteral", "Base16BlobLiteral", "Base64BlobLiteral", + "NullLiteral", "Identifier", "XMLLiteralStart", "StringTemplateLiteralStart", + "DocumentationLineStart", "ParameterDocumentationStart", "ReturnParameterDocumentationStart", + "WS", "NEW_LINE", "LINE_COMMENT", "VARIABLE", "MODULE", "ReferenceType", + "DocumentationText", "SingleBacktickStart", "DoubleBacktickStart", "TripleBacktickStart", + "DefinitionReference", "DocumentationEscapedCharacters", "DocumentationSpace", + "DocumentationEnd", "ParameterName", "DescriptionSeparator", "DocumentationParamEnd", + "SingleBacktickContent", "SingleBacktickEnd", "DoubleBacktickContent", + "DoubleBacktickEnd", "TripleBacktickContent", "TripleBacktickEnd", "XML_COMMENT_START", + "CDATA", "DTD", "EntityRef", "CharRef", "XML_TAG_OPEN", "XML_TAG_OPEN_SLASH", + "XML_TAG_SPECIAL_OPEN", "XMLLiteralEnd", "XMLTemplateText", "XMLText", + "XML_TAG_CLOSE", "XML_TAG_SPECIAL_CLOSE", "XML_TAG_SLASH_CLOSE", "SLASH", + "QNAME_SEPARATOR", "EQUALS", "DOUBLE_QUOTE", "SINGLE_QUOTE", "XMLQName", + "XML_TAG_WS", "DOUBLE_QUOTE_END", "XMLDoubleQuotedTemplateString", "XMLDoubleQuotedString", + "SINGLE_QUOTE_END", "XMLSingleQuotedTemplateString", "XMLSingleQuotedString", + "XMLPIText", "XMLPITemplateText", "XML_COMMENT_END", "XMLCommentTemplateText", + "XMLCommentText", "TripleBackTickInlineCodeEnd", "TripleBackTickInlineCode", + "DoubleBackTickInlineCodeEnd", "DoubleBackTickInlineCode", "SingleBackTickInlineCodeEnd", + "SingleBackTickInlineCode", "StringTemplateLiteralEnd", "StringTemplateExpressionStart", + "StringTemplateText" }; public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); @@ -401,22 +403,22 @@ public final CompilationUnitContext compilationUnit() throws RecognitionExceptio try { enterOuterAlt(_localctx, 1); { - setState(480); + setState(482); _errHandler.sync(this); _la = _input.LA(1); while (_la==IMPORT || _la==XMLNS) { { - setState(478); + setState(480); switch (_input.LA(1)) { case IMPORT: { - setState(476); + setState(478); importDeclaration(); } break; case XMLNS: { - setState(477); + setState(479); namespaceDeclaration(); } break; @@ -424,48 +426,48 @@ public final CompilationUnitContext compilationUnit() throws RecognitionExceptio throw new NoViableAltException(this); } } - setState(482); + setState(484); _errHandler.sync(this); _la = _input.LA(1); } - setState(495); + setState(497); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PUBLIC) | (1L << PRIVATE) | (1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ANNOTATION) | (1L << LISTENER) | (1L << REMOTE) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << CONST))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (AT - 132)) | (1L << (Identifier - 132)) | (1L << (DocumentationLineStart - 132)))) != 0)) { { { - setState(484); + setState(486); _la = _input.LA(1); if (_la==DocumentationLineStart) { { - setState(483); + setState(485); documentationString(); } } - setState(489); + setState(491); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(486); + setState(488); annotationAttachment(); } } - setState(491); + setState(493); _errHandler.sync(this); _la = _input.LA(1); } - setState(492); + setState(494); definition(); } } - setState(497); + setState(499); _errHandler.sync(this); _la = _input.LA(1); } - setState(498); + setState(500); match(EOF); } } @@ -513,29 +515,29 @@ public final PackageNameContext packageName() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(500); + setState(502); match(Identifier); - setState(505); + setState(507); _errHandler.sync(this); _la = _input.LA(1); while (_la==DOT) { { { - setState(501); + setState(503); match(DOT); - setState(502); + setState(504); match(Identifier); } } - setState(507); + setState(509); _errHandler.sync(this); _la = _input.LA(1); } - setState(509); + setState(511); _la = _input.LA(1); if (_la==VERSION) { { - setState(508); + setState(510); version(); } } @@ -555,7 +557,9 @@ public final PackageNameContext packageName() throws RecognitionException { public static class VersionContext extends ParserRuleContext { public TerminalNode VERSION() { return getToken(BallerinaParser.VERSION, 0); } - public TerminalNode Identifier() { return getToken(BallerinaParser.Identifier, 0); } + public VersionPatternContext versionPattern() { + return getRuleContext(VersionPatternContext.class,0); + } public VersionContext(ParserRuleContext parent, int invokingState) { super(parent, invokingState); } @@ -576,10 +580,55 @@ public final VersionContext version() throws RecognitionException { try { enterOuterAlt(_localctx, 1); { - setState(511); + setState(513); match(VERSION); - setState(512); - match(Identifier); + setState(514); + versionPattern(); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + _errHandler.reportError(this, re); + _errHandler.recover(this, re); + } + finally { + exitRule(); + } + return _localctx; + } + + public static class VersionPatternContext extends ParserRuleContext { + public TerminalNode DecimalIntegerLiteral() { return getToken(BallerinaParser.DecimalIntegerLiteral, 0); } + public TerminalNode DecimalFloatingPointNumber() { return getToken(BallerinaParser.DecimalFloatingPointNumber, 0); } + public TerminalNode DecimalExtendedFloatingPointNumber() { return getToken(BallerinaParser.DecimalExtendedFloatingPointNumber, 0); } + public VersionPatternContext(ParserRuleContext parent, int invokingState) { + super(parent, invokingState); + } + @Override public int getRuleIndex() { return RULE_versionPattern; } + @Override + public void enterRule(ParseTreeListener listener) { + if ( listener instanceof BallerinaParserListener ) ((BallerinaParserListener)listener).enterVersionPattern(this); + } + @Override + public void exitRule(ParseTreeListener listener) { + if ( listener instanceof BallerinaParserListener ) ((BallerinaParserListener)listener).exitVersionPattern(this); + } + } + + public final VersionPatternContext versionPattern() throws RecognitionException { + VersionPatternContext _localctx = new VersionPatternContext(_ctx, getState()); + enterRule(_localctx, 6, RULE_versionPattern); + int _la; + try { + enterOuterAlt(_localctx, 1); + { + setState(516); + _la = _input.LA(1); + if ( !(((((_la - 182)) & ~0x3f) == 0 && ((1L << (_la - 182)) & ((1L << (DecimalIntegerLiteral - 182)) | (1L << (DecimalFloatingPointNumber - 182)) | (1L << (DecimalExtendedFloatingPointNumber - 182)))) != 0)) ) { + _errHandler.recoverInline(this); + } else { + consume(); + } } } catch (RecognitionException re) { @@ -621,39 +670,39 @@ public void exitRule(ParseTreeListener listener) { public final ImportDeclarationContext importDeclaration() throws RecognitionException { ImportDeclarationContext _localctx = new ImportDeclarationContext(_ctx, getState()); - enterRule(_localctx, 6, RULE_importDeclaration); + enterRule(_localctx, 8, RULE_importDeclaration); int _la; try { enterOuterAlt(_localctx, 1); { - setState(514); - match(IMPORT); setState(518); + match(IMPORT); + setState(522); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,7,_ctx) ) { case 1: { - setState(515); + setState(519); orgName(); - setState(516); + setState(520); match(DIV); } break; } - setState(520); + setState(524); packageName(); - setState(523); + setState(527); _la = _input.LA(1); if (_la==AS) { { - setState(521); + setState(525); match(AS); - setState(522); + setState(526); match(Identifier); } } - setState(525); + setState(529); match(SEMICOLON); } } @@ -686,11 +735,11 @@ public void exitRule(ParseTreeListener listener) { public final OrgNameContext orgName() throws RecognitionException { OrgNameContext _localctx = new OrgNameContext(_ctx, getState()); - enterRule(_localctx, 8, RULE_orgName); + enterRule(_localctx, 10, RULE_orgName); try { enterOuterAlt(_localctx, 1); { - setState(527); + setState(531); match(Identifier); } } @@ -740,50 +789,50 @@ public void exitRule(ParseTreeListener listener) { public final DefinitionContext definition() throws RecognitionException { DefinitionContext _localctx = new DefinitionContext(_ctx, getState()); - enterRule(_localctx, 10, RULE_definition); + enterRule(_localctx, 12, RULE_definition); try { - setState(535); + setState(539); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,9,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(529); + setState(533); serviceDefinition(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(530); + setState(534); functionDefinition(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(531); + setState(535); typeDefinition(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(532); + setState(536); annotationDefinition(); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(533); + setState(537); globalVariableDefinition(); } break; case 6: enterOuterAlt(_localctx, 6); { - setState(534); + setState(538); constantDefinition(); } break; @@ -826,27 +875,27 @@ public void exitRule(ParseTreeListener listener) { public final ServiceDefinitionContext serviceDefinition() throws RecognitionException { ServiceDefinitionContext _localctx = new ServiceDefinitionContext(_ctx, getState()); - enterRule(_localctx, 12, RULE_serviceDefinition); + enterRule(_localctx, 14, RULE_serviceDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(537); + setState(541); match(SERVICE); - setState(539); + setState(543); _la = _input.LA(1); if (_la==Identifier) { { - setState(538); + setState(542); match(Identifier); } } - setState(541); + setState(545); match(ON); - setState(542); + setState(546); expressionList(); - setState(543); + setState(547); serviceBody(); } } @@ -886,28 +935,28 @@ public void exitRule(ParseTreeListener listener) { public final ServiceBodyContext serviceBody() throws RecognitionException { ServiceBodyContext _localctx = new ServiceBodyContext(_ctx, getState()); - enterRule(_localctx, 14, RULE_serviceBody); + enterRule(_localctx, 16, RULE_serviceBody); int _la; try { enterOuterAlt(_localctx, 1); { - setState(545); - match(LEFT_BRACE); setState(549); + match(LEFT_BRACE); + setState(553); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PUBLIC) | (1L << PRIVATE) | (1L << RESOURCE) | (1L << FUNCTION) | (1L << REMOTE))) != 0) || _la==AT || _la==DocumentationLineStart) { { { - setState(546); + setState(550); objectFunctionDefinition(); } } - setState(551); + setState(555); _errHandler.sync(this); _la = _input.LA(1); } - setState(552); + setState(556); match(RIGHT_BRACE); } } @@ -953,35 +1002,35 @@ public void exitRule(ParseTreeListener listener) { public final CallableUnitBodyContext callableUnitBody() throws RecognitionException { CallableUnitBodyContext _localctx = new CallableUnitBodyContext(_ctx, getState()); - enterRule(_localctx, 16, RULE_callableUnitBody); + enterRule(_localctx, 18, RULE_callableUnitBody); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(554); - match(LEFT_BRACE); setState(558); + match(LEFT_BRACE); + setState(562); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,12,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(555); + setState(559); statement(); } } } - setState(560); + setState(564); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,12,_ctx); } - setState(572); + setState(576); _la = _input.LA(1); if (_la==WORKER || _la==AT) { { - setState(562); + setState(566); _errHandler.sync(this); _alt = 1; do { @@ -989,7 +1038,7 @@ public final CallableUnitBodyContext callableUnitBody() throws RecognitionExcept case 1: { { - setState(561); + setState(565); workerDeclaration(); } } @@ -997,28 +1046,28 @@ public final CallableUnitBodyContext callableUnitBody() throws RecognitionExcept default: throw new NoViableAltException(this); } - setState(564); + setState(568); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,13,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); - setState(569); + setState(573); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(566); + setState(570); statement(); } } - setState(571); + setState(575); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(574); + setState(578); match(RIGHT_BRACE); } } @@ -1058,28 +1107,28 @@ public void exitRule(ParseTreeListener listener) { public final ExternalFunctionBodyContext externalFunctionBody() throws RecognitionException { ExternalFunctionBodyContext _localctx = new ExternalFunctionBodyContext(_ctx, getState()); - enterRule(_localctx, 18, RULE_externalFunctionBody); + enterRule(_localctx, 20, RULE_externalFunctionBody); int _la; try { enterOuterAlt(_localctx, 1); { - setState(576); - match(ASSIGN); setState(580); + match(ASSIGN); + setState(584); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(577); + setState(581); annotationAttachment(); } } - setState(582); + setState(586); _errHandler.sync(this); _la = _input.LA(1); } - setState(583); + setState(587); match(EXTERNAL); } } @@ -1125,16 +1174,16 @@ public void exitRule(ParseTreeListener listener) { public final FunctionDefinitionContext functionDefinition() throws RecognitionException { FunctionDefinitionContext _localctx = new FunctionDefinitionContext(_ctx, getState()); - enterRule(_localctx, 20, RULE_functionDefinition); + enterRule(_localctx, 22, RULE_functionDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(586); + setState(590); _la = _input.LA(1); if (_la==PUBLIC || _la==PRIVATE) { { - setState(585); + setState(589); _la = _input.LA(1); if ( !(_la==PUBLIC || _la==PRIVATE) ) { _errHandler.recoverInline(this); @@ -1144,32 +1193,32 @@ public final FunctionDefinitionContext functionDefinition() throws RecognitionEx } } - setState(589); + setState(593); _la = _input.LA(1); if (_la==REMOTE) { { - setState(588); + setState(592); match(REMOTE); } } - setState(591); + setState(595); match(FUNCTION); - setState(592); + setState(596); callableUnitSignature(); - setState(597); + setState(601); switch (_input.LA(1)) { case LEFT_BRACE: { - setState(593); + setState(597); callableUnitBody(); } break; case ASSIGN: { - setState(594); + setState(598); externalFunctionBody(); - setState(595); + setState(599); match(SEMICOLON); } break; @@ -1219,38 +1268,38 @@ public void exitRule(ParseTreeListener listener) { public final LambdaFunctionContext lambdaFunction() throws RecognitionException { LambdaFunctionContext _localctx = new LambdaFunctionContext(_ctx, getState()); - enterRule(_localctx, 22, RULE_lambdaFunction); + enterRule(_localctx, 24, RULE_lambdaFunction); int _la; try { enterOuterAlt(_localctx, 1); { - setState(599); + setState(603); match(FUNCTION); - setState(600); + setState(604); match(LEFT_PARENTHESIS); - setState(602); + setState(606); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PUBLIC) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (AT - 132)) | (1L << (Identifier - 132)))) != 0)) { { - setState(601); + setState(605); formalParameterList(); } } - setState(604); + setState(608); match(RIGHT_PARENTHESIS); - setState(607); + setState(611); _la = _input.LA(1); if (_la==RETURNS) { { - setState(605); + setState(609); match(RETURNS); - setState(606); + setState(610); lambdaReturnParameter(); } } - setState(609); + setState(613); callableUnitBody(); } } @@ -1298,57 +1347,57 @@ public void exitRule(ParseTreeListener listener) { public final ArrowFunctionContext arrowFunction() throws RecognitionException { ArrowFunctionContext _localctx = new ArrowFunctionContext(_ctx, getState()); - enterRule(_localctx, 24, RULE_arrowFunction); + enterRule(_localctx, 26, RULE_arrowFunction); int _la; try { - setState(629); + setState(633); switch (_input.LA(1)) { case Identifier: enterOuterAlt(_localctx, 1); { - setState(611); + setState(615); arrowParam(); - setState(612); + setState(616); match(EQUAL_GT); - setState(613); + setState(617); expression(0); } break; case LEFT_PARENTHESIS: enterOuterAlt(_localctx, 2); { - setState(615); + setState(619); match(LEFT_PARENTHESIS); - setState(624); + setState(628); _la = _input.LA(1); if (_la==Identifier) { { - setState(616); + setState(620); arrowParam(); - setState(621); + setState(625); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(617); + setState(621); match(COMMA); - setState(618); + setState(622); arrowParam(); } } - setState(623); + setState(627); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(626); + setState(630); match(RIGHT_PARENTHESIS); - setState(627); + setState(631); match(EQUAL_GT); - setState(628); + setState(632); expression(0); } break; @@ -1385,11 +1434,11 @@ public void exitRule(ParseTreeListener listener) { public final ArrowParamContext arrowParam() throws RecognitionException { ArrowParamContext _localctx = new ArrowParamContext(_ctx, getState()); - enterRule(_localctx, 26, RULE_arrowParam); + enterRule(_localctx, 28, RULE_arrowParam); try { enterOuterAlt(_localctx, 1); { - setState(631); + setState(635); match(Identifier); } } @@ -1432,31 +1481,31 @@ public void exitRule(ParseTreeListener listener) { public final CallableUnitSignatureContext callableUnitSignature() throws RecognitionException { CallableUnitSignatureContext _localctx = new CallableUnitSignatureContext(_ctx, getState()); - enterRule(_localctx, 28, RULE_callableUnitSignature); + enterRule(_localctx, 30, RULE_callableUnitSignature); int _la; try { enterOuterAlt(_localctx, 1); { - setState(633); + setState(637); anyIdentifierName(); - setState(634); + setState(638); match(LEFT_PARENTHESIS); - setState(636); + setState(640); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PUBLIC) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (AT - 132)) | (1L << (Identifier - 132)))) != 0)) { { - setState(635); + setState(639); formalParameterList(); } } - setState(638); + setState(642); match(RIGHT_PARENTHESIS); - setState(640); + setState(644); _la = _input.LA(1); if (_la==RETURNS) { { - setState(639); + setState(643); returnParameter(); } } @@ -1498,27 +1547,27 @@ public void exitRule(ParseTreeListener listener) { public final TypeDefinitionContext typeDefinition() throws RecognitionException { TypeDefinitionContext _localctx = new TypeDefinitionContext(_ctx, getState()); - enterRule(_localctx, 30, RULE_typeDefinition); + enterRule(_localctx, 32, RULE_typeDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(643); + setState(647); _la = _input.LA(1); if (_la==PUBLIC) { { - setState(642); + setState(646); match(PUBLIC); } } - setState(645); + setState(649); match(TYPE); - setState(646); + setState(650); match(Identifier); - setState(647); + setState(651); finiteType(); - setState(648); + setState(652); match(SEMICOLON); } } @@ -1568,40 +1617,40 @@ public void exitRule(ParseTreeListener listener) { public final ObjectBodyContext objectBody() throws RecognitionException { ObjectBodyContext _localctx = new ObjectBodyContext(_ctx, getState()); - enterRule(_localctx, 32, RULE_objectBody); + enterRule(_localctx, 34, RULE_objectBody); int _la; try { enterOuterAlt(_localctx, 1); { - setState(655); + setState(659); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << PUBLIC) | (1L << PRIVATE) | (1L << SERVICE) | (1L << RESOURCE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << REMOTE) | (1L << ABSTRACT) | (1L << CLIENT))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (MUL - 132)) | (1L << (AT - 132)) | (1L << (Identifier - 132)) | (1L << (DocumentationLineStart - 132)))) != 0)) { { - setState(653); + setState(657); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) { case 1: { - setState(650); + setState(654); objectFieldDefinition(); } break; case 2: { - setState(651); + setState(655); objectFunctionDefinition(); } break; case 3: { - setState(652); + setState(656); typeReference(); } break; } } - setState(657); + setState(661); _errHandler.sync(this); _la = _input.LA(1); } @@ -1640,15 +1689,15 @@ public void exitRule(ParseTreeListener listener) { public final TypeReferenceContext typeReference() throws RecognitionException { TypeReferenceContext _localctx = new TypeReferenceContext(_ctx, getState()); - enterRule(_localctx, 34, RULE_typeReference); + enterRule(_localctx, 36, RULE_typeReference); try { enterOuterAlt(_localctx, 1); { - setState(658); + setState(662); match(MUL); - setState(659); + setState(663); simpleTypeName(); - setState(660); + setState(664); match(SEMICOLON); } } @@ -1697,30 +1746,30 @@ public void exitRule(ParseTreeListener listener) { public final ObjectFieldDefinitionContext objectFieldDefinition() throws RecognitionException { ObjectFieldDefinitionContext _localctx = new ObjectFieldDefinitionContext(_ctx, getState()); - enterRule(_localctx, 36, RULE_objectFieldDefinition); + enterRule(_localctx, 38, RULE_objectFieldDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(665); + setState(669); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(662); + setState(666); annotationAttachment(); } } - setState(667); + setState(671); _errHandler.sync(this); _la = _input.LA(1); } - setState(669); + setState(673); _la = _input.LA(1); if (_la==PUBLIC || _la==PRIVATE) { { - setState(668); + setState(672); _la = _input.LA(1); if ( !(_la==PUBLIC || _la==PRIVATE) ) { _errHandler.recoverInline(this); @@ -1730,22 +1779,22 @@ public final ObjectFieldDefinitionContext objectFieldDefinition() throws Recogni } } - setState(671); + setState(675); typeName(0); - setState(672); + setState(676); match(Identifier); - setState(675); + setState(679); _la = _input.LA(1); if (_la==ASSIGN) { { - setState(673); + setState(677); match(ASSIGN); - setState(674); + setState(678); expression(0); } } - setState(677); + setState(681); match(SEMICOLON); } } @@ -1793,50 +1842,50 @@ public void exitRule(ParseTreeListener listener) { public final FieldDefinitionContext fieldDefinition() throws RecognitionException { FieldDefinitionContext _localctx = new FieldDefinitionContext(_ctx, getState()); - enterRule(_localctx, 38, RULE_fieldDefinition); + enterRule(_localctx, 40, RULE_fieldDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(682); + setState(686); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(679); + setState(683); annotationAttachment(); } } - setState(684); + setState(688); _errHandler.sync(this); _la = _input.LA(1); } - setState(685); + setState(689); typeName(0); - setState(686); + setState(690); match(Identifier); - setState(688); + setState(692); _la = _input.LA(1); if (_la==QUESTION_MARK) { { - setState(687); + setState(691); match(QUESTION_MARK); } } - setState(692); + setState(696); _la = _input.LA(1); if (_la==ASSIGN) { { - setState(690); + setState(694); match(ASSIGN); - setState(691); + setState(695); expression(0); } } - setState(694); + setState(698); match(SEMICOLON); } } @@ -1876,17 +1925,17 @@ public void exitRule(ParseTreeListener listener) { public final RecordRestFieldDefinitionContext recordRestFieldDefinition() throws RecognitionException { RecordRestFieldDefinitionContext _localctx = new RecordRestFieldDefinitionContext(_ctx, getState()); - enterRule(_localctx, 40, RULE_recordRestFieldDefinition); + enterRule(_localctx, 42, RULE_recordRestFieldDefinition); try { enterOuterAlt(_localctx, 1); { - setState(696); + setState(700); typeName(0); - setState(697); + setState(701); restDescriptorPredicate(); - setState(698); + setState(702); match(ELLIPSIS); - setState(699); + setState(703); match(SEMICOLON); } } @@ -1923,15 +1972,15 @@ public void exitRule(ParseTreeListener listener) { public final SealedLiteralContext sealedLiteral() throws RecognitionException { SealedLiteralContext _localctx = new SealedLiteralContext(_ctx, getState()); - enterRule(_localctx, 42, RULE_sealedLiteral); + enterRule(_localctx, 44, RULE_sealedLiteral); try { enterOuterAlt(_localctx, 1); { - setState(701); + setState(705); match(NOT); - setState(702); + setState(706); restDescriptorPredicate(); - setState(703); + setState(707); match(ELLIPSIS); } } @@ -1963,11 +2012,11 @@ public void exitRule(ParseTreeListener listener) { public final RestDescriptorPredicateContext restDescriptorPredicate() throws RecognitionException { RestDescriptorPredicateContext _localctx = new RestDescriptorPredicateContext(_ctx, getState()); - enterRule(_localctx, 44, RULE_restDescriptorPredicate); + enterRule(_localctx, 46, RULE_restDescriptorPredicate); try { enterOuterAlt(_localctx, 1); { - setState(705); + setState(709); if (!(_input.get(_input.index() -1).getType() != WS)) throw new FailedPredicateException(this, "_input.get(_input.index() -1).getType() != WS"); } } @@ -2023,39 +2072,39 @@ public void exitRule(ParseTreeListener listener) { public final ObjectFunctionDefinitionContext objectFunctionDefinition() throws RecognitionException { ObjectFunctionDefinitionContext _localctx = new ObjectFunctionDefinitionContext(_ctx, getState()); - enterRule(_localctx, 46, RULE_objectFunctionDefinition); + enterRule(_localctx, 48, RULE_objectFunctionDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(708); + setState(712); _la = _input.LA(1); if (_la==DocumentationLineStart) { { - setState(707); + setState(711); documentationString(); } } - setState(713); + setState(717); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(710); + setState(714); annotationAttachment(); } } - setState(715); + setState(719); _errHandler.sync(this); _la = _input.LA(1); } - setState(717); + setState(721); _la = _input.LA(1); if (_la==PUBLIC || _la==PRIVATE) { { - setState(716); + setState(720); _la = _input.LA(1); if ( !(_la==PUBLIC || _la==PRIVATE) ) { _errHandler.recoverInline(this); @@ -2065,11 +2114,11 @@ public final ObjectFunctionDefinitionContext objectFunctionDefinition() throws R } } - setState(720); + setState(724); _la = _input.LA(1); if (_la==RESOURCE || _la==REMOTE) { { - setState(719); + setState(723); _la = _input.LA(1); if ( !(_la==RESOURCE || _la==REMOTE) ) { _errHandler.recoverInline(this); @@ -2079,31 +2128,31 @@ public final ObjectFunctionDefinitionContext objectFunctionDefinition() throws R } } - setState(722); + setState(726); match(FUNCTION); - setState(723); + setState(727); callableUnitSignature(); - setState(729); + setState(733); switch (_input.LA(1)) { case LEFT_BRACE: { - setState(724); + setState(728); callableUnitBody(); } break; case SEMICOLON: case ASSIGN: { - setState(726); + setState(730); _la = _input.LA(1); if (_la==ASSIGN) { { - setState(725); + setState(729); externalFunctionBody(); } } - setState(728); + setState(732); match(SEMICOLON); } break; @@ -2159,71 +2208,71 @@ public void exitRule(ParseTreeListener listener) { public final AnnotationDefinitionContext annotationDefinition() throws RecognitionException { AnnotationDefinitionContext _localctx = new AnnotationDefinitionContext(_ctx, getState()); - enterRule(_localctx, 48, RULE_annotationDefinition); + enterRule(_localctx, 50, RULE_annotationDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(732); + setState(736); _la = _input.LA(1); if (_la==PUBLIC) { { - setState(731); + setState(735); match(PUBLIC); } } - setState(735); + setState(739); _la = _input.LA(1); if (_la==CONST) { { - setState(734); + setState(738); match(CONST); } } - setState(737); + setState(741); match(ANNOTATION); - setState(739); + setState(743); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,44,_ctx) ) { case 1: { - setState(738); + setState(742); typeName(0); } break; } - setState(741); + setState(745); match(Identifier); - setState(751); + setState(755); _la = _input.LA(1); if (_la==ON) { { - setState(742); + setState(746); match(ON); - setState(743); + setState(747); attachmentPoint(); - setState(748); + setState(752); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(744); + setState(748); match(COMMA); - setState(745); + setState(749); attachmentPoint(); } } - setState(750); + setState(754); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(753); + setState(757); match(SEMICOLON); } } @@ -2266,39 +2315,39 @@ public void exitRule(ParseTreeListener listener) { public final ConstantDefinitionContext constantDefinition() throws RecognitionException { ConstantDefinitionContext _localctx = new ConstantDefinitionContext(_ctx, getState()); - enterRule(_localctx, 50, RULE_constantDefinition); + enterRule(_localctx, 52, RULE_constantDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(756); + setState(760); _la = _input.LA(1); if (_la==PUBLIC) { { - setState(755); + setState(759); match(PUBLIC); } } - setState(758); + setState(762); match(CONST); - setState(760); + setState(764); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,48,_ctx) ) { case 1: { - setState(759); + setState(763); typeName(0); } break; } - setState(762); + setState(766); match(Identifier); - setState(763); + setState(767); match(ASSIGN); - setState(764); + setState(768); constantExpression(0); - setState(765); + setState(769); match(SEMICOLON); } } @@ -2343,35 +2392,35 @@ public void exitRule(ParseTreeListener listener) { public final GlobalVariableDefinitionContext globalVariableDefinition() throws RecognitionException { GlobalVariableDefinitionContext _localctx = new GlobalVariableDefinitionContext(_ctx, getState()); - enterRule(_localctx, 52, RULE_globalVariableDefinition); + enterRule(_localctx, 54, RULE_globalVariableDefinition); int _la; try { - setState(789); + setState(793); switch (_input.LA(1)) { case PUBLIC: case LISTENER: enterOuterAlt(_localctx, 1); { - setState(768); + setState(772); _la = _input.LA(1); if (_la==PUBLIC) { { - setState(767); + setState(771); match(PUBLIC); } } - setState(770); + setState(774); match(LISTENER); - setState(771); + setState(775); typeName(0); - setState(772); + setState(776); match(Identifier); - setState(773); + setState(777); match(ASSIGN); - setState(774); + setState(778); expression(0); - setState(775); + setState(779); match(SEMICOLON); } break; @@ -2405,16 +2454,16 @@ public final GlobalVariableDefinitionContext globalVariableDefinition() throws R case Identifier: enterOuterAlt(_localctx, 2); { - setState(778); + setState(782); _la = _input.LA(1); if (_la==FINAL) { { - setState(777); + setState(781); match(FINAL); } } - setState(782); + setState(786); switch (_input.LA(1)) { case SERVICE: case FUNCTION: @@ -2443,26 +2492,26 @@ public final GlobalVariableDefinitionContext globalVariableDefinition() throws R case LEFT_BRACKET: case Identifier: { - setState(780); + setState(784); typeName(0); } break; case VAR: { - setState(781); + setState(785); match(VAR); } break; default: throw new NoViableAltException(this); } - setState(784); + setState(788); match(Identifier); - setState(785); + setState(789); match(ASSIGN); - setState(786); + setState(790); expression(0); - setState(787); + setState(791); match(SEMICOLON); } break; @@ -2504,22 +2553,22 @@ public void exitRule(ParseTreeListener listener) { public final AttachmentPointContext attachmentPoint() throws RecognitionException { AttachmentPointContext _localctx = new AttachmentPointContext(_ctx, getState()); - enterRule(_localctx, 54, RULE_attachmentPoint); + enterRule(_localctx, 56, RULE_attachmentPoint); try { - setState(793); + setState(797); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,53,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(791); + setState(795); dualAttachPoint(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(792); + setState(796); sourceOnlyAttachPoint(); } break; @@ -2557,21 +2606,21 @@ public void exitRule(ParseTreeListener listener) { public final DualAttachPointContext dualAttachPoint() throws RecognitionException { DualAttachPointContext _localctx = new DualAttachPointContext(_ctx, getState()); - enterRule(_localctx, 56, RULE_dualAttachPoint); + enterRule(_localctx, 58, RULE_dualAttachPoint); int _la; try { enterOuterAlt(_localctx, 1); { - setState(796); + setState(800); _la = _input.LA(1); if (_la==SOURCE) { { - setState(795); + setState(799); match(SOURCE); } } - setState(798); + setState(802); dualAttachPointIdent(); } } @@ -2610,36 +2659,36 @@ public void exitRule(ParseTreeListener listener) { public final DualAttachPointIdentContext dualAttachPointIdent() throws RecognitionException { DualAttachPointIdentContext _localctx = new DualAttachPointIdentContext(_ctx, getState()); - enterRule(_localctx, 58, RULE_dualAttachPointIdent); + enterRule(_localctx, 60, RULE_dualAttachPointIdent); int _la; try { - setState(811); + setState(815); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,57,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(801); + setState(805); _la = _input.LA(1); if (_la==OBJECT) { { - setState(800); + setState(804); match(OBJECT); } } - setState(803); + setState(807); match(TYPE); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(805); + setState(809); _la = _input.LA(1); if (_la==RESOURCE || _la==OBJECT) { { - setState(804); + setState(808); _la = _input.LA(1); if ( !(_la==RESOURCE || _la==OBJECT) ) { _errHandler.recoverInline(this); @@ -2649,28 +2698,28 @@ public final DualAttachPointIdentContext dualAttachPointIdent() throws Recogniti } } - setState(807); + setState(811); match(FUNCTION); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(808); + setState(812); match(PARAMETER); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(809); + setState(813); match(RETURN); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(810); + setState(814); match(SERVICE); } break; @@ -2708,13 +2757,13 @@ public void exitRule(ParseTreeListener listener) { public final SourceOnlyAttachPointContext sourceOnlyAttachPoint() throws RecognitionException { SourceOnlyAttachPointContext _localctx = new SourceOnlyAttachPointContext(_ctx, getState()); - enterRule(_localctx, 60, RULE_sourceOnlyAttachPoint); + enterRule(_localctx, 62, RULE_sourceOnlyAttachPoint); try { enterOuterAlt(_localctx, 1); { - setState(813); + setState(817); match(SOURCE); - setState(814); + setState(818); sourceOnlyAttachPointIdent(); } } @@ -2752,12 +2801,12 @@ public void exitRule(ParseTreeListener listener) { public final SourceOnlyAttachPointIdentContext sourceOnlyAttachPointIdent() throws RecognitionException { SourceOnlyAttachPointIdentContext _localctx = new SourceOnlyAttachPointIdentContext(_ctx, getState()); - enterRule(_localctx, 62, RULE_sourceOnlyAttachPointIdent); + enterRule(_localctx, 64, RULE_sourceOnlyAttachPointIdent); int _la; try { enterOuterAlt(_localctx, 1); { - setState(816); + setState(820); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << EXTERNAL) | (1L << ANNOTATION) | (1L << WORKER) | (1L << LISTENER) | (1L << CONST))) != 0) || _la==VAR) ) { _errHandler.recoverInline(this); @@ -2811,44 +2860,44 @@ public void exitRule(ParseTreeListener listener) { public final WorkerDeclarationContext workerDeclaration() throws RecognitionException { WorkerDeclarationContext _localctx = new WorkerDeclarationContext(_ctx, getState()); - enterRule(_localctx, 64, RULE_workerDeclaration); + enterRule(_localctx, 66, RULE_workerDeclaration); int _la; try { enterOuterAlt(_localctx, 1); { - setState(821); + setState(825); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(818); + setState(822); annotationAttachment(); } } - setState(823); + setState(827); _errHandler.sync(this); _la = _input.LA(1); } - setState(824); + setState(828); workerDefinition(); - setState(825); - match(LEFT_BRACE); setState(829); + match(LEFT_BRACE); + setState(833); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(826); + setState(830); statement(); } } - setState(831); + setState(835); _errHandler.sync(this); _la = _input.LA(1); } - setState(832); + setState(836); match(RIGHT_BRACE); } } @@ -2885,20 +2934,20 @@ public void exitRule(ParseTreeListener listener) { public final WorkerDefinitionContext workerDefinition() throws RecognitionException { WorkerDefinitionContext _localctx = new WorkerDefinitionContext(_ctx, getState()); - enterRule(_localctx, 66, RULE_workerDefinition); + enterRule(_localctx, 68, RULE_workerDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(834); + setState(838); match(WORKER); - setState(835); + setState(839); match(Identifier); - setState(837); + setState(841); _la = _input.LA(1); if (_la==RETURNS) { { - setState(836); + setState(840); returnParameter(); } } @@ -2943,26 +2992,26 @@ public void exitRule(ParseTreeListener listener) { public final FiniteTypeContext finiteType() throws RecognitionException { FiniteTypeContext _localctx = new FiniteTypeContext(_ctx, getState()); - enterRule(_localctx, 68, RULE_finiteType); + enterRule(_localctx, 70, RULE_finiteType); int _la; try { enterOuterAlt(_localctx, 1); { - setState(839); + setState(843); finiteTypeUnit(); - setState(844); + setState(848); _errHandler.sync(this); _la = _input.LA(1); while (_la==PIPE) { { { - setState(840); + setState(844); match(PIPE); - setState(841); + setState(845); finiteTypeUnit(); } } - setState(846); + setState(850); _errHandler.sync(this); _la = _input.LA(1); } @@ -3002,22 +3051,22 @@ public void exitRule(ParseTreeListener listener) { public final FiniteTypeUnitContext finiteTypeUnit() throws RecognitionException { FiniteTypeUnitContext _localctx = new FiniteTypeUnitContext(_ctx, getState()); - enterRule(_localctx, 70, RULE_finiteTypeUnit); + enterRule(_localctx, 72, RULE_finiteTypeUnit); try { - setState(849); + setState(853); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,62,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(847); + setState(851); simpleLiteral(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(848); + setState(852); typeName(0); } break; @@ -3214,14 +3263,14 @@ private TypeNameContext typeName(int _p) throws RecognitionException { int _parentState = getState(); TypeNameContext _localctx = new TypeNameContext(_ctx, _parentState); TypeNameContext _prevctx = _localctx; - int _startState = 72; - enterRecursionRule(_localctx, 72, RULE_typeName, _p); + int _startState = 74; + enterRecursionRule(_localctx, 74, RULE_typeName, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(877); + setState(881); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,67,_ctx) ) { case 1: @@ -3230,7 +3279,7 @@ private TypeNameContext typeName(int _p) throws RecognitionException { _ctx = _localctx; _prevctx = _localctx; - setState(852); + setState(856); simpleTypeName(); } break; @@ -3239,11 +3288,11 @@ private TypeNameContext typeName(int _p) throws RecognitionException { _localctx = new GroupTypeNameLabelContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(853); + setState(857); match(LEFT_PARENTHESIS); - setState(854); + setState(858); typeName(0); - setState(855); + setState(859); match(RIGHT_PARENTHESIS); } break; @@ -3252,7 +3301,7 @@ private TypeNameContext typeName(int _p) throws RecognitionException { _localctx = new TupleTypeNameLabelContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(857); + setState(861); tupleTypeDescriptor(); } break; @@ -3261,26 +3310,26 @@ private TypeNameContext typeName(int _p) throws RecognitionException { _localctx = new ObjectTypeNameLabelContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(868); + setState(872); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,66,_ctx) ) { case 1: { { - setState(859); + setState(863); _la = _input.LA(1); if (_la==ABSTRACT) { { - setState(858); + setState(862); match(ABSTRACT); } } - setState(862); + setState(866); _la = _input.LA(1); if (_la==CLIENT) { { - setState(861); + setState(865); match(CLIENT); } } @@ -3291,28 +3340,28 @@ private TypeNameContext typeName(int _p) throws RecognitionException { case 2: { { - setState(865); + setState(869); _la = _input.LA(1); if (_la==CLIENT) { { - setState(864); + setState(868); match(CLIENT); } } - setState(867); + setState(871); match(ABSTRACT); } } break; } - setState(870); + setState(874); match(OBJECT); - setState(871); + setState(875); match(LEFT_BRACE); - setState(872); + setState(876); objectBody(); - setState(873); + setState(877); match(RIGHT_BRACE); } break; @@ -3321,7 +3370,7 @@ private TypeNameContext typeName(int _p) throws RecognitionException { _localctx = new InclusiveRecordTypeNameLabelContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(875); + setState(879); inclusiveRecordTypeDescriptor(); } break; @@ -3330,13 +3379,13 @@ private TypeNameContext typeName(int _p) throws RecognitionException { _localctx = new ExclusiveRecordTypeNameLabelContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(876); + setState(880); exclusiveRecordTypeDescriptor(); } break; } _ctx.stop = _input.LT(-1); - setState(901); + setState(905); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,72,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -3344,16 +3393,16 @@ private TypeNameContext typeName(int _p) throws RecognitionException { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(899); + setState(903); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,71,_ctx) ) { case 1: { _localctx = new ArrayTypeNameLabelContext(new TypeNameContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_typeName); - setState(879); + setState(883); if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(886); + setState(890); _errHandler.sync(this); _alt = 1; do { @@ -3361,20 +3410,20 @@ private TypeNameContext typeName(int _p) throws RecognitionException { case 1: { { - setState(880); + setState(884); match(LEFT_BRACKET); - setState(883); + setState(887); switch (_input.LA(1)) { case DecimalIntegerLiteral: case HexIntegerLiteral: { - setState(881); + setState(885); integerLiteral(); } break; case MUL: { - setState(882); + setState(886); match(MUL); } break; @@ -3383,7 +3432,7 @@ private TypeNameContext typeName(int _p) throws RecognitionException { default: throw new NoViableAltException(this); } - setState(885); + setState(889); match(RIGHT_BRACKET); } } @@ -3391,7 +3440,7 @@ private TypeNameContext typeName(int _p) throws RecognitionException { default: throw new NoViableAltException(this); } - setState(888); + setState(892); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,69,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -3401,9 +3450,9 @@ private TypeNameContext typeName(int _p) throws RecognitionException { { _localctx = new UnionTypeNameLabelContext(new TypeNameContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_typeName); - setState(890); + setState(894); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(893); + setState(897); _errHandler.sync(this); _alt = 1; do { @@ -3411,9 +3460,9 @@ private TypeNameContext typeName(int _p) throws RecognitionException { case 1: { { - setState(891); + setState(895); match(PIPE); - setState(892); + setState(896); typeName(0); } } @@ -3421,7 +3470,7 @@ private TypeNameContext typeName(int _p) throws RecognitionException { default: throw new NoViableAltException(this); } - setState(895); + setState(899); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,70,_ctx); } while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ); @@ -3431,16 +3480,16 @@ private TypeNameContext typeName(int _p) throws RecognitionException { { _localctx = new NullableTypeNameLabelContext(new TypeNameContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_typeName); - setState(897); + setState(901); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(898); + setState(902); match(QUESTION_MARK); } break; } } } - setState(903); + setState(907); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,72,_ctx); } @@ -3483,30 +3532,30 @@ public void exitRule(ParseTreeListener listener) { public final InclusiveRecordTypeDescriptorContext inclusiveRecordTypeDescriptor() throws RecognitionException { InclusiveRecordTypeDescriptorContext _localctx = new InclusiveRecordTypeDescriptorContext(_ctx, getState()); - enterRule(_localctx, 74, RULE_inclusiveRecordTypeDescriptor); + enterRule(_localctx, 76, RULE_inclusiveRecordTypeDescriptor); int _la; try { enterOuterAlt(_localctx, 1); { - setState(904); + setState(908); match(RECORD); - setState(905); - match(LEFT_BRACE); setState(909); + match(LEFT_BRACE); + setState(913); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (MUL - 132)) | (1L << (AT - 132)) | (1L << (Identifier - 132)))) != 0)) { { { - setState(906); + setState(910); fieldDescriptor(); } } - setState(911); + setState(915); _errHandler.sync(this); _la = _input.LA(1); } - setState(912); + setState(916); match(RIGHT_BRACE); } } @@ -3553,47 +3602,47 @@ public void exitRule(ParseTreeListener listener) { public final TupleTypeDescriptorContext tupleTypeDescriptor() throws RecognitionException { TupleTypeDescriptorContext _localctx = new TupleTypeDescriptorContext(_ctx, getState()); - enterRule(_localctx, 76, RULE_tupleTypeDescriptor); + enterRule(_localctx, 78, RULE_tupleTypeDescriptor); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(914); + setState(918); match(LEFT_BRACKET); - setState(928); + setState(932); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,76,_ctx) ) { case 1: { { - setState(915); + setState(919); typeName(0); - setState(920); + setState(924); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,74,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(916); + setState(920); match(COMMA); - setState(917); + setState(921); typeName(0); } } } - setState(922); + setState(926); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,74,_ctx); } - setState(925); + setState(929); _la = _input.LA(1); if (_la==COMMA) { { - setState(923); + setState(927); match(COMMA); - setState(924); + setState(928); tupleRestDescriptor(); } } @@ -3603,12 +3652,12 @@ public final TupleTypeDescriptorContext tupleTypeDescriptor() throws Recognition break; case 2: { - setState(927); + setState(931); tupleRestDescriptor(); } break; } - setState(930); + setState(934); match(RIGHT_BRACKET); } } @@ -3644,13 +3693,13 @@ public void exitRule(ParseTreeListener listener) { public final TupleRestDescriptorContext tupleRestDescriptor() throws RecognitionException { TupleRestDescriptorContext _localctx = new TupleRestDescriptorContext(_ctx, getState()); - enterRule(_localctx, 78, RULE_tupleRestDescriptor); + enterRule(_localctx, 80, RULE_tupleRestDescriptor); try { enterOuterAlt(_localctx, 1); { - setState(932); + setState(936); typeName(0); - setState(933); + setState(937); match(ELLIPSIS); } } @@ -3694,42 +3743,42 @@ public void exitRule(ParseTreeListener listener) { public final ExclusiveRecordTypeDescriptorContext exclusiveRecordTypeDescriptor() throws RecognitionException { ExclusiveRecordTypeDescriptorContext _localctx = new ExclusiveRecordTypeDescriptorContext(_ctx, getState()); - enterRule(_localctx, 80, RULE_exclusiveRecordTypeDescriptor); + enterRule(_localctx, 82, RULE_exclusiveRecordTypeDescriptor); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(935); + setState(939); match(RECORD); - setState(936); - match(LEFT_CLOSED_RECORD_DELIMITER); setState(940); + match(LEFT_CLOSED_RECORD_DELIMITER); + setState(944); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,77,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(937); + setState(941); fieldDescriptor(); } } } - setState(942); + setState(946); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,77,_ctx); } - setState(944); + setState(948); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (Identifier - 132)))) != 0)) { { - setState(943); + setState(947); recordRestFieldDefinition(); } } - setState(946); + setState(950); match(RIGHT_CLOSED_RECORD_DELIMITER); } } @@ -3767,9 +3816,9 @@ public void exitRule(ParseTreeListener listener) { public final FieldDescriptorContext fieldDescriptor() throws RecognitionException { FieldDescriptorContext _localctx = new FieldDescriptorContext(_ctx, getState()); - enterRule(_localctx, 82, RULE_fieldDescriptor); + enterRule(_localctx, 84, RULE_fieldDescriptor); try { - setState(950); + setState(954); switch (_input.LA(1)) { case SERVICE: case FUNCTION: @@ -3800,14 +3849,14 @@ public final FieldDescriptorContext fieldDescriptor() throws RecognitionExceptio case Identifier: enterOuterAlt(_localctx, 1); { - setState(948); + setState(952); fieldDefinition(); } break; case MUL: enterOuterAlt(_localctx, 2); { - setState(949); + setState(953); typeReference(); } break; @@ -3855,28 +3904,28 @@ public void exitRule(ParseTreeListener listener) { public final SimpleTypeNameContext simpleTypeName() throws RecognitionException { SimpleTypeNameContext _localctx = new SimpleTypeNameContext(_ctx, getState()); - enterRule(_localctx, 84, RULE_simpleTypeName); + enterRule(_localctx, 86, RULE_simpleTypeName); try { - setState(958); + setState(962); switch (_input.LA(1)) { case TYPE_ANY: enterOuterAlt(_localctx, 1); { - setState(952); + setState(956); match(TYPE_ANY); } break; case TYPE_ANYDATA: enterOuterAlt(_localctx, 2); { - setState(953); + setState(957); match(TYPE_ANYDATA); } break; case TYPE_HANDLE: enterOuterAlt(_localctx, 3); { - setState(954); + setState(958); match(TYPE_HANDLE); } break; @@ -3888,7 +3937,7 @@ public final SimpleTypeNameContext simpleTypeName() throws RecognitionException case TYPE_STRING: enterOuterAlt(_localctx, 4); { - setState(955); + setState(959); valueTypeName(); } break; @@ -3905,14 +3954,14 @@ public final SimpleTypeNameContext simpleTypeName() throws RecognitionException case Identifier: enterOuterAlt(_localctx, 5); { - setState(956); + setState(960); referenceTypeName(); } break; case LEFT_PARENTHESIS: enterOuterAlt(_localctx, 6); { - setState(957); + setState(961); nilLiteral(); } break; @@ -3954,9 +4003,9 @@ public void exitRule(ParseTreeListener listener) { public final ReferenceTypeNameContext referenceTypeName() throws RecognitionException { ReferenceTypeNameContext _localctx = new ReferenceTypeNameContext(_ctx, getState()); - enterRule(_localctx, 86, RULE_referenceTypeName); + enterRule(_localctx, 88, RULE_referenceTypeName); try { - setState(962); + setState(966); switch (_input.LA(1)) { case SERVICE: case FUNCTION: @@ -3970,14 +4019,14 @@ public final ReferenceTypeNameContext referenceTypeName() throws RecognitionExce case TYPE_FUTURE: enterOuterAlt(_localctx, 1); { - setState(960); + setState(964); builtInReferenceTypeName(); } break; case Identifier: enterOuterAlt(_localctx, 2); { - setState(961); + setState(965); userDefineTypeName(); } break; @@ -4016,11 +4065,11 @@ public void exitRule(ParseTreeListener listener) { public final UserDefineTypeNameContext userDefineTypeName() throws RecognitionException { UserDefineTypeNameContext _localctx = new UserDefineTypeNameContext(_ctx, getState()); - enterRule(_localctx, 88, RULE_userDefineTypeName); + enterRule(_localctx, 90, RULE_userDefineTypeName); try { enterOuterAlt(_localctx, 1); { - setState(964); + setState(968); nameReference(); } } @@ -4058,12 +4107,12 @@ public void exitRule(ParseTreeListener listener) { public final ValueTypeNameContext valueTypeName() throws RecognitionException { ValueTypeNameContext _localctx = new ValueTypeNameContext(_ctx, getState()); - enterRule(_localctx, 90, RULE_valueTypeName); + enterRule(_localctx, 92, RULE_valueTypeName); int _la; try { enterOuterAlt(_localctx, 1); { - setState(966); + setState(970); _la = _input.LA(1); if ( !(((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)))) != 0)) ) { _errHandler.recoverInline(this); @@ -4119,107 +4168,107 @@ public void exitRule(ParseTreeListener listener) { public final BuiltInReferenceTypeNameContext builtInReferenceTypeName() throws RecognitionException { BuiltInReferenceTypeNameContext _localctx = new BuiltInReferenceTypeNameContext(_ctx, getState()); - enterRule(_localctx, 92, RULE_builtInReferenceTypeName); + enterRule(_localctx, 94, RULE_builtInReferenceTypeName); try { - setState(998); + setState(1002); switch (_input.LA(1)) { case TYPE_MAP: enterOuterAlt(_localctx, 1); { - setState(968); + setState(972); match(TYPE_MAP); - setState(969); + setState(973); match(LT); - setState(970); + setState(974); typeName(0); - setState(971); + setState(975); match(GT); } break; case TYPE_FUTURE: enterOuterAlt(_localctx, 2); { - setState(973); + setState(977); match(TYPE_FUTURE); - setState(974); + setState(978); match(LT); - setState(975); + setState(979); typeName(0); - setState(976); + setState(980); match(GT); } break; case TYPE_XML: enterOuterAlt(_localctx, 3); { - setState(978); + setState(982); match(TYPE_XML); } break; case TYPE_JSON: enterOuterAlt(_localctx, 4); { - setState(979); + setState(983); match(TYPE_JSON); } break; case TYPE_TABLE: enterOuterAlt(_localctx, 5); { - setState(980); + setState(984); match(TYPE_TABLE); - setState(981); + setState(985); match(LT); - setState(982); + setState(986); typeName(0); - setState(983); + setState(987); match(GT); } break; case TYPE_STREAM: enterOuterAlt(_localctx, 6); { - setState(985); + setState(989); match(TYPE_STREAM); - setState(986); + setState(990); match(LT); - setState(987); + setState(991); typeName(0); - setState(988); + setState(992); match(GT); } break; case TYPE_DESC: enterOuterAlt(_localctx, 7); { - setState(990); + setState(994); match(TYPE_DESC); - setState(991); + setState(995); match(LT); - setState(992); + setState(996); typeName(0); - setState(993); + setState(997); match(GT); } break; case SERVICE: enterOuterAlt(_localctx, 8); { - setState(995); + setState(999); match(SERVICE); } break; case TYPE_ERROR: enterOuterAlt(_localctx, 9); { - setState(996); + setState(1000); errorTypeName(); } break; case FUNCTION: enterOuterAlt(_localctx, 10); { - setState(997); + setState(1001); functionTypeName(); } break; @@ -4267,38 +4316,38 @@ public void exitRule(ParseTreeListener listener) { public final FunctionTypeNameContext functionTypeName() throws RecognitionException { FunctionTypeNameContext _localctx = new FunctionTypeNameContext(_ctx, getState()); - enterRule(_localctx, 94, RULE_functionTypeName); + enterRule(_localctx, 96, RULE_functionTypeName); try { enterOuterAlt(_localctx, 1); { - setState(1000); + setState(1004); match(FUNCTION); - setState(1001); + setState(1005); match(LEFT_PARENTHESIS); - setState(1004); + setState(1008); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,83,_ctx) ) { case 1: { - setState(1002); + setState(1006); parameterList(); } break; case 2: { - setState(1003); + setState(1007); parameterTypeNameList(); } break; } - setState(1006); + setState(1010); match(RIGHT_PARENTHESIS); - setState(1008); + setState(1012); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,84,_ctx) ) { case 1: { - setState(1007); + setState(1011); returnParameter(); } break; @@ -4343,34 +4392,34 @@ public void exitRule(ParseTreeListener listener) { public final ErrorTypeNameContext errorTypeName() throws RecognitionException { ErrorTypeNameContext _localctx = new ErrorTypeNameContext(_ctx, getState()); - enterRule(_localctx, 96, RULE_errorTypeName); + enterRule(_localctx, 98, RULE_errorTypeName); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1010); + setState(1014); match(TYPE_ERROR); - setState(1019); + setState(1023); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,86,_ctx) ) { case 1: { - setState(1011); + setState(1015); match(LT); - setState(1012); + setState(1016); typeName(0); - setState(1015); + setState(1019); _la = _input.LA(1); if (_la==COMMA) { { - setState(1013); + setState(1017); match(COMMA); - setState(1014); + setState(1018); typeName(0); } } - setState(1017); + setState(1021); match(GT); } break; @@ -4406,11 +4455,11 @@ public void exitRule(ParseTreeListener listener) { public final XmlNamespaceNameContext xmlNamespaceName() throws RecognitionException { XmlNamespaceNameContext _localctx = new XmlNamespaceNameContext(_ctx, getState()); - enterRule(_localctx, 98, RULE_xmlNamespaceName); + enterRule(_localctx, 100, RULE_xmlNamespaceName); try { enterOuterAlt(_localctx, 1); { - setState(1021); + setState(1025); match(QuotedStringLiteral); } } @@ -4443,11 +4492,11 @@ public void exitRule(ParseTreeListener listener) { public final XmlLocalNameContext xmlLocalName() throws RecognitionException { XmlLocalNameContext _localctx = new XmlLocalNameContext(_ctx, getState()); - enterRule(_localctx, 100, RULE_xmlLocalName); + enterRule(_localctx, 102, RULE_xmlLocalName); try { enterOuterAlt(_localctx, 1); { - setState(1023); + setState(1027); match(Identifier); } } @@ -4486,20 +4535,20 @@ public void exitRule(ParseTreeListener listener) { public final AnnotationAttachmentContext annotationAttachment() throws RecognitionException { AnnotationAttachmentContext _localctx = new AnnotationAttachmentContext(_ctx, getState()); - enterRule(_localctx, 102, RULE_annotationAttachment); + enterRule(_localctx, 104, RULE_annotationAttachment); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1025); + setState(1029); match(AT); - setState(1026); + setState(1030); nameReference(); - setState(1028); + setState(1032); _la = _input.LA(1); if (_la==LEFT_BRACE) { { - setState(1027); + setState(1031); recordLiteral(); } } @@ -4612,190 +4661,190 @@ public void exitRule(ParseTreeListener listener) { public final StatementContext statement() throws RecognitionException { StatementContext _localctx = new StatementContext(_ctx, getState()); - enterRule(_localctx, 104, RULE_statement); + enterRule(_localctx, 106, RULE_statement); try { - setState(1056); + setState(1060); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,88,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1030); + setState(1034); errorDestructuringStatement(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1031); + setState(1035); assignmentStatement(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(1032); + setState(1036); variableDefinitionStatement(); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(1033); + setState(1037); listDestructuringStatement(); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(1034); + setState(1038); recordDestructuringStatement(); } break; case 6: enterOuterAlt(_localctx, 6); { - setState(1035); + setState(1039); compoundAssignmentStatement(); } break; case 7: enterOuterAlt(_localctx, 7); { - setState(1036); + setState(1040); ifElseStatement(); } break; case 8: enterOuterAlt(_localctx, 8); { - setState(1037); + setState(1041); matchStatement(); } break; case 9: enterOuterAlt(_localctx, 9); { - setState(1038); + setState(1042); foreachStatement(); } break; case 10: enterOuterAlt(_localctx, 10); { - setState(1039); + setState(1043); whileStatement(); } break; case 11: enterOuterAlt(_localctx, 11); { - setState(1040); + setState(1044); continueStatement(); } break; case 12: enterOuterAlt(_localctx, 12); { - setState(1041); + setState(1045); breakStatement(); } break; case 13: enterOuterAlt(_localctx, 13); { - setState(1042); + setState(1046); forkJoinStatement(); } break; case 14: enterOuterAlt(_localctx, 14); { - setState(1043); + setState(1047); tryCatchStatement(); } break; case 15: enterOuterAlt(_localctx, 15); { - setState(1044); + setState(1048); throwStatement(); } break; case 16: enterOuterAlt(_localctx, 16); { - setState(1045); + setState(1049); panicStatement(); } break; case 17: enterOuterAlt(_localctx, 17); { - setState(1046); + setState(1050); returnStatement(); } break; case 18: enterOuterAlt(_localctx, 18); { - setState(1047); + setState(1051); workerSendAsyncStatement(); } break; case 19: enterOuterAlt(_localctx, 19); { - setState(1048); + setState(1052); expressionStmt(); } break; case 20: enterOuterAlt(_localctx, 20); { - setState(1049); + setState(1053); transactionStatement(); } break; case 21: enterOuterAlt(_localctx, 21); { - setState(1050); + setState(1054); abortStatement(); } break; case 22: enterOuterAlt(_localctx, 22); { - setState(1051); + setState(1055); retryStatement(); } break; case 23: enterOuterAlt(_localctx, 23); { - setState(1052); + setState(1056); lockStatement(); } break; case 24: enterOuterAlt(_localctx, 24); { - setState(1053); + setState(1057); namespaceDeclarationStatement(); } break; case 25: enterOuterAlt(_localctx, 25); { - setState(1054); + setState(1058); foreverStatement(); } break; case 26: enterOuterAlt(_localctx, 26); { - setState(1055); + setState(1059); streamingQueryStatement(); } break; @@ -4843,36 +4892,36 @@ public void exitRule(ParseTreeListener listener) { public final VariableDefinitionStatementContext variableDefinitionStatement() throws RecognitionException { VariableDefinitionStatementContext _localctx = new VariableDefinitionStatementContext(_ctx, getState()); - enterRule(_localctx, 106, RULE_variableDefinitionStatement); + enterRule(_localctx, 108, RULE_variableDefinitionStatement); int _la; try { - setState(1074); + setState(1078); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,91,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1058); + setState(1062); typeName(0); - setState(1059); + setState(1063); match(Identifier); - setState(1060); + setState(1064); match(SEMICOLON); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1063); + setState(1067); _la = _input.LA(1); if (_la==FINAL) { { - setState(1062); + setState(1066); match(FINAL); } } - setState(1067); + setState(1071); switch (_input.LA(1)) { case SERVICE: case FUNCTION: @@ -4901,26 +4950,26 @@ public final VariableDefinitionStatementContext variableDefinitionStatement() th case LEFT_BRACKET: case Identifier: { - setState(1065); + setState(1069); typeName(0); } break; case VAR: { - setState(1066); + setState(1070); match(VAR); } break; default: throw new NoViableAltException(this); } - setState(1069); + setState(1073); bindingPattern(); - setState(1070); + setState(1074); match(ASSIGN); - setState(1071); + setState(1075); expression(0); - setState(1072); + setState(1076); match(SEMICOLON); } break; @@ -4966,39 +5015,39 @@ public void exitRule(ParseTreeListener listener) { public final RecordLiteralContext recordLiteral() throws RecognitionException { RecordLiteralContext _localctx = new RecordLiteralContext(_ctx, getState()); - enterRule(_localctx, 108, RULE_recordLiteral); + enterRule(_localctx, 110, RULE_recordLiteral); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1076); + setState(1080); match(LEFT_BRACE); - setState(1085); + setState(1089); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(1077); + setState(1081); recordKeyValue(); - setState(1082); + setState(1086); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(1078); + setState(1082); match(COMMA); - setState(1079); + setState(1083); recordKeyValue(); } } - setState(1084); + setState(1088); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(1087); + setState(1091); match(RIGHT_BRACE); } } @@ -5106,13 +5155,13 @@ private StaticMatchLiteralsContext staticMatchLiterals(int _p) throws Recognitio int _parentState = getState(); StaticMatchLiteralsContext _localctx = new StaticMatchLiteralsContext(_ctx, _parentState); StaticMatchLiteralsContext _prevctx = _localctx; - int _startState = 110; - enterRecursionRule(_localctx, 110, RULE_staticMatchLiterals, _p); + int _startState = 112; + enterRecursionRule(_localctx, 112, RULE_staticMatchLiterals, _p); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(1094); + setState(1098); switch (_input.LA(1)) { case LEFT_PARENTHESIS: case SUB: @@ -5130,7 +5179,7 @@ private StaticMatchLiteralsContext staticMatchLiterals(int _p) throws Recognitio _ctx = _localctx; _prevctx = _localctx; - setState(1090); + setState(1094); simpleLiteral(); } break; @@ -5139,7 +5188,7 @@ private StaticMatchLiteralsContext staticMatchLiterals(int _p) throws Recognitio _localctx = new StaticMatchRecordLiteralContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1091); + setState(1095); recordLiteral(); } break; @@ -5148,7 +5197,7 @@ private StaticMatchLiteralsContext staticMatchLiterals(int _p) throws Recognitio _localctx = new StaticMatchListLiteralContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1092); + setState(1096); listConstructorExpr(); } break; @@ -5157,7 +5206,7 @@ private StaticMatchLiteralsContext staticMatchLiterals(int _p) throws Recognitio _localctx = new StaticMatchIdentifierLiteralContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1093); + setState(1097); match(Identifier); } break; @@ -5165,7 +5214,7 @@ private StaticMatchLiteralsContext staticMatchLiterals(int _p) throws Recognitio throw new NoViableAltException(this); } _ctx.stop = _input.LT(-1); - setState(1101); + setState(1105); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,95,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -5176,16 +5225,16 @@ private StaticMatchLiteralsContext staticMatchLiterals(int _p) throws Recognitio { _localctx = new StaticMatchOrExpressionContext(new StaticMatchLiteralsContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_staticMatchLiterals); - setState(1096); + setState(1100); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(1097); + setState(1101); match(PIPE); - setState(1098); + setState(1102); staticMatchLiterals(2); } } } - setState(1103); + setState(1107); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,95,_ctx); } @@ -5226,15 +5275,15 @@ public void exitRule(ParseTreeListener listener) { public final RecordKeyValueContext recordKeyValue() throws RecognitionException { RecordKeyValueContext _localctx = new RecordKeyValueContext(_ctx, getState()); - enterRule(_localctx, 112, RULE_recordKeyValue); + enterRule(_localctx, 114, RULE_recordKeyValue); try { enterOuterAlt(_localctx, 1); { - setState(1104); + setState(1108); recordKey(); - setState(1105); + setState(1109); match(COLON); - setState(1106); + setState(1110); expression(0); } } @@ -5272,33 +5321,33 @@ public void exitRule(ParseTreeListener listener) { public final RecordKeyContext recordKey() throws RecognitionException { RecordKeyContext _localctx = new RecordKeyContext(_ctx, getState()); - enterRule(_localctx, 114, RULE_recordKey); + enterRule(_localctx, 116, RULE_recordKey); try { - setState(1114); + setState(1118); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,96,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1108); + setState(1112); match(Identifier); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1109); + setState(1113); match(LEFT_BRACKET); - setState(1110); + setState(1114); expression(0); - setState(1111); + setState(1115); match(RIGHT_BRACKET); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(1113); + setState(1117); expression(0); } break; @@ -5342,36 +5391,36 @@ public void exitRule(ParseTreeListener listener) { public final TableLiteralContext tableLiteral() throws RecognitionException { TableLiteralContext _localctx = new TableLiteralContext(_ctx, getState()); - enterRule(_localctx, 116, RULE_tableLiteral); + enterRule(_localctx, 118, RULE_tableLiteral); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1116); + setState(1120); match(TYPE_TABLE); - setState(1117); + setState(1121); match(LEFT_BRACE); - setState(1119); + setState(1123); _la = _input.LA(1); if (_la==LEFT_BRACE) { { - setState(1118); + setState(1122); tableColumnDefinition(); } } - setState(1123); + setState(1127); _la = _input.LA(1); if (_la==COMMA) { { - setState(1121); + setState(1125); match(COMMA); - setState(1122); + setState(1126); tableDataArray(); } } - setState(1125); + setState(1129); match(RIGHT_BRACE); } } @@ -5415,39 +5464,39 @@ public void exitRule(ParseTreeListener listener) { public final TableColumnDefinitionContext tableColumnDefinition() throws RecognitionException { TableColumnDefinitionContext _localctx = new TableColumnDefinitionContext(_ctx, getState()); - enterRule(_localctx, 118, RULE_tableColumnDefinition); + enterRule(_localctx, 120, RULE_tableColumnDefinition); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1127); + setState(1131); match(LEFT_BRACE); - setState(1136); + setState(1140); _la = _input.LA(1); if (_la==Identifier) { { - setState(1128); + setState(1132); tableColumn(); - setState(1133); + setState(1137); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(1129); + setState(1133); match(COMMA); - setState(1130); + setState(1134); tableColumn(); } } - setState(1135); + setState(1139); _errHandler.sync(this); _la = _input.LA(1); } } } - setState(1138); + setState(1142); match(RIGHT_BRACE); } } @@ -5483,21 +5532,21 @@ public void exitRule(ParseTreeListener listener) { public final TableColumnContext tableColumn() throws RecognitionException { TableColumnContext _localctx = new TableColumnContext(_ctx, getState()); - enterRule(_localctx, 120, RULE_tableColumn); + enterRule(_localctx, 122, RULE_tableColumn); try { enterOuterAlt(_localctx, 1); { - setState(1141); + setState(1145); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,101,_ctx) ) { case 1: { - setState(1140); + setState(1144); match(Identifier); } break; } - setState(1143); + setState(1147); match(Identifier); } } @@ -5534,23 +5583,23 @@ public void exitRule(ParseTreeListener listener) { public final TableDataArrayContext tableDataArray() throws RecognitionException { TableDataArrayContext _localctx = new TableDataArrayContext(_ctx, getState()); - enterRule(_localctx, 122, RULE_tableDataArray); + enterRule(_localctx, 124, RULE_tableDataArray); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1145); + setState(1149); match(LEFT_BRACKET); - setState(1147); + setState(1151); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(1146); + setState(1150); tableDataList(); } } - setState(1149); + setState(1153); match(RIGHT_BRACKET); } } @@ -5595,30 +5644,30 @@ public void exitRule(ParseTreeListener listener) { public final TableDataListContext tableDataList() throws RecognitionException { TableDataListContext _localctx = new TableDataListContext(_ctx, getState()); - enterRule(_localctx, 124, RULE_tableDataList); + enterRule(_localctx, 126, RULE_tableDataList); int _la; try { - setState(1160); + setState(1164); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,104,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1151); + setState(1155); tableData(); - setState(1156); + setState(1160); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(1152); + setState(1156); match(COMMA); - setState(1153); + setState(1157); tableData(); } } - setState(1158); + setState(1162); _errHandler.sync(this); _la = _input.LA(1); } @@ -5627,7 +5676,7 @@ public final TableDataListContext tableDataList() throws RecognitionException { case 2: enterOuterAlt(_localctx, 2); { - setState(1159); + setState(1163); expressionList(); } break; @@ -5666,15 +5715,15 @@ public void exitRule(ParseTreeListener listener) { public final TableDataContext tableData() throws RecognitionException { TableDataContext _localctx = new TableDataContext(_ctx, getState()); - enterRule(_localctx, 126, RULE_tableData); + enterRule(_localctx, 128, RULE_tableData); try { enterOuterAlt(_localctx, 1); { - setState(1162); + setState(1166); match(LEFT_BRACE); - setState(1163); + setState(1167); expressionList(); - setState(1164); + setState(1168); match(RIGHT_BRACE); } } @@ -5711,23 +5760,23 @@ public void exitRule(ParseTreeListener listener) { public final ListConstructorExprContext listConstructorExpr() throws RecognitionException { ListConstructorExprContext _localctx = new ListConstructorExprContext(_ctx, getState()); - enterRule(_localctx, 128, RULE_listConstructorExpr); + enterRule(_localctx, 130, RULE_listConstructorExpr); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1166); + setState(1170); match(LEFT_BRACKET); - setState(1168); + setState(1172); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(1167); + setState(1171); expressionList(); } } - setState(1170); + setState(1174); match(RIGHT_BRACKET); } } @@ -5767,17 +5816,17 @@ public void exitRule(ParseTreeListener listener) { public final AssignmentStatementContext assignmentStatement() throws RecognitionException { AssignmentStatementContext _localctx = new AssignmentStatementContext(_ctx, getState()); - enterRule(_localctx, 130, RULE_assignmentStatement); + enterRule(_localctx, 132, RULE_assignmentStatement); try { enterOuterAlt(_localctx, 1); { - setState(1172); + setState(1176); variableReference(0); - setState(1173); + setState(1177); match(ASSIGN); - setState(1174); + setState(1178); expression(0); - setState(1175); + setState(1179); match(SEMICOLON); } } @@ -5817,17 +5866,17 @@ public void exitRule(ParseTreeListener listener) { public final ListDestructuringStatementContext listDestructuringStatement() throws RecognitionException { ListDestructuringStatementContext _localctx = new ListDestructuringStatementContext(_ctx, getState()); - enterRule(_localctx, 132, RULE_listDestructuringStatement); + enterRule(_localctx, 134, RULE_listDestructuringStatement); try { enterOuterAlt(_localctx, 1); { - setState(1177); + setState(1181); listRefBindingPattern(); - setState(1178); + setState(1182); match(ASSIGN); - setState(1179); + setState(1183); expression(0); - setState(1180); + setState(1184); match(SEMICOLON); } } @@ -5867,17 +5916,17 @@ public void exitRule(ParseTreeListener listener) { public final RecordDestructuringStatementContext recordDestructuringStatement() throws RecognitionException { RecordDestructuringStatementContext _localctx = new RecordDestructuringStatementContext(_ctx, getState()); - enterRule(_localctx, 134, RULE_recordDestructuringStatement); + enterRule(_localctx, 136, RULE_recordDestructuringStatement); try { enterOuterAlt(_localctx, 1); { - setState(1182); + setState(1186); recordRefBindingPattern(); - setState(1183); + setState(1187); match(ASSIGN); - setState(1184); + setState(1188); expression(0); - setState(1185); + setState(1189); match(SEMICOLON); } } @@ -5917,17 +5966,17 @@ public void exitRule(ParseTreeListener listener) { public final ErrorDestructuringStatementContext errorDestructuringStatement() throws RecognitionException { ErrorDestructuringStatementContext _localctx = new ErrorDestructuringStatementContext(_ctx, getState()); - enterRule(_localctx, 136, RULE_errorDestructuringStatement); + enterRule(_localctx, 138, RULE_errorDestructuringStatement); try { enterOuterAlt(_localctx, 1); { - setState(1187); + setState(1191); errorRefBindingPattern(); - setState(1188); + setState(1192); match(ASSIGN); - setState(1189); + setState(1193); expression(0); - setState(1190); + setState(1194); match(SEMICOLON); } } @@ -5969,17 +6018,17 @@ public void exitRule(ParseTreeListener listener) { public final CompoundAssignmentStatementContext compoundAssignmentStatement() throws RecognitionException { CompoundAssignmentStatementContext _localctx = new CompoundAssignmentStatementContext(_ctx, getState()); - enterRule(_localctx, 138, RULE_compoundAssignmentStatement); + enterRule(_localctx, 140, RULE_compoundAssignmentStatement); try { enterOuterAlt(_localctx, 1); { - setState(1192); + setState(1196); variableReference(0); - setState(1193); + setState(1197); compoundOperator(); - setState(1194); + setState(1198); expression(0); - setState(1195); + setState(1199); match(SEMICOLON); } } @@ -6021,12 +6070,12 @@ public void exitRule(ParseTreeListener listener) { public final CompoundOperatorContext compoundOperator() throws RecognitionException { CompoundOperatorContext _localctx = new CompoundOperatorContext(_ctx, getState()); - enterRule(_localctx, 140, RULE_compoundOperator); + enterRule(_localctx, 142, RULE_compoundOperator); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1197); + setState(1201); _la = _input.LA(1); if ( !(((((_la - 170)) & ~0x3f) == 0 && ((1L << (_la - 170)) & ((1L << (COMPOUND_ADD - 170)) | (1L << (COMPOUND_SUB - 170)) | (1L << (COMPOUND_MUL - 170)) | (1L << (COMPOUND_DIV - 170)) | (1L << (COMPOUND_BIT_AND - 170)) | (1L << (COMPOUND_BIT_OR - 170)) | (1L << (COMPOUND_BIT_XOR - 170)) | (1L << (COMPOUND_LEFT_SHIFT - 170)) | (1L << (COMPOUND_RIGHT_SHIFT - 170)) | (1L << (COMPOUND_LOGICAL_SHIFT - 170)))) != 0)) ) { _errHandler.recoverInline(this); @@ -6073,28 +6122,28 @@ public void exitRule(ParseTreeListener listener) { public final VariableReferenceListContext variableReferenceList() throws RecognitionException { VariableReferenceListContext _localctx = new VariableReferenceListContext(_ctx, getState()); - enterRule(_localctx, 142, RULE_variableReferenceList); + enterRule(_localctx, 144, RULE_variableReferenceList); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(1199); + setState(1203); variableReference(0); - setState(1204); + setState(1208); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,106,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1200); + setState(1204); match(COMMA); - setState(1201); + setState(1205); variableReference(0); } } } - setState(1206); + setState(1210); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,106,_ctx); } @@ -6140,35 +6189,35 @@ public void exitRule(ParseTreeListener listener) { public final IfElseStatementContext ifElseStatement() throws RecognitionException { IfElseStatementContext _localctx = new IfElseStatementContext(_ctx, getState()); - enterRule(_localctx, 144, RULE_ifElseStatement); + enterRule(_localctx, 146, RULE_ifElseStatement); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(1207); - ifClause(); setState(1211); + ifClause(); + setState(1215); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,107,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1208); + setState(1212); elseIfClause(); } } } - setState(1213); + setState(1217); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,107,_ctx); } - setState(1215); + setState(1219); _la = _input.LA(1); if (_la==ELSE) { { - setState(1214); + setState(1218); elseClause(); } } @@ -6215,32 +6264,32 @@ public void exitRule(ParseTreeListener listener) { public final IfClauseContext ifClause() throws RecognitionException { IfClauseContext _localctx = new IfClauseContext(_ctx, getState()); - enterRule(_localctx, 146, RULE_ifClause); + enterRule(_localctx, 148, RULE_ifClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1217); + setState(1221); match(IF); - setState(1218); + setState(1222); expression(0); - setState(1219); - match(LEFT_BRACE); setState(1223); + match(LEFT_BRACE); + setState(1227); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1220); + setState(1224); statement(); } } - setState(1225); + setState(1229); _errHandler.sync(this); _la = _input.LA(1); } - setState(1226); + setState(1230); match(RIGHT_BRACE); } } @@ -6285,34 +6334,34 @@ public void exitRule(ParseTreeListener listener) { public final ElseIfClauseContext elseIfClause() throws RecognitionException { ElseIfClauseContext _localctx = new ElseIfClauseContext(_ctx, getState()); - enterRule(_localctx, 148, RULE_elseIfClause); + enterRule(_localctx, 150, RULE_elseIfClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1228); + setState(1232); match(ELSE); - setState(1229); + setState(1233); match(IF); - setState(1230); + setState(1234); expression(0); - setState(1231); - match(LEFT_BRACE); setState(1235); + match(LEFT_BRACE); + setState(1239); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1232); + setState(1236); statement(); } } - setState(1237); + setState(1241); _errHandler.sync(this); _la = _input.LA(1); } - setState(1238); + setState(1242); match(RIGHT_BRACE); } } @@ -6353,30 +6402,30 @@ public void exitRule(ParseTreeListener listener) { public final ElseClauseContext elseClause() throws RecognitionException { ElseClauseContext _localctx = new ElseClauseContext(_ctx, getState()); - enterRule(_localctx, 150, RULE_elseClause); + enterRule(_localctx, 152, RULE_elseClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1240); + setState(1244); match(ELSE); - setState(1241); - match(LEFT_BRACE); setState(1245); + match(LEFT_BRACE); + setState(1249); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1242); + setState(1246); statement(); } } - setState(1247); + setState(1251); _errHandler.sync(this); _la = _input.LA(1); } - setState(1248); + setState(1252); match(RIGHT_BRACE); } } @@ -6420,32 +6469,32 @@ public void exitRule(ParseTreeListener listener) { public final MatchStatementContext matchStatement() throws RecognitionException { MatchStatementContext _localctx = new MatchStatementContext(_ctx, getState()); - enterRule(_localctx, 152, RULE_matchStatement); + enterRule(_localctx, 154, RULE_matchStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1250); + setState(1254); match(MATCH); - setState(1251); + setState(1255); expression(0); - setState(1252); + setState(1256); match(LEFT_BRACE); - setState(1254); + setState(1258); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(1253); + setState(1257); matchPatternClause(); } } - setState(1256); + setState(1260); _errHandler.sync(this); _la = _input.LA(1); } while ( (((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (SUB - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)))) != 0) ); - setState(1258); + setState(1262); match(RIGHT_BRACE); } } @@ -6500,114 +6549,114 @@ public void exitRule(ParseTreeListener listener) { public final MatchPatternClauseContext matchPatternClause() throws RecognitionException { MatchPatternClauseContext _localctx = new MatchPatternClauseContext(_ctx, getState()); - enterRule(_localctx, 154, RULE_matchPatternClause); + enterRule(_localctx, 156, RULE_matchPatternClause); int _la; try { - setState(1302); + setState(1306); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,118,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1260); + setState(1264); staticMatchLiterals(0); - setState(1261); + setState(1265); match(EQUAL_GT); - setState(1262); - match(LEFT_BRACE); setState(1266); + match(LEFT_BRACE); + setState(1270); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1263); + setState(1267); statement(); } } - setState(1268); + setState(1272); _errHandler.sync(this); _la = _input.LA(1); } - setState(1269); + setState(1273); match(RIGHT_BRACE); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1271); + setState(1275); match(VAR); - setState(1272); + setState(1276); bindingPattern(); - setState(1275); + setState(1279); _la = _input.LA(1); if (_la==IF) { { - setState(1273); + setState(1277); match(IF); - setState(1274); + setState(1278); expression(0); } } - setState(1277); + setState(1281); match(EQUAL_GT); - setState(1278); - match(LEFT_BRACE); setState(1282); + match(LEFT_BRACE); + setState(1286); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1279); + setState(1283); statement(); } } - setState(1284); + setState(1288); _errHandler.sync(this); _la = _input.LA(1); } - setState(1285); + setState(1289); match(RIGHT_BRACE); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(1287); + setState(1291); errorMatchPattern(); - setState(1290); + setState(1294); _la = _input.LA(1); if (_la==IF) { { - setState(1288); + setState(1292); match(IF); - setState(1289); + setState(1293); expression(0); } } - setState(1292); + setState(1296); match(EQUAL_GT); - setState(1293); - match(LEFT_BRACE); setState(1297); + match(LEFT_BRACE); + setState(1301); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1294); + setState(1298); statement(); } } - setState(1299); + setState(1303); _errHandler.sync(this); _la = _input.LA(1); } - setState(1300); + setState(1304); match(RIGHT_BRACE); } break; @@ -6645,22 +6694,22 @@ public void exitRule(ParseTreeListener listener) { public final BindingPatternContext bindingPattern() throws RecognitionException { BindingPatternContext _localctx = new BindingPatternContext(_ctx, getState()); - enterRule(_localctx, 156, RULE_bindingPattern); + enterRule(_localctx, 158, RULE_bindingPattern); try { - setState(1306); + setState(1310); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,119,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1304); + setState(1308); match(Identifier); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1305); + setState(1309); structuredBindingPattern(); } break; @@ -6703,29 +6752,29 @@ public void exitRule(ParseTreeListener listener) { public final StructuredBindingPatternContext structuredBindingPattern() throws RecognitionException { StructuredBindingPatternContext _localctx = new StructuredBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 158, RULE_structuredBindingPattern); + enterRule(_localctx, 160, RULE_structuredBindingPattern); try { - setState(1311); + setState(1315); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,120,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1308); + setState(1312); listBindingPattern(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1309); + setState(1313); recordBindingPattern(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(1310); + setState(1314); errorBindingPattern(); } break; @@ -6782,65 +6831,65 @@ public void exitRule(ParseTreeListener listener) { public final ErrorBindingPatternContext errorBindingPattern() throws RecognitionException { ErrorBindingPatternContext _localctx = new ErrorBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 160, RULE_errorBindingPattern); + enterRule(_localctx, 162, RULE_errorBindingPattern); int _la; try { int _alt; - setState(1333); + setState(1337); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,123,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1313); + setState(1317); match(TYPE_ERROR); - setState(1314); + setState(1318); match(LEFT_PARENTHESIS); - setState(1315); + setState(1319); match(Identifier); - setState(1320); + setState(1324); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,121,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1316); + setState(1320); match(COMMA); - setState(1317); + setState(1321); errorDetailBindingPattern(); } } } - setState(1322); + setState(1326); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,121,_ctx); } - setState(1325); + setState(1329); _la = _input.LA(1); if (_la==COMMA) { { - setState(1323); + setState(1327); match(COMMA); - setState(1324); + setState(1328); errorRestBindingPattern(); } } - setState(1327); + setState(1331); match(RIGHT_PARENTHESIS); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1328); + setState(1332); typeName(0); - setState(1329); + setState(1333); match(LEFT_PARENTHESIS); - setState(1330); + setState(1334); errorFieldBindingPatterns(); - setState(1331); + setState(1335); match(RIGHT_PARENTHESIS); } break; @@ -6887,42 +6936,42 @@ public void exitRule(ParseTreeListener listener) { public final ErrorFieldBindingPatternsContext errorFieldBindingPatterns() throws RecognitionException { ErrorFieldBindingPatternsContext _localctx = new ErrorFieldBindingPatternsContext(_ctx, getState()); - enterRule(_localctx, 162, RULE_errorFieldBindingPatterns); + enterRule(_localctx, 164, RULE_errorFieldBindingPatterns); int _la; try { int _alt; - setState(1348); + setState(1352); switch (_input.LA(1)) { case Identifier: enterOuterAlt(_localctx, 1); { - setState(1335); + setState(1339); errorDetailBindingPattern(); - setState(1340); + setState(1344); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,124,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1336); + setState(1340); match(COMMA); - setState(1337); + setState(1341); errorDetailBindingPattern(); } } } - setState(1342); + setState(1346); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,124,_ctx); } - setState(1345); + setState(1349); _la = _input.LA(1); if (_la==COMMA) { { - setState(1343); + setState(1347); match(COMMA); - setState(1344); + setState(1348); errorRestBindingPattern(); } } @@ -6932,7 +6981,7 @@ public final ErrorFieldBindingPatternsContext errorFieldBindingPatterns() throws case ELLIPSIS: enterOuterAlt(_localctx, 2); { - setState(1347); + setState(1351); errorRestBindingPattern(); } break; @@ -6980,34 +7029,34 @@ public void exitRule(ParseTreeListener listener) { public final ErrorMatchPatternContext errorMatchPattern() throws RecognitionException { ErrorMatchPatternContext _localctx = new ErrorMatchPatternContext(_ctx, getState()); - enterRule(_localctx, 164, RULE_errorMatchPattern); + enterRule(_localctx, 166, RULE_errorMatchPattern); try { - setState(1360); + setState(1364); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,127,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1350); + setState(1354); match(TYPE_ERROR); - setState(1351); + setState(1355); match(LEFT_PARENTHESIS); - setState(1352); + setState(1356); errorArgListMatchPattern(); - setState(1353); + setState(1357); match(RIGHT_PARENTHESIS); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1355); + setState(1359); typeName(0); - setState(1356); + setState(1360); match(LEFT_PARENTHESIS); - setState(1357); + setState(1361); errorFieldMatchPatterns(); - setState(1358); + setState(1362); match(RIGHT_PARENTHESIS); } break; @@ -7057,43 +7106,43 @@ public void exitRule(ParseTreeListener listener) { public final ErrorArgListMatchPatternContext errorArgListMatchPattern() throws RecognitionException { ErrorArgListMatchPatternContext _localctx = new ErrorArgListMatchPatternContext(_ctx, getState()); - enterRule(_localctx, 166, RULE_errorArgListMatchPattern); + enterRule(_localctx, 168, RULE_errorArgListMatchPattern); int _la; try { int _alt; - setState(1387); + setState(1391); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,132,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1362); + setState(1366); simpleMatchPattern(); - setState(1367); + setState(1371); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,128,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1363); + setState(1367); match(COMMA); - setState(1364); + setState(1368); errorDetailBindingPattern(); } } } - setState(1369); + setState(1373); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,128,_ctx); } - setState(1372); + setState(1376); _la = _input.LA(1); if (_la==COMMA) { { - setState(1370); + setState(1374); match(COMMA); - setState(1371); + setState(1375); restMatchPattern(); } } @@ -7103,33 +7152,33 @@ public final ErrorArgListMatchPatternContext errorArgListMatchPattern() throws R case 2: enterOuterAlt(_localctx, 2); { - setState(1374); + setState(1378); errorDetailBindingPattern(); - setState(1379); + setState(1383); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,130,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1375); + setState(1379); match(COMMA); - setState(1376); + setState(1380); errorDetailBindingPattern(); } } } - setState(1381); + setState(1385); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,130,_ctx); } - setState(1384); + setState(1388); _la = _input.LA(1); if (_la==COMMA) { { - setState(1382); + setState(1386); match(COMMA); - setState(1383); + setState(1387); restMatchPattern(); } } @@ -7139,7 +7188,7 @@ public final ErrorArgListMatchPatternContext errorArgListMatchPattern() throws R case 3: enterOuterAlt(_localctx, 3); { - setState(1386); + setState(1390); restMatchPattern(); } break; @@ -7186,42 +7235,42 @@ public void exitRule(ParseTreeListener listener) { public final ErrorFieldMatchPatternsContext errorFieldMatchPatterns() throws RecognitionException { ErrorFieldMatchPatternsContext _localctx = new ErrorFieldMatchPatternsContext(_ctx, getState()); - enterRule(_localctx, 168, RULE_errorFieldMatchPatterns); + enterRule(_localctx, 170, RULE_errorFieldMatchPatterns); int _la; try { int _alt; - setState(1402); + setState(1406); switch (_input.LA(1)) { case Identifier: enterOuterAlt(_localctx, 1); { - setState(1389); + setState(1393); errorDetailBindingPattern(); - setState(1394); + setState(1398); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,133,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1390); + setState(1394); match(COMMA); - setState(1391); + setState(1395); errorDetailBindingPattern(); } } } - setState(1396); + setState(1400); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,133,_ctx); } - setState(1399); + setState(1403); _la = _input.LA(1); if (_la==COMMA) { { - setState(1397); + setState(1401); match(COMMA); - setState(1398); + setState(1402); restMatchPattern(); } } @@ -7231,7 +7280,7 @@ public final ErrorFieldMatchPatternsContext errorFieldMatchPatterns() throws Rec case ELLIPSIS: enterOuterAlt(_localctx, 2); { - setState(1401); + setState(1405); restMatchPattern(); } break; @@ -7269,13 +7318,13 @@ public void exitRule(ParseTreeListener listener) { public final ErrorRestBindingPatternContext errorRestBindingPattern() throws RecognitionException { ErrorRestBindingPatternContext _localctx = new ErrorRestBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 170, RULE_errorRestBindingPattern); + enterRule(_localctx, 172, RULE_errorRestBindingPattern); try { enterOuterAlt(_localctx, 1); { - setState(1404); + setState(1408); match(ELLIPSIS); - setState(1405); + setState(1409); match(Identifier); } } @@ -7310,15 +7359,15 @@ public void exitRule(ParseTreeListener listener) { public final RestMatchPatternContext restMatchPattern() throws RecognitionException { RestMatchPatternContext _localctx = new RestMatchPatternContext(_ctx, getState()); - enterRule(_localctx, 172, RULE_restMatchPattern); + enterRule(_localctx, 174, RULE_restMatchPattern); try { enterOuterAlt(_localctx, 1); { - setState(1407); + setState(1411); match(ELLIPSIS); - setState(1408); + setState(1412); match(VAR); - setState(1409); + setState(1413); match(Identifier); } } @@ -7353,21 +7402,21 @@ public void exitRule(ParseTreeListener listener) { public final SimpleMatchPatternContext simpleMatchPattern() throws RecognitionException { SimpleMatchPatternContext _localctx = new SimpleMatchPatternContext(_ctx, getState()); - enterRule(_localctx, 174, RULE_simpleMatchPattern); + enterRule(_localctx, 176, RULE_simpleMatchPattern); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1412); + setState(1416); _la = _input.LA(1); if (_la==VAR) { { - setState(1411); + setState(1415); match(VAR); } } - setState(1414); + setState(1418); _la = _input.LA(1); if ( !(_la==QuotedStringLiteral || _la==Identifier) ) { _errHandler.recoverInline(this); @@ -7409,15 +7458,15 @@ public void exitRule(ParseTreeListener listener) { public final ErrorDetailBindingPatternContext errorDetailBindingPattern() throws RecognitionException { ErrorDetailBindingPatternContext _localctx = new ErrorDetailBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 176, RULE_errorDetailBindingPattern); + enterRule(_localctx, 178, RULE_errorDetailBindingPattern); try { enterOuterAlt(_localctx, 1); { - setState(1416); + setState(1420); match(Identifier); - setState(1417); + setState(1421); match(ASSIGN); - setState(1418); + setState(1422); bindingPattern(); } } @@ -7464,15 +7513,15 @@ public void exitRule(ParseTreeListener listener) { public final ListBindingPatternContext listBindingPattern() throws RecognitionException { ListBindingPatternContext _localctx = new ListBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 178, RULE_listBindingPattern); + enterRule(_localctx, 180, RULE_listBindingPattern); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(1420); + setState(1424); match(LEFT_BRACKET); - setState(1436); + setState(1440); switch (_input.LA(1)) { case SERVICE: case FUNCTION: @@ -7503,33 +7552,33 @@ public final ListBindingPatternContext listBindingPattern() throws RecognitionEx case Identifier: { { - setState(1421); + setState(1425); bindingPattern(); - setState(1426); + setState(1430); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,137,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1422); + setState(1426); match(COMMA); - setState(1423); + setState(1427); bindingPattern(); } } } - setState(1428); + setState(1432); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,137,_ctx); } - setState(1431); + setState(1435); _la = _input.LA(1); if (_la==COMMA) { { - setState(1429); + setState(1433); match(COMMA); - setState(1430); + setState(1434); restBindingPattern(); } } @@ -7540,11 +7589,11 @@ public final ListBindingPatternContext listBindingPattern() throws RecognitionEx case RIGHT_BRACKET: case ELLIPSIS: { - setState(1434); + setState(1438); _la = _input.LA(1); if (_la==ELLIPSIS) { { - setState(1433); + setState(1437); restBindingPattern(); } } @@ -7554,7 +7603,7 @@ public final ListBindingPatternContext listBindingPattern() throws RecognitionEx default: throw new NoViableAltException(this); } - setState(1438); + setState(1442); match(RIGHT_BRACKET); } } @@ -7591,15 +7640,15 @@ public void exitRule(ParseTreeListener listener) { public final RecordBindingPatternContext recordBindingPattern() throws RecognitionException { RecordBindingPatternContext _localctx = new RecordBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 180, RULE_recordBindingPattern); + enterRule(_localctx, 182, RULE_recordBindingPattern); try { enterOuterAlt(_localctx, 1); { - setState(1440); + setState(1444); match(LEFT_BRACE); - setState(1441); + setState(1445); entryBindingPattern(); - setState(1442); + setState(1446); match(RIGHT_BRACE); } } @@ -7644,42 +7693,42 @@ public void exitRule(ParseTreeListener listener) { public final EntryBindingPatternContext entryBindingPattern() throws RecognitionException { EntryBindingPatternContext _localctx = new EntryBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 182, RULE_entryBindingPattern); + enterRule(_localctx, 184, RULE_entryBindingPattern); int _la; try { int _alt; - setState(1459); + setState(1463); switch (_input.LA(1)) { case Identifier: enterOuterAlt(_localctx, 1); { - setState(1444); + setState(1448); fieldBindingPattern(); - setState(1449); + setState(1453); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,141,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1445); + setState(1449); match(COMMA); - setState(1446); + setState(1450); fieldBindingPattern(); } } } - setState(1451); + setState(1455); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,141,_ctx); } - setState(1454); + setState(1458); _la = _input.LA(1); if (_la==COMMA) { { - setState(1452); + setState(1456); match(COMMA); - setState(1453); + setState(1457); restBindingPattern(); } } @@ -7690,11 +7739,11 @@ public final EntryBindingPatternContext entryBindingPattern() throws Recognition case ELLIPSIS: enterOuterAlt(_localctx, 2); { - setState(1457); + setState(1461); _la = _input.LA(1); if (_la==ELLIPSIS) { { - setState(1456); + setState(1460); restBindingPattern(); } } @@ -7738,20 +7787,20 @@ public void exitRule(ParseTreeListener listener) { public final FieldBindingPatternContext fieldBindingPattern() throws RecognitionException { FieldBindingPatternContext _localctx = new FieldBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 184, RULE_fieldBindingPattern); + enterRule(_localctx, 186, RULE_fieldBindingPattern); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1461); + setState(1465); match(Identifier); - setState(1464); + setState(1468); _la = _input.LA(1); if (_la==COLON) { { - setState(1462); + setState(1466); match(COLON); - setState(1463); + setState(1467); bindingPattern(); } } @@ -7788,13 +7837,13 @@ public void exitRule(ParseTreeListener listener) { public final RestBindingPatternContext restBindingPattern() throws RecognitionException { RestBindingPatternContext _localctx = new RestBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 186, RULE_restBindingPattern); + enterRule(_localctx, 188, RULE_restBindingPattern); try { enterOuterAlt(_localctx, 1); { - setState(1466); + setState(1470); match(ELLIPSIS); - setState(1467); + setState(1471); match(Identifier); } } @@ -7835,29 +7884,29 @@ public void exitRule(ParseTreeListener listener) { public final BindingRefPatternContext bindingRefPattern() throws RecognitionException { BindingRefPatternContext _localctx = new BindingRefPatternContext(_ctx, getState()); - enterRule(_localctx, 188, RULE_bindingRefPattern); + enterRule(_localctx, 190, RULE_bindingRefPattern); try { - setState(1472); + setState(1476); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,146,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1469); + setState(1473); errorRefBindingPattern(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1470); + setState(1474); variableReference(0); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(1471); + setState(1475); structuredRefBindingPattern(); } break; @@ -7897,21 +7946,21 @@ public void exitRule(ParseTreeListener listener) { public final StructuredRefBindingPatternContext structuredRefBindingPattern() throws RecognitionException { StructuredRefBindingPatternContext _localctx = new StructuredRefBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 190, RULE_structuredRefBindingPattern); + enterRule(_localctx, 192, RULE_structuredRefBindingPattern); try { - setState(1476); + setState(1480); switch (_input.LA(1)) { case LEFT_BRACKET: enterOuterAlt(_localctx, 1); { - setState(1474); + setState(1478); listRefBindingPattern(); } break; case LEFT_BRACE: enterOuterAlt(_localctx, 2); { - setState(1475); + setState(1479); recordRefBindingPattern(); } break; @@ -7962,15 +8011,15 @@ public void exitRule(ParseTreeListener listener) { public final ListRefBindingPatternContext listRefBindingPattern() throws RecognitionException { ListRefBindingPatternContext _localctx = new ListRefBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 192, RULE_listRefBindingPattern); + enterRule(_localctx, 194, RULE_listRefBindingPattern); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(1478); + setState(1482); match(LEFT_BRACKET); - setState(1492); + setState(1496); switch (_input.LA(1)) { case SERVICE: case FUNCTION: @@ -8006,33 +8055,33 @@ public final ListRefBindingPatternContext listRefBindingPattern() throws Recogni case Identifier: { { - setState(1479); + setState(1483); bindingRefPattern(); - setState(1484); + setState(1488); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,148,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1480); + setState(1484); match(COMMA); - setState(1481); + setState(1485); bindingRefPattern(); } } } - setState(1486); + setState(1490); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,148,_ctx); } - setState(1489); + setState(1493); _la = _input.LA(1); if (_la==COMMA) { { - setState(1487); + setState(1491); match(COMMA); - setState(1488); + setState(1492); listRefRestPattern(); } } @@ -8042,14 +8091,14 @@ public final ListRefBindingPatternContext listRefBindingPattern() throws Recogni break; case ELLIPSIS: { - setState(1491); + setState(1495); listRefRestPattern(); } break; default: throw new NoViableAltException(this); } - setState(1494); + setState(1498); match(RIGHT_BRACKET); } } @@ -8085,13 +8134,13 @@ public void exitRule(ParseTreeListener listener) { public final ListRefRestPatternContext listRefRestPattern() throws RecognitionException { ListRefRestPatternContext _localctx = new ListRefRestPatternContext(_ctx, getState()); - enterRule(_localctx, 194, RULE_listRefRestPattern); + enterRule(_localctx, 196, RULE_listRefRestPattern); try { enterOuterAlt(_localctx, 1); { - setState(1496); + setState(1500); match(ELLIPSIS); - setState(1497); + setState(1501); variableReference(0); } } @@ -8128,15 +8177,15 @@ public void exitRule(ParseTreeListener listener) { public final RecordRefBindingPatternContext recordRefBindingPattern() throws RecognitionException { RecordRefBindingPatternContext _localctx = new RecordRefBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 196, RULE_recordRefBindingPattern); + enterRule(_localctx, 198, RULE_recordRefBindingPattern); try { enterOuterAlt(_localctx, 1); { - setState(1499); + setState(1503); match(LEFT_BRACE); - setState(1500); + setState(1504); entryRefBindingPattern(); - setState(1501); + setState(1505); match(RIGHT_BRACE); } } @@ -8190,43 +8239,43 @@ public void exitRule(ParseTreeListener listener) { public final ErrorRefBindingPatternContext errorRefBindingPattern() throws RecognitionException { ErrorRefBindingPatternContext _localctx = new ErrorRefBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 198, RULE_errorRefBindingPattern); + enterRule(_localctx, 200, RULE_errorRefBindingPattern); int _la; try { int _alt; - setState(1547); + setState(1551); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,157,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1503); + setState(1507); match(TYPE_ERROR); - setState(1504); + setState(1508); match(LEFT_PARENTHESIS); - setState(1518); + setState(1522); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,153,_ctx) ) { case 1: { { - setState(1505); + setState(1509); variableReference(0); - setState(1510); + setState(1514); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,151,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1506); + setState(1510); match(COMMA); - setState(1507); + setState(1511); errorNamedArgRefPattern(); } } } - setState(1512); + setState(1516); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,151,_ctx); } @@ -8235,90 +8284,90 @@ public final ErrorRefBindingPatternContext errorRefBindingPattern() throws Recog break; case 2: { - setState(1514); + setState(1518); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(1513); + setState(1517); errorNamedArgRefPattern(); } } - setState(1516); + setState(1520); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==Identifier ); } break; } - setState(1522); + setState(1526); _la = _input.LA(1); if (_la==COMMA) { { - setState(1520); + setState(1524); match(COMMA); - setState(1521); + setState(1525); errorRefRestPattern(); } } - setState(1524); + setState(1528); match(RIGHT_PARENTHESIS); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1526); + setState(1530); match(TYPE_ERROR); - setState(1527); + setState(1531); match(LEFT_PARENTHESIS); - setState(1528); + setState(1532); errorRefRestPattern(); - setState(1529); + setState(1533); match(RIGHT_PARENTHESIS); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(1531); + setState(1535); typeName(0); - setState(1532); + setState(1536); match(LEFT_PARENTHESIS); - setState(1533); + setState(1537); errorNamedArgRefPattern(); - setState(1538); + setState(1542); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,155,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1534); + setState(1538); match(COMMA); - setState(1535); + setState(1539); errorNamedArgRefPattern(); } } } - setState(1540); + setState(1544); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,155,_ctx); } - setState(1543); + setState(1547); _la = _input.LA(1); if (_la==COMMA) { { - setState(1541); + setState(1545); match(COMMA); - setState(1542); + setState(1546); errorRefRestPattern(); } } - setState(1545); + setState(1549); match(RIGHT_PARENTHESIS); } break; @@ -8357,15 +8406,15 @@ public void exitRule(ParseTreeListener listener) { public final ErrorNamedArgRefPatternContext errorNamedArgRefPattern() throws RecognitionException { ErrorNamedArgRefPatternContext _localctx = new ErrorNamedArgRefPatternContext(_ctx, getState()); - enterRule(_localctx, 200, RULE_errorNamedArgRefPattern); + enterRule(_localctx, 202, RULE_errorNamedArgRefPattern); try { enterOuterAlt(_localctx, 1); { - setState(1549); + setState(1553); match(Identifier); - setState(1550); + setState(1554); match(ASSIGN); - setState(1551); + setState(1555); bindingRefPattern(); } } @@ -8401,13 +8450,13 @@ public void exitRule(ParseTreeListener listener) { public final ErrorRefRestPatternContext errorRefRestPattern() throws RecognitionException { ErrorRefRestPatternContext _localctx = new ErrorRefRestPatternContext(_ctx, getState()); - enterRule(_localctx, 202, RULE_errorRefRestPattern); + enterRule(_localctx, 204, RULE_errorRefRestPattern); try { enterOuterAlt(_localctx, 1); { - setState(1553); + setState(1557); match(ELLIPSIS); - setState(1554); + setState(1558); variableReference(0); } } @@ -8452,42 +8501,42 @@ public void exitRule(ParseTreeListener listener) { public final EntryRefBindingPatternContext entryRefBindingPattern() throws RecognitionException { EntryRefBindingPatternContext _localctx = new EntryRefBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 204, RULE_entryRefBindingPattern); + enterRule(_localctx, 206, RULE_entryRefBindingPattern); int _la; try { int _alt; - setState(1571); + setState(1575); switch (_input.LA(1)) { case Identifier: enterOuterAlt(_localctx, 1); { - setState(1556); + setState(1560); fieldRefBindingPattern(); - setState(1561); + setState(1565); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,158,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(1557); + setState(1561); match(COMMA); - setState(1558); + setState(1562); fieldRefBindingPattern(); } } } - setState(1563); + setState(1567); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,158,_ctx); } - setState(1566); + setState(1570); _la = _input.LA(1); if (_la==COMMA) { { - setState(1564); + setState(1568); match(COMMA); - setState(1565); + setState(1569); restRefBindingPattern(); } } @@ -8499,11 +8548,11 @@ public final EntryRefBindingPatternContext entryRefBindingPattern() throws Recog case ELLIPSIS: enterOuterAlt(_localctx, 2); { - setState(1569); + setState(1573); _la = _input.LA(1); if (_la==NOT || _la==ELLIPSIS) { { - setState(1568); + setState(1572); restRefBindingPattern(); } } @@ -8547,20 +8596,20 @@ public void exitRule(ParseTreeListener listener) { public final FieldRefBindingPatternContext fieldRefBindingPattern() throws RecognitionException { FieldRefBindingPatternContext _localctx = new FieldRefBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 206, RULE_fieldRefBindingPattern); + enterRule(_localctx, 208, RULE_fieldRefBindingPattern); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1573); + setState(1577); match(Identifier); - setState(1576); + setState(1580); _la = _input.LA(1); if (_la==COLON) { { - setState(1574); + setState(1578); match(COLON); - setState(1575); + setState(1579); bindingRefPattern(); } } @@ -8602,23 +8651,23 @@ public void exitRule(ParseTreeListener listener) { public final RestRefBindingPatternContext restRefBindingPattern() throws RecognitionException { RestRefBindingPatternContext _localctx = new RestRefBindingPatternContext(_ctx, getState()); - enterRule(_localctx, 208, RULE_restRefBindingPattern); + enterRule(_localctx, 210, RULE_restRefBindingPattern); try { - setState(1581); + setState(1585); switch (_input.LA(1)) { case ELLIPSIS: enterOuterAlt(_localctx, 1); { - setState(1578); + setState(1582); match(ELLIPSIS); - setState(1579); + setState(1583); variableReference(0); } break; case NOT: enterOuterAlt(_localctx, 2); { - setState(1580); + setState(1584); sealedLiteral(); } break; @@ -8676,24 +8725,24 @@ public void exitRule(ParseTreeListener listener) { public final ForeachStatementContext foreachStatement() throws RecognitionException { ForeachStatementContext _localctx = new ForeachStatementContext(_ctx, getState()); - enterRule(_localctx, 210, RULE_foreachStatement); + enterRule(_localctx, 212, RULE_foreachStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1583); + setState(1587); match(FOREACH); - setState(1585); + setState(1589); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,164,_ctx) ) { case 1: { - setState(1584); + setState(1588); match(LEFT_PARENTHESIS); } break; } - setState(1589); + setState(1593); switch (_input.LA(1)) { case SERVICE: case FUNCTION: @@ -8722,51 +8771,51 @@ public final ForeachStatementContext foreachStatement() throws RecognitionExcept case LEFT_BRACKET: case Identifier: { - setState(1587); + setState(1591); typeName(0); } break; case VAR: { - setState(1588); + setState(1592); match(VAR); } break; default: throw new NoViableAltException(this); } - setState(1591); + setState(1595); bindingPattern(); - setState(1592); + setState(1596); match(IN); - setState(1593); + setState(1597); expression(0); - setState(1595); + setState(1599); _la = _input.LA(1); if (_la==RIGHT_PARENTHESIS) { { - setState(1594); + setState(1598); match(RIGHT_PARENTHESIS); } } - setState(1597); - match(LEFT_BRACE); setState(1601); + match(LEFT_BRACE); + setState(1605); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1598); + setState(1602); statement(); } } - setState(1603); + setState(1607); _errHandler.sync(this); _la = _input.LA(1); } - setState(1604); + setState(1608); match(RIGHT_BRACE); } } @@ -8809,32 +8858,32 @@ public void exitRule(ParseTreeListener listener) { public final IntRangeExpressionContext intRangeExpression() throws RecognitionException { IntRangeExpressionContext _localctx = new IntRangeExpressionContext(_ctx, getState()); - enterRule(_localctx, 212, RULE_intRangeExpression); + enterRule(_localctx, 214, RULE_intRangeExpression); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1606); + setState(1610); _la = _input.LA(1); if ( !(_la==LEFT_PARENTHESIS || _la==LEFT_BRACKET) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(1607); + setState(1611); expression(0); - setState(1608); + setState(1612); match(RANGE); - setState(1610); + setState(1614); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(1609); + setState(1613); expression(0); } } - setState(1612); + setState(1616); _la = _input.LA(1); if ( !(_la==RIGHT_PARENTHESIS || _la==RIGHT_BRACKET) ) { _errHandler.recoverInline(this); @@ -8883,32 +8932,32 @@ public void exitRule(ParseTreeListener listener) { public final WhileStatementContext whileStatement() throws RecognitionException { WhileStatementContext _localctx = new WhileStatementContext(_ctx, getState()); - enterRule(_localctx, 214, RULE_whileStatement); + enterRule(_localctx, 216, RULE_whileStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1614); + setState(1618); match(WHILE); - setState(1615); + setState(1619); expression(0); - setState(1616); - match(LEFT_BRACE); setState(1620); + match(LEFT_BRACE); + setState(1624); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1617); + setState(1621); statement(); } } - setState(1622); + setState(1626); _errHandler.sync(this); _la = _input.LA(1); } - setState(1623); + setState(1627); match(RIGHT_BRACE); } } @@ -8942,13 +8991,13 @@ public void exitRule(ParseTreeListener listener) { public final ContinueStatementContext continueStatement() throws RecognitionException { ContinueStatementContext _localctx = new ContinueStatementContext(_ctx, getState()); - enterRule(_localctx, 216, RULE_continueStatement); + enterRule(_localctx, 218, RULE_continueStatement); try { enterOuterAlt(_localctx, 1); { - setState(1625); + setState(1629); match(CONTINUE); - setState(1626); + setState(1630); match(SEMICOLON); } } @@ -8982,13 +9031,13 @@ public void exitRule(ParseTreeListener listener) { public final BreakStatementContext breakStatement() throws RecognitionException { BreakStatementContext _localctx = new BreakStatementContext(_ctx, getState()); - enterRule(_localctx, 218, RULE_breakStatement); + enterRule(_localctx, 220, RULE_breakStatement); try { enterOuterAlt(_localctx, 1); { - setState(1628); + setState(1632); match(BREAK); - setState(1629); + setState(1633); match(SEMICOLON); } } @@ -9029,30 +9078,30 @@ public void exitRule(ParseTreeListener listener) { public final ForkJoinStatementContext forkJoinStatement() throws RecognitionException { ForkJoinStatementContext _localctx = new ForkJoinStatementContext(_ctx, getState()); - enterRule(_localctx, 220, RULE_forkJoinStatement); + enterRule(_localctx, 222, RULE_forkJoinStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1631); + setState(1635); match(FORK); - setState(1632); - match(LEFT_BRACE); setState(1636); + match(LEFT_BRACE); + setState(1640); _errHandler.sync(this); _la = _input.LA(1); while (_la==WORKER || _la==AT) { { { - setState(1633); + setState(1637); workerDeclaration(); } } - setState(1638); + setState(1642); _errHandler.sync(this); _la = _input.LA(1); } - setState(1639); + setState(1643); match(RIGHT_BRACE); } } @@ -9096,32 +9145,32 @@ public void exitRule(ParseTreeListener listener) { public final TryCatchStatementContext tryCatchStatement() throws RecognitionException { TryCatchStatementContext _localctx = new TryCatchStatementContext(_ctx, getState()); - enterRule(_localctx, 222, RULE_tryCatchStatement); + enterRule(_localctx, 224, RULE_tryCatchStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1641); + setState(1645); match(TRY); - setState(1642); - match(LEFT_BRACE); setState(1646); + match(LEFT_BRACE); + setState(1650); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1643); + setState(1647); statement(); } } - setState(1648); + setState(1652); _errHandler.sync(this); _la = _input.LA(1); } - setState(1649); + setState(1653); match(RIGHT_BRACE); - setState(1650); + setState(1654); catchClauses(); } } @@ -9162,33 +9211,33 @@ public void exitRule(ParseTreeListener listener) { public final CatchClausesContext catchClauses() throws RecognitionException { CatchClausesContext _localctx = new CatchClausesContext(_ctx, getState()); - enterRule(_localctx, 224, RULE_catchClauses); + enterRule(_localctx, 226, RULE_catchClauses); int _la; try { - setState(1661); + setState(1665); switch (_input.LA(1)) { case CATCH: enterOuterAlt(_localctx, 1); { - setState(1653); + setState(1657); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(1652); + setState(1656); catchClause(); } } - setState(1655); + setState(1659); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==CATCH ); - setState(1658); + setState(1662); _la = _input.LA(1); if (_la==FINALLY) { { - setState(1657); + setState(1661); finallyClause(); } } @@ -9198,7 +9247,7 @@ public final CatchClausesContext catchClauses() throws RecognitionException { case FINALLY: enterOuterAlt(_localctx, 2); { - setState(1660); + setState(1664); finallyClause(); } break; @@ -9249,38 +9298,38 @@ public void exitRule(ParseTreeListener listener) { public final CatchClauseContext catchClause() throws RecognitionException { CatchClauseContext _localctx = new CatchClauseContext(_ctx, getState()); - enterRule(_localctx, 226, RULE_catchClause); + enterRule(_localctx, 228, RULE_catchClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1663); + setState(1667); match(CATCH); - setState(1664); + setState(1668); match(LEFT_PARENTHESIS); - setState(1665); + setState(1669); typeName(0); - setState(1666); + setState(1670); match(Identifier); - setState(1667); + setState(1671); match(RIGHT_PARENTHESIS); - setState(1668); - match(LEFT_BRACE); setState(1672); + match(LEFT_BRACE); + setState(1676); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1669); + setState(1673); statement(); } } - setState(1674); + setState(1678); _errHandler.sync(this); _la = _input.LA(1); } - setState(1675); + setState(1679); match(RIGHT_BRACE); } } @@ -9321,30 +9370,30 @@ public void exitRule(ParseTreeListener listener) { public final FinallyClauseContext finallyClause() throws RecognitionException { FinallyClauseContext _localctx = new FinallyClauseContext(_ctx, getState()); - enterRule(_localctx, 228, RULE_finallyClause); + enterRule(_localctx, 230, RULE_finallyClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1677); + setState(1681); match(FINALLY); - setState(1678); - match(LEFT_BRACE); setState(1682); + match(LEFT_BRACE); + setState(1686); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1679); + setState(1683); statement(); } } - setState(1684); + setState(1688); _errHandler.sync(this); _la = _input.LA(1); } - setState(1685); + setState(1689); match(RIGHT_BRACE); } } @@ -9381,15 +9430,15 @@ public void exitRule(ParseTreeListener listener) { public final ThrowStatementContext throwStatement() throws RecognitionException { ThrowStatementContext _localctx = new ThrowStatementContext(_ctx, getState()); - enterRule(_localctx, 230, RULE_throwStatement); + enterRule(_localctx, 232, RULE_throwStatement); try { enterOuterAlt(_localctx, 1); { - setState(1687); + setState(1691); match(THROW); - setState(1688); + setState(1692); expression(0); - setState(1689); + setState(1693); match(SEMICOLON); } } @@ -9426,15 +9475,15 @@ public void exitRule(ParseTreeListener listener) { public final PanicStatementContext panicStatement() throws RecognitionException { PanicStatementContext _localctx = new PanicStatementContext(_ctx, getState()); - enterRule(_localctx, 232, RULE_panicStatement); + enterRule(_localctx, 234, RULE_panicStatement); try { enterOuterAlt(_localctx, 1); { - setState(1691); + setState(1695); match(PANIC); - setState(1692); + setState(1696); expression(0); - setState(1693); + setState(1697); match(SEMICOLON); } } @@ -9471,23 +9520,23 @@ public void exitRule(ParseTreeListener listener) { public final ReturnStatementContext returnStatement() throws RecognitionException { ReturnStatementContext _localctx = new ReturnStatementContext(_ctx, getState()); - enterRule(_localctx, 234, RULE_returnStatement); + enterRule(_localctx, 236, RULE_returnStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1695); + setState(1699); match(RETURN); - setState(1697); + setState(1701); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(1696); + setState(1700); expression(0); } } - setState(1699); + setState(1703); match(SEMICOLON); } } @@ -9531,29 +9580,29 @@ public void exitRule(ParseTreeListener listener) { public final WorkerSendAsyncStatementContext workerSendAsyncStatement() throws RecognitionException { WorkerSendAsyncStatementContext _localctx = new WorkerSendAsyncStatementContext(_ctx, getState()); - enterRule(_localctx, 236, RULE_workerSendAsyncStatement); + enterRule(_localctx, 238, RULE_workerSendAsyncStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1701); + setState(1705); expression(0); - setState(1702); + setState(1706); match(RARROW); - setState(1703); + setState(1707); peerWorker(); - setState(1706); + setState(1710); _la = _input.LA(1); if (_la==COMMA) { { - setState(1704); + setState(1708); match(COMMA); - setState(1705); + setState(1709); expression(0); } } - setState(1708); + setState(1712); match(SEMICOLON); } } @@ -9589,21 +9638,21 @@ public void exitRule(ParseTreeListener listener) { public final PeerWorkerContext peerWorker() throws RecognitionException { PeerWorkerContext _localctx = new PeerWorkerContext(_ctx, getState()); - enterRule(_localctx, 238, RULE_peerWorker); + enterRule(_localctx, 240, RULE_peerWorker); try { - setState(1712); + setState(1716); switch (_input.LA(1)) { case Identifier: enterOuterAlt(_localctx, 1); { - setState(1710); + setState(1714); workerName(); } break; case DEFAULT: enterOuterAlt(_localctx, 2); { - setState(1711); + setState(1715); match(DEFAULT); } break; @@ -9640,11 +9689,11 @@ public void exitRule(ParseTreeListener listener) { public final WorkerNameContext workerName() throws RecognitionException { WorkerNameContext _localctx = new WorkerNameContext(_ctx, getState()); - enterRule(_localctx, 240, RULE_workerName); + enterRule(_localctx, 242, RULE_workerName); try { enterOuterAlt(_localctx, 1); { - setState(1714); + setState(1718); match(Identifier); } } @@ -9678,18 +9727,18 @@ public void exitRule(ParseTreeListener listener) { public final FlushWorkerContext flushWorker() throws RecognitionException { FlushWorkerContext _localctx = new FlushWorkerContext(_ctx, getState()); - enterRule(_localctx, 242, RULE_flushWorker); + enterRule(_localctx, 244, RULE_flushWorker); try { enterOuterAlt(_localctx, 1); { - setState(1716); + setState(1720); match(FLUSH); - setState(1718); + setState(1722); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,180,_ctx) ) { case 1: { - setState(1717); + setState(1721); match(Identifier); } break; @@ -9736,32 +9785,32 @@ public void exitRule(ParseTreeListener listener) { public final WaitForCollectionContext waitForCollection() throws RecognitionException { WaitForCollectionContext _localctx = new WaitForCollectionContext(_ctx, getState()); - enterRule(_localctx, 244, RULE_waitForCollection); + enterRule(_localctx, 246, RULE_waitForCollection); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1720); + setState(1724); match(LEFT_BRACE); - setState(1721); + setState(1725); waitKeyValue(); - setState(1726); + setState(1730); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(1722); + setState(1726); match(COMMA); - setState(1723); + setState(1727); waitKeyValue(); } } - setState(1728); + setState(1732); _errHandler.sync(this); _la = _input.LA(1); } - setState(1729); + setState(1733); match(RIGHT_BRACE); } } @@ -9798,26 +9847,26 @@ public void exitRule(ParseTreeListener listener) { public final WaitKeyValueContext waitKeyValue() throws RecognitionException { WaitKeyValueContext _localctx = new WaitKeyValueContext(_ctx, getState()); - enterRule(_localctx, 246, RULE_waitKeyValue); + enterRule(_localctx, 248, RULE_waitKeyValue); try { - setState(1735); + setState(1739); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,182,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1731); + setState(1735); match(Identifier); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1732); + setState(1736); match(Identifier); - setState(1733); + setState(1737); match(COLON); - setState(1734); + setState(1738); expression(0); } break; @@ -10001,13 +10050,13 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc int _parentState = getState(); VariableReferenceContext _localctx = new VariableReferenceContext(_ctx, _parentState); VariableReferenceContext _prevctx = _localctx; - int _startState = 248; - enterRecursionRule(_localctx, 248, RULE_variableReference, _p); + int _startState = 250; + enterRecursionRule(_localctx, 250, RULE_variableReference, _p); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(1745); + setState(1749); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,183,_ctx) ) { case 1: @@ -10016,7 +10065,7 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc _ctx = _localctx; _prevctx = _localctx; - setState(1738); + setState(1742); nameReference(); } break; @@ -10025,7 +10074,7 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc _localctx = new FunctionInvocationReferenceContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1739); + setState(1743); functionInvocation(); } break; @@ -10034,9 +10083,9 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc _localctx = new TypeDescExprInvocationReferenceContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1740); + setState(1744); typeDescExpr(); - setState(1741); + setState(1745); invocation(); } break; @@ -10045,15 +10094,15 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc _localctx = new StringFunctionInvocationReferenceContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1743); + setState(1747); match(QuotedStringLiteral); - setState(1744); + setState(1748); invocation(); } break; } _ctx.stop = _input.LT(-1); - setState(1760); + setState(1764); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,185,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -10061,16 +10110,16 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(1758); + setState(1762); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,184,_ctx) ) { case 1: { _localctx = new FieldVariableReferenceContext(new VariableReferenceContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_variableReference); - setState(1747); + setState(1751); if (!(precpred(_ctx, 8))) throw new FailedPredicateException(this, "precpred(_ctx, 8)"); - setState(1748); + setState(1752); field(); } break; @@ -10078,11 +10127,11 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc { _localctx = new AnnotAccessExpressionContext(new VariableReferenceContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_variableReference); - setState(1749); + setState(1753); if (!(precpred(_ctx, 7))) throw new FailedPredicateException(this, "precpred(_ctx, 7)"); - setState(1750); + setState(1754); match(ANNOTATION_ACCESS); - setState(1751); + setState(1755); nameReference(); } break; @@ -10090,9 +10139,9 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc { _localctx = new XmlAttribVariableReferenceContext(new VariableReferenceContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_variableReference); - setState(1752); + setState(1756); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(1753); + setState(1757); xmlAttrib(); } break; @@ -10100,9 +10149,9 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc { _localctx = new InvocationReferenceContext(new VariableReferenceContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_variableReference); - setState(1754); + setState(1758); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(1755); + setState(1759); invocation(); } break; @@ -10110,16 +10159,16 @@ private VariableReferenceContext variableReference(int _p) throws RecognitionExc { _localctx = new MapArrayVariableReferenceContext(new VariableReferenceContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_variableReference); - setState(1756); + setState(1760); if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)"); - setState(1757); + setState(1761); index(); } break; } } } - setState(1762); + setState(1766); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,185,_ctx); } @@ -10157,19 +10206,19 @@ public void exitRule(ParseTreeListener listener) { public final FieldContext field() throws RecognitionException { FieldContext _localctx = new FieldContext(_ctx, getState()); - enterRule(_localctx, 250, RULE_field); + enterRule(_localctx, 252, RULE_field); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1763); + setState(1767); _la = _input.LA(1); if ( !(_la==DOT || _la==OPTIONAL_FIELD_ACCESS) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(1764); + setState(1768); _la = _input.LA(1); if ( !(_la==MUL || _la==Identifier) ) { _errHandler.recoverInline(this); @@ -10211,15 +10260,15 @@ public void exitRule(ParseTreeListener listener) { public final IndexContext index() throws RecognitionException { IndexContext _localctx = new IndexContext(_ctx, getState()); - enterRule(_localctx, 252, RULE_index); + enterRule(_localctx, 254, RULE_index); try { enterOuterAlt(_localctx, 1); { - setState(1766); + setState(1770); match(LEFT_BRACKET); - setState(1767); + setState(1771); expression(0); - setState(1768); + setState(1772); match(RIGHT_BRACKET); } } @@ -10257,22 +10306,22 @@ public void exitRule(ParseTreeListener listener) { public final XmlAttribContext xmlAttrib() throws RecognitionException { XmlAttribContext _localctx = new XmlAttribContext(_ctx, getState()); - enterRule(_localctx, 254, RULE_xmlAttrib); + enterRule(_localctx, 256, RULE_xmlAttrib); try { enterOuterAlt(_localctx, 1); { - setState(1770); + setState(1774); match(AT); - setState(1775); + setState(1779); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,186,_ctx) ) { case 1: { - setState(1771); + setState(1775); match(LEFT_BRACKET); - setState(1772); + setState(1776); expression(0); - setState(1773); + setState(1777); match(RIGHT_BRACKET); } break; @@ -10315,25 +10364,25 @@ public void exitRule(ParseTreeListener listener) { public final FunctionInvocationContext functionInvocation() throws RecognitionException { FunctionInvocationContext _localctx = new FunctionInvocationContext(_ctx, getState()); - enterRule(_localctx, 256, RULE_functionInvocation); + enterRule(_localctx, 258, RULE_functionInvocation); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1777); + setState(1781); functionNameReference(); - setState(1778); + setState(1782); match(LEFT_PARENTHESIS); - setState(1780); + setState(1784); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (ELLIPSIS - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(1779); + setState(1783); invocationArgList(); } } - setState(1782); + setState(1786); match(RIGHT_PARENTHESIS); } } @@ -10374,27 +10423,27 @@ public void exitRule(ParseTreeListener listener) { public final InvocationContext invocation() throws RecognitionException { InvocationContext _localctx = new InvocationContext(_ctx, getState()); - enterRule(_localctx, 258, RULE_invocation); + enterRule(_localctx, 260, RULE_invocation); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1784); + setState(1788); match(DOT); - setState(1785); + setState(1789); anyIdentifierName(); - setState(1786); + setState(1790); match(LEFT_PARENTHESIS); - setState(1788); + setState(1792); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (ELLIPSIS - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(1787); + setState(1791); invocationArgList(); } } - setState(1790); + setState(1794); match(RIGHT_PARENTHESIS); } } @@ -10436,26 +10485,26 @@ public void exitRule(ParseTreeListener listener) { public final InvocationArgListContext invocationArgList() throws RecognitionException { InvocationArgListContext _localctx = new InvocationArgListContext(_ctx, getState()); - enterRule(_localctx, 260, RULE_invocationArgList); + enterRule(_localctx, 262, RULE_invocationArgList); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1792); + setState(1796); invocationArg(); - setState(1797); + setState(1801); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(1793); + setState(1797); match(COMMA); - setState(1794); + setState(1798); invocationArg(); } } - setState(1799); + setState(1803); _errHandler.sync(this); _la = _input.LA(1); } @@ -10498,29 +10547,29 @@ public void exitRule(ParseTreeListener listener) { public final InvocationArgContext invocationArg() throws RecognitionException { InvocationArgContext _localctx = new InvocationArgContext(_ctx, getState()); - enterRule(_localctx, 262, RULE_invocationArg); + enterRule(_localctx, 264, RULE_invocationArg); try { - setState(1803); + setState(1807); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,190,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(1800); + setState(1804); expression(0); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(1801); + setState(1805); namedArgs(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(1802); + setState(1806); restArgs(); } break; @@ -10568,40 +10617,40 @@ public void exitRule(ParseTreeListener listener) { public final ActionInvocationContext actionInvocation() throws RecognitionException { ActionInvocationContext _localctx = new ActionInvocationContext(_ctx, getState()); - enterRule(_localctx, 264, RULE_actionInvocation); + enterRule(_localctx, 266, RULE_actionInvocation); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1812); + setState(1816); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,192,_ctx) ) { case 1: { - setState(1808); + setState(1812); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(1805); + setState(1809); annotationAttachment(); } } - setState(1810); + setState(1814); _errHandler.sync(this); _la = _input.LA(1); } - setState(1811); + setState(1815); match(START); } break; } - setState(1814); + setState(1818); variableReference(0); - setState(1815); + setState(1819); match(RARROW); - setState(1816); + setState(1820); functionInvocation(); } } @@ -10643,26 +10692,26 @@ public void exitRule(ParseTreeListener listener) { public final ExpressionListContext expressionList() throws RecognitionException { ExpressionListContext _localctx = new ExpressionListContext(_ctx, getState()); - enterRule(_localctx, 266, RULE_expressionList); + enterRule(_localctx, 268, RULE_expressionList); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1818); + setState(1822); expression(0); - setState(1823); + setState(1827); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(1819); + setState(1823); match(COMMA); - setState(1820); + setState(1824); expression(0); } } - setState(1825); + setState(1829); _errHandler.sync(this); _la = _input.LA(1); } @@ -10700,13 +10749,13 @@ public void exitRule(ParseTreeListener listener) { public final ExpressionStmtContext expressionStmt() throws RecognitionException { ExpressionStmtContext _localctx = new ExpressionStmtContext(_ctx, getState()); - enterRule(_localctx, 268, RULE_expressionStmt); + enterRule(_localctx, 270, RULE_expressionStmt); try { enterOuterAlt(_localctx, 1); { - setState(1826); + setState(1830); expression(0); - setState(1827); + setState(1831); match(SEMICOLON); } } @@ -10747,23 +10796,23 @@ public void exitRule(ParseTreeListener listener) { public final TransactionStatementContext transactionStatement() throws RecognitionException { TransactionStatementContext _localctx = new TransactionStatementContext(_ctx, getState()); - enterRule(_localctx, 270, RULE_transactionStatement); + enterRule(_localctx, 272, RULE_transactionStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1829); + setState(1833); transactionClause(); - setState(1831); + setState(1835); _la = _input.LA(1); if (_la==ONRETRY) { { - setState(1830); + setState(1834); onretryClause(); } } - setState(1833); + setState(1837); committedAbortedClauses(); } } @@ -10801,30 +10850,30 @@ public void exitRule(ParseTreeListener listener) { public final CommittedAbortedClausesContext committedAbortedClauses() throws RecognitionException { CommittedAbortedClausesContext _localctx = new CommittedAbortedClausesContext(_ctx, getState()); - enterRule(_localctx, 272, RULE_committedAbortedClauses); + enterRule(_localctx, 274, RULE_committedAbortedClauses); int _la; try { - setState(1847); + setState(1851); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,199,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { { - setState(1836); + setState(1840); _la = _input.LA(1); if (_la==COMMITTED) { { - setState(1835); + setState(1839); committedClause(); } } - setState(1839); + setState(1843); _la = _input.LA(1); if (_la==ABORTED) { { - setState(1838); + setState(1842); abortedClause(); } } @@ -10836,20 +10885,20 @@ public final CommittedAbortedClausesContext committedAbortedClauses() throws Rec enterOuterAlt(_localctx, 2); { { - setState(1842); + setState(1846); _la = _input.LA(1); if (_la==ABORTED) { { - setState(1841); + setState(1845); abortedClause(); } } - setState(1845); + setState(1849); _la = _input.LA(1); if (_la==COMMITTED) { { - setState(1844); + setState(1848); committedClause(); } } @@ -10900,41 +10949,41 @@ public void exitRule(ParseTreeListener listener) { public final TransactionClauseContext transactionClause() throws RecognitionException { TransactionClauseContext _localctx = new TransactionClauseContext(_ctx, getState()); - enterRule(_localctx, 274, RULE_transactionClause); + enterRule(_localctx, 276, RULE_transactionClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1849); + setState(1853); match(TRANSACTION); - setState(1852); + setState(1856); _la = _input.LA(1); if (_la==WITH) { { - setState(1850); + setState(1854); match(WITH); - setState(1851); + setState(1855); transactionPropertyInitStatementList(); } } - setState(1854); - match(LEFT_BRACE); setState(1858); + match(LEFT_BRACE); + setState(1862); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1855); + setState(1859); statement(); } } - setState(1860); + setState(1864); _errHandler.sync(this); _la = _input.LA(1); } - setState(1861); + setState(1865); match(RIGHT_BRACE); } } @@ -10969,11 +11018,11 @@ public void exitRule(ParseTreeListener listener) { public final TransactionPropertyInitStatementContext transactionPropertyInitStatement() throws RecognitionException { TransactionPropertyInitStatementContext _localctx = new TransactionPropertyInitStatementContext(_ctx, getState()); - enterRule(_localctx, 276, RULE_transactionPropertyInitStatement); + enterRule(_localctx, 278, RULE_transactionPropertyInitStatement); try { enterOuterAlt(_localctx, 1); { - setState(1863); + setState(1867); retriesStatement(); } } @@ -11015,26 +11064,26 @@ public void exitRule(ParseTreeListener listener) { public final TransactionPropertyInitStatementListContext transactionPropertyInitStatementList() throws RecognitionException { TransactionPropertyInitStatementListContext _localctx = new TransactionPropertyInitStatementListContext(_ctx, getState()); - enterRule(_localctx, 278, RULE_transactionPropertyInitStatementList); + enterRule(_localctx, 280, RULE_transactionPropertyInitStatementList); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1865); + setState(1869); transactionPropertyInitStatement(); - setState(1870); + setState(1874); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(1866); + setState(1870); match(COMMA); - setState(1867); + setState(1871); transactionPropertyInitStatement(); } } - setState(1872); + setState(1876); _errHandler.sync(this); _la = _input.LA(1); } @@ -11077,30 +11126,30 @@ public void exitRule(ParseTreeListener listener) { public final LockStatementContext lockStatement() throws RecognitionException { LockStatementContext _localctx = new LockStatementContext(_ctx, getState()); - enterRule(_localctx, 280, RULE_lockStatement); + enterRule(_localctx, 282, RULE_lockStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1873); + setState(1877); match(LOCK); - setState(1874); - match(LEFT_BRACE); setState(1878); + match(LEFT_BRACE); + setState(1882); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1875); + setState(1879); statement(); } } - setState(1880); + setState(1884); _errHandler.sync(this); _la = _input.LA(1); } - setState(1881); + setState(1885); match(RIGHT_BRACE); } } @@ -11141,30 +11190,30 @@ public void exitRule(ParseTreeListener listener) { public final OnretryClauseContext onretryClause() throws RecognitionException { OnretryClauseContext _localctx = new OnretryClauseContext(_ctx, getState()); - enterRule(_localctx, 282, RULE_onretryClause); + enterRule(_localctx, 284, RULE_onretryClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1883); + setState(1887); match(ONRETRY); - setState(1884); - match(LEFT_BRACE); setState(1888); + match(LEFT_BRACE); + setState(1892); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1885); + setState(1889); statement(); } } - setState(1890); + setState(1894); _errHandler.sync(this); _la = _input.LA(1); } - setState(1891); + setState(1895); match(RIGHT_BRACE); } } @@ -11205,30 +11254,30 @@ public void exitRule(ParseTreeListener listener) { public final CommittedClauseContext committedClause() throws RecognitionException { CommittedClauseContext _localctx = new CommittedClauseContext(_ctx, getState()); - enterRule(_localctx, 284, RULE_committedClause); + enterRule(_localctx, 286, RULE_committedClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1893); + setState(1897); match(COMMITTED); - setState(1894); - match(LEFT_BRACE); setState(1898); + match(LEFT_BRACE); + setState(1902); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1895); + setState(1899); statement(); } } - setState(1900); + setState(1904); _errHandler.sync(this); _la = _input.LA(1); } - setState(1901); + setState(1905); match(RIGHT_BRACE); } } @@ -11269,30 +11318,30 @@ public void exitRule(ParseTreeListener listener) { public final AbortedClauseContext abortedClause() throws RecognitionException { AbortedClauseContext _localctx = new AbortedClauseContext(_ctx, getState()); - enterRule(_localctx, 286, RULE_abortedClause); + enterRule(_localctx, 288, RULE_abortedClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1903); + setState(1907); match(ABORTED); - setState(1904); - match(LEFT_BRACE); setState(1908); + match(LEFT_BRACE); + setState(1912); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(1905); + setState(1909); statement(); } } - setState(1910); + setState(1914); _errHandler.sync(this); _la = _input.LA(1); } - setState(1911); + setState(1915); match(RIGHT_BRACE); } } @@ -11326,13 +11375,13 @@ public void exitRule(ParseTreeListener listener) { public final AbortStatementContext abortStatement() throws RecognitionException { AbortStatementContext _localctx = new AbortStatementContext(_ctx, getState()); - enterRule(_localctx, 288, RULE_abortStatement); + enterRule(_localctx, 290, RULE_abortStatement); try { enterOuterAlt(_localctx, 1); { - setState(1913); + setState(1917); match(ABORT); - setState(1914); + setState(1918); match(SEMICOLON); } } @@ -11366,13 +11415,13 @@ public void exitRule(ParseTreeListener listener) { public final RetryStatementContext retryStatement() throws RecognitionException { RetryStatementContext _localctx = new RetryStatementContext(_ctx, getState()); - enterRule(_localctx, 290, RULE_retryStatement); + enterRule(_localctx, 292, RULE_retryStatement); try { enterOuterAlt(_localctx, 1); { - setState(1916); + setState(1920); match(RETRY); - setState(1917); + setState(1921); match(SEMICOLON); } } @@ -11409,15 +11458,15 @@ public void exitRule(ParseTreeListener listener) { public final RetriesStatementContext retriesStatement() throws RecognitionException { RetriesStatementContext _localctx = new RetriesStatementContext(_ctx, getState()); - enterRule(_localctx, 292, RULE_retriesStatement); + enterRule(_localctx, 294, RULE_retriesStatement); try { enterOuterAlt(_localctx, 1); { - setState(1919); + setState(1923); match(RETRIES); - setState(1920); + setState(1924); match(ASSIGN); - setState(1921); + setState(1925); expression(0); } } @@ -11452,11 +11501,11 @@ public void exitRule(ParseTreeListener listener) { public final NamespaceDeclarationStatementContext namespaceDeclarationStatement() throws RecognitionException { NamespaceDeclarationStatementContext _localctx = new NamespaceDeclarationStatementContext(_ctx, getState()); - enterRule(_localctx, 294, RULE_namespaceDeclarationStatement); + enterRule(_localctx, 296, RULE_namespaceDeclarationStatement); try { enterOuterAlt(_localctx, 1); { - setState(1923); + setState(1927); namespaceDeclaration(); } } @@ -11493,27 +11542,27 @@ public void exitRule(ParseTreeListener listener) { public final NamespaceDeclarationContext namespaceDeclaration() throws RecognitionException { NamespaceDeclarationContext _localctx = new NamespaceDeclarationContext(_ctx, getState()); - enterRule(_localctx, 296, RULE_namespaceDeclaration); + enterRule(_localctx, 298, RULE_namespaceDeclaration); int _la; try { enterOuterAlt(_localctx, 1); { - setState(1925); + setState(1929); match(XMLNS); - setState(1926); + setState(1930); match(QuotedStringLiteral); - setState(1929); + setState(1933); _la = _input.LA(1); if (_la==AS) { { - setState(1927); + setState(1931); match(AS); - setState(1928); + setState(1932); match(Identifier); } } - setState(1931); + setState(1935); match(SEMICOLON); } } @@ -12173,14 +12222,14 @@ private ExpressionContext expression(int _p) throws RecognitionException { int _parentState = getState(); ExpressionContext _localctx = new ExpressionContext(_ctx, _parentState); ExpressionContext _prevctx = _localctx; - int _startState = 298; - enterRecursionRule(_localctx, 298, RULE_expression, _p); + int _startState = 300; + enterRecursionRule(_localctx, 300, RULE_expression, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(1995); + setState(1999); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,215,_ctx) ) { case 1: @@ -12189,7 +12238,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _ctx = _localctx; _prevctx = _localctx; - setState(1934); + setState(1938); simpleLiteral(); } break; @@ -12198,7 +12247,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new ListConstructorExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1935); + setState(1939); listConstructorExpr(); } break; @@ -12207,7 +12256,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new RecordLiteralExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1936); + setState(1940); recordLiteral(); } break; @@ -12216,7 +12265,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new XmlLiteralExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1937); + setState(1941); xmlLiteral(); } break; @@ -12225,7 +12274,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new TableLiteralExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1938); + setState(1942); tableLiteral(); } break; @@ -12234,7 +12283,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new StringTemplateLiteralExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1939); + setState(1943); stringTemplateLiteral(); } break; @@ -12243,31 +12292,31 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new VariableReferenceExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1947); + setState(1951); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,209,_ctx) ) { case 1: { - setState(1943); + setState(1947); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(1940); + setState(1944); annotationAttachment(); } } - setState(1945); + setState(1949); _errHandler.sync(this); _la = _input.LA(1); } - setState(1946); + setState(1950); match(START); } break; } - setState(1949); + setState(1953); variableReference(0); } break; @@ -12276,7 +12325,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new ActionInvocationExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1950); + setState(1954); actionInvocation(); } break; @@ -12285,7 +12334,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new TypeInitExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1951); + setState(1955); typeInitExpr(); } break; @@ -12294,7 +12343,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new ServiceConstructorExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1952); + setState(1956); serviceConstructorExpr(); } break; @@ -12303,7 +12352,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new TableQueryExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1953); + setState(1957); tableQuery(); } break; @@ -12312,9 +12361,9 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new CheckedExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1954); + setState(1958); match(CHECK); - setState(1955); + setState(1959); expression(26); } break; @@ -12323,9 +12372,9 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new CheckPanickedExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1956); + setState(1960); match(CHECKPANIC); - setState(1957); + setState(1961); expression(25); } break; @@ -12334,14 +12383,14 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new UnaryExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1958); + setState(1962); _la = _input.LA(1); if ( !(_la==TYPEOF || ((((_la - 141)) & ~0x3f) == 0 && ((1L << (_la - 141)) & ((1L << (ADD - 141)) | (1L << (SUB - 141)) | (1L << (NOT - 141)) | (1L << (BIT_COMPLEMENT - 141)))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(1959); + setState(1963); expression(24); } break; @@ -12350,31 +12399,31 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new TypeConversionExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1960); + setState(1964); match(LT); - setState(1970); + setState(1974); switch (_input.LA(1)) { case AT: { - setState(1962); + setState(1966); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(1961); + setState(1965); annotationAttachment(); } } - setState(1964); + setState(1968); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==AT ); - setState(1967); + setState(1971); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (Identifier - 132)))) != 0)) { { - setState(1966); + setState(1970); typeName(0); } } @@ -12408,16 +12457,16 @@ private ExpressionContext expression(int _p) throws RecognitionException { case LEFT_BRACKET: case Identifier: { - setState(1969); + setState(1973); typeName(0); } break; default: throw new NoViableAltException(this); } - setState(1972); + setState(1976); match(GT); - setState(1973); + setState(1977); expression(23); } break; @@ -12426,7 +12475,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new LambdaFunctionExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1975); + setState(1979); lambdaFunction(); } break; @@ -12435,7 +12484,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new ArrowFunctionExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1976); + setState(1980); arrowFunction(); } break; @@ -12444,11 +12493,11 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new GroupExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1977); + setState(1981); match(LEFT_PARENTHESIS); - setState(1978); + setState(1982); expression(0); - setState(1979); + setState(1983); match(RIGHT_PARENTHESIS); } break; @@ -12457,20 +12506,20 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new WaitExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1981); + setState(1985); match(WAIT); - setState(1984); + setState(1988); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,213,_ctx) ) { case 1: { - setState(1982); + setState(1986); waitForCollection(); } break; case 2: { - setState(1983); + setState(1987); expression(0); } break; @@ -12482,7 +12531,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new TrapExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1986); + setState(1990); trapExpr(); } break; @@ -12491,18 +12540,18 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new WorkerReceiveExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1987); + setState(1991); match(LARROW); - setState(1988); + setState(1992); peerWorker(); - setState(1991); + setState(1995); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,214,_ctx) ) { case 1: { - setState(1989); + setState(1993); match(COMMA); - setState(1990); + setState(1994); expression(0); } break; @@ -12514,7 +12563,7 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new FlushWorkerExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1993); + setState(1997); flushWorker(); } break; @@ -12523,13 +12572,13 @@ private ExpressionContext expression(int _p) throws RecognitionException { _localctx = new TypeAccessExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(1994); + setState(1998); typeDescExpr(); } break; } _ctx.stop = _input.LT(-1); - setState(2045); + setState(2049); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,217,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -12537,23 +12586,23 @@ private ExpressionContext expression(int _p) throws RecognitionException { if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(2043); + setState(2047); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,216,_ctx) ) { case 1: { _localctx = new BinaryDivMulModExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(1997); + setState(2001); if (!(precpred(_ctx, 22))) throw new FailedPredicateException(this, "precpred(_ctx, 22)"); - setState(1998); + setState(2002); _la = _input.LA(1); if ( !(((((_la - 143)) & ~0x3f) == 0 && ((1L << (_la - 143)) & ((1L << (MUL - 143)) | (1L << (DIV - 143)) | (1L << (MOD - 143)))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(1999); + setState(2003); expression(23); } break; @@ -12561,16 +12610,16 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BinaryAddSubExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2000); + setState(2004); if (!(precpred(_ctx, 21))) throw new FailedPredicateException(this, "precpred(_ctx, 21)"); - setState(2001); + setState(2005); _la = _input.LA(1); if ( !(_la==ADD || _la==SUB) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2002); + setState(2006); expression(22); } break; @@ -12578,13 +12627,13 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BitwiseShiftExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2003); + setState(2007); if (!(precpred(_ctx, 20))) throw new FailedPredicateException(this, "precpred(_ctx, 20)"); { - setState(2004); + setState(2008); shiftExpression(); } - setState(2005); + setState(2009); expression(21); } break; @@ -12592,16 +12641,16 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new IntegerRangeExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2007); + setState(2011); if (!(precpred(_ctx, 19))) throw new FailedPredicateException(this, "precpred(_ctx, 19)"); - setState(2008); + setState(2012); _la = _input.LA(1); if ( !(_la==ELLIPSIS || _la==HALF_OPEN_RANGE) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2009); + setState(2013); expression(20); } break; @@ -12609,16 +12658,16 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BinaryCompareExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2010); + setState(2014); if (!(precpred(_ctx, 18))) throw new FailedPredicateException(this, "precpred(_ctx, 18)"); - setState(2011); + setState(2015); _la = _input.LA(1); if ( !(((((_la - 149)) & ~0x3f) == 0 && ((1L << (_la - 149)) & ((1L << (GT - 149)) | (1L << (LT - 149)) | (1L << (GT_EQUAL - 149)) | (1L << (LT_EQUAL - 149)))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2012); + setState(2016); expression(19); } break; @@ -12626,16 +12675,16 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BinaryEqualExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2013); + setState(2017); if (!(precpred(_ctx, 16))) throw new FailedPredicateException(this, "precpred(_ctx, 16)"); - setState(2014); + setState(2018); _la = _input.LA(1); if ( !(_la==EQUAL || _la==NOT_EQUAL) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2015); + setState(2019); expression(17); } break; @@ -12643,16 +12692,16 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BinaryRefEqualExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2016); + setState(2020); if (!(precpred(_ctx, 15))) throw new FailedPredicateException(this, "precpred(_ctx, 15)"); - setState(2017); + setState(2021); _la = _input.LA(1); if ( !(_la==REF_EQUAL || _la==REF_NOT_EQUAL) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2018); + setState(2022); expression(16); } break; @@ -12660,16 +12709,16 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BitwiseExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2019); + setState(2023); if (!(precpred(_ctx, 14))) throw new FailedPredicateException(this, "precpred(_ctx, 14)"); - setState(2020); + setState(2024); _la = _input.LA(1); if ( !(((((_la - 157)) & ~0x3f) == 0 && ((1L << (_la - 157)) & ((1L << (BIT_AND - 157)) | (1L << (BIT_XOR - 157)) | (1L << (PIPE - 157)))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2021); + setState(2025); expression(15); } break; @@ -12677,11 +12726,11 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BinaryAndExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2022); + setState(2026); if (!(precpred(_ctx, 13))) throw new FailedPredicateException(this, "precpred(_ctx, 13)"); - setState(2023); + setState(2027); match(AND); - setState(2024); + setState(2028); expression(14); } break; @@ -12689,11 +12738,11 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new BinaryOrExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2025); + setState(2029); if (!(precpred(_ctx, 12))) throw new FailedPredicateException(this, "precpred(_ctx, 12)"); - setState(2026); + setState(2030); match(OR); - setState(2027); + setState(2031); expression(13); } break; @@ -12701,11 +12750,11 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new ElvisExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2028); + setState(2032); if (!(precpred(_ctx, 11))) throw new FailedPredicateException(this, "precpred(_ctx, 11)"); - setState(2029); + setState(2033); match(ELVIS); - setState(2030); + setState(2034); expression(12); } break; @@ -12713,15 +12762,15 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new TernaryExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2031); + setState(2035); if (!(precpred(_ctx, 10))) throw new FailedPredicateException(this, "precpred(_ctx, 10)"); - setState(2032); + setState(2036); match(QUESTION_MARK); - setState(2033); + setState(2037); expression(0); - setState(2034); + setState(2038); match(COLON); - setState(2035); + setState(2039); expression(11); } break; @@ -12729,11 +12778,11 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new TypeTestExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2037); + setState(2041); if (!(precpred(_ctx, 17))) throw new FailedPredicateException(this, "precpred(_ctx, 17)"); - setState(2038); + setState(2042); match(IS); - setState(2039); + setState(2043); typeName(0); } break; @@ -12741,18 +12790,18 @@ private ExpressionContext expression(int _p) throws RecognitionException { { _localctx = new WorkerSendSyncExpressionContext(new ExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_expression); - setState(2040); + setState(2044); if (!(precpred(_ctx, 6))) throw new FailedPredicateException(this, "precpred(_ctx, 6)"); - setState(2041); + setState(2045); match(SYNCRARROW); - setState(2042); + setState(2046); peerWorker(); } break; } } } - setState(2047); + setState(2051); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,217,_ctx); } @@ -12872,14 +12921,14 @@ private ConstantExpressionContext constantExpression(int _p) throws RecognitionE int _parentState = getState(); ConstantExpressionContext _localctx = new ConstantExpressionContext(_ctx, _parentState); ConstantExpressionContext _prevctx = _localctx; - int _startState = 300; - enterRecursionRule(_localctx, 300, RULE_constantExpression, _p); + int _startState = 302; + enterRecursionRule(_localctx, 302, RULE_constantExpression, _p); int _la; try { int _alt; enterOuterAlt(_localctx, 1); { - setState(2055); + setState(2059); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,218,_ctx) ) { case 1: @@ -12888,7 +12937,7 @@ private ConstantExpressionContext constantExpression(int _p) throws RecognitionE _ctx = _localctx; _prevctx = _localctx; - setState(2049); + setState(2053); simpleLiteral(); } break; @@ -12897,7 +12946,7 @@ private ConstantExpressionContext constantExpression(int _p) throws RecognitionE _localctx = new ConstRecordLiteralExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(2050); + setState(2054); recordLiteral(); } break; @@ -12906,17 +12955,17 @@ private ConstantExpressionContext constantExpression(int _p) throws RecognitionE _localctx = new ConstGroupExpressionContext(_localctx); _ctx = _localctx; _prevctx = _localctx; - setState(2051); + setState(2055); match(LEFT_PARENTHESIS); - setState(2052); + setState(2056); constantExpression(0); - setState(2053); + setState(2057); match(RIGHT_PARENTHESIS); } break; } _ctx.stop = _input.LT(-1); - setState(2065); + setState(2069); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,220,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { @@ -12924,23 +12973,23 @@ private ConstantExpressionContext constantExpression(int _p) throws RecognitionE if ( _parseListeners!=null ) triggerExitRuleEvent(); _prevctx = _localctx; { - setState(2063); + setState(2067); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,219,_ctx) ) { case 1: { _localctx = new ConstDivMulModExpressionContext(new ConstantExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_constantExpression); - setState(2057); + setState(2061); if (!(precpred(_ctx, 3))) throw new FailedPredicateException(this, "precpred(_ctx, 3)"); - setState(2058); + setState(2062); _la = _input.LA(1); if ( !(_la==MUL || _la==DIV) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2059); + setState(2063); constantExpression(4); } break; @@ -12948,23 +12997,23 @@ private ConstantExpressionContext constantExpression(int _p) throws RecognitionE { _localctx = new ConstAddSubExpressionContext(new ConstantExpressionContext(_parentctx, _parentState)); pushNewRecursionContext(_localctx, _startState, RULE_constantExpression); - setState(2060); + setState(2064); if (!(precpred(_ctx, 2))) throw new FailedPredicateException(this, "precpred(_ctx, 2)"); - setState(2061); + setState(2065); _la = _input.LA(1); if ( !(_la==ADD || _la==SUB) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2062); + setState(2066); constantExpression(3); } break; } } } - setState(2067); + setState(2071); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,220,_ctx); } @@ -13001,11 +13050,11 @@ public void exitRule(ParseTreeListener listener) { public final TypeDescExprContext typeDescExpr() throws RecognitionException { TypeDescExprContext _localctx = new TypeDescExprContext(_ctx, getState()); - enterRule(_localctx, 302, RULE_typeDescExpr); + enterRule(_localctx, 304, RULE_typeDescExpr); try { enterOuterAlt(_localctx, 1); { - setState(2068); + setState(2072); typeName(0); } } @@ -13046,34 +13095,34 @@ public void exitRule(ParseTreeListener listener) { public final TypeInitExprContext typeInitExpr() throws RecognitionException { TypeInitExprContext _localctx = new TypeInitExprContext(_ctx, getState()); - enterRule(_localctx, 304, RULE_typeInitExpr); + enterRule(_localctx, 306, RULE_typeInitExpr); int _la; try { - setState(2086); + setState(2090); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,224,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(2070); + setState(2074); match(NEW); - setState(2076); + setState(2080); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,222,_ctx) ) { case 1: { - setState(2071); + setState(2075); match(LEFT_PARENTHESIS); - setState(2073); + setState(2077); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (ELLIPSIS - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(2072); + setState(2076); invocationArgList(); } } - setState(2075); + setState(2079); match(RIGHT_PARENTHESIS); } break; @@ -13083,22 +13132,22 @@ public final TypeInitExprContext typeInitExpr() throws RecognitionException { case 2: enterOuterAlt(_localctx, 2); { - setState(2078); + setState(2082); match(NEW); - setState(2079); + setState(2083); userDefineTypeName(); - setState(2080); + setState(2084); match(LEFT_PARENTHESIS); - setState(2082); + setState(2086); _la = _input.LA(1); if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (FOREACH - 67)) | (1L << (CONTINUE - 67)) | (1L << (TRAP - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (ELLIPSIS - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { - setState(2081); + setState(2085); invocationArgList(); } } - setState(2084); + setState(2088); match(RIGHT_PARENTHESIS); } break; @@ -13142,28 +13191,28 @@ public void exitRule(ParseTreeListener listener) { public final ServiceConstructorExprContext serviceConstructorExpr() throws RecognitionException { ServiceConstructorExprContext _localctx = new ServiceConstructorExprContext(_ctx, getState()); - enterRule(_localctx, 306, RULE_serviceConstructorExpr); + enterRule(_localctx, 308, RULE_serviceConstructorExpr); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2091); + setState(2095); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(2088); + setState(2092); annotationAttachment(); } } - setState(2093); + setState(2097); _errHandler.sync(this); _la = _input.LA(1); } - setState(2094); + setState(2098); match(SERVICE); - setState(2095); + setState(2099); serviceBody(); } } @@ -13199,13 +13248,13 @@ public void exitRule(ParseTreeListener listener) { public final TrapExprContext trapExpr() throws RecognitionException { TrapExprContext _localctx = new TrapExprContext(_ctx, getState()); - enterRule(_localctx, 308, RULE_trapExpr); + enterRule(_localctx, 310, RULE_trapExpr); try { enterOuterAlt(_localctx, 1); { - setState(2097); + setState(2101); match(TRAP); - setState(2098); + setState(2102); expression(0); } } @@ -13251,45 +13300,45 @@ public void exitRule(ParseTreeListener listener) { public final ShiftExpressionContext shiftExpression() throws RecognitionException { ShiftExpressionContext _localctx = new ShiftExpressionContext(_ctx, getState()); - enterRule(_localctx, 310, RULE_shiftExpression); + enterRule(_localctx, 312, RULE_shiftExpression); try { - setState(2114); + setState(2118); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,226,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(2100); + setState(2104); match(LT); - setState(2101); + setState(2105); shiftExprPredicate(); - setState(2102); + setState(2106); match(LT); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(2104); + setState(2108); match(GT); - setState(2105); + setState(2109); shiftExprPredicate(); - setState(2106); + setState(2110); match(GT); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(2108); + setState(2112); match(GT); - setState(2109); + setState(2113); shiftExprPredicate(); - setState(2110); + setState(2114); match(GT); - setState(2111); + setState(2115); shiftExprPredicate(); - setState(2112); + setState(2116); match(GT); } break; @@ -13323,11 +13372,11 @@ public void exitRule(ParseTreeListener listener) { public final ShiftExprPredicateContext shiftExprPredicate() throws RecognitionException { ShiftExprPredicateContext _localctx = new ShiftExprPredicateContext(_ctx, getState()); - enterRule(_localctx, 312, RULE_shiftExprPredicate); + enterRule(_localctx, 314, RULE_shiftExprPredicate); try { enterOuterAlt(_localctx, 1); { - setState(2116); + setState(2120); if (!(_input.get(_input.index() -1).getType() != WS)) throw new FailedPredicateException(this, "_input.get(_input.index() -1).getType() != WS"); } } @@ -13364,23 +13413,23 @@ public void exitRule(ParseTreeListener listener) { public final NameReferenceContext nameReference() throws RecognitionException { NameReferenceContext _localctx = new NameReferenceContext(_ctx, getState()); - enterRule(_localctx, 314, RULE_nameReference); + enterRule(_localctx, 316, RULE_nameReference); try { enterOuterAlt(_localctx, 1); { - setState(2120); + setState(2124); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,227,_ctx) ) { case 1: { - setState(2118); + setState(2122); match(Identifier); - setState(2119); + setState(2123); match(COLON); } break; } - setState(2122); + setState(2126); match(Identifier); } } @@ -13417,23 +13466,23 @@ public void exitRule(ParseTreeListener listener) { public final FunctionNameReferenceContext functionNameReference() throws RecognitionException { FunctionNameReferenceContext _localctx = new FunctionNameReferenceContext(_ctx, getState()); - enterRule(_localctx, 316, RULE_functionNameReference); + enterRule(_localctx, 318, RULE_functionNameReference); try { enterOuterAlt(_localctx, 1); { - setState(2126); + setState(2130); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,228,_ctx) ) { case 1: { - setState(2124); + setState(2128); match(Identifier); - setState(2125); + setState(2129); match(COLON); } break; } - setState(2128); + setState(2132); anyIdentifierName(); } } @@ -13475,28 +13524,28 @@ public void exitRule(ParseTreeListener listener) { public final ReturnParameterContext returnParameter() throws RecognitionException { ReturnParameterContext _localctx = new ReturnParameterContext(_ctx, getState()); - enterRule(_localctx, 318, RULE_returnParameter); + enterRule(_localctx, 320, RULE_returnParameter); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2130); - match(RETURNS); setState(2134); + match(RETURNS); + setState(2138); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(2131); + setState(2135); annotationAttachment(); } } - setState(2136); + setState(2140); _errHandler.sync(this); _la = _input.LA(1); } - setState(2137); + setState(2141); typeName(0); } } @@ -13537,26 +13586,26 @@ public void exitRule(ParseTreeListener listener) { public final LambdaReturnParameterContext lambdaReturnParameter() throws RecognitionException { LambdaReturnParameterContext _localctx = new LambdaReturnParameterContext(_ctx, getState()); - enterRule(_localctx, 320, RULE_lambdaReturnParameter); + enterRule(_localctx, 322, RULE_lambdaReturnParameter); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2142); + setState(2146); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(2139); + setState(2143); annotationAttachment(); } } - setState(2144); + setState(2148); _errHandler.sync(this); _la = _input.LA(1); } - setState(2145); + setState(2149); typeName(0); } } @@ -13598,26 +13647,26 @@ public void exitRule(ParseTreeListener listener) { public final ParameterTypeNameListContext parameterTypeNameList() throws RecognitionException { ParameterTypeNameListContext _localctx = new ParameterTypeNameListContext(_ctx, getState()); - enterRule(_localctx, 322, RULE_parameterTypeNameList); + enterRule(_localctx, 324, RULE_parameterTypeNameList); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2147); + setState(2151); parameterTypeName(); - setState(2152); + setState(2156); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(2148); + setState(2152); match(COMMA); - setState(2149); + setState(2153); parameterTypeName(); } } - setState(2154); + setState(2158); _errHandler.sync(this); _la = _input.LA(1); } @@ -13654,11 +13703,11 @@ public void exitRule(ParseTreeListener listener) { public final ParameterTypeNameContext parameterTypeName() throws RecognitionException { ParameterTypeNameContext _localctx = new ParameterTypeNameContext(_ctx, getState()); - enterRule(_localctx, 324, RULE_parameterTypeName); + enterRule(_localctx, 326, RULE_parameterTypeName); try { enterOuterAlt(_localctx, 1); { - setState(2155); + setState(2159); typeName(0); } } @@ -13700,26 +13749,26 @@ public void exitRule(ParseTreeListener listener) { public final ParameterListContext parameterList() throws RecognitionException { ParameterListContext _localctx = new ParameterListContext(_ctx, getState()); - enterRule(_localctx, 326, RULE_parameterList); + enterRule(_localctx, 328, RULE_parameterList); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2157); + setState(2161); parameter(); - setState(2162); + setState(2166); _errHandler.sync(this); _la = _input.LA(1); while (_la==COMMA) { { { - setState(2158); + setState(2162); match(COMMA); - setState(2159); + setState(2163); parameter(); } } - setState(2164); + setState(2168); _errHandler.sync(this); _la = _input.LA(1); } @@ -13764,37 +13813,37 @@ public void exitRule(ParseTreeListener listener) { public final ParameterContext parameter() throws RecognitionException { ParameterContext _localctx = new ParameterContext(_ctx, getState()); - enterRule(_localctx, 328, RULE_parameter); + enterRule(_localctx, 330, RULE_parameter); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2168); + setState(2172); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(2165); + setState(2169); annotationAttachment(); } } - setState(2170); + setState(2174); _errHandler.sync(this); _la = _input.LA(1); } - setState(2172); + setState(2176); _la = _input.LA(1); if (_la==PUBLIC) { { - setState(2171); + setState(2175); match(PUBLIC); } } - setState(2174); + setState(2178); typeName(0); - setState(2175); + setState(2179); match(Identifier); } } @@ -13833,15 +13882,15 @@ public void exitRule(ParseTreeListener listener) { public final DefaultableParameterContext defaultableParameter() throws RecognitionException { DefaultableParameterContext _localctx = new DefaultableParameterContext(_ctx, getState()); - enterRule(_localctx, 330, RULE_defaultableParameter); + enterRule(_localctx, 332, RULE_defaultableParameter); try { enterOuterAlt(_localctx, 1); { - setState(2177); + setState(2181); parameter(); - setState(2178); + setState(2182); match(ASSIGN); - setState(2179); + setState(2183); expression(0); } } @@ -13884,30 +13933,30 @@ public void exitRule(ParseTreeListener listener) { public final RestParameterContext restParameter() throws RecognitionException { RestParameterContext _localctx = new RestParameterContext(_ctx, getState()); - enterRule(_localctx, 332, RULE_restParameter); + enterRule(_localctx, 334, RULE_restParameter); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2184); + setState(2188); _errHandler.sync(this); _la = _input.LA(1); while (_la==AT) { { { - setState(2181); + setState(2185); annotationAttachment(); } } - setState(2186); + setState(2190); _errHandler.sync(this); _la = _input.LA(1); } - setState(2187); + setState(2191); typeName(0); - setState(2188); + setState(2192); match(ELLIPSIS); - setState(2189); + setState(2193); match(Identifier); } } @@ -13958,53 +14007,53 @@ public void exitRule(ParseTreeListener listener) { public final FormalParameterListContext formalParameterList() throws RecognitionException { FormalParameterListContext _localctx = new FormalParameterListContext(_ctx, getState()); - enterRule(_localctx, 334, RULE_formalParameterList); + enterRule(_localctx, 336, RULE_formalParameterList); int _la; try { int _alt; - setState(2210); + setState(2214); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,240,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(2193); + setState(2197); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,236,_ctx) ) { case 1: { - setState(2191); + setState(2195); parameter(); } break; case 2: { - setState(2192); + setState(2196); defaultableParameter(); } break; } - setState(2202); + setState(2206); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,238,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(2195); + setState(2199); match(COMMA); - setState(2198); + setState(2202); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,237,_ctx) ) { case 1: { - setState(2196); + setState(2200); parameter(); } break; case 2: { - setState(2197); + setState(2201); defaultableParameter(); } break; @@ -14012,17 +14061,17 @@ public final FormalParameterListContext formalParameterList() throws Recognition } } } - setState(2204); + setState(2208); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,238,_ctx); } - setState(2207); + setState(2211); _la = _input.LA(1); if (_la==COMMA) { { - setState(2205); + setState(2209); match(COMMA); - setState(2206); + setState(2210); restParameter(); } } @@ -14032,7 +14081,7 @@ public final FormalParameterListContext formalParameterList() throws Recognition case 2: enterOuterAlt(_localctx, 2); { - setState(2209); + setState(2213); restParameter(); } break; @@ -14082,76 +14131,76 @@ public void exitRule(ParseTreeListener listener) { public final SimpleLiteralContext simpleLiteral() throws RecognitionException { SimpleLiteralContext _localctx = new SimpleLiteralContext(_ctx, getState()); - enterRule(_localctx, 336, RULE_simpleLiteral); + enterRule(_localctx, 338, RULE_simpleLiteral); int _la; try { - setState(2225); + setState(2229); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,243,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(2213); + setState(2217); _la = _input.LA(1); if (_la==SUB) { { - setState(2212); + setState(2216); match(SUB); } } - setState(2215); + setState(2219); integerLiteral(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(2217); + setState(2221); _la = _input.LA(1); if (_la==SUB) { { - setState(2216); + setState(2220); match(SUB); } } - setState(2219); + setState(2223); floatingPointLiteral(); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(2220); + setState(2224); match(QuotedStringLiteral); } break; case 4: enterOuterAlt(_localctx, 4); { - setState(2221); + setState(2225); match(BooleanLiteral); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(2222); + setState(2226); nilLiteral(); } break; case 6: enterOuterAlt(_localctx, 6); { - setState(2223); + setState(2227); blobLiteral(); } break; case 7: enterOuterAlt(_localctx, 7); { - setState(2224); + setState(2228); match(NullLiteral); } break; @@ -14187,12 +14236,12 @@ public void exitRule(ParseTreeListener listener) { public final FloatingPointLiteralContext floatingPointLiteral() throws RecognitionException { FloatingPointLiteralContext _localctx = new FloatingPointLiteralContext(_ctx, getState()); - enterRule(_localctx, 338, RULE_floatingPointLiteral); + enterRule(_localctx, 340, RULE_floatingPointLiteral); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2227); + setState(2231); _la = _input.LA(1); if ( !(_la==HexadecimalFloatingPointLiteral || _la==DecimalFloatingPointNumber) ) { _errHandler.recoverInline(this); @@ -14231,12 +14280,12 @@ public void exitRule(ParseTreeListener listener) { public final IntegerLiteralContext integerLiteral() throws RecognitionException { IntegerLiteralContext _localctx = new IntegerLiteralContext(_ctx, getState()); - enterRule(_localctx, 340, RULE_integerLiteral); + enterRule(_localctx, 342, RULE_integerLiteral); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2229); + setState(2233); _la = _input.LA(1); if ( !(_la==DecimalIntegerLiteral || _la==HexIntegerLiteral) ) { _errHandler.recoverInline(this); @@ -14275,13 +14324,13 @@ public void exitRule(ParseTreeListener listener) { public final NilLiteralContext nilLiteral() throws RecognitionException { NilLiteralContext _localctx = new NilLiteralContext(_ctx, getState()); - enterRule(_localctx, 342, RULE_nilLiteral); + enterRule(_localctx, 344, RULE_nilLiteral); try { enterOuterAlt(_localctx, 1); { - setState(2231); + setState(2235); match(LEFT_PARENTHESIS); - setState(2232); + setState(2236); match(RIGHT_PARENTHESIS); } } @@ -14315,12 +14364,12 @@ public void exitRule(ParseTreeListener listener) { public final BlobLiteralContext blobLiteral() throws RecognitionException { BlobLiteralContext _localctx = new BlobLiteralContext(_ctx, getState()); - enterRule(_localctx, 344, RULE_blobLiteral); + enterRule(_localctx, 346, RULE_blobLiteral); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2234); + setState(2238); _la = _input.LA(1); if ( !(_la==Base16BlobLiteral || _la==Base64BlobLiteral) ) { _errHandler.recoverInline(this); @@ -14362,15 +14411,15 @@ public void exitRule(ParseTreeListener listener) { public final NamedArgsContext namedArgs() throws RecognitionException { NamedArgsContext _localctx = new NamedArgsContext(_ctx, getState()); - enterRule(_localctx, 346, RULE_namedArgs); + enterRule(_localctx, 348, RULE_namedArgs); try { enterOuterAlt(_localctx, 1); { - setState(2236); + setState(2240); match(Identifier); - setState(2237); + setState(2241); match(ASSIGN); - setState(2238); + setState(2242); expression(0); } } @@ -14406,13 +14455,13 @@ public void exitRule(ParseTreeListener listener) { public final RestArgsContext restArgs() throws RecognitionException { RestArgsContext _localctx = new RestArgsContext(_ctx, getState()); - enterRule(_localctx, 348, RULE_restArgs); + enterRule(_localctx, 350, RULE_restArgs); try { enterOuterAlt(_localctx, 1); { - setState(2240); + setState(2244); match(ELLIPSIS); - setState(2241); + setState(2245); expression(0); } } @@ -14449,15 +14498,15 @@ public void exitRule(ParseTreeListener listener) { public final XmlLiteralContext xmlLiteral() throws RecognitionException { XmlLiteralContext _localctx = new XmlLiteralContext(_ctx, getState()); - enterRule(_localctx, 350, RULE_xmlLiteral); + enterRule(_localctx, 352, RULE_xmlLiteral); try { enterOuterAlt(_localctx, 1); { - setState(2243); + setState(2247); match(XMLLiteralStart); - setState(2244); + setState(2248); xmlItem(); - setState(2245); + setState(2249); match(XMLLiteralEnd); } } @@ -14502,28 +14551,28 @@ public void exitRule(ParseTreeListener listener) { public final XmlItemContext xmlItem() throws RecognitionException { XmlItemContext _localctx = new XmlItemContext(_ctx, getState()); - enterRule(_localctx, 352, RULE_xmlItem); + enterRule(_localctx, 354, RULE_xmlItem); try { - setState(2252); + setState(2256); switch (_input.LA(1)) { case XML_TAG_OPEN: enterOuterAlt(_localctx, 1); { - setState(2247); + setState(2251); element(); } break; case XML_TAG_SPECIAL_OPEN: enterOuterAlt(_localctx, 2); { - setState(2248); + setState(2252); procIns(); } break; case XML_COMMENT_START: enterOuterAlt(_localctx, 3); { - setState(2249); + setState(2253); comment(); } break; @@ -14531,14 +14580,14 @@ public final XmlItemContext xmlItem() throws RecognitionException { case XMLText: enterOuterAlt(_localctx, 4); { - setState(2250); + setState(2254); text(); } break; case CDATA: enterOuterAlt(_localctx, 5); { - setState(2251); + setState(2255); match(CDATA); } break; @@ -14602,67 +14651,67 @@ public void exitRule(ParseTreeListener listener) { public final ContentContext content() throws RecognitionException { ContentContext _localctx = new ContentContext(_ctx, getState()); - enterRule(_localctx, 354, RULE_content); + enterRule(_localctx, 356, RULE_content); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2255); + setState(2259); _la = _input.LA(1); if (_la==XMLTemplateText || _la==XMLText) { { - setState(2254); + setState(2258); text(); } } - setState(2268); + setState(2272); _errHandler.sync(this); _la = _input.LA(1); - while (((((_la - 220)) & ~0x3f) == 0 && ((1L << (_la - 220)) & ((1L << (XML_COMMENT_START - 220)) | (1L << (CDATA - 220)) | (1L << (XML_TAG_OPEN - 220)) | (1L << (XML_TAG_SPECIAL_OPEN - 220)))) != 0)) { + while (((((_la - 221)) & ~0x3f) == 0 && ((1L << (_la - 221)) & ((1L << (XML_COMMENT_START - 221)) | (1L << (CDATA - 221)) | (1L << (XML_TAG_OPEN - 221)) | (1L << (XML_TAG_SPECIAL_OPEN - 221)))) != 0)) { { { - setState(2261); + setState(2265); switch (_input.LA(1)) { case XML_TAG_OPEN: { - setState(2257); + setState(2261); element(); } break; case CDATA: { - setState(2258); + setState(2262); match(CDATA); } break; case XML_TAG_SPECIAL_OPEN: { - setState(2259); + setState(2263); procIns(); } break; case XML_COMMENT_START: { - setState(2260); + setState(2264); comment(); } break; default: throw new NoViableAltException(this); } - setState(2264); + setState(2268); _la = _input.LA(1); if (_la==XMLTemplateText || _la==XMLText) { { - setState(2263); + setState(2267); text(); } } } } - setState(2270); + setState(2274); _errHandler.sync(this); _la = _input.LA(1); } @@ -14716,46 +14765,46 @@ public void exitRule(ParseTreeListener listener) { public final CommentContext comment() throws RecognitionException { CommentContext _localctx = new CommentContext(_ctx, getState()); - enterRule(_localctx, 356, RULE_comment); + enterRule(_localctx, 358, RULE_comment); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2271); + setState(2275); match(XML_COMMENT_START); - setState(2278); + setState(2282); _errHandler.sync(this); _la = _input.LA(1); while (_la==XMLCommentTemplateText) { { { - setState(2272); + setState(2276); match(XMLCommentTemplateText); - setState(2273); + setState(2277); expression(0); - setState(2274); + setState(2278); match(RIGHT_BRACE); } } - setState(2280); + setState(2284); _errHandler.sync(this); _la = _input.LA(1); } - setState(2284); + setState(2288); _errHandler.sync(this); _la = _input.LA(1); while (_la==XMLCommentText) { { { - setState(2281); + setState(2285); match(XMLCommentText); } } - setState(2286); + setState(2290); _errHandler.sync(this); _la = _input.LA(1); } - setState(2287); + setState(2291); match(XML_COMMENT_END); } } @@ -14799,26 +14848,26 @@ public void exitRule(ParseTreeListener listener) { public final ElementContext element() throws RecognitionException { ElementContext _localctx = new ElementContext(_ctx, getState()); - enterRule(_localctx, 358, RULE_element); + enterRule(_localctx, 360, RULE_element); try { - setState(2294); + setState(2298); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,251,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(2289); + setState(2293); startTag(); - setState(2290); + setState(2294); content(); - setState(2291); + setState(2295); closeTag(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(2293); + setState(2297); emptyTag(); } break; @@ -14863,30 +14912,30 @@ public void exitRule(ParseTreeListener listener) { public final StartTagContext startTag() throws RecognitionException { StartTagContext _localctx = new StartTagContext(_ctx, getState()); - enterRule(_localctx, 360, RULE_startTag); + enterRule(_localctx, 362, RULE_startTag); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2296); + setState(2300); match(XML_TAG_OPEN); - setState(2297); - xmlQualifiedName(); setState(2301); + xmlQualifiedName(); + setState(2305); _errHandler.sync(this); _la = _input.LA(1); while (_la==XMLQName) { { { - setState(2298); + setState(2302); attribute(); } } - setState(2303); + setState(2307); _errHandler.sync(this); _la = _input.LA(1); } - setState(2304); + setState(2308); match(XML_TAG_CLOSE); } } @@ -14923,15 +14972,15 @@ public void exitRule(ParseTreeListener listener) { public final CloseTagContext closeTag() throws RecognitionException { CloseTagContext _localctx = new CloseTagContext(_ctx, getState()); - enterRule(_localctx, 362, RULE_closeTag); + enterRule(_localctx, 364, RULE_closeTag); try { enterOuterAlt(_localctx, 1); { - setState(2306); + setState(2310); match(XML_TAG_OPEN_SLASH); - setState(2307); + setState(2311); xmlQualifiedName(); - setState(2308); + setState(2312); match(XML_TAG_CLOSE); } } @@ -14974,30 +15023,30 @@ public void exitRule(ParseTreeListener listener) { public final EmptyTagContext emptyTag() throws RecognitionException { EmptyTagContext _localctx = new EmptyTagContext(_ctx, getState()); - enterRule(_localctx, 364, RULE_emptyTag); + enterRule(_localctx, 366, RULE_emptyTag); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2310); + setState(2314); match(XML_TAG_OPEN); - setState(2311); - xmlQualifiedName(); setState(2315); + xmlQualifiedName(); + setState(2319); _errHandler.sync(this); _la = _input.LA(1); while (_la==XMLQName) { { { - setState(2312); + setState(2316); attribute(); } } - setState(2317); + setState(2321); _errHandler.sync(this); _la = _input.LA(1); } - setState(2318); + setState(2322); match(XML_TAG_SLASH_CLOSE); } } @@ -15045,32 +15094,32 @@ public void exitRule(ParseTreeListener listener) { public final ProcInsContext procIns() throws RecognitionException { ProcInsContext _localctx = new ProcInsContext(_ctx, getState()); - enterRule(_localctx, 366, RULE_procIns); + enterRule(_localctx, 368, RULE_procIns); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2320); + setState(2324); match(XML_TAG_SPECIAL_OPEN); - setState(2327); + setState(2331); _errHandler.sync(this); _la = _input.LA(1); while (_la==XMLPITemplateText) { { { - setState(2321); + setState(2325); match(XMLPITemplateText); - setState(2322); + setState(2326); expression(0); - setState(2323); + setState(2327); match(RIGHT_BRACE); } } - setState(2329); + setState(2333); _errHandler.sync(this); _la = _input.LA(1); } - setState(2330); + setState(2334); match(XMLPIText); } } @@ -15109,15 +15158,15 @@ public void exitRule(ParseTreeListener listener) { public final AttributeContext attribute() throws RecognitionException { AttributeContext _localctx = new AttributeContext(_ctx, getState()); - enterRule(_localctx, 368, RULE_attribute); + enterRule(_localctx, 370, RULE_attribute); try { enterOuterAlt(_localctx, 1); { - setState(2332); + setState(2336); xmlQualifiedName(); - setState(2333); + setState(2337); match(EQUALS); - setState(2334); + setState(2338); xmlQuotedString(); } } @@ -15164,37 +15213,37 @@ public void exitRule(ParseTreeListener listener) { public final TextContext text() throws RecognitionException { TextContext _localctx = new TextContext(_ctx, getState()); - enterRule(_localctx, 370, RULE_text); + enterRule(_localctx, 372, RULE_text); int _la; try { - setState(2348); + setState(2352); switch (_input.LA(1)) { case XMLTemplateText: enterOuterAlt(_localctx, 1); { - setState(2340); + setState(2344); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(2336); + setState(2340); match(XMLTemplateText); - setState(2337); + setState(2341); expression(0); - setState(2338); + setState(2342); match(RIGHT_BRACE); } } - setState(2342); + setState(2346); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==XMLTemplateText ); - setState(2345); + setState(2349); _la = _input.LA(1); if (_la==XMLText) { { - setState(2344); + setState(2348); match(XMLText); } } @@ -15204,7 +15253,7 @@ public final TextContext text() throws RecognitionException { case XMLText: enterOuterAlt(_localctx, 2); { - setState(2347); + setState(2351); match(XMLText); } break; @@ -15246,21 +15295,21 @@ public void exitRule(ParseTreeListener listener) { public final XmlQuotedStringContext xmlQuotedString() throws RecognitionException { XmlQuotedStringContext _localctx = new XmlQuotedStringContext(_ctx, getState()); - enterRule(_localctx, 372, RULE_xmlQuotedString); + enterRule(_localctx, 374, RULE_xmlQuotedString); try { - setState(2352); + setState(2356); switch (_input.LA(1)) { case SINGLE_QUOTE: enterOuterAlt(_localctx, 1); { - setState(2350); + setState(2354); xmlSingleQuotedString(); } break; case DOUBLE_QUOTE: enterOuterAlt(_localctx, 2); { - setState(2351); + setState(2355); xmlDoubleQuotedString(); } break; @@ -15313,41 +15362,41 @@ public void exitRule(ParseTreeListener listener) { public final XmlSingleQuotedStringContext xmlSingleQuotedString() throws RecognitionException { XmlSingleQuotedStringContext _localctx = new XmlSingleQuotedStringContext(_ctx, getState()); - enterRule(_localctx, 374, RULE_xmlSingleQuotedString); + enterRule(_localctx, 376, RULE_xmlSingleQuotedString); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2354); + setState(2358); match(SINGLE_QUOTE); - setState(2361); + setState(2365); _errHandler.sync(this); _la = _input.LA(1); while (_la==XMLSingleQuotedTemplateString) { { { - setState(2355); + setState(2359); match(XMLSingleQuotedTemplateString); - setState(2356); + setState(2360); expression(0); - setState(2357); + setState(2361); match(RIGHT_BRACE); } } - setState(2363); + setState(2367); _errHandler.sync(this); _la = _input.LA(1); } - setState(2365); + setState(2369); _la = _input.LA(1); if (_la==XMLSingleQuotedString) { { - setState(2364); + setState(2368); match(XMLSingleQuotedString); } } - setState(2367); + setState(2371); match(SINGLE_QUOTE_END); } } @@ -15396,41 +15445,41 @@ public void exitRule(ParseTreeListener listener) { public final XmlDoubleQuotedStringContext xmlDoubleQuotedString() throws RecognitionException { XmlDoubleQuotedStringContext _localctx = new XmlDoubleQuotedStringContext(_ctx, getState()); - enterRule(_localctx, 376, RULE_xmlDoubleQuotedString); + enterRule(_localctx, 378, RULE_xmlDoubleQuotedString); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2369); + setState(2373); match(DOUBLE_QUOTE); - setState(2376); + setState(2380); _errHandler.sync(this); _la = _input.LA(1); while (_la==XMLDoubleQuotedTemplateString) { { { - setState(2370); + setState(2374); match(XMLDoubleQuotedTemplateString); - setState(2371); + setState(2375); expression(0); - setState(2372); + setState(2376); match(RIGHT_BRACE); } } - setState(2378); + setState(2382); _errHandler.sync(this); _la = _input.LA(1); } - setState(2380); + setState(2384); _la = _input.LA(1); if (_la==XMLDoubleQuotedString) { { - setState(2379); + setState(2383); match(XMLDoubleQuotedString); } } - setState(2382); + setState(2386); match(DOUBLE_QUOTE_END); } } @@ -15467,23 +15516,23 @@ public void exitRule(ParseTreeListener listener) { public final XmlQualifiedNameContext xmlQualifiedName() throws RecognitionException { XmlQualifiedNameContext _localctx = new XmlQualifiedNameContext(_ctx, getState()); - enterRule(_localctx, 378, RULE_xmlQualifiedName); + enterRule(_localctx, 380, RULE_xmlQualifiedName); try { enterOuterAlt(_localctx, 1); { - setState(2386); + setState(2390); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,263,_ctx) ) { case 1: { - setState(2384); + setState(2388); match(XMLQName); - setState(2385); + setState(2389); match(QNAME_SEPARATOR); } break; } - setState(2388); + setState(2392); match(XMLQName); } } @@ -15520,23 +15569,23 @@ public void exitRule(ParseTreeListener listener) { public final StringTemplateLiteralContext stringTemplateLiteral() throws RecognitionException { StringTemplateLiteralContext _localctx = new StringTemplateLiteralContext(_ctx, getState()); - enterRule(_localctx, 380, RULE_stringTemplateLiteral); + enterRule(_localctx, 382, RULE_stringTemplateLiteral); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2390); + setState(2394); match(StringTemplateLiteralStart); - setState(2392); + setState(2396); _la = _input.LA(1); if (_la==StringTemplateExpressionStart || _la==StringTemplateText) { { - setState(2391); + setState(2395); stringTemplateContent(); } } - setState(2394); + setState(2398); match(StringTemplateLiteralEnd); } } @@ -15583,37 +15632,37 @@ public void exitRule(ParseTreeListener listener) { public final StringTemplateContentContext stringTemplateContent() throws RecognitionException { StringTemplateContentContext _localctx = new StringTemplateContentContext(_ctx, getState()); - enterRule(_localctx, 382, RULE_stringTemplateContent); + enterRule(_localctx, 384, RULE_stringTemplateContent); int _la; try { - setState(2408); + setState(2412); switch (_input.LA(1)) { case StringTemplateExpressionStart: enterOuterAlt(_localctx, 1); { - setState(2400); + setState(2404); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(2396); + setState(2400); match(StringTemplateExpressionStart); - setState(2397); + setState(2401); expression(0); - setState(2398); + setState(2402); match(RIGHT_BRACE); } } - setState(2402); + setState(2406); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==StringTemplateExpressionStart ); - setState(2405); + setState(2409); _la = _input.LA(1); if (_la==StringTemplateText) { { - setState(2404); + setState(2408); match(StringTemplateText); } } @@ -15623,7 +15672,7 @@ public final StringTemplateContentContext stringTemplateContent() throws Recogni case StringTemplateText: enterOuterAlt(_localctx, 2); { - setState(2407); + setState(2411); match(StringTemplateText); } break; @@ -15663,14 +15712,14 @@ public void exitRule(ParseTreeListener listener) { public final AnyIdentifierNameContext anyIdentifierName() throws RecognitionException { AnyIdentifierNameContext _localctx = new AnyIdentifierNameContext(_ctx, getState()); - enterRule(_localctx, 384, RULE_anyIdentifierName); + enterRule(_localctx, 386, RULE_anyIdentifierName); try { - setState(2412); + setState(2416); switch (_input.LA(1)) { case Identifier: enterOuterAlt(_localctx, 1); { - setState(2410); + setState(2414); match(Identifier); } break; @@ -15682,7 +15731,7 @@ public final AnyIdentifierNameContext anyIdentifierName() throws RecognitionExce case START: enterOuterAlt(_localctx, 2); { - setState(2411); + setState(2415); reservedWord(); } break; @@ -15724,12 +15773,12 @@ public void exitRule(ParseTreeListener listener) { public final ReservedWordContext reservedWord() throws RecognitionException { ReservedWordContext _localctx = new ReservedWordContext(_ctx, getState()); - enterRule(_localctx, 386, RULE_reservedWord); + enterRule(_localctx, 388, RULE_reservedWord); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2414); + setState(2418); _la = _input.LA(1); if ( !(((((_la - 73)) & ~0x3f) == 0 && ((1L << (_la - 73)) & ((1L << (TYPE_ERROR - 73)) | (1L << (TYPE_MAP - 73)) | (1L << (OBJECT_INIT - 73)) | (1L << (FOREACH - 73)) | (1L << (CONTINUE - 73)) | (1L << (START - 73)))) != 0)) ) { _errHandler.recoverInline(this); @@ -15782,50 +15831,50 @@ public void exitRule(ParseTreeListener listener) { public final TableQueryContext tableQuery() throws RecognitionException { TableQueryContext _localctx = new TableQueryContext(_ctx, getState()); - enterRule(_localctx, 388, RULE_tableQuery); + enterRule(_localctx, 390, RULE_tableQuery); try { enterOuterAlt(_localctx, 1); { - setState(2416); + setState(2420); match(FROM); - setState(2417); + setState(2421); streamingInput(); - setState(2419); + setState(2423); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,269,_ctx) ) { case 1: { - setState(2418); + setState(2422); joinStreamingInput(); } break; } - setState(2422); + setState(2426); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,270,_ctx) ) { case 1: { - setState(2421); + setState(2425); selectClause(); } break; } - setState(2425); + setState(2429); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,271,_ctx) ) { case 1: { - setState(2424); + setState(2428); orderByClause(); } break; } - setState(2428); + setState(2432); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,272,_ctx) ) { case 1: { - setState(2427); + setState(2431); limitClause(); } break; @@ -15869,30 +15918,30 @@ public void exitRule(ParseTreeListener listener) { public final ForeverStatementContext foreverStatement() throws RecognitionException { ForeverStatementContext _localctx = new ForeverStatementContext(_ctx, getState()); - enterRule(_localctx, 390, RULE_foreverStatement); + enterRule(_localctx, 392, RULE_foreverStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2430); + setState(2434); match(FOREVER); - setState(2431); + setState(2435); match(LEFT_BRACE); - setState(2433); + setState(2437); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(2432); + setState(2436); streamingQueryStatement(); } } - setState(2435); + setState(2439); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==FROM ); - setState(2437); + setState(2441); match(RIGHT_BRACE); } } @@ -15946,25 +15995,25 @@ public void exitRule(ParseTreeListener listener) { public final StreamingQueryStatementContext streamingQueryStatement() throws RecognitionException { StreamingQueryStatementContext _localctx = new StreamingQueryStatementContext(_ctx, getState()); - enterRule(_localctx, 392, RULE_streamingQueryStatement); + enterRule(_localctx, 394, RULE_streamingQueryStatement); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2439); + setState(2443); match(FROM); - setState(2445); + setState(2449); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,275,_ctx) ) { case 1: { - setState(2440); + setState(2444); streamingInput(); - setState(2442); + setState(2446); _la = _input.LA(1); if (((((_la - 45)) & ~0x3f) == 0 && ((1L << (_la - 45)) & ((1L << (INNER - 45)) | (1L << (OUTER - 45)) | (1L << (RIGHT - 45)) | (1L << (LEFT - 45)) | (1L << (FULL - 45)) | (1L << (UNIDIRECTIONAL - 45)) | (1L << (JOIN - 45)))) != 0)) { { - setState(2441); + setState(2445); joinStreamingInput(); } } @@ -15973,39 +16022,39 @@ public final StreamingQueryStatementContext streamingQueryStatement() throws Rec break; case 2: { - setState(2444); + setState(2448); patternClause(); } break; } - setState(2448); + setState(2452); _la = _input.LA(1); if (_la==SELECT) { { - setState(2447); + setState(2451); selectClause(); } } - setState(2451); + setState(2455); _la = _input.LA(1); if (_la==ORDER) { { - setState(2450); + setState(2454); orderByClause(); } } - setState(2454); + setState(2458); _la = _input.LA(1); if (_la==OUTPUT) { { - setState(2453); + setState(2457); outputRateLimit(); } } - setState(2456); + setState(2460); streamingAction(); } } @@ -16044,27 +16093,27 @@ public void exitRule(ParseTreeListener listener) { public final PatternClauseContext patternClause() throws RecognitionException { PatternClauseContext _localctx = new PatternClauseContext(_ctx, getState()); - enterRule(_localctx, 394, RULE_patternClause); + enterRule(_localctx, 396, RULE_patternClause); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2459); + setState(2463); _la = _input.LA(1); if (_la==EVERY) { { - setState(2458); + setState(2462); match(EVERY); } } - setState(2461); + setState(2465); patternStreamingInput(); - setState(2463); + setState(2467); _la = _input.LA(1); if (_la==WITHIN) { { - setState(2462); + setState(2466); withinClause(); } } @@ -16104,15 +16153,15 @@ public void exitRule(ParseTreeListener listener) { public final WithinClauseContext withinClause() throws RecognitionException { WithinClauseContext _localctx = new WithinClauseContext(_ctx, getState()); - enterRule(_localctx, 396, RULE_withinClause); + enterRule(_localctx, 398, RULE_withinClause); try { enterOuterAlt(_localctx, 1); { - setState(2465); + setState(2469); match(WITHIN); - setState(2466); + setState(2470); match(DecimalIntegerLiteral); - setState(2467); + setState(2471); timeScale(); } } @@ -16156,32 +16205,32 @@ public void exitRule(ParseTreeListener listener) { public final OrderByClauseContext orderByClause() throws RecognitionException { OrderByClauseContext _localctx = new OrderByClauseContext(_ctx, getState()); - enterRule(_localctx, 398, RULE_orderByClause); + enterRule(_localctx, 400, RULE_orderByClause); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(2469); + setState(2473); match(ORDER); - setState(2470); + setState(2474); match(BY); - setState(2471); + setState(2475); orderByVariable(); - setState(2476); + setState(2480); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,281,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(2472); + setState(2476); match(COMMA); - setState(2473); + setState(2477); orderByVariable(); } } } - setState(2478); + setState(2482); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,281,_ctx); } @@ -16221,18 +16270,18 @@ public void exitRule(ParseTreeListener listener) { public final OrderByVariableContext orderByVariable() throws RecognitionException { OrderByVariableContext _localctx = new OrderByVariableContext(_ctx, getState()); - enterRule(_localctx, 400, RULE_orderByVariable); + enterRule(_localctx, 402, RULE_orderByVariable); try { enterOuterAlt(_localctx, 1); { - setState(2479); + setState(2483); variableReference(0); - setState(2481); + setState(2485); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,282,_ctx) ) { case 1: { - setState(2480); + setState(2484); orderByType(); } break; @@ -16269,13 +16318,13 @@ public void exitRule(ParseTreeListener listener) { public final LimitClauseContext limitClause() throws RecognitionException { LimitClauseContext _localctx = new LimitClauseContext(_ctx, getState()); - enterRule(_localctx, 402, RULE_limitClause); + enterRule(_localctx, 404, RULE_limitClause); try { enterOuterAlt(_localctx, 1); { - setState(2483); + setState(2487); match(LIMIT); - setState(2484); + setState(2488); match(DecimalIntegerLiteral); } } @@ -16318,17 +16367,17 @@ public void exitRule(ParseTreeListener listener) { public final SelectClauseContext selectClause() throws RecognitionException { SelectClauseContext _localctx = new SelectClauseContext(_ctx, getState()); - enterRule(_localctx, 404, RULE_selectClause); + enterRule(_localctx, 406, RULE_selectClause); try { enterOuterAlt(_localctx, 1); { - setState(2486); + setState(2490); match(SELECT); - setState(2489); + setState(2493); switch (_input.LA(1)) { case MUL: { - setState(2487); + setState(2491); match(MUL); } break; @@ -16390,29 +16439,29 @@ public final SelectClauseContext selectClause() throws RecognitionException { case XMLLiteralStart: case StringTemplateLiteralStart: { - setState(2488); + setState(2492); selectExpressionList(); } break; default: throw new NoViableAltException(this); } - setState(2492); + setState(2496); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,284,_ctx) ) { case 1: { - setState(2491); + setState(2495); groupByClause(); } break; } - setState(2495); + setState(2499); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,285,_ctx) ) { case 1: { - setState(2494); + setState(2498); havingClause(); } break; @@ -16457,28 +16506,28 @@ public void exitRule(ParseTreeListener listener) { public final SelectExpressionListContext selectExpressionList() throws RecognitionException { SelectExpressionListContext _localctx = new SelectExpressionListContext(_ctx, getState()); - enterRule(_localctx, 406, RULE_selectExpressionList); + enterRule(_localctx, 408, RULE_selectExpressionList); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(2497); + setState(2501); selectExpression(); - setState(2502); + setState(2506); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,286,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(2498); + setState(2502); match(COMMA); - setState(2499); + setState(2503); selectExpression(); } } } - setState(2504); + setState(2508); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,286,_ctx); } @@ -16517,20 +16566,20 @@ public void exitRule(ParseTreeListener listener) { public final SelectExpressionContext selectExpression() throws RecognitionException { SelectExpressionContext _localctx = new SelectExpressionContext(_ctx, getState()); - enterRule(_localctx, 408, RULE_selectExpression); + enterRule(_localctx, 410, RULE_selectExpression); try { enterOuterAlt(_localctx, 1); { - setState(2505); + setState(2509); expression(0); - setState(2508); + setState(2512); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,287,_ctx) ) { case 1: { - setState(2506); + setState(2510); match(AS); - setState(2507); + setState(2511); match(Identifier); } break; @@ -16570,15 +16619,15 @@ public void exitRule(ParseTreeListener listener) { public final GroupByClauseContext groupByClause() throws RecognitionException { GroupByClauseContext _localctx = new GroupByClauseContext(_ctx, getState()); - enterRule(_localctx, 410, RULE_groupByClause); + enterRule(_localctx, 412, RULE_groupByClause); try { enterOuterAlt(_localctx, 1); { - setState(2510); + setState(2514); match(GROUP); - setState(2511); + setState(2515); match(BY); - setState(2512); + setState(2516); variableReferenceList(); } } @@ -16614,13 +16663,13 @@ public void exitRule(ParseTreeListener listener) { public final HavingClauseContext havingClause() throws RecognitionException { HavingClauseContext _localctx = new HavingClauseContext(_ctx, getState()); - enterRule(_localctx, 412, RULE_havingClause); + enterRule(_localctx, 414, RULE_havingClause); try { enterOuterAlt(_localctx, 1); { - setState(2514); + setState(2518); match(HAVING); - setState(2515); + setState(2519); expression(0); } } @@ -16666,36 +16715,36 @@ public void exitRule(ParseTreeListener listener) { public final StreamingActionContext streamingAction() throws RecognitionException { StreamingActionContext _localctx = new StreamingActionContext(_ctx, getState()); - enterRule(_localctx, 414, RULE_streamingAction); + enterRule(_localctx, 416, RULE_streamingAction); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2517); + setState(2521); match(EQUAL_GT); - setState(2518); + setState(2522); match(LEFT_PARENTHESIS); - setState(2519); + setState(2523); parameter(); - setState(2520); + setState(2524); match(RIGHT_PARENTHESIS); - setState(2521); - match(LEFT_BRACE); setState(2525); + match(LEFT_BRACE); + setState(2529); _errHandler.sync(this); _la = _input.LA(1); while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << FINAL) | (1L << SERVICE) | (1L << FUNCTION) | (1L << OBJECT) | (1L << RECORD) | (1L << XMLNS) | (1L << ABSTRACT) | (1L << CLIENT) | (1L << TYPEOF) | (1L << FROM) | (1L << FOREVER))) != 0) || ((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (TYPE_INT - 67)) | (1L << (TYPE_BYTE - 67)) | (1L << (TYPE_FLOAT - 67)) | (1L << (TYPE_DECIMAL - 67)) | (1L << (TYPE_BOOL - 67)) | (1L << (TYPE_STRING - 67)) | (1L << (TYPE_ERROR - 67)) | (1L << (TYPE_MAP - 67)) | (1L << (TYPE_JSON - 67)) | (1L << (TYPE_XML - 67)) | (1L << (TYPE_TABLE - 67)) | (1L << (TYPE_STREAM - 67)) | (1L << (TYPE_ANY - 67)) | (1L << (TYPE_DESC - 67)) | (1L << (TYPE_FUTURE - 67)) | (1L << (TYPE_ANYDATA - 67)) | (1L << (TYPE_HANDLE - 67)) | (1L << (VAR - 67)) | (1L << (NEW - 67)) | (1L << (OBJECT_INIT - 67)) | (1L << (IF - 67)) | (1L << (MATCH - 67)) | (1L << (FOREACH - 67)) | (1L << (WHILE - 67)) | (1L << (CONTINUE - 67)) | (1L << (BREAK - 67)) | (1L << (FORK - 67)) | (1L << (TRY - 67)) | (1L << (THROW - 67)) | (1L << (PANIC - 67)) | (1L << (TRAP - 67)) | (1L << (RETURN - 67)) | (1L << (TRANSACTION - 67)) | (1L << (ABORT - 67)) | (1L << (RETRY - 67)) | (1L << (LOCK - 67)) | (1L << (START - 67)) | (1L << (CHECK - 67)) | (1L << (CHECKPANIC - 67)) | (1L << (FLUSH - 67)) | (1L << (WAIT - 67)) | (1L << (LEFT_BRACE - 67)))) != 0) || ((((_la - 132)) & ~0x3f) == 0 && ((1L << (_la - 132)) & ((1L << (LEFT_PARENTHESIS - 132)) | (1L << (LEFT_BRACKET - 132)) | (1L << (ADD - 132)) | (1L << (SUB - 132)) | (1L << (NOT - 132)) | (1L << (LT - 132)) | (1L << (BIT_COMPLEMENT - 132)) | (1L << (LARROW - 132)) | (1L << (AT - 132)) | (1L << (DecimalIntegerLiteral - 132)) | (1L << (HexIntegerLiteral - 132)) | (1L << (HexadecimalFloatingPointLiteral - 132)) | (1L << (DecimalFloatingPointNumber - 132)) | (1L << (BooleanLiteral - 132)) | (1L << (QuotedStringLiteral - 132)) | (1L << (Base16BlobLiteral - 132)) | (1L << (Base64BlobLiteral - 132)) | (1L << (NullLiteral - 132)) | (1L << (Identifier - 132)) | (1L << (XMLLiteralStart - 132)) | (1L << (StringTemplateLiteralStart - 132)))) != 0)) { { { - setState(2522); + setState(2526); statement(); } } - setState(2527); + setState(2531); _errHandler.sync(this); _la = _input.LA(1); } - setState(2528); + setState(2532); match(RIGHT_BRACE); } } @@ -16748,83 +16797,83 @@ public void exitRule(ParseTreeListener listener) { public final StreamingInputContext streamingInput() throws RecognitionException { StreamingInputContext _localctx = new StreamingInputContext(_ctx, getState()); - enterRule(_localctx, 416, RULE_streamingInput); + enterRule(_localctx, 418, RULE_streamingInput); try { int _alt; enterOuterAlt(_localctx, 1); { - setState(2530); + setState(2534); variableReference(0); - setState(2532); + setState(2536); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,289,_ctx) ) { case 1: { - setState(2531); + setState(2535); whereClause(); } break; } - setState(2537); + setState(2541); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,290,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(2534); + setState(2538); functionInvocation(); } } } - setState(2539); + setState(2543); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,290,_ctx); } - setState(2541); + setState(2545); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,291,_ctx) ) { case 1: { - setState(2540); + setState(2544); windowClause(); } break; } - setState(2546); + setState(2550); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,292,_ctx); while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { { { - setState(2543); + setState(2547); functionInvocation(); } } } - setState(2548); + setState(2552); _errHandler.sync(this); _alt = getInterpreter().adaptivePredict(_input,292,_ctx); } - setState(2550); + setState(2554); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,293,_ctx) ) { case 1: { - setState(2549); + setState(2553); whereClause(); } break; } - setState(2554); + setState(2558); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,294,_ctx) ) { case 1: { - setState(2552); + setState(2556); match(AS); - setState(2553); + setState(2557); ((StreamingInputContext)_localctx).alias = match(Identifier); } break; @@ -16870,46 +16919,46 @@ public void exitRule(ParseTreeListener listener) { public final JoinStreamingInputContext joinStreamingInput() throws RecognitionException { JoinStreamingInputContext _localctx = new JoinStreamingInputContext(_ctx, getState()); - enterRule(_localctx, 418, RULE_joinStreamingInput); + enterRule(_localctx, 420, RULE_joinStreamingInput); try { enterOuterAlt(_localctx, 1); { - setState(2562); + setState(2566); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,295,_ctx) ) { case 1: { - setState(2556); + setState(2560); match(UNIDIRECTIONAL); - setState(2557); + setState(2561); joinType(); } break; case 2: { - setState(2558); + setState(2562); joinType(); - setState(2559); + setState(2563); match(UNIDIRECTIONAL); } break; case 3: { - setState(2561); + setState(2565); joinType(); } break; } - setState(2564); + setState(2568); streamingInput(); - setState(2567); + setState(2571); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,296,_ctx) ) { case 1: { - setState(2565); + setState(2569); match(ON); - setState(2566); + setState(2570); expression(0); } break; @@ -16955,42 +17004,42 @@ public void exitRule(ParseTreeListener listener) { public final OutputRateLimitContext outputRateLimit() throws RecognitionException { OutputRateLimitContext _localctx = new OutputRateLimitContext(_ctx, getState()); - enterRule(_localctx, 420, RULE_outputRateLimit); + enterRule(_localctx, 422, RULE_outputRateLimit); int _la; try { - setState(2583); + setState(2587); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,298,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(2569); + setState(2573); match(OUTPUT); - setState(2570); + setState(2574); _la = _input.LA(1); if ( !(((((_la - 41)) & ~0x3f) == 0 && ((1L << (_la - 41)) & ((1L << (LAST - 41)) | (1L << (FIRST - 41)) | (1L << (ALL - 41)))) != 0)) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2571); + setState(2575); match(EVERY); - setState(2576); + setState(2580); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,297,_ctx) ) { case 1: { - setState(2572); + setState(2576); match(DecimalIntegerLiteral); - setState(2573); + setState(2577); timeScale(); } break; case 2: { - setState(2574); + setState(2578); match(DecimalIntegerLiteral); - setState(2575); + setState(2579); match(EVENTS); } break; @@ -17000,15 +17049,15 @@ public final OutputRateLimitContext outputRateLimit() throws RecognitionExceptio case 2: enterOuterAlt(_localctx, 2); { - setState(2578); + setState(2582); match(OUTPUT); - setState(2579); + setState(2583); match(SNAPSHOT); - setState(2580); + setState(2584); match(EVERY); - setState(2581); + setState(2585); match(DecimalIntegerLiteral); - setState(2582); + setState(2586); timeScale(); } break; @@ -17064,75 +17113,75 @@ public void exitRule(ParseTreeListener listener) { public final PatternStreamingInputContext patternStreamingInput() throws RecognitionException { PatternStreamingInputContext _localctx = new PatternStreamingInputContext(_ctx, getState()); - enterRule(_localctx, 422, RULE_patternStreamingInput); + enterRule(_localctx, 424, RULE_patternStreamingInput); int _la; try { - setState(2611); + setState(2615); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,301,_ctx) ) { case 1: enterOuterAlt(_localctx, 1); { - setState(2585); - patternStreamingEdgeInput(); setState(2589); + patternStreamingEdgeInput(); + setState(2593); switch (_input.LA(1)) { case FOLLOWED: { - setState(2586); + setState(2590); match(FOLLOWED); - setState(2587); + setState(2591); match(BY); } break; case COMMA: { - setState(2588); + setState(2592); match(COMMA); } break; default: throw new NoViableAltException(this); } - setState(2591); + setState(2595); patternStreamingInput(); } break; case 2: enterOuterAlt(_localctx, 2); { - setState(2593); + setState(2597); match(LEFT_PARENTHESIS); - setState(2594); + setState(2598); patternStreamingInput(); - setState(2595); + setState(2599); match(RIGHT_PARENTHESIS); } break; case 3: enterOuterAlt(_localctx, 3); { - setState(2597); + setState(2601); match(NOT); - setState(2598); + setState(2602); patternStreamingEdgeInput(); - setState(2604); + setState(2608); switch (_input.LA(1)) { case AND: { - setState(2599); + setState(2603); match(AND); - setState(2600); + setState(2604); patternStreamingEdgeInput(); } break; case FOR: { - setState(2601); + setState(2605); match(FOR); - setState(2602); + setState(2606); match(DecimalIntegerLiteral); - setState(2603); + setState(2607); timeScale(); } break; @@ -17144,23 +17193,23 @@ public final PatternStreamingInputContext patternStreamingInput() throws Recogni case 4: enterOuterAlt(_localctx, 4); { - setState(2606); + setState(2610); patternStreamingEdgeInput(); - setState(2607); + setState(2611); _la = _input.LA(1); if ( !(_la==AND || _la==OR) ) { _errHandler.recoverInline(this); } else { consume(); } - setState(2608); + setState(2612); patternStreamingEdgeInput(); } break; case 5: enterOuterAlt(_localctx, 5); { - setState(2610); + setState(2614); patternStreamingEdgeInput(); } break; @@ -17206,38 +17255,38 @@ public void exitRule(ParseTreeListener listener) { public final PatternStreamingEdgeInputContext patternStreamingEdgeInput() throws RecognitionException { PatternStreamingEdgeInputContext _localctx = new PatternStreamingEdgeInputContext(_ctx, getState()); - enterRule(_localctx, 424, RULE_patternStreamingEdgeInput); + enterRule(_localctx, 426, RULE_patternStreamingEdgeInput); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2613); + setState(2617); variableReference(0); - setState(2615); + setState(2619); _la = _input.LA(1); if (_la==WHERE) { { - setState(2614); + setState(2618); whereClause(); } } - setState(2618); + setState(2622); _la = _input.LA(1); if (_la==LEFT_PARENTHESIS || _la==LEFT_BRACKET) { { - setState(2617); + setState(2621); intRangeExpression(); } } - setState(2622); + setState(2626); _la = _input.LA(1); if (_la==AS) { { - setState(2620); + setState(2624); match(AS); - setState(2621); + setState(2625); ((PatternStreamingEdgeInputContext)_localctx).alias = match(Identifier); } } @@ -17276,13 +17325,13 @@ public void exitRule(ParseTreeListener listener) { public final WhereClauseContext whereClause() throws RecognitionException { WhereClauseContext _localctx = new WhereClauseContext(_ctx, getState()); - enterRule(_localctx, 426, RULE_whereClause); + enterRule(_localctx, 428, RULE_whereClause); try { enterOuterAlt(_localctx, 1); { - setState(2624); + setState(2628); match(WHERE); - setState(2625); + setState(2629); expression(0); } } @@ -17318,13 +17367,13 @@ public void exitRule(ParseTreeListener listener) { public final WindowClauseContext windowClause() throws RecognitionException { WindowClauseContext _localctx = new WindowClauseContext(_ctx, getState()); - enterRule(_localctx, 428, RULE_windowClause); + enterRule(_localctx, 430, RULE_windowClause); try { enterOuterAlt(_localctx, 1); { - setState(2627); + setState(2631); match(WINDOW); - setState(2628); + setState(2632); functionInvocation(); } } @@ -17358,12 +17407,12 @@ public void exitRule(ParseTreeListener listener) { public final OrderByTypeContext orderByType() throws RecognitionException { OrderByTypeContext _localctx = new OrderByTypeContext(_ctx, getState()); - enterRule(_localctx, 430, RULE_orderByType); + enterRule(_localctx, 432, RULE_orderByType); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2630); + setState(2634); _la = _input.LA(1); if ( !(_la==ASCENDING || _la==DESCENDING) ) { _errHandler.recoverInline(this); @@ -17406,50 +17455,50 @@ public void exitRule(ParseTreeListener listener) { public final JoinTypeContext joinType() throws RecognitionException { JoinTypeContext _localctx = new JoinTypeContext(_ctx, getState()); - enterRule(_localctx, 432, RULE_joinType); + enterRule(_localctx, 434, RULE_joinType); int _la; try { - setState(2647); + setState(2651); switch (_input.LA(1)) { case LEFT: enterOuterAlt(_localctx, 1); { - setState(2632); + setState(2636); match(LEFT); - setState(2633); + setState(2637); match(OUTER); - setState(2634); + setState(2638); match(JOIN); } break; case RIGHT: enterOuterAlt(_localctx, 2); { - setState(2635); + setState(2639); match(RIGHT); - setState(2636); + setState(2640); match(OUTER); - setState(2637); + setState(2641); match(JOIN); } break; case FULL: enterOuterAlt(_localctx, 3); { - setState(2638); + setState(2642); match(FULL); - setState(2639); + setState(2643); match(OUTER); - setState(2640); + setState(2644); match(JOIN); } break; case OUTER: enterOuterAlt(_localctx, 4); { - setState(2641); + setState(2645); match(OUTER); - setState(2642); + setState(2646); match(JOIN); } break; @@ -17457,16 +17506,16 @@ public final JoinTypeContext joinType() throws RecognitionException { case JOIN: enterOuterAlt(_localctx, 5); { - setState(2644); + setState(2648); _la = _input.LA(1); if (_la==INNER) { { - setState(2643); + setState(2647); match(INNER); } } - setState(2646); + setState(2650); match(JOIN); } break; @@ -17514,12 +17563,12 @@ public void exitRule(ParseTreeListener listener) { public final TimeScaleContext timeScale() throws RecognitionException { TimeScaleContext _localctx = new TimeScaleContext(_ctx, getState()); - enterRule(_localctx, 434, RULE_timeScale); + enterRule(_localctx, 436, RULE_timeScale); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2649); + setState(2653); _la = _input.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << SECOND) | (1L << MINUTE) | (1L << HOUR) | (1L << DAY) | (1L << MONTH) | (1L << YEAR) | (1L << SECONDS) | (1L << MINUTES) | (1L << HOURS) | (1L << DAYS) | (1L << MONTHS) | (1L << YEARS))) != 0)) ) { _errHandler.recoverInline(this); @@ -17571,44 +17620,44 @@ public void exitRule(ParseTreeListener listener) { public final DocumentationStringContext documentationString() throws RecognitionException { DocumentationStringContext _localctx = new DocumentationStringContext(_ctx, getState()); - enterRule(_localctx, 436, RULE_documentationString); + enterRule(_localctx, 438, RULE_documentationString); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2652); + setState(2656); _errHandler.sync(this); _la = _input.LA(1); do { { { - setState(2651); + setState(2655); documentationLine(); } } - setState(2654); + setState(2658); _errHandler.sync(this); _la = _input.LA(1); } while ( _la==DocumentationLineStart ); - setState(2659); + setState(2663); _errHandler.sync(this); _la = _input.LA(1); while (_la==ParameterDocumentationStart) { { { - setState(2656); + setState(2660); parameterDocumentationLine(); } } - setState(2661); + setState(2665); _errHandler.sync(this); _la = _input.LA(1); } - setState(2663); + setState(2667); _la = _input.LA(1); if (_la==ReturnParameterDocumentationStart) { { - setState(2662); + setState(2666); returnParameterDocumentationLine(); } } @@ -17647,13 +17696,13 @@ public void exitRule(ParseTreeListener listener) { public final DocumentationLineContext documentationLine() throws RecognitionException { DocumentationLineContext _localctx = new DocumentationLineContext(_ctx, getState()); - enterRule(_localctx, 438, RULE_documentationLine); + enterRule(_localctx, 440, RULE_documentationLine); try { enterOuterAlt(_localctx, 1); { - setState(2665); + setState(2669); match(DocumentationLineStart); - setState(2666); + setState(2670); documentationContent(); } } @@ -17694,24 +17743,24 @@ public void exitRule(ParseTreeListener listener) { public final ParameterDocumentationLineContext parameterDocumentationLine() throws RecognitionException { ParameterDocumentationLineContext _localctx = new ParameterDocumentationLineContext(_ctx, getState()); - enterRule(_localctx, 440, RULE_parameterDocumentationLine); + enterRule(_localctx, 442, RULE_parameterDocumentationLine); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2668); - parameterDocumentation(); setState(2672); + parameterDocumentation(); + setState(2676); _errHandler.sync(this); _la = _input.LA(1); while (_la==DocumentationLineStart) { { { - setState(2669); + setState(2673); parameterDescriptionLine(); } } - setState(2674); + setState(2678); _errHandler.sync(this); _la = _input.LA(1); } @@ -17754,24 +17803,24 @@ public void exitRule(ParseTreeListener listener) { public final ReturnParameterDocumentationLineContext returnParameterDocumentationLine() throws RecognitionException { ReturnParameterDocumentationLineContext _localctx = new ReturnParameterDocumentationLineContext(_ctx, getState()); - enterRule(_localctx, 442, RULE_returnParameterDocumentationLine); + enterRule(_localctx, 444, RULE_returnParameterDocumentationLine); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2675); - returnParameterDocumentation(); setState(2679); + returnParameterDocumentation(); + setState(2683); _errHandler.sync(this); _la = _input.LA(1); while (_la==DocumentationLineStart) { { { - setState(2676); + setState(2680); returnParameterDescriptionLine(); } } - setState(2681); + setState(2685); _errHandler.sync(this); _la = _input.LA(1); } @@ -17808,16 +17857,16 @@ public void exitRule(ParseTreeListener listener) { public final DocumentationContentContext documentationContent() throws RecognitionException { DocumentationContentContext _localctx = new DocumentationContentContext(_ctx, getState()); - enterRule(_localctx, 444, RULE_documentationContent); + enterRule(_localctx, 446, RULE_documentationContent); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2683); + setState(2687); _la = _input.LA(1); - if (((((_la - 200)) & ~0x3f) == 0 && ((1L << (_la - 200)) & ((1L << (VARIABLE - 200)) | (1L << (MODULE - 200)) | (1L << (ReferenceType - 200)) | (1L << (DocumentationText - 200)) | (1L << (SingleBacktickStart - 200)) | (1L << (DoubleBacktickStart - 200)) | (1L << (TripleBacktickStart - 200)) | (1L << (DefinitionReference - 200)))) != 0)) { + if (((((_la - 201)) & ~0x3f) == 0 && ((1L << (_la - 201)) & ((1L << (VARIABLE - 201)) | (1L << (MODULE - 201)) | (1L << (ReferenceType - 201)) | (1L << (DocumentationText - 201)) | (1L << (SingleBacktickStart - 201)) | (1L << (DoubleBacktickStart - 201)) | (1L << (TripleBacktickStart - 201)) | (1L << (DefinitionReference - 201)))) != 0)) { { - setState(2682); + setState(2686); documentationText(); } } @@ -17856,18 +17905,18 @@ public void exitRule(ParseTreeListener listener) { public final ParameterDescriptionLineContext parameterDescriptionLine() throws RecognitionException { ParameterDescriptionLineContext _localctx = new ParameterDescriptionLineContext(_ctx, getState()); - enterRule(_localctx, 446, RULE_parameterDescriptionLine); + enterRule(_localctx, 448, RULE_parameterDescriptionLine); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2685); + setState(2689); match(DocumentationLineStart); - setState(2687); + setState(2691); _la = _input.LA(1); - if (((((_la - 200)) & ~0x3f) == 0 && ((1L << (_la - 200)) & ((1L << (VARIABLE - 200)) | (1L << (MODULE - 200)) | (1L << (ReferenceType - 200)) | (1L << (DocumentationText - 200)) | (1L << (SingleBacktickStart - 200)) | (1L << (DoubleBacktickStart - 200)) | (1L << (TripleBacktickStart - 200)) | (1L << (DefinitionReference - 200)))) != 0)) { + if (((((_la - 201)) & ~0x3f) == 0 && ((1L << (_la - 201)) & ((1L << (VARIABLE - 201)) | (1L << (MODULE - 201)) | (1L << (ReferenceType - 201)) | (1L << (DocumentationText - 201)) | (1L << (SingleBacktickStart - 201)) | (1L << (DoubleBacktickStart - 201)) | (1L << (TripleBacktickStart - 201)) | (1L << (DefinitionReference - 201)))) != 0)) { { - setState(2686); + setState(2690); documentationText(); } } @@ -17906,18 +17955,18 @@ public void exitRule(ParseTreeListener listener) { public final ReturnParameterDescriptionLineContext returnParameterDescriptionLine() throws RecognitionException { ReturnParameterDescriptionLineContext _localctx = new ReturnParameterDescriptionLineContext(_ctx, getState()); - enterRule(_localctx, 448, RULE_returnParameterDescriptionLine); + enterRule(_localctx, 450, RULE_returnParameterDescriptionLine); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2689); + setState(2693); match(DocumentationLineStart); - setState(2691); + setState(2695); _la = _input.LA(1); - if (((((_la - 200)) & ~0x3f) == 0 && ((1L << (_la - 200)) & ((1L << (VARIABLE - 200)) | (1L << (MODULE - 200)) | (1L << (ReferenceType - 200)) | (1L << (DocumentationText - 200)) | (1L << (SingleBacktickStart - 200)) | (1L << (DoubleBacktickStart - 200)) | (1L << (TripleBacktickStart - 200)) | (1L << (DefinitionReference - 200)))) != 0)) { + if (((((_la - 201)) & ~0x3f) == 0 && ((1L << (_la - 201)) & ((1L << (VARIABLE - 201)) | (1L << (MODULE - 201)) | (1L << (ReferenceType - 201)) | (1L << (DocumentationText - 201)) | (1L << (SingleBacktickStart - 201)) | (1L << (DoubleBacktickStart - 201)) | (1L << (TripleBacktickStart - 201)) | (1L << (DefinitionReference - 201)))) != 0)) { { - setState(2690); + setState(2694); documentationText(); } } @@ -17996,79 +18045,79 @@ public void exitRule(ParseTreeListener listener) { public final DocumentationTextContext documentationText() throws RecognitionException { DocumentationTextContext _localctx = new DocumentationTextContext(_ctx, getState()); - enterRule(_localctx, 450, RULE_documentationText); + enterRule(_localctx, 452, RULE_documentationText); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2702); + setState(2706); _errHandler.sync(this); _la = _input.LA(1); do { { - setState(2702); + setState(2706); _errHandler.sync(this); switch ( getInterpreter().adaptivePredict(_input,315,_ctx) ) { case 1: { - setState(2693); + setState(2697); match(DocumentationText); } break; case 2: { - setState(2694); + setState(2698); match(ReferenceType); } break; case 3: { - setState(2695); + setState(2699); match(VARIABLE); } break; case 4: { - setState(2696); + setState(2700); match(MODULE); } break; case 5: { - setState(2697); + setState(2701); documentationReference(); } break; case 6: { - setState(2698); + setState(2702); singleBacktickedBlock(); } break; case 7: { - setState(2699); + setState(2703); doubleBacktickedBlock(); } break; case 8: { - setState(2700); + setState(2704); tripleBacktickedBlock(); } break; case 9: { - setState(2701); + setState(2705); match(DefinitionReference); } break; } } - setState(2704); + setState(2708); _errHandler.sync(this); _la = _input.LA(1); - } while ( ((((_la - 200)) & ~0x3f) == 0 && ((1L << (_la - 200)) & ((1L << (VARIABLE - 200)) | (1L << (MODULE - 200)) | (1L << (ReferenceType - 200)) | (1L << (DocumentationText - 200)) | (1L << (SingleBacktickStart - 200)) | (1L << (DoubleBacktickStart - 200)) | (1L << (TripleBacktickStart - 200)) | (1L << (DefinitionReference - 200)))) != 0) ); + } while ( ((((_la - 201)) & ~0x3f) == 0 && ((1L << (_la - 201)) & ((1L << (VARIABLE - 201)) | (1L << (MODULE - 201)) | (1L << (ReferenceType - 201)) | (1L << (DocumentationText - 201)) | (1L << (SingleBacktickStart - 201)) | (1L << (DoubleBacktickStart - 201)) | (1L << (TripleBacktickStart - 201)) | (1L << (DefinitionReference - 201)))) != 0) ); } } catch (RecognitionException re) { @@ -18102,11 +18151,11 @@ public void exitRule(ParseTreeListener listener) { public final DocumentationReferenceContext documentationReference() throws RecognitionException { DocumentationReferenceContext _localctx = new DocumentationReferenceContext(_ctx, getState()); - enterRule(_localctx, 452, RULE_documentationReference); + enterRule(_localctx, 454, RULE_documentationReference); try { enterOuterAlt(_localctx, 1); { - setState(2706); + setState(2710); definitionReference(); } } @@ -18144,13 +18193,13 @@ public void exitRule(ParseTreeListener listener) { public final DefinitionReferenceContext definitionReference() throws RecognitionException { DefinitionReferenceContext _localctx = new DefinitionReferenceContext(_ctx, getState()); - enterRule(_localctx, 454, RULE_definitionReference); + enterRule(_localctx, 456, RULE_definitionReference); try { enterOuterAlt(_localctx, 1); { - setState(2708); + setState(2712); definitionReferenceType(); - setState(2709); + setState(2713); singleBacktickedBlock(); } } @@ -18183,11 +18232,11 @@ public void exitRule(ParseTreeListener listener) { public final DefinitionReferenceTypeContext definitionReferenceType() throws RecognitionException { DefinitionReferenceTypeContext _localctx = new DefinitionReferenceTypeContext(_ctx, getState()); - enterRule(_localctx, 456, RULE_definitionReferenceType); + enterRule(_localctx, 458, RULE_definitionReferenceType); try { enterOuterAlt(_localctx, 1); { - setState(2711); + setState(2715); match(DefinitionReference); } } @@ -18227,22 +18276,22 @@ public void exitRule(ParseTreeListener listener) { public final ParameterDocumentationContext parameterDocumentation() throws RecognitionException { ParameterDocumentationContext _localctx = new ParameterDocumentationContext(_ctx, getState()); - enterRule(_localctx, 458, RULE_parameterDocumentation); + enterRule(_localctx, 460, RULE_parameterDocumentation); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2713); + setState(2717); match(ParameterDocumentationStart); - setState(2714); + setState(2718); docParameterName(); - setState(2715); + setState(2719); match(DescriptionSeparator); - setState(2717); + setState(2721); _la = _input.LA(1); - if (((((_la - 200)) & ~0x3f) == 0 && ((1L << (_la - 200)) & ((1L << (VARIABLE - 200)) | (1L << (MODULE - 200)) | (1L << (ReferenceType - 200)) | (1L << (DocumentationText - 200)) | (1L << (SingleBacktickStart - 200)) | (1L << (DoubleBacktickStart - 200)) | (1L << (TripleBacktickStart - 200)) | (1L << (DefinitionReference - 200)))) != 0)) { + if (((((_la - 201)) & ~0x3f) == 0 && ((1L << (_la - 201)) & ((1L << (VARIABLE - 201)) | (1L << (MODULE - 201)) | (1L << (ReferenceType - 201)) | (1L << (DocumentationText - 201)) | (1L << (SingleBacktickStart - 201)) | (1L << (DoubleBacktickStart - 201)) | (1L << (TripleBacktickStart - 201)) | (1L << (DefinitionReference - 201)))) != 0)) { { - setState(2716); + setState(2720); documentationText(); } } @@ -18281,18 +18330,18 @@ public void exitRule(ParseTreeListener listener) { public final ReturnParameterDocumentationContext returnParameterDocumentation() throws RecognitionException { ReturnParameterDocumentationContext _localctx = new ReturnParameterDocumentationContext(_ctx, getState()); - enterRule(_localctx, 460, RULE_returnParameterDocumentation); + enterRule(_localctx, 462, RULE_returnParameterDocumentation); int _la; try { enterOuterAlt(_localctx, 1); { - setState(2719); + setState(2723); match(ReturnParameterDocumentationStart); - setState(2721); + setState(2725); _la = _input.LA(1); - if (((((_la - 200)) & ~0x3f) == 0 && ((1L << (_la - 200)) & ((1L << (VARIABLE - 200)) | (1L << (MODULE - 200)) | (1L << (ReferenceType - 200)) | (1L << (DocumentationText - 200)) | (1L << (SingleBacktickStart - 200)) | (1L << (DoubleBacktickStart - 200)) | (1L << (TripleBacktickStart - 200)) | (1L << (DefinitionReference - 200)))) != 0)) { + if (((((_la - 201)) & ~0x3f) == 0 && ((1L << (_la - 201)) & ((1L << (VARIABLE - 201)) | (1L << (MODULE - 201)) | (1L << (ReferenceType - 201)) | (1L << (DocumentationText - 201)) | (1L << (SingleBacktickStart - 201)) | (1L << (DoubleBacktickStart - 201)) | (1L << (TripleBacktickStart - 201)) | (1L << (DefinitionReference - 201)))) != 0)) { { - setState(2720); + setState(2724); documentationText(); } } @@ -18328,11 +18377,11 @@ public void exitRule(ParseTreeListener listener) { public final DocParameterNameContext docParameterName() throws RecognitionException { DocParameterNameContext _localctx = new DocParameterNameContext(_ctx, getState()); - enterRule(_localctx, 462, RULE_docParameterName); + enterRule(_localctx, 464, RULE_docParameterName); try { enterOuterAlt(_localctx, 1); { - setState(2723); + setState(2727); match(ParameterName); } } @@ -18369,15 +18418,15 @@ public void exitRule(ParseTreeListener listener) { public final SingleBacktickedBlockContext singleBacktickedBlock() throws RecognitionException { SingleBacktickedBlockContext _localctx = new SingleBacktickedBlockContext(_ctx, getState()); - enterRule(_localctx, 464, RULE_singleBacktickedBlock); + enterRule(_localctx, 466, RULE_singleBacktickedBlock); try { enterOuterAlt(_localctx, 1); { - setState(2725); + setState(2729); match(SingleBacktickStart); - setState(2726); + setState(2730); singleBacktickedContent(); - setState(2727); + setState(2731); match(SingleBacktickEnd); } } @@ -18410,11 +18459,11 @@ public void exitRule(ParseTreeListener listener) { public final SingleBacktickedContentContext singleBacktickedContent() throws RecognitionException { SingleBacktickedContentContext _localctx = new SingleBacktickedContentContext(_ctx, getState()); - enterRule(_localctx, 466, RULE_singleBacktickedContent); + enterRule(_localctx, 468, RULE_singleBacktickedContent); try { enterOuterAlt(_localctx, 1); { - setState(2729); + setState(2733); match(SingleBacktickContent); } } @@ -18451,15 +18500,15 @@ public void exitRule(ParseTreeListener listener) { public final DoubleBacktickedBlockContext doubleBacktickedBlock() throws RecognitionException { DoubleBacktickedBlockContext _localctx = new DoubleBacktickedBlockContext(_ctx, getState()); - enterRule(_localctx, 468, RULE_doubleBacktickedBlock); + enterRule(_localctx, 470, RULE_doubleBacktickedBlock); try { enterOuterAlt(_localctx, 1); { - setState(2731); + setState(2735); match(DoubleBacktickStart); - setState(2732); + setState(2736); doubleBacktickedContent(); - setState(2733); + setState(2737); match(DoubleBacktickEnd); } } @@ -18492,11 +18541,11 @@ public void exitRule(ParseTreeListener listener) { public final DoubleBacktickedContentContext doubleBacktickedContent() throws RecognitionException { DoubleBacktickedContentContext _localctx = new DoubleBacktickedContentContext(_ctx, getState()); - enterRule(_localctx, 470, RULE_doubleBacktickedContent); + enterRule(_localctx, 472, RULE_doubleBacktickedContent); try { enterOuterAlt(_localctx, 1); { - setState(2735); + setState(2739); match(DoubleBacktickContent); } } @@ -18533,15 +18582,15 @@ public void exitRule(ParseTreeListener listener) { public final TripleBacktickedBlockContext tripleBacktickedBlock() throws RecognitionException { TripleBacktickedBlockContext _localctx = new TripleBacktickedBlockContext(_ctx, getState()); - enterRule(_localctx, 472, RULE_tripleBacktickedBlock); + enterRule(_localctx, 474, RULE_tripleBacktickedBlock); try { enterOuterAlt(_localctx, 1); { - setState(2737); + setState(2741); match(TripleBacktickStart); - setState(2738); + setState(2742); tripleBacktickedContent(); - setState(2739); + setState(2743); match(TripleBacktickEnd); } } @@ -18574,11 +18623,11 @@ public void exitRule(ParseTreeListener listener) { public final TripleBacktickedContentContext tripleBacktickedContent() throws RecognitionException { TripleBacktickedContentContext _localctx = new TripleBacktickedContentContext(_ctx, getState()); - enterRule(_localctx, 474, RULE_tripleBacktickedContent); + enterRule(_localctx, 476, RULE_tripleBacktickedContent); try { enterOuterAlt(_localctx, 1); { - setState(2741); + setState(2745); match(TripleBacktickContent); } } @@ -18595,19 +18644,19 @@ public final TripleBacktickedContentContext tripleBacktickedContent() throws Rec public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) { switch (ruleIndex) { - case 22: + case 23: return restDescriptorPredicate_sempred((RestDescriptorPredicateContext)_localctx, predIndex); - case 36: + case 37: return typeName_sempred((TypeNameContext)_localctx, predIndex); - case 55: + case 56: return staticMatchLiterals_sempred((StaticMatchLiteralsContext)_localctx, predIndex); - case 124: + case 125: return variableReference_sempred((VariableReferenceContext)_localctx, predIndex); - case 149: - return expression_sempred((ExpressionContext)_localctx, predIndex); case 150: + return expression_sempred((ExpressionContext)_localctx, predIndex); + case 151: return constantExpression_sempred((ConstantExpressionContext)_localctx, predIndex); - case 156: + case 157: return shiftExprPredicate_sempred((ShiftExprPredicateContext)_localctx, predIndex); } return true; @@ -18704,7 +18753,7 @@ private boolean shiftExprPredicate_sempred(ShiftExprPredicateContext _localctx, private static final int _serializedATNSegments = 2; private static final String _serializedATNSegment0 = - "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\u0106\u0aba\4\2\t"+ + "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3\u0107\u0abe\4\2\t"+ "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ @@ -18742,1153 +18791,1158 @@ private boolean shiftExprPredicate_sempred(ShiftExprPredicateContext _localctx, "\t\u00df\4\u00e0\t\u00e0\4\u00e1\t\u00e1\4\u00e2\t\u00e2\4\u00e3\t\u00e3"+ "\4\u00e4\t\u00e4\4\u00e5\t\u00e5\4\u00e6\t\u00e6\4\u00e7\t\u00e7\4\u00e8"+ "\t\u00e8\4\u00e9\t\u00e9\4\u00ea\t\u00ea\4\u00eb\t\u00eb\4\u00ec\t\u00ec"+ - "\4\u00ed\t\u00ed\4\u00ee\t\u00ee\4\u00ef\t\u00ef\3\2\3\2\7\2\u01e1\n\2"+ - "\f\2\16\2\u01e4\13\2\3\2\5\2\u01e7\n\2\3\2\7\2\u01ea\n\2\f\2\16\2\u01ed"+ - "\13\2\3\2\7\2\u01f0\n\2\f\2\16\2\u01f3\13\2\3\2\3\2\3\3\3\3\3\3\7\3\u01fa"+ - "\n\3\f\3\16\3\u01fd\13\3\3\3\5\3\u0200\n\3\3\4\3\4\3\4\3\5\3\5\3\5\3\5"+ - "\5\5\u0209\n\5\3\5\3\5\3\5\5\5\u020e\n\5\3\5\3\5\3\6\3\6\3\7\3\7\3\7\3"+ - "\7\3\7\3\7\5\7\u021a\n\7\3\b\3\b\5\b\u021e\n\b\3\b\3\b\3\b\3\b\3\t\3\t"+ - "\7\t\u0226\n\t\f\t\16\t\u0229\13\t\3\t\3\t\3\n\3\n\7\n\u022f\n\n\f\n\16"+ - "\n\u0232\13\n\3\n\6\n\u0235\n\n\r\n\16\n\u0236\3\n\7\n\u023a\n\n\f\n\16"+ - "\n\u023d\13\n\5\n\u023f\n\n\3\n\3\n\3\13\3\13\7\13\u0245\n\13\f\13\16"+ - "\13\u0248\13\13\3\13\3\13\3\f\5\f\u024d\n\f\3\f\5\f\u0250\n\f\3\f\3\f"+ - "\3\f\3\f\3\f\3\f\5\f\u0258\n\f\3\r\3\r\3\r\5\r\u025d\n\r\3\r\3\r\3\r\5"+ - "\r\u0262\n\r\3\r\3\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3\16\7\16\u026e"+ - "\n\16\f\16\16\16\u0271\13\16\5\16\u0273\n\16\3\16\3\16\3\16\5\16\u0278"+ - "\n\16\3\17\3\17\3\20\3\20\3\20\5\20\u027f\n\20\3\20\3\20\5\20\u0283\n"+ - "\20\3\21\5\21\u0286\n\21\3\21\3\21\3\21\3\21\3\21\3\22\3\22\3\22\7\22"+ - "\u0290\n\22\f\22\16\22\u0293\13\22\3\23\3\23\3\23\3\23\3\24\7\24\u029a"+ - "\n\24\f\24\16\24\u029d\13\24\3\24\5\24\u02a0\n\24\3\24\3\24\3\24\3\24"+ - "\5\24\u02a6\n\24\3\24\3\24\3\25\7\25\u02ab\n\25\f\25\16\25\u02ae\13\25"+ - "\3\25\3\25\3\25\5\25\u02b3\n\25\3\25\3\25\5\25\u02b7\n\25\3\25\3\25\3"+ - "\26\3\26\3\26\3\26\3\26\3\27\3\27\3\27\3\27\3\30\3\30\3\31\5\31\u02c7"+ - "\n\31\3\31\7\31\u02ca\n\31\f\31\16\31\u02cd\13\31\3\31\5\31\u02d0\n\31"+ - "\3\31\5\31\u02d3\n\31\3\31\3\31\3\31\3\31\5\31\u02d9\n\31\3\31\5\31\u02dc"+ - "\n\31\3\32\5\32\u02df\n\32\3\32\5\32\u02e2\n\32\3\32\3\32\5\32\u02e6\n"+ - "\32\3\32\3\32\3\32\3\32\3\32\7\32\u02ed\n\32\f\32\16\32\u02f0\13\32\5"+ - "\32\u02f2\n\32\3\32\3\32\3\33\5\33\u02f7\n\33\3\33\3\33\5\33\u02fb\n\33"+ - "\3\33\3\33\3\33\3\33\3\33\3\34\5\34\u0303\n\34\3\34\3\34\3\34\3\34\3\34"+ - "\3\34\3\34\3\34\5\34\u030d\n\34\3\34\3\34\5\34\u0311\n\34\3\34\3\34\3"+ - "\34\3\34\3\34\5\34\u0318\n\34\3\35\3\35\5\35\u031c\n\35\3\36\5\36\u031f"+ - "\n\36\3\36\3\36\3\37\5\37\u0324\n\37\3\37\3\37\5\37\u0328\n\37\3\37\3"+ - "\37\3\37\3\37\5\37\u032e\n\37\3 \3 \3 \3!\3!\3\"\7\"\u0336\n\"\f\"\16"+ - "\"\u0339\13\"\3\"\3\"\3\"\7\"\u033e\n\"\f\"\16\"\u0341\13\"\3\"\3\"\3"+ - "#\3#\3#\5#\u0348\n#\3$\3$\3$\7$\u034d\n$\f$\16$\u0350\13$\3%\3%\5%\u0354"+ - "\n%\3&\3&\3&\3&\3&\3&\3&\3&\5&\u035e\n&\3&\5&\u0361\n&\3&\5&\u0364\n&"+ - "\3&\5&\u0367\n&\3&\3&\3&\3&\3&\3&\3&\5&\u0370\n&\3&\3&\3&\3&\5&\u0376"+ - "\n&\3&\6&\u0379\n&\r&\16&\u037a\3&\3&\3&\6&\u0380\n&\r&\16&\u0381\3&\3"+ - "&\7&\u0386\n&\f&\16&\u0389\13&\3\'\3\'\3\'\7\'\u038e\n\'\f\'\16\'\u0391"+ - "\13\'\3\'\3\'\3(\3(\3(\3(\7(\u0399\n(\f(\16(\u039c\13(\3(\3(\5(\u03a0"+ - "\n(\3(\5(\u03a3\n(\3(\3(\3)\3)\3)\3*\3*\3*\7*\u03ad\n*\f*\16*\u03b0\13"+ - "*\3*\5*\u03b3\n*\3*\3*\3+\3+\5+\u03b9\n+\3,\3,\3,\3,\3,\3,\5,\u03c1\n"+ - ",\3-\3-\5-\u03c5\n-\3.\3.\3/\3/\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60"+ - "\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60"+ - "\3\60\3\60\3\60\3\60\3\60\3\60\3\60\3\60\5\60\u03e9\n\60\3\61\3\61\3\61"+ - "\3\61\5\61\u03ef\n\61\3\61\3\61\5\61\u03f3\n\61\3\62\3\62\3\62\3\62\3"+ - "\62\5\62\u03fa\n\62\3\62\3\62\5\62\u03fe\n\62\3\63\3\63\3\64\3\64\3\65"+ - "\3\65\3\65\5\65\u0407\n\65\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66"+ - "\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66\3\66"+ - "\3\66\3\66\3\66\5\66\u0423\n\66\3\67\3\67\3\67\3\67\3\67\5\67\u042a\n"+ - "\67\3\67\3\67\5\67\u042e\n\67\3\67\3\67\3\67\3\67\3\67\5\67\u0435\n\67"+ - "\38\38\38\38\78\u043b\n8\f8\168\u043e\138\58\u0440\n8\38\38\39\39\39\3"+ - "9\39\59\u0449\n9\39\39\39\79\u044e\n9\f9\169\u0451\139\3:\3:\3:\3:\3;"+ - "\3;\3;\3;\3;\3;\5;\u045d\n;\3<\3<\3<\5<\u0462\n<\3<\3<\5<\u0466\n<\3<"+ - "\3<\3=\3=\3=\3=\7=\u046e\n=\f=\16=\u0471\13=\5=\u0473\n=\3=\3=\3>\5>\u0478"+ - "\n>\3>\3>\3?\3?\5?\u047e\n?\3?\3?\3@\3@\3@\7@\u0485\n@\f@\16@\u0488\13"+ - "@\3@\5@\u048b\n@\3A\3A\3A\3A\3B\3B\5B\u0493\nB\3B\3B\3C\3C\3C\3C\3C\3"+ - "D\3D\3D\3D\3D\3E\3E\3E\3E\3E\3F\3F\3F\3F\3F\3G\3G\3G\3G\3G\3H\3H\3I\3"+ - "I\3I\7I\u04b5\nI\fI\16I\u04b8\13I\3J\3J\7J\u04bc\nJ\fJ\16J\u04bf\13J\3"+ - "J\5J\u04c2\nJ\3K\3K\3K\3K\7K\u04c8\nK\fK\16K\u04cb\13K\3K\3K\3L\3L\3L"+ - "\3L\3L\7L\u04d4\nL\fL\16L\u04d7\13L\3L\3L\3M\3M\3M\7M\u04de\nM\fM\16M"+ - "\u04e1\13M\3M\3M\3N\3N\3N\3N\6N\u04e9\nN\rN\16N\u04ea\3N\3N\3O\3O\3O\3"+ - "O\7O\u04f3\nO\fO\16O\u04f6\13O\3O\3O\3O\3O\3O\3O\5O\u04fe\nO\3O\3O\3O"+ - "\7O\u0503\nO\fO\16O\u0506\13O\3O\3O\3O\3O\3O\5O\u050d\nO\3O\3O\3O\7O\u0512"+ - "\nO\fO\16O\u0515\13O\3O\3O\5O\u0519\nO\3P\3P\5P\u051d\nP\3Q\3Q\3Q\5Q\u0522"+ - "\nQ\3R\3R\3R\3R\3R\7R\u0529\nR\fR\16R\u052c\13R\3R\3R\5R\u0530\nR\3R\3"+ - "R\3R\3R\3R\3R\5R\u0538\nR\3S\3S\3S\7S\u053d\nS\fS\16S\u0540\13S\3S\3S"+ - "\5S\u0544\nS\3S\5S\u0547\nS\3T\3T\3T\3T\3T\3T\3T\3T\3T\3T\5T\u0553\nT"+ - "\3U\3U\3U\7U\u0558\nU\fU\16U\u055b\13U\3U\3U\5U\u055f\nU\3U\3U\3U\7U\u0564"+ - "\nU\fU\16U\u0567\13U\3U\3U\5U\u056b\nU\3U\5U\u056e\nU\3V\3V\3V\7V\u0573"+ - "\nV\fV\16V\u0576\13V\3V\3V\5V\u057a\nV\3V\5V\u057d\nV\3W\3W\3W\3X\3X\3"+ - "X\3X\3Y\5Y\u0587\nY\3Y\3Y\3Z\3Z\3Z\3Z\3[\3[\3[\3[\7[\u0593\n[\f[\16[\u0596"+ - "\13[\3[\3[\5[\u059a\n[\3[\5[\u059d\n[\5[\u059f\n[\3[\3[\3\\\3\\\3\\\3"+ - "\\\3]\3]\3]\7]\u05aa\n]\f]\16]\u05ad\13]\3]\3]\5]\u05b1\n]\3]\5]\u05b4"+ - "\n]\5]\u05b6\n]\3^\3^\3^\5^\u05bb\n^\3_\3_\3_\3`\3`\3`\5`\u05c3\n`\3a"+ - "\3a\5a\u05c7\na\3b\3b\3b\3b\7b\u05cd\nb\fb\16b\u05d0\13b\3b\3b\5b\u05d4"+ - "\nb\3b\5b\u05d7\nb\3b\3b\3c\3c\3c\3d\3d\3d\3d\3e\3e\3e\3e\3e\7e\u05e7"+ - "\ne\fe\16e\u05ea\13e\3e\6e\u05ed\ne\re\16e\u05ee\5e\u05f1\ne\3e\3e\5e"+ - "\u05f5\ne\3e\3e\3e\3e\3e\3e\3e\3e\3e\3e\3e\3e\7e\u0603\ne\fe\16e\u0606"+ - "\13e\3e\3e\5e\u060a\ne\3e\3e\5e\u060e\ne\3f\3f\3f\3f\3g\3g\3g\3h\3h\3"+ - "h\7h\u061a\nh\fh\16h\u061d\13h\3h\3h\5h\u0621\nh\3h\5h\u0624\nh\5h\u0626"+ - "\nh\3i\3i\3i\5i\u062b\ni\3j\3j\3j\5j\u0630\nj\3k\3k\5k\u0634\nk\3k\3k"+ - "\5k\u0638\nk\3k\3k\3k\3k\5k\u063e\nk\3k\3k\7k\u0642\nk\fk\16k\u0645\13"+ - "k\3k\3k\3l\3l\3l\3l\5l\u064d\nl\3l\3l\3m\3m\3m\3m\7m\u0655\nm\fm\16m\u0658"+ - "\13m\3m\3m\3n\3n\3n\3o\3o\3o\3p\3p\3p\7p\u0665\np\fp\16p\u0668\13p\3p"+ - "\3p\3q\3q\3q\7q\u066f\nq\fq\16q\u0672\13q\3q\3q\3q\3r\6r\u0678\nr\rr\16"+ - "r\u0679\3r\5r\u067d\nr\3r\5r\u0680\nr\3s\3s\3s\3s\3s\3s\3s\7s\u0689\n"+ - "s\fs\16s\u068c\13s\3s\3s\3t\3t\3t\7t\u0693\nt\ft\16t\u0696\13t\3t\3t\3"+ - "u\3u\3u\3u\3v\3v\3v\3v\3w\3w\5w\u06a4\nw\3w\3w\3x\3x\3x\3x\3x\5x\u06ad"+ - "\nx\3x\3x\3y\3y\5y\u06b3\ny\3z\3z\3{\3{\5{\u06b9\n{\3|\3|\3|\3|\7|\u06bf"+ - "\n|\f|\16|\u06c2\13|\3|\3|\3}\3}\3}\3}\5}\u06ca\n}\3~\3~\3~\3~\3~\3~\3"+ - "~\3~\5~\u06d4\n~\3~\3~\3~\3~\3~\3~\3~\3~\3~\3~\3~\7~\u06e1\n~\f~\16~\u06e4"+ - "\13~\3\177\3\177\3\177\3\u0080\3\u0080\3\u0080\3\u0080\3\u0081\3\u0081"+ - "\3\u0081\3\u0081\3\u0081\5\u0081\u06f2\n\u0081\3\u0082\3\u0082\3\u0082"+ - "\5\u0082\u06f7\n\u0082\3\u0082\3\u0082\3\u0083\3\u0083\3\u0083\3\u0083"+ - "\5\u0083\u06ff\n\u0083\3\u0083\3\u0083\3\u0084\3\u0084\3\u0084\7\u0084"+ - "\u0706\n\u0084\f\u0084\16\u0084\u0709\13\u0084\3\u0085\3\u0085\3\u0085"+ - "\5\u0085\u070e\n\u0085\3\u0086\7\u0086\u0711\n\u0086\f\u0086\16\u0086"+ - "\u0714\13\u0086\3\u0086\5\u0086\u0717\n\u0086\3\u0086\3\u0086\3\u0086"+ - "\3\u0086\3\u0087\3\u0087\3\u0087\7\u0087\u0720\n\u0087\f\u0087\16\u0087"+ - "\u0723\13\u0087\3\u0088\3\u0088\3\u0088\3\u0089\3\u0089\5\u0089\u072a"+ - "\n\u0089\3\u0089\3\u0089\3\u008a\5\u008a\u072f\n\u008a\3\u008a\5\u008a"+ - "\u0732\n\u008a\3\u008a\5\u008a\u0735\n\u008a\3\u008a\5\u008a\u0738\n\u008a"+ - "\5\u008a\u073a\n\u008a\3\u008b\3\u008b\3\u008b\5\u008b\u073f\n\u008b\3"+ - "\u008b\3\u008b\7\u008b\u0743\n\u008b\f\u008b\16\u008b\u0746\13\u008b\3"+ - "\u008b\3\u008b\3\u008c\3\u008c\3\u008d\3\u008d\3\u008d\7\u008d\u074f\n"+ - "\u008d\f\u008d\16\u008d\u0752\13\u008d\3\u008e\3\u008e\3\u008e\7\u008e"+ - "\u0757\n\u008e\f\u008e\16\u008e\u075a\13\u008e\3\u008e\3\u008e\3\u008f"+ - "\3\u008f\3\u008f\7\u008f\u0761\n\u008f\f\u008f\16\u008f\u0764\13\u008f"+ - "\3\u008f\3\u008f\3\u0090\3\u0090\3\u0090\7\u0090\u076b\n\u0090\f\u0090"+ - "\16\u0090\u076e\13\u0090\3\u0090\3\u0090\3\u0091\3\u0091\3\u0091\7\u0091"+ - "\u0775\n\u0091\f\u0091\16\u0091\u0778\13\u0091\3\u0091\3\u0091\3\u0092"+ - "\3\u0092\3\u0092\3\u0093\3\u0093\3\u0093\3\u0094\3\u0094\3\u0094\3\u0094"+ - "\3\u0095\3\u0095\3\u0096\3\u0096\3\u0096\3\u0096\5\u0096\u078c\n\u0096"+ - "\3\u0096\3\u0096\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\7\u0097\u0798\n\u0097\f\u0097\16\u0097\u079b\13\u0097\3\u0097"+ - "\5\u0097\u079e\n\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\6\u0097\u07ad"+ - "\n\u0097\r\u0097\16\u0097\u07ae\3\u0097\5\u0097\u07b2\n\u0097\3\u0097"+ - "\5\u0097\u07b5\n\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\5\u0097\u07c3\n\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\5\u0097\u07ca\n\u0097\3\u0097"+ - "\3\u0097\5\u0097\u07ce\n\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097"+ - "\3\u0097\3\u0097\3\u0097\3\u0097\3\u0097\7\u0097\u07fe\n\u0097\f\u0097"+ - "\16\u0097\u0801\13\u0097\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ - "\3\u0098\5\u0098\u080a\n\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ - "\3\u0098\7\u0098\u0812\n\u0098\f\u0098\16\u0098\u0815\13\u0098\3\u0099"+ - "\3\u0099\3\u009a\3\u009a\3\u009a\5\u009a\u081c\n\u009a\3\u009a\5\u009a"+ - "\u081f\n\u009a\3\u009a\3\u009a\3\u009a\3\u009a\5\u009a\u0825\n\u009a\3"+ - "\u009a\3\u009a\5\u009a\u0829\n\u009a\3\u009b\7\u009b\u082c\n\u009b\f\u009b"+ - "\16\u009b\u082f\13\u009b\3\u009b\3\u009b\3\u009b\3\u009c\3\u009c\3\u009c"+ - "\3\u009d\3\u009d\3\u009d\3\u009d\3\u009d\3\u009d\3\u009d\3\u009d\3\u009d"+ - "\3\u009d\3\u009d\3\u009d\3\u009d\3\u009d\5\u009d\u0845\n\u009d\3\u009e"+ - "\3\u009e\3\u009f\3\u009f\5\u009f\u084b\n\u009f\3\u009f\3\u009f\3\u00a0"+ - "\3\u00a0\5\u00a0\u0851\n\u00a0\3\u00a0\3\u00a0\3\u00a1\3\u00a1\7\u00a1"+ - "\u0857\n\u00a1\f\u00a1\16\u00a1\u085a\13\u00a1\3\u00a1\3\u00a1\3\u00a2"+ - "\7\u00a2\u085f\n\u00a2\f\u00a2\16\u00a2\u0862\13\u00a2\3\u00a2\3\u00a2"+ - "\3\u00a3\3\u00a3\3\u00a3\7\u00a3\u0869\n\u00a3\f\u00a3\16\u00a3\u086c"+ - "\13\u00a3\3\u00a4\3\u00a4\3\u00a5\3\u00a5\3\u00a5\7\u00a5\u0873\n\u00a5"+ - "\f\u00a5\16\u00a5\u0876\13\u00a5\3\u00a6\7\u00a6\u0879\n\u00a6\f\u00a6"+ - "\16\u00a6\u087c\13\u00a6\3\u00a6\5\u00a6\u087f\n\u00a6\3\u00a6\3\u00a6"+ - "\3\u00a6\3\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a8\7\u00a8\u0889\n\u00a8"+ - "\f\u00a8\16\u00a8\u088c\13\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a8\3\u00a9"+ - "\3\u00a9\5\u00a9\u0894\n\u00a9\3\u00a9\3\u00a9\3\u00a9\5\u00a9\u0899\n"+ - "\u00a9\7\u00a9\u089b\n\u00a9\f\u00a9\16\u00a9\u089e\13\u00a9\3\u00a9\3"+ - "\u00a9\5\u00a9\u08a2\n\u00a9\3\u00a9\5\u00a9\u08a5\n\u00a9\3\u00aa\5\u00aa"+ - "\u08a8\n\u00aa\3\u00aa\3\u00aa\5\u00aa\u08ac\n\u00aa\3\u00aa\3\u00aa\3"+ - "\u00aa\3\u00aa\3\u00aa\3\u00aa\5\u00aa\u08b4\n\u00aa\3\u00ab\3\u00ab\3"+ - "\u00ac\3\u00ac\3\u00ad\3\u00ad\3\u00ad\3\u00ae\3\u00ae\3\u00af\3\u00af"+ - "\3\u00af\3\u00af\3\u00b0\3\u00b0\3\u00b0\3\u00b1\3\u00b1\3\u00b1\3\u00b1"+ - "\3\u00b2\3\u00b2\3\u00b2\3\u00b2\3\u00b2\5\u00b2\u08cf\n\u00b2\3\u00b3"+ - "\5\u00b3\u08d2\n\u00b3\3\u00b3\3\u00b3\3\u00b3\3\u00b3\5\u00b3\u08d8\n"+ - "\u00b3\3\u00b3\5\u00b3\u08db\n\u00b3\7\u00b3\u08dd\n\u00b3\f\u00b3\16"+ - "\u00b3\u08e0\13\u00b3\3\u00b4\3\u00b4\3\u00b4\3\u00b4\3\u00b4\7\u00b4"+ - "\u08e7\n\u00b4\f\u00b4\16\u00b4\u08ea\13\u00b4\3\u00b4\7\u00b4\u08ed\n"+ - "\u00b4\f\u00b4\16\u00b4\u08f0\13\u00b4\3\u00b4\3\u00b4\3\u00b5\3\u00b5"+ - "\3\u00b5\3\u00b5\3\u00b5\5\u00b5\u08f9\n\u00b5\3\u00b6\3\u00b6\3\u00b6"+ - "\7\u00b6\u08fe\n\u00b6\f\u00b6\16\u00b6\u0901\13\u00b6\3\u00b6\3\u00b6"+ - "\3\u00b7\3\u00b7\3\u00b7\3\u00b7\3\u00b8\3\u00b8\3\u00b8\7\u00b8\u090c"+ - "\n\u00b8\f\u00b8\16\u00b8\u090f\13\u00b8\3\u00b8\3\u00b8\3\u00b9\3\u00b9"+ - "\3\u00b9\3\u00b9\3\u00b9\7\u00b9\u0918\n\u00b9\f\u00b9\16\u00b9\u091b"+ - "\13\u00b9\3\u00b9\3\u00b9\3\u00ba\3\u00ba\3\u00ba\3\u00ba\3\u00bb\3\u00bb"+ - "\3\u00bb\3\u00bb\6\u00bb\u0927\n\u00bb\r\u00bb\16\u00bb\u0928\3\u00bb"+ - "\5\u00bb\u092c\n\u00bb\3\u00bb\5\u00bb\u092f\n\u00bb\3\u00bc\3\u00bc\5"+ - "\u00bc\u0933\n\u00bc\3\u00bd\3\u00bd\3\u00bd\3\u00bd\3\u00bd\7\u00bd\u093a"+ - "\n\u00bd\f\u00bd\16\u00bd\u093d\13\u00bd\3\u00bd\5\u00bd\u0940\n\u00bd"+ - "\3\u00bd\3\u00bd\3\u00be\3\u00be\3\u00be\3\u00be\3\u00be\7\u00be\u0949"+ - "\n\u00be\f\u00be\16\u00be\u094c\13\u00be\3\u00be\5\u00be\u094f\n\u00be"+ - "\3\u00be\3\u00be\3\u00bf\3\u00bf\5\u00bf\u0955\n\u00bf\3\u00bf\3\u00bf"+ - "\3\u00c0\3\u00c0\5\u00c0\u095b\n\u00c0\3\u00c0\3\u00c0\3\u00c1\3\u00c1"+ - "\3\u00c1\3\u00c1\6\u00c1\u0963\n\u00c1\r\u00c1\16\u00c1\u0964\3\u00c1"+ - "\5\u00c1\u0968\n\u00c1\3\u00c1\5\u00c1\u096b\n\u00c1\3\u00c2\3\u00c2\5"+ - "\u00c2\u096f\n\u00c2\3\u00c3\3\u00c3\3\u00c4\3\u00c4\3\u00c4\5\u00c4\u0976"+ - "\n\u00c4\3\u00c4\5\u00c4\u0979\n\u00c4\3\u00c4\5\u00c4\u097c\n\u00c4\3"+ - "\u00c4\5\u00c4\u097f\n\u00c4\3\u00c5\3\u00c5\3\u00c5\6\u00c5\u0984\n\u00c5"+ - "\r\u00c5\16\u00c5\u0985\3\u00c5\3\u00c5\3\u00c6\3\u00c6\3\u00c6\5\u00c6"+ - "\u098d\n\u00c6\3\u00c6\5\u00c6\u0990\n\u00c6\3\u00c6\5\u00c6\u0993\n\u00c6"+ - "\3\u00c6\5\u00c6\u0996\n\u00c6\3\u00c6\5\u00c6\u0999\n\u00c6\3\u00c6\3"+ - "\u00c6\3\u00c7\5\u00c7\u099e\n\u00c7\3\u00c7\3\u00c7\5\u00c7\u09a2\n\u00c7"+ - "\3\u00c8\3\u00c8\3\u00c8\3\u00c8\3\u00c9\3\u00c9\3\u00c9\3\u00c9\3\u00c9"+ - "\7\u00c9\u09ad\n\u00c9\f\u00c9\16\u00c9\u09b0\13\u00c9\3\u00ca\3\u00ca"+ - "\5\u00ca\u09b4\n\u00ca\3\u00cb\3\u00cb\3\u00cb\3\u00cc\3\u00cc\3\u00cc"+ - "\5\u00cc\u09bc\n\u00cc\3\u00cc\5\u00cc\u09bf\n\u00cc\3\u00cc\5\u00cc\u09c2"+ - "\n\u00cc\3\u00cd\3\u00cd\3\u00cd\7\u00cd\u09c7\n\u00cd\f\u00cd\16\u00cd"+ - "\u09ca\13\u00cd\3\u00ce\3\u00ce\3\u00ce\5\u00ce\u09cf\n\u00ce\3\u00cf"+ - "\3\u00cf\3\u00cf\3\u00cf\3\u00d0\3\u00d0\3\u00d0\3\u00d1\3\u00d1\3\u00d1"+ - "\3\u00d1\3\u00d1\3\u00d1\7\u00d1\u09de\n\u00d1\f\u00d1\16\u00d1\u09e1"+ - "\13\u00d1\3\u00d1\3\u00d1\3\u00d2\3\u00d2\5\u00d2\u09e7\n\u00d2\3\u00d2"+ - "\7\u00d2\u09ea\n\u00d2\f\u00d2\16\u00d2\u09ed\13\u00d2\3\u00d2\5\u00d2"+ - "\u09f0\n\u00d2\3\u00d2\7\u00d2\u09f3\n\u00d2\f\u00d2\16\u00d2\u09f6\13"+ - "\u00d2\3\u00d2\5\u00d2\u09f9\n\u00d2\3\u00d2\3\u00d2\5\u00d2\u09fd\n\u00d2"+ - "\3\u00d3\3\u00d3\3\u00d3\3\u00d3\3\u00d3\3\u00d3\5\u00d3\u0a05\n\u00d3"+ - "\3\u00d3\3\u00d3\3\u00d3\5\u00d3\u0a0a\n\u00d3\3\u00d4\3\u00d4\3\u00d4"+ - "\3\u00d4\3\u00d4\3\u00d4\3\u00d4\5\u00d4\u0a13\n\u00d4\3\u00d4\3\u00d4"+ - "\3\u00d4\3\u00d4\3\u00d4\5\u00d4\u0a1a\n\u00d4\3\u00d5\3\u00d5\3\u00d5"+ - "\3\u00d5\5\u00d5\u0a20\n\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5"+ - "\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\5\u00d5"+ - "\u0a2f\n\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5\5\u00d5\u0a36\n"+ - "\u00d5\3\u00d6\3\u00d6\5\u00d6\u0a3a\n\u00d6\3\u00d6\5\u00d6\u0a3d\n\u00d6"+ - "\3\u00d6\3\u00d6\5\u00d6\u0a41\n\u00d6\3\u00d7\3\u00d7\3\u00d7\3\u00d8"+ - "\3\u00d8\3\u00d8\3\u00d9\3\u00d9\3\u00da\3\u00da\3\u00da\3\u00da\3\u00da"+ - "\3\u00da\3\u00da\3\u00da\3\u00da\3\u00da\3\u00da\3\u00da\5\u00da\u0a57"+ - "\n\u00da\3\u00da\5\u00da\u0a5a\n\u00da\3\u00db\3\u00db\3\u00dc\6\u00dc"+ - "\u0a5f\n\u00dc\r\u00dc\16\u00dc\u0a60\3\u00dc\7\u00dc\u0a64\n\u00dc\f"+ - "\u00dc\16\u00dc\u0a67\13\u00dc\3\u00dc\5\u00dc\u0a6a\n\u00dc\3\u00dd\3"+ - "\u00dd\3\u00dd\3\u00de\3\u00de\7\u00de\u0a71\n\u00de\f\u00de\16\u00de"+ - "\u0a74\13\u00de\3\u00df\3\u00df\7\u00df\u0a78\n\u00df\f\u00df\16\u00df"+ - "\u0a7b\13\u00df\3\u00e0\5\u00e0\u0a7e\n\u00e0\3\u00e1\3\u00e1\5\u00e1"+ - "\u0a82\n\u00e1\3\u00e2\3\u00e2\5\u00e2\u0a86\n\u00e2\3\u00e3\3\u00e3\3"+ - "\u00e3\3\u00e3\3\u00e3\3\u00e3\3\u00e3\3\u00e3\3\u00e3\6\u00e3\u0a91\n"+ - "\u00e3\r\u00e3\16\u00e3\u0a92\3\u00e4\3\u00e4\3\u00e5\3\u00e5\3\u00e5"+ - "\3\u00e6\3\u00e6\3\u00e7\3\u00e7\3\u00e7\3\u00e7\5\u00e7\u0aa0\n\u00e7"+ - "\3\u00e8\3\u00e8\5\u00e8\u0aa4\n\u00e8\3\u00e9\3\u00e9\3\u00ea\3\u00ea"+ - "\3\u00ea\3\u00ea\3\u00eb\3\u00eb\3\u00ec\3\u00ec\3\u00ec\3\u00ec\3\u00ed"+ - "\3\u00ed\3\u00ee\3\u00ee\3\u00ee\3\u00ee\3\u00ef\3\u00ef\3\u00ef\2\7J"+ - "p\u00fa\u012c\u012e\u00f0\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&"+ - "(*,.\60\62\64\668:<>@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084"+ - "\u0086\u0088\u008a\u008c\u008e\u0090\u0092\u0094\u0096\u0098\u009a\u009c"+ - "\u009e\u00a0\u00a2\u00a4\u00a6\u00a8\u00aa\u00ac\u00ae\u00b0\u00b2\u00b4"+ - "\u00b6\u00b8\u00ba\u00bc\u00be\u00c0\u00c2\u00c4\u00c6\u00c8\u00ca\u00cc"+ - "\u00ce\u00d0\u00d2\u00d4\u00d6\u00d8\u00da\u00dc\u00de\u00e0\u00e2\u00e4"+ - "\u00e6\u00e8\u00ea\u00ec\u00ee\u00f0\u00f2\u00f4\u00f6\u00f8\u00fa\u00fc"+ - "\u00fe\u0100\u0102\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114"+ - "\u0116\u0118\u011a\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c"+ - "\u012e\u0130\u0132\u0134\u0136\u0138\u013a\u013c\u013e\u0140\u0142\u0144"+ - "\u0146\u0148\u014a\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c"+ - "\u015e\u0160\u0162\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174"+ - "\u0176\u0178\u017a\u017c\u017e\u0180\u0182\u0184\u0186\u0188\u018a\u018c"+ - "\u018e\u0190\u0192\u0194\u0196\u0198\u019a\u019c\u019e\u01a0\u01a2\u01a4"+ - "\u01a6\u01a8\u01aa\u01ac\u01ae\u01b0\u01b2\u01b4\u01b6\u01b8\u01ba\u01bc"+ - "\u01be\u01c0\u01c2\u01c4\u01c6\u01c8\u01ca\u01cc\u01ce\u01d0\u01d2\u01d4"+ - "\u01d6\u01d8\u01da\u01dc\2\36\3\2\5\6\4\2\n\n\23\23\4\2\n\n\f\f\7\2\7"+ - "\7\16\16\21\22\32\32WW\3\2EJ\3\2\u00ac\u00b5\4\2\u00bd\u00bd\u00c1\u00c1"+ - "\4\2\u0086\u0086\u0088\u0088\4\2\u0087\u0087\u0089\u0089\4\2\u0082\u0082"+ - "\u008b\u008b\4\2\u0091\u0091\u00c1\u00c1\6\2\33\33\u008f\u0090\u0094\u0094"+ - "\u00a1\u00a1\3\2\u0091\u0093\3\2\u008f\u0090\4\2\u00a7\u00a7\u00b6\u00b6"+ - "\3\2\u0097\u009a\3\2\u0095\u0096\3\2\u009d\u009e\4\2\u009f\u00a0\u00a8"+ - "\u00a8\3\2\u0091\u0092\3\2\u00ba\u00bb\3\2\u00b8\u00b9\3\2\u00be\u00bf"+ - "\7\2KLYY]]__ww\4\2+,dd\3\2\u009b\u009c\3\2CD\3\2\65@\u0b86\2\u01e2\3\2"+ - "\2\2\4\u01f6\3\2\2\2\6\u0201\3\2\2\2\b\u0204\3\2\2\2\n\u0211\3\2\2\2\f"+ - "\u0219\3\2\2\2\16\u021b\3\2\2\2\20\u0223\3\2\2\2\22\u022c\3\2\2\2\24\u0242"+ - "\3\2\2\2\26\u024c\3\2\2\2\30\u0259\3\2\2\2\32\u0277\3\2\2\2\34\u0279\3"+ - "\2\2\2\36\u027b\3\2\2\2 \u0285\3\2\2\2\"\u0291\3\2\2\2$\u0294\3\2\2\2"+ - "&\u029b\3\2\2\2(\u02ac\3\2\2\2*\u02ba\3\2\2\2,\u02bf\3\2\2\2.\u02c3\3"+ - "\2\2\2\60\u02c6\3\2\2\2\62\u02de\3\2\2\2\64\u02f6\3\2\2\2\66\u0317\3\2"+ - "\2\28\u031b\3\2\2\2:\u031e\3\2\2\2<\u032d\3\2\2\2>\u032f\3\2\2\2@\u0332"+ - "\3\2\2\2B\u0337\3\2\2\2D\u0344\3\2\2\2F\u0349\3\2\2\2H\u0353\3\2\2\2J"+ - "\u036f\3\2\2\2L\u038a\3\2\2\2N\u0394\3\2\2\2P\u03a6\3\2\2\2R\u03a9\3\2"+ - "\2\2T\u03b8\3\2\2\2V\u03c0\3\2\2\2X\u03c4\3\2\2\2Z\u03c6\3\2\2\2\\\u03c8"+ - "\3\2\2\2^\u03e8\3\2\2\2`\u03ea\3\2\2\2b\u03f4\3\2\2\2d\u03ff\3\2\2\2f"+ - "\u0401\3\2\2\2h\u0403\3\2\2\2j\u0422\3\2\2\2l\u0434\3\2\2\2n\u0436\3\2"+ - "\2\2p\u0448\3\2\2\2r\u0452\3\2\2\2t\u045c\3\2\2\2v\u045e\3\2\2\2x\u0469"+ - "\3\2\2\2z\u0477\3\2\2\2|\u047b\3\2\2\2~\u048a\3\2\2\2\u0080\u048c\3\2"+ - "\2\2\u0082\u0490\3\2\2\2\u0084\u0496\3\2\2\2\u0086\u049b\3\2\2\2\u0088"+ - "\u04a0\3\2\2\2\u008a\u04a5\3\2\2\2\u008c\u04aa\3\2\2\2\u008e\u04af\3\2"+ - "\2\2\u0090\u04b1\3\2\2\2\u0092\u04b9\3\2\2\2\u0094\u04c3\3\2\2\2\u0096"+ - "\u04ce\3\2\2\2\u0098\u04da\3\2\2\2\u009a\u04e4\3\2\2\2\u009c\u0518\3\2"+ - "\2\2\u009e\u051c\3\2\2\2\u00a0\u0521\3\2\2\2\u00a2\u0537\3\2\2\2\u00a4"+ - "\u0546\3\2\2\2\u00a6\u0552\3\2\2\2\u00a8\u056d\3\2\2\2\u00aa\u057c\3\2"+ - "\2\2\u00ac\u057e\3\2\2\2\u00ae\u0581\3\2\2\2\u00b0\u0586\3\2\2\2\u00b2"+ - "\u058a\3\2\2\2\u00b4\u058e\3\2\2\2\u00b6\u05a2\3\2\2\2\u00b8\u05b5\3\2"+ - "\2\2\u00ba\u05b7\3\2\2\2\u00bc\u05bc\3\2\2\2\u00be\u05c2\3\2\2\2\u00c0"+ - "\u05c6\3\2\2\2\u00c2\u05c8\3\2\2\2\u00c4\u05da\3\2\2\2\u00c6\u05dd\3\2"+ - "\2\2\u00c8\u060d\3\2\2\2\u00ca\u060f\3\2\2\2\u00cc\u0613\3\2\2\2\u00ce"+ - "\u0625\3\2\2\2\u00d0\u0627\3\2\2\2\u00d2\u062f\3\2\2\2\u00d4\u0631\3\2"+ - "\2\2\u00d6\u0648\3\2\2\2\u00d8\u0650\3\2\2\2\u00da\u065b\3\2\2\2\u00dc"+ - "\u065e\3\2\2\2\u00de\u0661\3\2\2\2\u00e0\u066b\3\2\2\2\u00e2\u067f\3\2"+ - "\2\2\u00e4\u0681\3\2\2\2\u00e6\u068f\3\2\2\2\u00e8\u0699\3\2\2\2\u00ea"+ - "\u069d\3\2\2\2\u00ec\u06a1\3\2\2\2\u00ee\u06a7\3\2\2\2\u00f0\u06b2\3\2"+ - "\2\2\u00f2\u06b4\3\2\2\2\u00f4\u06b6\3\2\2\2\u00f6\u06ba\3\2\2\2\u00f8"+ - "\u06c9\3\2\2\2\u00fa\u06d3\3\2\2\2\u00fc\u06e5\3\2\2\2\u00fe\u06e8\3\2"+ - "\2\2\u0100\u06ec\3\2\2\2\u0102\u06f3\3\2\2\2\u0104\u06fa\3\2\2\2\u0106"+ - "\u0702\3\2\2\2\u0108\u070d\3\2\2\2\u010a\u0716\3\2\2\2\u010c\u071c\3\2"+ - "\2\2\u010e\u0724\3\2\2\2\u0110\u0727\3\2\2\2\u0112\u0739\3\2\2\2\u0114"+ - "\u073b\3\2\2\2\u0116\u0749\3\2\2\2\u0118\u074b\3\2\2\2\u011a\u0753\3\2"+ - "\2\2\u011c\u075d\3\2\2\2\u011e\u0767\3\2\2\2\u0120\u0771\3\2\2\2\u0122"+ - "\u077b\3\2\2\2\u0124\u077e\3\2\2\2\u0126\u0781\3\2\2\2\u0128\u0785\3\2"+ - "\2\2\u012a\u0787\3\2\2\2\u012c\u07cd\3\2\2\2\u012e\u0809\3\2\2\2\u0130"+ - "\u0816\3\2\2\2\u0132\u0828\3\2\2\2\u0134\u082d\3\2\2\2\u0136\u0833\3\2"+ - "\2\2\u0138\u0844\3\2\2\2\u013a\u0846\3\2\2\2\u013c\u084a\3\2\2\2\u013e"+ - "\u0850\3\2\2\2\u0140\u0854\3\2\2\2\u0142\u0860\3\2\2\2\u0144\u0865\3\2"+ - "\2\2\u0146\u086d\3\2\2\2\u0148\u086f\3\2\2\2\u014a\u087a\3\2\2\2\u014c"+ - "\u0883\3\2\2\2\u014e\u088a\3\2\2\2\u0150\u08a4\3\2\2\2\u0152\u08b3\3\2"+ - "\2\2\u0154\u08b5\3\2\2\2\u0156\u08b7\3\2\2\2\u0158\u08b9\3\2\2\2\u015a"+ - "\u08bc\3\2\2\2\u015c\u08be\3\2\2\2\u015e\u08c2\3\2\2\2\u0160\u08c5\3\2"+ - "\2\2\u0162\u08ce\3\2\2\2\u0164\u08d1\3\2\2\2\u0166\u08e1\3\2\2\2\u0168"+ - "\u08f8\3\2\2\2\u016a\u08fa\3\2\2\2\u016c\u0904\3\2\2\2\u016e\u0908\3\2"+ - "\2\2\u0170\u0912\3\2\2\2\u0172\u091e\3\2\2\2\u0174\u092e\3\2\2\2\u0176"+ - "\u0932\3\2\2\2\u0178\u0934\3\2\2\2\u017a\u0943\3\2\2\2\u017c\u0954\3\2"+ - "\2\2\u017e\u0958\3\2\2\2\u0180\u096a\3\2\2\2\u0182\u096e\3\2\2\2\u0184"+ - "\u0970\3\2\2\2\u0186\u0972\3\2\2\2\u0188\u0980\3\2\2\2\u018a\u0989\3\2"+ - "\2\2\u018c\u099d\3\2\2\2\u018e\u09a3\3\2\2\2\u0190\u09a7\3\2\2\2\u0192"+ - "\u09b1\3\2\2\2\u0194\u09b5\3\2\2\2\u0196\u09b8\3\2\2\2\u0198\u09c3\3\2"+ - "\2\2\u019a\u09cb\3\2\2\2\u019c\u09d0\3\2\2\2\u019e\u09d4\3\2\2\2\u01a0"+ - "\u09d7\3\2\2\2\u01a2\u09e4\3\2\2\2\u01a4\u0a04\3\2\2\2\u01a6\u0a19\3\2"+ - "\2\2\u01a8\u0a35\3\2\2\2\u01aa\u0a37\3\2\2\2\u01ac\u0a42\3\2\2\2\u01ae"+ - "\u0a45\3\2\2\2\u01b0\u0a48\3\2\2\2\u01b2\u0a59\3\2\2\2\u01b4\u0a5b\3\2"+ - "\2\2\u01b6\u0a5e\3\2\2\2\u01b8\u0a6b\3\2\2\2\u01ba\u0a6e\3\2\2\2\u01bc"+ - "\u0a75\3\2\2\2\u01be\u0a7d\3\2\2\2\u01c0\u0a7f\3\2\2\2\u01c2\u0a83\3\2"+ - "\2\2\u01c4\u0a90\3\2\2\2\u01c6\u0a94\3\2\2\2\u01c8\u0a96\3\2\2\2\u01ca"+ - "\u0a99\3\2\2\2\u01cc\u0a9b\3\2\2\2\u01ce\u0aa1\3\2\2\2\u01d0\u0aa5\3\2"+ - "\2\2\u01d2\u0aa7\3\2\2\2\u01d4\u0aab\3\2\2\2\u01d6\u0aad\3\2\2\2\u01d8"+ - "\u0ab1\3\2\2\2\u01da\u0ab3\3\2\2\2\u01dc\u0ab7\3\2\2\2\u01de\u01e1\5\b"+ - "\5\2\u01df\u01e1\5\u012a\u0096\2\u01e0\u01de\3\2\2\2\u01e0\u01df\3\2\2"+ - "\2\u01e1\u01e4\3\2\2\2\u01e2\u01e0\3\2\2\2\u01e2\u01e3\3\2\2\2\u01e3\u01f1"+ - "\3\2\2\2\u01e4\u01e2\3\2\2\2\u01e5\u01e7\5\u01b6\u00dc\2\u01e6\u01e5\3"+ - "\2\2\2\u01e6\u01e7\3\2\2\2\u01e7\u01eb\3\2\2\2\u01e8\u01ea\5h\65\2\u01e9"+ - "\u01e8\3\2\2\2\u01ea\u01ed\3\2\2\2\u01eb\u01e9\3\2\2\2\u01eb\u01ec\3\2"+ - "\2\2\u01ec\u01ee\3\2\2\2\u01ed\u01eb\3\2\2\2\u01ee\u01f0\5\f\7\2\u01ef"+ - "\u01e6\3\2\2\2\u01f0\u01f3\3\2\2\2\u01f1\u01ef\3\2\2\2\u01f1\u01f2\3\2"+ - "\2\2\u01f2\u01f4\3\2\2\2\u01f3\u01f1\3\2\2\2\u01f4\u01f5\7\2\2\3\u01f5"+ - "\3\3\2\2\2\u01f6\u01fb\7\u00c1\2\2\u01f7\u01f8\7\u0082\2\2\u01f8\u01fa"+ - "\7\u00c1\2\2\u01f9\u01f7\3\2\2\2\u01fa\u01fd\3\2\2\2\u01fb\u01f9\3\2\2"+ - "\2\u01fb\u01fc\3\2\2\2\u01fc\u01ff\3\2\2\2\u01fd\u01fb\3\2\2\2\u01fe\u0200"+ - "\5\6\4\2\u01ff\u01fe\3\2\2\2\u01ff\u0200\3\2\2\2\u0200\5\3\2\2\2\u0201"+ - "\u0202\7\26\2\2\u0202\u0203\7\u00c1\2\2\u0203\7\3\2\2\2\u0204\u0208\7"+ - "\3\2\2\u0205\u0206\5\n\6\2\u0206\u0207\7\u0092\2\2\u0207\u0209\3\2\2\2"+ - "\u0208\u0205\3\2\2\2\u0208\u0209\3\2\2\2\u0209\u020a\3\2\2\2\u020a\u020d"+ - "\5\4\3\2\u020b\u020c\7\4\2\2\u020c\u020e\7\u00c1\2\2\u020d\u020b\3\2\2"+ - "\2\u020d\u020e\3\2\2\2\u020e\u020f\3\2\2\2\u020f\u0210\7\u0080\2\2\u0210"+ - "\t\3\2\2\2\u0211\u0212\7\u00c1\2\2\u0212\13\3\2\2\2\u0213\u021a\5\16\b"+ - "\2\u0214\u021a\5\26\f\2\u0215\u021a\5 \21\2\u0216\u021a\5\62\32\2\u0217"+ - "\u021a\5\66\34\2\u0218\u021a\5\64\33\2\u0219\u0213\3\2\2\2\u0219\u0214"+ - "\3\2\2\2\u0219\u0215\3\2\2\2\u0219\u0216\3\2\2\2\u0219\u0217\3\2\2\2\u0219"+ - "\u0218\3\2\2\2\u021a\r\3\2\2\2\u021b\u021d\7\t\2\2\u021c\u021e\7\u00c1"+ - "\2\2\u021d\u021c\3\2\2\2\u021d\u021e\3\2\2\2\u021e\u021f\3\2\2\2\u021f"+ - "\u0220\7\36\2\2\u0220\u0221\5\u010c\u0087\2\u0221\u0222\5\20\t\2\u0222"+ - "\17\3\2\2\2\u0223\u0227\7\u0084\2\2\u0224\u0226\5\60\31\2\u0225\u0224"+ - "\3\2\2\2\u0226\u0229\3\2\2\2\u0227\u0225\3\2\2\2\u0227\u0228\3\2\2\2\u0228"+ - "\u022a\3\2\2\2\u0229\u0227\3\2\2\2\u022a\u022b\7\u0085\2\2\u022b\21\3"+ - "\2\2\2\u022c\u0230\7\u0084\2\2\u022d\u022f\5j\66\2\u022e\u022d\3\2\2\2"+ - "\u022f\u0232\3\2\2\2\u0230\u022e\3\2\2\2\u0230\u0231\3\2\2\2\u0231\u023e"+ - "\3\2\2\2\u0232\u0230\3\2\2\2\u0233\u0235\5B\"\2\u0234\u0233\3\2\2\2\u0235"+ - "\u0236\3\2\2\2\u0236\u0234\3\2\2\2\u0236\u0237\3\2\2\2\u0237\u023b\3\2"+ - "\2\2\u0238\u023a\5j\66\2\u0239\u0238\3\2\2\2\u023a\u023d\3\2\2\2\u023b"+ - "\u0239\3\2\2\2\u023b\u023c\3\2\2\2\u023c\u023f\3\2\2\2\u023d\u023b\3\2"+ - "\2\2\u023e\u0234\3\2\2\2\u023e\u023f\3\2\2\2\u023f\u0240\3\2\2\2\u0240"+ - "\u0241\7\u0085\2\2\u0241\23\3\2\2\2\u0242\u0246\7\u008e\2\2\u0243\u0245"+ - "\5h\65\2\u0244\u0243\3\2\2\2\u0245\u0248\3\2\2\2\u0246\u0244\3\2\2\2\u0246"+ - "\u0247\3\2\2\2\u0247\u0249\3\2\2\2\u0248\u0246\3\2\2\2\u0249\u024a\7\7"+ - "\2\2\u024a\25\3\2\2\2\u024b\u024d\t\2\2\2\u024c\u024b\3\2\2\2\u024c\u024d"+ - "\3\2\2\2\u024d\u024f\3\2\2\2\u024e\u0250\7\23\2\2\u024f\u024e\3\2\2\2"+ - "\u024f\u0250\3\2\2\2\u0250\u0251\3\2\2\2\u0251\u0252\7\13\2\2\u0252\u0257"+ - "\5\36\20\2\u0253\u0258\5\22\n\2\u0254\u0255\5\24\13\2\u0255\u0256\7\u0080"+ - "\2\2\u0256\u0258\3\2\2\2\u0257\u0253\3\2\2\2\u0257\u0254\3\2\2\2\u0258"+ - "\27\3\2\2\2\u0259\u025a\7\13\2\2\u025a\u025c\7\u0086\2\2\u025b\u025d\5"+ - "\u0150\u00a9\2\u025c\u025b\3\2\2\2\u025c\u025d\3\2\2\2\u025d\u025e\3\2"+ - "\2\2\u025e\u0261\7\u0087\2\2\u025f\u0260\7\25\2\2\u0260\u0262\5\u0142"+ - "\u00a2\2\u0261\u025f\3\2\2\2\u0261\u0262\3\2\2\2\u0262\u0263\3\2\2\2\u0263"+ - "\u0264\5\22\n\2\u0264\31\3\2\2\2\u0265\u0266\5\34\17\2\u0266\u0267\7\u00a9"+ - "\2\2\u0267\u0268\5\u012c\u0097\2\u0268\u0278\3\2\2\2\u0269\u0272\7\u0086"+ - "\2\2\u026a\u026f\5\34\17\2\u026b\u026c\7\u0083\2\2\u026c\u026e\5\34\17"+ - "\2\u026d\u026b\3\2\2\2\u026e\u0271\3\2\2\2\u026f\u026d\3\2\2\2\u026f\u0270"+ - "\3\2\2\2\u0270\u0273\3\2\2\2\u0271\u026f\3\2\2\2\u0272\u026a\3\2\2\2\u0272"+ - "\u0273\3\2\2\2\u0273\u0274\3\2\2\2\u0274\u0275\7\u0087\2\2\u0275\u0276"+ - "\7\u00a9\2\2\u0276\u0278\5\u012c\u0097\2\u0277\u0265\3\2\2\2\u0277\u0269"+ - "\3\2\2\2\u0278\33\3\2\2\2\u0279\u027a\7\u00c1\2\2\u027a\35\3\2\2\2\u027b"+ - "\u027c\5\u0182\u00c2\2\u027c\u027e\7\u0086\2\2\u027d\u027f\5\u0150\u00a9"+ - "\2\u027e\u027d\3\2\2\2\u027e\u027f\3\2\2\2\u027f\u0280\3\2\2\2\u0280\u0282"+ - "\7\u0087\2\2\u0281\u0283\5\u0140\u00a1\2\u0282\u0281\3\2\2\2\u0282\u0283"+ - "\3\2\2\2\u0283\37\3\2\2\2\u0284\u0286\7\5\2\2\u0285\u0284\3\2\2\2\u0285"+ - "\u0286\3\2\2\2\u0286\u0287\3\2\2\2\u0287\u0288\7S\2\2\u0288\u0289\7\u00c1"+ - "\2\2\u0289\u028a\5F$\2\u028a\u028b\7\u0080\2\2\u028b!\3\2\2\2\u028c\u0290"+ - "\5&\24\2\u028d\u0290\5\60\31\2\u028e\u0290\5$\23\2\u028f\u028c\3\2\2\2"+ - "\u028f\u028d\3\2\2\2\u028f\u028e\3\2\2\2\u0290\u0293\3\2\2\2\u0291\u028f"+ - "\3\2\2\2\u0291\u0292\3\2\2\2\u0292#\3\2\2\2\u0293\u0291\3\2\2\2\u0294"+ - "\u0295\7\u0091\2\2\u0295\u0296\5V,\2\u0296\u0297\7\u0080\2\2\u0297%\3"+ - "\2\2\2\u0298\u029a\5h\65\2\u0299\u0298\3\2\2\2\u029a\u029d\3\2\2\2\u029b"+ - "\u0299\3\2\2\2\u029b\u029c\3\2\2\2\u029c\u029f\3\2\2\2\u029d\u029b\3\2"+ - "\2\2\u029e\u02a0\t\2\2\2\u029f\u029e\3\2\2\2\u029f\u02a0\3\2\2\2\u02a0"+ - "\u02a1\3\2\2\2\u02a1\u02a2\5J&\2\u02a2\u02a5\7\u00c1\2\2\u02a3\u02a4\7"+ - "\u008e\2\2\u02a4\u02a6\5\u012c\u0097\2\u02a5\u02a3\3\2\2\2\u02a5\u02a6"+ - "\3\2\2\2\u02a6\u02a7\3\2\2\2\u02a7\u02a8\7\u0080\2\2\u02a8\'\3\2\2\2\u02a9"+ - "\u02ab\5h\65\2\u02aa\u02a9\3\2\2\2\u02ab\u02ae\3\2\2\2\u02ac\u02aa\3\2"+ - "\2\2\u02ac\u02ad\3\2\2\2\u02ad\u02af\3\2\2\2\u02ae\u02ac\3\2\2\2\u02af"+ - "\u02b0\5J&\2\u02b0\u02b2\7\u00c1\2\2\u02b1\u02b3\7\u008a\2\2\u02b2\u02b1"+ - "\3\2\2\2\u02b2\u02b3\3\2\2\2\u02b3\u02b6\3\2\2\2\u02b4\u02b5\7\u008e\2"+ - "\2\u02b5\u02b7\5\u012c\u0097\2\u02b6\u02b4\3\2\2\2\u02b6\u02b7\3\2\2\2"+ - "\u02b7\u02b8\3\2\2\2\u02b8\u02b9\7\u0080\2\2\u02b9)\3\2\2\2\u02ba\u02bb"+ - "\5J&\2\u02bb\u02bc\5.\30\2\u02bc\u02bd\7\u00a7\2\2\u02bd\u02be\7\u0080"+ - "\2\2\u02be+\3\2\2\2\u02bf\u02c0\7\u0094\2\2\u02c0\u02c1\5.\30\2\u02c1"+ - "\u02c2\7\u00a7\2\2\u02c2-\3\2\2\2\u02c3\u02c4\6\30\2\2\u02c4/\3\2\2\2"+ - "\u02c5\u02c7\5\u01b6\u00dc\2\u02c6\u02c5\3\2\2\2\u02c6\u02c7\3\2\2\2\u02c7"+ - "\u02cb\3\2\2\2\u02c8\u02ca\5h\65\2\u02c9\u02c8\3\2\2\2\u02ca\u02cd\3\2"+ - "\2\2\u02cb\u02c9\3\2\2\2\u02cb\u02cc\3\2\2\2\u02cc\u02cf\3\2\2\2\u02cd"+ - "\u02cb\3\2\2\2\u02ce\u02d0\t\2\2\2\u02cf\u02ce\3\2\2\2\u02cf\u02d0\3\2"+ - "\2\2\u02d0\u02d2\3\2\2\2\u02d1\u02d3\t\3\2\2\u02d2\u02d1\3\2\2\2\u02d2"+ - "\u02d3\3\2\2\2\u02d3\u02d4\3\2\2\2\u02d4\u02d5\7\13\2\2\u02d5\u02db\5"+ - "\36\20\2\u02d6\u02dc\5\22\n\2\u02d7\u02d9\5\24\13\2\u02d8\u02d7\3\2\2"+ - "\2\u02d8\u02d9\3\2\2\2\u02d9\u02da\3\2\2\2\u02da\u02dc\7\u0080\2\2\u02db"+ - "\u02d6\3\2\2\2\u02db\u02d8\3\2\2\2\u02dc\61\3\2\2\2\u02dd\u02df\7\5\2"+ - "\2\u02de\u02dd\3\2\2\2\u02de\u02df\3\2\2\2\u02df\u02e1\3\2\2\2\u02e0\u02e2"+ - "\7\32\2\2\u02e1\u02e0\3\2\2\2\u02e1\u02e2\3\2\2\2\u02e2\u02e3\3\2\2\2"+ - "\u02e3\u02e5\7\16\2\2\u02e4\u02e6\5J&\2\u02e5\u02e4\3\2\2\2\u02e5\u02e6"+ - "\3\2\2\2\u02e6\u02e7\3\2\2\2\u02e7\u02f1\7\u00c1\2\2\u02e8\u02e9\7\36"+ - "\2\2\u02e9\u02ee\58\35\2\u02ea\u02eb\7\u0083\2\2\u02eb\u02ed\58\35\2\u02ec"+ - "\u02ea\3\2\2\2\u02ed\u02f0\3\2\2\2\u02ee\u02ec\3\2\2\2\u02ee\u02ef\3\2"+ - "\2\2\u02ef\u02f2\3\2\2\2\u02f0\u02ee\3\2\2\2\u02f1\u02e8\3\2\2\2\u02f1"+ - "\u02f2\3\2\2\2\u02f2\u02f3\3\2\2\2\u02f3\u02f4\7\u0080\2\2\u02f4\63\3"+ - "\2\2\2\u02f5\u02f7\7\5\2\2\u02f6\u02f5\3\2\2\2\u02f6\u02f7\3\2\2\2\u02f7"+ - "\u02f8\3\2\2\2\u02f8\u02fa\7\32\2\2\u02f9\u02fb\5J&\2\u02fa\u02f9\3\2"+ - "\2\2\u02fa\u02fb\3\2\2\2\u02fb\u02fc\3\2\2\2\u02fc\u02fd\7\u00c1\2\2\u02fd"+ - "\u02fe\7\u008e\2\2\u02fe\u02ff\5\u012e\u0098\2\u02ff\u0300\7\u0080\2\2"+ - "\u0300\65\3\2\2\2\u0301\u0303\7\5\2\2\u0302\u0301\3\2\2\2\u0302\u0303"+ - "\3\2\2\2\u0303\u0304\3\2\2\2\u0304\u0305\7\22\2\2\u0305\u0306\5J&\2\u0306"+ - "\u0307\7\u00c1\2\2\u0307\u0308\7\u008e\2\2\u0308\u0309\5\u012c\u0097\2"+ - "\u0309\u030a\7\u0080\2\2\u030a\u0318\3\2\2\2\u030b\u030d\7\b\2\2\u030c"+ - "\u030b\3\2\2\2\u030c\u030d\3\2\2\2\u030d\u0310\3\2\2\2\u030e\u0311\5J"+ - "&\2\u030f\u0311\7W\2\2\u0310\u030e\3\2\2\2\u0310\u030f\3\2\2\2\u0311\u0312"+ - "\3\2\2\2\u0312\u0313\7\u00c1\2\2\u0313\u0314\7\u008e\2\2\u0314\u0315\5"+ - "\u012c\u0097\2\u0315\u0316\7\u0080\2\2\u0316\u0318\3\2\2\2\u0317\u0302"+ - "\3\2\2\2\u0317\u030c\3\2\2\2\u0318\67\3\2\2\2\u0319\u031c\5:\36\2\u031a"+ - "\u031c\5> \2\u031b\u0319\3\2\2\2\u031b\u031a\3\2\2\2\u031c9\3\2\2\2\u031d"+ - "\u031f\7\34\2\2\u031e\u031d\3\2\2\2\u031e\u031f\3\2\2\2\u031f\u0320\3"+ - "\2\2\2\u0320\u0321\5<\37\2\u0321;\3\2\2\2\u0322\u0324\7\f\2\2\u0323\u0322"+ - "\3\2\2\2\u0323\u0324\3\2\2\2\u0324\u0325\3\2\2\2\u0325\u032e\7S\2\2\u0326"+ - "\u0328\t\4\2\2\u0327\u0326\3\2\2\2\u0327\u0328\3\2\2\2\u0328\u0329\3\2"+ - "\2\2\u0329\u032e\7\13\2\2\u032a\u032e\7\17\2\2\u032b\u032e\7k\2\2\u032c"+ - "\u032e\7\t\2\2\u032d\u0323\3\2\2\2\u032d\u0327\3\2\2\2\u032d\u032a\3\2"+ - "\2\2\u032d\u032b\3\2\2\2\u032d\u032c\3\2\2\2\u032e=\3\2\2\2\u032f\u0330"+ - "\7\34\2\2\u0330\u0331\5@!\2\u0331?\3\2\2\2\u0332\u0333\t\5\2\2\u0333A"+ - "\3\2\2\2\u0334\u0336\5h\65\2\u0335\u0334\3\2\2\2\u0336\u0339\3\2\2\2\u0337"+ - "\u0335\3\2\2\2\u0337\u0338\3\2\2\2\u0338\u033a\3\2\2\2\u0339\u0337\3\2"+ - "\2\2\u033a\u033b\5D#\2\u033b\u033f\7\u0084\2\2\u033c\u033e\5j\66\2\u033d"+ - "\u033c\3\2\2\2\u033e\u0341\3\2\2\2\u033f\u033d\3\2\2\2\u033f\u0340\3\2"+ - "\2\2\u0340\u0342\3\2\2\2\u0341\u033f\3\2\2\2\u0342\u0343\7\u0085\2\2\u0343"+ - "C\3\2\2\2\u0344\u0345\7\21\2\2\u0345\u0347\7\u00c1\2\2\u0346\u0348\5\u0140"+ - "\u00a1\2\u0347\u0346\3\2\2\2\u0347\u0348\3\2\2\2\u0348E\3\2\2\2\u0349"+ - "\u034e\5H%\2\u034a\u034b\7\u00a8\2\2\u034b\u034d\5H%\2\u034c\u034a\3\2"+ - "\2\2\u034d\u0350\3\2\2\2\u034e\u034c\3\2\2\2\u034e\u034f\3\2\2\2\u034f"+ - "G\3\2\2\2\u0350\u034e\3\2\2\2\u0351\u0354\5\u0152\u00aa\2\u0352\u0354"+ - "\5J&\2\u0353\u0351\3\2\2\2\u0353\u0352\3\2\2\2\u0354I\3\2\2\2\u0355\u0356"+ - "\b&\1\2\u0356\u0370\5V,\2\u0357\u0358\7\u0086\2\2\u0358\u0359\5J&\2\u0359"+ - "\u035a\7\u0087\2\2\u035a\u0370\3\2\2\2\u035b\u0370\5N(\2\u035c\u035e\7"+ - "\30\2\2\u035d\u035c\3\2\2\2\u035d\u035e\3\2\2\2\u035e\u0360\3\2\2\2\u035f"+ - "\u0361\7\31\2\2\u0360\u035f\3\2\2\2\u0360\u0361\3\2\2\2\u0361\u0367\3"+ - "\2\2\2\u0362\u0364\7\31\2\2\u0363\u0362\3\2\2\2\u0363\u0364\3\2\2\2\u0364"+ - "\u0365\3\2\2\2\u0365\u0367\7\30\2\2\u0366\u035d\3\2\2\2\u0366\u0363\3"+ - "\2\2\2\u0367\u0368\3\2\2\2\u0368\u0369\7\f\2\2\u0369\u036a\7\u0084\2\2"+ - "\u036a\u036b\5\"\22\2\u036b\u036c\7\u0085\2\2\u036c\u0370\3\2\2\2\u036d"+ - "\u0370\5L\'\2\u036e\u0370\5R*\2\u036f\u0355\3\2\2\2\u036f\u0357\3\2\2"+ - "\2\u036f\u035b\3\2\2\2\u036f\u0366\3\2\2\2\u036f\u036d\3\2\2\2\u036f\u036e"+ - "\3\2\2\2\u0370\u0387\3\2\2\2\u0371\u0378\f\n\2\2\u0372\u0375\7\u0088\2"+ - "\2\u0373\u0376\5\u0156\u00ac\2\u0374\u0376\7\u0091\2\2\u0375\u0373\3\2"+ - "\2\2\u0375\u0374\3\2\2\2\u0375\u0376\3\2\2\2\u0376\u0377\3\2\2\2\u0377"+ - "\u0379\7\u0089\2\2\u0378\u0372\3\2\2\2\u0379\u037a\3\2\2\2\u037a\u0378"+ - "\3\2\2\2\u037a\u037b\3\2\2\2\u037b\u0386\3\2\2\2\u037c\u037f\f\t\2\2\u037d"+ - "\u037e\7\u00a8\2\2\u037e\u0380\5J&\2\u037f\u037d\3\2\2\2\u0380\u0381\3"+ - "\2\2\2\u0381\u037f\3\2\2\2\u0381\u0382\3\2\2\2\u0382\u0386\3\2\2\2\u0383"+ - "\u0384\f\b\2\2\u0384\u0386\7\u008a\2\2\u0385\u0371\3\2\2\2\u0385\u037c"+ - "\3\2\2\2\u0385\u0383\3\2\2\2\u0386\u0389\3\2\2\2\u0387\u0385\3\2\2\2\u0387"+ - "\u0388\3\2\2\2\u0388K\3\2\2\2\u0389\u0387\3\2\2\2\u038a\u038b\7\r\2\2"+ - "\u038b\u038f\7\u0084\2\2\u038c\u038e\5T+\2\u038d\u038c\3\2\2\2\u038e\u0391"+ - "\3\2\2\2\u038f\u038d\3\2\2\2\u038f\u0390\3\2\2\2\u0390\u0392\3\2\2\2\u0391"+ - "\u038f\3\2\2\2\u0392\u0393\7\u0085\2\2\u0393M\3\2\2\2\u0394\u03a2\7\u0088"+ - "\2\2\u0395\u039a\5J&\2\u0396\u0397\7\u0083\2\2\u0397\u0399\5J&\2\u0398"+ - "\u0396\3\2\2\2\u0399\u039c\3\2\2\2\u039a\u0398\3\2\2\2\u039a\u039b\3\2"+ - "\2\2\u039b\u039f\3\2\2\2\u039c\u039a\3\2\2\2\u039d\u039e\7\u0083\2\2\u039e"+ - "\u03a0\5P)\2\u039f\u039d\3\2\2\2\u039f\u03a0\3\2\2\2\u03a0\u03a3\3\2\2"+ - "\2\u03a1\u03a3\5P)\2\u03a2\u0395\3\2\2\2\u03a2\u03a1\3\2\2\2\u03a3\u03a4"+ - "\3\2\2\2\u03a4\u03a5\7\u0089\2\2\u03a5O\3\2\2\2\u03a6\u03a7\5J&\2\u03a7"+ - "\u03a8\7\u00a7\2\2\u03a8Q\3\2\2\2\u03a9\u03aa\7\r\2\2\u03aa\u03ae\7\u008c"+ - "\2\2\u03ab\u03ad\5T+\2\u03ac\u03ab\3\2\2\2\u03ad\u03b0\3\2\2\2\u03ae\u03ac"+ - "\3\2\2\2\u03ae\u03af\3\2\2\2\u03af\u03b2\3\2\2\2\u03b0\u03ae\3\2\2\2\u03b1"+ - "\u03b3\5*\26\2\u03b2\u03b1\3\2\2\2\u03b2\u03b3\3\2\2\2\u03b3\u03b4\3\2"+ - "\2\2\u03b4\u03b5\7\u008d\2\2\u03b5S\3\2\2\2\u03b6\u03b9\5(\25\2\u03b7"+ - "\u03b9\5$\23\2\u03b8\u03b6\3\2\2\2\u03b8\u03b7\3\2\2\2\u03b9U\3\2\2\2"+ - "\u03ba\u03c1\7Q\2\2\u03bb\u03c1\7U\2\2\u03bc\u03c1\7V\2\2\u03bd\u03c1"+ - "\5\\/\2\u03be\u03c1\5X-\2\u03bf\u03c1\5\u0158\u00ad\2\u03c0\u03ba\3\2"+ - "\2\2\u03c0\u03bb\3\2\2\2\u03c0\u03bc\3\2\2\2\u03c0\u03bd\3\2\2\2\u03c0"+ - "\u03be\3\2\2\2\u03c0\u03bf\3\2\2\2\u03c1W\3\2\2\2\u03c2\u03c5\5^\60\2"+ - "\u03c3\u03c5\5Z.\2\u03c4\u03c2\3\2\2\2\u03c4\u03c3\3\2\2\2\u03c5Y\3\2"+ - "\2\2\u03c6\u03c7\5\u013c\u009f\2\u03c7[\3\2\2\2\u03c8\u03c9\t\6\2\2\u03c9"+ - "]\3\2\2\2\u03ca\u03cb\7L\2\2\u03cb\u03cc\7\u0098\2\2\u03cc\u03cd\5J&\2"+ - "\u03cd\u03ce\7\u0097\2\2\u03ce\u03e9\3\2\2\2\u03cf\u03d0\7T\2\2\u03d0"+ - "\u03d1\7\u0098\2\2\u03d1\u03d2\5J&\2\u03d2\u03d3\7\u0097\2\2\u03d3\u03e9"+ - "\3\2\2\2\u03d4\u03e9\7N\2\2\u03d5\u03e9\7M\2\2\u03d6\u03d7\7O\2\2\u03d7"+ - "\u03d8\7\u0098\2\2\u03d8\u03d9\5J&\2\u03d9\u03da\7\u0097\2\2\u03da\u03e9"+ - "\3\2\2\2\u03db\u03dc\7P\2\2\u03dc\u03dd\7\u0098\2\2\u03dd\u03de\5J&\2"+ - "\u03de\u03df\7\u0097\2\2\u03df\u03e9\3\2\2\2\u03e0\u03e1\7R\2\2\u03e1"+ - "\u03e2\7\u0098\2\2\u03e2\u03e3\5J&\2\u03e3\u03e4\7\u0097\2\2\u03e4\u03e9"+ - "\3\2\2\2\u03e5\u03e9\7\t\2\2\u03e6\u03e9\5b\62\2\u03e7\u03e9\5`\61\2\u03e8"+ - "\u03ca\3\2\2\2\u03e8\u03cf\3\2\2\2\u03e8\u03d4\3\2\2\2\u03e8\u03d5\3\2"+ - "\2\2\u03e8\u03d6\3\2\2\2\u03e8\u03db\3\2\2\2\u03e8\u03e0\3\2\2\2\u03e8"+ - "\u03e5\3\2\2\2\u03e8\u03e6\3\2\2\2\u03e8\u03e7\3\2\2\2\u03e9_\3\2\2\2"+ - "\u03ea\u03eb\7\13\2\2\u03eb\u03ee\7\u0086\2\2\u03ec\u03ef\5\u0148\u00a5"+ - "\2\u03ed\u03ef\5\u0144\u00a3\2\u03ee\u03ec\3\2\2\2\u03ee\u03ed\3\2\2\2"+ - "\u03ee\u03ef\3\2\2\2\u03ef\u03f0\3\2\2\2\u03f0\u03f2\7\u0087\2\2\u03f1"+ - "\u03f3\5\u0140\u00a1\2\u03f2\u03f1\3\2\2\2\u03f2\u03f3\3\2\2\2\u03f3a"+ - "\3\2\2\2\u03f4\u03fd\7K\2\2\u03f5\u03f6\7\u0098\2\2\u03f6\u03f9\5J&\2"+ - "\u03f7\u03f8\7\u0083\2\2\u03f8\u03fa\5J&\2\u03f9\u03f7\3\2\2\2\u03f9\u03fa"+ - "\3\2\2\2\u03fa\u03fb\3\2\2\2\u03fb\u03fc\7\u0097\2\2\u03fc\u03fe\3\2\2"+ - "\2\u03fd\u03f5\3\2\2\2\u03fd\u03fe\3\2\2\2\u03fec\3\2\2\2\u03ff\u0400"+ - "\7\u00bd\2\2\u0400e\3\2\2\2\u0401\u0402\7\u00c1\2\2\u0402g\3\2\2\2\u0403"+ - "\u0404\7\u00a4\2\2\u0404\u0406\5\u013c\u009f\2\u0405\u0407\5n8\2\u0406"+ - "\u0405\3\2\2\2\u0406\u0407\3\2\2\2\u0407i\3\2\2\2\u0408\u0423\5\u008a"+ - "F\2\u0409\u0423\5\u0084C\2\u040a\u0423\5l\67\2\u040b\u0423\5\u0086D\2"+ - "\u040c\u0423\5\u0088E\2\u040d\u0423\5\u008cG\2\u040e\u0423\5\u0092J\2"+ - "\u040f\u0423\5\u009aN\2\u0410\u0423\5\u00d4k\2\u0411\u0423\5\u00d8m\2"+ - "\u0412\u0423\5\u00dan\2\u0413\u0423\5\u00dco\2\u0414\u0423\5\u00dep\2"+ - "\u0415\u0423\5\u00e0q\2\u0416\u0423\5\u00e8u\2\u0417\u0423\5\u00eav\2"+ - "\u0418\u0423\5\u00ecw\2\u0419\u0423\5\u00eex\2\u041a\u0423\5\u010e\u0088"+ - "\2\u041b\u0423\5\u0110\u0089\2\u041c\u0423\5\u0122\u0092\2\u041d\u0423"+ - "\5\u0124\u0093\2\u041e\u0423\5\u011a\u008e\2\u041f\u0423\5\u0128\u0095"+ - "\2\u0420\u0423\5\u0188\u00c5\2\u0421\u0423\5\u018a\u00c6\2\u0422\u0408"+ - "\3\2\2\2\u0422\u0409\3\2\2\2\u0422\u040a\3\2\2\2\u0422\u040b\3\2\2\2\u0422"+ - "\u040c\3\2\2\2\u0422\u040d\3\2\2\2\u0422\u040e\3\2\2\2\u0422\u040f\3\2"+ - "\2\2\u0422\u0410\3\2\2\2\u0422\u0411\3\2\2\2\u0422\u0412\3\2\2\2\u0422"+ - "\u0413\3\2\2\2\u0422\u0414\3\2\2\2\u0422\u0415\3\2\2\2\u0422\u0416\3\2"+ - "\2\2\u0422\u0417\3\2\2\2\u0422\u0418\3\2\2\2\u0422\u0419\3\2\2\2\u0422"+ - "\u041a\3\2\2\2\u0422\u041b\3\2\2\2\u0422\u041c\3\2\2\2\u0422\u041d\3\2"+ - "\2\2\u0422\u041e\3\2\2\2\u0422\u041f\3\2\2\2\u0422\u0420\3\2\2\2\u0422"+ - "\u0421\3\2\2\2\u0423k\3\2\2\2\u0424\u0425\5J&\2\u0425\u0426\7\u00c1\2"+ - "\2\u0426\u0427\7\u0080\2\2\u0427\u0435\3\2\2\2\u0428\u042a\7\b\2\2\u0429"+ - "\u0428\3\2\2\2\u0429\u042a\3\2\2\2\u042a\u042d\3\2\2\2\u042b\u042e\5J"+ - "&\2\u042c\u042e\7W\2\2\u042d\u042b\3\2\2\2\u042d\u042c\3\2\2\2\u042e\u042f"+ - "\3\2\2\2\u042f\u0430\5\u009eP\2\u0430\u0431\7\u008e\2\2\u0431\u0432\5"+ - "\u012c\u0097\2\u0432\u0433\7\u0080\2\2\u0433\u0435\3\2\2\2\u0434\u0424"+ - "\3\2\2\2\u0434\u0429\3\2\2\2\u0435m\3\2\2\2\u0436\u043f\7\u0084\2\2\u0437"+ - "\u043c\5r:\2\u0438\u0439\7\u0083\2\2\u0439\u043b\5r:\2\u043a\u0438\3\2"+ - "\2\2\u043b\u043e\3\2\2\2\u043c\u043a\3\2\2\2\u043c\u043d\3\2\2\2\u043d"+ - "\u0440\3\2\2\2\u043e\u043c\3\2\2\2\u043f\u0437\3\2\2\2\u043f\u0440\3\2"+ - "\2\2\u0440\u0441\3\2\2\2\u0441\u0442\7\u0085\2\2\u0442o\3\2\2\2\u0443"+ - "\u0444\b9\1\2\u0444\u0449\5\u0152\u00aa\2\u0445\u0449\5n8\2\u0446\u0449"+ - "\5\u0082B\2\u0447\u0449\7\u00c1\2\2\u0448\u0443\3\2\2\2\u0448\u0445\3"+ - "\2\2\2\u0448\u0446\3\2\2\2\u0448\u0447\3\2\2\2\u0449\u044f\3\2\2\2\u044a"+ - "\u044b\f\3\2\2\u044b\u044c\7\u00a8\2\2\u044c\u044e\5p9\4\u044d\u044a\3"+ - "\2\2\2\u044e\u0451\3\2\2\2\u044f\u044d\3\2\2\2\u044f\u0450\3\2\2\2\u0450"+ - "q\3\2\2\2\u0451\u044f\3\2\2\2\u0452\u0453\5t;\2\u0453\u0454\7\u0081\2"+ - "\2\u0454\u0455\5\u012c\u0097\2\u0455s\3\2\2\2\u0456\u045d\7\u00c1\2\2"+ - "\u0457\u0458\7\u0088\2\2\u0458\u0459\5\u012c\u0097\2\u0459\u045a\7\u0089"+ - "\2\2\u045a\u045d\3\2\2\2\u045b\u045d\5\u012c\u0097\2\u045c\u0456\3\2\2"+ - "\2\u045c\u0457\3\2\2\2\u045c\u045b\3\2\2\2\u045du\3\2\2\2\u045e\u045f"+ - "\7O\2\2\u045f\u0461\7\u0084\2\2\u0460\u0462\5x=\2\u0461\u0460\3\2\2\2"+ - "\u0461\u0462\3\2\2\2\u0462\u0465\3\2\2\2\u0463\u0464\7\u0083\2\2\u0464"+ - "\u0466\5|?\2\u0465\u0463\3\2\2\2\u0465\u0466\3\2\2\2\u0466\u0467\3\2\2"+ - "\2\u0467\u0468\7\u0085\2\2\u0468w\3\2\2\2\u0469\u0472\7\u0084\2\2\u046a"+ - "\u046f\5z>\2\u046b\u046c\7\u0083\2\2\u046c\u046e\5z>\2\u046d\u046b\3\2"+ - "\2\2\u046e\u0471\3\2\2\2\u046f\u046d\3\2\2\2\u046f\u0470\3\2\2\2\u0470"+ - "\u0473\3\2\2\2\u0471\u046f\3\2\2\2\u0472\u046a\3\2\2\2\u0472\u0473\3\2"+ - "\2\2\u0473\u0474\3\2\2\2\u0474\u0475\7\u0085\2\2\u0475y\3\2\2\2\u0476"+ - "\u0478\7\u00c1\2\2\u0477\u0476\3\2\2\2\u0477\u0478\3\2\2\2\u0478\u0479"+ - "\3\2\2\2\u0479\u047a\7\u00c1\2\2\u047a{\3\2\2\2\u047b\u047d\7\u0088\2"+ - "\2\u047c\u047e\5~@\2\u047d\u047c\3\2\2\2\u047d\u047e\3\2\2\2\u047e\u047f"+ - "\3\2\2\2\u047f\u0480\7\u0089\2\2\u0480}\3\2\2\2\u0481\u0486\5\u0080A\2"+ - "\u0482\u0483\7\u0083\2\2\u0483\u0485\5\u0080A\2\u0484\u0482\3\2\2\2\u0485"+ - "\u0488\3\2\2\2\u0486\u0484\3\2\2\2\u0486\u0487\3\2\2\2\u0487\u048b\3\2"+ - "\2\2\u0488\u0486\3\2\2\2\u0489\u048b\5\u010c\u0087\2\u048a\u0481\3\2\2"+ - "\2\u048a\u0489\3\2\2\2\u048b\177\3\2\2\2\u048c\u048d\7\u0084\2\2\u048d"+ - "\u048e\5\u010c\u0087\2\u048e\u048f\7\u0085\2\2\u048f\u0081\3\2\2\2\u0490"+ - "\u0492\7\u0088\2\2\u0491\u0493\5\u010c\u0087\2\u0492\u0491\3\2\2\2\u0492"+ - "\u0493\3\2\2\2\u0493\u0494\3\2\2\2\u0494\u0495\7\u0089\2\2\u0495\u0083"+ - "\3\2\2\2\u0496\u0497\5\u00fa~\2\u0497\u0498\7\u008e\2\2\u0498\u0499\5"+ - "\u012c\u0097\2\u0499\u049a\7\u0080\2\2\u049a\u0085\3\2\2\2\u049b\u049c"+ - "\5\u00c2b\2\u049c\u049d\7\u008e\2\2\u049d\u049e\5\u012c\u0097\2\u049e"+ - "\u049f\7\u0080\2\2\u049f\u0087\3\2\2\2\u04a0\u04a1\5\u00c6d\2\u04a1\u04a2"+ - "\7\u008e\2\2\u04a2\u04a3\5\u012c\u0097\2\u04a3\u04a4\7\u0080\2\2\u04a4"+ - "\u0089\3\2\2\2\u04a5\u04a6\5\u00c8e\2\u04a6\u04a7\7\u008e\2\2\u04a7\u04a8"+ - "\5\u012c\u0097\2\u04a8\u04a9\7\u0080\2\2\u04a9\u008b\3\2\2\2\u04aa\u04ab"+ - "\5\u00fa~\2\u04ab\u04ac\5\u008eH\2\u04ac\u04ad\5\u012c\u0097\2\u04ad\u04ae"+ - "\7\u0080\2\2\u04ae\u008d\3\2\2\2\u04af\u04b0\t\7\2\2\u04b0\u008f\3\2\2"+ - "\2\u04b1\u04b6\5\u00fa~\2\u04b2\u04b3\7\u0083\2\2\u04b3\u04b5\5\u00fa"+ - "~\2\u04b4\u04b2\3\2\2\2\u04b5\u04b8\3\2\2\2\u04b6\u04b4\3\2\2\2\u04b6"+ - "\u04b7\3\2\2\2\u04b7\u0091\3\2\2\2\u04b8\u04b6\3\2\2\2\u04b9\u04bd\5\u0094"+ - "K\2\u04ba\u04bc\5\u0096L\2\u04bb\u04ba\3\2\2\2\u04bc\u04bf\3\2\2\2\u04bd"+ - "\u04bb\3\2\2\2\u04bd\u04be\3\2\2\2\u04be\u04c1\3\2\2\2\u04bf\u04bd\3\2"+ - "\2\2\u04c0\u04c2\5\u0098M\2\u04c1\u04c0\3\2\2\2\u04c1\u04c2\3\2\2\2\u04c2"+ - "\u0093\3\2\2\2\u04c3\u04c4\7Z\2\2\u04c4\u04c5\5\u012c\u0097\2\u04c5\u04c9"+ - "\7\u0084\2\2\u04c6\u04c8\5j\66\2\u04c7\u04c6\3\2\2\2\u04c8\u04cb\3\2\2"+ - "\2\u04c9\u04c7\3\2\2\2\u04c9\u04ca\3\2\2\2\u04ca\u04cc\3\2\2\2\u04cb\u04c9"+ - "\3\2\2\2\u04cc\u04cd\7\u0085\2\2\u04cd\u0095\3\2\2\2\u04ce\u04cf\7\\\2"+ - "\2\u04cf\u04d0\7Z\2\2\u04d0\u04d1\5\u012c\u0097\2\u04d1\u04d5\7\u0084"+ - "\2\2\u04d2\u04d4\5j\66\2\u04d3\u04d2\3\2\2\2\u04d4\u04d7\3\2\2\2\u04d5"+ - "\u04d3\3\2\2\2\u04d5\u04d6\3\2\2\2\u04d6\u04d8\3\2\2\2\u04d7\u04d5\3\2"+ - "\2\2\u04d8\u04d9\7\u0085\2\2\u04d9\u0097\3\2\2\2\u04da\u04db\7\\\2\2\u04db"+ - "\u04df\7\u0084\2\2\u04dc\u04de\5j\66\2\u04dd\u04dc\3\2\2\2\u04de\u04e1"+ - "\3\2\2\2\u04df\u04dd\3\2\2\2\u04df\u04e0\3\2\2\2\u04e0\u04e2\3\2\2\2\u04e1"+ - "\u04df\3\2\2\2\u04e2\u04e3\7\u0085\2\2\u04e3\u0099\3\2\2\2\u04e4\u04e5"+ - "\7[\2\2\u04e5\u04e6\5\u012c\u0097\2\u04e6\u04e8\7\u0084\2\2\u04e7\u04e9"+ - "\5\u009cO\2\u04e8\u04e7\3\2\2\2\u04e9\u04ea\3\2\2\2\u04ea\u04e8\3\2\2"+ - "\2\u04ea\u04eb\3\2\2\2\u04eb\u04ec\3\2\2\2\u04ec\u04ed\7\u0085\2\2\u04ed"+ - "\u009b\3\2\2\2\u04ee\u04ef\5p9\2\u04ef\u04f0\7\u00a9\2\2\u04f0\u04f4\7"+ - "\u0084\2\2\u04f1\u04f3\5j\66\2\u04f2\u04f1\3\2\2\2\u04f3\u04f6\3\2\2\2"+ - "\u04f4\u04f2\3\2\2\2\u04f4\u04f5\3\2\2\2\u04f5\u04f7\3\2\2\2\u04f6\u04f4"+ - "\3\2\2\2\u04f7\u04f8\7\u0085\2\2\u04f8\u0519\3\2\2\2\u04f9\u04fa\7W\2"+ - "\2\u04fa\u04fd\5\u009eP\2\u04fb\u04fc\7Z\2\2\u04fc\u04fe\5\u012c\u0097"+ - "\2\u04fd\u04fb\3\2\2\2\u04fd\u04fe\3\2\2\2\u04fe\u04ff\3\2\2\2\u04ff\u0500"+ - "\7\u00a9\2\2\u0500\u0504\7\u0084\2\2\u0501\u0503\5j\66\2\u0502\u0501\3"+ - "\2\2\2\u0503\u0506\3\2\2\2\u0504\u0502\3\2\2\2\u0504\u0505\3\2\2\2\u0505"+ - "\u0507\3\2\2\2\u0506\u0504\3\2\2\2\u0507\u0508\7\u0085\2\2\u0508\u0519"+ - "\3\2\2\2\u0509\u050c\5\u00a6T\2\u050a\u050b\7Z\2\2\u050b\u050d\5\u012c"+ - "\u0097\2\u050c\u050a\3\2\2\2\u050c\u050d\3\2\2\2\u050d\u050e\3\2\2\2\u050e"+ - "\u050f\7\u00a9\2\2\u050f\u0513\7\u0084\2\2\u0510\u0512\5j\66\2\u0511\u0510"+ - "\3\2\2\2\u0512\u0515\3\2\2\2\u0513\u0511\3\2\2\2\u0513\u0514\3\2\2\2\u0514"+ - "\u0516\3\2\2\2\u0515\u0513\3\2\2\2\u0516\u0517\7\u0085\2\2\u0517\u0519"+ - "\3\2\2\2\u0518\u04ee\3\2\2\2\u0518\u04f9\3\2\2\2\u0518\u0509\3\2\2\2\u0519"+ - "\u009d\3\2\2\2\u051a\u051d\7\u00c1\2\2\u051b\u051d\5\u00a0Q\2\u051c\u051a"+ - "\3\2\2\2\u051c\u051b\3\2\2\2\u051d\u009f\3\2\2\2\u051e\u0522\5\u00b4["+ - "\2\u051f\u0522\5\u00b6\\\2\u0520\u0522\5\u00a2R\2\u0521\u051e\3\2\2\2"+ - "\u0521\u051f\3\2\2\2\u0521\u0520\3\2\2\2\u0522\u00a1\3\2\2\2\u0523\u0524"+ - "\7K\2\2\u0524\u0525\7\u0086\2\2\u0525\u052a\7\u00c1\2\2\u0526\u0527\7"+ - "\u0083\2\2\u0527\u0529\5\u00b2Z\2\u0528\u0526\3\2\2\2\u0529\u052c\3\2"+ - "\2\2\u052a\u0528\3\2\2\2\u052a\u052b\3\2\2\2\u052b\u052f\3\2\2\2\u052c"+ - "\u052a\3\2\2\2\u052d\u052e\7\u0083\2\2\u052e\u0530\5\u00acW\2\u052f\u052d"+ - "\3\2\2\2\u052f\u0530\3\2\2\2\u0530\u0531\3\2\2\2\u0531\u0538\7\u0087\2"+ - "\2\u0532\u0533\5J&\2\u0533\u0534\7\u0086\2\2\u0534\u0535\5\u00a4S\2\u0535"+ - "\u0536\7\u0087\2\2\u0536\u0538\3\2\2\2\u0537\u0523\3\2\2\2\u0537\u0532"+ - "\3\2\2\2\u0538\u00a3\3\2\2\2\u0539\u053e\5\u00b2Z\2\u053a\u053b\7\u0083"+ - "\2\2\u053b\u053d\5\u00b2Z\2\u053c\u053a\3\2\2\2\u053d\u0540\3\2\2\2\u053e"+ - "\u053c\3\2\2\2\u053e\u053f\3\2\2\2\u053f\u0543\3\2\2\2\u0540\u053e\3\2"+ - "\2\2\u0541\u0542\7\u0083\2\2\u0542\u0544\5\u00acW\2\u0543\u0541\3\2\2"+ - "\2\u0543\u0544\3\2\2\2\u0544\u0547\3\2\2\2\u0545\u0547\5\u00acW\2\u0546"+ - "\u0539\3\2\2\2\u0546\u0545\3\2\2\2\u0547\u00a5\3\2\2\2\u0548\u0549\7K"+ - "\2\2\u0549\u054a\7\u0086\2\2\u054a\u054b\5\u00a8U\2\u054b\u054c\7\u0087"+ - "\2\2\u054c\u0553\3\2\2\2\u054d\u054e\5J&\2\u054e\u054f\7\u0086\2\2\u054f"+ - "\u0550\5\u00aaV\2\u0550\u0551\7\u0087\2\2\u0551\u0553\3\2\2\2\u0552\u0548"+ - "\3\2\2\2\u0552\u054d\3\2\2\2\u0553\u00a7\3\2\2\2\u0554\u0559\5\u00b0Y"+ - "\2\u0555\u0556\7\u0083\2\2\u0556\u0558\5\u00b2Z\2\u0557\u0555\3\2\2\2"+ - "\u0558\u055b\3\2\2\2\u0559\u0557\3\2\2\2\u0559\u055a\3\2\2\2\u055a\u055e"+ - "\3\2\2\2\u055b\u0559\3\2\2\2\u055c\u055d\7\u0083\2\2\u055d\u055f\5\u00ae"+ - "X\2\u055e\u055c\3\2\2\2\u055e\u055f\3\2\2\2\u055f\u056e\3\2\2\2\u0560"+ - "\u0565\5\u00b2Z\2\u0561\u0562\7\u0083\2\2\u0562\u0564\5\u00b2Z\2\u0563"+ - "\u0561\3\2\2\2\u0564\u0567\3\2\2\2\u0565\u0563\3\2\2\2\u0565\u0566\3\2"+ - "\2\2\u0566\u056a\3\2\2\2\u0567\u0565\3\2\2\2\u0568\u0569\7\u0083\2\2\u0569"+ - "\u056b\5\u00aeX\2\u056a\u0568\3\2\2\2\u056a\u056b\3\2\2\2\u056b\u056e"+ - "\3\2\2\2\u056c\u056e\5\u00aeX\2\u056d\u0554\3\2\2\2\u056d\u0560\3\2\2"+ - "\2\u056d\u056c\3\2\2\2\u056e\u00a9\3\2\2\2\u056f\u0574\5\u00b2Z\2\u0570"+ - "\u0571\7\u0083\2\2\u0571\u0573\5\u00b2Z\2\u0572\u0570\3\2\2\2\u0573\u0576"+ - "\3\2\2\2\u0574\u0572\3\2\2\2\u0574\u0575\3\2\2\2\u0575\u0579\3\2\2\2\u0576"+ - "\u0574\3\2\2\2\u0577\u0578\7\u0083\2\2\u0578\u057a\5\u00aeX\2\u0579\u0577"+ - "\3\2\2\2\u0579\u057a\3\2\2\2\u057a\u057d\3\2\2\2\u057b\u057d\5\u00aeX"+ - "\2\u057c\u056f\3\2\2\2\u057c\u057b\3\2\2\2\u057d\u00ab\3\2\2\2\u057e\u057f"+ - "\7\u00a7\2\2\u057f\u0580\7\u00c1\2\2\u0580\u00ad\3\2\2\2\u0581\u0582\7"+ - "\u00a7\2\2\u0582\u0583\7W\2\2\u0583\u0584\7\u00c1\2\2\u0584\u00af\3\2"+ - "\2\2\u0585\u0587\7W\2\2\u0586\u0585\3\2\2\2\u0586\u0587\3\2\2\2\u0587"+ - "\u0588\3\2\2\2\u0588\u0589\t\b\2\2\u0589\u00b1\3\2\2\2\u058a\u058b\7\u00c1"+ - "\2\2\u058b\u058c\7\u008e\2\2\u058c\u058d\5\u009eP\2\u058d\u00b3\3\2\2"+ - "\2\u058e\u059e\7\u0088\2\2\u058f\u0594\5\u009eP\2\u0590\u0591\7\u0083"+ - "\2\2\u0591\u0593\5\u009eP\2\u0592\u0590\3\2\2\2\u0593\u0596\3\2\2\2\u0594"+ - "\u0592\3\2\2\2\u0594\u0595\3\2\2\2\u0595\u0599\3\2\2\2\u0596\u0594\3\2"+ - "\2\2\u0597\u0598\7\u0083\2\2\u0598\u059a\5\u00bc_\2\u0599\u0597\3\2\2"+ - "\2\u0599\u059a\3\2\2\2\u059a\u059f\3\2\2\2\u059b\u059d\5\u00bc_\2\u059c"+ - "\u059b\3\2\2\2\u059c\u059d\3\2\2\2\u059d\u059f\3\2\2\2\u059e\u058f\3\2"+ - "\2\2\u059e\u059c\3\2\2\2\u059f\u05a0\3\2\2\2\u05a0\u05a1\7\u0089\2\2\u05a1"+ - "\u00b5\3\2\2\2\u05a2\u05a3\7\u0084\2\2\u05a3\u05a4\5\u00b8]\2\u05a4\u05a5"+ - "\7\u0085\2\2\u05a5\u00b7\3\2\2\2\u05a6\u05ab\5\u00ba^\2\u05a7\u05a8\7"+ - "\u0083\2\2\u05a8\u05aa\5\u00ba^\2\u05a9\u05a7\3\2\2\2\u05aa\u05ad\3\2"+ - "\2\2\u05ab\u05a9\3\2\2\2\u05ab\u05ac\3\2\2\2\u05ac\u05b0\3\2\2\2\u05ad"+ - "\u05ab\3\2\2\2\u05ae\u05af\7\u0083\2\2\u05af\u05b1\5\u00bc_\2\u05b0\u05ae"+ - "\3\2\2\2\u05b0\u05b1\3\2\2\2\u05b1\u05b6\3\2\2\2\u05b2\u05b4\5\u00bc_"+ - "\2\u05b3\u05b2\3\2\2\2\u05b3\u05b4\3\2\2\2\u05b4\u05b6\3\2\2\2\u05b5\u05a6"+ - "\3\2\2\2\u05b5\u05b3\3\2\2\2\u05b6\u00b9\3\2\2\2\u05b7\u05ba\7\u00c1\2"+ - "\2\u05b8\u05b9\7\u0081\2\2\u05b9\u05bb\5\u009eP\2\u05ba\u05b8\3\2\2\2"+ - "\u05ba\u05bb\3\2\2\2\u05bb\u00bb\3\2\2\2\u05bc\u05bd\7\u00a7\2\2\u05bd"+ - "\u05be\7\u00c1\2\2\u05be\u00bd\3\2\2\2\u05bf\u05c3\5\u00c8e\2\u05c0\u05c3"+ - "\5\u00fa~\2\u05c1\u05c3\5\u00c0a\2\u05c2\u05bf\3\2\2\2\u05c2\u05c0\3\2"+ - "\2\2\u05c2\u05c1\3\2\2\2\u05c3\u00bf\3\2\2\2\u05c4\u05c7\5\u00c2b\2\u05c5"+ - "\u05c7\5\u00c6d\2\u05c6\u05c4\3\2\2\2\u05c6\u05c5\3\2\2\2\u05c7\u00c1"+ - "\3\2\2\2\u05c8\u05d6\7\u0088\2\2\u05c9\u05ce\5\u00be`\2\u05ca\u05cb\7"+ - "\u0083\2\2\u05cb\u05cd\5\u00be`\2\u05cc\u05ca\3\2\2\2\u05cd\u05d0\3\2"+ - "\2\2\u05ce\u05cc\3\2\2\2\u05ce\u05cf\3\2\2\2\u05cf\u05d3\3\2\2\2\u05d0"+ - "\u05ce\3\2\2\2\u05d1\u05d2\7\u0083\2\2\u05d2\u05d4\5\u00c4c\2\u05d3\u05d1"+ - "\3\2\2\2\u05d3\u05d4\3\2\2\2\u05d4\u05d7\3\2\2\2\u05d5\u05d7\5\u00c4c"+ - "\2\u05d6\u05c9\3\2\2\2\u05d6\u05d5\3\2\2\2\u05d7\u05d8\3\2\2\2\u05d8\u05d9"+ - "\7\u0089\2\2\u05d9\u00c3\3\2\2\2\u05da\u05db\7\u00a7\2\2\u05db\u05dc\5"+ - "\u00fa~\2\u05dc\u00c5\3\2\2\2\u05dd\u05de\7\u0084\2\2\u05de\u05df\5\u00ce"+ - "h\2\u05df\u05e0\7\u0085\2\2\u05e0\u00c7\3\2\2\2\u05e1\u05e2\7K\2\2\u05e2"+ - "\u05f0\7\u0086\2\2\u05e3\u05e8\5\u00fa~\2\u05e4\u05e5\7\u0083\2\2\u05e5"+ - "\u05e7\5\u00caf\2\u05e6\u05e4\3\2\2\2\u05e7\u05ea\3\2\2\2\u05e8\u05e6"+ - "\3\2\2\2\u05e8\u05e9\3\2\2\2\u05e9\u05f1\3\2\2\2\u05ea\u05e8\3\2\2\2\u05eb"+ - "\u05ed\5\u00caf\2\u05ec\u05eb\3\2\2\2\u05ed\u05ee\3\2\2\2\u05ee\u05ec"+ - "\3\2\2\2\u05ee\u05ef\3\2\2\2\u05ef\u05f1\3\2\2\2\u05f0\u05e3\3\2\2\2\u05f0"+ - "\u05ec\3\2\2\2\u05f1\u05f4\3\2\2\2\u05f2\u05f3\7\u0083\2\2\u05f3\u05f5"+ - "\5\u00ccg\2\u05f4\u05f2\3\2\2\2\u05f4\u05f5\3\2\2\2\u05f5\u05f6\3\2\2"+ - "\2\u05f6\u05f7\7\u0087\2\2\u05f7\u060e\3\2\2\2\u05f8\u05f9\7K\2\2\u05f9"+ - "\u05fa\7\u0086\2\2\u05fa\u05fb\5\u00ccg\2\u05fb\u05fc\7\u0087\2\2\u05fc"+ - "\u060e\3\2\2\2\u05fd\u05fe\5J&\2\u05fe\u05ff\7\u0086\2\2\u05ff\u0604\5"+ - "\u00caf\2\u0600\u0601\7\u0083\2\2\u0601\u0603\5\u00caf\2\u0602\u0600\3"+ - "\2\2\2\u0603\u0606\3\2\2\2\u0604\u0602\3\2\2\2\u0604\u0605\3\2\2\2\u0605"+ - "\u0609\3\2\2\2\u0606\u0604\3\2\2\2\u0607\u0608\7\u0083\2\2\u0608\u060a"+ - "\5\u00ccg\2\u0609\u0607\3\2\2\2\u0609\u060a\3\2\2\2\u060a\u060b\3\2\2"+ - "\2\u060b\u060c\7\u0087\2\2\u060c\u060e\3\2\2\2\u060d\u05e1\3\2\2\2\u060d"+ - "\u05f8\3\2\2\2\u060d\u05fd\3\2\2\2\u060e\u00c9\3\2\2\2\u060f\u0610\7\u00c1"+ - "\2\2\u0610\u0611\7\u008e\2\2\u0611\u0612\5\u00be`\2\u0612\u00cb\3\2\2"+ - "\2\u0613\u0614\7\u00a7\2\2\u0614\u0615\5\u00fa~\2\u0615\u00cd\3\2\2\2"+ - "\u0616\u061b\5\u00d0i\2\u0617\u0618\7\u0083\2\2\u0618\u061a\5\u00d0i\2"+ - "\u0619\u0617\3\2\2\2\u061a\u061d\3\2\2\2\u061b\u0619\3\2\2\2\u061b\u061c"+ - "\3\2\2\2\u061c\u0620\3\2\2\2\u061d\u061b\3\2\2\2\u061e\u061f\7\u0083\2"+ - "\2\u061f\u0621\5\u00d2j\2\u0620\u061e\3\2\2\2\u0620\u0621\3\2\2\2\u0621"+ - "\u0626\3\2\2\2\u0622\u0624\5\u00d2j\2\u0623\u0622\3\2\2\2\u0623\u0624"+ - "\3\2\2\2\u0624\u0626\3\2\2\2\u0625\u0616\3\2\2\2\u0625\u0623\3\2\2\2\u0626"+ - "\u00cf\3\2\2\2\u0627\u062a\7\u00c1\2\2\u0628\u0629\7\u0081\2\2\u0629\u062b"+ - "\5\u00be`\2\u062a\u0628\3\2\2\2\u062a\u062b\3\2\2\2\u062b\u00d1\3\2\2"+ - "\2\u062c\u062d\7\u00a7\2\2\u062d\u0630\5\u00fa~\2\u062e\u0630\5,\27\2"+ - "\u062f\u062c\3\2\2\2\u062f\u062e\3\2\2\2\u0630\u00d3\3\2\2\2\u0631\u0633"+ - "\7]\2\2\u0632\u0634\7\u0086\2\2\u0633\u0632\3\2\2\2\u0633\u0634\3\2\2"+ - "\2\u0634\u0637\3\2\2\2\u0635\u0638\5J&\2\u0636\u0638\7W\2\2\u0637\u0635"+ - "\3\2\2\2\u0637\u0636\3\2\2\2\u0638\u0639\3\2\2\2\u0639\u063a\5\u009eP"+ - "\2\u063a\u063b\7t\2\2\u063b\u063d\5\u012c\u0097\2\u063c\u063e\7\u0087"+ - "\2\2\u063d\u063c\3\2\2\2\u063d\u063e\3\2\2\2\u063e\u063f\3\2\2\2\u063f"+ - "\u0643\7\u0084\2\2\u0640\u0642\5j\66\2\u0641\u0640\3\2\2\2\u0642\u0645"+ - "\3\2\2\2\u0643\u0641\3\2\2\2\u0643\u0644\3\2\2\2\u0644\u0646\3\2\2\2\u0645"+ - "\u0643\3\2\2\2\u0646\u0647\7\u0085\2\2\u0647\u00d5\3\2\2\2\u0648\u0649"+ - "\t\t\2\2\u0649\u064a\5\u012c\u0097\2\u064a\u064c\7\u00a6\2\2\u064b\u064d"+ - "\5\u012c\u0097\2\u064c\u064b\3\2\2\2\u064c\u064d\3\2\2\2\u064d\u064e\3"+ - "\2\2\2\u064e\u064f\t\n\2\2\u064f\u00d7\3\2\2\2\u0650\u0651\7^\2\2\u0651"+ - "\u0652\5\u012c\u0097\2\u0652\u0656\7\u0084\2\2\u0653\u0655\5j\66\2\u0654"+ - "\u0653\3\2\2\2\u0655\u0658\3\2\2\2\u0656\u0654\3\2\2\2\u0656\u0657\3\2"+ - "\2\2\u0657\u0659\3\2\2\2\u0658\u0656\3\2\2\2\u0659\u065a\7\u0085\2\2\u065a"+ - "\u00d9\3\2\2\2\u065b\u065c\7_\2\2\u065c\u065d\7\u0080\2\2\u065d\u00db"+ - "\3\2\2\2\u065e\u065f\7`\2\2\u065f\u0660\7\u0080\2\2\u0660\u00dd\3\2\2"+ - "\2\u0661\u0662\7a\2\2\u0662\u0666\7\u0084\2\2\u0663\u0665\5B\"\2\u0664"+ - "\u0663\3\2\2\2\u0665\u0668\3\2\2\2\u0666\u0664\3\2\2\2\u0666\u0667\3\2"+ - "\2\2\u0667\u0669\3\2\2\2\u0668\u0666\3\2\2\2\u0669\u066a\7\u0085\2\2\u066a"+ - "\u00df\3\2\2\2\u066b\u066c\7e\2\2\u066c\u0670\7\u0084\2\2\u066d\u066f"+ - "\5j\66\2\u066e\u066d\3\2\2\2\u066f\u0672\3\2\2\2\u0670\u066e\3\2\2\2\u0670"+ - "\u0671\3\2\2\2\u0671\u0673\3\2\2\2\u0672\u0670\3\2\2\2\u0673\u0674\7\u0085"+ - "\2\2\u0674\u0675\5\u00e2r\2\u0675\u00e1\3\2\2\2\u0676\u0678\5\u00e4s\2"+ - "\u0677\u0676\3\2\2\2\u0678\u0679\3\2\2\2\u0679\u0677\3\2\2\2\u0679\u067a"+ - "\3\2\2\2\u067a\u067c\3\2\2\2\u067b\u067d\5\u00e6t\2\u067c\u067b\3\2\2"+ - "\2\u067c\u067d\3\2\2\2\u067d\u0680\3\2\2\2\u067e\u0680\5\u00e6t\2\u067f"+ - "\u0677\3\2\2\2\u067f\u067e\3\2\2\2\u0680\u00e3\3\2\2\2\u0681\u0682\7f"+ - "\2\2\u0682\u0683\7\u0086\2\2\u0683\u0684\5J&\2\u0684\u0685\7\u00c1\2\2"+ - "\u0685\u0686\7\u0087\2\2\u0686\u068a\7\u0084\2\2\u0687\u0689\5j\66\2\u0688"+ - "\u0687\3\2\2\2\u0689\u068c\3\2\2\2\u068a\u0688\3\2\2\2\u068a\u068b\3\2"+ - "\2\2\u068b\u068d\3\2\2\2\u068c\u068a\3\2\2\2\u068d\u068e\7\u0085\2\2\u068e"+ - "\u00e5\3\2\2\2\u068f\u0690\7g\2\2\u0690\u0694\7\u0084\2\2\u0691\u0693"+ - "\5j\66\2\u0692\u0691\3\2\2\2\u0693\u0696\3\2\2\2\u0694\u0692\3\2\2\2\u0694"+ - "\u0695\3\2\2\2\u0695\u0697\3\2\2\2\u0696\u0694\3\2\2\2\u0697\u0698\7\u0085"+ - "\2\2\u0698\u00e7\3\2\2\2\u0699\u069a\7h\2\2\u069a\u069b\5\u012c\u0097"+ - "\2\u069b\u069c\7\u0080\2\2\u069c\u00e9\3\2\2\2\u069d\u069e\7i\2\2\u069e"+ - "\u069f\5\u012c\u0097\2\u069f\u06a0\7\u0080\2\2\u06a0\u00eb\3\2\2\2\u06a1"+ - "\u06a3\7k\2\2\u06a2\u06a4\5\u012c\u0097\2\u06a3\u06a2\3\2\2\2\u06a3\u06a4"+ - "\3\2\2\2\u06a4\u06a5\3\2\2\2\u06a5\u06a6\7\u0080\2\2\u06a6\u00ed\3\2\2"+ - "\2\u06a7\u06a8\5\u012c\u0097\2\u06a8\u06a9\7\u00a2\2\2\u06a9\u06ac\5\u00f0"+ - "y\2\u06aa\u06ab\7\u0083\2\2\u06ab\u06ad\5\u012c\u0097\2\u06ac\u06aa\3"+ - "\2\2\2\u06ac\u06ad\3\2\2\2\u06ad\u06ae\3\2\2\2\u06ae\u06af\7\u0080\2\2"+ - "\u06af\u00ef\3\2\2\2\u06b0\u06b3\5\u00f2z\2\u06b1\u06b3\7\177\2\2\u06b2"+ - "\u06b0\3\2\2\2\u06b2\u06b1\3\2\2\2\u06b3\u00f1\3\2\2\2\u06b4\u06b5\7\u00c1"+ - "\2\2\u06b5\u00f3\3\2\2\2\u06b6\u06b8\7}\2\2\u06b7\u06b9\7\u00c1\2\2\u06b8"+ - "\u06b7\3\2\2\2\u06b8\u06b9\3\2\2\2\u06b9\u00f5\3\2\2\2\u06ba\u06bb\7\u0084"+ - "\2\2\u06bb\u06c0\5\u00f8}\2\u06bc\u06bd\7\u0083\2\2\u06bd\u06bf\5\u00f8"+ - "}\2\u06be\u06bc\3\2\2\2\u06bf\u06c2\3\2\2\2\u06c0\u06be\3\2\2\2\u06c0"+ - "\u06c1\3\2\2\2\u06c1\u06c3\3\2\2\2\u06c2\u06c0\3\2\2\2\u06c3\u06c4\7\u0085"+ - "\2\2\u06c4\u00f7\3\2\2\2\u06c5\u06ca\7\u00c1\2\2\u06c6\u06c7\7\u00c1\2"+ - "\2\u06c7\u06c8\7\u0081\2\2\u06c8\u06ca\5\u012c\u0097\2\u06c9\u06c5\3\2"+ - "\2\2\u06c9\u06c6\3\2\2\2\u06ca\u00f9\3\2\2\2\u06cb\u06cc\b~\1\2\u06cc"+ - "\u06d4\5\u013c\u009f\2\u06cd\u06d4\5\u0102\u0082\2\u06ce\u06cf\5\u0130"+ - "\u0099\2\u06cf\u06d0\5\u0104\u0083\2\u06d0\u06d4\3\2\2\2\u06d1\u06d2\7"+ - "\u00bd\2\2\u06d2\u06d4\5\u0104\u0083\2\u06d3\u06cb\3\2\2\2\u06d3\u06cd"+ - "\3\2\2\2\u06d3\u06ce\3\2\2\2\u06d3\u06d1\3\2\2\2\u06d4\u06e2\3\2\2\2\u06d5"+ - "\u06d6\f\n\2\2\u06d6\u06e1\5\u00fc\177\2\u06d7\u06d8\f\t\2\2\u06d8\u06d9"+ - "\7\u00b7\2\2\u06d9\u06e1\5\u013c\u009f\2\u06da\u06db\f\b\2\2\u06db\u06e1"+ - "\5\u0100\u0081\2\u06dc\u06dd\f\4\2\2\u06dd\u06e1\5\u0104\u0083\2\u06de"+ - "\u06df\f\3\2\2\u06df\u06e1\5\u00fe\u0080\2\u06e0\u06d5\3\2\2\2\u06e0\u06d7"+ - "\3\2\2\2\u06e0\u06da\3\2\2\2\u06e0\u06dc\3\2\2\2\u06e0\u06de\3\2\2\2\u06e1"+ - "\u06e4\3\2\2\2\u06e2\u06e0\3\2\2\2\u06e2\u06e3\3\2\2\2\u06e3\u00fb\3\2"+ - "\2\2\u06e4\u06e2\3\2\2\2\u06e5\u06e6\t\13\2\2\u06e6\u06e7\t\f\2\2\u06e7"+ - "\u00fd\3\2\2\2\u06e8\u06e9\7\u0088\2\2\u06e9\u06ea\5\u012c\u0097\2\u06ea"+ - "\u06eb\7\u0089\2\2\u06eb\u00ff\3\2\2\2\u06ec\u06f1\7\u00a4\2\2\u06ed\u06ee"+ - "\7\u0088\2\2\u06ee\u06ef\5\u012c\u0097\2\u06ef\u06f0\7\u0089\2\2\u06f0"+ - "\u06f2\3\2\2\2\u06f1\u06ed\3\2\2\2\u06f1\u06f2\3\2\2\2\u06f2\u0101\3\2"+ - "\2\2\u06f3\u06f4\5\u013e\u00a0\2\u06f4\u06f6\7\u0086\2\2\u06f5\u06f7\5"+ - "\u0106\u0084\2\u06f6\u06f5\3\2\2\2\u06f6\u06f7\3\2\2\2\u06f7\u06f8\3\2"+ - "\2\2\u06f8\u06f9\7\u0087\2\2\u06f9\u0103\3\2\2\2\u06fa\u06fb\7\u0082\2"+ - "\2\u06fb\u06fc\5\u0182\u00c2\2\u06fc\u06fe\7\u0086\2\2\u06fd\u06ff\5\u0106"+ - "\u0084\2\u06fe\u06fd\3\2\2\2\u06fe\u06ff\3\2\2\2\u06ff\u0700\3\2\2\2\u0700"+ - "\u0701\7\u0087\2\2\u0701\u0105\3\2\2\2\u0702\u0707\5\u0108\u0085\2\u0703"+ - "\u0704\7\u0083\2\2\u0704\u0706\5\u0108\u0085\2\u0705\u0703\3\2\2\2\u0706"+ - "\u0709\3\2\2\2\u0707\u0705\3\2\2\2\u0707\u0708\3\2\2\2\u0708\u0107\3\2"+ - "\2\2\u0709\u0707\3\2\2\2\u070a\u070e\5\u012c\u0097\2\u070b\u070e\5\u015c"+ - "\u00af\2\u070c\u070e\5\u015e\u00b0\2\u070d\u070a\3\2\2\2\u070d\u070b\3"+ - "\2\2\2\u070d\u070c\3\2\2\2\u070e\u0109\3\2\2\2\u070f\u0711\5h\65\2\u0710"+ - "\u070f\3\2\2\2\u0711\u0714\3\2\2\2\u0712\u0710\3\2\2\2\u0712\u0713\3\2"+ - "\2\2\u0713\u0715\3\2\2\2\u0714\u0712\3\2\2\2\u0715\u0717\7w\2\2\u0716"+ - "\u0712\3\2\2\2\u0716\u0717\3\2\2\2\u0717\u0718\3\2\2\2\u0718\u0719\5\u00fa"+ - "~\2\u0719\u071a\7\u00a2\2\2\u071a\u071b\5\u0102\u0082\2\u071b\u010b\3"+ - "\2\2\2\u071c\u0721\5\u012c\u0097\2\u071d\u071e\7\u0083\2\2\u071e\u0720"+ - "\5\u012c\u0097\2\u071f\u071d\3\2\2\2\u0720\u0723\3\2\2\2\u0721\u071f\3"+ - "\2\2\2\u0721\u0722\3\2\2\2\u0722\u010d\3\2\2\2\u0723\u0721\3\2\2\2\u0724"+ - "\u0725\5\u012c\u0097\2\u0725\u0726\7\u0080\2\2\u0726\u010f\3\2\2\2\u0727"+ - "\u0729\5\u0114\u008b\2\u0728\u072a\5\u011c\u008f\2\u0729\u0728\3\2\2\2"+ - "\u0729\u072a\3\2\2\2\u072a\u072b\3\2\2\2\u072b\u072c\5\u0112\u008a\2\u072c"+ - "\u0111\3\2\2\2\u072d\u072f\5\u011e\u0090\2\u072e\u072d\3\2\2\2\u072e\u072f"+ - "\3\2\2\2\u072f\u0731\3\2\2\2\u0730\u0732\5\u0120\u0091\2\u0731\u0730\3"+ - "\2\2\2\u0731\u0732\3\2\2\2\u0732\u073a\3\2\2\2\u0733\u0735\5\u0120\u0091"+ - "\2\u0734\u0733\3\2\2\2\u0734\u0735\3\2\2\2\u0735\u0737\3\2\2\2\u0736\u0738"+ - "\5\u011e\u0090\2\u0737\u0736\3\2\2\2\u0737\u0738\3\2\2\2\u0738\u073a\3"+ - "\2\2\2\u0739\u072e\3\2\2\2\u0739\u0734\3\2\2\2\u073a\u0113\3\2\2\2\u073b"+ - "\u073e\7l\2\2\u073c\u073d\7s\2\2\u073d\u073f\5\u0118\u008d\2\u073e\u073c"+ - "\3\2\2\2\u073e\u073f\3\2\2\2\u073f\u0740\3\2\2\2\u0740\u0744\7\u0084\2"+ - "\2\u0741\u0743\5j\66\2\u0742\u0741\3\2\2\2\u0743\u0746\3\2\2\2\u0744\u0742"+ - "\3\2\2\2\u0744\u0745\3\2\2\2\u0745\u0747\3\2\2\2\u0746\u0744\3\2\2\2\u0747"+ - "\u0748\7\u0085\2\2\u0748\u0115\3\2\2\2\u0749\u074a\5\u0126\u0094\2\u074a"+ - "\u0117\3\2\2\2\u074b\u0750\5\u0116\u008c\2\u074c\u074d\7\u0083\2\2\u074d"+ - "\u074f\5\u0116\u008c\2\u074e\u074c\3\2\2\2\u074f\u0752\3\2\2\2\u0750\u074e"+ - "\3\2\2\2\u0750\u0751\3\2\2\2\u0751\u0119\3\2\2\2\u0752\u0750\3\2\2\2\u0753"+ - "\u0754\7u\2\2\u0754\u0758\7\u0084\2\2\u0755\u0757\5j\66\2\u0756\u0755"+ - "\3\2\2\2\u0757\u075a\3\2\2\2\u0758\u0756\3\2\2\2\u0758\u0759\3\2\2\2\u0759"+ - "\u075b\3\2\2\2\u075a\u0758\3\2\2\2\u075b\u075c\7\u0085\2\2\u075c\u011b"+ - "\3\2\2\2\u075d\u075e\7o\2\2\u075e\u0762\7\u0084\2\2\u075f\u0761\5j\66"+ - "\2\u0760\u075f\3\2\2\2\u0761\u0764\3\2\2\2\u0762\u0760\3\2\2\2\u0762\u0763"+ - "\3\2\2\2\u0763\u0765\3\2\2\2\u0764\u0762\3\2\2\2\u0765\u0766\7\u0085\2"+ - "\2\u0766\u011d\3\2\2\2\u0767\u0768\7q\2\2\u0768\u076c\7\u0084\2\2\u0769"+ - "\u076b\5j\66\2\u076a\u0769\3\2\2\2\u076b\u076e\3\2\2\2\u076c\u076a\3\2"+ - "\2\2\u076c\u076d\3\2\2\2\u076d\u076f\3\2\2\2\u076e\u076c\3\2\2\2\u076f"+ - "\u0770\7\u0085\2\2\u0770\u011f\3\2\2\2\u0771\u0772\7r\2\2\u0772\u0776"+ - "\7\u0084\2\2\u0773\u0775\5j\66\2\u0774\u0773\3\2\2\2\u0775\u0778\3\2\2"+ - "\2\u0776\u0774\3\2\2\2\u0776\u0777\3\2\2\2\u0777\u0779\3\2\2\2\u0778\u0776"+ - "\3\2\2\2\u0779\u077a\7\u0085\2\2\u077a\u0121\3\2\2\2\u077b\u077c\7m\2"+ - "\2\u077c\u077d\7\u0080\2\2\u077d\u0123\3\2\2\2\u077e\u077f\7n\2\2\u077f"+ - "\u0780\7\u0080\2\2\u0780\u0125\3\2\2\2\u0781\u0782\7p\2\2\u0782\u0783"+ - "\7\u008e\2\2\u0783\u0784\5\u012c\u0097\2\u0784\u0127\3\2\2\2\u0785\u0786"+ - "\5\u012a\u0096\2\u0786\u0129\3\2\2\2\u0787\u0788\7\24\2\2\u0788\u078b"+ - "\7\u00bd\2\2\u0789\u078a\7\4\2\2\u078a\u078c\7\u00c1\2\2\u078b\u0789\3"+ - "\2\2\2\u078b\u078c\3\2\2\2\u078c\u078d\3\2\2\2\u078d\u078e\7\u0080\2\2"+ - "\u078e\u012b\3\2\2\2\u078f\u0790\b\u0097\1\2\u0790\u07ce\5\u0152\u00aa"+ - "\2\u0791\u07ce\5\u0082B\2\u0792\u07ce\5n8\2\u0793\u07ce\5\u0160\u00b1"+ - "\2\u0794\u07ce\5v<\2\u0795\u07ce\5\u017e\u00c0\2\u0796\u0798\5h\65\2\u0797"+ - "\u0796\3\2\2\2\u0798\u079b\3\2\2\2\u0799\u0797\3\2\2\2\u0799\u079a\3\2"+ - "\2\2\u079a\u079c\3\2\2\2\u079b\u0799\3\2\2\2\u079c\u079e\7w\2\2\u079d"+ - "\u0799\3\2\2\2\u079d\u079e\3\2\2\2\u079e\u079f\3\2\2\2\u079f\u07ce\5\u00fa"+ - "~\2\u07a0\u07ce\5\u010a\u0086\2\u07a1\u07ce\5\u0132\u009a\2\u07a2\u07ce"+ - "\5\u0134\u009b\2\u07a3\u07ce\5\u0186\u00c4\2\u07a4\u07a5\7y\2\2\u07a5"+ - "\u07ce\5\u012c\u0097\34\u07a6\u07a7\7z\2\2\u07a7\u07ce\5\u012c\u0097\33"+ - "\u07a8\u07a9\t\r\2\2\u07a9\u07ce\5\u012c\u0097\32\u07aa\u07b4\7\u0098"+ - "\2\2\u07ab\u07ad\5h\65\2\u07ac\u07ab\3\2\2\2\u07ad\u07ae\3\2\2\2\u07ae"+ - "\u07ac\3\2\2\2\u07ae\u07af\3\2\2\2\u07af\u07b1\3\2\2\2\u07b0\u07b2\5J"+ - "&\2\u07b1\u07b0\3\2\2\2\u07b1\u07b2\3\2\2\2\u07b2\u07b5\3\2\2\2\u07b3"+ - "\u07b5\5J&\2\u07b4\u07ac\3\2\2\2\u07b4\u07b3\3\2\2\2\u07b5\u07b6\3\2\2"+ - "\2\u07b6\u07b7\7\u0097\2\2\u07b7\u07b8\5\u012c\u0097\31\u07b8\u07ce\3"+ - "\2\2\2\u07b9\u07ce\5\30\r\2\u07ba\u07ce\5\32\16\2\u07bb\u07bc\7\u0086"+ - "\2\2\u07bc\u07bd\5\u012c\u0097\2\u07bd\u07be\7\u0087\2\2\u07be\u07ce\3"+ - "\2\2\2\u07bf\u07c2\7~\2\2\u07c0\u07c3\5\u00f6|\2\u07c1\u07c3\5\u012c\u0097"+ - "\2\u07c2\u07c0\3\2\2\2\u07c2\u07c1\3\2\2\2\u07c3\u07ce\3\2\2\2\u07c4\u07ce"+ - "\5\u0136\u009c\2\u07c5\u07c6\7\u00a3\2\2\u07c6\u07c9\5\u00f0y\2\u07c7"+ - "\u07c8\7\u0083\2\2\u07c8\u07ca\5\u012c\u0097\2\u07c9\u07c7\3\2\2\2\u07c9"+ - "\u07ca\3\2\2\2\u07ca\u07ce\3\2\2\2\u07cb\u07ce\5\u00f4{\2\u07cc\u07ce"+ - "\5\u0130\u0099\2\u07cd\u078f\3\2\2\2\u07cd\u0791\3\2\2\2\u07cd\u0792\3"+ - "\2\2\2\u07cd\u0793\3\2\2\2\u07cd\u0794\3\2\2\2\u07cd\u0795\3\2\2\2\u07cd"+ - "\u079d\3\2\2\2\u07cd\u07a0\3\2\2\2\u07cd\u07a1\3\2\2\2\u07cd\u07a2\3\2"+ - "\2\2\u07cd\u07a3\3\2\2\2\u07cd\u07a4\3\2\2\2\u07cd\u07a6\3\2\2\2\u07cd"+ - "\u07a8\3\2\2\2\u07cd\u07aa\3\2\2\2\u07cd\u07b9\3\2\2\2\u07cd\u07ba\3\2"+ - "\2\2\u07cd\u07bb\3\2\2\2\u07cd\u07bf\3\2\2\2\u07cd\u07c4\3\2\2\2\u07cd"+ - "\u07c5\3\2\2\2\u07cd\u07cb\3\2\2\2\u07cd\u07cc\3\2\2\2\u07ce\u07ff\3\2"+ - "\2\2\u07cf\u07d0\f\30\2\2\u07d0\u07d1\t\16\2\2\u07d1\u07fe\5\u012c\u0097"+ - "\31\u07d2\u07d3\f\27\2\2\u07d3\u07d4\t\17\2\2\u07d4\u07fe\5\u012c\u0097"+ - "\30\u07d5\u07d6\f\26\2\2\u07d6\u07d7\5\u0138\u009d\2\u07d7\u07d8\5\u012c"+ - "\u0097\27\u07d8\u07fe\3\2\2\2\u07d9\u07da\f\25\2\2\u07da\u07db\t\20\2"+ - "\2\u07db\u07fe\5\u012c\u0097\26\u07dc\u07dd\f\24\2\2\u07dd\u07de\t\21"+ - "\2\2\u07de\u07fe\5\u012c\u0097\25\u07df\u07e0\f\22\2\2\u07e0\u07e1\t\22"+ - "\2\2\u07e1\u07fe\5\u012c\u0097\23\u07e2\u07e3\f\21\2\2\u07e3\u07e4\t\23"+ - "\2\2\u07e4\u07fe\5\u012c\u0097\22\u07e5\u07e6\f\20\2\2\u07e6\u07e7\t\24"+ - "\2\2\u07e7\u07fe\5\u012c\u0097\21\u07e8\u07e9\f\17\2\2\u07e9\u07ea\7\u009b"+ - "\2\2\u07ea\u07fe\5\u012c\u0097\20\u07eb\u07ec\f\16\2\2\u07ec\u07ed\7\u009c"+ - "\2\2\u07ed\u07fe\5\u012c\u0097\17\u07ee\u07ef\f\r\2\2\u07ef\u07f0\7\u00aa"+ - "\2\2\u07f0\u07fe\5\u012c\u0097\16\u07f1\u07f2\f\f\2\2\u07f2\u07f3\7\u008a"+ - "\2\2\u07f3\u07f4\5\u012c\u0097\2\u07f4\u07f5\7\u0081\2\2\u07f5\u07f6\5"+ - "\u012c\u0097\r\u07f6\u07fe\3\2\2\2\u07f7\u07f8\f\23\2\2\u07f8\u07f9\7"+ - "|\2\2\u07f9\u07fe\5J&\2\u07fa\u07fb\f\b\2\2\u07fb\u07fc\7\u00ab\2\2\u07fc"+ - "\u07fe\5\u00f0y\2\u07fd\u07cf\3\2\2\2\u07fd\u07d2\3\2\2\2\u07fd\u07d5"+ - "\3\2\2\2\u07fd\u07d9\3\2\2\2\u07fd\u07dc\3\2\2\2\u07fd\u07df\3\2\2\2\u07fd"+ - "\u07e2\3\2\2\2\u07fd\u07e5\3\2\2\2\u07fd\u07e8\3\2\2\2\u07fd\u07eb\3\2"+ - "\2\2\u07fd\u07ee\3\2\2\2\u07fd\u07f1\3\2\2\2\u07fd\u07f7\3\2\2\2\u07fd"+ - "\u07fa\3\2\2\2\u07fe\u0801\3\2\2\2\u07ff\u07fd\3\2\2\2\u07ff\u0800\3\2"+ - "\2\2\u0800\u012d\3\2\2\2\u0801\u07ff\3\2\2\2\u0802\u0803\b\u0098\1\2\u0803"+ - "\u080a\5\u0152\u00aa\2\u0804\u080a\5n8\2\u0805\u0806\7\u0086\2\2\u0806"+ - "\u0807\5\u012e\u0098\2\u0807\u0808\7\u0087\2\2\u0808\u080a\3\2\2\2\u0809"+ - "\u0802\3\2\2\2\u0809\u0804\3\2\2\2\u0809\u0805\3\2\2\2\u080a\u0813\3\2"+ - "\2\2\u080b\u080c\f\5\2\2\u080c\u080d\t\25\2\2\u080d\u0812\5\u012e\u0098"+ - "\6\u080e\u080f\f\4\2\2\u080f\u0810\t\17\2\2\u0810\u0812\5\u012e\u0098"+ - "\5\u0811\u080b\3\2\2\2\u0811\u080e\3\2\2\2\u0812\u0815\3\2\2\2\u0813\u0811"+ - "\3\2\2\2\u0813\u0814\3\2\2\2\u0814\u012f\3\2\2\2\u0815\u0813\3\2\2\2\u0816"+ - "\u0817\5J&\2\u0817\u0131\3\2\2\2\u0818\u081e\7X\2\2\u0819\u081b\7\u0086"+ - "\2\2\u081a\u081c\5\u0106\u0084\2\u081b\u081a\3\2\2\2\u081b\u081c\3\2\2"+ - "\2\u081c\u081d\3\2\2\2\u081d\u081f\7\u0087\2\2\u081e\u0819\3\2\2\2\u081e"+ - "\u081f\3\2\2\2\u081f\u0829\3\2\2\2\u0820\u0821\7X\2\2\u0821\u0822\5Z."+ - "\2\u0822\u0824\7\u0086\2\2\u0823\u0825\5\u0106\u0084\2\u0824\u0823\3\2"+ - "\2\2\u0824\u0825\3\2\2\2\u0825\u0826\3\2\2\2\u0826\u0827\7\u0087\2\2\u0827"+ - "\u0829\3\2\2\2\u0828\u0818\3\2\2\2\u0828\u0820\3\2\2\2\u0829\u0133\3\2"+ - "\2\2\u082a\u082c\5h\65\2\u082b\u082a\3\2\2\2\u082c\u082f\3\2\2\2\u082d"+ - "\u082b\3\2\2\2\u082d\u082e\3\2\2\2\u082e\u0830\3\2\2\2\u082f\u082d\3\2"+ - "\2\2\u0830\u0831\7\t\2\2\u0831\u0832\5\20\t\2\u0832\u0135\3\2\2\2\u0833"+ - "\u0834\7j\2\2\u0834\u0835\5\u012c\u0097\2\u0835\u0137\3\2\2\2\u0836\u0837"+ - "\7\u0098\2\2\u0837\u0838\5\u013a\u009e\2\u0838\u0839\7\u0098\2\2\u0839"+ - "\u0845\3\2\2\2\u083a\u083b\7\u0097\2\2\u083b\u083c\5\u013a\u009e\2\u083c"+ - "\u083d\7\u0097\2\2\u083d\u0845\3\2\2\2\u083e\u083f\7\u0097\2\2\u083f\u0840"+ - "\5\u013a\u009e\2\u0840\u0841\7\u0097\2\2\u0841\u0842\5\u013a\u009e\2\u0842"+ - "\u0843\7\u0097\2\2\u0843\u0845\3\2\2\2\u0844\u0836\3\2\2\2\u0844\u083a"+ - "\3\2\2\2\u0844\u083e\3\2\2\2\u0845\u0139\3\2\2\2\u0846\u0847\6\u009e\34"+ - "\2\u0847\u013b\3\2\2\2\u0848\u0849\7\u00c1\2\2\u0849\u084b\7\u0081\2\2"+ - "\u084a\u0848\3\2\2\2\u084a\u084b\3\2\2\2\u084b\u084c\3\2\2\2\u084c\u084d"+ - "\7\u00c1\2\2\u084d\u013d\3\2\2\2\u084e\u084f\7\u00c1\2\2\u084f\u0851\7"+ - "\u0081\2\2\u0850\u084e\3\2\2\2\u0850\u0851\3\2\2\2\u0851\u0852\3\2\2\2"+ - "\u0852\u0853\5\u0182\u00c2\2\u0853\u013f\3\2\2\2\u0854\u0858\7\25\2\2"+ - "\u0855\u0857\5h\65\2\u0856\u0855\3\2\2\2\u0857\u085a\3\2\2\2\u0858\u0856"+ - "\3\2\2\2\u0858\u0859\3\2\2\2\u0859\u085b\3\2\2\2\u085a\u0858\3\2\2\2\u085b"+ - "\u085c\5J&\2\u085c\u0141\3\2\2\2\u085d\u085f\5h\65\2\u085e\u085d\3\2\2"+ - "\2\u085f\u0862\3\2\2\2\u0860\u085e\3\2\2\2\u0860\u0861\3\2\2\2\u0861\u0863"+ - "\3\2\2\2\u0862\u0860\3\2\2\2\u0863\u0864\5J&\2\u0864\u0143\3\2\2\2\u0865"+ - "\u086a\5\u0146\u00a4\2\u0866\u0867\7\u0083\2\2\u0867\u0869\5\u0146\u00a4"+ - "\2\u0868\u0866\3\2\2\2\u0869\u086c\3\2\2\2\u086a\u0868\3\2\2\2\u086a\u086b"+ - "\3\2\2\2\u086b\u0145\3\2\2\2\u086c\u086a\3\2\2\2\u086d\u086e\5J&\2\u086e"+ - "\u0147\3\2\2\2\u086f\u0874\5\u014a\u00a6\2\u0870\u0871\7\u0083\2\2\u0871"+ - "\u0873\5\u014a\u00a6\2\u0872\u0870\3\2\2\2\u0873\u0876\3\2\2\2\u0874\u0872"+ - "\3\2\2\2\u0874\u0875\3\2\2\2\u0875\u0149\3\2\2\2\u0876\u0874\3\2\2\2\u0877"+ - "\u0879\5h\65\2\u0878\u0877\3\2\2\2\u0879\u087c\3\2\2\2\u087a\u0878\3\2"+ - "\2\2\u087a\u087b\3\2\2\2\u087b\u087e\3\2\2\2\u087c\u087a\3\2\2\2\u087d"+ - "\u087f\7\5\2\2\u087e\u087d\3\2\2\2\u087e\u087f\3\2\2\2\u087f\u0880\3\2"+ - "\2\2\u0880\u0881\5J&\2\u0881\u0882\7\u00c1\2\2\u0882\u014b\3\2\2\2\u0883"+ - "\u0884\5\u014a\u00a6\2\u0884\u0885\7\u008e\2\2\u0885\u0886\5\u012c\u0097"+ - "\2\u0886\u014d\3\2\2\2\u0887\u0889\5h\65\2\u0888\u0887\3\2\2\2\u0889\u088c"+ - "\3\2\2\2\u088a\u0888\3\2\2\2\u088a\u088b\3\2\2\2\u088b\u088d\3\2\2\2\u088c"+ - "\u088a\3\2\2\2\u088d\u088e\5J&\2\u088e\u088f\7\u00a7\2\2\u088f\u0890\7"+ - "\u00c1\2\2\u0890\u014f\3\2\2\2\u0891\u0894\5\u014a\u00a6\2\u0892\u0894"+ - "\5\u014c\u00a7\2\u0893\u0891\3\2\2\2\u0893\u0892\3\2\2\2\u0894\u089c\3"+ - "\2\2\2\u0895\u0898\7\u0083\2\2\u0896\u0899\5\u014a\u00a6\2\u0897\u0899"+ - "\5\u014c\u00a7\2\u0898\u0896\3\2\2\2\u0898\u0897\3\2\2\2\u0899\u089b\3"+ - "\2\2\2\u089a\u0895\3\2\2\2\u089b\u089e\3\2\2\2\u089c\u089a\3\2\2\2\u089c"+ - "\u089d\3\2\2\2\u089d\u08a1\3\2\2\2\u089e\u089c\3\2\2\2\u089f\u08a0\7\u0083"+ - "\2\2\u08a0\u08a2\5\u014e\u00a8\2\u08a1\u089f\3\2\2\2\u08a1\u08a2\3\2\2"+ - "\2\u08a2\u08a5\3\2\2\2\u08a3\u08a5\5\u014e\u00a8\2\u08a4\u0893\3\2\2\2"+ - "\u08a4\u08a3\3\2\2\2\u08a5\u0151\3\2\2\2\u08a6\u08a8\7\u0090\2\2\u08a7"+ - "\u08a6\3\2\2\2\u08a7\u08a8\3\2\2\2\u08a8\u08a9\3\2\2\2\u08a9\u08b4\5\u0156"+ - "\u00ac\2\u08aa\u08ac\7\u0090\2\2\u08ab\u08aa\3\2\2\2\u08ab\u08ac\3\2\2"+ - "\2\u08ac\u08ad\3\2\2\2\u08ad\u08b4\5\u0154\u00ab\2\u08ae\u08b4\7\u00bd"+ - "\2\2\u08af\u08b4\7\u00bc\2\2\u08b0\u08b4\5\u0158\u00ad\2\u08b1\u08b4\5"+ - "\u015a\u00ae\2\u08b2\u08b4\7\u00c0\2\2\u08b3\u08a7\3\2\2\2\u08b3\u08ab"+ - "\3\2\2\2\u08b3\u08ae\3\2\2\2\u08b3\u08af\3\2\2\2\u08b3\u08b0\3\2\2\2\u08b3"+ - "\u08b1\3\2\2\2\u08b3\u08b2\3\2\2\2\u08b4\u0153\3\2\2\2\u08b5\u08b6\t\26"+ - "\2\2\u08b6\u0155\3\2\2\2\u08b7\u08b8\t\27\2\2\u08b8\u0157\3\2\2\2\u08b9"+ - "\u08ba\7\u0086\2\2\u08ba\u08bb\7\u0087\2\2\u08bb\u0159\3\2\2\2\u08bc\u08bd"+ - "\t\30\2\2\u08bd\u015b\3\2\2\2\u08be\u08bf\7\u00c1\2\2\u08bf\u08c0\7\u008e"+ - "\2\2\u08c0\u08c1\5\u012c\u0097\2\u08c1\u015d\3\2\2\2\u08c2\u08c3\7\u00a7"+ - "\2\2\u08c3\u08c4\5\u012c\u0097\2\u08c4\u015f\3\2\2\2\u08c5\u08c6\7\u00c2"+ - "\2\2\u08c6\u08c7\5\u0162\u00b2\2\u08c7\u08c8\7\u00e6\2\2\u08c8\u0161\3"+ - "\2\2\2\u08c9\u08cf\5\u0168\u00b5\2\u08ca\u08cf\5\u0170\u00b9\2\u08cb\u08cf"+ - "\5\u0166\u00b4\2\u08cc\u08cf\5\u0174\u00bb\2\u08cd\u08cf\7\u00df\2\2\u08ce"+ - "\u08c9\3\2\2\2\u08ce\u08ca\3\2\2\2\u08ce\u08cb\3\2\2\2\u08ce\u08cc\3\2"+ - "\2\2\u08ce\u08cd\3\2\2\2\u08cf\u0163\3\2\2\2\u08d0\u08d2\5\u0174\u00bb"+ - "\2\u08d1\u08d0\3\2\2\2\u08d1\u08d2\3\2\2\2\u08d2\u08de\3\2\2\2\u08d3\u08d8"+ - "\5\u0168\u00b5\2\u08d4\u08d8\7\u00df\2\2\u08d5\u08d8\5\u0170\u00b9\2\u08d6"+ - "\u08d8\5\u0166\u00b4\2\u08d7\u08d3\3\2\2\2\u08d7\u08d4\3\2\2\2\u08d7\u08d5"+ - "\3\2\2\2\u08d7\u08d6\3\2\2\2\u08d8\u08da\3\2\2\2\u08d9\u08db\5\u0174\u00bb"+ - "\2\u08da\u08d9\3\2\2\2\u08da\u08db\3\2\2\2\u08db\u08dd\3\2\2\2\u08dc\u08d7"+ - "\3\2\2\2\u08dd\u08e0\3\2\2\2\u08de\u08dc\3\2\2\2\u08de\u08df\3\2\2\2\u08df"+ - "\u0165\3\2\2\2\u08e0\u08de\3\2\2\2\u08e1\u08e8\7\u00de\2\2\u08e2\u08e3"+ - "\7\u00fc\2\2\u08e3\u08e4\5\u012c\u0097\2\u08e4\u08e5\7\u0085\2\2\u08e5"+ - "\u08e7\3\2\2\2\u08e6\u08e2\3\2\2\2\u08e7\u08ea\3\2\2\2\u08e8\u08e6\3\2"+ - "\2\2\u08e8\u08e9\3\2\2\2\u08e9\u08ee\3\2\2\2\u08ea\u08e8\3\2\2\2\u08eb"+ - "\u08ed\7\u00fd\2\2\u08ec\u08eb\3\2\2\2\u08ed\u08f0\3\2\2\2\u08ee\u08ec"+ - "\3\2\2\2\u08ee\u08ef\3\2\2\2\u08ef\u08f1\3\2\2\2\u08f0\u08ee\3\2\2\2\u08f1"+ - "\u08f2\7\u00fb\2\2\u08f2\u0167\3\2\2\2\u08f3\u08f4\5\u016a\u00b6\2\u08f4"+ - "\u08f5\5\u0164\u00b3\2\u08f5\u08f6\5\u016c\u00b7\2\u08f6\u08f9\3\2\2\2"+ - "\u08f7\u08f9\5\u016e\u00b8\2\u08f8\u08f3\3\2\2\2\u08f8\u08f7\3\2\2\2\u08f9"+ - "\u0169\3\2\2\2\u08fa\u08fb\7\u00e3\2\2\u08fb\u08ff\5\u017c\u00bf\2\u08fc"+ - "\u08fe\5\u0172\u00ba\2\u08fd\u08fc\3\2\2\2\u08fe\u0901\3\2\2\2\u08ff\u08fd"+ - "\3\2\2\2\u08ff\u0900\3\2\2\2\u0900\u0902\3\2\2\2\u0901\u08ff\3\2\2\2\u0902"+ - "\u0903\7\u00e9\2\2\u0903\u016b\3\2\2\2\u0904\u0905\7\u00e4\2\2\u0905\u0906"+ - "\5\u017c\u00bf\2\u0906\u0907\7\u00e9\2\2\u0907\u016d\3\2\2\2\u0908\u0909"+ - "\7\u00e3\2\2\u0909\u090d\5\u017c\u00bf\2\u090a\u090c\5\u0172\u00ba\2\u090b"+ - "\u090a\3\2\2\2\u090c\u090f\3\2\2\2\u090d\u090b\3\2\2\2\u090d\u090e\3\2"+ - "\2\2\u090e\u0910\3\2\2\2\u090f\u090d\3\2\2\2\u0910\u0911\7\u00eb\2\2\u0911"+ - "\u016f\3\2\2\2\u0912\u0919\7\u00e5\2\2\u0913\u0914\7\u00fa\2\2\u0914\u0915"+ - "\5\u012c\u0097\2\u0915\u0916\7\u0085\2\2\u0916\u0918\3\2\2\2\u0917\u0913"+ - "\3\2\2\2\u0918\u091b\3\2\2\2\u0919\u0917\3\2\2\2\u0919\u091a\3\2\2\2\u091a"+ - "\u091c\3\2\2\2\u091b\u0919\3\2\2\2\u091c\u091d\7\u00f9\2\2\u091d\u0171"+ - "\3\2\2\2\u091e\u091f\5\u017c\u00bf\2\u091f\u0920\7\u00ee\2\2\u0920\u0921"+ - "\5\u0176\u00bc\2\u0921\u0173\3\2\2\2\u0922\u0923\7\u00e7\2\2\u0923\u0924"+ - "\5\u012c\u0097\2\u0924\u0925\7\u0085\2\2\u0925\u0927\3\2\2\2\u0926\u0922"+ - "\3\2\2\2\u0927\u0928\3\2\2\2\u0928\u0926\3\2\2\2\u0928\u0929\3\2\2\2\u0929"+ - "\u092b\3\2\2\2\u092a\u092c\7\u00e8\2\2\u092b\u092a\3\2\2\2\u092b\u092c"+ - "\3\2\2\2\u092c\u092f\3\2\2\2\u092d\u092f\7\u00e8\2\2\u092e\u0926\3\2\2"+ - "\2\u092e\u092d\3\2\2\2\u092f\u0175\3\2\2\2\u0930\u0933\5\u0178\u00bd\2"+ - "\u0931\u0933\5\u017a\u00be\2\u0932\u0930\3\2\2\2\u0932\u0931\3\2\2\2\u0933"+ - "\u0177\3\2\2\2\u0934\u093b\7\u00f0\2\2\u0935\u0936\7\u00f7\2\2\u0936\u0937"+ - "\5\u012c\u0097\2\u0937\u0938\7\u0085\2\2\u0938\u093a\3\2\2\2\u0939\u0935"+ - "\3\2\2\2\u093a\u093d\3\2\2\2\u093b\u0939\3\2\2\2\u093b\u093c\3\2\2\2\u093c"+ - "\u093f\3\2\2\2\u093d\u093b\3\2\2\2\u093e\u0940\7\u00f8\2\2\u093f\u093e"+ - "\3\2\2\2\u093f\u0940\3\2\2\2\u0940\u0941\3\2\2\2\u0941\u0942\7\u00f6\2"+ - "\2\u0942\u0179\3\2\2\2\u0943\u094a\7\u00ef\2\2\u0944\u0945\7\u00f4\2\2"+ - "\u0945\u0946\5\u012c\u0097\2\u0946\u0947\7\u0085\2\2\u0947\u0949\3\2\2"+ - "\2\u0948\u0944\3\2\2\2\u0949\u094c\3\2\2\2\u094a\u0948\3\2\2\2\u094a\u094b"+ - "\3\2\2\2\u094b\u094e\3\2\2\2\u094c\u094a\3\2\2\2\u094d\u094f\7\u00f5\2"+ - "\2\u094e\u094d\3\2\2\2\u094e\u094f\3\2\2\2\u094f\u0950\3\2\2\2\u0950\u0951"+ - "\7\u00f3\2\2\u0951\u017b\3\2\2\2\u0952\u0953\7\u00f1\2\2\u0953\u0955\7"+ - "\u00ed\2\2\u0954\u0952\3\2\2\2\u0954\u0955\3\2\2\2\u0955\u0956\3\2\2\2"+ - "\u0956\u0957\7\u00f1\2\2\u0957\u017d\3\2\2\2\u0958\u095a\7\u00c3\2\2\u0959"+ - "\u095b\5\u0180\u00c1\2\u095a\u0959\3\2\2\2\u095a\u095b\3\2\2\2\u095b\u095c"+ - "\3\2\2\2\u095c\u095d\7\u0104\2\2\u095d\u017f\3\2\2\2\u095e\u095f\7\u0105"+ - "\2\2\u095f\u0960\5\u012c\u0097\2\u0960\u0961\7\u0085\2\2\u0961\u0963\3"+ - "\2\2\2\u0962\u095e\3\2\2\2\u0963\u0964\3\2\2\2\u0964\u0962\3\2\2\2\u0964"+ - "\u0965\3\2\2\2\u0965\u0967\3\2\2\2\u0966\u0968\7\u0106\2\2\u0967\u0966"+ - "\3\2\2\2\u0967\u0968\3\2\2\2\u0968\u096b\3\2\2\2\u0969\u096b\7\u0106\2"+ - "\2\u096a\u0962\3\2\2\2\u096a\u0969\3\2\2\2\u096b\u0181\3\2\2\2\u096c\u096f"+ - "\7\u00c1\2\2\u096d\u096f\5\u0184\u00c3\2\u096e\u096c\3\2\2\2\u096e\u096d"+ - "\3\2\2\2\u096f\u0183\3\2\2\2\u0970\u0971\t\31\2\2\u0971\u0185\3\2\2\2"+ - "\u0972\u0973\7\35\2\2\u0973\u0975\5\u01a2\u00d2\2\u0974\u0976\5\u01a4"+ - "\u00d3\2\u0975\u0974\3\2\2\2\u0975\u0976\3\2\2\2\u0976\u0978\3\2\2\2\u0977"+ - "\u0979\5\u0196\u00cc\2\u0978\u0977\3\2\2\2\u0978\u0979\3\2\2\2\u0979\u097b"+ - "\3\2\2\2\u097a\u097c\5\u0190\u00c9\2\u097b\u097a\3\2\2\2\u097b\u097c\3"+ - "\2\2\2\u097c\u097e\3\2\2\2\u097d\u097f\5\u0194\u00cb\2\u097e\u097d\3\2"+ - "\2\2\u097e\u097f\3\2\2\2\u097f\u0187\3\2\2\2\u0980\u0981\7A\2\2\u0981"+ - "\u0983\7\u0084\2\2\u0982\u0984\5\u018a\u00c6\2\u0983\u0982\3\2\2\2\u0984"+ - "\u0985\3\2\2\2\u0985\u0983\3\2\2\2\u0985\u0986\3\2\2\2\u0986\u0987\3\2"+ - "\2\2\u0987\u0988\7\u0085\2\2\u0988\u0189\3\2\2\2\u0989\u098f\7\35\2\2"+ - "\u098a\u098c\5\u01a2\u00d2\2\u098b\u098d\5\u01a4\u00d3\2\u098c\u098b"; + "\4\u00ed\t\u00ed\4\u00ee\t\u00ee\4\u00ef\t\u00ef\4\u00f0\t\u00f0\3\2\3"+ + "\2\7\2\u01e3\n\2\f\2\16\2\u01e6\13\2\3\2\5\2\u01e9\n\2\3\2\7\2\u01ec\n"+ + "\2\f\2\16\2\u01ef\13\2\3\2\7\2\u01f2\n\2\f\2\16\2\u01f5\13\2\3\2\3\2\3"+ + "\3\3\3\3\3\7\3\u01fc\n\3\f\3\16\3\u01ff\13\3\3\3\5\3\u0202\n\3\3\4\3\4"+ + "\3\4\3\5\3\5\3\6\3\6\3\6\3\6\5\6\u020d\n\6\3\6\3\6\3\6\5\6\u0212\n\6\3"+ + "\6\3\6\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3\b\5\b\u021e\n\b\3\t\3\t\5\t\u0222"+ + "\n\t\3\t\3\t\3\t\3\t\3\n\3\n\7\n\u022a\n\n\f\n\16\n\u022d\13\n\3\n\3\n"+ + "\3\13\3\13\7\13\u0233\n\13\f\13\16\13\u0236\13\13\3\13\6\13\u0239\n\13"+ + "\r\13\16\13\u023a\3\13\7\13\u023e\n\13\f\13\16\13\u0241\13\13\5\13\u0243"+ + "\n\13\3\13\3\13\3\f\3\f\7\f\u0249\n\f\f\f\16\f\u024c\13\f\3\f\3\f\3\r"+ + "\5\r\u0251\n\r\3\r\5\r\u0254\n\r\3\r\3\r\3\r\3\r\3\r\3\r\5\r\u025c\n\r"+ + "\3\16\3\16\3\16\5\16\u0261\n\16\3\16\3\16\3\16\5\16\u0266\n\16\3\16\3"+ + "\16\3\17\3\17\3\17\3\17\3\17\3\17\3\17\3\17\7\17\u0272\n\17\f\17\16\17"+ + "\u0275\13\17\5\17\u0277\n\17\3\17\3\17\3\17\5\17\u027c\n\17\3\20\3\20"+ + "\3\21\3\21\3\21\5\21\u0283\n\21\3\21\3\21\5\21\u0287\n\21\3\22\5\22\u028a"+ + "\n\22\3\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\7\23\u0294\n\23\f\23\16"+ + "\23\u0297\13\23\3\24\3\24\3\24\3\24\3\25\7\25\u029e\n\25\f\25\16\25\u02a1"+ + "\13\25\3\25\5\25\u02a4\n\25\3\25\3\25\3\25\3\25\5\25\u02aa\n\25\3\25\3"+ + "\25\3\26\7\26\u02af\n\26\f\26\16\26\u02b2\13\26\3\26\3\26\3\26\5\26\u02b7"+ + "\n\26\3\26\3\26\5\26\u02bb\n\26\3\26\3\26\3\27\3\27\3\27\3\27\3\27\3\30"+ + "\3\30\3\30\3\30\3\31\3\31\3\32\5\32\u02cb\n\32\3\32\7\32\u02ce\n\32\f"+ + "\32\16\32\u02d1\13\32\3\32\5\32\u02d4\n\32\3\32\5\32\u02d7\n\32\3\32\3"+ + "\32\3\32\3\32\5\32\u02dd\n\32\3\32\5\32\u02e0\n\32\3\33\5\33\u02e3\n\33"+ + "\3\33\5\33\u02e6\n\33\3\33\3\33\5\33\u02ea\n\33\3\33\3\33\3\33\3\33\3"+ + "\33\7\33\u02f1\n\33\f\33\16\33\u02f4\13\33\5\33\u02f6\n\33\3\33\3\33\3"+ + "\34\5\34\u02fb\n\34\3\34\3\34\5\34\u02ff\n\34\3\34\3\34\3\34\3\34\3\34"+ + "\3\35\5\35\u0307\n\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\3\35\5\35\u0311"+ + "\n\35\3\35\3\35\5\35\u0315\n\35\3\35\3\35\3\35\3\35\3\35\5\35\u031c\n"+ + "\35\3\36\3\36\5\36\u0320\n\36\3\37\5\37\u0323\n\37\3\37\3\37\3 \5 \u0328"+ + "\n \3 \3 \5 \u032c\n \3 \3 \3 \3 \5 \u0332\n \3!\3!\3!\3\"\3\"\3#\7#\u033a"+ + "\n#\f#\16#\u033d\13#\3#\3#\3#\7#\u0342\n#\f#\16#\u0345\13#\3#\3#\3$\3"+ + "$\3$\5$\u034c\n$\3%\3%\3%\7%\u0351\n%\f%\16%\u0354\13%\3&\3&\5&\u0358"+ + "\n&\3\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\5\'\u0362\n\'\3\'\5\'\u0365\n\'\3"+ + "\'\5\'\u0368\n\'\3\'\5\'\u036b\n\'\3\'\3\'\3\'\3\'\3\'\3\'\3\'\5\'\u0374"+ + "\n\'\3\'\3\'\3\'\3\'\5\'\u037a\n\'\3\'\6\'\u037d\n\'\r\'\16\'\u037e\3"+ + "\'\3\'\3\'\6\'\u0384\n\'\r\'\16\'\u0385\3\'\3\'\7\'\u038a\n\'\f\'\16\'"+ + "\u038d\13\'\3(\3(\3(\7(\u0392\n(\f(\16(\u0395\13(\3(\3(\3)\3)\3)\3)\7"+ + ")\u039d\n)\f)\16)\u03a0\13)\3)\3)\5)\u03a4\n)\3)\5)\u03a7\n)\3)\3)\3*"+ + "\3*\3*\3+\3+\3+\7+\u03b1\n+\f+\16+\u03b4\13+\3+\5+\u03b7\n+\3+\3+\3,\3"+ + ",\5,\u03bd\n,\3-\3-\3-\3-\3-\3-\5-\u03c5\n-\3.\3.\5.\u03c9\n.\3/\3/\3"+ + "\60\3\60\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3"+ + "\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3\61\3"+ + "\61\3\61\3\61\3\61\5\61\u03ed\n\61\3\62\3\62\3\62\3\62\5\62\u03f3\n\62"+ + "\3\62\3\62\5\62\u03f7\n\62\3\63\3\63\3\63\3\63\3\63\5\63\u03fe\n\63\3"+ + "\63\3\63\5\63\u0402\n\63\3\64\3\64\3\65\3\65\3\66\3\66\3\66\5\66\u040b"+ + "\n\66\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67"+ + "\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\3\67\5\67"+ + "\u0427\n\67\38\38\38\38\38\58\u042e\n8\38\38\58\u0432\n8\38\38\38\38\3"+ + "8\58\u0439\n8\39\39\39\39\79\u043f\n9\f9\169\u0442\139\59\u0444\n9\39"+ + "\39\3:\3:\3:\3:\3:\5:\u044d\n:\3:\3:\3:\7:\u0452\n:\f:\16:\u0455\13:\3"+ + ";\3;\3;\3;\3<\3<\3<\3<\3<\3<\5<\u0461\n<\3=\3=\3=\5=\u0466\n=\3=\3=\5"+ + "=\u046a\n=\3=\3=\3>\3>\3>\3>\7>\u0472\n>\f>\16>\u0475\13>\5>\u0477\n>"+ + "\3>\3>\3?\5?\u047c\n?\3?\3?\3@\3@\5@\u0482\n@\3@\3@\3A\3A\3A\7A\u0489"+ + "\nA\fA\16A\u048c\13A\3A\5A\u048f\nA\3B\3B\3B\3B\3C\3C\5C\u0497\nC\3C\3"+ + "C\3D\3D\3D\3D\3D\3E\3E\3E\3E\3E\3F\3F\3F\3F\3F\3G\3G\3G\3G\3G\3H\3H\3"+ + "H\3H\3H\3I\3I\3J\3J\3J\7J\u04b9\nJ\fJ\16J\u04bc\13J\3K\3K\7K\u04c0\nK"+ + "\fK\16K\u04c3\13K\3K\5K\u04c6\nK\3L\3L\3L\3L\7L\u04cc\nL\fL\16L\u04cf"+ + "\13L\3L\3L\3M\3M\3M\3M\3M\7M\u04d8\nM\fM\16M\u04db\13M\3M\3M\3N\3N\3N"+ + "\7N\u04e2\nN\fN\16N\u04e5\13N\3N\3N\3O\3O\3O\3O\6O\u04ed\nO\rO\16O\u04ee"+ + "\3O\3O\3P\3P\3P\3P\7P\u04f7\nP\fP\16P\u04fa\13P\3P\3P\3P\3P\3P\3P\5P\u0502"+ + "\nP\3P\3P\3P\7P\u0507\nP\fP\16P\u050a\13P\3P\3P\3P\3P\3P\5P\u0511\nP\3"+ + "P\3P\3P\7P\u0516\nP\fP\16P\u0519\13P\3P\3P\5P\u051d\nP\3Q\3Q\5Q\u0521"+ + "\nQ\3R\3R\3R\5R\u0526\nR\3S\3S\3S\3S\3S\7S\u052d\nS\fS\16S\u0530\13S\3"+ + "S\3S\5S\u0534\nS\3S\3S\3S\3S\3S\3S\5S\u053c\nS\3T\3T\3T\7T\u0541\nT\f"+ + "T\16T\u0544\13T\3T\3T\5T\u0548\nT\3T\5T\u054b\nT\3U\3U\3U\3U\3U\3U\3U"+ + "\3U\3U\3U\5U\u0557\nU\3V\3V\3V\7V\u055c\nV\fV\16V\u055f\13V\3V\3V\5V\u0563"+ + "\nV\3V\3V\3V\7V\u0568\nV\fV\16V\u056b\13V\3V\3V\5V\u056f\nV\3V\5V\u0572"+ + "\nV\3W\3W\3W\7W\u0577\nW\fW\16W\u057a\13W\3W\3W\5W\u057e\nW\3W\5W\u0581"+ + "\nW\3X\3X\3X\3Y\3Y\3Y\3Y\3Z\5Z\u058b\nZ\3Z\3Z\3[\3[\3[\3[\3\\\3\\\3\\"+ + "\3\\\7\\\u0597\n\\\f\\\16\\\u059a\13\\\3\\\3\\\5\\\u059e\n\\\3\\\5\\\u05a1"+ + "\n\\\5\\\u05a3\n\\\3\\\3\\\3]\3]\3]\3]\3^\3^\3^\7^\u05ae\n^\f^\16^\u05b1"+ + "\13^\3^\3^\5^\u05b5\n^\3^\5^\u05b8\n^\5^\u05ba\n^\3_\3_\3_\5_\u05bf\n"+ + "_\3`\3`\3`\3a\3a\3a\5a\u05c7\na\3b\3b\5b\u05cb\nb\3c\3c\3c\3c\7c\u05d1"+ + "\nc\fc\16c\u05d4\13c\3c\3c\5c\u05d8\nc\3c\5c\u05db\nc\3c\3c\3d\3d\3d\3"+ + "e\3e\3e\3e\3f\3f\3f\3f\3f\7f\u05eb\nf\ff\16f\u05ee\13f\3f\6f\u05f1\nf"+ + "\rf\16f\u05f2\5f\u05f5\nf\3f\3f\5f\u05f9\nf\3f\3f\3f\3f\3f\3f\3f\3f\3"+ + "f\3f\3f\3f\7f\u0607\nf\ff\16f\u060a\13f\3f\3f\5f\u060e\nf\3f\3f\5f\u0612"+ + "\nf\3g\3g\3g\3g\3h\3h\3h\3i\3i\3i\7i\u061e\ni\fi\16i\u0621\13i\3i\3i\5"+ + "i\u0625\ni\3i\5i\u0628\ni\5i\u062a\ni\3j\3j\3j\5j\u062f\nj\3k\3k\3k\5"+ + "k\u0634\nk\3l\3l\5l\u0638\nl\3l\3l\5l\u063c\nl\3l\3l\3l\3l\5l\u0642\n"+ + "l\3l\3l\7l\u0646\nl\fl\16l\u0649\13l\3l\3l\3m\3m\3m\3m\5m\u0651\nm\3m"+ + "\3m\3n\3n\3n\3n\7n\u0659\nn\fn\16n\u065c\13n\3n\3n\3o\3o\3o\3p\3p\3p\3"+ + "q\3q\3q\7q\u0669\nq\fq\16q\u066c\13q\3q\3q\3r\3r\3r\7r\u0673\nr\fr\16"+ + "r\u0676\13r\3r\3r\3r\3s\6s\u067c\ns\rs\16s\u067d\3s\5s\u0681\ns\3s\5s"+ + "\u0684\ns\3t\3t\3t\3t\3t\3t\3t\7t\u068d\nt\ft\16t\u0690\13t\3t\3t\3u\3"+ + "u\3u\7u\u0697\nu\fu\16u\u069a\13u\3u\3u\3v\3v\3v\3v\3w\3w\3w\3w\3x\3x"+ + "\5x\u06a8\nx\3x\3x\3y\3y\3y\3y\3y\5y\u06b1\ny\3y\3y\3z\3z\5z\u06b7\nz"+ + "\3{\3{\3|\3|\5|\u06bd\n|\3}\3}\3}\3}\7}\u06c3\n}\f}\16}\u06c6\13}\3}\3"+ + "}\3~\3~\3~\3~\5~\u06ce\n~\3\177\3\177\3\177\3\177\3\177\3\177\3\177\3"+ + "\177\5\177\u06d8\n\177\3\177\3\177\3\177\3\177\3\177\3\177\3\177\3\177"+ + "\3\177\3\177\3\177\7\177\u06e5\n\177\f\177\16\177\u06e8\13\177\3\u0080"+ + "\3\u0080\3\u0080\3\u0081\3\u0081\3\u0081\3\u0081\3\u0082\3\u0082\3\u0082"+ + "\3\u0082\3\u0082\5\u0082\u06f6\n\u0082\3\u0083\3\u0083\3\u0083\5\u0083"+ + "\u06fb\n\u0083\3\u0083\3\u0083\3\u0084\3\u0084\3\u0084\3\u0084\5\u0084"+ + "\u0703\n\u0084\3\u0084\3\u0084\3\u0085\3\u0085\3\u0085\7\u0085\u070a\n"+ + "\u0085\f\u0085\16\u0085\u070d\13\u0085\3\u0086\3\u0086\3\u0086\5\u0086"+ + "\u0712\n\u0086\3\u0087\7\u0087\u0715\n\u0087\f\u0087\16\u0087\u0718\13"+ + "\u0087\3\u0087\5\u0087\u071b\n\u0087\3\u0087\3\u0087\3\u0087\3\u0087\3"+ + "\u0088\3\u0088\3\u0088\7\u0088\u0724\n\u0088\f\u0088\16\u0088\u0727\13"+ + "\u0088\3\u0089\3\u0089\3\u0089\3\u008a\3\u008a\5\u008a\u072e\n\u008a\3"+ + "\u008a\3\u008a\3\u008b\5\u008b\u0733\n\u008b\3\u008b\5\u008b\u0736\n\u008b"+ + "\3\u008b\5\u008b\u0739\n\u008b\3\u008b\5\u008b\u073c\n\u008b\5\u008b\u073e"+ + "\n\u008b\3\u008c\3\u008c\3\u008c\5\u008c\u0743\n\u008c\3\u008c\3\u008c"+ + "\7\u008c\u0747\n\u008c\f\u008c\16\u008c\u074a\13\u008c\3\u008c\3\u008c"+ + "\3\u008d\3\u008d\3\u008e\3\u008e\3\u008e\7\u008e\u0753\n\u008e\f\u008e"+ + "\16\u008e\u0756\13\u008e\3\u008f\3\u008f\3\u008f\7\u008f\u075b\n\u008f"+ + "\f\u008f\16\u008f\u075e\13\u008f\3\u008f\3\u008f\3\u0090\3\u0090\3\u0090"+ + "\7\u0090\u0765\n\u0090\f\u0090\16\u0090\u0768\13\u0090\3\u0090\3\u0090"+ + "\3\u0091\3\u0091\3\u0091\7\u0091\u076f\n\u0091\f\u0091\16\u0091\u0772"+ + "\13\u0091\3\u0091\3\u0091\3\u0092\3\u0092\3\u0092\7\u0092\u0779\n\u0092"+ + "\f\u0092\16\u0092\u077c\13\u0092\3\u0092\3\u0092\3\u0093\3\u0093\3\u0093"+ + "\3\u0094\3\u0094\3\u0094\3\u0095\3\u0095\3\u0095\3\u0095\3\u0096\3\u0096"+ + "\3\u0097\3\u0097\3\u0097\3\u0097\5\u0097\u0790\n\u0097\3\u0097\3\u0097"+ + "\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\7\u0098"+ + "\u079c\n\u0098\f\u0098\16\u0098\u079f\13\u0098\3\u0098\5\u0098\u07a2\n"+ + "\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\6\u0098\u07b1\n\u0098\r\u0098"+ + "\16\u0098\u07b2\3\u0098\5\u0098\u07b6\n\u0098\3\u0098\5\u0098\u07b9\n"+ + "\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\3\u0098\5\u0098\u07c7\n\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\5\u0098\u07ce\n\u0098\3\u0098\3\u0098\5\u0098"+ + "\u07d2\n\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098\3\u0098"+ + "\3\u0098\3\u0098\3\u0098\7\u0098\u0802\n\u0098\f\u0098\16\u0098\u0805"+ + "\13\u0098\3\u0099\3\u0099\3\u0099\3\u0099\3\u0099\3\u0099\3\u0099\5\u0099"+ + "\u080e\n\u0099\3\u0099\3\u0099\3\u0099\3\u0099\3\u0099\3\u0099\7\u0099"+ + "\u0816\n\u0099\f\u0099\16\u0099\u0819\13\u0099\3\u009a\3\u009a\3\u009b"+ + "\3\u009b\3\u009b\5\u009b\u0820\n\u009b\3\u009b\5\u009b\u0823\n\u009b\3"+ + "\u009b\3\u009b\3\u009b\3\u009b\5\u009b\u0829\n\u009b\3\u009b\3\u009b\5"+ + "\u009b\u082d\n\u009b\3\u009c\7\u009c\u0830\n\u009c\f\u009c\16\u009c\u0833"+ + "\13\u009c\3\u009c\3\u009c\3\u009c\3\u009d\3\u009d\3\u009d\3\u009e\3\u009e"+ + "\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e\3\u009e"+ + "\3\u009e\3\u009e\3\u009e\5\u009e\u0849\n\u009e\3\u009f\3\u009f\3\u00a0"+ + "\3\u00a0\5\u00a0\u084f\n\u00a0\3\u00a0\3\u00a0\3\u00a1\3\u00a1\5\u00a1"+ + "\u0855\n\u00a1\3\u00a1\3\u00a1\3\u00a2\3\u00a2\7\u00a2\u085b\n\u00a2\f"+ + "\u00a2\16\u00a2\u085e\13\u00a2\3\u00a2\3\u00a2\3\u00a3\7\u00a3\u0863\n"+ + "\u00a3\f\u00a3\16\u00a3\u0866\13\u00a3\3\u00a3\3\u00a3\3\u00a4\3\u00a4"+ + "\3\u00a4\7\u00a4\u086d\n\u00a4\f\u00a4\16\u00a4\u0870\13\u00a4\3\u00a5"+ + "\3\u00a5\3\u00a6\3\u00a6\3\u00a6\7\u00a6\u0877\n\u00a6\f\u00a6\16\u00a6"+ + "\u087a\13\u00a6\3\u00a7\7\u00a7\u087d\n\u00a7\f\u00a7\16\u00a7\u0880\13"+ + "\u00a7\3\u00a7\5\u00a7\u0883\n\u00a7\3\u00a7\3\u00a7\3\u00a7\3\u00a8\3"+ + "\u00a8\3\u00a8\3\u00a8\3\u00a9\7\u00a9\u088d\n\u00a9\f\u00a9\16\u00a9"+ + "\u0890\13\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00a9\3\u00aa\3\u00aa\5\u00aa"+ + "\u0898\n\u00aa\3\u00aa\3\u00aa\3\u00aa\5\u00aa\u089d\n\u00aa\7\u00aa\u089f"+ + "\n\u00aa\f\u00aa\16\u00aa\u08a2\13\u00aa\3\u00aa\3\u00aa\5\u00aa\u08a6"+ + "\n\u00aa\3\u00aa\5\u00aa\u08a9\n\u00aa\3\u00ab\5\u00ab\u08ac\n\u00ab\3"+ + "\u00ab\3\u00ab\5\u00ab\u08b0\n\u00ab\3\u00ab\3\u00ab\3\u00ab\3\u00ab\3"+ + "\u00ab\3\u00ab\5\u00ab\u08b8\n\u00ab\3\u00ac\3\u00ac\3\u00ad\3\u00ad\3"+ + "\u00ae\3\u00ae\3\u00ae\3\u00af\3\u00af\3\u00b0\3\u00b0\3\u00b0\3\u00b0"+ + "\3\u00b1\3\u00b1\3\u00b1\3\u00b2\3\u00b2\3\u00b2\3\u00b2\3\u00b3\3\u00b3"+ + "\3\u00b3\3\u00b3\3\u00b3\5\u00b3\u08d3\n\u00b3\3\u00b4\5\u00b4\u08d6\n"+ + "\u00b4\3\u00b4\3\u00b4\3\u00b4\3\u00b4\5\u00b4\u08dc\n\u00b4\3\u00b4\5"+ + "\u00b4\u08df\n\u00b4\7\u00b4\u08e1\n\u00b4\f\u00b4\16\u00b4\u08e4\13\u00b4"+ + "\3\u00b5\3\u00b5\3\u00b5\3\u00b5\3\u00b5\7\u00b5\u08eb\n\u00b5\f\u00b5"+ + "\16\u00b5\u08ee\13\u00b5\3\u00b5\7\u00b5\u08f1\n\u00b5\f\u00b5\16\u00b5"+ + "\u08f4\13\u00b5\3\u00b5\3\u00b5\3\u00b6\3\u00b6\3\u00b6\3\u00b6\3\u00b6"+ + "\5\u00b6\u08fd\n\u00b6\3\u00b7\3\u00b7\3\u00b7\7\u00b7\u0902\n\u00b7\f"+ + "\u00b7\16\u00b7\u0905\13\u00b7\3\u00b7\3\u00b7\3\u00b8\3\u00b8\3\u00b8"+ + "\3\u00b8\3\u00b9\3\u00b9\3\u00b9\7\u00b9\u0910\n\u00b9\f\u00b9\16\u00b9"+ + "\u0913\13\u00b9\3\u00b9\3\u00b9\3\u00ba\3\u00ba\3\u00ba\3\u00ba\3\u00ba"+ + "\7\u00ba\u091c\n\u00ba\f\u00ba\16\u00ba\u091f\13\u00ba\3\u00ba\3\u00ba"+ + "\3\u00bb\3\u00bb\3\u00bb\3\u00bb\3\u00bc\3\u00bc\3\u00bc\3\u00bc\6\u00bc"+ + "\u092b\n\u00bc\r\u00bc\16\u00bc\u092c\3\u00bc\5\u00bc\u0930\n\u00bc\3"+ + "\u00bc\5\u00bc\u0933\n\u00bc\3\u00bd\3\u00bd\5\u00bd\u0937\n\u00bd\3\u00be"+ + "\3\u00be\3\u00be\3\u00be\3\u00be\7\u00be\u093e\n\u00be\f\u00be\16\u00be"+ + "\u0941\13\u00be\3\u00be\5\u00be\u0944\n\u00be\3\u00be\3\u00be\3\u00bf"+ + "\3\u00bf\3\u00bf\3\u00bf\3\u00bf\7\u00bf\u094d\n\u00bf\f\u00bf\16\u00bf"+ + "\u0950\13\u00bf\3\u00bf\5\u00bf\u0953\n\u00bf\3\u00bf\3\u00bf\3\u00c0"+ + "\3\u00c0\5\u00c0\u0959\n\u00c0\3\u00c0\3\u00c0\3\u00c1\3\u00c1\5\u00c1"+ + "\u095f\n\u00c1\3\u00c1\3\u00c1\3\u00c2\3\u00c2\3\u00c2\3\u00c2\6\u00c2"+ + "\u0967\n\u00c2\r\u00c2\16\u00c2\u0968\3\u00c2\5\u00c2\u096c\n\u00c2\3"+ + "\u00c2\5\u00c2\u096f\n\u00c2\3\u00c3\3\u00c3\5\u00c3\u0973\n\u00c3\3\u00c4"+ + "\3\u00c4\3\u00c5\3\u00c5\3\u00c5\5\u00c5\u097a\n\u00c5\3\u00c5\5\u00c5"+ + "\u097d\n\u00c5\3\u00c5\5\u00c5\u0980\n\u00c5\3\u00c5\5\u00c5\u0983\n\u00c5"+ + "\3\u00c6\3\u00c6\3\u00c6\6\u00c6\u0988\n\u00c6\r\u00c6\16\u00c6\u0989"+ + "\3\u00c6\3\u00c6\3\u00c7\3\u00c7\3\u00c7\5\u00c7\u0991\n\u00c7\3\u00c7"+ + "\5\u00c7\u0994\n\u00c7\3\u00c7\5\u00c7\u0997\n\u00c7\3\u00c7\5\u00c7\u099a"+ + "\n\u00c7\3\u00c7\5\u00c7\u099d\n\u00c7\3\u00c7\3\u00c7\3\u00c8\5\u00c8"+ + "\u09a2\n\u00c8\3\u00c8\3\u00c8\5\u00c8\u09a6\n\u00c8\3\u00c9\3\u00c9\3"+ + "\u00c9\3\u00c9\3\u00ca\3\u00ca\3\u00ca\3\u00ca\3\u00ca\7\u00ca\u09b1\n"+ + "\u00ca\f\u00ca\16\u00ca\u09b4\13\u00ca\3\u00cb\3\u00cb\5\u00cb\u09b8\n"+ + "\u00cb\3\u00cc\3\u00cc\3\u00cc\3\u00cd\3\u00cd\3\u00cd\5\u00cd\u09c0\n"+ + "\u00cd\3\u00cd\5\u00cd\u09c3\n\u00cd\3\u00cd\5\u00cd\u09c6\n\u00cd\3\u00ce"+ + "\3\u00ce\3\u00ce\7\u00ce\u09cb\n\u00ce\f\u00ce\16\u00ce\u09ce\13\u00ce"+ + "\3\u00cf\3\u00cf\3\u00cf\5\u00cf\u09d3\n\u00cf\3\u00d0\3\u00d0\3\u00d0"+ + "\3\u00d0\3\u00d1\3\u00d1\3\u00d1\3\u00d2\3\u00d2\3\u00d2\3\u00d2\3\u00d2"+ + "\3\u00d2\7\u00d2\u09e2\n\u00d2\f\u00d2\16\u00d2\u09e5\13\u00d2\3\u00d2"+ + "\3\u00d2\3\u00d3\3\u00d3\5\u00d3\u09eb\n\u00d3\3\u00d3\7\u00d3\u09ee\n"+ + "\u00d3\f\u00d3\16\u00d3\u09f1\13\u00d3\3\u00d3\5\u00d3\u09f4\n\u00d3\3"+ + "\u00d3\7\u00d3\u09f7\n\u00d3\f\u00d3\16\u00d3\u09fa\13\u00d3\3\u00d3\5"+ + "\u00d3\u09fd\n\u00d3\3\u00d3\3\u00d3\5\u00d3\u0a01\n\u00d3\3\u00d4\3\u00d4"+ + "\3\u00d4\3\u00d4\3\u00d4\3\u00d4\5\u00d4\u0a09\n\u00d4\3\u00d4\3\u00d4"+ + "\3\u00d4\5\u00d4\u0a0e\n\u00d4\3\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5"+ + "\3\u00d5\3\u00d5\5\u00d5\u0a17\n\u00d5\3\u00d5\3\u00d5\3\u00d5\3\u00d5"+ + "\3\u00d5\5\u00d5\u0a1e\n\u00d5\3\u00d6\3\u00d6\3\u00d6\3\u00d6\5\u00d6"+ + "\u0a24\n\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6"+ + "\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\5\u00d6\u0a33\n\u00d6"+ + "\3\u00d6\3\u00d6\3\u00d6\3\u00d6\3\u00d6\5\u00d6\u0a3a\n\u00d6\3\u00d7"+ + "\3\u00d7\5\u00d7\u0a3e\n\u00d7\3\u00d7\5\u00d7\u0a41\n\u00d7\3\u00d7\3"+ + "\u00d7\5\u00d7\u0a45\n\u00d7\3\u00d8\3\u00d8\3\u00d8\3\u00d9\3\u00d9\3"+ + "\u00d9\3\u00da\3\u00da\3\u00db\3\u00db\3\u00db\3\u00db\3\u00db\3\u00db"+ + "\3\u00db\3\u00db\3\u00db\3\u00db\3\u00db\3\u00db\5\u00db\u0a5b\n\u00db"+ + "\3\u00db\5\u00db\u0a5e\n\u00db\3\u00dc\3\u00dc\3\u00dd\6\u00dd\u0a63\n"+ + "\u00dd\r\u00dd\16\u00dd\u0a64\3\u00dd\7\u00dd\u0a68\n\u00dd\f\u00dd\16"+ + "\u00dd\u0a6b\13\u00dd\3\u00dd\5\u00dd\u0a6e\n\u00dd\3\u00de\3\u00de\3"+ + "\u00de\3\u00df\3\u00df\7\u00df\u0a75\n\u00df\f\u00df\16\u00df\u0a78\13"+ + "\u00df\3\u00e0\3\u00e0\7\u00e0\u0a7c\n\u00e0\f\u00e0\16\u00e0\u0a7f\13"+ + "\u00e0\3\u00e1\5\u00e1\u0a82\n\u00e1\3\u00e2\3\u00e2\5\u00e2\u0a86\n\u00e2"+ + "\3\u00e3\3\u00e3\5\u00e3\u0a8a\n\u00e3\3\u00e4\3\u00e4\3\u00e4\3\u00e4"+ + "\3\u00e4\3\u00e4\3\u00e4\3\u00e4\3\u00e4\6\u00e4\u0a95\n\u00e4\r\u00e4"+ + "\16\u00e4\u0a96\3\u00e5\3\u00e5\3\u00e6\3\u00e6\3\u00e6\3\u00e7\3\u00e7"+ + "\3\u00e8\3\u00e8\3\u00e8\3\u00e8\5\u00e8\u0aa4\n\u00e8\3\u00e9\3\u00e9"+ + "\5\u00e9\u0aa8\n\u00e9\3\u00ea\3\u00ea\3\u00eb\3\u00eb\3\u00eb\3\u00eb"+ + "\3\u00ec\3\u00ec\3\u00ed\3\u00ed\3\u00ed\3\u00ed\3\u00ee\3\u00ee\3\u00ef"+ + "\3\u00ef\3\u00ef\3\u00ef\3\u00f0\3\u00f0\3\u00f0\2\7Lr\u00fc\u012e\u0130"+ + "\u00f1\2\4\6\b\n\f\16\20\22\24\26\30\32\34\36 \"$&(*,.\60\62\64\668:<"+ + ">@BDFHJLNPRTVXZ\\^`bdfhjlnprtvxz|~\u0080\u0082\u0084\u0086\u0088\u008a"+ + "\u008c\u008e\u0090\u0092\u0094\u0096\u0098\u009a\u009c\u009e\u00a0\u00a2"+ + "\u00a4\u00a6\u00a8\u00aa\u00ac\u00ae\u00b0\u00b2\u00b4\u00b6\u00b8\u00ba"+ + "\u00bc\u00be\u00c0\u00c2\u00c4\u00c6\u00c8\u00ca\u00cc\u00ce\u00d0\u00d2"+ + "\u00d4\u00d6\u00d8\u00da\u00dc\u00de\u00e0\u00e2\u00e4\u00e6\u00e8\u00ea"+ + "\u00ec\u00ee\u00f0\u00f2\u00f4\u00f6\u00f8\u00fa\u00fc\u00fe\u0100\u0102"+ + "\u0104\u0106\u0108\u010a\u010c\u010e\u0110\u0112\u0114\u0116\u0118\u011a"+ + "\u011c\u011e\u0120\u0122\u0124\u0126\u0128\u012a\u012c\u012e\u0130\u0132"+ + "\u0134\u0136\u0138\u013a\u013c\u013e\u0140\u0142\u0144\u0146\u0148\u014a"+ + "\u014c\u014e\u0150\u0152\u0154\u0156\u0158\u015a\u015c\u015e\u0160\u0162"+ + "\u0164\u0166\u0168\u016a\u016c\u016e\u0170\u0172\u0174\u0176\u0178\u017a"+ + "\u017c\u017e\u0180\u0182\u0184\u0186\u0188\u018a\u018c\u018e\u0190\u0192"+ + "\u0194\u0196\u0198\u019a\u019c\u019e\u01a0\u01a2\u01a4\u01a6\u01a8\u01aa"+ + "\u01ac\u01ae\u01b0\u01b2\u01b4\u01b6\u01b8\u01ba\u01bc\u01be\u01c0\u01c2"+ + "\u01c4\u01c6\u01c8\u01ca\u01cc\u01ce\u01d0\u01d2\u01d4\u01d6\u01d8\u01da"+ + "\u01dc\u01de\2\37\4\2\u00b8\u00b8\u00bb\u00bc\3\2\5\6\4\2\n\n\23\23\4"+ + "\2\n\n\f\f\7\2\7\7\16\16\21\22\32\32WW\3\2EJ\3\2\u00ac\u00b5\4\2\u00be"+ + "\u00be\u00c2\u00c2\4\2\u0086\u0086\u0088\u0088\4\2\u0087\u0087\u0089\u0089"+ + "\4\2\u0082\u0082\u008b\u008b\4\2\u0091\u0091\u00c2\u00c2\6\2\33\33\u008f"+ + "\u0090\u0094\u0094\u00a1\u00a1\3\2\u0091\u0093\3\2\u008f\u0090\4\2\u00a7"+ + "\u00a7\u00b6\u00b6\3\2\u0097\u009a\3\2\u0095\u0096\3\2\u009d\u009e\4\2"+ + "\u009f\u00a0\u00a8\u00a8\3\2\u0091\u0092\3\2\u00ba\u00bb\3\2\u00b8\u00b9"+ + "\3\2\u00bf\u00c0\7\2KLYY]]__ww\4\2+,dd\3\2\u009b\u009c\3\2CD\3\2\65@\u0b89"+ + "\2\u01e4\3\2\2\2\4\u01f8\3\2\2\2\6\u0203\3\2\2\2\b\u0206\3\2\2\2\n\u0208"+ + "\3\2\2\2\f\u0215\3\2\2\2\16\u021d\3\2\2\2\20\u021f\3\2\2\2\22\u0227\3"+ + "\2\2\2\24\u0230\3\2\2\2\26\u0246\3\2\2\2\30\u0250\3\2\2\2\32\u025d\3\2"+ + "\2\2\34\u027b\3\2\2\2\36\u027d\3\2\2\2 \u027f\3\2\2\2\"\u0289\3\2\2\2"+ + "$\u0295\3\2\2\2&\u0298\3\2\2\2(\u029f\3\2\2\2*\u02b0\3\2\2\2,\u02be\3"+ + "\2\2\2.\u02c3\3\2\2\2\60\u02c7\3\2\2\2\62\u02ca\3\2\2\2\64\u02e2\3\2\2"+ + "\2\66\u02fa\3\2\2\28\u031b\3\2\2\2:\u031f\3\2\2\2<\u0322\3\2\2\2>\u0331"+ + "\3\2\2\2@\u0333\3\2\2\2B\u0336\3\2\2\2D\u033b\3\2\2\2F\u0348\3\2\2\2H"+ + "\u034d\3\2\2\2J\u0357\3\2\2\2L\u0373\3\2\2\2N\u038e\3\2\2\2P\u0398\3\2"+ + "\2\2R\u03aa\3\2\2\2T\u03ad\3\2\2\2V\u03bc\3\2\2\2X\u03c4\3\2\2\2Z\u03c8"+ + "\3\2\2\2\\\u03ca\3\2\2\2^\u03cc\3\2\2\2`\u03ec\3\2\2\2b\u03ee\3\2\2\2"+ + "d\u03f8\3\2\2\2f\u0403\3\2\2\2h\u0405\3\2\2\2j\u0407\3\2\2\2l\u0426\3"+ + "\2\2\2n\u0438\3\2\2\2p\u043a\3\2\2\2r\u044c\3\2\2\2t\u0456\3\2\2\2v\u0460"+ + "\3\2\2\2x\u0462\3\2\2\2z\u046d\3\2\2\2|\u047b\3\2\2\2~\u047f\3\2\2\2\u0080"+ + "\u048e\3\2\2\2\u0082\u0490\3\2\2\2\u0084\u0494\3\2\2\2\u0086\u049a\3\2"+ + "\2\2\u0088\u049f\3\2\2\2\u008a\u04a4\3\2\2\2\u008c\u04a9\3\2\2\2\u008e"+ + "\u04ae\3\2\2\2\u0090\u04b3\3\2\2\2\u0092\u04b5\3\2\2\2\u0094\u04bd\3\2"+ + "\2\2\u0096\u04c7\3\2\2\2\u0098\u04d2\3\2\2\2\u009a\u04de\3\2\2\2\u009c"+ + "\u04e8\3\2\2\2\u009e\u051c\3\2\2\2\u00a0\u0520\3\2\2\2\u00a2\u0525\3\2"+ + "\2\2\u00a4\u053b\3\2\2\2\u00a6\u054a\3\2\2\2\u00a8\u0556\3\2\2\2\u00aa"+ + "\u0571\3\2\2\2\u00ac\u0580\3\2\2\2\u00ae\u0582\3\2\2\2\u00b0\u0585\3\2"+ + "\2\2\u00b2\u058a\3\2\2\2\u00b4\u058e\3\2\2\2\u00b6\u0592\3\2\2\2\u00b8"+ + "\u05a6\3\2\2\2\u00ba\u05b9\3\2\2\2\u00bc\u05bb\3\2\2\2\u00be\u05c0\3\2"+ + "\2\2\u00c0\u05c6\3\2\2\2\u00c2\u05ca\3\2\2\2\u00c4\u05cc\3\2\2\2\u00c6"+ + "\u05de\3\2\2\2\u00c8\u05e1\3\2\2\2\u00ca\u0611\3\2\2\2\u00cc\u0613\3\2"+ + "\2\2\u00ce\u0617\3\2\2\2\u00d0\u0629\3\2\2\2\u00d2\u062b\3\2\2\2\u00d4"+ + "\u0633\3\2\2\2\u00d6\u0635\3\2\2\2\u00d8\u064c\3\2\2\2\u00da\u0654\3\2"+ + "\2\2\u00dc\u065f\3\2\2\2\u00de\u0662\3\2\2\2\u00e0\u0665\3\2\2\2\u00e2"+ + "\u066f\3\2\2\2\u00e4\u0683\3\2\2\2\u00e6\u0685\3\2\2\2\u00e8\u0693\3\2"+ + "\2\2\u00ea\u069d\3\2\2\2\u00ec\u06a1\3\2\2\2\u00ee\u06a5\3\2\2\2\u00f0"+ + "\u06ab\3\2\2\2\u00f2\u06b6\3\2\2\2\u00f4\u06b8\3\2\2\2\u00f6\u06ba\3\2"+ + "\2\2\u00f8\u06be\3\2\2\2\u00fa\u06cd\3\2\2\2\u00fc\u06d7\3\2\2\2\u00fe"+ + "\u06e9\3\2\2\2\u0100\u06ec\3\2\2\2\u0102\u06f0\3\2\2\2\u0104\u06f7\3\2"+ + "\2\2\u0106\u06fe\3\2\2\2\u0108\u0706\3\2\2\2\u010a\u0711\3\2\2\2\u010c"+ + "\u071a\3\2\2\2\u010e\u0720\3\2\2\2\u0110\u0728\3\2\2\2\u0112\u072b\3\2"+ + "\2\2\u0114\u073d\3\2\2\2\u0116\u073f\3\2\2\2\u0118\u074d\3\2\2\2\u011a"+ + "\u074f\3\2\2\2\u011c\u0757\3\2\2\2\u011e\u0761\3\2\2\2\u0120\u076b\3\2"+ + "\2\2\u0122\u0775\3\2\2\2\u0124\u077f\3\2\2\2\u0126\u0782\3\2\2\2\u0128"+ + "\u0785\3\2\2\2\u012a\u0789\3\2\2\2\u012c\u078b\3\2\2\2\u012e\u07d1\3\2"+ + "\2\2\u0130\u080d\3\2\2\2\u0132\u081a\3\2\2\2\u0134\u082c\3\2\2\2\u0136"+ + "\u0831\3\2\2\2\u0138\u0837\3\2\2\2\u013a\u0848\3\2\2\2\u013c\u084a\3\2"+ + "\2\2\u013e\u084e\3\2\2\2\u0140\u0854\3\2\2\2\u0142\u0858\3\2\2\2\u0144"+ + "\u0864\3\2\2\2\u0146\u0869\3\2\2\2\u0148\u0871\3\2\2\2\u014a\u0873\3\2"+ + "\2\2\u014c\u087e\3\2\2\2\u014e\u0887\3\2\2\2\u0150\u088e\3\2\2\2\u0152"+ + "\u08a8\3\2\2\2\u0154\u08b7\3\2\2\2\u0156\u08b9\3\2\2\2\u0158\u08bb\3\2"+ + "\2\2\u015a\u08bd\3\2\2\2\u015c\u08c0\3\2\2\2\u015e\u08c2\3\2\2\2\u0160"+ + "\u08c6\3\2\2\2\u0162\u08c9\3\2\2\2\u0164\u08d2\3\2\2\2\u0166\u08d5\3\2"+ + "\2\2\u0168\u08e5\3\2\2\2\u016a\u08fc\3\2\2\2\u016c\u08fe\3\2\2\2\u016e"+ + "\u0908\3\2\2\2\u0170\u090c\3\2\2\2\u0172\u0916\3\2\2\2\u0174\u0922\3\2"+ + "\2\2\u0176\u0932\3\2\2\2\u0178\u0936\3\2\2\2\u017a\u0938\3\2\2\2\u017c"+ + "\u0947\3\2\2\2\u017e\u0958\3\2\2\2\u0180\u095c\3\2\2\2\u0182\u096e\3\2"+ + "\2\2\u0184\u0972\3\2\2\2\u0186\u0974\3\2\2\2\u0188\u0976\3\2\2\2\u018a"+ + "\u0984\3\2\2\2\u018c\u098d\3\2\2\2\u018e\u09a1\3\2\2\2\u0190\u09a7\3\2"+ + "\2\2\u0192\u09ab\3\2\2\2\u0194\u09b5\3\2\2\2\u0196\u09b9\3\2\2\2\u0198"+ + "\u09bc\3\2\2\2\u019a\u09c7\3\2\2\2\u019c\u09cf\3\2\2\2\u019e\u09d4\3\2"+ + "\2\2\u01a0\u09d8\3\2\2\2\u01a2\u09db\3\2\2\2\u01a4\u09e8\3\2\2\2\u01a6"+ + "\u0a08\3\2\2\2\u01a8\u0a1d\3\2\2\2\u01aa\u0a39\3\2\2\2\u01ac\u0a3b\3\2"+ + "\2\2\u01ae\u0a46\3\2\2\2\u01b0\u0a49\3\2\2\2\u01b2\u0a4c\3\2\2\2\u01b4"+ + "\u0a5d\3\2\2\2\u01b6\u0a5f\3\2\2\2\u01b8\u0a62\3\2\2\2\u01ba\u0a6f\3\2"+ + "\2\2\u01bc\u0a72\3\2\2\2\u01be\u0a79\3\2\2\2\u01c0\u0a81\3\2\2\2\u01c2"+ + "\u0a83\3\2\2\2\u01c4\u0a87\3\2\2\2\u01c6\u0a94\3\2\2\2\u01c8\u0a98\3\2"+ + "\2\2\u01ca\u0a9a\3\2\2\2\u01cc\u0a9d\3\2\2\2\u01ce\u0a9f\3\2\2\2\u01d0"+ + "\u0aa5\3\2\2\2\u01d2\u0aa9\3\2\2\2\u01d4\u0aab\3\2\2\2\u01d6\u0aaf\3\2"+ + "\2\2\u01d8\u0ab1\3\2\2\2\u01da\u0ab5\3\2\2\2\u01dc\u0ab7\3\2\2\2\u01de"+ + "\u0abb\3\2\2\2\u01e0\u01e3\5\n\6\2\u01e1\u01e3\5\u012c\u0097\2\u01e2\u01e0"+ + "\3\2\2\2\u01e2\u01e1\3\2\2\2\u01e3\u01e6\3\2\2\2\u01e4\u01e2\3\2\2\2\u01e4"+ + "\u01e5\3\2\2\2\u01e5\u01f3\3\2\2\2\u01e6\u01e4\3\2\2\2\u01e7\u01e9\5\u01b8"+ + "\u00dd\2\u01e8\u01e7\3\2\2\2\u01e8\u01e9\3\2\2\2\u01e9\u01ed\3\2\2\2\u01ea"+ + "\u01ec\5j\66\2\u01eb\u01ea\3\2\2\2\u01ec\u01ef\3\2\2\2\u01ed\u01eb\3\2"+ + "\2\2\u01ed\u01ee\3\2\2\2\u01ee\u01f0\3\2\2\2\u01ef\u01ed\3\2\2\2\u01f0"+ + "\u01f2\5\16\b\2\u01f1\u01e8\3\2\2\2\u01f2\u01f5\3\2\2\2\u01f3\u01f1\3"+ + "\2\2\2\u01f3\u01f4\3\2\2\2\u01f4\u01f6\3\2\2\2\u01f5\u01f3\3\2\2\2\u01f6"+ + "\u01f7\7\2\2\3\u01f7\3\3\2\2\2\u01f8\u01fd\7\u00c2\2\2\u01f9\u01fa\7\u0082"+ + "\2\2\u01fa\u01fc\7\u00c2\2\2\u01fb\u01f9\3\2\2\2\u01fc\u01ff\3\2\2\2\u01fd"+ + "\u01fb\3\2\2\2\u01fd\u01fe\3\2\2\2\u01fe\u0201\3\2\2\2\u01ff\u01fd\3\2"+ + "\2\2\u0200\u0202\5\6\4\2\u0201\u0200\3\2\2\2\u0201\u0202\3\2\2\2\u0202"+ + "\5\3\2\2\2\u0203\u0204\7\26\2\2\u0204\u0205\5\b\5\2\u0205\7\3\2\2\2\u0206"+ + "\u0207\t\2\2\2\u0207\t\3\2\2\2\u0208\u020c\7\3\2\2\u0209\u020a\5\f\7\2"+ + "\u020a\u020b\7\u0092\2\2\u020b\u020d\3\2\2\2\u020c\u0209\3\2\2\2\u020c"+ + "\u020d\3\2\2\2\u020d\u020e\3\2\2\2\u020e\u0211\5\4\3\2\u020f\u0210\7\4"+ + "\2\2\u0210\u0212\7\u00c2\2\2\u0211\u020f\3\2\2\2\u0211\u0212\3\2\2\2\u0212"+ + "\u0213\3\2\2\2\u0213\u0214\7\u0080\2\2\u0214\13\3\2\2\2\u0215\u0216\7"+ + "\u00c2\2\2\u0216\r\3\2\2\2\u0217\u021e\5\20\t\2\u0218\u021e\5\30\r\2\u0219"+ + "\u021e\5\"\22\2\u021a\u021e\5\64\33\2\u021b\u021e\58\35\2\u021c\u021e"+ + "\5\66\34\2\u021d\u0217\3\2\2\2\u021d\u0218\3\2\2\2\u021d\u0219\3\2\2\2"+ + "\u021d\u021a\3\2\2\2\u021d\u021b\3\2\2\2\u021d\u021c\3\2\2\2\u021e\17"+ + "\3\2\2\2\u021f\u0221\7\t\2\2\u0220\u0222\7\u00c2\2\2\u0221\u0220\3\2\2"+ + "\2\u0221\u0222\3\2\2\2\u0222\u0223\3\2\2\2\u0223\u0224\7\36\2\2\u0224"+ + "\u0225\5\u010e\u0088\2\u0225\u0226\5\22\n\2\u0226\21\3\2\2\2\u0227\u022b"+ + "\7\u0084\2\2\u0228\u022a\5\62\32\2\u0229\u0228\3\2\2\2\u022a\u022d\3\2"+ + "\2\2\u022b\u0229\3\2\2\2\u022b\u022c\3\2\2\2\u022c\u022e\3\2\2\2\u022d"+ + "\u022b\3\2\2\2\u022e\u022f\7\u0085\2\2\u022f\23\3\2\2\2\u0230\u0234\7"+ + "\u0084\2\2\u0231\u0233\5l\67\2\u0232\u0231\3\2\2\2\u0233\u0236\3\2\2\2"+ + "\u0234\u0232\3\2\2\2\u0234\u0235\3\2\2\2\u0235\u0242\3\2\2\2\u0236\u0234"+ + "\3\2\2\2\u0237\u0239\5D#\2\u0238\u0237\3\2\2\2\u0239\u023a\3\2\2\2\u023a"+ + "\u0238\3\2\2\2\u023a\u023b\3\2\2\2\u023b\u023f\3\2\2\2\u023c\u023e\5l"+ + "\67\2\u023d\u023c\3\2\2\2\u023e\u0241\3\2\2\2\u023f\u023d\3\2\2\2\u023f"+ + "\u0240\3\2\2\2\u0240\u0243\3\2\2\2\u0241\u023f\3\2\2\2\u0242\u0238\3\2"+ + "\2\2\u0242\u0243\3\2\2\2\u0243\u0244\3\2\2\2\u0244\u0245\7\u0085\2\2\u0245"+ + "\25\3\2\2\2\u0246\u024a\7\u008e\2\2\u0247\u0249\5j\66\2\u0248\u0247\3"+ + "\2\2\2\u0249\u024c\3\2\2\2\u024a\u0248\3\2\2\2\u024a\u024b\3\2\2\2\u024b"+ + "\u024d\3\2\2\2\u024c\u024a\3\2\2\2\u024d\u024e\7\7\2\2\u024e\27\3\2\2"+ + "\2\u024f\u0251\t\3\2\2\u0250\u024f\3\2\2\2\u0250\u0251\3\2\2\2\u0251\u0253"+ + "\3\2\2\2\u0252\u0254\7\23\2\2\u0253\u0252\3\2\2\2\u0253\u0254\3\2\2\2"+ + "\u0254\u0255\3\2\2\2\u0255\u0256\7\13\2\2\u0256\u025b\5 \21\2\u0257\u025c"+ + "\5\24\13\2\u0258\u0259\5\26\f\2\u0259\u025a\7\u0080\2\2\u025a\u025c\3"+ + "\2\2\2\u025b\u0257\3\2\2\2\u025b\u0258\3\2\2\2\u025c\31\3\2\2\2\u025d"+ + "\u025e\7\13\2\2\u025e\u0260\7\u0086\2\2\u025f\u0261\5\u0152\u00aa\2\u0260"+ + "\u025f\3\2\2\2\u0260\u0261\3\2\2\2\u0261\u0262\3\2\2\2\u0262\u0265\7\u0087"+ + "\2\2\u0263\u0264\7\25\2\2\u0264\u0266\5\u0144\u00a3\2\u0265\u0263\3\2"+ + "\2\2\u0265\u0266\3\2\2\2\u0266\u0267\3\2\2\2\u0267\u0268\5\24\13\2\u0268"+ + "\33\3\2\2\2\u0269\u026a\5\36\20\2\u026a\u026b\7\u00a9\2\2\u026b\u026c"+ + "\5\u012e\u0098\2\u026c\u027c\3\2\2\2\u026d\u0276\7\u0086\2\2\u026e\u0273"+ + "\5\36\20\2\u026f\u0270\7\u0083\2\2\u0270\u0272\5\36\20\2\u0271\u026f\3"+ + "\2\2\2\u0272\u0275\3\2\2\2\u0273\u0271\3\2\2\2\u0273\u0274\3\2\2\2\u0274"+ + "\u0277\3\2\2\2\u0275\u0273\3\2\2\2\u0276\u026e\3\2\2\2\u0276\u0277\3\2"+ + "\2\2\u0277\u0278\3\2\2\2\u0278\u0279\7\u0087\2\2\u0279\u027a\7\u00a9\2"+ + "\2\u027a\u027c\5\u012e\u0098\2\u027b\u0269\3\2\2\2\u027b\u026d\3\2\2\2"+ + "\u027c\35\3\2\2\2\u027d\u027e\7\u00c2\2\2\u027e\37\3\2\2\2\u027f\u0280"+ + "\5\u0184\u00c3\2\u0280\u0282\7\u0086\2\2\u0281\u0283\5\u0152\u00aa\2\u0282"+ + "\u0281\3\2\2\2\u0282\u0283\3\2\2\2\u0283\u0284\3\2\2\2\u0284\u0286\7\u0087"+ + "\2\2\u0285\u0287\5\u0142\u00a2\2\u0286\u0285\3\2\2\2\u0286\u0287\3\2\2"+ + "\2\u0287!\3\2\2\2\u0288\u028a\7\5\2\2\u0289\u0288\3\2\2\2\u0289\u028a"+ + "\3\2\2\2\u028a\u028b\3\2\2\2\u028b\u028c\7S\2\2\u028c\u028d\7\u00c2\2"+ + "\2\u028d\u028e\5H%\2\u028e\u028f\7\u0080\2\2\u028f#\3\2\2\2\u0290\u0294"+ + "\5(\25\2\u0291\u0294\5\62\32\2\u0292\u0294\5&\24\2\u0293\u0290\3\2\2\2"+ + "\u0293\u0291\3\2\2\2\u0293\u0292\3\2\2\2\u0294\u0297\3\2\2\2\u0295\u0293"+ + "\3\2\2\2\u0295\u0296\3\2\2\2\u0296%\3\2\2\2\u0297\u0295\3\2\2\2\u0298"+ + "\u0299\7\u0091\2\2\u0299\u029a\5X-\2\u029a\u029b\7\u0080\2\2\u029b\'\3"+ + "\2\2\2\u029c\u029e\5j\66\2\u029d\u029c\3\2\2\2\u029e\u02a1\3\2\2\2\u029f"+ + "\u029d\3\2\2\2\u029f\u02a0\3\2\2\2\u02a0\u02a3\3\2\2\2\u02a1\u029f\3\2"+ + "\2\2\u02a2\u02a4\t\3\2\2\u02a3\u02a2\3\2\2\2\u02a3\u02a4\3\2\2\2\u02a4"+ + "\u02a5\3\2\2\2\u02a5\u02a6\5L\'\2\u02a6\u02a9\7\u00c2\2\2\u02a7\u02a8"+ + "\7\u008e\2\2\u02a8\u02aa\5\u012e\u0098\2\u02a9\u02a7\3\2\2\2\u02a9\u02aa"+ + "\3\2\2\2\u02aa\u02ab\3\2\2\2\u02ab\u02ac\7\u0080\2\2\u02ac)\3\2\2\2\u02ad"+ + "\u02af\5j\66\2\u02ae\u02ad\3\2\2\2\u02af\u02b2\3\2\2\2\u02b0\u02ae\3\2"+ + "\2\2\u02b0\u02b1\3\2\2\2\u02b1\u02b3\3\2\2\2\u02b2\u02b0\3\2\2\2\u02b3"+ + "\u02b4\5L\'\2\u02b4\u02b6\7\u00c2\2\2\u02b5\u02b7\7\u008a\2\2\u02b6\u02b5"+ + "\3\2\2\2\u02b6\u02b7\3\2\2\2\u02b7\u02ba\3\2\2\2\u02b8\u02b9\7\u008e\2"+ + "\2\u02b9\u02bb\5\u012e\u0098\2\u02ba\u02b8\3\2\2\2\u02ba\u02bb\3\2\2\2"+ + "\u02bb\u02bc\3\2\2\2\u02bc\u02bd\7\u0080\2\2\u02bd+\3\2\2\2\u02be\u02bf"+ + "\5L\'\2\u02bf\u02c0\5\60\31\2\u02c0\u02c1\7\u00a7\2\2\u02c1\u02c2\7\u0080"+ + "\2\2\u02c2-\3\2\2\2\u02c3\u02c4\7\u0094\2\2\u02c4\u02c5\5\60\31\2\u02c5"+ + "\u02c6\7\u00a7\2\2\u02c6/\3\2\2\2\u02c7\u02c8\6\31\2\2\u02c8\61\3\2\2"+ + "\2\u02c9\u02cb\5\u01b8\u00dd\2\u02ca\u02c9\3\2\2\2\u02ca\u02cb\3\2\2\2"+ + "\u02cb\u02cf\3\2\2\2\u02cc\u02ce\5j\66\2\u02cd\u02cc\3\2\2\2\u02ce\u02d1"+ + "\3\2\2\2\u02cf\u02cd\3\2\2\2\u02cf\u02d0\3\2\2\2\u02d0\u02d3\3\2\2\2\u02d1"+ + "\u02cf\3\2\2\2\u02d2\u02d4\t\3\2\2\u02d3\u02d2\3\2\2\2\u02d3\u02d4\3\2"+ + "\2\2\u02d4\u02d6\3\2\2\2\u02d5\u02d7\t\4\2\2\u02d6\u02d5\3\2\2\2\u02d6"+ + "\u02d7\3\2\2\2\u02d7\u02d8\3\2\2\2\u02d8\u02d9\7\13\2\2\u02d9\u02df\5"+ + " \21\2\u02da\u02e0\5\24\13\2\u02db\u02dd\5\26\f\2\u02dc\u02db\3\2\2\2"+ + "\u02dc\u02dd\3\2\2\2\u02dd\u02de\3\2\2\2\u02de\u02e0\7\u0080\2\2\u02df"+ + "\u02da\3\2\2\2\u02df\u02dc\3\2\2\2\u02e0\63\3\2\2\2\u02e1\u02e3\7\5\2"+ + "\2\u02e2\u02e1\3\2\2\2\u02e2\u02e3\3\2\2\2\u02e3\u02e5\3\2\2\2\u02e4\u02e6"+ + "\7\32\2\2\u02e5\u02e4\3\2\2\2\u02e5\u02e6\3\2\2\2\u02e6\u02e7\3\2\2\2"+ + "\u02e7\u02e9\7\16\2\2\u02e8\u02ea\5L\'\2\u02e9\u02e8\3\2\2\2\u02e9\u02ea"+ + "\3\2\2\2\u02ea\u02eb\3\2\2\2\u02eb\u02f5\7\u00c2\2\2\u02ec\u02ed\7\36"+ + "\2\2\u02ed\u02f2\5:\36\2\u02ee\u02ef\7\u0083\2\2\u02ef\u02f1\5:\36\2\u02f0"+ + "\u02ee\3\2\2\2\u02f1\u02f4\3\2\2\2\u02f2\u02f0\3\2\2\2\u02f2\u02f3\3\2"+ + "\2\2\u02f3\u02f6\3\2\2\2\u02f4\u02f2\3\2\2\2\u02f5\u02ec\3\2\2\2\u02f5"+ + "\u02f6\3\2\2\2\u02f6\u02f7\3\2\2\2\u02f7\u02f8\7\u0080\2\2\u02f8\65\3"+ + "\2\2\2\u02f9\u02fb\7\5\2\2\u02fa\u02f9\3\2\2\2\u02fa\u02fb\3\2\2\2\u02fb"+ + "\u02fc\3\2\2\2\u02fc\u02fe\7\32\2\2\u02fd\u02ff\5L\'\2\u02fe\u02fd\3\2"+ + "\2\2\u02fe\u02ff\3\2\2\2\u02ff\u0300\3\2\2\2\u0300\u0301\7\u00c2\2\2\u0301"+ + "\u0302\7\u008e\2\2\u0302\u0303\5\u0130\u0099\2\u0303\u0304\7\u0080\2\2"+ + "\u0304\67\3\2\2\2\u0305\u0307\7\5\2\2\u0306\u0305\3\2\2\2\u0306\u0307"+ + "\3\2\2\2\u0307\u0308\3\2\2\2\u0308\u0309\7\22\2\2\u0309\u030a\5L\'\2\u030a"+ + "\u030b\7\u00c2\2\2\u030b\u030c\7\u008e\2\2\u030c\u030d\5\u012e\u0098\2"+ + "\u030d\u030e\7\u0080\2\2\u030e\u031c\3\2\2\2\u030f\u0311\7\b\2\2\u0310"+ + "\u030f\3\2\2\2\u0310\u0311\3\2\2\2\u0311\u0314\3\2\2\2\u0312\u0315\5L"+ + "\'\2\u0313\u0315\7W\2\2\u0314\u0312\3\2\2\2\u0314\u0313\3\2\2\2\u0315"+ + "\u0316\3\2\2\2\u0316\u0317\7\u00c2\2\2\u0317\u0318\7\u008e\2\2\u0318\u0319"+ + "\5\u012e\u0098\2\u0319\u031a\7\u0080\2\2\u031a\u031c\3\2\2\2\u031b\u0306"+ + "\3\2\2\2\u031b\u0310\3\2\2\2\u031c9\3\2\2\2\u031d\u0320\5<\37\2\u031e"+ + "\u0320\5@!\2\u031f\u031d\3\2\2\2\u031f\u031e\3\2\2\2\u0320;\3\2\2\2\u0321"+ + "\u0323\7\34\2\2\u0322\u0321\3\2\2\2\u0322\u0323\3\2\2\2\u0323\u0324\3"+ + "\2\2\2\u0324\u0325\5> \2\u0325=\3\2\2\2\u0326\u0328\7\f\2\2\u0327\u0326"+ + "\3\2\2\2\u0327\u0328\3\2\2\2\u0328\u0329\3\2\2\2\u0329\u0332\7S\2\2\u032a"+ + "\u032c\t\5\2\2\u032b\u032a\3\2\2\2\u032b\u032c\3\2\2\2\u032c\u032d\3\2"+ + "\2\2\u032d\u0332\7\13\2\2\u032e\u0332\7\17\2\2\u032f\u0332\7k\2\2\u0330"+ + "\u0332\7\t\2\2\u0331\u0327\3\2\2\2\u0331\u032b\3\2\2\2\u0331\u032e\3\2"+ + "\2\2\u0331\u032f\3\2\2\2\u0331\u0330\3\2\2\2\u0332?\3\2\2\2\u0333\u0334"+ + "\7\34\2\2\u0334\u0335\5B\"\2\u0335A\3\2\2\2\u0336\u0337\t\6\2\2\u0337"+ + "C\3\2\2\2\u0338\u033a\5j\66\2\u0339\u0338\3\2\2\2\u033a\u033d\3\2\2\2"+ + "\u033b\u0339\3\2\2\2\u033b\u033c\3\2\2\2\u033c\u033e\3\2\2\2\u033d\u033b"+ + "\3\2\2\2\u033e\u033f\5F$\2\u033f\u0343\7\u0084\2\2\u0340\u0342\5l\67\2"+ + "\u0341\u0340\3\2\2\2\u0342\u0345\3\2\2\2\u0343\u0341\3\2\2\2\u0343\u0344"+ + "\3\2\2\2\u0344\u0346\3\2\2\2\u0345\u0343\3\2\2\2\u0346\u0347\7\u0085\2"+ + "\2\u0347E\3\2\2\2\u0348\u0349\7\21\2\2\u0349\u034b\7\u00c2\2\2\u034a\u034c"+ + "\5\u0142\u00a2\2\u034b\u034a\3\2\2\2\u034b\u034c\3\2\2\2\u034cG\3\2\2"+ + "\2\u034d\u0352\5J&\2\u034e\u034f\7\u00a8\2\2\u034f\u0351\5J&\2\u0350\u034e"+ + "\3\2\2\2\u0351\u0354\3\2\2\2\u0352\u0350\3\2\2\2\u0352\u0353\3\2\2\2\u0353"+ + "I\3\2\2\2\u0354\u0352\3\2\2\2\u0355\u0358\5\u0154\u00ab\2\u0356\u0358"+ + "\5L\'\2\u0357\u0355\3\2\2\2\u0357\u0356\3\2\2\2\u0358K\3\2\2\2\u0359\u035a"+ + "\b\'\1\2\u035a\u0374\5X-\2\u035b\u035c\7\u0086\2\2\u035c\u035d\5L\'\2"+ + "\u035d\u035e\7\u0087\2\2\u035e\u0374\3\2\2\2\u035f\u0374\5P)\2\u0360\u0362"+ + "\7\30\2\2\u0361\u0360\3\2\2\2\u0361\u0362\3\2\2\2\u0362\u0364\3\2\2\2"+ + "\u0363\u0365\7\31\2\2\u0364\u0363\3\2\2\2\u0364\u0365\3\2\2\2\u0365\u036b"+ + "\3\2\2\2\u0366\u0368\7\31\2\2\u0367\u0366\3\2\2\2\u0367\u0368\3\2\2\2"+ + "\u0368\u0369\3\2\2\2\u0369\u036b\7\30\2\2\u036a\u0361\3\2\2\2\u036a\u0367"+ + "\3\2\2\2\u036b\u036c\3\2\2\2\u036c\u036d\7\f\2\2\u036d\u036e\7\u0084\2"+ + "\2\u036e\u036f\5$\23\2\u036f\u0370\7\u0085\2\2\u0370\u0374\3\2\2\2\u0371"+ + "\u0374\5N(\2\u0372\u0374\5T+\2\u0373\u0359\3\2\2\2\u0373\u035b\3\2\2\2"+ + "\u0373\u035f\3\2\2\2\u0373\u036a\3\2\2\2\u0373\u0371\3\2\2\2\u0373\u0372"+ + "\3\2\2\2\u0374\u038b\3\2\2\2\u0375\u037c\f\n\2\2\u0376\u0379\7\u0088\2"+ + "\2\u0377\u037a\5\u0158\u00ad\2\u0378\u037a\7\u0091\2\2\u0379\u0377\3\2"+ + "\2\2\u0379\u0378\3\2\2\2\u0379\u037a\3\2\2\2\u037a\u037b\3\2\2\2\u037b"+ + "\u037d\7\u0089\2\2\u037c\u0376\3\2\2\2\u037d\u037e\3\2\2\2\u037e\u037c"+ + "\3\2\2\2\u037e\u037f\3\2\2\2\u037f\u038a\3\2\2\2\u0380\u0383\f\t\2\2\u0381"+ + "\u0382\7\u00a8\2\2\u0382\u0384\5L\'\2\u0383\u0381\3\2\2\2\u0384\u0385"+ + "\3\2\2\2\u0385\u0383\3\2\2\2\u0385\u0386\3\2\2\2\u0386\u038a\3\2\2\2\u0387"+ + "\u0388\f\b\2\2\u0388\u038a\7\u008a\2\2\u0389\u0375\3\2\2\2\u0389\u0380"+ + "\3\2\2\2\u0389\u0387\3\2\2\2\u038a\u038d\3\2\2\2\u038b\u0389\3\2\2\2\u038b"+ + "\u038c\3\2\2\2\u038cM\3\2\2\2\u038d\u038b\3\2\2\2\u038e\u038f\7\r\2\2"+ + "\u038f\u0393\7\u0084\2\2\u0390\u0392\5V,\2\u0391\u0390\3\2\2\2\u0392\u0395"+ + "\3\2\2\2\u0393\u0391\3\2\2\2\u0393\u0394\3\2\2\2\u0394\u0396\3\2\2\2\u0395"+ + "\u0393\3\2\2\2\u0396\u0397\7\u0085\2\2\u0397O\3\2\2\2\u0398\u03a6\7\u0088"+ + "\2\2\u0399\u039e\5L\'\2\u039a\u039b\7\u0083\2\2\u039b\u039d\5L\'\2\u039c"+ + "\u039a\3\2\2\2\u039d\u03a0\3\2\2\2\u039e\u039c\3\2\2\2\u039e\u039f\3\2"+ + "\2\2\u039f\u03a3\3\2\2\2\u03a0\u039e\3\2\2\2\u03a1\u03a2\7\u0083\2\2\u03a2"+ + "\u03a4\5R*\2\u03a3\u03a1\3\2\2\2\u03a3\u03a4\3\2\2\2\u03a4\u03a7\3\2\2"+ + "\2\u03a5\u03a7\5R*\2\u03a6\u0399\3\2\2\2\u03a6\u03a5\3\2\2\2\u03a7\u03a8"+ + "\3\2\2\2\u03a8\u03a9\7\u0089\2\2\u03a9Q\3\2\2\2\u03aa\u03ab\5L\'\2\u03ab"+ + "\u03ac\7\u00a7\2\2\u03acS\3\2\2\2\u03ad\u03ae\7\r\2\2\u03ae\u03b2\7\u008c"+ + "\2\2\u03af\u03b1\5V,\2\u03b0\u03af\3\2\2\2\u03b1\u03b4\3\2\2\2\u03b2\u03b0"+ + "\3\2\2\2\u03b2\u03b3\3\2\2\2\u03b3\u03b6\3\2\2\2\u03b4\u03b2\3\2\2\2\u03b5"+ + "\u03b7\5,\27\2\u03b6\u03b5\3\2\2\2\u03b6\u03b7\3\2\2\2\u03b7\u03b8\3\2"+ + "\2\2\u03b8\u03b9\7\u008d\2\2\u03b9U\3\2\2\2\u03ba\u03bd\5*\26\2\u03bb"+ + "\u03bd\5&\24\2\u03bc\u03ba\3\2\2\2\u03bc\u03bb\3\2\2\2\u03bdW\3\2\2\2"+ + "\u03be\u03c5\7Q\2\2\u03bf\u03c5\7U\2\2\u03c0\u03c5\7V\2\2\u03c1\u03c5"+ + "\5^\60\2\u03c2\u03c5\5Z.\2\u03c3\u03c5\5\u015a\u00ae\2\u03c4\u03be\3\2"+ + "\2\2\u03c4\u03bf\3\2\2\2\u03c4\u03c0\3\2\2\2\u03c4\u03c1\3\2\2\2\u03c4"+ + "\u03c2\3\2\2\2\u03c4\u03c3\3\2\2\2\u03c5Y\3\2\2\2\u03c6\u03c9\5`\61\2"+ + "\u03c7\u03c9\5\\/\2\u03c8\u03c6\3\2\2\2\u03c8\u03c7\3\2\2\2\u03c9[\3\2"+ + "\2\2\u03ca\u03cb\5\u013e\u00a0\2\u03cb]\3\2\2\2\u03cc\u03cd\t\7\2\2\u03cd"+ + "_\3\2\2\2\u03ce\u03cf\7L\2\2\u03cf\u03d0\7\u0098\2\2\u03d0\u03d1\5L\'"+ + "\2\u03d1\u03d2\7\u0097\2\2\u03d2\u03ed\3\2\2\2\u03d3\u03d4\7T\2\2\u03d4"+ + "\u03d5\7\u0098\2\2\u03d5\u03d6\5L\'\2\u03d6\u03d7\7\u0097\2\2\u03d7\u03ed"+ + "\3\2\2\2\u03d8\u03ed\7N\2\2\u03d9\u03ed\7M\2\2\u03da\u03db\7O\2\2\u03db"+ + "\u03dc\7\u0098\2\2\u03dc\u03dd\5L\'\2\u03dd\u03de\7\u0097\2\2\u03de\u03ed"+ + "\3\2\2\2\u03df\u03e0\7P\2\2\u03e0\u03e1\7\u0098\2\2\u03e1\u03e2\5L\'\2"+ + "\u03e2\u03e3\7\u0097\2\2\u03e3\u03ed\3\2\2\2\u03e4\u03e5\7R\2\2\u03e5"+ + "\u03e6\7\u0098\2\2\u03e6\u03e7\5L\'\2\u03e7\u03e8\7\u0097\2\2\u03e8\u03ed"+ + "\3\2\2\2\u03e9\u03ed\7\t\2\2\u03ea\u03ed\5d\63\2\u03eb\u03ed\5b\62\2\u03ec"+ + "\u03ce\3\2\2\2\u03ec\u03d3\3\2\2\2\u03ec\u03d8\3\2\2\2\u03ec\u03d9\3\2"+ + "\2\2\u03ec\u03da\3\2\2\2\u03ec\u03df\3\2\2\2\u03ec\u03e4\3\2\2\2\u03ec"+ + "\u03e9\3\2\2\2\u03ec\u03ea\3\2\2\2\u03ec\u03eb\3\2\2\2\u03eda\3\2\2\2"+ + "\u03ee\u03ef\7\13\2\2\u03ef\u03f2\7\u0086\2\2\u03f0\u03f3\5\u014a\u00a6"+ + "\2\u03f1\u03f3\5\u0146\u00a4\2\u03f2\u03f0\3\2\2\2\u03f2\u03f1\3\2\2\2"+ + "\u03f2\u03f3\3\2\2\2\u03f3\u03f4\3\2\2\2\u03f4\u03f6\7\u0087\2\2\u03f5"+ + "\u03f7\5\u0142\u00a2\2\u03f6\u03f5\3\2\2\2\u03f6\u03f7\3\2\2\2\u03f7c"+ + "\3\2\2\2\u03f8\u0401\7K\2\2\u03f9\u03fa\7\u0098\2\2\u03fa\u03fd\5L\'\2"+ + "\u03fb\u03fc\7\u0083\2\2\u03fc\u03fe\5L\'\2\u03fd\u03fb\3\2\2\2\u03fd"+ + "\u03fe\3\2\2\2\u03fe\u03ff\3\2\2\2\u03ff\u0400\7\u0097\2\2\u0400\u0402"+ + "\3\2\2\2\u0401\u03f9\3\2\2\2\u0401\u0402\3\2\2\2\u0402e\3\2\2\2\u0403"+ + "\u0404\7\u00be\2\2\u0404g\3\2\2\2\u0405\u0406\7\u00c2\2\2\u0406i\3\2\2"+ + "\2\u0407\u0408\7\u00a4\2\2\u0408\u040a\5\u013e\u00a0\2\u0409\u040b\5p"+ + "9\2\u040a\u0409\3\2\2\2\u040a\u040b\3\2\2\2\u040bk\3\2\2\2\u040c\u0427"+ + "\5\u008cG\2\u040d\u0427\5\u0086D\2\u040e\u0427\5n8\2\u040f\u0427\5\u0088"+ + "E\2\u0410\u0427\5\u008aF\2\u0411\u0427\5\u008eH\2\u0412\u0427\5\u0094"+ + "K\2\u0413\u0427\5\u009cO\2\u0414\u0427\5\u00d6l\2\u0415\u0427\5\u00da"+ + "n\2\u0416\u0427\5\u00dco\2\u0417\u0427\5\u00dep\2\u0418\u0427\5\u00e0"+ + "q\2\u0419\u0427\5\u00e2r\2\u041a\u0427\5\u00eav\2\u041b\u0427\5\u00ec"+ + "w\2\u041c\u0427\5\u00eex\2\u041d\u0427\5\u00f0y\2\u041e\u0427\5\u0110"+ + "\u0089\2\u041f\u0427\5\u0112\u008a\2\u0420\u0427\5\u0124\u0093\2\u0421"+ + "\u0427\5\u0126\u0094\2\u0422\u0427\5\u011c\u008f\2\u0423\u0427\5\u012a"+ + "\u0096\2\u0424\u0427\5\u018a\u00c6\2\u0425\u0427\5\u018c\u00c7\2\u0426"+ + "\u040c\3\2\2\2\u0426\u040d\3\2\2\2\u0426\u040e\3\2\2\2\u0426\u040f\3\2"+ + "\2\2\u0426\u0410\3\2\2\2\u0426\u0411\3\2\2\2\u0426\u0412\3\2\2\2\u0426"+ + "\u0413\3\2\2\2\u0426\u0414\3\2\2\2\u0426\u0415\3\2\2\2\u0426\u0416\3\2"+ + "\2\2\u0426\u0417\3\2\2\2\u0426\u0418\3\2\2\2\u0426\u0419\3\2\2\2\u0426"+ + "\u041a\3\2\2\2\u0426\u041b\3\2\2\2\u0426\u041c\3\2\2\2\u0426\u041d\3\2"+ + "\2\2\u0426\u041e\3\2\2\2\u0426\u041f\3\2\2\2\u0426\u0420\3\2\2\2\u0426"+ + "\u0421\3\2\2\2\u0426\u0422\3\2\2\2\u0426\u0423\3\2\2\2\u0426\u0424\3\2"+ + "\2\2\u0426\u0425\3\2\2\2\u0427m\3\2\2\2\u0428\u0429\5L\'\2\u0429\u042a"+ + "\7\u00c2\2\2\u042a\u042b\7\u0080\2\2\u042b\u0439\3\2\2\2\u042c\u042e\7"+ + "\b\2\2\u042d\u042c\3\2\2\2\u042d\u042e\3\2\2\2\u042e\u0431\3\2\2\2\u042f"+ + "\u0432\5L\'\2\u0430\u0432\7W\2\2\u0431\u042f\3\2\2\2\u0431\u0430\3\2\2"+ + "\2\u0432\u0433\3\2\2\2\u0433\u0434\5\u00a0Q\2\u0434\u0435\7\u008e\2\2"+ + "\u0435\u0436\5\u012e\u0098\2\u0436\u0437\7\u0080\2\2\u0437\u0439\3\2\2"+ + "\2\u0438\u0428\3\2\2\2\u0438\u042d\3\2\2\2\u0439o\3\2\2\2\u043a\u0443"+ + "\7\u0084\2\2\u043b\u0440\5t;\2\u043c\u043d\7\u0083\2\2\u043d\u043f\5t"+ + ";\2\u043e\u043c\3\2\2\2\u043f\u0442\3\2\2\2\u0440\u043e\3\2\2\2\u0440"+ + "\u0441\3\2\2\2\u0441\u0444\3\2\2\2\u0442\u0440\3\2\2\2\u0443\u043b\3\2"+ + "\2\2\u0443\u0444\3\2\2\2\u0444\u0445\3\2\2\2\u0445\u0446\7\u0085\2\2\u0446"+ + "q\3\2\2\2\u0447\u0448\b:\1\2\u0448\u044d\5\u0154\u00ab\2\u0449\u044d\5"+ + "p9\2\u044a\u044d\5\u0084C\2\u044b\u044d\7\u00c2\2\2\u044c\u0447\3\2\2"+ + "\2\u044c\u0449\3\2\2\2\u044c\u044a\3\2\2\2\u044c\u044b\3\2\2\2\u044d\u0453"+ + "\3\2\2\2\u044e\u044f\f\3\2\2\u044f\u0450\7\u00a8\2\2\u0450\u0452\5r:\4"+ + "\u0451\u044e\3\2\2\2\u0452\u0455\3\2\2\2\u0453\u0451\3\2\2\2\u0453\u0454"+ + "\3\2\2\2\u0454s\3\2\2\2\u0455\u0453\3\2\2\2\u0456\u0457\5v<\2\u0457\u0458"+ + "\7\u0081\2\2\u0458\u0459\5\u012e\u0098\2\u0459u\3\2\2\2\u045a\u0461\7"+ + "\u00c2\2\2\u045b\u045c\7\u0088\2\2\u045c\u045d\5\u012e\u0098\2\u045d\u045e"+ + "\7\u0089\2\2\u045e\u0461\3\2\2\2\u045f\u0461\5\u012e\u0098\2\u0460\u045a"+ + "\3\2\2\2\u0460\u045b\3\2\2\2\u0460\u045f\3\2\2\2\u0461w\3\2\2\2\u0462"+ + "\u0463\7O\2\2\u0463\u0465\7\u0084\2\2\u0464\u0466\5z>\2\u0465\u0464\3"+ + "\2\2\2\u0465\u0466\3\2\2\2\u0466\u0469\3\2\2\2\u0467\u0468\7\u0083\2\2"+ + "\u0468\u046a\5~@\2\u0469\u0467\3\2\2\2\u0469\u046a\3\2\2\2\u046a\u046b"+ + "\3\2\2\2\u046b\u046c\7\u0085\2\2\u046cy\3\2\2\2\u046d\u0476\7\u0084\2"+ + "\2\u046e\u0473\5|?\2\u046f\u0470\7\u0083\2\2\u0470\u0472\5|?\2\u0471\u046f"+ + "\3\2\2\2\u0472\u0475\3\2\2\2\u0473\u0471\3\2\2\2\u0473\u0474\3\2\2\2\u0474"+ + "\u0477\3\2\2\2\u0475\u0473\3\2\2\2\u0476\u046e\3\2\2\2\u0476\u0477\3\2"+ + "\2\2\u0477\u0478\3\2\2\2\u0478\u0479\7\u0085\2\2\u0479{\3\2\2\2\u047a"+ + "\u047c\7\u00c2\2\2\u047b\u047a\3\2\2\2\u047b\u047c\3\2\2\2\u047c\u047d"+ + "\3\2\2\2\u047d\u047e\7\u00c2\2\2\u047e}\3\2\2\2\u047f\u0481\7\u0088\2"+ + "\2\u0480\u0482\5\u0080A\2\u0481\u0480\3\2\2\2\u0481\u0482\3\2\2\2\u0482"+ + "\u0483\3\2\2\2\u0483\u0484\7\u0089\2\2\u0484\177\3\2\2\2\u0485\u048a\5"+ + "\u0082B\2\u0486\u0487\7\u0083\2\2\u0487\u0489\5\u0082B\2\u0488\u0486\3"+ + "\2\2\2\u0489\u048c\3\2\2\2\u048a\u0488\3\2\2\2\u048a\u048b\3\2\2\2\u048b"+ + "\u048f\3\2\2\2\u048c\u048a\3\2\2\2\u048d\u048f\5\u010e\u0088\2\u048e\u0485"+ + "\3\2\2\2\u048e\u048d\3\2\2\2\u048f\u0081\3\2\2\2\u0490\u0491\7\u0084\2"+ + "\2\u0491\u0492\5\u010e\u0088\2\u0492\u0493\7\u0085\2\2\u0493\u0083\3\2"+ + "\2\2\u0494\u0496\7\u0088\2\2\u0495\u0497\5\u010e\u0088\2\u0496\u0495\3"+ + "\2\2\2\u0496\u0497\3\2\2\2\u0497\u0498\3\2\2\2\u0498\u0499\7\u0089\2\2"+ + "\u0499\u0085\3\2\2\2\u049a\u049b\5\u00fc\177\2\u049b\u049c\7\u008e\2\2"+ + "\u049c\u049d\5\u012e\u0098\2\u049d\u049e\7\u0080\2\2\u049e\u0087\3\2\2"+ + "\2\u049f\u04a0\5\u00c4c\2\u04a0\u04a1\7\u008e\2\2\u04a1\u04a2\5\u012e"+ + "\u0098\2\u04a2\u04a3\7\u0080\2\2\u04a3\u0089\3\2\2\2\u04a4\u04a5\5\u00c8"+ + "e\2\u04a5\u04a6\7\u008e\2\2\u04a6\u04a7\5\u012e\u0098\2\u04a7\u04a8\7"+ + "\u0080\2\2\u04a8\u008b\3\2\2\2\u04a9\u04aa\5\u00caf\2\u04aa\u04ab\7\u008e"+ + "\2\2\u04ab\u04ac\5\u012e\u0098\2\u04ac\u04ad\7\u0080\2\2\u04ad\u008d\3"+ + "\2\2\2\u04ae\u04af\5\u00fc\177\2\u04af\u04b0\5\u0090I\2\u04b0\u04b1\5"+ + "\u012e\u0098\2\u04b1\u04b2\7\u0080\2\2\u04b2\u008f\3\2\2\2\u04b3\u04b4"+ + "\t\b\2\2\u04b4\u0091\3\2\2\2\u04b5\u04ba\5\u00fc\177\2\u04b6\u04b7\7\u0083"+ + "\2\2\u04b7\u04b9\5\u00fc\177\2\u04b8\u04b6\3\2\2\2\u04b9\u04bc\3\2\2\2"+ + "\u04ba\u04b8\3\2\2\2\u04ba\u04bb\3\2\2\2\u04bb\u0093\3\2\2\2\u04bc\u04ba"+ + "\3\2\2\2\u04bd\u04c1\5\u0096L\2\u04be\u04c0\5\u0098M\2\u04bf\u04be\3\2"+ + "\2\2\u04c0\u04c3\3\2\2\2\u04c1\u04bf\3\2\2\2\u04c1\u04c2\3\2\2\2\u04c2"+ + "\u04c5\3\2\2\2\u04c3\u04c1\3\2\2\2\u04c4\u04c6\5\u009aN\2\u04c5\u04c4"+ + "\3\2\2\2\u04c5\u04c6\3\2\2\2\u04c6\u0095\3\2\2\2\u04c7\u04c8\7Z\2\2\u04c8"+ + "\u04c9\5\u012e\u0098\2\u04c9\u04cd\7\u0084\2\2\u04ca\u04cc\5l\67\2\u04cb"+ + "\u04ca\3\2\2\2\u04cc\u04cf\3\2\2\2\u04cd\u04cb\3\2\2\2\u04cd\u04ce\3\2"+ + "\2\2\u04ce\u04d0\3\2\2\2\u04cf\u04cd\3\2\2\2\u04d0\u04d1\7\u0085\2\2\u04d1"+ + "\u0097\3\2\2\2\u04d2\u04d3\7\\\2\2\u04d3\u04d4\7Z\2\2\u04d4\u04d5\5\u012e"+ + "\u0098\2\u04d5\u04d9\7\u0084\2\2\u04d6\u04d8\5l\67\2\u04d7\u04d6\3\2\2"+ + "\2\u04d8\u04db\3\2\2\2\u04d9\u04d7\3\2\2\2\u04d9\u04da\3\2\2\2\u04da\u04dc"+ + "\3\2\2\2\u04db\u04d9\3\2\2\2\u04dc\u04dd\7\u0085\2\2\u04dd\u0099\3\2\2"+ + "\2\u04de\u04df\7\\\2\2\u04df\u04e3\7\u0084\2\2\u04e0\u04e2\5l\67\2\u04e1"+ + "\u04e0\3\2\2\2\u04e2\u04e5\3\2\2\2\u04e3\u04e1\3\2\2\2\u04e3\u04e4\3\2"+ + "\2\2\u04e4\u04e6\3\2\2\2\u04e5\u04e3\3\2\2\2\u04e6\u04e7\7\u0085\2\2\u04e7"+ + "\u009b\3\2\2\2\u04e8\u04e9\7[\2\2\u04e9\u04ea\5\u012e\u0098\2\u04ea\u04ec"+ + "\7\u0084\2\2\u04eb\u04ed\5\u009eP\2\u04ec\u04eb\3\2\2\2\u04ed\u04ee\3"+ + "\2\2\2\u04ee\u04ec\3\2\2\2\u04ee\u04ef\3\2\2\2\u04ef\u04f0\3\2\2\2\u04f0"+ + "\u04f1\7\u0085\2\2\u04f1\u009d\3\2\2\2\u04f2\u04f3\5r:\2\u04f3\u04f4\7"+ + "\u00a9\2\2\u04f4\u04f8\7\u0084\2\2\u04f5\u04f7\5l\67\2\u04f6\u04f5\3\2"+ + "\2\2\u04f7\u04fa\3\2\2\2\u04f8\u04f6\3\2\2\2\u04f8\u04f9\3\2\2\2\u04f9"+ + "\u04fb\3\2\2\2\u04fa\u04f8\3\2\2\2\u04fb\u04fc\7\u0085\2\2\u04fc\u051d"+ + "\3\2\2\2\u04fd\u04fe\7W\2\2\u04fe\u0501\5\u00a0Q\2\u04ff\u0500\7Z\2\2"+ + "\u0500\u0502\5\u012e\u0098\2\u0501\u04ff\3\2\2\2\u0501\u0502\3\2\2\2\u0502"+ + "\u0503\3\2\2\2\u0503\u0504\7\u00a9\2\2\u0504\u0508\7\u0084\2\2\u0505\u0507"+ + "\5l\67\2\u0506\u0505\3\2\2\2\u0507\u050a\3\2\2\2\u0508\u0506\3\2\2\2\u0508"+ + "\u0509\3\2\2\2\u0509\u050b\3\2\2\2\u050a\u0508\3\2\2\2\u050b\u050c\7\u0085"+ + "\2\2\u050c\u051d\3\2\2\2\u050d\u0510\5\u00a8U\2\u050e\u050f\7Z\2\2\u050f"+ + "\u0511\5\u012e\u0098\2\u0510\u050e\3\2\2\2\u0510\u0511\3\2\2\2\u0511\u0512"+ + "\3\2\2\2\u0512\u0513\7\u00a9\2\2\u0513\u0517\7\u0084\2\2\u0514\u0516\5"+ + "l\67\2\u0515\u0514\3\2\2\2\u0516\u0519\3\2\2\2\u0517\u0515\3\2\2\2\u0517"+ + "\u0518\3\2\2\2\u0518\u051a\3\2\2\2\u0519\u0517\3\2\2\2\u051a\u051b\7\u0085"+ + "\2\2\u051b\u051d\3\2\2\2\u051c\u04f2\3\2\2\2\u051c\u04fd\3\2\2\2\u051c"+ + "\u050d\3\2\2\2\u051d\u009f\3\2\2\2\u051e\u0521\7\u00c2\2\2\u051f\u0521"+ + "\5\u00a2R\2\u0520\u051e\3\2\2\2\u0520\u051f\3\2\2\2\u0521\u00a1\3\2\2"+ + "\2\u0522\u0526\5\u00b6\\\2\u0523\u0526\5\u00b8]\2\u0524\u0526\5\u00a4"+ + "S\2\u0525\u0522\3\2\2\2\u0525\u0523\3\2\2\2\u0525\u0524\3\2\2\2\u0526"+ + "\u00a3\3\2\2\2\u0527\u0528\7K\2\2\u0528\u0529\7\u0086\2\2\u0529\u052e"+ + "\7\u00c2\2\2\u052a\u052b\7\u0083\2\2\u052b\u052d\5\u00b4[\2\u052c\u052a"+ + "\3\2\2\2\u052d\u0530\3\2\2\2\u052e\u052c\3\2\2\2\u052e\u052f\3\2\2\2\u052f"+ + "\u0533\3\2\2\2\u0530\u052e\3\2\2\2\u0531\u0532\7\u0083\2\2\u0532\u0534"+ + "\5\u00aeX\2\u0533\u0531\3\2\2\2\u0533\u0534\3\2\2\2\u0534\u0535\3\2\2"+ + "\2\u0535\u053c\7\u0087\2\2\u0536\u0537\5L\'\2\u0537\u0538\7\u0086\2\2"+ + "\u0538\u0539\5\u00a6T\2\u0539\u053a\7\u0087\2\2\u053a\u053c\3\2\2\2\u053b"+ + "\u0527\3\2\2\2\u053b\u0536\3\2\2\2\u053c\u00a5\3\2\2\2\u053d\u0542\5\u00b4"+ + "[\2\u053e\u053f\7\u0083\2\2\u053f\u0541\5\u00b4[\2\u0540\u053e\3\2\2\2"+ + "\u0541\u0544\3\2\2\2\u0542\u0540\3\2\2\2\u0542\u0543\3\2\2\2\u0543\u0547"+ + "\3\2\2\2\u0544\u0542\3\2\2\2\u0545\u0546\7\u0083\2\2\u0546\u0548\5\u00ae"+ + "X\2\u0547\u0545\3\2\2\2\u0547\u0548\3\2\2\2\u0548\u054b\3\2\2\2\u0549"+ + "\u054b\5\u00aeX\2\u054a\u053d\3\2\2\2\u054a\u0549\3\2\2\2\u054b\u00a7"+ + "\3\2\2\2\u054c\u054d\7K\2\2\u054d\u054e\7\u0086\2\2\u054e\u054f\5\u00aa"+ + "V\2\u054f\u0550\7\u0087\2\2\u0550\u0557\3\2\2\2\u0551\u0552\5L\'\2\u0552"+ + "\u0553\7\u0086\2\2\u0553\u0554\5\u00acW\2\u0554\u0555\7\u0087\2\2\u0555"+ + "\u0557\3\2\2\2\u0556\u054c\3\2\2\2\u0556\u0551\3\2\2\2\u0557\u00a9\3\2"+ + "\2\2\u0558\u055d\5\u00b2Z\2\u0559\u055a\7\u0083\2\2\u055a\u055c\5\u00b4"+ + "[\2\u055b\u0559\3\2\2\2\u055c\u055f\3\2\2\2\u055d\u055b\3\2\2\2\u055d"+ + "\u055e\3\2\2\2\u055e\u0562\3\2\2\2\u055f\u055d\3\2\2\2\u0560\u0561\7\u0083"+ + "\2\2\u0561\u0563\5\u00b0Y\2\u0562\u0560\3\2\2\2\u0562\u0563\3\2\2\2\u0563"+ + "\u0572\3\2\2\2\u0564\u0569\5\u00b4[\2\u0565\u0566\7\u0083\2\2\u0566\u0568"+ + "\5\u00b4[\2\u0567\u0565\3\2\2\2\u0568\u056b\3\2\2\2\u0569\u0567\3\2\2"+ + "\2\u0569\u056a\3\2\2\2\u056a\u056e\3\2\2\2\u056b\u0569\3\2\2\2\u056c\u056d"+ + "\7\u0083\2\2\u056d\u056f\5\u00b0Y\2\u056e\u056c\3\2\2\2\u056e\u056f\3"+ + "\2\2\2\u056f\u0572\3\2\2\2\u0570\u0572\5\u00b0Y\2\u0571\u0558\3\2\2\2"+ + "\u0571\u0564\3\2\2\2\u0571\u0570\3\2\2\2\u0572\u00ab\3\2\2\2\u0573\u0578"+ + "\5\u00b4[\2\u0574\u0575\7\u0083\2\2\u0575\u0577\5\u00b4[\2\u0576\u0574"+ + "\3\2\2\2\u0577\u057a\3\2\2\2\u0578\u0576\3\2\2\2\u0578\u0579\3\2\2\2\u0579"+ + "\u057d\3\2\2\2\u057a\u0578\3\2\2\2\u057b\u057c\7\u0083\2\2\u057c\u057e"+ + "\5\u00b0Y\2\u057d\u057b\3\2\2\2\u057d\u057e\3\2\2\2\u057e\u0581\3\2\2"+ + "\2\u057f\u0581\5\u00b0Y\2\u0580\u0573\3\2\2\2\u0580\u057f\3\2\2\2\u0581"+ + "\u00ad\3\2\2\2\u0582\u0583\7\u00a7\2\2\u0583\u0584\7\u00c2\2\2\u0584\u00af"+ + "\3\2\2\2\u0585\u0586\7\u00a7\2\2\u0586\u0587\7W\2\2\u0587\u0588\7\u00c2"+ + "\2\2\u0588\u00b1\3\2\2\2\u0589\u058b\7W\2\2\u058a\u0589\3\2\2\2\u058a"+ + "\u058b\3\2\2\2\u058b\u058c\3\2\2\2\u058c\u058d\t\t\2\2\u058d\u00b3\3\2"+ + "\2\2\u058e\u058f\7\u00c2\2\2\u058f\u0590\7\u008e\2\2\u0590\u0591\5\u00a0"+ + "Q\2\u0591\u00b5\3\2\2\2\u0592\u05a2\7\u0088\2\2\u0593\u0598\5\u00a0Q\2"+ + "\u0594\u0595\7\u0083\2\2\u0595\u0597\5\u00a0Q\2\u0596\u0594\3\2\2\2\u0597"+ + "\u059a\3\2\2\2\u0598\u0596\3\2\2\2\u0598\u0599\3\2\2\2\u0599\u059d\3\2"+ + "\2\2\u059a\u0598\3\2\2\2\u059b\u059c\7\u0083\2\2\u059c\u059e\5\u00be`"+ + "\2\u059d\u059b\3\2\2\2\u059d\u059e\3\2\2\2\u059e\u05a3\3\2\2\2\u059f\u05a1"+ + "\5\u00be`\2\u05a0\u059f\3\2\2\2\u05a0\u05a1\3\2\2\2\u05a1\u05a3\3\2\2"+ + "\2\u05a2\u0593\3\2\2\2\u05a2\u05a0\3\2\2\2\u05a3\u05a4\3\2\2\2\u05a4\u05a5"+ + "\7\u0089\2\2\u05a5\u00b7\3\2\2\2\u05a6\u05a7\7\u0084\2\2\u05a7\u05a8\5"+ + "\u00ba^\2\u05a8\u05a9\7\u0085\2\2\u05a9\u00b9\3\2\2\2\u05aa\u05af\5\u00bc"+ + "_\2\u05ab\u05ac\7\u0083\2\2\u05ac\u05ae\5\u00bc_\2\u05ad\u05ab\3\2\2\2"+ + "\u05ae\u05b1\3\2\2\2\u05af\u05ad\3\2\2\2\u05af\u05b0\3\2\2\2\u05b0\u05b4"+ + "\3\2\2\2\u05b1\u05af\3\2\2\2\u05b2\u05b3\7\u0083\2\2\u05b3\u05b5\5\u00be"+ + "`\2\u05b4\u05b2\3\2\2\2\u05b4\u05b5\3\2\2\2\u05b5\u05ba\3\2\2\2\u05b6"+ + "\u05b8\5\u00be`\2\u05b7\u05b6\3\2\2\2\u05b7\u05b8\3\2\2\2\u05b8\u05ba"+ + "\3\2\2\2\u05b9\u05aa\3\2\2\2\u05b9\u05b7\3\2\2\2\u05ba\u00bb\3\2\2\2\u05bb"+ + "\u05be\7\u00c2\2\2\u05bc\u05bd\7\u0081\2\2\u05bd\u05bf\5\u00a0Q\2\u05be"+ + "\u05bc\3\2\2\2\u05be\u05bf\3\2\2\2\u05bf\u00bd\3\2\2\2\u05c0\u05c1\7\u00a7"+ + "\2\2\u05c1\u05c2\7\u00c2\2\2\u05c2\u00bf\3\2\2\2\u05c3\u05c7\5\u00caf"+ + "\2\u05c4\u05c7\5\u00fc\177\2\u05c5\u05c7\5\u00c2b\2\u05c6\u05c3\3\2\2"+ + "\2\u05c6\u05c4\3\2\2\2\u05c6\u05c5\3\2\2\2\u05c7\u00c1\3\2\2\2\u05c8\u05cb"+ + "\5\u00c4c\2\u05c9\u05cb\5\u00c8e\2\u05ca\u05c8\3\2\2\2\u05ca\u05c9\3\2"+ + "\2\2\u05cb\u00c3\3\2\2\2\u05cc\u05da\7\u0088\2\2\u05cd\u05d2\5\u00c0a"+ + "\2\u05ce\u05cf\7\u0083\2\2\u05cf\u05d1\5\u00c0a\2\u05d0\u05ce\3\2\2\2"+ + "\u05d1\u05d4\3\2\2\2\u05d2\u05d0\3\2\2\2\u05d2\u05d3\3\2\2\2\u05d3\u05d7"+ + "\3\2\2\2\u05d4\u05d2\3\2\2\2\u05d5\u05d6\7\u0083\2\2\u05d6\u05d8\5\u00c6"+ + "d\2\u05d7\u05d5\3\2\2\2\u05d7\u05d8\3\2\2\2\u05d8\u05db\3\2\2\2\u05d9"+ + "\u05db\5\u00c6d\2\u05da\u05cd\3\2\2\2\u05da\u05d9\3\2\2\2\u05db\u05dc"+ + "\3\2\2\2\u05dc\u05dd\7\u0089\2\2\u05dd\u00c5\3\2\2\2\u05de\u05df\7\u00a7"+ + "\2\2\u05df\u05e0\5\u00fc\177\2\u05e0\u00c7\3\2\2\2\u05e1\u05e2\7\u0084"+ + "\2\2\u05e2\u05e3\5\u00d0i\2\u05e3\u05e4\7\u0085\2\2\u05e4\u00c9\3\2\2"+ + "\2\u05e5\u05e6\7K\2\2\u05e6\u05f4\7\u0086\2\2\u05e7\u05ec\5\u00fc\177"+ + "\2\u05e8\u05e9\7\u0083\2\2\u05e9\u05eb\5\u00ccg\2\u05ea\u05e8\3\2\2\2"+ + "\u05eb\u05ee\3\2\2\2\u05ec\u05ea\3\2\2\2\u05ec\u05ed\3\2\2\2\u05ed\u05f5"+ + "\3\2\2\2\u05ee\u05ec\3\2\2\2\u05ef\u05f1\5\u00ccg\2\u05f0\u05ef\3\2\2"+ + "\2\u05f1\u05f2\3\2\2\2\u05f2\u05f0\3\2\2\2\u05f2\u05f3\3\2\2\2\u05f3\u05f5"+ + "\3\2\2\2\u05f4\u05e7\3\2\2\2\u05f4\u05f0\3\2\2\2\u05f5\u05f8\3\2\2\2\u05f6"+ + "\u05f7\7\u0083\2\2\u05f7\u05f9\5\u00ceh\2\u05f8\u05f6\3\2\2\2\u05f8\u05f9"+ + "\3\2\2\2\u05f9\u05fa\3\2\2\2\u05fa\u05fb\7\u0087\2\2\u05fb\u0612\3\2\2"+ + "\2\u05fc\u05fd\7K\2\2\u05fd\u05fe\7\u0086\2\2\u05fe\u05ff\5\u00ceh\2\u05ff"+ + "\u0600\7\u0087\2\2\u0600\u0612\3\2\2\2\u0601\u0602\5L\'\2\u0602\u0603"+ + "\7\u0086\2\2\u0603\u0608\5\u00ccg\2\u0604\u0605\7\u0083\2\2\u0605\u0607"+ + "\5\u00ccg\2\u0606\u0604\3\2\2\2\u0607\u060a\3\2\2\2\u0608\u0606\3\2\2"+ + "\2\u0608\u0609\3\2\2\2\u0609\u060d\3\2\2\2\u060a\u0608\3\2\2\2\u060b\u060c"+ + "\7\u0083\2\2\u060c\u060e\5\u00ceh\2\u060d\u060b\3\2\2\2\u060d\u060e\3"+ + "\2\2\2\u060e\u060f\3\2\2\2\u060f\u0610\7\u0087\2\2\u0610\u0612\3\2\2\2"+ + "\u0611\u05e5\3\2\2\2\u0611\u05fc\3\2\2\2\u0611\u0601\3\2\2\2\u0612\u00cb"+ + "\3\2\2\2\u0613\u0614\7\u00c2\2\2\u0614\u0615\7\u008e\2\2\u0615\u0616\5"+ + "\u00c0a\2\u0616\u00cd\3\2\2\2\u0617\u0618\7\u00a7\2\2\u0618\u0619\5\u00fc"+ + "\177\2\u0619\u00cf\3\2\2\2\u061a\u061f\5\u00d2j\2\u061b\u061c\7\u0083"+ + "\2\2\u061c\u061e\5\u00d2j\2\u061d\u061b\3\2\2\2\u061e\u0621\3\2\2\2\u061f"+ + "\u061d\3\2\2\2\u061f\u0620\3\2\2\2\u0620\u0624\3\2\2\2\u0621\u061f\3\2"+ + "\2\2\u0622\u0623\7\u0083\2\2\u0623\u0625\5\u00d4k\2\u0624\u0622\3\2\2"+ + "\2\u0624\u0625\3\2\2\2\u0625\u062a\3\2\2\2\u0626\u0628\5\u00d4k\2\u0627"+ + "\u0626\3\2\2\2\u0627\u0628\3\2\2\2\u0628\u062a\3\2\2\2\u0629\u061a\3\2"+ + "\2\2\u0629\u0627\3\2\2\2\u062a\u00d1\3\2\2\2\u062b\u062e\7\u00c2\2\2\u062c"+ + "\u062d\7\u0081\2\2\u062d\u062f\5\u00c0a\2\u062e\u062c\3\2\2\2\u062e\u062f"+ + "\3\2\2\2\u062f\u00d3\3\2\2\2\u0630\u0631\7\u00a7\2\2\u0631\u0634\5\u00fc"+ + "\177\2\u0632\u0634\5.\30\2\u0633\u0630\3\2\2\2\u0633\u0632\3\2\2\2\u0634"+ + "\u00d5\3\2\2\2\u0635\u0637\7]\2\2\u0636\u0638\7\u0086\2\2\u0637\u0636"+ + "\3\2\2\2\u0637\u0638\3\2\2\2\u0638\u063b\3\2\2\2\u0639\u063c\5L\'\2\u063a"+ + "\u063c\7W\2\2\u063b\u0639\3\2\2\2\u063b\u063a\3\2\2\2\u063c\u063d\3\2"+ + "\2\2\u063d\u063e\5\u00a0Q\2\u063e\u063f\7t\2\2\u063f\u0641\5\u012e\u0098"+ + "\2\u0640\u0642\7\u0087\2\2\u0641\u0640\3\2\2\2\u0641\u0642\3\2\2\2\u0642"+ + "\u0643\3\2\2\2\u0643\u0647\7\u0084\2\2\u0644\u0646\5l\67\2\u0645\u0644"+ + "\3\2\2\2\u0646\u0649\3\2\2\2\u0647\u0645\3\2\2\2\u0647\u0648\3\2\2\2\u0648"+ + "\u064a\3\2\2\2\u0649\u0647\3\2\2\2\u064a\u064b\7\u0085\2\2\u064b\u00d7"+ + "\3\2\2\2\u064c\u064d\t\n\2\2\u064d\u064e\5\u012e\u0098\2\u064e\u0650\7"+ + "\u00a6\2\2\u064f\u0651\5\u012e\u0098\2\u0650\u064f\3\2\2\2\u0650\u0651"+ + "\3\2\2\2\u0651\u0652\3\2\2\2\u0652\u0653\t\13\2\2\u0653\u00d9\3\2\2\2"+ + "\u0654\u0655\7^\2\2\u0655\u0656\5\u012e\u0098\2\u0656\u065a\7\u0084\2"+ + "\2\u0657\u0659\5l\67\2\u0658\u0657\3\2\2\2\u0659\u065c\3\2\2\2\u065a\u0658"+ + "\3\2\2\2\u065a\u065b\3\2\2\2\u065b\u065d\3\2\2\2\u065c\u065a\3\2\2\2\u065d"+ + "\u065e\7\u0085\2\2\u065e\u00db\3\2\2\2\u065f\u0660\7_\2\2\u0660\u0661"+ + "\7\u0080\2\2\u0661\u00dd\3\2\2\2\u0662\u0663\7`\2\2\u0663\u0664\7\u0080"+ + "\2\2\u0664\u00df\3\2\2\2\u0665\u0666\7a\2\2\u0666\u066a\7\u0084\2\2\u0667"+ + "\u0669\5D#\2\u0668\u0667\3\2\2\2\u0669\u066c\3\2\2\2\u066a\u0668\3\2\2"+ + "\2\u066a\u066b\3\2\2\2\u066b\u066d\3\2\2\2\u066c\u066a\3\2\2\2\u066d\u066e"+ + "\7\u0085\2\2\u066e\u00e1\3\2\2\2\u066f\u0670\7e\2\2\u0670\u0674\7\u0084"+ + "\2\2\u0671\u0673\5l\67\2\u0672\u0671\3\2\2\2\u0673\u0676\3\2\2\2\u0674"+ + "\u0672\3\2\2\2\u0674\u0675\3\2\2\2\u0675\u0677\3\2\2\2\u0676\u0674\3\2"+ + "\2\2\u0677\u0678\7\u0085\2\2\u0678\u0679\5\u00e4s\2\u0679\u00e3\3\2\2"+ + "\2\u067a\u067c\5\u00e6t\2\u067b\u067a\3\2\2\2\u067c\u067d\3\2\2\2\u067d"+ + "\u067b\3\2\2\2\u067d\u067e\3\2\2\2\u067e\u0680\3\2\2\2\u067f\u0681\5\u00e8"+ + "u\2\u0680\u067f\3\2\2\2\u0680\u0681\3\2\2\2\u0681\u0684\3\2\2\2\u0682"+ + "\u0684\5\u00e8u\2\u0683\u067b\3\2\2\2\u0683\u0682\3\2\2\2\u0684\u00e5"+ + "\3\2\2\2\u0685\u0686\7f\2\2\u0686\u0687\7\u0086\2\2\u0687\u0688\5L\'\2"+ + "\u0688\u0689\7\u00c2\2\2\u0689\u068a\7\u0087\2\2\u068a\u068e\7\u0084\2"+ + "\2\u068b\u068d\5l\67\2\u068c\u068b\3\2\2\2\u068d\u0690\3\2\2\2\u068e\u068c"+ + "\3\2\2\2\u068e\u068f\3\2\2\2\u068f\u0691\3\2\2\2\u0690\u068e\3\2\2\2\u0691"+ + "\u0692\7\u0085\2\2\u0692\u00e7\3\2\2\2\u0693\u0694\7g\2\2\u0694\u0698"+ + "\7\u0084\2\2\u0695\u0697\5l\67\2\u0696\u0695\3\2\2\2\u0697\u069a\3\2\2"+ + "\2\u0698\u0696\3\2\2\2\u0698\u0699\3\2\2\2\u0699\u069b\3\2\2\2\u069a\u0698"+ + "\3\2\2\2\u069b\u069c\7\u0085\2\2\u069c\u00e9\3\2\2\2\u069d\u069e\7h\2"+ + "\2\u069e\u069f\5\u012e\u0098\2\u069f\u06a0\7\u0080\2\2\u06a0\u00eb\3\2"+ + "\2\2\u06a1\u06a2\7i\2\2\u06a2\u06a3\5\u012e\u0098\2\u06a3\u06a4\7\u0080"+ + "\2\2\u06a4\u00ed\3\2\2\2\u06a5\u06a7\7k\2\2\u06a6\u06a8\5\u012e\u0098"+ + "\2\u06a7\u06a6\3\2\2\2\u06a7\u06a8\3\2\2\2\u06a8\u06a9\3\2\2\2\u06a9\u06aa"+ + "\7\u0080\2\2\u06aa\u00ef\3\2\2\2\u06ab\u06ac\5\u012e\u0098\2\u06ac\u06ad"+ + "\7\u00a2\2\2\u06ad\u06b0\5\u00f2z\2\u06ae\u06af\7\u0083\2\2\u06af\u06b1"+ + "\5\u012e\u0098\2\u06b0\u06ae\3\2\2\2\u06b0\u06b1\3\2\2\2\u06b1\u06b2\3"+ + "\2\2\2\u06b2\u06b3\7\u0080\2\2\u06b3\u00f1\3\2\2\2\u06b4\u06b7\5\u00f4"+ + "{\2\u06b5\u06b7\7\177\2\2\u06b6\u06b4\3\2\2\2\u06b6\u06b5\3\2\2\2\u06b7"+ + "\u00f3\3\2\2\2\u06b8\u06b9\7\u00c2\2\2\u06b9\u00f5\3\2\2\2\u06ba\u06bc"+ + "\7}\2\2\u06bb\u06bd\7\u00c2\2\2\u06bc\u06bb\3\2\2\2\u06bc\u06bd\3\2\2"+ + "\2\u06bd\u00f7\3\2\2\2\u06be\u06bf\7\u0084\2\2\u06bf\u06c4\5\u00fa~\2"+ + "\u06c0\u06c1\7\u0083\2\2\u06c1\u06c3\5\u00fa~\2\u06c2\u06c0\3\2\2\2\u06c3"+ + "\u06c6\3\2\2\2\u06c4\u06c2\3\2\2\2\u06c4\u06c5\3\2\2\2\u06c5\u06c7\3\2"+ + "\2\2\u06c6\u06c4\3\2\2\2\u06c7\u06c8\7\u0085\2\2\u06c8\u00f9\3\2\2\2\u06c9"+ + "\u06ce\7\u00c2\2\2\u06ca\u06cb\7\u00c2\2\2\u06cb\u06cc\7\u0081\2\2\u06cc"+ + "\u06ce\5\u012e\u0098\2\u06cd\u06c9\3\2\2\2\u06cd\u06ca\3\2\2\2\u06ce\u00fb"+ + "\3\2\2\2\u06cf\u06d0\b\177\1\2\u06d0\u06d8\5\u013e\u00a0\2\u06d1\u06d8"+ + "\5\u0104\u0083\2\u06d2\u06d3\5\u0132\u009a\2\u06d3\u06d4\5\u0106\u0084"+ + "\2\u06d4\u06d8\3\2\2\2\u06d5\u06d6\7\u00be\2\2\u06d6\u06d8\5\u0106\u0084"+ + "\2\u06d7\u06cf\3\2\2\2\u06d7\u06d1\3\2\2\2\u06d7\u06d2\3\2\2\2\u06d7\u06d5"+ + "\3\2\2\2\u06d8\u06e6\3\2\2\2\u06d9\u06da\f\n\2\2\u06da\u06e5\5\u00fe\u0080"+ + "\2\u06db\u06dc\f\t\2\2\u06dc\u06dd\7\u00b7\2\2\u06dd\u06e5\5\u013e\u00a0"+ + "\2\u06de\u06df\f\b\2\2\u06df\u06e5\5\u0102\u0082\2\u06e0\u06e1\f\4\2\2"+ + "\u06e1\u06e5\5\u0106\u0084\2\u06e2\u06e3\f\3\2\2\u06e3\u06e5\5\u0100\u0081"+ + "\2\u06e4\u06d9\3\2\2\2\u06e4\u06db\3\2\2\2\u06e4\u06de\3\2\2\2\u06e4\u06e0"+ + "\3\2\2\2\u06e4\u06e2\3\2\2\2\u06e5\u06e8\3\2\2\2\u06e6\u06e4\3\2\2\2\u06e6"+ + "\u06e7\3\2\2\2\u06e7\u00fd\3\2\2\2\u06e8\u06e6\3\2\2\2\u06e9\u06ea\t\f"+ + "\2\2\u06ea\u06eb\t\r\2\2\u06eb\u00ff\3\2\2\2\u06ec\u06ed\7\u0088\2\2\u06ed"+ + "\u06ee\5\u012e\u0098\2\u06ee\u06ef\7\u0089\2\2\u06ef\u0101\3\2\2\2\u06f0"+ + "\u06f5\7\u00a4\2\2\u06f1\u06f2\7\u0088\2\2\u06f2\u06f3\5\u012e\u0098\2"+ + "\u06f3\u06f4\7\u0089\2\2\u06f4\u06f6\3\2\2\2\u06f5\u06f1\3\2\2\2\u06f5"+ + "\u06f6\3\2\2\2\u06f6\u0103\3\2\2\2\u06f7\u06f8\5\u0140\u00a1\2\u06f8\u06fa"+ + "\7\u0086\2\2\u06f9\u06fb\5\u0108\u0085\2\u06fa\u06f9\3\2\2\2\u06fa\u06fb"+ + "\3\2\2\2\u06fb\u06fc\3\2\2\2\u06fc\u06fd\7\u0087\2\2\u06fd\u0105\3\2\2"+ + "\2\u06fe\u06ff\7\u0082\2\2\u06ff\u0700\5\u0184\u00c3\2\u0700\u0702\7\u0086"+ + "\2\2\u0701\u0703\5\u0108\u0085\2\u0702\u0701\3\2\2\2\u0702\u0703\3\2\2"+ + "\2\u0703\u0704\3\2\2\2\u0704\u0705\7\u0087\2\2\u0705\u0107\3\2\2\2\u0706"+ + "\u070b\5\u010a\u0086\2\u0707\u0708\7\u0083\2\2\u0708\u070a\5\u010a\u0086"+ + "\2\u0709\u0707\3\2\2\2\u070a\u070d\3\2\2\2\u070b\u0709\3\2\2\2\u070b\u070c"+ + "\3\2\2\2\u070c\u0109\3\2\2\2\u070d\u070b\3\2\2\2\u070e\u0712\5\u012e\u0098"+ + "\2\u070f\u0712\5\u015e\u00b0\2\u0710\u0712\5\u0160\u00b1\2\u0711\u070e"+ + "\3\2\2\2\u0711\u070f\3\2\2\2\u0711\u0710\3\2\2\2\u0712\u010b\3\2\2\2\u0713"+ + "\u0715\5j\66\2\u0714\u0713\3\2\2\2\u0715\u0718\3\2\2\2\u0716\u0714\3\2"+ + "\2\2\u0716\u0717\3\2\2\2\u0717\u0719\3\2\2\2\u0718\u0716\3\2\2\2\u0719"+ + "\u071b\7w\2\2\u071a\u0716\3\2\2\2\u071a\u071b\3\2\2\2\u071b\u071c\3\2"+ + "\2\2\u071c\u071d\5\u00fc\177\2\u071d\u071e\7\u00a2\2\2\u071e\u071f\5\u0104"+ + "\u0083\2\u071f\u010d\3\2\2\2\u0720\u0725\5\u012e\u0098\2\u0721\u0722\7"+ + "\u0083\2\2\u0722\u0724\5\u012e\u0098\2\u0723\u0721\3\2\2\2\u0724\u0727"+ + "\3\2\2\2\u0725\u0723\3\2\2\2\u0725\u0726\3\2\2\2\u0726\u010f\3\2\2\2\u0727"+ + "\u0725\3\2\2\2\u0728\u0729\5\u012e\u0098\2\u0729\u072a\7\u0080\2\2\u072a"+ + "\u0111\3\2\2\2\u072b\u072d\5\u0116\u008c\2\u072c\u072e\5\u011e\u0090\2"+ + "\u072d\u072c\3\2\2\2\u072d\u072e\3\2\2\2\u072e\u072f\3\2\2\2\u072f\u0730"+ + "\5\u0114\u008b\2\u0730\u0113\3\2\2\2\u0731\u0733\5\u0120\u0091\2\u0732"+ + "\u0731\3\2\2\2\u0732\u0733\3\2\2\2\u0733\u0735\3\2\2\2\u0734\u0736\5\u0122"+ + "\u0092\2\u0735\u0734\3\2\2\2\u0735\u0736\3\2\2\2\u0736\u073e\3\2\2\2\u0737"+ + "\u0739\5\u0122\u0092\2\u0738\u0737\3\2\2\2\u0738\u0739\3\2\2\2\u0739\u073b"+ + "\3\2\2\2\u073a\u073c\5\u0120\u0091\2\u073b\u073a\3\2\2\2\u073b\u073c\3"+ + "\2\2\2\u073c\u073e\3\2\2\2\u073d\u0732\3\2\2\2\u073d\u0738\3\2\2\2\u073e"+ + "\u0115\3\2\2\2\u073f\u0742\7l\2\2\u0740\u0741\7s\2\2\u0741\u0743\5\u011a"+ + "\u008e\2\u0742\u0740\3\2\2\2\u0742\u0743\3\2\2\2\u0743\u0744\3\2\2\2\u0744"+ + "\u0748\7\u0084\2\2\u0745\u0747\5l\67\2\u0746\u0745\3\2\2\2\u0747\u074a"+ + "\3\2\2\2\u0748\u0746\3\2\2\2\u0748\u0749\3\2\2\2\u0749\u074b\3\2\2\2\u074a"+ + "\u0748\3\2\2\2\u074b\u074c\7\u0085\2\2\u074c\u0117\3\2\2\2\u074d\u074e"+ + "\5\u0128\u0095\2\u074e\u0119\3\2\2\2\u074f\u0754\5\u0118\u008d\2\u0750"+ + "\u0751\7\u0083\2\2\u0751\u0753\5\u0118\u008d\2\u0752\u0750\3\2\2\2\u0753"+ + "\u0756\3\2\2\2\u0754\u0752\3\2\2\2\u0754\u0755\3\2\2\2\u0755\u011b\3\2"+ + "\2\2\u0756\u0754\3\2\2\2\u0757\u0758\7u\2\2\u0758\u075c\7\u0084\2\2\u0759"+ + "\u075b\5l\67\2\u075a\u0759\3\2\2\2\u075b\u075e\3\2\2\2\u075c\u075a\3\2"+ + "\2\2\u075c\u075d\3\2\2\2\u075d\u075f\3\2\2\2\u075e\u075c\3\2\2\2\u075f"+ + "\u0760\7\u0085\2\2\u0760\u011d\3\2\2\2\u0761\u0762\7o\2\2\u0762\u0766"+ + "\7\u0084\2\2\u0763\u0765\5l\67\2\u0764\u0763\3\2\2\2\u0765\u0768\3\2\2"+ + "\2\u0766\u0764\3\2\2\2\u0766\u0767\3\2\2\2\u0767\u0769\3\2\2\2\u0768\u0766"+ + "\3\2\2\2\u0769\u076a\7\u0085\2\2\u076a\u011f\3\2\2\2\u076b\u076c\7q\2"+ + "\2\u076c\u0770\7\u0084\2\2\u076d\u076f\5l\67\2\u076e\u076d\3\2\2\2\u076f"+ + "\u0772\3\2\2\2\u0770\u076e\3\2\2\2\u0770\u0771\3\2\2\2\u0771\u0773\3\2"+ + "\2\2\u0772\u0770\3\2\2\2\u0773\u0774\7\u0085\2\2\u0774\u0121\3\2\2\2\u0775"+ + "\u0776\7r\2\2\u0776\u077a\7\u0084\2\2\u0777\u0779\5l\67\2\u0778\u0777"+ + "\3\2\2\2\u0779\u077c\3\2\2\2\u077a\u0778\3\2\2\2\u077a\u077b\3\2\2\2\u077b"+ + "\u077d\3\2\2\2\u077c\u077a\3\2\2\2\u077d\u077e\7\u0085\2\2\u077e\u0123"+ + "\3\2\2\2\u077f\u0780\7m\2\2\u0780\u0781\7\u0080\2\2\u0781\u0125\3\2\2"+ + "\2\u0782\u0783\7n\2\2\u0783\u0784\7\u0080\2\2\u0784\u0127\3\2\2\2\u0785"+ + "\u0786\7p\2\2\u0786\u0787\7\u008e\2\2\u0787\u0788\5\u012e\u0098\2\u0788"+ + "\u0129\3\2\2\2\u0789\u078a\5\u012c\u0097\2\u078a\u012b\3\2\2\2\u078b\u078c"+ + "\7\24\2\2\u078c\u078f\7\u00be\2\2\u078d\u078e\7\4\2\2\u078e\u0790\7\u00c2"+ + "\2\2\u078f\u078d\3\2\2\2\u078f\u0790\3\2\2\2\u0790\u0791\3\2\2\2\u0791"+ + "\u0792\7\u0080\2\2\u0792\u012d\3\2\2\2\u0793\u0794\b\u0098\1\2\u0794\u07d2"+ + "\5\u0154\u00ab\2\u0795\u07d2\5\u0084C\2\u0796\u07d2\5p9\2\u0797\u07d2"+ + "\5\u0162\u00b2\2\u0798\u07d2\5x=\2\u0799\u07d2\5\u0180\u00c1\2\u079a\u079c"+ + "\5j\66\2\u079b\u079a\3\2\2\2\u079c\u079f\3\2\2\2\u079d\u079b\3\2\2\2\u079d"+ + "\u079e\3\2\2\2\u079e\u07a0\3\2\2\2\u079f\u079d\3\2\2\2\u07a0\u07a2\7w"+ + "\2\2\u07a1\u079d\3\2\2\2\u07a1\u07a2\3\2\2\2\u07a2\u07a3\3\2\2\2\u07a3"+ + "\u07d2\5\u00fc\177\2\u07a4\u07d2\5\u010c\u0087\2\u07a5\u07d2\5\u0134\u009b"+ + "\2\u07a6\u07d2\5\u0136\u009c\2\u07a7\u07d2\5\u0188\u00c5\2\u07a8\u07a9"+ + "\7y\2\2\u07a9\u07d2\5\u012e\u0098\34\u07aa\u07ab\7z\2\2\u07ab\u07d2\5"+ + "\u012e\u0098\33\u07ac\u07ad\t\16\2\2\u07ad\u07d2\5\u012e\u0098\32\u07ae"+ + "\u07b8\7\u0098\2\2\u07af\u07b1\5j\66\2\u07b0\u07af\3\2\2\2\u07b1\u07b2"+ + "\3\2\2\2\u07b2\u07b0\3\2\2\2\u07b2\u07b3\3\2\2\2\u07b3\u07b5\3\2\2\2\u07b4"+ + "\u07b6\5L\'\2\u07b5\u07b4\3\2\2\2\u07b5\u07b6\3\2\2\2\u07b6\u07b9\3\2"+ + "\2\2\u07b7\u07b9\5L\'\2\u07b8\u07b0\3\2\2\2\u07b8\u07b7\3\2\2\2\u07b9"+ + "\u07ba\3\2\2\2\u07ba\u07bb\7\u0097\2\2\u07bb\u07bc\5\u012e\u0098\31\u07bc"+ + "\u07d2\3\2\2\2\u07bd\u07d2\5\32\16\2\u07be\u07d2\5\34\17\2\u07bf\u07c0"+ + "\7\u0086\2\2\u07c0\u07c1\5\u012e\u0098\2\u07c1\u07c2\7\u0087\2\2\u07c2"+ + "\u07d2\3\2\2\2\u07c3\u07c6\7~\2\2\u07c4\u07c7\5\u00f8}\2\u07c5\u07c7\5"+ + "\u012e\u0098\2\u07c6\u07c4\3\2\2\2\u07c6\u07c5\3\2\2\2\u07c7\u07d2\3\2"+ + "\2\2\u07c8\u07d2\5\u0138\u009d\2\u07c9\u07ca\7\u00a3\2\2\u07ca\u07cd\5"+ + "\u00f2z\2\u07cb\u07cc\7\u0083\2\2\u07cc\u07ce\5\u012e\u0098\2\u07cd\u07cb"+ + "\3\2\2\2\u07cd\u07ce\3\2\2\2\u07ce\u07d2\3\2\2\2\u07cf\u07d2\5\u00f6|"+ + "\2\u07d0\u07d2\5\u0132\u009a\2\u07d1\u0793\3\2\2\2\u07d1\u0795\3\2\2\2"+ + "\u07d1\u0796\3\2\2\2\u07d1\u0797\3\2\2\2\u07d1\u0798\3\2\2\2\u07d1\u0799"+ + "\3\2\2\2\u07d1\u07a1\3\2\2\2\u07d1\u07a4\3\2\2\2\u07d1\u07a5\3\2\2\2\u07d1"+ + "\u07a6\3\2\2\2\u07d1\u07a7\3\2\2\2\u07d1\u07a8\3\2\2\2\u07d1\u07aa\3\2"+ + "\2\2\u07d1\u07ac\3\2\2\2\u07d1\u07ae\3\2\2\2\u07d1\u07bd\3\2\2\2\u07d1"+ + "\u07be\3\2\2\2\u07d1\u07bf\3\2\2\2\u07d1\u07c3\3\2\2\2\u07d1\u07c8\3\2"+ + "\2\2\u07d1\u07c9\3\2\2\2\u07d1\u07cf\3\2\2\2\u07d1\u07d0\3\2\2\2\u07d2"+ + "\u0803\3\2\2\2\u07d3\u07d4\f\30\2\2\u07d4\u07d5\t\17\2\2\u07d5\u0802\5"+ + "\u012e\u0098\31\u07d6\u07d7\f\27\2\2\u07d7\u07d8\t\20\2\2\u07d8\u0802"+ + "\5\u012e\u0098\30\u07d9\u07da\f\26\2\2\u07da\u07db\5\u013a\u009e\2\u07db"+ + "\u07dc\5\u012e\u0098\27\u07dc\u0802\3\2\2\2\u07dd\u07de\f\25\2\2\u07de"+ + "\u07df\t\21\2\2\u07df\u0802\5\u012e\u0098\26\u07e0\u07e1\f\24\2\2\u07e1"+ + "\u07e2\t\22\2\2\u07e2\u0802\5\u012e\u0098\25\u07e3\u07e4\f\22\2\2\u07e4"+ + "\u07e5\t\23\2\2\u07e5\u0802\5\u012e\u0098\23\u07e6\u07e7\f\21\2\2\u07e7"+ + "\u07e8\t\24\2\2\u07e8\u0802\5\u012e\u0098\22\u07e9\u07ea\f\20\2\2\u07ea"+ + "\u07eb\t\25\2\2\u07eb\u0802\5\u012e\u0098\21\u07ec\u07ed\f\17\2\2\u07ed"+ + "\u07ee\7\u009b\2\2\u07ee\u0802\5\u012e\u0098\20\u07ef\u07f0\f\16\2\2\u07f0"+ + "\u07f1\7\u009c\2\2\u07f1\u0802\5\u012e\u0098\17\u07f2\u07f3\f\r\2\2\u07f3"+ + "\u07f4\7\u00aa\2\2\u07f4\u0802\5\u012e\u0098\16\u07f5\u07f6\f\f\2\2\u07f6"+ + "\u07f7\7\u008a\2\2\u07f7\u07f8\5\u012e\u0098\2\u07f8\u07f9\7\u0081\2\2"+ + "\u07f9\u07fa\5\u012e\u0098\r\u07fa\u0802\3\2\2\2\u07fb\u07fc\f\23\2\2"+ + "\u07fc\u07fd\7|\2\2\u07fd\u0802\5L\'\2\u07fe\u07ff\f\b\2\2\u07ff\u0800"+ + "\7\u00ab\2\2\u0800\u0802\5\u00f2z\2\u0801\u07d3\3\2\2\2\u0801\u07d6\3"+ + "\2\2\2\u0801\u07d9\3\2\2\2\u0801\u07dd\3\2\2\2\u0801\u07e0\3\2\2\2\u0801"+ + "\u07e3\3\2\2\2\u0801\u07e6\3\2\2\2\u0801\u07e9\3\2\2\2\u0801\u07ec\3\2"+ + "\2\2\u0801\u07ef\3\2\2\2\u0801\u07f2\3\2\2\2\u0801\u07f5\3\2\2\2\u0801"+ + "\u07fb\3\2\2\2\u0801\u07fe\3\2\2\2\u0802\u0805\3\2\2\2\u0803\u0801\3\2"+ + "\2\2\u0803\u0804\3\2\2\2\u0804\u012f\3\2\2\2\u0805\u0803\3\2\2\2\u0806"+ + "\u0807\b\u0099\1\2\u0807\u080e\5\u0154\u00ab\2\u0808\u080e\5p9\2\u0809"+ + "\u080a\7\u0086\2\2\u080a\u080b\5\u0130\u0099\2\u080b\u080c\7\u0087\2\2"+ + "\u080c\u080e\3\2\2\2\u080d\u0806\3\2\2\2\u080d\u0808\3\2\2\2\u080d\u0809"+ + "\3\2\2\2\u080e\u0817\3\2\2\2\u080f\u0810\f\5\2\2\u0810\u0811\t\26\2\2"+ + "\u0811\u0816\5\u0130\u0099\6\u0812\u0813\f\4\2\2\u0813\u0814\t\20\2\2"+ + "\u0814\u0816\5\u0130\u0099\5\u0815\u080f\3\2\2\2\u0815\u0812\3\2\2\2\u0816"+ + "\u0819\3\2\2\2\u0817\u0815\3\2\2\2\u0817\u0818\3\2\2\2\u0818\u0131\3\2"+ + "\2\2\u0819\u0817\3\2\2\2\u081a\u081b\5L\'\2\u081b\u0133\3\2\2\2\u081c"+ + "\u0822\7X\2\2\u081d\u081f\7\u0086\2\2\u081e\u0820\5\u0108\u0085\2\u081f"+ + "\u081e\3\2\2\2\u081f\u0820\3\2\2\2\u0820\u0821\3\2\2\2\u0821\u0823\7\u0087"+ + "\2\2\u0822\u081d\3\2\2\2\u0822\u0823\3\2\2\2\u0823\u082d\3\2\2\2\u0824"+ + "\u0825\7X\2\2\u0825\u0826\5\\/\2\u0826\u0828\7\u0086\2\2\u0827\u0829\5"+ + "\u0108\u0085\2\u0828\u0827\3\2\2\2\u0828\u0829\3\2\2\2\u0829\u082a\3\2"+ + "\2\2\u082a\u082b\7\u0087\2\2\u082b\u082d\3\2\2\2\u082c\u081c\3\2\2\2\u082c"+ + "\u0824\3\2\2\2\u082d\u0135\3\2\2\2\u082e\u0830\5j\66\2\u082f\u082e\3\2"+ + "\2\2\u0830\u0833\3\2\2\2\u0831\u082f\3\2\2\2\u0831\u0832\3\2\2\2\u0832"+ + "\u0834\3\2\2\2\u0833\u0831\3\2\2\2\u0834\u0835\7\t\2\2\u0835\u0836\5\22"+ + "\n\2\u0836\u0137\3\2\2\2\u0837\u0838\7j\2\2\u0838\u0839\5\u012e\u0098"+ + "\2\u0839\u0139\3\2\2\2\u083a\u083b\7\u0098\2\2\u083b\u083c\5\u013c\u009f"+ + "\2\u083c\u083d\7\u0098\2\2\u083d\u0849\3\2\2\2\u083e\u083f\7\u0097\2\2"+ + "\u083f\u0840\5\u013c\u009f\2\u0840\u0841\7\u0097\2\2\u0841\u0849\3\2\2"+ + "\2\u0842\u0843\7\u0097\2\2\u0843\u0844\5\u013c\u009f\2\u0844\u0845\7\u0097"+ + "\2\2\u0845\u0846\5\u013c\u009f\2\u0846\u0847\7\u0097\2\2\u0847\u0849\3"+ + "\2\2\2\u0848\u083a\3\2\2\2\u0848\u083e\3\2\2\2\u0848\u0842\3\2\2\2\u0849"+ + "\u013b\3\2\2\2\u084a\u084b\6\u009f\34\2\u084b\u013d\3\2\2\2\u084c\u084d"+ + "\7\u00c2\2\2\u084d\u084f\7\u0081\2\2\u084e\u084c\3\2\2\2\u084e\u084f\3"+ + "\2\2\2\u084f\u0850\3\2\2\2\u0850\u0851\7\u00c2\2\2\u0851\u013f\3\2\2\2"+ + "\u0852\u0853\7\u00c2\2\2\u0853\u0855\7\u0081\2\2\u0854\u0852\3\2\2\2\u0854"+ + "\u0855\3\2\2\2\u0855\u0856\3\2\2\2\u0856\u0857\5\u0184\u00c3\2\u0857\u0141"+ + "\3\2\2\2\u0858\u085c\7\25\2\2\u0859\u085b\5j\66\2\u085a\u0859\3\2\2\2"+ + "\u085b\u085e\3\2\2\2\u085c\u085a\3\2\2\2\u085c\u085d\3\2\2\2\u085d\u085f"+ + "\3\2\2\2\u085e\u085c\3\2\2\2\u085f\u0860\5L\'\2\u0860\u0143\3\2\2\2\u0861"+ + "\u0863\5j\66\2\u0862\u0861\3\2\2\2\u0863\u0866\3\2\2\2\u0864\u0862\3\2"+ + "\2\2\u0864\u0865\3\2\2\2\u0865\u0867\3\2\2\2\u0866\u0864\3\2\2\2\u0867"+ + "\u0868\5L\'\2\u0868\u0145\3\2\2\2\u0869\u086e\5\u0148\u00a5\2\u086a\u086b"+ + "\7\u0083\2\2\u086b\u086d\5\u0148\u00a5\2\u086c\u086a\3\2\2\2\u086d\u0870"+ + "\3\2\2\2\u086e\u086c\3\2\2\2\u086e\u086f\3\2\2\2\u086f\u0147\3\2\2\2\u0870"+ + "\u086e\3\2\2\2\u0871\u0872\5L\'\2\u0872\u0149\3\2\2\2\u0873\u0878\5\u014c"+ + "\u00a7\2\u0874\u0875\7\u0083\2\2\u0875\u0877\5\u014c\u00a7\2\u0876\u0874"+ + "\3\2\2\2\u0877\u087a\3\2\2\2\u0878\u0876\3\2\2\2\u0878\u0879\3\2\2\2\u0879"+ + "\u014b\3\2\2\2\u087a\u0878\3\2\2\2\u087b\u087d\5j\66\2\u087c\u087b\3\2"+ + "\2\2\u087d\u0880\3\2\2\2\u087e\u087c\3\2\2\2\u087e\u087f\3\2\2\2\u087f"+ + "\u0882\3\2\2\2\u0880\u087e\3\2\2\2\u0881\u0883\7\5\2\2\u0882\u0881\3\2"+ + "\2\2\u0882\u0883\3\2\2\2\u0883\u0884\3\2\2\2\u0884\u0885\5L\'\2\u0885"+ + "\u0886\7\u00c2\2\2\u0886\u014d\3\2\2\2\u0887\u0888\5\u014c\u00a7\2\u0888"+ + "\u0889\7\u008e\2\2\u0889\u088a\5\u012e\u0098\2\u088a\u014f\3\2\2\2\u088b"+ + "\u088d\5j\66\2\u088c\u088b\3\2\2\2\u088d\u0890\3\2\2\2\u088e\u088c\3\2"+ + "\2\2\u088e\u088f\3\2\2\2\u088f\u0891\3\2\2\2\u0890\u088e\3\2\2\2\u0891"+ + "\u0892\5L\'\2\u0892\u0893\7\u00a7\2\2\u0893\u0894\7\u00c2\2\2\u0894\u0151"+ + "\3\2\2\2\u0895\u0898\5\u014c\u00a7\2\u0896\u0898\5\u014e\u00a8\2\u0897"+ + "\u0895\3\2\2\2\u0897\u0896\3\2\2\2\u0898\u08a0\3\2\2\2\u0899\u089c\7\u0083"+ + "\2\2\u089a\u089d\5\u014c\u00a7\2\u089b\u089d\5\u014e\u00a8\2\u089c\u089a"+ + "\3\2\2\2\u089c\u089b\3\2\2\2\u089d\u089f\3\2\2\2\u089e\u0899\3\2\2\2\u089f"+ + "\u08a2\3\2\2\2\u08a0\u089e\3\2\2\2\u08a0\u08a1\3\2\2\2\u08a1\u08a5\3\2"+ + "\2\2\u08a2\u08a0\3\2\2\2\u08a3\u08a4\7\u0083\2\2\u08a4\u08a6\5\u0150\u00a9"+ + "\2\u08a5\u08a3\3\2\2\2\u08a5\u08a6\3\2\2\2\u08a6\u08a9\3\2\2\2\u08a7\u08a9"+ + "\5\u0150\u00a9\2\u08a8\u0897\3\2\2\2\u08a8\u08a7\3\2\2\2\u08a9\u0153\3"+ + "\2\2\2\u08aa\u08ac\7\u0090\2\2\u08ab\u08aa\3\2\2\2\u08ab\u08ac\3\2\2\2"+ + "\u08ac\u08ad\3\2\2\2\u08ad\u08b8\5\u0158\u00ad\2\u08ae\u08b0\7\u0090\2"+ + "\2\u08af\u08ae\3\2\2\2\u08af\u08b0\3\2\2\2\u08b0\u08b1\3\2\2\2\u08b1\u08b8"+ + "\5\u0156\u00ac\2\u08b2\u08b8\7\u00be\2\2\u08b3\u08b8\7\u00bd\2\2\u08b4"+ + "\u08b8\5\u015a\u00ae\2\u08b5\u08b8\5\u015c\u00af\2\u08b6\u08b8\7\u00c1"+ + "\2\2\u08b7\u08ab\3\2\2\2\u08b7\u08af\3\2\2\2\u08b7\u08b2\3\2\2\2\u08b7"+ + "\u08b3\3\2\2\2\u08b7\u08b4\3\2\2\2\u08b7\u08b5\3\2\2\2\u08b7\u08b6\3\2"+ + "\2\2\u08b8\u0155\3\2\2\2\u08b9\u08ba\t\27\2\2\u08ba\u0157\3\2\2\2\u08bb"+ + "\u08bc\t\30\2\2\u08bc\u0159\3\2\2\2\u08bd\u08be\7\u0086\2\2\u08be\u08bf"+ + "\7\u0087\2\2\u08bf\u015b\3\2\2\2\u08c0\u08c1\t\31\2\2\u08c1\u015d\3\2"+ + "\2\2\u08c2\u08c3\7\u00c2\2\2\u08c3\u08c4\7\u008e\2\2\u08c4\u08c5\5\u012e"+ + "\u0098\2\u08c5\u015f\3\2\2\2\u08c6\u08c7\7\u00a7\2\2\u08c7\u08c8\5\u012e"+ + "\u0098\2\u08c8\u0161\3\2\2\2\u08c9\u08ca\7\u00c3\2\2\u08ca\u08cb\5\u0164"+ + "\u00b3\2\u08cb\u08cc\7\u00e7\2\2\u08cc\u0163\3\2\2\2\u08cd\u08d3\5\u016a"+ + "\u00b6\2\u08ce\u08d3\5\u0172\u00ba\2\u08cf\u08d3\5\u0168\u00b5\2\u08d0"+ + "\u08d3\5\u0176\u00bc\2\u08d1\u08d3\7\u00e0\2\2\u08d2\u08cd\3\2\2\2\u08d2"+ + "\u08ce\3\2\2\2\u08d2\u08cf\3\2\2\2\u08d2\u08d0\3\2\2\2\u08d2\u08d1\3\2"+ + "\2\2\u08d3\u0165\3\2\2\2\u08d4\u08d6\5\u0176\u00bc\2\u08d5\u08d4\3\2\2"+ + "\2\u08d5\u08d6\3\2\2\2\u08d6\u08e2\3\2\2\2\u08d7\u08dc\5\u016a\u00b6\2"+ + "\u08d8\u08dc\7\u00e0\2\2\u08d9\u08dc\5\u0172\u00ba\2\u08da\u08dc\5\u0168"+ + "\u00b5\2\u08db\u08d7\3\2\2\2\u08db\u08d8\3\2\2\2\u08db\u08d9\3\2\2\2\u08db"+ + "\u08da\3\2\2\2\u08dc\u08de\3\2\2\2\u08dd\u08df\5\u0176\u00bc\2\u08de\u08dd"+ + "\3\2\2\2\u08de\u08df\3\2\2\2\u08df\u08e1\3\2\2\2\u08e0\u08db\3\2\2\2\u08e1"+ + "\u08e4\3\2\2\2\u08e2\u08e0\3\2\2\2\u08e2\u08e3\3\2\2\2\u08e3\u0167\3\2"+ + "\2\2\u08e4\u08e2\3\2\2\2\u08e5\u08ec\7\u00df\2\2\u08e6\u08e7\7\u00fd\2"+ + "\2\u08e7\u08e8\5\u012e\u0098\2\u08e8\u08e9\7\u0085\2\2\u08e9\u08eb\3\2"+ + "\2\2\u08ea\u08e6\3\2\2\2\u08eb\u08ee\3\2\2\2\u08ec\u08ea\3\2\2\2\u08ec"+ + "\u08ed\3\2\2\2\u08ed\u08f2\3\2\2\2\u08ee\u08ec\3\2\2\2\u08ef\u08f1\7\u00fe"+ + "\2\2\u08f0\u08ef\3\2\2\2\u08f1\u08f4\3\2\2\2\u08f2\u08f0\3\2\2\2\u08f2"+ + "\u08f3\3\2\2\2\u08f3\u08f5\3\2\2\2\u08f4\u08f2\3\2\2\2\u08f5\u08f6\7\u00fc"+ + "\2\2\u08f6\u0169\3\2\2\2\u08f7\u08f8\5\u016c\u00b7\2\u08f8\u08f9\5\u0166"+ + "\u00b4\2\u08f9\u08fa\5\u016e\u00b8\2\u08fa\u08fd\3\2\2\2\u08fb\u08fd\5"+ + "\u0170\u00b9\2\u08fc\u08f7\3\2\2\2\u08fc\u08fb\3\2\2\2\u08fd\u016b\3\2"+ + "\2\2\u08fe\u08ff\7\u00e4\2\2\u08ff\u0903\5\u017e\u00c0\2\u0900\u0902\5"+ + "\u0174\u00bb\2\u0901\u0900\3\2\2\2\u0902\u0905\3\2\2\2\u0903\u0901\3\2"+ + "\2\2\u0903\u0904\3\2\2\2\u0904\u0906\3\2\2\2\u0905\u0903\3\2\2\2\u0906"+ + "\u0907\7\u00ea\2\2\u0907\u016d\3\2\2\2\u0908\u0909\7\u00e5\2\2\u0909\u090a"+ + "\5\u017e\u00c0\2\u090a\u090b\7\u00ea\2\2\u090b\u016f\3\2\2\2\u090c\u090d"+ + "\7\u00e4\2\2\u090d\u0911\5\u017e\u00c0\2\u090e\u0910\5\u0174\u00bb\2\u090f"+ + "\u090e\3\2\2\2\u0910\u0913\3\2\2\2\u0911\u090f\3\2\2\2\u0911\u0912\3\2"+ + "\2\2\u0912\u0914\3\2\2\2\u0913\u0911\3\2\2\2\u0914\u0915\7\u00ec\2\2\u0915"+ + "\u0171\3\2\2\2\u0916\u091d\7\u00e6\2\2\u0917\u0918\7\u00fb\2\2\u0918\u0919"+ + "\5\u012e\u0098\2\u0919\u091a\7\u0085\2\2\u091a\u091c\3\2\2\2\u091b\u0917"+ + "\3\2\2\2\u091c\u091f\3\2\2\2\u091d\u091b\3\2\2\2\u091d\u091e\3\2\2\2\u091e"+ + "\u0920\3\2\2\2\u091f\u091d\3\2\2\2\u0920\u0921\7\u00fa\2\2\u0921\u0173"+ + "\3\2\2\2\u0922\u0923\5\u017e\u00c0\2\u0923\u0924\7\u00ef\2\2\u0924\u0925"+ + "\5\u0178\u00bd\2\u0925\u0175\3\2\2\2\u0926\u0927\7\u00e8\2\2\u0927\u0928"+ + "\5\u012e\u0098\2\u0928\u0929\7\u0085\2\2\u0929\u092b\3\2\2\2\u092a\u0926"+ + "\3\2\2\2\u092b\u092c\3\2\2\2\u092c\u092a\3\2\2\2\u092c\u092d\3\2\2\2\u092d"+ + "\u092f\3\2\2\2\u092e\u0930\7\u00e9\2\2\u092f\u092e\3\2\2\2\u092f\u0930"+ + "\3\2\2\2\u0930\u0933\3\2\2\2\u0931\u0933\7\u00e9\2\2\u0932\u092a\3\2\2"+ + "\2\u0932\u0931\3\2\2\2\u0933\u0177\3\2\2\2\u0934\u0937\5\u017a\u00be\2"+ + "\u0935\u0937\5\u017c\u00bf\2\u0936\u0934\3\2\2\2\u0936\u0935\3\2\2\2\u0937"+ + "\u0179\3\2\2\2\u0938\u093f\7\u00f1\2\2\u0939\u093a\7\u00f8\2\2\u093a\u093b"+ + "\5\u012e\u0098\2\u093b\u093c\7\u0085\2\2\u093c\u093e\3\2\2\2\u093d\u0939"+ + "\3\2\2\2\u093e\u0941\3\2\2\2\u093f\u093d\3\2\2\2\u093f\u0940\3\2\2\2\u0940"+ + "\u0943\3\2\2\2\u0941\u093f\3\2\2\2\u0942\u0944\7\u00f9\2\2\u0943\u0942"+ + "\3\2\2\2\u0943\u0944\3\2\2\2\u0944\u0945\3\2\2\2\u0945\u0946\7\u00f7\2"+ + "\2\u0946\u017b\3\2\2\2\u0947\u094e\7\u00f0\2\2\u0948\u0949\7\u00f5\2\2"+ + "\u0949\u094a\5\u012e\u0098\2\u094a\u094b\7\u0085\2\2\u094b\u094d\3\2\2"+ + "\2\u094c\u0948\3\2\2\2\u094d\u0950\3\2\2\2\u094e\u094c\3\2\2\2\u094e\u094f"+ + "\3\2\2\2\u094f\u0952\3\2\2\2\u0950\u094e\3\2\2\2\u0951\u0953\7\u00f6\2"+ + "\2\u0952\u0951\3\2\2\2\u0952\u0953\3\2\2\2\u0953\u0954\3\2\2\2\u0954\u0955"+ + "\7\u00f4\2\2\u0955\u017d\3\2\2\2\u0956\u0957\7\u00f2\2\2\u0957\u0959\7"+ + "\u00ee\2\2\u0958\u0956\3\2\2\2\u0958\u0959\3\2\2\2\u0959\u095a\3\2\2\2"+ + "\u095a\u095b\7\u00f2\2\2\u095b\u017f\3\2\2\2\u095c\u095e\7\u00c4\2\2\u095d"+ + "\u095f\5\u0182\u00c2\2\u095e\u095d\3\2\2\2\u095e\u095f\3\2\2\2\u095f\u0960"+ + "\3\2\2\2\u0960\u0961\7\u0105\2\2\u0961\u0181\3\2\2\2\u0962\u0963\7\u0106"+ + "\2\2\u0963\u0964\5\u012e\u0098\2\u0964\u0965\7\u0085\2\2\u0965\u0967\3"+ + "\2\2\2\u0966\u0962\3\2\2\2\u0967\u0968\3\2\2\2\u0968\u0966\3\2\2\2\u0968"+ + "\u0969\3\2\2\2\u0969\u096b\3\2\2\2\u096a\u096c\7\u0107\2\2\u096b\u096a"+ + "\3\2\2\2\u096b\u096c\3\2\2\2\u096c\u096f\3\2\2\2\u096d\u096f\7\u0107\2"+ + "\2\u096e\u0966\3\2\2\2\u096e\u096d\3\2\2\2\u096f\u0183\3\2\2\2\u0970\u0973"+ + "\7\u00c2\2\2\u0971\u0973\5\u0186\u00c4\2\u0972\u0970\3\2\2\2\u0972\u0971"+ + "\3\2\2\2\u0973\u0185\3\2\2\2\u0974\u0975\t\32\2\2\u0975\u0187\3\2\2\2"+ + "\u0976\u0977\7\35\2\2\u0977\u0979\5\u01a4\u00d3\2\u0978\u097a\5\u01a6"+ + "\u00d4\2\u0979\u0978\3\2\2\2\u0979\u097a\3\2\2\2\u097a\u097c\3\2\2\2\u097b"+ + "\u097d\5\u0198\u00cd\2\u097c\u097b\3\2\2\2\u097c\u097d\3\2\2\2\u097d\u097f"+ + "\3\2\2\2\u097e\u0980\5\u0192\u00ca\2\u097f\u097e\3\2\2\2\u097f\u0980\3"+ + "\2\2\2\u0980\u0982\3\2\2\2\u0981\u0983\5\u0196\u00cc\2\u0982\u0981\3\2"+ + "\2\2\u0982\u0983\3\2\2\2\u0983\u0189\3\2\2\2\u0984\u0985\7A\2\2\u0985"+ + "\u0987\7\u0084\2\2\u0986\u0988\5\u018c\u00c7\2\u0987\u0986\3\2\2\2\u0988"+ + "\u0989\3\2\2\2\u0989\u0987\3\2\2\2\u0989\u098a\3\2\2\2\u098a\u098b\3\2"+ + "\2"; private static final String _serializedATNSegment1 = - "\3\2\2\2\u098c\u098d\3\2\2\2\u098d\u0990\3\2\2\2\u098e\u0990\5\u018c\u00c7"+ - "\2\u098f\u098a\3\2\2\2\u098f\u098e\3\2\2\2\u0990\u0992\3\2\2\2\u0991\u0993"+ - "\5\u0196\u00cc\2\u0992\u0991\3\2\2\2\u0992\u0993\3\2\2\2\u0993\u0995\3"+ - "\2\2\2\u0994\u0996\5\u0190\u00c9\2\u0995\u0994\3\2\2\2\u0995\u0996\3\2"+ - "\2\2\u0996\u0998\3\2\2\2\u0997\u0999\5\u01a6\u00d4\2\u0998\u0997\3\2\2"+ - "\2\u0998\u0999\3\2\2\2\u0999\u099a\3\2\2\2\u099a\u099b\5\u01a0\u00d1\2"+ - "\u099b\u018b\3\2\2\2\u099c\u099e\7)\2\2\u099d\u099c\3\2\2\2\u099d\u099e"+ - "\3\2\2\2\u099e\u099f\3\2\2\2\u099f\u09a1\5\u01a8\u00d5\2\u09a0\u09a2\5"+ - "\u018e\u00c8\2\u09a1\u09a0\3\2\2\2\u09a1\u09a2\3\2\2\2\u09a2\u018d\3\2"+ - "\2\2\u09a3\u09a4\7*\2\2\u09a4\u09a5\7\u00b8\2\2\u09a5\u09a6\5\u01b4\u00db"+ - "\2\u09a6\u018f\3\2\2\2\u09a7\u09a8\7#\2\2\u09a8\u09a9\7!\2\2\u09a9\u09ae"+ - "\5\u0192\u00ca\2\u09aa\u09ab\7\u0083\2\2\u09ab\u09ad\5\u0192\u00ca\2\u09ac"+ - "\u09aa\3\2\2\2\u09ad\u09b0\3\2\2\2\u09ae\u09ac\3\2\2\2\u09ae\u09af\3\2"+ - "\2\2\u09af\u0191\3\2\2\2\u09b0\u09ae\3\2\2\2\u09b1\u09b3\5\u00fa~\2\u09b2"+ - "\u09b4\5\u01b0\u00d9\2\u09b3\u09b2\3\2\2\2\u09b3\u09b4\3\2\2\2\u09b4\u0193"+ - "\3\2\2\2\u09b5\u09b6\7B\2\2\u09b6\u09b7\7\u00b8\2\2\u09b7\u0195\3\2\2"+ - "\2\u09b8\u09bb\7\37\2\2\u09b9\u09bc\7\u0091\2\2\u09ba\u09bc\5\u0198\u00cd"+ - "\2\u09bb\u09b9\3\2\2\2\u09bb\u09ba\3\2\2\2\u09bc\u09be\3\2\2\2\u09bd\u09bf"+ - "\5\u019c\u00cf\2\u09be\u09bd\3\2\2\2\u09be\u09bf\3\2\2\2\u09bf\u09c1\3"+ - "\2\2\2\u09c0\u09c2\5\u019e\u00d0\2\u09c1\u09c0\3\2\2\2\u09c1\u09c2\3\2"+ - "\2\2\u09c2\u0197\3\2\2\2\u09c3\u09c8\5\u019a\u00ce\2\u09c4\u09c5\7\u0083"+ - "\2\2\u09c5\u09c7\5\u019a\u00ce\2\u09c6\u09c4\3\2\2\2\u09c7\u09ca\3\2\2"+ - "\2\u09c8\u09c6\3\2\2\2\u09c8\u09c9\3\2\2\2\u09c9\u0199\3\2\2\2\u09ca\u09c8"+ - "\3\2\2\2\u09cb\u09ce\5\u012c\u0097\2\u09cc\u09cd\7\4\2\2\u09cd\u09cf\7"+ - "\u00c1\2\2\u09ce\u09cc\3\2\2\2\u09ce\u09cf\3\2\2\2\u09cf\u019b\3\2\2\2"+ - "\u09d0\u09d1\7 \2\2\u09d1\u09d2\7!\2\2\u09d2\u09d3\5\u0090I\2\u09d3\u019d"+ - "\3\2\2\2\u09d4\u09d5\7\"\2\2\u09d5\u09d6\5\u012c\u0097\2\u09d6\u019f\3"+ - "\2\2\2\u09d7\u09d8\7\u00a9\2\2\u09d8\u09d9\7\u0086\2\2\u09d9\u09da\5\u014a"+ - "\u00a6\2\u09da\u09db\7\u0087\2\2\u09db\u09df\7\u0084\2\2\u09dc\u09de\5"+ - "j\66\2\u09dd\u09dc\3\2\2\2\u09de\u09e1\3\2\2\2\u09df\u09dd\3\2\2\2\u09df"+ - "\u09e0\3\2\2\2\u09e0\u09e2\3\2\2\2\u09e1\u09df\3\2\2\2\u09e2\u09e3\7\u0085"+ - "\2\2\u09e3\u01a1\3\2\2\2\u09e4\u09e6\5\u00fa~\2\u09e5\u09e7\5\u01ac\u00d7"+ - "\2\u09e6\u09e5\3\2\2\2\u09e6\u09e7\3\2\2\2\u09e7\u09eb\3\2\2\2\u09e8\u09ea"+ - "\5\u0102\u0082\2\u09e9\u09e8\3\2\2\2\u09ea\u09ed\3\2\2\2\u09eb\u09e9\3"+ - "\2\2\2\u09eb\u09ec\3\2\2\2\u09ec\u09ef\3\2\2\2\u09ed\u09eb\3\2\2\2\u09ee"+ - "\u09f0\5\u01ae\u00d8\2\u09ef\u09ee\3\2\2\2\u09ef\u09f0\3\2\2\2\u09f0\u09f4"+ - "\3\2\2\2\u09f1\u09f3\5\u0102\u0082\2\u09f2\u09f1\3\2\2\2\u09f3\u09f6\3"+ - "\2\2\2\u09f4\u09f2\3\2\2\2\u09f4\u09f5\3\2\2\2\u09f5\u09f8\3\2\2\2\u09f6"+ - "\u09f4\3\2\2\2\u09f7\u09f9\5\u01ac\u00d7\2\u09f8\u09f7\3\2\2\2\u09f8\u09f9"+ - "\3\2\2\2\u09f9\u09fc\3\2\2\2\u09fa\u09fb\7\4\2\2\u09fb\u09fd\7\u00c1\2"+ - "\2\u09fc\u09fa\3\2\2\2\u09fc\u09fd\3\2\2\2\u09fd\u01a3\3\2\2\2\u09fe\u09ff"+ - "\7\64\2\2\u09ff\u0a05\5\u01b2\u00da\2\u0a00\u0a01\5\u01b2\u00da\2\u0a01"+ - "\u0a02\7\64\2\2\u0a02\u0a05\3\2\2\2\u0a03\u0a05\5\u01b2\u00da\2\u0a04"+ - "\u09fe\3\2\2\2\u0a04\u0a00\3\2\2\2\u0a04\u0a03\3\2\2\2\u0a05\u0a06\3\2"+ - "\2\2\u0a06\u0a09\5\u01a2\u00d2\2\u0a07\u0a08\7\36\2\2\u0a08\u0a0a\5\u012c"+ - "\u0097\2\u0a09\u0a07\3\2\2\2\u0a09\u0a0a\3\2\2\2\u0a0a\u01a5\3\2\2\2\u0a0b"+ - "\u0a0c\7.\2\2\u0a0c\u0a0d\t\32\2\2\u0a0d\u0a12\7)\2\2\u0a0e\u0a0f\7\u00b8"+ - "\2\2\u0a0f\u0a13\5\u01b4\u00db\2\u0a10\u0a11\7\u00b8\2\2\u0a11\u0a13\7"+ - "(\2\2\u0a12\u0a0e\3\2\2\2\u0a12\u0a10\3\2\2\2\u0a13\u0a1a\3\2\2\2\u0a14"+ - "\u0a15\7.\2\2\u0a15\u0a16\7-\2\2\u0a16\u0a17\7)\2\2\u0a17\u0a18\7\u00b8"+ - "\2\2\u0a18\u0a1a\5\u01b4\u00db\2\u0a19\u0a0b\3\2\2\2\u0a19\u0a14\3\2\2"+ - "\2\u0a1a\u01a7\3\2\2\2\u0a1b\u0a1f\5\u01aa\u00d6\2\u0a1c\u0a1d\7%\2\2"+ - "\u0a1d\u0a20\7!\2\2\u0a1e\u0a20\7\u0083\2\2\u0a1f\u0a1c\3\2\2\2\u0a1f"+ - "\u0a1e\3\2\2\2\u0a20\u0a21\3\2\2\2\u0a21\u0a22\5\u01a8\u00d5\2\u0a22\u0a36"+ - "\3\2\2\2\u0a23\u0a24\7\u0086\2\2\u0a24\u0a25\5\u01a8\u00d5\2\u0a25\u0a26"+ - "\7\u0087\2\2\u0a26\u0a36\3\2\2\2\u0a27\u0a28\7\u0094\2\2\u0a28\u0a2e\5"+ - "\u01aa\u00d6\2\u0a29\u0a2a\7\u009b\2\2\u0a2a\u0a2f\5\u01aa\u00d6\2\u0a2b"+ - "\u0a2c\7&\2\2\u0a2c\u0a2d\7\u00b8\2\2\u0a2d\u0a2f\5\u01b4\u00db\2\u0a2e"+ - "\u0a29\3\2\2\2\u0a2e\u0a2b\3\2\2\2\u0a2f\u0a36\3\2\2\2\u0a30\u0a31\5\u01aa"+ - "\u00d6\2\u0a31\u0a32\t\33\2\2\u0a32\u0a33\5\u01aa\u00d6\2\u0a33\u0a36"+ - "\3\2\2\2\u0a34\u0a36\5\u01aa\u00d6\2\u0a35\u0a1b\3\2\2\2\u0a35\u0a23\3"+ - "\2\2\2\u0a35\u0a27\3\2\2\2\u0a35\u0a30\3\2\2\2\u0a35\u0a34\3\2\2\2\u0a36"+ - "\u01a9\3\2\2\2\u0a37\u0a39\5\u00fa~\2\u0a38\u0a3a\5\u01ac\u00d7\2\u0a39"+ - "\u0a38\3\2\2\2\u0a39\u0a3a\3\2\2\2\u0a3a\u0a3c\3\2\2\2\u0a3b\u0a3d\5\u00d6"+ - "l\2\u0a3c\u0a3b\3\2\2\2\u0a3c\u0a3d\3\2\2\2\u0a3d\u0a40\3\2\2\2\u0a3e"+ - "\u0a3f\7\4\2\2\u0a3f\u0a41\7\u00c1\2\2\u0a40\u0a3e\3\2\2\2\u0a40\u0a41"+ - "\3\2\2\2\u0a41\u01ab\3\2\2\2\u0a42\u0a43\7$\2\2\u0a43\u0a44\5\u012c\u0097"+ - "\2\u0a44\u01ad\3\2\2\2\u0a45\u0a46\7\'\2\2\u0a46\u0a47\5\u0102\u0082\2"+ - "\u0a47\u01af\3\2\2\2\u0a48\u0a49\t\34\2\2\u0a49\u01b1\3\2\2\2\u0a4a\u0a4b"+ - "\7\62\2\2\u0a4b\u0a4c\7\60\2\2\u0a4c\u0a5a\7b\2\2\u0a4d\u0a4e\7\61\2\2"+ - "\u0a4e\u0a4f\7\60\2\2\u0a4f\u0a5a\7b\2\2\u0a50\u0a51\7\63\2\2\u0a51\u0a52"+ - "\7\60\2\2\u0a52\u0a5a\7b\2\2\u0a53\u0a54\7\60\2\2\u0a54\u0a5a\7b\2\2\u0a55"+ - "\u0a57\7/\2\2\u0a56\u0a55\3\2\2\2\u0a56\u0a57\3\2\2\2\u0a57\u0a58\3\2"+ - "\2\2\u0a58\u0a5a\7b\2\2\u0a59\u0a4a\3\2\2\2\u0a59\u0a4d\3\2\2\2\u0a59"+ - "\u0a50\3\2\2\2\u0a59\u0a53\3\2\2\2\u0a59\u0a56\3\2\2\2\u0a5a\u01b3\3\2"+ - "\2\2\u0a5b\u0a5c\t\35\2\2\u0a5c\u01b5\3\2\2\2\u0a5d\u0a5f\5\u01b8\u00dd"+ - "\2\u0a5e\u0a5d\3\2\2\2\u0a5f\u0a60\3\2\2\2\u0a60\u0a5e\3\2\2\2\u0a60\u0a61"+ - "\3\2\2\2\u0a61\u0a65\3\2\2\2\u0a62\u0a64\5\u01ba\u00de\2\u0a63\u0a62\3"+ - "\2\2\2\u0a64\u0a67\3\2\2\2\u0a65\u0a63\3\2\2\2\u0a65\u0a66\3\2\2\2\u0a66"+ - "\u0a69\3\2\2\2\u0a67\u0a65\3\2\2\2\u0a68\u0a6a\5\u01bc\u00df\2\u0a69\u0a68"+ - "\3\2\2\2\u0a69\u0a6a\3\2\2\2\u0a6a\u01b7\3\2\2\2\u0a6b\u0a6c\7\u00c4\2"+ - "\2\u0a6c\u0a6d\5\u01be\u00e0\2\u0a6d\u01b9\3\2\2\2\u0a6e\u0a72\5\u01cc"+ - "\u00e7\2\u0a6f\u0a71\5\u01c0\u00e1\2\u0a70\u0a6f\3\2\2\2\u0a71\u0a74\3"+ - "\2\2\2\u0a72\u0a70\3\2\2\2\u0a72\u0a73\3\2\2\2\u0a73\u01bb\3\2\2\2\u0a74"+ - "\u0a72\3\2\2\2\u0a75\u0a79\5\u01ce\u00e8\2\u0a76\u0a78\5\u01c2\u00e2\2"+ - "\u0a77\u0a76\3\2\2\2\u0a78\u0a7b\3\2\2\2\u0a79\u0a77\3\2\2\2\u0a79\u0a7a"+ - "\3\2\2\2\u0a7a\u01bd\3\2\2\2\u0a7b\u0a79\3\2\2\2\u0a7c\u0a7e\5\u01c4\u00e3"+ - "\2\u0a7d\u0a7c\3\2\2\2\u0a7d\u0a7e\3\2\2\2\u0a7e\u01bf\3\2\2\2\u0a7f\u0a81"+ - "\7\u00c4\2\2\u0a80\u0a82\5\u01c4\u00e3\2\u0a81\u0a80\3\2\2\2\u0a81\u0a82"+ - "\3\2\2\2\u0a82\u01c1\3\2\2\2\u0a83\u0a85\7\u00c4\2\2\u0a84\u0a86\5\u01c4"+ - "\u00e3\2\u0a85\u0a84\3\2\2\2\u0a85\u0a86\3\2\2\2\u0a86\u01c3\3\2\2\2\u0a87"+ - "\u0a91\7\u00cd\2\2\u0a88\u0a91\7\u00cc\2\2\u0a89\u0a91\7\u00ca\2\2\u0a8a"+ - "\u0a91\7\u00cb\2\2\u0a8b\u0a91\5\u01c6\u00e4\2\u0a8c\u0a91\5\u01d2\u00ea"+ - "\2\u0a8d\u0a91\5\u01d6\u00ec\2\u0a8e\u0a91\5\u01da\u00ee\2\u0a8f\u0a91"+ - "\7\u00d1\2\2\u0a90\u0a87\3\2\2\2\u0a90\u0a88\3\2\2\2\u0a90\u0a89\3\2\2"+ - "\2\u0a90\u0a8a\3\2\2\2\u0a90\u0a8b\3\2\2\2\u0a90\u0a8c\3\2\2\2\u0a90\u0a8d"+ - "\3\2\2\2\u0a90\u0a8e\3\2\2\2\u0a90\u0a8f\3\2\2\2\u0a91\u0a92\3\2\2\2\u0a92"+ - "\u0a90\3\2\2\2\u0a92\u0a93\3\2\2\2\u0a93\u01c5\3\2\2\2\u0a94\u0a95\5\u01c8"+ - "\u00e5\2\u0a95\u01c7\3\2\2\2\u0a96\u0a97\5\u01ca\u00e6\2\u0a97\u0a98\5"+ - "\u01d2\u00ea\2\u0a98\u01c9\3\2\2\2\u0a99\u0a9a\7\u00d1\2\2\u0a9a\u01cb"+ - "\3\2\2\2\u0a9b\u0a9c\7\u00c5\2\2\u0a9c\u0a9d\5\u01d0\u00e9\2\u0a9d\u0a9f"+ - "\7\u00d6\2\2\u0a9e\u0aa0\5\u01c4\u00e3\2\u0a9f\u0a9e\3\2\2\2\u0a9f\u0aa0"+ - "\3\2\2\2\u0aa0\u01cd\3\2\2\2\u0aa1\u0aa3\7\u00c6\2\2\u0aa2\u0aa4\5\u01c4"+ - "\u00e3\2\u0aa3\u0aa2\3\2\2\2\u0aa3\u0aa4\3\2\2\2\u0aa4\u01cf\3\2\2\2\u0aa5"+ - "\u0aa6\7\u00d5\2\2\u0aa6\u01d1\3\2\2\2\u0aa7\u0aa8\7\u00ce\2\2\u0aa8\u0aa9"+ - "\5\u01d4\u00eb\2\u0aa9\u0aaa\7\u00d9\2\2\u0aaa\u01d3\3\2\2\2\u0aab\u0aac"+ - "\7\u00d8\2\2\u0aac\u01d5\3\2\2\2\u0aad\u0aae\7\u00cf\2\2\u0aae\u0aaf\5"+ - "\u01d8\u00ed\2\u0aaf\u0ab0\7\u00db\2\2\u0ab0\u01d7\3\2\2\2\u0ab1\u0ab2"+ - "\7\u00da\2\2\u0ab2\u01d9\3\2\2\2\u0ab3\u0ab4\7\u00d0\2\2\u0ab4\u0ab5\5"+ - "\u01dc\u00ef\2\u0ab5\u0ab6\7\u00dd\2\2\u0ab6\u01db\3\2\2\2\u0ab7\u0ab8"+ - "\7\u00dc\2\2\u0ab8\u01dd\3\2\2\2\u0141\u01e0\u01e2\u01e6\u01eb\u01f1\u01fb"+ - "\u01ff\u0208\u020d\u0219\u021d\u0227\u0230\u0236\u023b\u023e\u0246\u024c"+ - "\u024f\u0257\u025c\u0261\u026f\u0272\u0277\u027e\u0282\u0285\u028f\u0291"+ - "\u029b\u029f\u02a5\u02ac\u02b2\u02b6\u02c6\u02cb\u02cf\u02d2\u02d8\u02db"+ - "\u02de\u02e1\u02e5\u02ee\u02f1\u02f6\u02fa\u0302\u030c\u0310\u0317\u031b"+ - "\u031e\u0323\u0327\u032d\u0337\u033f\u0347\u034e\u0353\u035d\u0360\u0363"+ - "\u0366\u036f\u0375\u037a\u0381\u0385\u0387\u038f\u039a\u039f\u03a2\u03ae"+ - "\u03b2\u03b8\u03c0\u03c4\u03e8\u03ee\u03f2\u03f9\u03fd\u0406\u0422\u0429"+ - "\u042d\u0434\u043c\u043f\u0448\u044f\u045c\u0461\u0465\u046f\u0472\u0477"+ - "\u047d\u0486\u048a\u0492\u04b6\u04bd\u04c1\u04c9\u04d5\u04df\u04ea\u04f4"+ - "\u04fd\u0504\u050c\u0513\u0518\u051c\u0521\u052a\u052f\u0537\u053e\u0543"+ - "\u0546\u0552\u0559\u055e\u0565\u056a\u056d\u0574\u0579\u057c\u0586\u0594"+ - "\u0599\u059c\u059e\u05ab\u05b0\u05b3\u05b5\u05ba\u05c2\u05c6\u05ce\u05d3"+ - "\u05d6\u05e8\u05ee\u05f0\u05f4\u0604\u0609\u060d\u061b\u0620\u0623\u0625"+ - "\u062a\u062f\u0633\u0637\u063d\u0643\u064c\u0656\u0666\u0670\u0679\u067c"+ - "\u067f\u068a\u0694\u06a3\u06ac\u06b2\u06b8\u06c0\u06c9\u06d3\u06e0\u06e2"+ - "\u06f1\u06f6\u06fe\u0707\u070d\u0712\u0716\u0721\u0729\u072e\u0731\u0734"+ - "\u0737\u0739\u073e\u0744\u0750\u0758\u0762\u076c\u0776\u078b\u0799\u079d"+ - "\u07ae\u07b1\u07b4\u07c2\u07c9\u07cd\u07fd\u07ff\u0809\u0811\u0813\u081b"+ - "\u081e\u0824\u0828\u082d\u0844\u084a\u0850\u0858\u0860\u086a\u0874\u087a"+ - "\u087e\u088a\u0893\u0898\u089c\u08a1\u08a4\u08a7\u08ab\u08b3\u08ce\u08d1"+ - "\u08d7\u08da\u08de\u08e8\u08ee\u08f8\u08ff\u090d\u0919\u0928\u092b\u092e"+ - "\u0932\u093b\u093f\u094a\u094e\u0954\u095a\u0964\u0967\u096a\u096e\u0975"+ - "\u0978\u097b\u097e\u0985\u098c\u098f\u0992\u0995\u0998\u099d\u09a1\u09ae"+ - "\u09b3\u09bb\u09be\u09c1\u09c8\u09ce\u09df\u09e6\u09eb\u09ef\u09f4\u09f8"+ - "\u09fc\u0a04\u0a09\u0a12\u0a19\u0a1f\u0a2e\u0a35\u0a39\u0a3c\u0a40\u0a56"+ - "\u0a59\u0a60\u0a65\u0a69\u0a72\u0a79\u0a7d\u0a81\u0a85\u0a90\u0a92\u0a9f"+ - "\u0aa3"; + "\2\u098b\u098c\7\u0085\2\2\u098c\u018b\3\2\2\2\u098d\u0993\7\35\2\2\u098e"+ + "\u0990\5\u01a4\u00d3\2\u098f\u0991\5\u01a6\u00d4\2\u0990\u098f\3\2\2\2"+ + "\u0990\u0991\3\2\2\2\u0991\u0994\3\2\2\2\u0992\u0994\5\u018e\u00c8\2\u0993"+ + "\u098e\3\2\2\2\u0993\u0992\3\2\2\2\u0994\u0996\3\2\2\2\u0995\u0997\5\u0198"+ + "\u00cd\2\u0996\u0995\3\2\2\2\u0996\u0997\3\2\2\2\u0997\u0999\3\2\2\2\u0998"+ + "\u099a\5\u0192\u00ca\2\u0999\u0998\3\2\2\2\u0999\u099a\3\2\2\2\u099a\u099c"+ + "\3\2\2\2\u099b\u099d\5\u01a8\u00d5\2\u099c\u099b\3\2\2\2\u099c\u099d\3"+ + "\2\2\2\u099d\u099e\3\2\2\2\u099e\u099f\5\u01a2\u00d2\2\u099f\u018d\3\2"+ + "\2\2\u09a0\u09a2\7)\2\2\u09a1\u09a0\3\2\2\2\u09a1\u09a2\3\2\2\2\u09a2"+ + "\u09a3\3\2\2\2\u09a3\u09a5\5\u01aa\u00d6\2\u09a4\u09a6\5\u0190\u00c9\2"+ + "\u09a5\u09a4\3\2\2\2\u09a5\u09a6\3\2\2\2\u09a6\u018f\3\2\2\2\u09a7\u09a8"+ + "\7*\2\2\u09a8\u09a9\7\u00b8\2\2\u09a9\u09aa\5\u01b6\u00dc\2\u09aa\u0191"+ + "\3\2\2\2\u09ab\u09ac\7#\2\2\u09ac\u09ad\7!\2\2\u09ad\u09b2\5\u0194\u00cb"+ + "\2\u09ae\u09af\7\u0083\2\2\u09af\u09b1\5\u0194\u00cb\2\u09b0\u09ae\3\2"+ + "\2\2\u09b1\u09b4\3\2\2\2\u09b2\u09b0\3\2\2\2\u09b2\u09b3\3\2\2\2\u09b3"+ + "\u0193\3\2\2\2\u09b4\u09b2\3\2\2\2\u09b5\u09b7\5\u00fc\177\2\u09b6\u09b8"+ + "\5\u01b2\u00da\2\u09b7\u09b6\3\2\2\2\u09b7\u09b8\3\2\2\2\u09b8\u0195\3"+ + "\2\2\2\u09b9\u09ba\7B\2\2\u09ba\u09bb\7\u00b8\2\2\u09bb\u0197\3\2\2\2"+ + "\u09bc\u09bf\7\37\2\2\u09bd\u09c0\7\u0091\2\2\u09be\u09c0\5\u019a\u00ce"+ + "\2\u09bf\u09bd\3\2\2\2\u09bf\u09be\3\2\2\2\u09c0\u09c2\3\2\2\2\u09c1\u09c3"+ + "\5\u019e\u00d0\2\u09c2\u09c1\3\2\2\2\u09c2\u09c3\3\2\2\2\u09c3\u09c5\3"+ + "\2\2\2\u09c4\u09c6\5\u01a0\u00d1\2\u09c5\u09c4\3\2\2\2\u09c5\u09c6\3\2"+ + "\2\2\u09c6\u0199\3\2\2\2\u09c7\u09cc\5\u019c\u00cf\2\u09c8\u09c9\7\u0083"+ + "\2\2\u09c9\u09cb\5\u019c\u00cf\2\u09ca\u09c8\3\2\2\2\u09cb\u09ce\3\2\2"+ + "\2\u09cc\u09ca\3\2\2\2\u09cc\u09cd\3\2\2\2\u09cd\u019b\3\2\2\2\u09ce\u09cc"+ + "\3\2\2\2\u09cf\u09d2\5\u012e\u0098\2\u09d0\u09d1\7\4\2\2\u09d1\u09d3\7"+ + "\u00c2\2\2\u09d2\u09d0\3\2\2\2\u09d2\u09d3\3\2\2\2\u09d3\u019d\3\2\2\2"+ + "\u09d4\u09d5\7 \2\2\u09d5\u09d6\7!\2\2\u09d6\u09d7\5\u0092J\2\u09d7\u019f"+ + "\3\2\2\2\u09d8\u09d9\7\"\2\2\u09d9\u09da\5\u012e\u0098\2\u09da\u01a1\3"+ + "\2\2\2\u09db\u09dc\7\u00a9\2\2\u09dc\u09dd\7\u0086\2\2\u09dd\u09de\5\u014c"+ + "\u00a7\2\u09de\u09df\7\u0087\2\2\u09df\u09e3\7\u0084\2\2\u09e0\u09e2\5"+ + "l\67\2\u09e1\u09e0\3\2\2\2\u09e2\u09e5\3\2\2\2\u09e3\u09e1\3\2\2\2\u09e3"+ + "\u09e4\3\2\2\2\u09e4\u09e6\3\2\2\2\u09e5\u09e3\3\2\2\2\u09e6\u09e7\7\u0085"+ + "\2\2\u09e7\u01a3\3\2\2\2\u09e8\u09ea\5\u00fc\177\2\u09e9\u09eb\5\u01ae"+ + "\u00d8\2\u09ea\u09e9\3\2\2\2\u09ea\u09eb\3\2\2\2\u09eb\u09ef\3\2\2\2\u09ec"+ + "\u09ee\5\u0104\u0083\2\u09ed\u09ec\3\2\2\2\u09ee\u09f1\3\2\2\2\u09ef\u09ed"+ + "\3\2\2\2\u09ef\u09f0\3\2\2\2\u09f0\u09f3\3\2\2\2\u09f1\u09ef\3\2\2\2\u09f2"+ + "\u09f4\5\u01b0\u00d9\2\u09f3\u09f2\3\2\2\2\u09f3\u09f4\3\2\2\2\u09f4\u09f8"+ + "\3\2\2\2\u09f5\u09f7\5\u0104\u0083\2\u09f6\u09f5\3\2\2\2\u09f7\u09fa\3"+ + "\2\2\2\u09f8\u09f6\3\2\2\2\u09f8\u09f9\3\2\2\2\u09f9\u09fc\3\2\2\2\u09fa"+ + "\u09f8\3\2\2\2\u09fb\u09fd\5\u01ae\u00d8\2\u09fc\u09fb\3\2\2\2\u09fc\u09fd"+ + "\3\2\2\2\u09fd\u0a00\3\2\2\2\u09fe\u09ff\7\4\2\2\u09ff\u0a01\7\u00c2\2"+ + "\2\u0a00\u09fe\3\2\2\2\u0a00\u0a01\3\2\2\2\u0a01\u01a5\3\2\2\2\u0a02\u0a03"+ + "\7\64\2\2\u0a03\u0a09\5\u01b4\u00db\2\u0a04\u0a05\5\u01b4\u00db\2\u0a05"+ + "\u0a06\7\64\2\2\u0a06\u0a09\3\2\2\2\u0a07\u0a09\5\u01b4\u00db\2\u0a08"+ + "\u0a02\3\2\2\2\u0a08\u0a04\3\2\2\2\u0a08\u0a07\3\2\2\2\u0a09\u0a0a\3\2"+ + "\2\2\u0a0a\u0a0d\5\u01a4\u00d3\2\u0a0b\u0a0c\7\36\2\2\u0a0c\u0a0e\5\u012e"+ + "\u0098\2\u0a0d\u0a0b\3\2\2\2\u0a0d\u0a0e\3\2\2\2\u0a0e\u01a7\3\2\2\2\u0a0f"+ + "\u0a10\7.\2\2\u0a10\u0a11\t\33\2\2\u0a11\u0a16\7)\2\2\u0a12\u0a13\7\u00b8"+ + "\2\2\u0a13\u0a17\5\u01b6\u00dc\2\u0a14\u0a15\7\u00b8\2\2\u0a15\u0a17\7"+ + "(\2\2\u0a16\u0a12\3\2\2\2\u0a16\u0a14\3\2\2\2\u0a17\u0a1e\3\2\2\2\u0a18"+ + "\u0a19\7.\2\2\u0a19\u0a1a\7-\2\2\u0a1a\u0a1b\7)\2\2\u0a1b\u0a1c\7\u00b8"+ + "\2\2\u0a1c\u0a1e\5\u01b6\u00dc\2\u0a1d\u0a0f\3\2\2\2\u0a1d\u0a18\3\2\2"+ + "\2\u0a1e\u01a9\3\2\2\2\u0a1f\u0a23\5\u01ac\u00d7\2\u0a20\u0a21\7%\2\2"+ + "\u0a21\u0a24\7!\2\2\u0a22\u0a24\7\u0083\2\2\u0a23\u0a20\3\2\2\2\u0a23"+ + "\u0a22\3\2\2\2\u0a24\u0a25\3\2\2\2\u0a25\u0a26\5\u01aa\u00d6\2\u0a26\u0a3a"+ + "\3\2\2\2\u0a27\u0a28\7\u0086\2\2\u0a28\u0a29\5\u01aa\u00d6\2\u0a29\u0a2a"+ + "\7\u0087\2\2\u0a2a\u0a3a\3\2\2\2\u0a2b\u0a2c\7\u0094\2\2\u0a2c\u0a32\5"+ + "\u01ac\u00d7\2\u0a2d\u0a2e\7\u009b\2\2\u0a2e\u0a33\5\u01ac\u00d7\2\u0a2f"+ + "\u0a30\7&\2\2\u0a30\u0a31\7\u00b8\2\2\u0a31\u0a33\5\u01b6\u00dc\2\u0a32"+ + "\u0a2d\3\2\2\2\u0a32\u0a2f\3\2\2\2\u0a33\u0a3a\3\2\2\2\u0a34\u0a35\5\u01ac"+ + "\u00d7\2\u0a35\u0a36\t\34\2\2\u0a36\u0a37\5\u01ac\u00d7\2\u0a37\u0a3a"+ + "\3\2\2\2\u0a38\u0a3a\5\u01ac\u00d7\2\u0a39\u0a1f\3\2\2\2\u0a39\u0a27\3"+ + "\2\2\2\u0a39\u0a2b\3\2\2\2\u0a39\u0a34\3\2\2\2\u0a39\u0a38\3\2\2\2\u0a3a"+ + "\u01ab\3\2\2\2\u0a3b\u0a3d\5\u00fc\177\2\u0a3c\u0a3e\5\u01ae\u00d8\2\u0a3d"+ + "\u0a3c\3\2\2\2\u0a3d\u0a3e\3\2\2\2\u0a3e\u0a40\3\2\2\2\u0a3f\u0a41\5\u00d8"+ + "m\2\u0a40\u0a3f\3\2\2\2\u0a40\u0a41\3\2\2\2\u0a41\u0a44\3\2\2\2\u0a42"+ + "\u0a43\7\4\2\2\u0a43\u0a45\7\u00c2\2\2\u0a44\u0a42\3\2\2\2\u0a44\u0a45"+ + "\3\2\2\2\u0a45\u01ad\3\2\2\2\u0a46\u0a47\7$\2\2\u0a47\u0a48\5\u012e\u0098"+ + "\2\u0a48\u01af\3\2\2\2\u0a49\u0a4a\7\'\2\2\u0a4a\u0a4b\5\u0104\u0083\2"+ + "\u0a4b\u01b1\3\2\2\2\u0a4c\u0a4d\t\35\2\2\u0a4d\u01b3\3\2\2\2\u0a4e\u0a4f"+ + "\7\62\2\2\u0a4f\u0a50\7\60\2\2\u0a50\u0a5e\7b\2\2\u0a51\u0a52\7\61\2\2"+ + "\u0a52\u0a53\7\60\2\2\u0a53\u0a5e\7b\2\2\u0a54\u0a55\7\63\2\2\u0a55\u0a56"+ + "\7\60\2\2\u0a56\u0a5e\7b\2\2\u0a57\u0a58\7\60\2\2\u0a58\u0a5e\7b\2\2\u0a59"+ + "\u0a5b\7/\2\2\u0a5a\u0a59\3\2\2\2\u0a5a\u0a5b\3\2\2\2\u0a5b\u0a5c\3\2"+ + "\2\2\u0a5c\u0a5e\7b\2\2\u0a5d\u0a4e\3\2\2\2\u0a5d\u0a51\3\2\2\2\u0a5d"+ + "\u0a54\3\2\2\2\u0a5d\u0a57\3\2\2\2\u0a5d\u0a5a\3\2\2\2\u0a5e\u01b5\3\2"+ + "\2\2\u0a5f\u0a60\t\36\2\2\u0a60\u01b7\3\2\2\2\u0a61\u0a63\5\u01ba\u00de"+ + "\2\u0a62\u0a61\3\2\2\2\u0a63\u0a64\3\2\2\2\u0a64\u0a62\3\2\2\2\u0a64\u0a65"+ + "\3\2\2\2\u0a65\u0a69\3\2\2\2\u0a66\u0a68\5\u01bc\u00df\2\u0a67\u0a66\3"+ + "\2\2\2\u0a68\u0a6b\3\2\2\2\u0a69\u0a67\3\2\2\2\u0a69\u0a6a\3\2\2\2\u0a6a"+ + "\u0a6d\3\2\2\2\u0a6b\u0a69\3\2\2\2\u0a6c\u0a6e\5\u01be\u00e0\2\u0a6d\u0a6c"+ + "\3\2\2\2\u0a6d\u0a6e\3\2\2\2\u0a6e\u01b9\3\2\2\2\u0a6f\u0a70\7\u00c5\2"+ + "\2\u0a70\u0a71\5\u01c0\u00e1\2\u0a71\u01bb\3\2\2\2\u0a72\u0a76\5\u01ce"+ + "\u00e8\2\u0a73\u0a75\5\u01c2\u00e2\2\u0a74\u0a73\3\2\2\2\u0a75\u0a78\3"+ + "\2\2\2\u0a76\u0a74\3\2\2\2\u0a76\u0a77\3\2\2\2\u0a77\u01bd\3\2\2\2\u0a78"+ + "\u0a76\3\2\2\2\u0a79\u0a7d\5\u01d0\u00e9\2\u0a7a\u0a7c\5\u01c4\u00e3\2"+ + "\u0a7b\u0a7a\3\2\2\2\u0a7c\u0a7f\3\2\2\2\u0a7d\u0a7b\3\2\2\2\u0a7d\u0a7e"+ + "\3\2\2\2\u0a7e\u01bf\3\2\2\2\u0a7f\u0a7d\3\2\2\2\u0a80\u0a82\5\u01c6\u00e4"+ + "\2\u0a81\u0a80\3\2\2\2\u0a81\u0a82\3\2\2\2\u0a82\u01c1\3\2\2\2\u0a83\u0a85"+ + "\7\u00c5\2\2\u0a84\u0a86\5\u01c6\u00e4\2\u0a85\u0a84\3\2\2\2\u0a85\u0a86"+ + "\3\2\2\2\u0a86\u01c3\3\2\2\2\u0a87\u0a89\7\u00c5\2\2\u0a88\u0a8a\5\u01c6"+ + "\u00e4\2\u0a89\u0a88\3\2\2\2\u0a89\u0a8a\3\2\2\2\u0a8a\u01c5\3\2\2\2\u0a8b"+ + "\u0a95\7\u00ce\2\2\u0a8c\u0a95\7\u00cd\2\2\u0a8d\u0a95\7\u00cb\2\2\u0a8e"+ + "\u0a95\7\u00cc\2\2\u0a8f\u0a95\5\u01c8\u00e5\2\u0a90\u0a95\5\u01d4\u00eb"+ + "\2\u0a91\u0a95\5\u01d8\u00ed\2\u0a92\u0a95\5\u01dc\u00ef\2\u0a93\u0a95"+ + "\7\u00d2\2\2\u0a94\u0a8b\3\2\2\2\u0a94\u0a8c\3\2\2\2\u0a94\u0a8d\3\2\2"+ + "\2\u0a94\u0a8e\3\2\2\2\u0a94\u0a8f\3\2\2\2\u0a94\u0a90\3\2\2\2\u0a94\u0a91"+ + "\3\2\2\2\u0a94\u0a92\3\2\2\2\u0a94\u0a93\3\2\2\2\u0a95\u0a96\3\2\2\2\u0a96"+ + "\u0a94\3\2\2\2\u0a96\u0a97\3\2\2\2\u0a97\u01c7\3\2\2\2\u0a98\u0a99\5\u01ca"+ + "\u00e6\2\u0a99\u01c9\3\2\2\2\u0a9a\u0a9b\5\u01cc\u00e7\2\u0a9b\u0a9c\5"+ + "\u01d4\u00eb\2\u0a9c\u01cb\3\2\2\2\u0a9d\u0a9e\7\u00d2\2\2\u0a9e\u01cd"+ + "\3\2\2\2\u0a9f\u0aa0\7\u00c6\2\2\u0aa0\u0aa1\5\u01d2\u00ea\2\u0aa1\u0aa3"+ + "\7\u00d7\2\2\u0aa2\u0aa4\5\u01c6\u00e4\2\u0aa3\u0aa2\3\2\2\2\u0aa3\u0aa4"+ + "\3\2\2\2\u0aa4\u01cf\3\2\2\2\u0aa5\u0aa7\7\u00c7\2\2\u0aa6\u0aa8\5\u01c6"+ + "\u00e4\2\u0aa7\u0aa6\3\2\2\2\u0aa7\u0aa8\3\2\2\2\u0aa8\u01d1\3\2\2\2\u0aa9"+ + "\u0aaa\7\u00d6\2\2\u0aaa\u01d3\3\2\2\2\u0aab\u0aac\7\u00cf\2\2\u0aac\u0aad"+ + "\5\u01d6\u00ec\2\u0aad\u0aae\7\u00da\2\2\u0aae\u01d5\3\2\2\2\u0aaf\u0ab0"+ + "\7\u00d9\2\2\u0ab0\u01d7\3\2\2\2\u0ab1\u0ab2\7\u00d0\2\2\u0ab2\u0ab3\5"+ + "\u01da\u00ee\2\u0ab3\u0ab4\7\u00dc\2\2\u0ab4\u01d9\3\2\2\2\u0ab5\u0ab6"+ + "\7\u00db\2\2\u0ab6\u01db\3\2\2\2\u0ab7\u0ab8\7\u00d1\2\2\u0ab8\u0ab9\5"+ + "\u01de\u00f0\2\u0ab9\u0aba\7\u00de\2\2\u0aba\u01dd\3\2\2\2\u0abb\u0abc"+ + "\7\u00dd\2\2\u0abc\u01df\3\2\2\2\u0141\u01e2\u01e4\u01e8\u01ed\u01f3\u01fd"+ + "\u0201\u020c\u0211\u021d\u0221\u022b\u0234\u023a\u023f\u0242\u024a\u0250"+ + "\u0253\u025b\u0260\u0265\u0273\u0276\u027b\u0282\u0286\u0289\u0293\u0295"+ + "\u029f\u02a3\u02a9\u02b0\u02b6\u02ba\u02ca\u02cf\u02d3\u02d6\u02dc\u02df"+ + "\u02e2\u02e5\u02e9\u02f2\u02f5\u02fa\u02fe\u0306\u0310\u0314\u031b\u031f"+ + "\u0322\u0327\u032b\u0331\u033b\u0343\u034b\u0352\u0357\u0361\u0364\u0367"+ + "\u036a\u0373\u0379\u037e\u0385\u0389\u038b\u0393\u039e\u03a3\u03a6\u03b2"+ + "\u03b6\u03bc\u03c4\u03c8\u03ec\u03f2\u03f6\u03fd\u0401\u040a\u0426\u042d"+ + "\u0431\u0438\u0440\u0443\u044c\u0453\u0460\u0465\u0469\u0473\u0476\u047b"+ + "\u0481\u048a\u048e\u0496\u04ba\u04c1\u04c5\u04cd\u04d9\u04e3\u04ee\u04f8"+ + "\u0501\u0508\u0510\u0517\u051c\u0520\u0525\u052e\u0533\u053b\u0542\u0547"+ + "\u054a\u0556\u055d\u0562\u0569\u056e\u0571\u0578\u057d\u0580\u058a\u0598"+ + "\u059d\u05a0\u05a2\u05af\u05b4\u05b7\u05b9\u05be\u05c6\u05ca\u05d2\u05d7"+ + "\u05da\u05ec\u05f2\u05f4\u05f8\u0608\u060d\u0611\u061f\u0624\u0627\u0629"+ + "\u062e\u0633\u0637\u063b\u0641\u0647\u0650\u065a\u066a\u0674\u067d\u0680"+ + "\u0683\u068e\u0698\u06a7\u06b0\u06b6\u06bc\u06c4\u06cd\u06d7\u06e4\u06e6"+ + "\u06f5\u06fa\u0702\u070b\u0711\u0716\u071a\u0725\u072d\u0732\u0735\u0738"+ + "\u073b\u073d\u0742\u0748\u0754\u075c\u0766\u0770\u077a\u078f\u079d\u07a1"+ + "\u07b2\u07b5\u07b8\u07c6\u07cd\u07d1\u0801\u0803\u080d\u0815\u0817\u081f"+ + "\u0822\u0828\u082c\u0831\u0848\u084e\u0854\u085c\u0864\u086e\u0878\u087e"+ + "\u0882\u088e\u0897\u089c\u08a0\u08a5\u08a8\u08ab\u08af\u08b7\u08d2\u08d5"+ + "\u08db\u08de\u08e2\u08ec\u08f2\u08fc\u0903\u0911\u091d\u092c\u092f\u0932"+ + "\u0936\u093f\u0943\u094e\u0952\u0958\u095e\u0968\u096b\u096e\u0972\u0979"+ + "\u097c\u097f\u0982\u0989\u0990\u0993\u0996\u0999\u099c\u09a1\u09a5\u09b2"+ + "\u09b7\u09bf\u09c2\u09c5\u09cc\u09d2\u09e3\u09ea\u09ef\u09f3\u09f8\u09fc"+ + "\u0a00\u0a08\u0a0d\u0a16\u0a1d\u0a23\u0a32\u0a39\u0a3d\u0a40\u0a44\u0a5a"+ + "\u0a5d\u0a64\u0a69\u0a6d\u0a76\u0a7d\u0a81\u0a85\u0a89\u0a94\u0a96\u0aa3"+ + "\u0aa7"; public static final String _serializedATN = Utils.join( new String[] { _serializedATNSegment0, diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.tokens b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.tokens index 935c5fadafc6..b546cef24915 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.tokens +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.tokens @@ -183,81 +183,82 @@ DecimalIntegerLiteral=182 HexIntegerLiteral=183 HexadecimalFloatingPointLiteral=184 DecimalFloatingPointNumber=185 -BooleanLiteral=186 -QuotedStringLiteral=187 -Base16BlobLiteral=188 -Base64BlobLiteral=189 -NullLiteral=190 -Identifier=191 -XMLLiteralStart=192 -StringTemplateLiteralStart=193 -DocumentationLineStart=194 -ParameterDocumentationStart=195 -ReturnParameterDocumentationStart=196 -WS=197 -NEW_LINE=198 -LINE_COMMENT=199 -VARIABLE=200 -MODULE=201 -ReferenceType=202 -DocumentationText=203 -SingleBacktickStart=204 -DoubleBacktickStart=205 -TripleBacktickStart=206 -DefinitionReference=207 -DocumentationEscapedCharacters=208 -DocumentationSpace=209 -DocumentationEnd=210 -ParameterName=211 -DescriptionSeparator=212 -DocumentationParamEnd=213 -SingleBacktickContent=214 -SingleBacktickEnd=215 -DoubleBacktickContent=216 -DoubleBacktickEnd=217 -TripleBacktickContent=218 -TripleBacktickEnd=219 -XML_COMMENT_START=220 -CDATA=221 -DTD=222 -EntityRef=223 -CharRef=224 -XML_TAG_OPEN=225 -XML_TAG_OPEN_SLASH=226 -XML_TAG_SPECIAL_OPEN=227 -XMLLiteralEnd=228 -XMLTemplateText=229 -XMLText=230 -XML_TAG_CLOSE=231 -XML_TAG_SPECIAL_CLOSE=232 -XML_TAG_SLASH_CLOSE=233 -SLASH=234 -QNAME_SEPARATOR=235 -EQUALS=236 -DOUBLE_QUOTE=237 -SINGLE_QUOTE=238 -XMLQName=239 -XML_TAG_WS=240 -DOUBLE_QUOTE_END=241 -XMLDoubleQuotedTemplateString=242 -XMLDoubleQuotedString=243 -SINGLE_QUOTE_END=244 -XMLSingleQuotedTemplateString=245 -XMLSingleQuotedString=246 -XMLPIText=247 -XMLPITemplateText=248 -XML_COMMENT_END=249 -XMLCommentTemplateText=250 -XMLCommentText=251 -TripleBackTickInlineCodeEnd=252 -TripleBackTickInlineCode=253 -DoubleBackTickInlineCodeEnd=254 -DoubleBackTickInlineCode=255 -SingleBackTickInlineCodeEnd=256 -SingleBackTickInlineCode=257 -StringTemplateLiteralEnd=258 -StringTemplateExpressionStart=259 -StringTemplateText=260 +DecimalExtendedFloatingPointNumber=186 +BooleanLiteral=187 +QuotedStringLiteral=188 +Base16BlobLiteral=189 +Base64BlobLiteral=190 +NullLiteral=191 +Identifier=192 +XMLLiteralStart=193 +StringTemplateLiteralStart=194 +DocumentationLineStart=195 +ParameterDocumentationStart=196 +ReturnParameterDocumentationStart=197 +WS=198 +NEW_LINE=199 +LINE_COMMENT=200 +VARIABLE=201 +MODULE=202 +ReferenceType=203 +DocumentationText=204 +SingleBacktickStart=205 +DoubleBacktickStart=206 +TripleBacktickStart=207 +DefinitionReference=208 +DocumentationEscapedCharacters=209 +DocumentationSpace=210 +DocumentationEnd=211 +ParameterName=212 +DescriptionSeparator=213 +DocumentationParamEnd=214 +SingleBacktickContent=215 +SingleBacktickEnd=216 +DoubleBacktickContent=217 +DoubleBacktickEnd=218 +TripleBacktickContent=219 +TripleBacktickEnd=220 +XML_COMMENT_START=221 +CDATA=222 +DTD=223 +EntityRef=224 +CharRef=225 +XML_TAG_OPEN=226 +XML_TAG_OPEN_SLASH=227 +XML_TAG_SPECIAL_OPEN=228 +XMLLiteralEnd=229 +XMLTemplateText=230 +XMLText=231 +XML_TAG_CLOSE=232 +XML_TAG_SPECIAL_CLOSE=233 +XML_TAG_SLASH_CLOSE=234 +SLASH=235 +QNAME_SEPARATOR=236 +EQUALS=237 +DOUBLE_QUOTE=238 +SINGLE_QUOTE=239 +XMLQName=240 +XML_TAG_WS=241 +DOUBLE_QUOTE_END=242 +XMLDoubleQuotedTemplateString=243 +XMLDoubleQuotedString=244 +SINGLE_QUOTE_END=245 +XMLSingleQuotedTemplateString=246 +XMLSingleQuotedString=247 +XMLPIText=248 +XMLPITemplateText=249 +XML_COMMENT_END=250 +XMLCommentTemplateText=251 +XMLCommentText=252 +TripleBackTickInlineCodeEnd=253 +TripleBackTickInlineCode=254 +DoubleBackTickInlineCodeEnd=255 +DoubleBackTickInlineCode=256 +SingleBackTickInlineCodeEnd=257 +SingleBackTickInlineCode=258 +StringTemplateLiteralEnd=259 +StringTemplateExpressionStart=260 +StringTemplateText=261 'import'=1 'as'=2 'public'=3 @@ -422,13 +423,13 @@ StringTemplateText=260 '>>>='=179 '..<'=180 '.@'=181 -'null'=190 -'variable'=200 -'module'=201 -''=249 +'null'=191 +'variable'=201 +'module'=202 +''=250 diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java index e89fb70d6d2d..5c246360abb0 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java @@ -1,4 +1,4 @@ -// Generated from BallerinaParser.g4 by ANTLR 4.5.3 +// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.ParserRuleContext; @@ -47,6 +47,18 @@ public class BallerinaParserBaseListener implements BallerinaParserListener { *

    The default implementation does nothing.

    */ @Override public void exitVersion(BallerinaParser.VersionContext ctx) { } + /** + * {@inheritDoc} + * + *

    The default implementation does nothing.

    + */ + @Override public void enterVersionPattern(BallerinaParser.VersionPatternContext ctx) { } + /** + * {@inheritDoc} + * + *

    The default implementation does nothing.

    + */ + @Override public void exitVersionPattern(BallerinaParser.VersionPatternContext ctx) { } /** * {@inheritDoc} * diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java index 8280fca95e3c..edbdc904357a 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java @@ -1,4 +1,4 @@ -// Generated from BallerinaParser.g4 by ANTLR 4.5.3 +// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.tree.ParseTreeListener; @@ -37,6 +37,16 @@ public interface BallerinaParserListener extends ParseTreeListener { * @param ctx the parse tree */ void exitVersion(BallerinaParser.VersionContext ctx); + /** + * Enter a parse tree produced by {@link BallerinaParser#versionPattern}. + * @param ctx the parse tree + */ + void enterVersionPattern(BallerinaParser.VersionPatternContext ctx); + /** + * Exit a parse tree produced by {@link BallerinaParser#versionPattern}. + * @param ctx the parse tree + */ + void exitVersionPattern(BallerinaParser.VersionPatternContext ctx); /** * Enter a parse tree produced by {@link BallerinaParser#importDeclaration}. * @param ctx the parse tree diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java index da30ef3abecb..46affa41f809 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java @@ -368,6 +368,10 @@ public void visit(BLangAnnotation annotationNode) { } } + private boolean isNullOrEmpty(String s) { + return s == null || s.isEmpty(); + } + @Override public void visit(BLangImportPackage importPkgNode) { Name pkgAlias = names.fromIdNode(importPkgNode.alias); @@ -390,29 +394,32 @@ public void visit(BLangImportPackage importPkgNode) { Name orgName; Name version; PackageID enclPackageID = env.enclPkg.packageID; - if (importPkgNode.orgName.value == null || importPkgNode.orgName.value.isEmpty()) { - // means it's in 'import ' style - orgName = enclPackageID.orgName; - version = (Names.DEFAULT_VERSION.equals(enclPackageID.version)) ? new Name("") : enclPackageID.version; - } else if (importPkgNode.orgName.value.equals(enclPackageID.orgName.value)) { - // means it's in 'import /' style and is used to import within same project + // The pattern of the import statement is 'import [org-name /] module-name [version sem-ver]' + // Three cases should be considered here. + // 1. import org-name/module-name version + // 2. import org-name/module-name + // 2a. same project + // 2b. different project + // 3. import module-name + if (!isNullOrEmpty(importPkgNode.orgName.value)) { orgName = names.fromIdNode(importPkgNode.orgName); - // Here we set the version to enclosing package version. Following cases will be handled properly: - // 1) Suppose the import is from the same project, then the enclosing package version set here will be used - // to lookup package symbol cache, avoiding re-defining package symbol. - String pkgName = importPkgNode.getPackageName().stream() - .map(id -> id.value) - .collect(Collectors.joining(".")); - if (this.sourceDirectory.getSourcePackageNames().contains(pkgName)) { - version = enclPackageID.version; + if (!isNullOrEmpty(importPkgNode.version.value)) { + version = names.fromIdNode(importPkgNode.version); } else { - version = new Name(""); + String pkgName = importPkgNode.getPackageName().stream() + .map(id -> id.value) + .collect(Collectors.joining(".")); + if (this.sourceDirectory.getSourcePackageNames().contains(pkgName)) { + version = enclPackageID.version; + } else { + version = Names.EMPTY; + } } } else { - // means it's in 'import /' style - orgName = names.fromIdNode(importPkgNode.orgName); - version = names.fromIdNode(importPkgNode.version); + orgName = enclPackageID.orgName; + version = (Names.DEFAULT_VERSION.equals(enclPackageID.version)) ? Names.EMPTY : enclPackageID.version; } + List nameComps = importPkgNode.pkgNameComps.stream() .map(identifier -> names.fromIdNode(identifier)) .collect(Collectors.toList()); diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java index dde685c5772d..4dd0ce070538 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java @@ -130,8 +130,8 @@ public String getQualifiedPackageName() { versionStr = " version " + versionStr; } - String aliasStr = (this.version.value != null) ? this.version.value : ""; - if (!aliasStr.isEmpty()) { + String aliasStr = (this.alias.value != null) ? this.alias.value : ""; + if (!aliasStr.isEmpty() & !aliasStr.equals(pkgName)) { aliasStr = " as " + aliasStr; } diff --git a/compiler/ballerina-lang/src/main/resources/compiler.properties b/compiler/ballerina-lang/src/main/resources/compiler.properties index 2849a0f6ed9e..c52abbadded8 100644 --- a/compiler/ballerina-lang/src/main/resources/compiler.properties +++ b/compiler/ballerina-lang/src/main/resources/compiler.properties @@ -1176,9 +1176,6 @@ error.invalid.use.of.null.literal=\ error.type.param.outside.lang.module=\ type params are not supported here -error.versioned.import.not.supported=\ - versioned import is not supported - error.invalid.lvalue.lhs.of.assignment=\ invocations are not supported on the left hand side of an assignment diff --git a/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 b/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 index 9a966efe4d1e..cbb7e0a890b4 100644 --- a/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 +++ b/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 @@ -303,6 +303,10 @@ DecimalFloatingPointNumber | DottedDecimalNumber ExponentPart? DecimalFloatSelector? ; +DecimalExtendedFloatingPointNumber + : DecimalFloatingPointNumber DOT DecimalNumeral + ; + fragment ExponentPart : ExponentIndicator SignedInteger diff --git a/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 b/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 index decef2f63903..39eb67a22a68 100644 --- a/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 +++ b/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 @@ -19,7 +19,13 @@ packageName ; version - : VERSION Identifier + : VERSION versionPattern + ; + +versionPattern + : DecimalIntegerLiteral + | DecimalFloatingPointNumber + | DecimalExtendedFloatingPointNumber ; importDeclaration diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java index aa63fe5f927c..30409349e5b8 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java @@ -60,6 +60,7 @@ import static org.ballerinalang.compiler.CompilerOptionName.COMPILER_PHASE; import static org.ballerinalang.compiler.CompilerOptionName.EXPERIMENTAL_FEATURES_ENABLED; +import static org.ballerinalang.compiler.CompilerOptionName.LOCK_ENABLED; import static org.ballerinalang.compiler.CompilerOptionName.PRESERVE_WHITESPACE; import static org.ballerinalang.compiler.CompilerOptionName.PROJECT_DIR; import static org.ballerinalang.test.util.TestConstant.ENABLE_JBALLERINA_TESTS; @@ -495,6 +496,7 @@ public static CompileResult compileOnJBallerina(CompilerContext context, String options.put(PROJECT_DIR, sourceRoot); options.put(COMPILER_PHASE, CompilerPhase.BIR_GEN.toString()); options.put(PRESERVE_WHITESPACE, "false"); + options.put(LOCK_ENABLED, Boolean.toString(true)); options.put(CompilerOptionName.EXPERIMENTAL_FEATURES_ENABLED, Boolean.TRUE.toString()); CompileResult compileResult = compile(context, packageName, CompilerPhase.BIR_GEN, false); diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BFileUtil.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BFileUtil.java index b06a380cf1c6..a136c70748b6 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BFileUtil.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BFileUtil.java @@ -28,6 +28,8 @@ import java.nio.file.SimpleFileVisitor; import java.nio.file.StandardCopyOption; import java.nio.file.attribute.BasicFileAttributes; +import java.util.List; +import java.util.stream.Collectors; /** * Utility methods for doing file operations. @@ -132,4 +134,22 @@ public static String getQualifiedClassName(String orgName, String packageName, S return className; } + + /** + * Delete all the files which are listed according to a given pattern. + * + * @param path Path to the directory + * @param pattern Filter pattern + * @throws IOException Failed when deleting + */ + public static void deleteAll(Path path, String pattern) throws IOException { + if (!Files.exists(path)) { + return; + } + List files = Files.find(path, Integer.MAX_VALUE, (p, attribute) -> + p.toString().contains(pattern)).collect(Collectors.toList()); + for (Path file : files) { + BFileUtil.delete(file); + } + } } diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java new file mode 100644 index 000000000000..bf3074324594 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.ballerinalang.test.balo.imports; + +import org.ballerinalang.model.values.BInteger; +import org.ballerinalang.model.values.BValue; +import org.ballerinalang.test.balo.BaloCreator; +import org.ballerinalang.test.util.BCompileUtil; +import org.ballerinalang.test.util.BFileUtil; +import org.ballerinalang.test.util.BRunUtil; +import org.ballerinalang.test.util.CompileResult; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Test cases for multiple version support. + */ +public class ImportsTests { + + private static final String USER_HOME = "user.home"; + private String previousUserHome; + + @BeforeClass(description = "Build the necessary modules.") + public void setup() throws IOException { + Path tempDir = Files.createTempDirectory("temp-bal-home"); + Path tempBir = Paths.get(System.getProperty("user.dir"), "build", "test-bir-temp"); + Path imports = Paths.get("test-src", "balo", "imports"); + Path homeBirCache = tempDir.resolve(Paths.get(".ballerina", "bir_cache")); + List birFiles; + + previousUserHome = System.getProperty(USER_HOME); + System.setProperty(USER_HOME, tempDir.toString()); + + // Delete all existing bir files. + BFileUtil.deleteAll(tempBir, "testModule.bir"); + + BaloCreator.createAndSetupBalo(imports.resolve(Paths.get("test_module1", "test_module")).toString(), + "testOrg", "testModule"); + birFiles = Files.find(tempBir, Integer.MAX_VALUE, (path, attribute) -> + path.toString().contains("testModule.bir") + && !path.toString().contains("imports")).collect(Collectors.toList()); + Path birDir = Files.createDirectories(homeBirCache.resolve(Paths.get("testOrg", "testModule", "1.1.0"))); + BFileUtil.copy(birFiles.get(0), birDir.resolve(Paths.get("testModule.bir"))); + BFileUtil.delete(birFiles.get(0)); + + BaloCreator.createAndSetupBalo(imports.resolve(Paths.get("test_module2", "test_module")).toString(), + "testOrg", "testModule"); + birFiles = Files.find(tempBir, Integer.MAX_VALUE, (path, attribute) -> + path.toString().contains("testModule.bir") + && !path.toString().contains("imports")).collect(Collectors.toList()); + birDir = Files.createDirectories(homeBirCache.resolve(Paths.get("testOrg", "testModule", "1.1.1"))); + BFileUtil.copy(birFiles.get(0), birDir.resolve(Paths.get("testModule.bir"))); + BFileUtil.delete(birFiles.get(0)); + + BaloCreator.createAndSetupBalo(imports.resolve(Paths.get("test_module3", "test_module")).toString(), + "testOrg", "testModule"); + birFiles = Files.find(tempBir, Integer.MAX_VALUE, (path, attribute) -> + path.toString().contains("testModule.bir") + && !path.toString().contains("imports")).collect(Collectors.toList()); + birDir = Files.createDirectories(homeBirCache.resolve(Paths.get("testOrg", "testModule", "1.1.2"))); + BFileUtil.copy(birFiles.get(0), birDir.resolve(Paths.get("testModule.bir"))); + BFileUtil.delete(birFiles.get(0)); + } + + @Test(description = "Get the version from the source file.") + public void testVersionSupportImportFromSourceFile() { + CompileResult result = BCompileUtil.compile(this, "/test-src/balo/imports/test-case1/", "testCase1"); + BValue[] returns = BRunUtil.invoke(result, "cal"); + Assert.assertEquals(returns.length, 1); + Assert.assertTrue(returns[0] instanceof BInteger); + Assert.assertEquals(((BInteger) returns[0]).intValue(), 20); + } + + @Test(description = "Get the version from the toml file.") + public void testVersionSupportImportFromTomlFile() { + CompileResult result = BCompileUtil.compile(this, "/test-src/balo/imports/test-case2/", "testCase2"); + BValue[] returns = BRunUtil.invoke(result, "cal"); + Assert.assertEquals(returns.length, 1); + Assert.assertTrue(returns[0] instanceof BInteger); + Assert.assertEquals(((BInteger) returns[0]).intValue(), 25); + } + + @Test(description = "Get the version from the lock file.") + public void testVersionSupportImportFromLockFile() { + CompileResult result = BCompileUtil.compile(this, "/test-src/balo/imports/test-case3/", "testCase3"); + BValue[] returns = BRunUtil.invoke(result, "cal"); + Assert.assertEquals(returns.length, 1); + Assert.assertTrue(returns[0] instanceof BInteger); + Assert.assertEquals(((BInteger) returns[0]).intValue(), 30); + } + + @Test(description = "Get the version from a single source file.") + public void testVersionSupportImportInSingleFile() { + CompileResult result = BCompileUtil.compile("test-src/balo/imports/test-case4/main.bal"); + BValue[] returns = BRunUtil.invoke(result, "cal"); + Assert.assertEquals(returns.length, 1); + Assert.assertTrue(returns[0] instanceof BInteger); + Assert.assertEquals(((BInteger) returns[0]).intValue(), 20); + } + + @Test(description = "Get the version from a single source file without alias.") + public void testVersionSupportImportInSingleFileWithoutAlias() { + CompileResult result = BCompileUtil.compile("test-src/balo/imports/test-case5/main.bal"); + BValue[] returns = BRunUtil.invoke(result, "cal"); + Assert.assertEquals(returns.length, 1); + Assert.assertTrue(returns[0] instanceof BInteger); + Assert.assertEquals(((BInteger) returns[0]).intValue(), 25); + } + + @AfterClass(description = "Set the home to previous location.", alwaysRun = true) + public void cleanup() { + System.setProperty(USER_HOME, previousUserHome); + } +} + + diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/Ballerina.toml b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/Ballerina.toml new file mode 100644 index 000000000000..2577f1792495 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/Ballerina.toml @@ -0,0 +1,5 @@ +[project] +org-name= "testOrg" +version= "1.0.0" + +[dependencies] diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/src/testCase1/main.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/src/testCase1/main.bal new file mode 100644 index 000000000000..8042214f8417 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case1/src/testCase1/main.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import testOrg/testModule version 1.1.0 as foo; + +public function cal() returns int { + return foo:calculate(); +} diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/Ballerina.toml b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/Ballerina.toml new file mode 100644 index 000000000000..49dc3edd27e0 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/Ballerina.toml @@ -0,0 +1,6 @@ +[project] +org-name= "testOrg" +version= "1.0.0" + +[dependencies] +"testOrg/testModule" = "1.1.1" diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/src/testCase2/main.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/src/testCase2/main.bal new file mode 100644 index 000000000000..8042214f8417 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case2/src/testCase2/main.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import testOrg/testModule version 1.1.0 as foo; + +public function cal() returns int { + return foo:calculate(); +} diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.lock b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.lock new file mode 100644 index 000000000000..37e992c301b4 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.lock @@ -0,0 +1,9 @@ +org_name = "testOrg" +version = "1.0.0" +lockfile_version = "1.0.0" +ballerina_version = "1.0.1-SNAPSHOT" + +[[imports."testOrg/testCase3:1.0.0"]] +org_name = "testOrg" +name = "testModule" +version = "1.1.2" diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.toml b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.toml new file mode 100644 index 000000000000..49dc3edd27e0 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/Ballerina.toml @@ -0,0 +1,6 @@ +[project] +org-name= "testOrg" +version= "1.0.0" + +[dependencies] +"testOrg/testModule" = "1.1.1" diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/src/testCase3/main.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/src/testCase3/main.bal new file mode 100644 index 000000000000..8042214f8417 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case3/src/testCase3/main.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import testOrg/testModule version 1.1.0 as foo; + +public function cal() returns int { + return foo:calculate(); +} diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case4/main.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case4/main.bal new file mode 100644 index 000000000000..8042214f8417 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case4/main.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import testOrg/testModule version 1.1.0 as foo; + +public function cal() returns int { + return foo:calculate(); +} diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case5/main.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case5/main.bal new file mode 100644 index 000000000000..a8089754b5f3 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test-case5/main.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +import testOrg/testModule version 1.1.1; + +public function cal() returns int { + return testModule:calculate(); +} diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/Ballerina.toml b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/Ballerina.toml new file mode 100644 index 000000000000..9aba778d1e2a --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/Ballerina.toml @@ -0,0 +1,5 @@ +[project] +org-name= "testOrg" +version= "1.1.0" + +[dependencies] diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/src/testModule/calculate.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/src/testModule/calculate.bal new file mode 100644 index 000000000000..2d9ac38b2eba --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module1/test_module/src/testModule/calculate.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public function calculate() returns int { + return 20; +} diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/Ballerina.toml b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/Ballerina.toml new file mode 100644 index 000000000000..febfbdb5e5af --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/Ballerina.toml @@ -0,0 +1,5 @@ +[project] +org-name= "testOrg" +version= "1.1.1" + +[dependencies] diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/src/testModule/calculate.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/src/testModule/calculate.bal new file mode 100644 index 000000000000..13c69ef02433 --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module2/test_module/src/testModule/calculate.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public function calculate() returns int { + return 25; +} diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/Ballerina.toml b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/Ballerina.toml new file mode 100644 index 000000000000..358ddf9ab59b --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/Ballerina.toml @@ -0,0 +1,5 @@ +[project] +org-name= "testOrg" +version= "1.1.2" + +[dependencies] diff --git a/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/src/testModule/calculate.bal b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/src/testModule/calculate.bal new file mode 100644 index 000000000000..4b16a327697e --- /dev/null +++ b/tests/jballerina-unit-test/src/test/resources/test-src/balo/imports/test_module3/test_module/src/testModule/calculate.bal @@ -0,0 +1,19 @@ +// Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +// +// WSO2 Inc. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +public function calculate() returns int { + return 30; +} From 0d7198bde52f21a6e1ce776c43498dbbf11f71b9 Mon Sep 17 00:00:00 2001 From: kavindu Date: Wed, 23 Oct 2019 16:23:29 +0530 Subject: [PATCH 124/167] Change the way of getting the import qualified name --- .../compiler/parser/antlr4/BallerinaParserBaseListener.java | 2 +- .../compiler/parser/antlr4/BallerinaParserListener.java | 2 +- .../wso2/ballerinalang/compiler/tree/BLangImportPackage.java | 2 +- .../test/statements/packageimport/PackageImportTest.java | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java index 5c246360abb0..01506fe9d840 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserBaseListener.java @@ -1,4 +1,4 @@ -// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 by ANTLR 4.5.3 +// Generated from BallerinaParser.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.ParserRuleContext; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java index edbdc904357a..6dfb932da1cd 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParserListener.java @@ -1,4 +1,4 @@ -// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 by ANTLR 4.5.3 +// Generated from BallerinaParser.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.tree.ParseTreeListener; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java index 4dd0ce070538..ab1e96336b4a 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java @@ -130,7 +130,7 @@ public String getQualifiedPackageName() { versionStr = " version " + versionStr; } - String aliasStr = (this.alias.value != null) ? this.alias.value : ""; + String aliasStr = (this.alias.value != null && !this.alias.value.equals(pkgName)) ? this.alias.value : ""; if (!aliasStr.isEmpty() & !aliasStr.equals(pkgName)) { aliasStr = " as " + aliasStr; } diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/packageimport/PackageImportTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/packageimport/PackageImportTest.java index 884cfbfca0ad..411ec8342e2f 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/packageimport/PackageImportTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/statements/packageimport/PackageImportTest.java @@ -67,7 +67,7 @@ public void testInvalidImport1() { public void testInvalidImport2() { CompileResult result = BCompileUtil.compile("test-src/statements/package/imports/invalid-import-negative2.bal"); Assert.assertEquals(result.getErrorCount(), 1); - BAssertUtil.validateError(result, 0, "cannot resolve module 'foo.x'", 1, 1); + BAssertUtil.validateError(result, 0, "cannot resolve module 'foo.x as x'", 1, 1); } @Test @@ -90,7 +90,7 @@ public void testUnusedImports() { Assert.assertEquals(result.getErrorCount(), 2); int i = 0; BAssertUtil.validateError(result, i++, "unused import module 'ballerina/io'", 1, 1); - BAssertUtil.validateError(result, i++, "unused import module 'ballerina/io'", 2, 1); + BAssertUtil.validateError(result, i++, "unused import module 'ballerina/io as otherIO'", 2, 1); } @Test From 508415c3dbbe578a7e60c9cb3904aafaad74f9f4 Mon Sep 17 00:00:00 2001 From: kavindu Date: Thu, 24 Oct 2019 16:11:20 +0530 Subject: [PATCH 125/167] Fix the checkstyle issues --- .../ballerinalang/compiler/parser/antlr4/BallerinaLexer.java | 2 +- .../ballerinalang/compiler/parser/antlr4/BallerinaParser.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java index f61cc6de9c0d..b194e5641b30 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaLexer.java @@ -1,4 +1,4 @@ -// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaLexer.g4 by ANTLR 4.5.3 +// Generated from BallerinaLexer.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.CharStream; diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java index bc4409d6ad97..5bb987900ff9 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/antlr4/BallerinaParser.java @@ -1,4 +1,4 @@ -// Generated from /home/kavindu/WSO2-GIT/ballerina-lang/compiler/ballerina-lang/src/main/resources/grammar/BallerinaParser.g4 by ANTLR 4.5.3 +// Generated from BallerinaParser.g4 by ANTLR 4.5.3 package org.wso2.ballerinalang.compiler.parser.antlr4; import org.antlr.v4.runtime.atn.*; import org.antlr.v4.runtime.dfa.DFA; From 5d3fa6e5dee3d9466fdbc43f00220129b9f9f9f1 Mon Sep 17 00:00:00 2001 From: kavindu Date: Tue, 29 Oct 2019 15:20:08 +0530 Subject: [PATCH 126/167] Set the alias --- .../ballerinalang/compiler/tree/BLangImportPackage.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java index ab1e96336b4a..928995c2951b 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/tree/BLangImportPackage.java @@ -130,10 +130,8 @@ public String getQualifiedPackageName() { versionStr = " version " + versionStr; } - String aliasStr = (this.alias.value != null && !this.alias.value.equals(pkgName)) ? this.alias.value : ""; - if (!aliasStr.isEmpty() & !aliasStr.equals(pkgName)) { - aliasStr = " as " + aliasStr; - } + String aliasStr = (this.alias.value != null && !this.alias.value.equals(pkgName)) ? + " as " + this.alias.value : ""; return (orgName.isEmpty() ? "" : orgName + '/') + pkgName + versionStr + aliasStr; } From aa43d1db3d7c765458a235fbede0bd563a71288e Mon Sep 17 00:00:00 2001 From: kavindu Date: Tue, 29 Oct 2019 21:28:49 +0530 Subject: [PATCH 127/167] Fix test failures --- .../org/ballerinalang/test/balo/imports/ImportsTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java index bf3074324594..2e5dc41ad96d 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/balo/imports/ImportsTests.java @@ -27,6 +27,7 @@ import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; +import org.wso2.ballerinalang.util.RepoUtils; import java.io.IOException; import java.nio.file.Files; @@ -48,7 +49,8 @@ public void setup() throws IOException { Path tempDir = Files.createTempDirectory("temp-bal-home"); Path tempBir = Paths.get(System.getProperty("user.dir"), "build", "test-bir-temp"); Path imports = Paths.get("test-src", "balo", "imports"); - Path homeBirCache = tempDir.resolve(Paths.get(".ballerina", "bir_cache")); + Path homeBirCache = tempDir.resolve(Paths.get(".ballerina", "bir_cache" + "-" + + RepoUtils.getBallerinaVersion())); List birFiles; previousUserHome = System.getProperty(USER_HOME); From 387df639c0ad7f12319ea9cf50505cf9415c1843 Mon Sep 17 00:00:00 2001 From: kavindu Date: Wed, 30 Oct 2019 13:43:22 +0530 Subject: [PATCH 128/167] Remove unused variable --- .../main/java/org/wso2/ballerinalang/compiler/PackageLoader.java | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java index a94d3c076073..d941632263fa 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/PackageLoader.java @@ -309,7 +309,6 @@ private Resolution resolveModuleByPath(PackageID moduleID) { private void updateModuleIDVersion(PackageID moduleID, PackageID enclPackageId) { String orgName = moduleID.orgName.value; String moduleName = moduleID.name.value; - String moduleVersion; // Set the version from the Ballerina.lock file found in the current project. if (enclPackageId != null && this.hasLockFile(Paths.get(this.options.get(PROJECT_DIR)))) { From da692b02603fab891f07f72484e89c055e337b22 Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Wed, 30 Oct 2019 15:11:37 +0530 Subject: [PATCH 129/167] Fix invalid error returning from redirect client --- .../src/http/redirect/redirect_client.bal | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/stdlib/http/src/main/ballerina/src/http/redirect/redirect_client.bal b/stdlib/http/src/main/ballerina/src/http/redirect/redirect_client.bal index d8f6c9765acb..63634e087172 100644 --- a/stdlib/http/src/main/ballerina/src/http/redirect/redirect_client.bal +++ b/stdlib/http/src/main/ballerina/src/http/redirect/redirect_client.bal @@ -53,10 +53,10 @@ public type RedirectClient client object { # + return - The HTTP `Response` message, or an error if the invocation fails public function get(string path, public RequestMessage message = ()) returns Response|ClientError { var result = performRedirectIfEligible(self, path, message, HTTP_GET); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } @@ -69,10 +69,10 @@ public type RedirectClient client object { # + return - The HTTP `Response` message, or an error if the invocation fails public function post(string path, RequestMessage message) returns Response|ClientError { var result = performRedirectIfEligible(self, path, message, HTTP_POST); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } @@ -85,10 +85,10 @@ public type RedirectClient client object { # + return - The HTTP `Response` message, or an error if the invocation fails public function head(string path, public RequestMessage message = ()) returns Response|ClientError { var result = performRedirectIfEligible(self, path, message, HTTP_HEAD); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } @@ -101,10 +101,10 @@ public type RedirectClient client object { # + return - The HTTP `Response` message, or an error if the invocation fails public function put(string path, RequestMessage message) returns Response|ClientError { var result = performRedirectIfEligible(self, path, message, HTTP_PUT); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } @@ -132,10 +132,10 @@ public type RedirectClient client object { return self.httpClient->execute(httpVerb, path, request); } else { var result = performRedirectIfEligible(self, path, request, extractHttpOperation(httpVerb)); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } } @@ -149,10 +149,10 @@ public type RedirectClient client object { # + return - The HTTP `Response` message, or an error if the invocation fails public function patch(string path, RequestMessage message) returns Response|ClientError { var result = performRedirectIfEligible(self, path, message, HTTP_PATCH); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } @@ -165,10 +165,10 @@ public type RedirectClient client object { # + return - The HTTP `Response` message, or an error if the invocation fails public function delete(string path, public RequestMessage message = ()) returns Response|ClientError { var result = performRedirectIfEligible(self, path, message, HTTP_DELETE); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } @@ -181,10 +181,10 @@ public type RedirectClient client object { # + return - The HTTP `Response` message, or an error if the invocation fails public function options(string path, public RequestMessage message = ()) returns Response|ClientError { var result = performRedirectIfEligible(self, path, message, HTTP_OPTIONS); - if (result is Response) { - return result; - } else { + if (result is HttpFuture) { return getInvalidTypeError(); + } else { + return result; } } From 9e35c1b51c985784de6519ed5071a04be2ed0108 Mon Sep 17 00:00:00 2001 From: wggihan Date: Wed, 30 Oct 2019 16:28:33 +0530 Subject: [PATCH 130/167] Add directory listener BBE --- examples/index.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/index.json b/examples/index.json index 139c69771663..9b2df13671d8 100644 --- a/examples/index.json +++ b/examples/index.json @@ -808,6 +808,15 @@ } ] }, + { + "title": "Listeners", + "column": 1, + "category": "Working over the network", + "samples": [{ + "name": "Directory Listener", + "url": "directory-listener" + }] + }, { "title": "Database", "column": 2, From a1d96b895f48422eda4e5ee2b9b1e7fe548cec8d Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Wed, 30 Oct 2019 17:27:05 +0530 Subject: [PATCH 131/167] Fix checkstyle issue with testerina code --- .../org/ballerinalang/testerina/util/TestarinaClassLoader.java | 1 - 1 file changed, 1 deletion(-) diff --git a/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java b/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java index 214080f8ec10..b2e059ddce8c 100644 --- a/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java +++ b/misc/testerina/modules/testerina-core/src/main/java/org/ballerinalang/testerina/util/TestarinaClassLoader.java @@ -24,7 +24,6 @@ import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Path; -import java.util.Arrays; import java.util.HashSet; import java.util.StringJoiner; From 1da337abc4bea2b9ad28b7e341b4e808a90f2f01 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Wed, 30 Oct 2019 17:32:46 +0530 Subject: [PATCH 132/167] Fix review suggestion --- .../main/java/org/ballerinalang/packerina/cmd/TestCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java index 0b27ea8e21ed..3f199b04ee8c 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/cmd/TestCommand.java @@ -290,7 +290,7 @@ public void printLongDesc(StringBuilder out) { @Override public void printUsage(StringBuilder out) { out.append(" ballerina test [--offline] [--sourceroot ] [--experimental] [--skip-lock]\n" + - "[ | -a | --all] [--] [(--key=value)...]\n"); + "[ | -a | --all] [--] [(--key=value)...]\n"); } @Override From 0cf4913987b7143ef503c32eb73a19dba3f7ba09 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Wed, 30 Oct 2019 22:11:25 +0530 Subject: [PATCH 133/167] Add missing utils jar for test --- .../case4/TestProject1/utils-lib/utils.jar | Bin 0 -> 3190 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/utils-lib/utils.jar diff --git a/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/utils-lib/utils.jar b/tests/jballerina-integration-test/src/test/resources/packaging/balopath/case4/TestProject1/utils-lib/utils.jar new file mode 100644 index 0000000000000000000000000000000000000000..f597e07fe6e4ccc24bfc4c95f3ec9052424786fe GIT binary patch literal 3190 zcmWIWW@h1H0D+ijKYuU-O0Y1xYJLGB9iKEs5phUlLnd!Og(P@{N&!fkgzU zE&!))PN?qk;(Q}Ajo?Ezq9nDrgrGSfCvkv167ojZU-BM^<-6QIg-!! zHe%Y8*iF{l_1ya#CLWQ0&~J2aX6(dm-G!IWJ-%0berIv|yYun)>lq>(b=if>*q+Mp zn1&a591c6YM(SD7jN?sGt0HaAB^WlVw*8yl_xeOQkLK<@rzg}sHf25hcGu&s-VX)- zKdfuk`%bI5oBiRN-gnup{k@qx-?Q)tm!8iL^=HaospYD$`t~I6bNTP2CW?PX0r39PiT0>$Ic|#TIwuz7HrV zii?u)Dl3m+3f#5Qm2Lgh8VVsme)C$GI8^v={!;@~2!tVQkX zQnkYFe{bCpSO0j`zg^m{-aoefH=Zh-!*jSZOgSP=B7;-%=?Q}*^?91x-?r8{?J{(V$>x$8ey-aFZjwk38C+}#i58l6$UlleaLG0)2jkuU#h zo(}N;c;fAjqVT6nt#jroF5Z0S&mn`X_3C$-x^_7BuGz<9YBZJS%7iV^%Vu7@6K=`= z+l!mI*<@87`>_>=-zRm1rLj249X8=lcrxjM+#-K=W7#|F53)AhJ($6>*+g-|-iD7a zWmaC+`@-zhKQW?ZUiW4rt>x1-U3XlXTEZhFfBmIMfqh?%f7nu!nnshCUqa7au=oCN zoU&_Wn#t7+mg6i-8TQUvB5LdFwNqkpo}ij*@w^+Gj!gS&v%D=|;>EKy8GhPM!s(vH z&pJ0R`CI98@sz^1_8EOQxo_&WM|y1532==r+g%OszD&z$!0*44Yn>#eJG?#%hk zK?YZhA3QD6@j7=x$6MElgZ;^puqk5N2UIF{&hauX_9~gHwN_-4aksJ1XRn4C(@*cz zFx{wP%Bu4&V#16$6IVT$9Wiaz@`N?%tJ0Y+PF?hR>LlJxC!EeJ+`DjS!u0Ox+(>0l zELsTgBRfAgu`D$Y5)N9p!vRtRq8o$~4iJM7f>;HA>Yl*iA# z&8n68Qfu!w|2rf;<@8gofBW{|-pR+S*ZGvCJfsU}`=Or6| zfBjro{`o`8gATTH^Zl+&eE)dcJFVwu)F&+nE>OB~*1AuwrlU4(k^0uodkMm!zS>#q zx&vx#E-sm)^;2t=-|zn=bH2+gw(_;y=VCB#-?GR>+Ij3zHnR8G{uj$O71z6|{OU;9 zV(HSeJ;rGJuO@Z3`a|{UZ{4}Aj~(H34mM`L_3Q7J>X&g1S927b?yO%j=eoI0<123m zpU=EA=aq&%<`1ZIew@TsnXJ63a&^xJFaNuC2R>)A9L{Dr8Z$wK_xRqxRKpOZ7mqcU zUN-IPXB0lx)c7`@Y5zS{mx2TpwfUrsOzb#_s~m6>!gpjk6z

    hk;8cjKI7p9KhP7Pf*)(}AYv1>$UwH`5IgqZ0eb>u a3vvO1D}q_sfGLB48wl?K6GsyVhz9_vm)}VM literal 0 HcmV?d00001 From b58883b84c5fe72295bb2add80f4edaf7b2cd415 Mon Sep 17 00:00:00 2001 From: kavindu Date: Thu, 31 Oct 2019 10:18:32 +0530 Subject: [PATCH 134/167] Disable a test case --- .../ballerinalang/test/record/ClosedRecordEquivalencyTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/record/ClosedRecordEquivalencyTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/record/ClosedRecordEquivalencyTest.java index e00007b1e685..f89a95b638d3 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/record/ClosedRecordEquivalencyTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/record/ClosedRecordEquivalencyTest.java @@ -55,7 +55,7 @@ public void testEqOfPublicStructsInSamePackage() { } @Test(description = "Test equivalence of public records that are in the same package. " + - "Equivalency test is performed in another package.") + "Equivalency test is performed in another package.", enabled = false) public void testEqOfPublicStructs() { BValue[] returns = BRunUtil.invoke(compileResult, "testEqOfPublicStructs"); From b042a603eb9ca5db88568486d1d468119c1434f6 Mon Sep 17 00:00:00 2001 From: chamil321 Date: Thu, 31 Oct 2019 11:47:36 +0530 Subject: [PATCH 135/167] Improve the HTTP data binding BBE --- examples/http-data-binding/http_data_binding.bal | 4 +++- examples/http-data-binding/http_data_binding.client.out | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/http-data-binding/http_data_binding.bal b/examples/http-data-binding/http_data_binding.bal index e75a90a8272c..a35e3e19b3c7 100644 --- a/examples/http-data-binding/http_data_binding.bal +++ b/examples/http-data-binding/http_data_binding.bal @@ -62,8 +62,10 @@ service hello on new http:Listener(9090) { //Accesses the fields of the record `Student`. string name = student.Name; int grade = student.Grade; + string english = student.Marks["English"]; http:Response res = new; - res.setPayload({ Name: <@untainted> name, Grade: <@untainted> grade }); + res.setPayload({ Name: <@untainted> name, Grade: <@untainted> grade, + English: <@untained> english}); var result = caller->respond(res); if (result is error) { diff --git a/examples/http-data-binding/http_data_binding.client.out b/examples/http-data-binding/http_data_binding.client.out index d34704fcd3e9..ab446dcb4ab4 100644 --- a/examples/http-data-binding/http_data_binding.client.out +++ b/examples/http-data-binding/http_data_binding.client.out @@ -1,7 +1,7 @@ # To invoke the `bindJson` resource, use the following HTTP request. $ curl -v http://localhost:9090/hello/bindJson -d '{ "Details": { "ID": "77999", "Name": "XYZ"} , "Location": { "No": "01", "City": "Colombo"}}' -H "Content-Type:application/json" # Server response: -{"ID":"77999","Name":"XYZ"} +{"ID":"77999", "Name":"XYZ"} # To invoke the `bindXML` resource, use the following HTTP request. $ curl -v http://localhost:9090/hello/bindXML -d "Main94" -H "Content-Type:application/xml" @@ -11,4 +11,4 @@ $ curl -v http://localhost:9090/hello/bindXML -d " Date: Thu, 31 Oct 2019 12:07:31 +0530 Subject: [PATCH 136/167] Address review requests --- examples/http-data-binding/http_data_binding.bal | 12 +++++------- .../http-data-binding/http_data_binding.client.out | 6 +++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/http-data-binding/http_data_binding.bal b/examples/http-data-binding/http_data_binding.bal index a35e3e19b3c7..efb197d8063b 100644 --- a/examples/http-data-binding/http_data_binding.bal +++ b/examples/http-data-binding/http_data_binding.bal @@ -59,13 +59,12 @@ service hello on new http:Listener(9090) { } resource function bindStruct(http:Caller caller, http:Request req, Student student) { - //Accesses the fields of the record `Student`. - string name = student.Name; - int grade = student.Grade; - string english = student.Marks["English"]; + //Accesses the fields of the `Student` record. + string name = <@untainted> student.Name; + int grade = <@untainted> student.Grade; + string english = <@untained> student.Marks["English"]; http:Response res = new; - res.setPayload({ Name: <@untainted> name, Grade: <@untainted> grade, - English: <@untained> english}); + res.setPayload({ Name: name, Grade: grade, English: english }); var result = caller->respond(res); if (result is error) { @@ -73,4 +72,3 @@ service hello on new http:Listener(9090) { } } } - diff --git a/examples/http-data-binding/http_data_binding.client.out b/examples/http-data-binding/http_data_binding.client.out index ab446dcb4ab4..0f39fdedbeee 100644 --- a/examples/http-data-binding/http_data_binding.client.out +++ b/examples/http-data-binding/http_data_binding.client.out @@ -1,14 +1,14 @@ -# To invoke the `bindJson` resource, use the following HTTP request. +# To invoke the `bindJson` resource, execute the below HTTP request. $ curl -v http://localhost:9090/hello/bindJson -d '{ "Details": { "ID": "77999", "Name": "XYZ"} , "Location": { "No": "01", "City": "Colombo"}}' -H "Content-Type:application/json" # Server response: {"ID":"77999", "Name":"XYZ"} -# To invoke the `bindXML` resource, use the following HTTP request. +# To invoke the `bindXML` resource, execute the below HTTP request. $ curl -v http://localhost:9090/hello/bindXML -d "Main94" -H "Content-Type:application/xml" # Server response: 94 -# To invoke the `bindStruct` resource, use the following HTTP request. +# To invoke the `bindStruct` resource, execute the below HTTP request. $ curl -v http://localhost:9090/hello/bindStruct -d '{ "Name": "John", "Grade": 12, "Marks": {"English" : "85", "IT" : "100"}}' -H "Content-Type:application/json" # Server response: {"Name":"John", "Grade":12, "English":"85"} From 6d893aa4c5efab7bd23af76bdce56c1e3dfc3376 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Thu, 31 Oct 2019 13:55:51 +0530 Subject: [PATCH 137/167] Add --experimental flag to help text --- .../src/main/resources/cli-help/ballerina-build.help | 3 +++ .../src/main/resources/cli-help/ballerina-run.help | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help index 2889d08eacfe..f34df715a4d6 100644 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help +++ b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-build.help @@ -47,6 +47,9 @@ OPTIONS --skip-lock Skip using the lock file to resolve dependencies. + --experimental + Enable experimental language features. + CONFIG PROPERTIES (--key=value)... Set Ballerina environment parameters as key/value pairs. diff --git a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help index 3d5b6cf1cae6..6ad0b61ab598 100644 --- a/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help +++ b/cli/ballerina-tool/src/main/resources/cli-help/ballerina-run.help @@ -37,6 +37,9 @@ OPTIONS The source will be looked up relative to the given source root path. + --experimental + Enable experimental language features. + CONFIG PROPERTIES (--key=value)... Set Ballerina environment parameters as key/value pairs. From c82674a3717395b358e90ce34cac211af27bf5b7 Mon Sep 17 00:00:00 2001 From: Hemika Kodikara Date: Thu, 31 Oct 2019 14:02:17 +0530 Subject: [PATCH 138/167] update docker,kubernetes cmd field documentation --- stdlib/docker/src/main/ballerina/src/docker/annotation.bal | 2 +- .../src/main/ballerina/src/kubernetes/annotation.bal | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/docker/src/main/ballerina/src/docker/annotation.bal b/stdlib/docker/src/main/ballerina/src/docker/annotation.bal index a27ed24f0898..4d689c48a80e 100644 --- a/stdlib/docker/src/main/ballerina/src/docker/annotation.bal +++ b/stdlib/docker/src/main/ballerina/src/docker/annotation.bal @@ -24,7 +24,7 @@ # + baseImage - Base image to create the docker image. Default value is `"openjdk:8-jre-alpine"`. # + buildImage - Enable building docker image. Default value is `true`. # + push - Enable pushing docker image to registry. Field `buildImage` must be set to `true` to be effective. Default value is `false`. -# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar [--b7a.config.file=] [--debug]`. +# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar ${APP} [--b7a.config.file=${CONFIG_FILE}] [--debug]`. # + enableDebug - Enable ballerina debug. Default is `false`. # + debugPort - Ballerina remote debug port. Default is `5005`. # + dockerAPIVersion - Docker API version. diff --git a/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal b/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal index 5ab2a7857a49..f3a8563e1252 100644 --- a/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal +++ b/stdlib/kubernetes/src/main/ballerina/src/kubernetes/annotation.bal @@ -155,7 +155,7 @@ public type PodTolerationConfiguration record {| # + image - Docker image name with tag. Default is `":latest"`. If field `registry` is set then it will be prepended to the docker image name as `/:latest`. # + buildImage - Docker image to be build or not. Default is `true`. # + push - Enable pushing docker image to registry. Field `buildImage` must be set to `true` to be effective. Default value is `false`. -# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar [--b7a.config.file=] [--debug]`. +# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar ${APP} [--b7a.config.file=${CONFIG_FILE}] [--debug]`. # + copyFiles - Array of [External files](kubernetes#FileConfig) for docker image. # + singleYAML - Generate a single yaml file with all kubernetes artifacts (services, deployment, ingress and etc). Default is `true`. # + namespace - Kubernetes namespace to be used on all artifacts. @@ -378,7 +378,7 @@ public type RestartPolicy "OnFailure"|"Always"|"Never"; # + image - Docker image name with tag. Default is `":latest"`. If field `registry` is set then it will be prepended to the docker image name as `/:latest`. # + buildImage - Docker image to be build or not. Default is `true`. # + push - Enable pushing docker image to registry. Field `buildImage` must be set to `true`. Default value is `false`. -# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar [--b7a.config.file=] [--debug]`. +# + cmd - Value for CMD for the generated Dockerfile. Default is `CMD java -jar ${APP} [--b7a.config.file=${CONFIG_FILE}] [--debug]`. # + copyFiles - Array of [External files](kubernetes#FileConfig) for docker image. # + singleYAML - Generate a single yaml file with all kubernetes artifacts (ingress, configmaps, secrets and etc). Default is `true`. # + namespace - Kubernetes namespace to be used on all artifacts. From 02667ee8d751618269a3df8d453e425e6bb909c7 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Thu, 31 Oct 2019 14:41:16 +0530 Subject: [PATCH 139/167] Address review comments --- examples/http-disable-chunking/http_disable_chunking.bal | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/http-disable-chunking/http_disable_chunking.bal b/examples/http-disable-chunking/http_disable_chunking.bal index 4acd0c3462c8..33e8a39dac8b 100644 --- a/examples/http-disable-chunking/http_disable_chunking.bal +++ b/examples/http-disable-chunking/http_disable_chunking.bal @@ -13,14 +13,12 @@ service chunkingSample on new http:Listener(9092) { @http:ResourceConfig { path: "/" } - //Parameters include a reference to the caller endpoint and an object containing the request data. resource function invokeEndpoint(http:Caller caller, http:Request req) { //Create a new outbound request and set the payload. http:Request newReq = new; newReq.setPayload({ "name": "Ballerina" }); var clientResponse = clientEndpoint->post("/echo/", newReq); if (clientResponse is http:Response) { - //Send the response back to the caller. var result = caller->respond(clientResponse); if (result is error) { log:printError("Error sending response", err = result); From 25708e5905c2819c6f1b3e8a03070b143dbbc413 Mon Sep 17 00:00:00 2001 From: praneesha Date: Thu, 31 Oct 2019 15:24:29 +0530 Subject: [PATCH 140/167] Update examples/http-disable-chunking/http_disable_chunking.description Co-Authored-By: Pubudu Fernando --- .../http-disable-chunking/http_disable_chunking.description | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/http-disable-chunking/http_disable_chunking.description b/examples/http-disable-chunking/http_disable_chunking.description index d7722d2a6e78..76490721f60a 100644 --- a/examples/http-disable-chunking/http_disable_chunking.description +++ b/examples/http-disable-chunking/http_disable_chunking.description @@ -1,2 +1,2 @@ -//This sample demonstrates how to change the chunking behavior of a Ballerina HTTP client endpoint. By default, the HTTP client sends messages of the length of the content. +//This sample demonstrates how to configure the chunking behavior of an HTTP client endpoint. By default, the HTTP client sends messages with the `content-length` header. //If the message size is larger than the buffer size (8K), messages are chunked. Chunking can be disabled using the connector options. From 35712f8b531d10bff8e0f26542298868978108e6 Mon Sep 17 00:00:00 2001 From: Tharik Kanaka Date: Thu, 31 Oct 2019 15:29:53 +0530 Subject: [PATCH 141/167] Fix java home check --- distribution/zip/jballerina/bin/ballerina.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/zip/jballerina/bin/ballerina.bat b/distribution/zip/jballerina/bin/ballerina.bat index 24b6a2f48ac8..35bc4699ef20 100644 --- a/distribution/zip/jballerina/bin/ballerina.bat +++ b/distribution/zip/jballerina/bin/ballerina.bat @@ -34,7 +34,7 @@ rem ----- if JAVA_HOME is not set we're not happy ------------------------------ :checkJava set BALLERINA_HOME=%~sdp0.. -if exist JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre ( +if exist %BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre ( set "JAVA_HOME=%BALLERINA_HOME%\..\..\dependencies\jdk8u202-b08-jre" ) From 1d9dfb089948f6d0012e1751c00ba7821bbe602f Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Thu, 31 Oct 2019 20:58:19 +0530 Subject: [PATCH 142/167] Fix pub/sub URLs when a public URL is specified --- .../websub/src/main/ballerina/src/websub/commons.bal | 11 +++++++---- .../java/org/ballerinalang/net/websub/hub/Hub.java | 9 +++++---- .../net/websub/nativeimpl/StopHubService.java | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index 613cb589a778..a0939c92d234 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -437,8 +437,6 @@ public type SubscriptionChangeResponse record {| # + remotePublish - The record representing configuration related to remote publishing allowance # + topicRegistrationRequired - Whether a topic needs to be registered at the hub prior to publishing/subscribing # to the topic -# + publicUrl - The URL for the hub to be included in content delivery requests, defaults to -# `http(s)://localhost:{port}/websub/hub` if unspecified # + clientConfig - The configuration for the hub to communicate with remote HTTP endpoints # + hubPersistenceStore - The `HubPersistenceStore` to use to persist hub data public type HubConfiguration record {| @@ -446,7 +444,6 @@ public type HubConfiguration record {| SignatureMethod signatureMethod = SHA256; RemotePublishConfig remotePublish?; boolean topicRegistrationRequired = true; - string publicUrl?; http:ClientConfiguration clientConfig?; HubPersistenceStore hubPersistenceStore?; |}; @@ -471,6 +468,11 @@ public type RemotePublishConfig record {| # + serviceAuth - The auth configuration for the hub service # + subscriptionResourceAuth - The auth configuration for the subscription resource of the hub service # + publisherResourceAuth - The auth configuration for the publisher resource of the hub service +# + publicUrl - The URL for the hub for remote interaction; used in defining the subscription and publish URLs. +# The subscription URL is defined as {publicUrl}/{basePath}/{subscriptionResourcePath} if `publicUrl` is +# specified, defaults to `http(s)://localhost:{port}/{basePath}/{subscriptionResourcePath}` if not. +# The publish URL is defined as {publicUrl}/{basePath}/{publishResourcePath} if `publicUrl` is +# specified, defaults to `http(s)://localhost:{port}/{basePath}/{publishResourcePath}` if not. # + hubConfiguration - The hub specific configuration # + return - `Hub` The WebSub Hub object representing the newly started up hub, or `HubStartedUpError` indicating # that the hub is already started, and including the `websub:Hub` object representing the @@ -482,6 +484,7 @@ public function startHub(http:Listener hubServiceListener, public http:ServiceResourceAuth serviceAuth = {enabled:false}, public http:ServiceResourceAuth subscriptionResourceAuth = {enabled:false}, public http:ServiceResourceAuth publisherResourceAuth = {enabled:false}, + public string? publicUrl = (), public HubConfiguration hubConfiguration = {}) returns Hub|HubStartedUpError|HubStartupError { @@ -504,7 +507,7 @@ public function startHub(http:Listener hubServiceListener, // reset the hubUrl once the other parameters are set. if url is an empty string, create hub url with listener // configs in the native code - hubPublicUrl = hubConfiguration["publicUrl"] ?: ""; + hubPublicUrl = publicUrl ?: ""; hubClientConfig = hubConfiguration["clientConfig"]; hubPersistenceStoreImpl = hubConfiguration["hubPersistenceStore"]; diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java index 7067177be97a..72aae2ee461f 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java @@ -249,10 +249,10 @@ private String populatePublishUrl(String publicUrl, ObjectValue hubListener) { Object secureSocket = ((MapValue) hubListener.get("config")).get("secureSocket"); String path = basePath.equals(SLASH) ? publishResourcePath : basePath.concat(publishResourcePath); - publicUrl = secureSocket != null ? ("https://localhost:" + hubPort + path) + return secureSocket != null ? ("https://localhost:" + hubPort + path) : ("http://localhost:" + hubPort + path); } - return publicUrl; + return publicUrl.concat(basePath.equals(SLASH) ? publishResourcePath : basePath.concat(publishResourcePath)); } @SuppressWarnings("unchecked") @@ -262,10 +262,11 @@ private String populateSubscribeUrl(String publicUrl, ObjectValue hubListener) { Object secureSocket = ((MapValue) hubListener.get("config")).get("secureSocket"); String path = basePath.equals(SLASH) ? subscribeResourcePath : basePath.concat(subscribeResourcePath); - publicUrl = secureSocket != null ? ("https://localhost:" + hubPort + path) + return secureSocket != null ? ("https://localhost:" + hubPort + path) : ("http://localhost:" + hubPort + path); } - return publicUrl; + return publicUrl.concat(basePath.equals(SLASH) ? subscribeResourcePath : + basePath.concat(subscribeResourcePath)); } /** diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java index cb6cfd6f5bb6..9d1c80e592f3 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/StopHubService.java @@ -19,6 +19,7 @@ package org.ballerinalang.net.websub.nativeimpl; import org.ballerinalang.jvm.scheduling.Strand; +import org.ballerinalang.jvm.values.ObjectValue; import org.ballerinalang.model.types.TypeKind; import org.ballerinalang.natives.annotations.BallerinaFunction; import org.ballerinalang.natives.annotations.ReturnType; @@ -39,7 +40,7 @@ ) public class StopHubService { - public static Object stopHubService(Strand strand, Object hub) { + public static Object stopHubService(Strand strand, ObjectValue hub) { Hub hubInstance = Hub.getInstance(); if (hubInstance.isStarted()) { try { From 4b642f90673777b13a26105a94574aaba866c894 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Thu, 31 Oct 2019 21:00:06 +0530 Subject: [PATCH 143/167] Add tests, fix hub startup test and enable it --- .../WebSubHubStartTest.java | 48 +---------------- .../test-src/hub/test_hub_startup.bal | 52 +++++++++++++++---- stdlib/websub/src/test/resources/testng.xml | 2 +- 3 files changed, 44 insertions(+), 58 deletions(-) diff --git a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartTest.java b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartTest.java index 5fe718d11136..e9a0e81ce9e6 100644 --- a/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartTest.java +++ b/stdlib/websub/src/test/java/org.ballerinalang.net.websub/WebSubHubStartTest.java @@ -19,14 +19,11 @@ package org.ballerinalang.net.websub; import org.ballerinalang.model.values.BBoolean; -import org.ballerinalang.model.values.BInteger; -import org.ballerinalang.model.values.BMap; import org.ballerinalang.model.values.BValue; import org.ballerinalang.test.util.BCompileUtil; import org.ballerinalang.test.util.BRunUtil; import org.ballerinalang.test.util.CompileResult; import org.testng.Assert; -import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -37,54 +34,19 @@ */ public class WebSubHubStartTest { - private static final String HUB_SUBS_URL_FIELD = "subscriptionUrl"; - private static final String STARTED_UP_HUB_FIELD = "startedUpHub"; - private CompileResult result; - private int port = 9191; - private BMap hubStartUpObject = null; @BeforeClass public void setup() { result = BCompileUtil.compile("test-src/hub/test_hub_startup.bal"); } - @Test(description = "Test hub start up and URL identification") + @Test public void testHubStartUp() { - BValue[] returns = BRunUtil.invoke(result, "startupHub", new BValue[]{new BInteger(port)}); - assertEquals(returns.length, 1); - Assert.assertTrue(returns[0] instanceof BMap); - hubStartUpObject = (BMap) returns[0]; - assertEquals(hubStartUpObject.get(HUB_SUBS_URL_FIELD).stringValue(), - "http://localhost:" + port + "/websub/hub"); - } - - @Test(description = "Test hub start up call when already started", dependsOnMethods = "testHubStartUp") - public void testHubStartUpWhenStarted() { - BValue[] returns = BRunUtil.invoke(result, "startupHub", new BValue[]{new BInteger(9292)}); - assertEquals(returns.length, 1); - Assert.assertTrue(returns[0] instanceof BMap); - hubStartUpObject = (BMap) returns[0]; - assertEquals(hubStartUpObject.get("message").stringValue(), "Ballerina Hub already started up"); - Assert.assertTrue(hubStartUpObject.get(STARTED_UP_HUB_FIELD) instanceof BMap); - BMap hubObject = (BMap) hubStartUpObject.get(STARTED_UP_HUB_FIELD); - assertEquals(hubObject.get(HUB_SUBS_URL_FIELD).stringValue(), "http://localhost:" + port + "/websub/hub"); - } - - @Test(description = "Test shut down and restart", dependsOnMethods = "testHubStartUpWhenStarted") - public void testHubShutdownAndStart() { - int port = 9393; - BValue[] returns = BRunUtil.invoke(result, "stopHub", new Object[]{hubStartUpObject}); + BValue[] returns = BRunUtil.invoke(result, "testHubStartUp"); assertEquals(returns.length, 1); Assert.assertTrue(returns[0] instanceof BBoolean); Assert.assertTrue((((BBoolean) returns[0]).value())); - - returns = BRunUtil.invoke(result, "startupHub", new BValue[]{new BInteger(port)}); - assertEquals(returns.length, 1); - Assert.assertTrue(returns[0] instanceof BMap); - hubStartUpObject = (BMap) returns[0]; - assertEquals(hubStartUpObject.get(HUB_SUBS_URL_FIELD).stringValue(), - "http://localhost:" + port + "/websub/hub"); } @Test @@ -94,10 +56,4 @@ public void testPublisherAndSubscriptionInvalidSameResourcePath() { Assert.assertTrue(returns[0] instanceof BBoolean); Assert.assertTrue((((BBoolean) returns[0]).value())); } - - @AfterClass - public void tearDown() { - BRunUtil.invoke(result, "stopHub", new Object[]{hubStartUpObject}); - } - } diff --git a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal index 2444909d7900..2f7b6a46e2b4 100644 --- a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal +++ b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal @@ -14,25 +14,55 @@ // specific language governing permissions and limitations // under the License. -import ballerina/websub; import ballerina/http; +import ballerina/websub; -function startupHub(int hubPort) returns websub:Hub|websub:HubStartedUpError|websub:HubStartupError { - return websub:startHub(new http:Listener(hubPort), "/websub", "/hub"); -} +function testHubStartUp() returns boolean { + http:Listener lis0 = new (9191); + http:Listener lis1 = new (9292); + websub:Hub|websub:HubStartedUpError|websub:HubStartupError res = + websub:startHub(lis0, "/websub", "/hub", "/pub", publicUrl = "https://localhost:9191"); -function stopHub(websub:Hub|websub:HubStartedUpError|websub:HubStartupError hubStartUpResult) { - if (hubStartUpResult is websub:Hub) { - checkpanic hubStartUpResult.stop(); - } else if (hubStartUpResult is websub:HubStartedUpError) { - checkpanic hubStartUpResult.startedUpHub.stop(); + if (res is websub:Hub) { + if (res.publishUrl != "https://localhost:9191/websub/pub" || + res.subscriptionUrl != "https://localhost:9191/websub/hub") { + return false; + } } else { - panic hubStartUpResult; + return false; + } + + // testHubStartUpWhenStarted + websub:Hub|websub:HubStartedUpError|websub:HubStartupError res2 = + websub:startHub(lis1); + + if !(res2 is websub:HubStartedUpError) || res2.startedUpHub !== res { + return false; + } + + // testHubShutdownAndStart + websub:Hub hub = res; + error? err = hub.stop(); + if (err is error) { + return false; } + err = lis0.__immediateStop(); + err = lis1.__immediateStop(); + + http:Listener lis2 = new (9393); + res2 = websub:startHub(lis2); + err = lis2.__immediateStop(); + if res2 is websub:Hub { + boolean b = res2.publishUrl == "http://localhost:9393/publish" && + res2.subscriptionUrl == "http://localhost:9393/"; + err = hub.stop(); + return b; + } + return false; } function testPublisherAndSubscriptionInvalidSameResourcePath() returns boolean { - http:Listener lis = new (9393); + http:Listener lis = new (9494); websub:Hub|websub:HubStartedUpError|websub:HubStartupError res = websub:startHub(lis, "/websub", "/hub", "/hub"); diff --git a/stdlib/websub/src/test/resources/testng.xml b/stdlib/websub/src/test/resources/testng.xml index e798fd69de66..19090c7808db 100644 --- a/stdlib/websub/src/test/resources/testng.xml +++ b/stdlib/websub/src/test/resources/testng.xml @@ -25,7 +25,7 @@ - + From 3c003f72c74d0015b34a689e0eeae8cbceaa90c2 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Thu, 31 Oct 2019 23:04:01 +0530 Subject: [PATCH 144/167] Fix ballerina run interop bal --- .../packerina/task/RunExecutableTask.java | 28 +++-- .../ballerinalang/util/BootstrapRunner.java | 112 +++++++++++++++--- 2 files changed, 111 insertions(+), 29 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java index 106afdcac63a..a4a995d39e3c 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java @@ -26,7 +26,6 @@ import org.ballerinalang.packerina.buildcontext.sourcecontext.SingleModuleContext; import org.ballerinalang.tool.util.BFileUtil; import org.ballerinalang.util.BootstrapRunner; -import org.ballerinalang.util.JBallerinaInMemoryClassLoader; import org.wso2.ballerinalang.compiler.tree.BLangPackage; import org.wso2.ballerinalang.compiler.util.ProjectDirConstants; @@ -85,7 +84,7 @@ public RunExecutableTask(Path executablePath, String[] args) { @Override public void execute(BuildContext buildContext) { Path sourceRootPath = buildContext.get(BuildContextField.SOURCE_ROOT); - + Path runtimeJar = getRuntimeAllJar(buildContext); if (!this.isGeneratedExecutable) { this.runExecutable(); return; @@ -141,9 +140,8 @@ public void execute(BuildContext buildContext) { } // set the source root path relative to the source path i.e. set the parent directory of the source path - System.setProperty(ProjectDirConstants.BALLERINA_SOURCE_ROOT, sourceRootPath.toString()); - - this.runGeneratedExecutable(executableModule); + System.setProperty(ProjectDirConstants.BALLERINA_SOURCE_ROOT, sourceRootPath.toString());; + this.runGeneratedExecutable(executableModule, buildContext, runtimeJar); } /** @@ -151,16 +149,16 @@ public void execute(BuildContext buildContext) { * * @param executableModule The module to run. */ - private void runGeneratedExecutable(BLangPackage executableModule) { + private void runGeneratedExecutable(BLangPackage executableModule, BuildContext buildContext, Path runtimeJar) { String balHome = Objects.requireNonNull(System.getProperty("ballerina.home"), "ballerina.home is not set"); - JBallerinaInMemoryClassLoader classLoader; + ClassLoader classLoader; try { ConfigRegistry.getInstance().setInitialized(true); Path targetDirectory = Files.createTempDirectory("ballerina-compile").toAbsolutePath(); - classLoader = BootstrapRunner.createClassLoaders(executableModule, - Paths.get(balHome).resolve("bir-cache"), - targetDirectory, Optional.empty(), false, false); + classLoader = BootstrapRunner.createClassLoaders(executableModule, Paths.get(balHome).resolve("bir-cache"), + targetDirectory, Optional.empty(), false, runtimeJar, + buildContext.moduleDependencyPathMap); ConfigRegistry.getInstance().setInitialized(false); } catch (IOException e) { throw new BLangCompilerException("error invoking jballerina backend", e); @@ -181,10 +179,9 @@ private void runGeneratedExecutable(BLangPackage executableModule) { throw createLauncherException("main method cannot be found for init class " + initClassName); } catch (IllegalAccessException | IllegalArgumentException e) { throw createLauncherException("invoking main method failed due to " + e.getMessage()); - } catch (InvocationTargetException | NoSuchFieldException e) { + } catch (ClassNotFoundException | InvocationTargetException | NoSuchFieldException e) { throw createLauncherException("invoking main method failed due to ", e.getCause()); } - } /** @@ -235,4 +232,11 @@ private static String getModuleInitClassName(Path executablePath) { throw createLauncherException("error while getting init class name from manifest due to " + e.getMessage()); } } + + private Path getRuntimeAllJar(BuildContext buildContext) { + String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); + String ballerinaVersion = System.getProperty("ballerina.version"); + String runtimeJarName = "ballerina-rt-" + ballerinaVersion + BLANG_COMPILED_JAR_EXT; + return Paths.get(balHomePath, "bre", "lib", runtimeJarName); + } } diff --git a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java index 3c3f02739be3..4032c1d99440 100644 --- a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java +++ b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/BootstrapRunner.java @@ -25,19 +25,24 @@ import org.wso2.ballerinalang.programfile.PackageFileWriter; import java.io.BufferedReader; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.StringJoiner; import java.util.concurrent.TimeUnit; @@ -139,8 +144,8 @@ private static String getMapPath() { return ballerinaNativeMap == null ? "" : ballerinaNativeMap; } - public static void writeNonEntryPkgs(List imports, Path birCache, Path importsBirCache, - Path jarTargetDir, boolean dumpBir) + private static void writeNonEntryPkgs(List imports, Path birCache, Path importsBirCache, + Path jarTargetDir, boolean dumpBir) throws IOException { for (BPackageSymbol pkg : imports) { PackageID id = pkg.pkgID; @@ -148,15 +153,7 @@ public static void writeNonEntryPkgs(List imports, Path birCache //Todo: Remove ballerinax check after fixing it by the packerina team if (!"ballerina".equals(id.orgName.value) && !"ballerinax".equals(id.orgName.value)) { writeNonEntryPkgs(pkg.imports, birCache, importsBirCache, jarTargetDir, dumpBir); - - byte[] bytes = PackageFileWriter.writePackage(pkg.birPackageFile); - Path pkgBirDir = importsBirCache.resolve(id.orgName.value) - .resolve(id.name.value) - .resolve(id.version.value.isEmpty() ? "0.0.0" : id.version.value); - Files.createDirectories(pkgBirDir); - Path pkgBir = pkgBirDir.resolve(id.name.value + ".bir"); - Files.write(pkgBir, bytes); - + Path pkgBir = getModuleBir(pkg, importsBirCache); String jarOutputPath = jarTargetDir.resolve(id.name.value + ".jar").toString(); generateJarBinary(pkgBir.toString(), jarOutputPath, dumpBir, birCache.toString(), importsBirCache.toString()); @@ -164,11 +161,44 @@ public static void writeNonEntryPkgs(List imports, Path birCache } } - public static JBallerinaInMemoryClassLoader createClassLoaders(BLangPackage bLangPackage, - Path systemBirCache, - Path buildRoot, - Optional jarTargetRoot, - boolean dumpBir, boolean onProc) throws IOException { + private static void writeNonEntryPkgs(List imports, Path birCache, Path importsBirCache, + Path jarTargetDir, Path runtimeJar, + Map> moduleDependencyPathMap, + boolean dumpBir) throws IOException { + for (BPackageSymbol pkg : imports) { + PackageID id = pkg.pkgID; + if (!"ballerina".equals(id.orgName.value) && !"ballerinax".equals(id.orgName.value)) { + writeNonEntryPkgs(pkg.imports, birCache, importsBirCache, jarTargetDir, runtimeJar, + moduleDependencyPathMap, dumpBir); + Path pkgBir = getModuleBir(pkg, importsBirCache); + String jarOutputPath = jarTargetDir.resolve(id.name.value + ".jar").toString(); + HashSet jarPaths = moduleDependencyPathMap.get(id); + jarPaths.add(runtimeJar); + loadTargetAndGenerateJarBinary(pkgBir.toString(), jarOutputPath, dumpBir, + jarPaths, birCache.toString(), + importsBirCache.toString()); + } + } + } + + private static Path getModuleBir(BPackageSymbol pkg, Path importsBirCache) throws IOException { + PackageID id = pkg.pkgID; + byte[] bytes = PackageFileWriter.writePackage(pkg.birPackageFile); + Path pkgBirDir = importsBirCache.resolve(id.orgName.value) + .resolve(id.name.value) + .resolve(id.version.value.isEmpty() ? "0.0.0" : id.version.value); + Files.createDirectories(pkgBirDir); + Path pkgBir = pkgBirDir.resolve(id.name.value + ".bir"); + Files.write(pkgBir, bytes); + return pkgBir; + } + + public static URLClassLoader createClassLoaders(BLangPackage bLangPackage, + Path systemBirCache, + Path buildRoot, + Optional jarTargetRoot, + boolean dumpBir, boolean onProc) throws IOException { + byte[] bytes = PackageFileWriter.writePackage(bLangPackage.symbol.birPackageFile); String fileName = calcFileNameForJar(bLangPackage); Files.createDirectories(buildRoot); @@ -193,8 +223,56 @@ public static JBallerinaInMemoryClassLoader createClassLoaders(BLangPackage bLan if (!Files.exists(jarTarget)) { throw new RuntimeException("Compiled binary jar is not found: " + jarTarget); } + int index = 0; + URL[] urls; + File importsCache = importsTarget.toFile(); + if (importsCache.isDirectory()) { + String[] jarFIles = importsCache.list(); + urls = new URL[jarFIles.length + 1]; + for (String file : jarFIles) { + urls[index++] = Paths.get(importsCache.getPath(), file).toUri().toURL(); + } + } else { + urls = new URL[1]; + } + urls[index] = jarTarget.toFile().toURI().toURL(); + return new URLClassLoader(urls); + } - return new JBallerinaInMemoryClassLoader(jarTarget, importsTarget.toFile()); + public static URLClassLoader createClassLoaders(BLangPackage bLangPackage, Path systemBirCache, Path buildRoot, + Optional jarTargetRoot, boolean dumpBir, Path runtimeJar, + Map> moduleJarsMap) throws IOException { + + byte[] bytes = PackageFileWriter.writePackage(bLangPackage.symbol.birPackageFile); + String fileName = calcFileNameForJar(bLangPackage); + Files.createDirectories(buildRoot); + Path intermediates = Files.createTempDirectory(buildRoot, fileName + "-"); + Path entryBir = intermediates.resolve(fileName + ".bir"); + Path jarTarget = jarTargetRoot.orElse(intermediates).resolve(fileName + ".jar"); + Files.write(entryBir, bytes); + + Path importsBirCache = intermediates.resolve("imports").resolve("bir-cache"); + Path importsTarget = importsBirCache.getParent().resolve("generated-bir-jar"); + Files.createDirectories(importsTarget); + writeNonEntryPkgs(bLangPackage.symbol.imports, systemBirCache, importsBirCache, importsTarget, runtimeJar, + moduleJarsMap, dumpBir); + HashSet moduleDependencySet = moduleJarsMap.get(bLangPackage.packageID); + moduleDependencySet.add(runtimeJar); + URL[] urls = new URL[moduleDependencySet.size() + 1]; + int i = 0; + List jarFilePaths = new ArrayList<>(moduleDependencySet.size()); + for (Path path : moduleDependencySet) { + urls[i] = path.toUri().toURL(); + jarFilePaths.add(path.toString()); + i++; + } + urls[urls.length - 1] = jarTarget.toUri().toURL(); + generateJarBinary(entryBir.toString(), jarTarget.toString(), dumpBir, false, jarFilePaths, + systemBirCache.toString(), importsBirCache.toString()); + if (!Files.exists(jarTarget)) { + throw new RuntimeException("Compiled binary jar is not found: " + jarFilePaths); + } + return new URLClassLoader(urls); } private static String calcFileNameForJar(BLangPackage bLangPackage) { From afcfeddc3288b81599f29ccdc5e620b4c5cece5d Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Thu, 31 Oct 2019 23:17:01 +0530 Subject: [PATCH 145/167] Add test for interop bal file with run cmd --- .../test/packaging/PathDependencyTestCase.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java index 3a8ea146a2e9..e0983de268b1 100644 --- a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java +++ b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/packaging/PathDependencyTestCase.java @@ -479,6 +479,12 @@ public void testBaloSingleBalFileCase8() throws BallerinaTestException, IOExcept balClient.runMain("run", new String[]{interopBalJarFileName}, envVariables, new String[0], new LogLeecher[]{bazRunLeecher}, caseResources.toString()); bazRunLeecher.waitForText(10000); + + // ballerina run bal command + LogLeecher balRunLeecher = new LogLeecher(msg); + balClient.runMain("run", new String[]{interopBalFileName}, envVariables, new String[]{}, + new LogLeecher[]{balRunLeecher}, caseResources.toString()); + balRunLeecher.waitForText(10000); } /** From 19f0141b2904d8b21e2711eb326d7640b97d9ae0 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Thu, 31 Oct 2019 23:18:59 +0530 Subject: [PATCH 146/167] Remove in memory class loader --- .../util/JBallerinaInMemoryClassLoader.java | 78 ------------------- .../ballerinalang/test/util/BCompileUtil.java | 34 +++++--- .../org/ballerinalang/test/util/BRunUtil.java | 8 +- .../test/util/CompileResult.java | 8 +- .../ballerina-internal.log.lck | 0 5 files changed, 30 insertions(+), 98 deletions(-) delete mode 100644 compiler/ballerina-lang/src/main/java/org/ballerinalang/util/JBallerinaInMemoryClassLoader.java delete mode 100644 tests/jballerina-unit-test/ballerina-internal.log.lck diff --git a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/JBallerinaInMemoryClassLoader.java b/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/JBallerinaInMemoryClassLoader.java deleted file mode 100644 index 6eb04c497ab6..000000000000 --- a/compiler/ballerina-lang/src/main/java/org/ballerinalang/util/JBallerinaInMemoryClassLoader.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.ballerinalang.util; - -import org.ballerinalang.compiler.BLangCompilerException; - -import java.io.File; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLClassLoader; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.StringJoiner; - -/** - * An in-memory jar class loader. - * - * @since 0.955.0 - */ - -public class JBallerinaInMemoryClassLoader { - - private URLClassLoader cl; - - public JBallerinaInMemoryClassLoader(Path testJarPath, File importsCache) { - try { - int index = 0; - URL[] jars; - if (importsCache.isDirectory()) { - String[] jarFIles = importsCache.list(); - jars = new URL[jarFIles.length + 1]; - for (String file : jarFIles) { - jars[index++] = Paths.get(importsCache.getPath(), file).toUri().toURL(); - } - } else { - jars = new URL[1]; - } - - jars[index] = testJarPath.toFile().toURI().toURL(); - cl = new URLClassLoader(jars); - } catch (MalformedURLException e) { - throw new BLangCompilerException("error loading jar " + testJarPath, e); - } - } - - public Class loadClass(String className) { - try { - return cl.loadClass(className); - } catch (ClassNotFoundException e) { - throw new RuntimeException("Class '" + className + "' cannot be loaded in-memory", e); - } - } - - public String getClassPath() { - URL[] urls = cl.getURLs(); - StringJoiner joiner = new StringJoiner(":"); - for (URL url : urls) { - joiner.add(url.getPath()); - } - return joiner.toString(); - } - -} diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java index aa63fe5f927c..892a1b58635a 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BCompileUtil.java @@ -25,7 +25,6 @@ import org.ballerinalang.jvm.values.FutureValue; import org.ballerinalang.model.elements.PackageID; import org.ballerinalang.util.BootstrapRunner; -import org.ballerinalang.util.JBallerinaInMemoryClassLoader; import org.ballerinalang.util.diagnostic.DiagnosticListener; import org.ballerinalang.util.exceptions.BLangRuntimeException; import org.ballerinalang.util.exceptions.BallerinaException; @@ -46,6 +45,8 @@ import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.net.URL; +import java.net.URLClassLoader; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -124,7 +125,8 @@ public static CompileResult compile(boolean temp, String sourceFilePath) { return compileOnJBallerina(sourceFilePath, temp, true); } - private static void runInit(BLangPackage bLangPackage, JBallerinaInMemoryClassLoader classLoader, boolean temp) { + private static void runInit(BLangPackage bLangPackage, ClassLoader classLoader, boolean temp) + throws ClassNotFoundException { String initClassName = BFileUtil.getQualifiedClassName(bLangPackage.packageID.orgName.value, bLangPackage.packageID.name.value, TestConstant.MODULE_INIT_CLASS_NAME); @@ -506,11 +508,9 @@ public static CompileResult compileOnJBallerina(CompilerContext context, String try { Path buildDir = Paths.get("build").toAbsolutePath().normalize(); Path systemBirCache = buildDir.resolve("bir-cache"); - JBallerinaInMemoryClassLoader cl = BootstrapRunner.createClassLoaders(bLangPackage, - systemBirCache, - buildDir.resolve("test-bir-temp"), - Optional.empty(), false, - onProc); + URLClassLoader cl = BootstrapRunner.createClassLoaders(bLangPackage, systemBirCache, + buildDir.resolve("test-bir-temp"), Optional.empty(), + false, onProc); compileResult.setClassLoader(cl); // TODO: calling run on compile method is wrong, should be called from BRunUtil @@ -520,7 +520,7 @@ public static CompileResult compileOnJBallerina(CompilerContext context, String return compileResult; - } catch (IOException e) { + } catch (ClassNotFoundException | IOException e) { throw new BLangRuntimeException("Error during jvm code gen of the test", e); } } @@ -538,14 +538,15 @@ public static ExitDetails run(CompileResult compileResult, String[] args) { BLangPackage compiledPkg = ((BLangPackage) compileResult.getAST()); String initClassName = BFileUtil.getQualifiedClassName(compiledPkg.packageID.orgName.value, compiledPkg.packageID.name.value, MODULE_INIT_CLASS_NAME); - JBallerinaInMemoryClassLoader classLoader = compileResult.classLoader; - Class initClazz = classLoader.loadClass(initClassName); + URLClassLoader classLoader = compileResult.classLoader; + try { + Class initClazz = classLoader.loadClass(initClassName); final List actualArgs = new ArrayList<>(); actualArgs.add(0, "java"); actualArgs.add(1, "-cp"); - String classPath = System.getProperty("java.class.path") + ":" + classLoader.getClassPath(); + String classPath = System.getProperty("java.class.path") + ":" + getClassPath(classLoader); actualArgs.add(2, classPath); actualArgs.add(3, initClazz.getCanonicalName()); actualArgs.addAll(Arrays.asList(args)); @@ -557,11 +558,20 @@ public static ExitDetails run(CompileResult compileResult, String[] args) { process.waitFor(); int exitValue = process.exitValue(); return new ExitDetails(exitValue, consoleInput, consoleError); - } catch (InterruptedException | IOException e) { + } catch (ClassNotFoundException | InterruptedException | IOException e) { throw new RuntimeException("Main method invocation failed", e); } } + private static String getClassPath(URLClassLoader cl) { + URL[] urls = cl.getURLs(); + StringJoiner joiner = new StringJoiner(":"); + for (URL url : urls) { + joiner.add(url.getPath()); + } + return joiner.toString(); + } + private static String getConsoleOutput(InputStream inputStream) { final BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); StringJoiner sj = new StringJoiner(System.getProperty("line.separator")); diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BRunUtil.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BRunUtil.java index cc7968f1821e..b4e351af5b54 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BRunUtil.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/BRunUtil.java @@ -235,8 +235,8 @@ private static BValue[] invoke(CompileResult compileResult, BIRNode.BIRFunction BIRNode.BIRPackage birPackage = ((BLangPackage) compileResult.getAST()).symbol.bir; String funcClassName = BFileUtil.getQualifiedClassName(birPackage.org.value, birPackage.name.value, getClassName(function.pos.src.cUnitName)); - Class funcClass = compileResult.getClassLoader().loadClass(funcClassName); try { + Class funcClass = compileResult.getClassLoader().loadClass(funcClassName); Method method = getMethod(functionName, funcClass); Function func = a -> { try { @@ -269,7 +269,7 @@ private static BValue[] invoke(CompileResult compileResult, BIRNode.BIRFunction futureValue.panic); } jvmResult = futureValue.result; - } catch (NoSuchMethodException e) { + } catch (ClassNotFoundException | NoSuchMethodException e) { throw new RuntimeException("Error while invoking function '" + functionName + "'", e); } @@ -372,8 +372,8 @@ private static BValue[] invoke(CompileResult compileResult, BIRNode.BIRFunction BIRNode.BIRPackage birPackage = ((BLangPackage) compileResult.getAST()).symbol.bir; String funcClassName = BFileUtil.getQualifiedClassName(birPackage.org.value, birPackage.name.value, getClassName(function.pos.src.cUnitName)); - Class funcClass = compileResult.getClassLoader().loadClass(funcClassName); try { + Class funcClass = compileResult.getClassLoader().loadClass(funcClassName); Method method = funcClass.getDeclaredMethod(functionName, jvmParamTypes); Function func = a -> { try { @@ -406,7 +406,7 @@ private static BValue[] invoke(CompileResult compileResult, BIRNode.BIRFunction futureValue.panic); } jvmResult = futureValue.result; - } catch (NoSuchMethodException e) { + } catch (ClassNotFoundException | NoSuchMethodException e) { throw new RuntimeException("Error while invoking function '" + functionName + "'", e); } diff --git a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/CompileResult.java b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/CompileResult.java index 49cc08230a0d..1df3e078b4e9 100644 --- a/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/CompileResult.java +++ b/tests/ballerina-test-utils/src/main/java/org/ballerinalang/test/util/CompileResult.java @@ -17,10 +17,10 @@ package org.ballerinalang.test.util; import org.ballerinalang.model.tree.PackageNode; -import org.ballerinalang.util.JBallerinaInMemoryClassLoader; import org.ballerinalang.util.diagnostic.Diagnostic; import org.ballerinalang.util.diagnostic.DiagnosticListener; +import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -36,7 +36,7 @@ public class CompileResult { private PackageNode pkgNode; private CompileResultDiagnosticListener diagnosticListener; - JBallerinaInMemoryClassLoader classLoader; + URLClassLoader classLoader; public CompileResult(CompileResultDiagnosticListener diagnosticListener) { this.diagnosticListener = diagnosticListener; @@ -65,11 +65,11 @@ public void setAST(PackageNode pkgNode) { this.pkgNode = pkgNode; } - public JBallerinaInMemoryClassLoader getClassLoader() { + public URLClassLoader getClassLoader() { return classLoader; } - void setClassLoader(JBallerinaInMemoryClassLoader classLoader) { + void setClassLoader(URLClassLoader classLoader) { this.classLoader = classLoader; } diff --git a/tests/jballerina-unit-test/ballerina-internal.log.lck b/tests/jballerina-unit-test/ballerina-internal.log.lck deleted file mode 100644 index e69de29bb2d1..000000000000 From 72d50ad836697a2aea464b112590f39952c75d03 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Thu, 31 Oct 2019 23:28:32 +0530 Subject: [PATCH 147/167] Address review suggestions --- .../packerina/buildcontext/BuildContext.java | 1 - .../packerina/task/CopyNativeLibTask.java | 40 +++++++++---------- .../packerina/task/CreateJarTask.java | 3 +- .../packerina/task/RunExecutableTask.java | 3 +- .../src/compiler_backend_jvm/main.bal | 2 + .../src/compiler_backend_jvm/main.bal | 3 +- 6 files changed, 27 insertions(+), 25 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java index 81f21a5704a5..cdc4d120cf20 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/buildcontext/BuildContext.java @@ -70,7 +70,6 @@ public class BuildContext extends HashMap { private SourceType srcType; private transient PrintStream out; private transient PrintStream err; - public transient Map> moduleDependencyPathMap = new HashMap<>(); /** diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java index 73d649355340..adabb7eef8b4 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java @@ -192,38 +192,36 @@ private void copyLibsFromBalo(Path baloFilePath, HashSet moduleDependencyS fileName.substring(0, fileName.lastIndexOf("."))); File destFile = baloFileUnzipDirectory.toFile(); // Read from .balo file if directory not exist. - if (destFile.mkdir()) { + if (!destFile.mkdir()) {// Read from already unzipped balo directory. + try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(destFile.toString()))) { + for (Path path : stream) { + moduleDependencySet.add(path); + } + } catch (IOException e) { + throw createLauncherException("unable to copy native jar: " + e.getMessage()); + } + } else { try (JarFile jar = new JarFile(baloFilePath.toFile())) { java.util.Enumeration enumEntries = jar.entries(); while (enumEntries.hasMoreElements()) { JarEntry file = (JarEntry) enumEntries.nextElement(); - if (file.getName().endsWith(BLANG_COMPILED_JAR_EXT)) { - File f = Paths.get(baloFileUnzipDirectory.toString(), - file.getName().split(BALO_PLATFORM_LIB_DIR_NAME)[1]).toFile(); - if (!f.exists()) { // if file already copied or its a directory, ignore - // get the input stream - try (InputStream is = jar.getInputStream(file)) { - Files.copy(is, f.toPath()); - } + if (!file.getName().endsWith(BLANG_COMPILED_JAR_EXT)) { + continue; + } + File f = Paths.get(baloFileUnzipDirectory.toString(), + file.getName().split(BALO_PLATFORM_LIB_DIR_NAME)[1]).toFile(); + if (!f.exists()) { // if file already copied or its a directory, ignore + // get the input stream + try (InputStream is = jar.getInputStream(file)) { + Files.copy(is, f.toPath()); } - moduleDependencySet.add(f.toPath()); } + moduleDependencySet.add(f.toPath()); } } catch (IOException e) { throw createLauncherException("unable to copy native jar: " + e.getMessage()); } - return; - } - - // Read from already unzipped balo directory. - try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(destFile.toString()))) { - for (Path path : stream) { - moduleDependencySet.add(path); - } - } catch (IOException e) { - throw createLauncherException("unable to copy native jar: " + e.getMessage()); } - } private void copyDependenciesFromToml(BPackageSymbol importz, String balHomePath, diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java index 10ff82832567..4d4735204b2b 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CreateJarTask.java @@ -26,6 +26,7 @@ import org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol; import org.wso2.ballerinalang.compiler.tree.BLangPackage; import org.wso2.ballerinalang.compiler.util.ProjectDirs; +import org.wso2.ballerinalang.util.RepoUtils; import java.nio.file.Files; import java.nio.file.Path; @@ -140,7 +141,7 @@ private Path getRuntimeAllJar(BuildContext buildContext) { return null; } String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); - String ballerinaVersion = System.getProperty("ballerina.version"); + String ballerinaVersion = RepoUtils.getBallerinaVersion(); String runtimeJarName = "ballerina-rt-" + ballerinaVersion + BLANG_COMPILED_JAR_EXT; return Paths.get(balHomePath, "bre", "lib", runtimeJarName); } diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java index a4a995d39e3c..52d722829a07 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/RunExecutableTask.java @@ -28,6 +28,7 @@ import org.ballerinalang.util.BootstrapRunner; import org.wso2.ballerinalang.compiler.tree.BLangPackage; import org.wso2.ballerinalang.compiler.util.ProjectDirConstants; +import org.wso2.ballerinalang.util.RepoUtils; import java.io.FileInputStream; import java.io.IOException; @@ -235,7 +236,7 @@ private static String getModuleInitClassName(Path executablePath) { private Path getRuntimeAllJar(BuildContext buildContext) { String balHomePath = buildContext.get(BuildContextField.HOME_REPO).toString(); - String ballerinaVersion = System.getProperty("ballerina.version"); + String ballerinaVersion = RepoUtils.getBallerinaVersion(); String runtimeJarName = "ballerina-rt-" + ballerinaVersion + BLANG_COMPILED_JAR_EXT; return Paths.get(balHomePath, "bre", "lib", runtimeJarName); } diff --git a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal index b38189ce6ea2..218fad8b638c 100644 --- a/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal +++ b/compiler/ballerina-backend-jvm-old/src/main/ballerina/src/compiler_backend_jvm/main.bal @@ -48,6 +48,8 @@ public function main(string... args) { i = i + 1; } + // main will receive the no of cache directories as 6th arg. Then we read the rest of the args as cache directories + // based on 6th arg value. int argsCount = 6 + numCacheDirs; int dependentJarCnt = args.length() - argsCount; i = 0; diff --git a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal index f3dc464a493e..28312dab316a 100644 --- a/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal +++ b/compiler/ballerina-backend-jvm/src/main/ballerina/src/compiler_backend_jvm/main.bal @@ -47,7 +47,8 @@ public function main(string... args) { birCacheDirs[i] = <@untainted> args[6 + i]; i = i + 1; } - + // main will receive the no of cache directories as 6th arg. Then we read the rest of the args as cache directories + // based on 6th arg value. int argsCount = 6 + numCacheDirs; int dependentJarCnt = args.length() - argsCount; i = 0; From 941d73cb161f5968b13b49b9292356108ffe5486 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Fri, 1 Nov 2019 00:27:57 +0530 Subject: [PATCH 148/167] Fix formatting issue --- .../org/ballerinalang/packerina/task/CopyNativeLibTask.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java index adabb7eef8b4..802376ac901f 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java @@ -192,7 +192,8 @@ private void copyLibsFromBalo(Path baloFilePath, HashSet moduleDependencyS fileName.substring(0, fileName.lastIndexOf("."))); File destFile = baloFileUnzipDirectory.toFile(); // Read from .balo file if directory not exist. - if (!destFile.mkdir()) {// Read from already unzipped balo directory. + if (!destFile.mkdir()) { + // Read from already unzipped balo directory. try (DirectoryStream stream = Files.newDirectoryStream(Paths.get(destFile.toString()))) { for (Path path : stream) { moduleDependencySet.add(path); From c3f8cd61618b308869b100fc1502ffb8ad799eb5 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Fri, 1 Nov 2019 06:53:37 +0530 Subject: [PATCH 149/167] Add a method to the websub:Hub to remove a subscription --- .../websub/src/main/ballerina/src/websub/commons.bal | 12 ++++++++++++ .../src/main/ballerina/src/websub/hub_service.bal | 6 +++--- .../websub/src/main/ballerina/src/websub/natives.bal | 2 +- ...bscription.java => RemoveNativeSubscription.java} | 6 +++--- 4 files changed, 19 insertions(+), 7 deletions(-) rename stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/{RemoveSubscription.java => RemoveNativeSubscription.java} (88%) diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index a0939c92d234..aac8cfe00307 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -627,6 +627,18 @@ public type Hub object { return unregisterTopic(topic); } + # Removes a subscription from the Ballerina Hub, without verifying intent. + # + # + topic - The topic for which the subscription should be removed + # + callback - The callback for which the subscription should be removed + # + return - `error` if an error occurred with removal + public function removeSubscription(string topic, string callback) returns error? { + removeNativeSubscription(topic, callback); + if (hubPersistenceEnabled) { + return persistSubscriptionChange(MODE_UNSUBSCRIBE, {topic: topic, callback: callback}); + } + } + # Retrieves topics currently recognized by the Hub. # # + return - An array of available topics diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 973548d69371..65964b76c514 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -342,7 +342,7 @@ function verifyIntentAndAddSubscription(string callback, string topic, map createdAt) { //TODO: introduce a separate periodic task, and modify select to select only active subs - removeSubscription(subscriptionDetails.topic, callback); + removeNativeSubscription(subscriptionDetails.topic, callback); if (hubPersistenceEnabled) { error? remResult = persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); if (remResult is error) { @@ -517,7 +517,7 @@ function distributeContent(string callback, SubscriptionDetails subscriptionDeta log:printDebug("Content delivery to callback[" + callback + "] successful for topic[" + subscriptionDetails.topic + "]"); } else if (respStatusCode == http:STATUS_GONE) { - removeSubscription(subscriptionDetails.topic, callback); + removeNativeSubscription(subscriptionDetails.topic, callback); if (hubPersistenceEnabled) { error? remResult = persistSubscriptionChange(MODE_UNSUBSCRIBE, subscriptionDetails); if (remResult is error) { diff --git a/stdlib/websub/src/main/ballerina/src/websub/natives.bal b/stdlib/websub/src/main/ballerina/src/websub/natives.bal index 092931f5f73a..742bb298b42c 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/natives.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/natives.bal @@ -59,7 +59,7 @@ function publishToInternalHub(string topic, WebSubContent content) returns error # # + topic - The topic for which the subscription was added # + callback - The callback registered for this subscription -function removeSubscription(string topic, string callback) = external; +function removeNativeSubscription(string topic, string callback) = external; # Registers a topic in the Ballerina Hub. # diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RemoveSubscription.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RemoveNativeSubscription.java similarity index 88% rename from stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RemoveSubscription.java rename to stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RemoveNativeSubscription.java index 70f5d9d4c193..4242f18b9679 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RemoveSubscription.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RemoveNativeSubscription.java @@ -31,14 +31,14 @@ */ @BallerinaFunction( orgName = "ballerina", packageName = "websub", - functionName = "removeSubscription", + functionName = "removeNativeSubscription", args = {@Argument(name = "topic", type = TypeKind.STRING), @Argument(name = "callback", type = TypeKind.STRING)}, isPublic = true ) -public class RemoveSubscription { +public class RemoveNativeSubscription { - public static void removeSubscription(Strand strand, String topic, String callback) { + public static void removeNativeSubscription(Strand strand, String topic, String callback) { Hub.getInstance().unregisterSubscription(strand, topic, callback); } } From 93720294df589a45c6e2dca8ad4e78c2ac1c28d9 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Fri, 1 Nov 2019 10:20:21 +0530 Subject: [PATCH 150/167] Address review suggestions --- .../packerina/task/CopyNativeLibTask.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java index 802376ac901f..ced75302ced0 100644 --- a/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java +++ b/cli/ballerina-packerina/src/main/java/org/ballerinalang/packerina/task/CopyNativeLibTask.java @@ -201,27 +201,27 @@ private void copyLibsFromBalo(Path baloFilePath, HashSet moduleDependencyS } catch (IOException e) { throw createLauncherException("unable to copy native jar: " + e.getMessage()); } - } else { - try (JarFile jar = new JarFile(baloFilePath.toFile())) { - java.util.Enumeration enumEntries = jar.entries(); - while (enumEntries.hasMoreElements()) { - JarEntry file = (JarEntry) enumEntries.nextElement(); - if (!file.getName().endsWith(BLANG_COMPILED_JAR_EXT)) { - continue; - } - File f = Paths.get(baloFileUnzipDirectory.toString(), - file.getName().split(BALO_PLATFORM_LIB_DIR_NAME)[1]).toFile(); - if (!f.exists()) { // if file already copied or its a directory, ignore - // get the input stream - try (InputStream is = jar.getInputStream(file)) { - Files.copy(is, f.toPath()); - } + return; + } + try (JarFile jar = new JarFile(baloFilePath.toFile())) { + java.util.Enumeration enumEntries = jar.entries(); + while (enumEntries.hasMoreElements()) { + JarEntry file = (JarEntry) enumEntries.nextElement(); + if (!file.getName().endsWith(BLANG_COMPILED_JAR_EXT)) { + continue; + } + File f = Paths.get(baloFileUnzipDirectory.toString(), + file.getName().split(BALO_PLATFORM_LIB_DIR_NAME)[1]).toFile(); + if (!f.exists()) { // if file already copied or its a directory, ignore + // get the input stream + try (InputStream is = jar.getInputStream(file)) { + Files.copy(is, f.toPath()); } - moduleDependencySet.add(f.toPath()); } - } catch (IOException e) { - throw createLauncherException("unable to copy native jar: " + e.getMessage()); + moduleDependencySet.add(f.toPath()); } + } catch (IOException e) { + throw createLauncherException("unable to copy native jar: " + e.getMessage()); } } From f39c6ebf1a2b96a8a4d382bfa4e75ddb298f3f36 Mon Sep 17 00:00:00 2001 From: MaryamZi Date: Fri, 1 Nov 2019 10:43:16 +0530 Subject: [PATCH 151/167] Add test for subscription removal via websub:Hub --- .../websub/basic/WebSubCoreFunctionalityTestCase.java | 10 ++++++++++ .../publisher/src/services/01_websub_publisher.bal | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/basic/WebSubCoreFunctionalityTestCase.java b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/basic/WebSubCoreFunctionalityTestCase.java index 8d124a4dfc0d..37932e085ca1 100644 --- a/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/basic/WebSubCoreFunctionalityTestCase.java +++ b/tests/jballerina-integration-test/src/test/java/org/ballerinalang/test/service/websub/basic/WebSubCoreFunctionalityTestCase.java @@ -106,6 +106,7 @@ public class WebSubCoreFunctionalityTestCase extends WebSubBaseTest { private LogLeecher unsubscriptionIntentVerificationLogLeecher = new LogLeecher( UNSUBSCRIPTION_INTENT_VERIFICATION_LOG); private LogLeecher logAbsenceTestLogLeecher = new LogLeecher(INTERNAL_HUB_NOTIFICATION_LOG); + private LogLeecher logAbsenceTestLogLeecherTwo = new LogLeecher(QUERY_PARAM_LOG); private LogLeecher intentVerificationDenialLogLeecher = new LogLeecher(INTENT_VERIFICATION_DENIAL_LOG); private LogLeecher internalHubNotificationLogLeecherTwoAfterOneUnsubscription = new LogLeecher(INTERNAL_HUB_NOTIFICATION_LOG_TWO); @@ -186,6 +187,7 @@ public void testUnsubscriptionIntentVerification() throws BallerinaTestException } }); webSubSubscriber.addLogLeecher(logAbsenceTestLogLeecher); + webSubSubscriber.addLogLeecher(logAbsenceTestLogLeecherTwo); unsubscriptionIntentVerificationLogLeecher.waitForText(LOG_LEECHER_TIMEOUT); } @@ -194,9 +196,17 @@ public void testUnsubscriptionIntentVerification() throws BallerinaTestException expectedExceptions = BallerinaTestException.class, expectedExceptionsMessageRegExp = ".*Timeout expired waiting for matching log.*") public void testUnsubscription() throws BallerinaTestException { + try { + HttpResponse response = HttpClientRequest.doGet("http://localhost:23080/publisher/unsubscribe"); + Assert.assertEquals(response.getData(), "unsubscription successful"); + } catch (IOException e) { + throw new BallerinaTestException("Error requesting unsubscription"); + } + requestUpdate(PUBLISHER_NOTIFY_URL + PATH_SEPARATOR + "skip_subscriber_check", HUB_MODE_INTERNAL, CONTENT_TYPE_JSON); logAbsenceTestLogLeecher.waitForText(5000); + logAbsenceTestLogLeecherTwo.waitForText(2500); internalHubNotificationLogLeecherTwoAfterOneUnsubscription.waitForText(LOG_LEECHER_TIMEOUT); } diff --git a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal index 4dced70ec7e7..0eb22bb2f958 100644 --- a/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal +++ b/tests/jballerina-integration-test/src/test/resources/websub/publisher/src/services/01_websub_publisher.bal @@ -110,6 +110,15 @@ service publisher on publisherServiceEP { } } } + + resource function unsubscribe(http:Caller caller, http:Request req) returns error? { + check webSubHub.removeSubscription("http://one.websub.topic.com", + "http://localhost:23181/websubThree?topic=http://one.websub.topic.com&fooVal=barVal"); + var err = caller->respond("unsubscription successful"); + if (err is error) { + log:printError("Error responding on unsubscription request", err); + } + } } service publisherTwo on publisherServiceEP { From 120a81a2551d207e4e884865589deca20e1843d2 Mon Sep 17 00:00:00 2001 From: Pubudu Fernando Date: Fri, 1 Nov 2019 10:53:10 +0530 Subject: [PATCH 152/167] Fix usage of AbstractTransportCompilerPlugin --- .../service/compiler/DirectoryListenerCompilerPlugin.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java index 6a4ddca6eb39..a957444e469a 100644 --- a/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java +++ b/stdlib/file/src/main/java/org/ballerinalang/stdlib/file/service/compiler/DirectoryListenerCompilerPlugin.java @@ -18,6 +18,7 @@ package org.ballerinalang.stdlib.file.service.compiler; +import org.ballerinalang.compiler.plugins.AbstractCompilerPlugin; import org.ballerinalang.compiler.plugins.SupportedResourceParamTypes; import org.ballerinalang.model.tree.AnnotationAttachmentNode; import org.ballerinalang.model.tree.ServiceNode; @@ -27,7 +28,6 @@ import org.wso2.ballerinalang.compiler.semantics.model.types.BType; import org.wso2.ballerinalang.compiler.tree.BLangFunction; import org.wso2.ballerinalang.compiler.tree.BLangSimpleVariable; -import org.wso2.ballerinalang.util.AbstractTransportCompilerPlugin; import java.util.List; @@ -46,7 +46,7 @@ expectedListenerType = @SupportedResourceParamTypes.Type(packageName = "file", name = "Listener"), paramTypes = { @SupportedResourceParamTypes.Type(packageName = "file", name = "FileEvent") } ) -public class DirectoryListenerCompilerPlugin extends AbstractTransportCompilerPlugin { +public class DirectoryListenerCompilerPlugin extends AbstractCompilerPlugin { private DiagnosticLog dlog = null; @@ -85,9 +85,6 @@ public void validate(String serviceName, BLangFunction resource, DiagnosticLog d } } } - if (!isResourceReturnsErrorOrNil(resource)) { - dlog.logDiagnostic(ERROR, resource.getPosition(), msg); - } break; default: dlog.logDiagnostic(ERROR, resource.getPosition(), From 0c0587f374f0801ea5b76917c1b26568dd415c2c Mon Sep 17 00:00:00 2001 From: chamil321 Date: Fri, 1 Nov 2019 10:53:26 +0530 Subject: [PATCH 153/167] Improve subscription related logs --- .../src/main/ballerina/src/websub/annotation.bal | 2 ++ .../websub/src/main/ballerina/src/websub/commons.bal | 1 + .../src/main/ballerina/src/websub/hub_service.bal | 7 +++++++ .../src/websub/subscriber_service_endpoint.bal | 11 +++++++++-- .../net/websub/WebSubSubscriberConstants.java | 1 + .../nativeimpl/RetrieveSubscriptionParameters.java | 4 ++++ 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/annotation.bal b/stdlib/websub/src/main/ballerina/src/websub/annotation.bal index d72d12eddbe9..9dc2a395e24c 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/annotation.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/annotation.bal @@ -28,6 +28,7 @@ import ballerina/http; # + leaseSeconds - The period for which the subscription is expected to be active # + secret - The secret to be used for authenticated content distribution # + callback - The callback to use when registering, if unspecified host:port/path will be used +# + expectIntentVerification - A `boolean` indicating whether an intent verification is expected from the hub # + publisherClientConfig - The configuration for the discovery client, to use if a resource URL is specified # + hubClientConfig - The configuration for the hub client used to interact with the discovered/specified hub public type SubscriberServiceConfiguration record {| @@ -37,6 +38,7 @@ public type SubscriberServiceConfiguration record {| int leaseSeconds?; string secret?; string callback?; + boolean expectIntentVerification = false; http:ClientConfiguration publisherClientConfig?; http:ClientConfiguration hubClientConfig?; |}; diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index 613cb589a778..d26d9abe015f 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -75,6 +75,7 @@ const ANNOT_FIELD_CALLBACK = "callback"; const ANNOT_FIELD_LEASE_SECONDS = "leaseSeconds"; const ANNOT_FIELD_SECRET = "secret"; const ANNOT_FIELD_SUBSCRIBE_ON_STARTUP = "subscribeOnStartUp"; +const ANNOT_FIELD_EXPECT_INTENT_VERIFICATION = "expectIntentVerification"; const ANNOT_FIELD_HUB_CLIENT_CONFIG = "hubClientConfig"; const ANNOT_FIELD_PUBLISHER_CLIENT_CONFIG = "publisherClientConfig"; diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal index 973548d69371..20d13e521dc4 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_service.bal @@ -240,11 +240,16 @@ function getHubService() returns service { string callbackFromParams = params[HUB_CALLBACK] ?: ""; var decodedCallbackFromParams = encoding:decodeUriComponent(callbackFromParams, "UTF-8"); string callback = decodedCallbackFromParams is string ? decodedCallbackFromParams : callbackFromParams; + + log:printInfo("Subscription request received for topic[" + topic + "] with callback[" + callback + "]"); + var validationStatus = validateSubscriptionChangeRequest(mode, topic, callback); if (validationStatus is error) { response.statusCode = http:STATUS_BAD_REQUEST; string errorMessage = validationStatus.detail()?.message; response.setTextPayload(errorMessage); + log:printError("Invalid subscription request received for topic[" + topic + "] with callback[" + + callback + "]"); } else { validSubscriptionChangeRequest = true; response.statusCode = http:STATUS_ACCEPTED; @@ -319,6 +324,8 @@ function verifyIntentAndAddSubscription(string callback, string topic, mapget(<@untainted string> queryParams, request); if (subscriberResponse is http:Response) { diff --git a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal index ba56b052825c..a3ca9601b629 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/subscriber_service_endpoint.bal @@ -277,8 +277,15 @@ function invokeClientConnectorForSubscription(string hub, http:ClientConfigurati var subscriptionResponse = websubHubClientEP->subscribe(subscriptionChangeRequest); if (subscriptionResponse is SubscriptionChangeResponse) { - log:printInfo("Subscription Request successful at Hub[" + subscriptionResponse.hub + - "], for Topic[" + subscriptionResponse.topic + "], with Callback [" + callback + "]"); + string subscriptionSuccessMsg = "Subscription Request successfully sent to Hub[" + subscriptionResponse.hub + + "], for Topic[" + subscriptionResponse.topic + "], with Callback [" + callback + "]"; + + boolean expectIntentVerification = subscriptionDetails[ANNOT_FIELD_EXPECT_INTENT_VERIFICATION]; + if (expectIntentVerification) { + log:printInfo(subscriptionSuccessMsg + ". Awaiting intent verification."); + return; + } + log:printInfo(subscriptionSuccessMsg); } else { string errCause = subscriptionResponse.detail()?.message; log:printError("Subscription Request failed at Hub[" + hub + "], for Topic[" + topic + "]: " + errCause); diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java index dbeb07ae9bfb..3fb046f8b524 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/WebSubSubscriberConstants.java @@ -53,6 +53,7 @@ public class WebSubSubscriberConstants { public static final String ANN_WEBSUB_ATTR_LEASE_SECONDS = "leaseSeconds"; public static final String ANN_WEBSUB_ATTR_SECRET = "secret"; public static final String ANN_WEBSUB_ATTR_CALLBACK = "callback"; + public static final String ANN_WEBSUB_ATTR_EXPECT_INTENT_VERIFICATION = "expectIntentVerification"; public static final String ANN_WEBSUB_ATTR_SUBSCRIPTION_PUBLISHER_CLIENT_CONFIG = "publisherClientConfig"; public static final String ANN_WEBSUB_ATTR_SUBSCRIPTION_HUB_CLIENT_CONFIG = "hubClientConfig"; diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RetrieveSubscriptionParameters.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RetrieveSubscriptionParameters.java index 69fb646943c3..3b974db031d6 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RetrieveSubscriptionParameters.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/nativeimpl/RetrieveSubscriptionParameters.java @@ -39,6 +39,7 @@ import static org.ballerinalang.net.http.HttpConstants.HTTP_SERVER_CONNECTOR; import static org.ballerinalang.net.websub.WebSubSubscriberConstants.ANN_NAME_WEBSUB_SUBSCRIBER_SERVICE_CONFIG; import static org.ballerinalang.net.websub.WebSubSubscriberConstants.ANN_WEBSUB_ATTR_CALLBACK; +import static org.ballerinalang.net.websub.WebSubSubscriberConstants.ANN_WEBSUB_ATTR_EXPECT_INTENT_VERIFICATION; import static org.ballerinalang.net.websub.WebSubSubscriberConstants.ANN_WEBSUB_ATTR_LEASE_SECONDS; import static org.ballerinalang.net.websub.WebSubSubscriberConstants.ANN_WEBSUB_ATTR_SECRET; import static org.ballerinalang.net.websub.WebSubSubscriberConstants.ANN_WEBSUB_ATTR_SUBSCRIBE_ON_STARTUP; @@ -107,6 +108,9 @@ public static ArrayValue retrieveSubscriptionParameters(Strand strand, ObjectVal subscriptionDetails.put(ANN_WEBSUB_ATTR_SECRET, annotation.getStringValue(ANN_WEBSUB_ATTR_SECRET)); } + subscriptionDetails.put(ANN_WEBSUB_ATTR_EXPECT_INTENT_VERIFICATION, + annotation.getBooleanValue(ANN_WEBSUB_ATTR_EXPECT_INTENT_VERIFICATION)); + if (annotation.containsKey(ANN_WEBSUB_ATTR_SUBSCRIPTION_PUBLISHER_CLIENT_CONFIG)) { MapValue publisherClientConfig = (MapValue) annotation.get(ANN_WEBSUB_ATTR_SUBSCRIPTION_PUBLISHER_CLIENT_CONFIG); From 4396dc2223d85fe5aa09cd3cba044185478a15de Mon Sep 17 00:00:00 2001 From: chamil321 Date: Fri, 1 Nov 2019 10:54:17 +0530 Subject: [PATCH 154/167] Fix concurrent modification issue --- .../src/main/java/org/ballerinalang/net/websub/hub/Hub.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java index 7067177be97a..316576dbd870 100644 --- a/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java +++ b/stdlib/websub/src/main/java/org/ballerinalang/net/websub/hub/Hub.java @@ -151,7 +151,8 @@ public void unregisterSubscription(Strand strand, String topic, String callback) } return; } else { - for (HubSubscriber subscriber: getSubscribers()) { + List currentSubscriberList = getSubscribers(); + for (HubSubscriber subscriber: currentSubscriberList) { if (subscriber.equals(subscriberToUnregister)) { subscriberToUnregister = subscriber; break; From 0cb9e867ef06d315f083b45a5e8405beda7c36eb Mon Sep 17 00:00:00 2001 From: Chanaka Lakmal Date: Fri, 1 Nov 2019 12:07:31 +0530 Subject: [PATCH 155/167] Fix a bug in authz --- stdlib/auth/src/main/ballerina/src/auth/utils.bal | 4 ++-- .../src/main/ballerina/src/jwt/inbound_jwt_auth_provider.bal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/auth/src/main/ballerina/src/auth/utils.bal b/stdlib/auth/src/main/ballerina/src/auth/utils.bal index 33fee005d426..8b1104179367 100644 --- a/stdlib/auth/src/main/ballerina/src/auth/utils.bal +++ b/stdlib/auth/src/main/ballerina/src/auth/utils.bal @@ -109,10 +109,10 @@ public function setAuthenticationContext(string scheme, string authToken) { public function setPrincipal(public string? userId = (), public string? username = (), public string[]? scopes = (), public map? claims = ()) { runtime:InvocationContext invocationContext = runtime:getInvocationContext(); - if (!(userId is ())) { + if (!(userId is ()) && userId != "") { invocationContext.principal.userId = userId; } - if (!(username is ())) { + if (!(username is ()) && username != "") { invocationContext.principal.username = username; } if (!(scopes is ())) { diff --git a/stdlib/jwt/src/main/ballerina/src/jwt/inbound_jwt_auth_provider.bal b/stdlib/jwt/src/main/ballerina/src/jwt/inbound_jwt_auth_provider.bal index b35bd65faf54..fd600ac7936d 100644 --- a/stdlib/jwt/src/main/ballerina/src/jwt/inbound_jwt_auth_provider.bal +++ b/stdlib/jwt/src/main/ballerina/src/jwt/inbound_jwt_auth_provider.bal @@ -113,7 +113,7 @@ function setPrincipal(JwtPayload jwtPayload) { auth:setPrincipal(claims = claims); if (claims.hasKey(SCOPE)) { var scopeString = claims[SCOPE]; - if (scopeString is string) { + if (scopeString is string && scopeString != "") { auth:setPrincipal(scopes = stringutils:split(scopeString, " ")); } } From 21c43bd235f29af64f452b7c33606382c7384078 Mon Sep 17 00:00:00 2001 From: Tharushi Jayasekara Date: Fri, 1 Nov 2019 11:30:38 +0530 Subject: [PATCH 156/167] Fix launch.json --- tool-plugins/vscode/.vscode/launch.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool-plugins/vscode/.vscode/launch.json b/tool-plugins/vscode/.vscode/launch.json index 53f82ac54e3f..bb6d25df9003 100644 --- a/tool-plugins/vscode/.vscode/launch.json +++ b/tool-plugins/vscode/.vscode/launch.json @@ -13,8 +13,8 @@ "--extensionDevelopmentPath=${workspaceFolder}" ], "env": { - "LS_CUSTOM_CLASSPATH": "/home/tharushi/ballerina-lang/language-server/modules/langserver-core/build/distributions/*", - "LSDEBUG": "true", + "LS_CUSTOM_CLASSPATH": "", + "LSDEBUG": "false", "COMPOSER_DEBUG": "false", "COMPOSER_DEV_HOST": "http://localhost:9000" }, From 2c5103c0b1ab595c3ae525534ea708eaaa33e428 Mon Sep 17 00:00:00 2001 From: praneesha Date: Fri, 1 Nov 2019 12:33:03 +0530 Subject: [PATCH 157/167] Update examples/restrict-by-media-type/restrict_by_media_type.bal Co-Authored-By: Pubudu Fernando --- examples/restrict-by-media-type/restrict_by_media_type.bal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/restrict-by-media-type/restrict_by_media_type.bal b/examples/restrict-by-media-type/restrict_by_media_type.bal index 5d833dadfb7f..73b937592903 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.bal +++ b/examples/restrict-by-media-type/restrict_by_media_type.bal @@ -3,7 +3,7 @@ import ballerina/log; service infoService on new http:Listener(9092) { // The `consumes` and `produces` annotations contain MIME types as an - // array of strings. The resource can consume/accept only the `text/json` and + // array of strings. The resource can only consume/accept `text/json` and // `application/json` media types. Therefore, the `Content-Type` header // of the request must be in one of these two types. The resource can produce // `application/xml` payloads. Therefore, you need to set the `Accept` header accordingly. From c501a92baf766c552584bfb0d04ee3eb675d6873 Mon Sep 17 00:00:00 2001 From: praneesha Date: Fri, 1 Nov 2019 12:35:21 +0530 Subject: [PATCH 158/167] Update examples/restrict-by-media-type/restrict_by_media_type.client.out Co-Authored-By: Pubudu Fernando --- .../restrict-by-media-type/restrict_by_media_type.client.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/restrict-by-media-type/restrict_by_media_type.client.out b/examples/restrict-by-media-type/restrict_by_media_type.client.out index f58508d0ed6d..47b810606877 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.client.out +++ b/examples/restrict-by-media-type/restrict_by_media_type.client.out @@ -9,7 +9,7 @@ $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Cont Ballerina # To invoke the service using unsupported media type, execute the following client. The Content type of the -# request is not listed under the consumer's resource configuration. +# request is not listed under the `consumes` resource configuration. $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Content-Type:text/plain" -d "Hello ballerina" # The server response. < HTTP/1.1 415 Unsupported Media Type From 37162b6ea2b8909d4e4e62cdd3b30515c207db73 Mon Sep 17 00:00:00 2001 From: praneesha Date: Fri, 1 Nov 2019 12:35:32 +0530 Subject: [PATCH 159/167] Update examples/restrict-by-media-type/restrict_by_media_type.client.out Co-Authored-By: Pubudu Fernando --- .../restrict-by-media-type/restrict_by_media_type.client.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/restrict-by-media-type/restrict_by_media_type.client.out b/examples/restrict-by-media-type/restrict_by_media_type.client.out index 47b810606877..0ec4bdea38cf 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.client.out +++ b/examples/restrict-by-media-type/restrict_by_media_type.client.out @@ -19,7 +19,7 @@ $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Cont * Connection #0 to host localhost left intact # To invoke the service with a media type that is not acceptable, execute the following client. The media type mentioned -# in the Accept header is not listed under the producer's resource configuration. +# in the Accept header is not listed under the `produces` resource configuration. $ curl -v http://localhost:9092/infoService -H "Accept:text/html" -H "Content-Type:application/json" -d '{"name":"Ballerina"}' # The server response. < HTTP/1.1 406 Not Acceptable From 7d2b636cb47a09940105d1e809f1b93e557e9777 Mon Sep 17 00:00:00 2001 From: praneesha Date: Fri, 1 Nov 2019 12:35:55 +0530 Subject: [PATCH 160/167] Update examples/http-disable-chunking/http_disable_chunking.bal Co-Authored-By: Chamil Elladeniya --- examples/http-disable-chunking/http_disable_chunking.bal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/http-disable-chunking/http_disable_chunking.bal b/examples/http-disable-chunking/http_disable_chunking.bal index 33e8a39dac8b..52822023e06a 100644 --- a/examples/http-disable-chunking/http_disable_chunking.bal +++ b/examples/http-disable-chunking/http_disable_chunking.bal @@ -2,7 +2,7 @@ import ballerina/http; import ballerina/log; //The HTTP client's chunking behaviour can be configured as auto, always, or never. -//In this example, it is set to never, which means that chunking never happens irrespective of how it is specified +//In this example, it is set to `CHUNKING_NEVER`, which means that chunking never happens irrespective of how it is specified //in the request. When chunking is set to auto, chunking is done as specified in the request. http:Client clientEndpoint = new("http://localhost:9090", From 5007f79c0a820b517a3adc450c189a5bd175823e Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Fri, 1 Nov 2019 12:44:32 +0530 Subject: [PATCH 161/167] Address review comments --- examples/mutual-ssl/mutual_ssl_service.bal | 2 +- .../restrict-by-media-type/restrict_by_media_type.client.out | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/mutual-ssl/mutual_ssl_service.bal b/examples/mutual-ssl/mutual_ssl_service.bal index 68830896dcaf..bf570ac11134 100644 --- a/examples/mutual-ssl/mutual_ssl_service.bal +++ b/examples/mutual-ssl/mutual_ssl_service.bal @@ -13,7 +13,7 @@ http:ListenerConfiguration helloWorldEPConfig = { path: "${ballerina.home}/bre/security/ballerinaTruststore.p12", password: "ballerina" }, - // Configure the preferred SSL protocol and the versions to enable the HTTP Listener. + // Enable the preferred SSL protocol and its versions. protocol: { name: "TLS", versions: ["TLSv1.2", "TLSv1.1"] diff --git a/examples/restrict-by-media-type/restrict_by_media_type.client.out b/examples/restrict-by-media-type/restrict_by_media_type.client.out index 0ec4bdea38cf..5b466308ff3f 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.client.out +++ b/examples/restrict-by-media-type/restrict_by_media_type.client.out @@ -1,4 +1,4 @@ -# To invoke the service, execute the following client. +# To invoke the service, execute the following cURL request. $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Content-Type:application/json" -d '{"name":"Ballerina"}' # The server response. < HTTP/1.1 200 OK @@ -8,7 +8,7 @@ $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Cont * Connection #0 to host localhost left intact Ballerina -# To invoke the service using unsupported media type, execute the following client. The Content type of the +# To invoke the service using unsupported media type, execute the following cURL request. The content type of the # request is not listed under the `consumes` resource configuration. $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Content-Type:text/plain" -d "Hello ballerina" # The server response. From 4497e2764ad4cbfd26265fb6287e49133cf3f6e3 Mon Sep 17 00:00:00 2001 From: praneesha Date: Fri, 1 Nov 2019 12:49:35 +0530 Subject: [PATCH 162/167] Update examples/http-disable-chunking/http_disable_chunking.bal Co-Authored-By: Chamil Elladeniya --- examples/http-disable-chunking/http_disable_chunking.bal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/http-disable-chunking/http_disable_chunking.bal b/examples/http-disable-chunking/http_disable_chunking.bal index 52822023e06a..606880c29191 100644 --- a/examples/http-disable-chunking/http_disable_chunking.bal +++ b/examples/http-disable-chunking/http_disable_chunking.bal @@ -1,7 +1,7 @@ import ballerina/http; import ballerina/log; -//The HTTP client's chunking behaviour can be configured as auto, always, or never. +//The HTTP client's chunking behaviour can be configured as `CHUNKING_AUTO`, `CHUNKING_ALWAYS`, or `CHUNKING_NEVER`. //In this example, it is set to `CHUNKING_NEVER`, which means that chunking never happens irrespective of how it is specified //in the request. When chunking is set to auto, chunking is done as specified in the request. From f17af43f86c0d947203f19e165717ec4f00eadc8 Mon Sep 17 00:00:00 2001 From: praneesha Date: Fri, 1 Nov 2019 12:49:46 +0530 Subject: [PATCH 163/167] Update examples/http-disable-chunking/http_disable_chunking.bal Co-Authored-By: Chamil Elladeniya --- examples/http-disable-chunking/http_disable_chunking.bal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/http-disable-chunking/http_disable_chunking.bal b/examples/http-disable-chunking/http_disable_chunking.bal index 606880c29191..39155448c5fb 100644 --- a/examples/http-disable-chunking/http_disable_chunking.bal +++ b/examples/http-disable-chunking/http_disable_chunking.bal @@ -3,7 +3,7 @@ import ballerina/log; //The HTTP client's chunking behaviour can be configured as `CHUNKING_AUTO`, `CHUNKING_ALWAYS`, or `CHUNKING_NEVER`. //In this example, it is set to `CHUNKING_NEVER`, which means that chunking never happens irrespective of how it is specified -//in the request. When chunking is set to auto, chunking is done as specified in the request. +//in the request. When chunking is set to `CHUNKING_AUTO`, chunking is done as specified in the request. http:Client clientEndpoint = new("http://localhost:9090", { http1Settings : { chunking: http:CHUNKING_NEVER }}); From 1db10983546fef3c1e8d689787735d7725639961 Mon Sep 17 00:00:00 2001 From: Praneesha Nayomi Chandrasiri Date: Fri, 1 Nov 2019 12:53:31 +0530 Subject: [PATCH 164/167] Address one more review comment --- .../restrict-by-media-type/restrict_by_media_type.client.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/restrict-by-media-type/restrict_by_media_type.client.out b/examples/restrict-by-media-type/restrict_by_media_type.client.out index 5b466308ff3f..c6acc1f590d3 100644 --- a/examples/restrict-by-media-type/restrict_by_media_type.client.out +++ b/examples/restrict-by-media-type/restrict_by_media_type.client.out @@ -18,7 +18,7 @@ $ curl -v http://localhost:9092/infoService -H "Accept:application/xml" -H "Cont < * Connection #0 to host localhost left intact -# To invoke the service with a media type that is not acceptable, execute the following client. The media type mentioned +# To invoke the service with a media type that is not acceptable, execute the following cURL request. The media type mentioned # in the Accept header is not listed under the `produces` resource configuration. $ curl -v http://localhost:9092/infoService -H "Accept:text/html" -H "Content-Type:application/json" -d '{"name":"Ballerina"}' # The server response. From 2b0f688c54fd51ab8fea3d838fdd0f112afaaabf Mon Sep 17 00:00:00 2001 From: chamil321 Date: Fri, 1 Nov 2019 14:43:25 +0530 Subject: [PATCH 165/167] Update websub BBEs --- .../websub-hub-client-sample/publisher.bal | 12 ++++++++--- .../websub-hub-client-sample/publisher.out | 15 ++++++++++--- .../subscriber_service.bal | 2 +- .../subscriber_service.out | 5 ++++- .../subscription_change_client.bal | 11 +++++----- .../websub-internal-hub-sample/publisher.bal | 11 ++++++++-- .../websub-internal-hub-sample/publisher.out | 10 ++++++--- .../websub-internal-hub-sample/subscriber.out | 6 +++--- examples/websub-remote-hub-sample/hub.bal | 21 +++++++++++++------ examples/websub-remote-hub-sample/hub.out | 12 +++++++---- .../websub-remote-hub-sample/publisher.bal | 2 +- .../websub-remote-hub-sample/subscriber.out | 6 +++--- .../order_mgmt_service.server.out | 10 ++++++--- .../subscriber.out | 4 ++-- .../src/main/ballerina/src/websub/commons.bal | 2 +- .../test-src/hub/test_hub_startup.bal | 8 +++---- .../test_specific_subscriber.bal | 2 +- 17 files changed, 93 insertions(+), 46 deletions(-) diff --git a/examples/websub-hub-client-sample/publisher.bal b/examples/websub-hub-client-sample/publisher.bal index fe95850dbde6..fb23e9520b2e 100644 --- a/examples/websub-hub-client-sample/publisher.bal +++ b/examples/websub-hub-client-sample/publisher.bal @@ -9,10 +9,16 @@ public function main() { // Starts the internal Ballerina Hub. io:println("Starting up the Ballerina Hub Service"); - + websub:Hub webSubHub; var result = websub:startHub(new http:Listener(9191), "/websub", "/hub"); - websub:Hub webSubHub = result is websub:HubStartedUpError - ? result.startedUpHub : result; + if (result is websub:Hub) { + webSubHub = result; + } else if (result is websub:HubStartedUpError) { + webSubHub = result.startedUpHub; + } else { + io:println("Hub start error:" + result.detail()?.message); + return; + } // Registers a topic at the hub. var registrationResponse = webSubHub.registerTopic( "http://websubpubtopic.com"); diff --git a/examples/websub-hub-client-sample/publisher.out b/examples/websub-hub-client-sample/publisher.out index 2c9a06bcefdc..d7177a161c8e 100644 --- a/examples/websub-hub-client-sample/publisher.out +++ b/examples/websub-hub-client-sample/publisher.out @@ -5,10 +5,19 @@ # `.bal` file, and execute the `ballerina run` command. $ ballerina run publisher.bal Starting up the Ballerina Hub Service +[ballerina/websub] Ballerina WebSub Hub started up. +[ballerina/websub] Publish URL: http://localhost:9191/websub/publish +[ballerina/websub] Subscription URL: http://localhost:9191/websub/hub [ballerina/http] started HTTP/WS listener 0.0.0.0:9191 -[ballerina/websub] Default Ballerina WebSub Hub started up at http://localhost:9191/websub/hub Topic registration successful! -2018-04-26 22:40:35,678 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/websub] +2019-11-01 14:06:38,035 INFO [ballerina/websub] - Subscription request received for topic[http://websubpubtopic.com] with callback[http://localhost:8181/websub] +2019-11-01 14:06:38,255 INFO [ballerina/websub] - Sending intent verification request to callback[http://localhost:8181/websub] for topic[http://websubpubtopic.com] +2019-11-01 14:06:38,781 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/websub] Update notification successful! -2018-04-26 22:40:50,493 INFO [ballerina/websub] - Intent verification successful for mode: [unsubscribe], for callback URL: [http://localhost:8181/websub] +2019-11-01 14:06:40,572 INFO [ballerina/websub] - Subscription request received for topic[http://websubpubtopic.com] with callback[http://localhost:8181/websub] +2019-11-01 14:06:40,576 INFO [ballerina/websub] - Sending intent verification request to callback[http://localhost:8181/websub] for topic[http://websubpubtopic.com] +2019-11-01 14:06:40,627 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/websub] Update notification successful! +2019-11-01 14:06:45,628 INFO [ballerina/websub] - Subscription request received for topic[http://websubpubtopic.com] with callback[http://localhost:8181/websub] +2019-11-01 14:06:45,637 INFO [ballerina/websub] - Sending intent verification request to callback[http://localhost:8181/websub] for topic[http://websubpubtopic.com] +2019-11-01 14:06:45,695 INFO [ballerina/websub] - Intent verification successful for mode: [unsubscribe], for callback URL: [http://localhost:8181/websub] diff --git a/examples/websub-hub-client-sample/subscriber_service.bal b/examples/websub-hub-client-sample/subscriber_service.bal index 6c5e9004c406..6ec818f9369c 100644 --- a/examples/websub-hub-client-sample/subscriber_service.bal +++ b/examples/websub-hub-client-sample/subscriber_service.bal @@ -11,7 +11,7 @@ listener websub:Listener websubEP = new(8181); // Also, the exclusion of the onIntentVerification resource will result in auto intent-verification. @websub:SubscriberServiceConfig { path: "/websub", - target: ["https://localhost:9191/websub/hub","http://websubpubtopic.com"], + target: ["http://localhost:9191/websub/hub","http://websubpubtopic.com"], secret: "Kslk30SNF2AChs2" } service websubSubscriber on websubEP { diff --git a/examples/websub-hub-client-sample/subscriber_service.out b/examples/websub-hub-client-sample/subscriber_service.out index ed34a111ec75..b6424e7b3d17 100644 --- a/examples/websub-hub-client-sample/subscriber_service.out +++ b/examples/websub-hub-client-sample/subscriber_service.out @@ -3,6 +3,9 @@ # `.bal` file, and use the `ballerina run` command. $ ballerina run subscriber_service.bal [ballerina/http] started HTTP/WS listener 0.0.0.0:8181 +2019-11-01 14:06:38,171 INFO [ballerina/websub] - Subscription Request successfully sent to Hub[http://localhost:9191/websub/hub], for Topic[http://websubpubtopic.com], with Callback [http://localhost:8181/websub] ballerina: Intent Verification agreed - Mode [subscribe], Topic [http://websubpubtopic.com], Lease Seconds [86400] -2018-04-26 22:40:47,310 INFO [] - WebSub Notification Received: {"action":"publish", "mode":"internal-hub"} +2019-11-01 14:06:40,196 INFO [] - WebSub Notification Received: {"action":"publish", "mode":"internal-hub"} +ballerina: Intent Verification agreed - Mode [subscribe], Topic [http://websubpubtopic.com], Lease Seconds [86400] +2019-11-01 14:06:45,052 INFO [] - WebSub Notification Received: {"action":"publish", "mode":"internal-hub"} ballerina: Intent Verification agreed - Mode [unsubscribe], Topic [http://websubpubtopic.com] diff --git a/examples/websub-hub-client-sample/subscription_change_client.bal b/examples/websub-hub-client-sample/subscription_change_client.bal index 24f42eefc14b..40772bc31adf 100644 --- a/examples/websub-hub-client-sample/subscription_change_client.bal +++ b/examples/websub-hub-client-sample/subscription_change_client.bal @@ -21,9 +21,9 @@ public function main() { io:println("Subscription Request successful at Hub [" + response.hub + "] for Topic [" + response.topic + "]"); } else { - string errCause = response.detail().message; - io:println("Error occurred with Subscription Request: " + - response.detail()?.message); + error err = response; + string errCause = err.detail()?.message; + io:println("Error occurred with Subscription Request: " + errCause); } // Waits for the initial notification before unsubscribing. @@ -41,7 +41,8 @@ public function main() { io:println("Unsubscription Request successful at Hub [" + response.hub + "] for Topic [" + response.topic + "]"); } else { - io:println("Error occurred with Unsubscription Request: " + - response.detail()?.message); + error err = response; + string errCause = err.detail()?.message; + io:println("Error occurred with Unsubscription Request: " + errCause); } } diff --git a/examples/websub-internal-hub-sample/publisher.bal b/examples/websub-internal-hub-sample/publisher.bal index 916384e8365b..4b1886cec51f 100644 --- a/examples/websub-internal-hub-sample/publisher.bal +++ b/examples/websub-internal-hub-sample/publisher.bal @@ -9,9 +9,16 @@ public function main() { // Specifies the port that the internal Ballerina hub needs to start on and start the hub. io:println("Starting up the Ballerina Hub Service"); + websub:Hub webSubHub; var result = websub:startHub(new http:Listener(9191), "/websub", "/hub"); - websub:Hub webSubHub = result is websub:HubStartedUpError ? - result.startedUpHub : result; + if (result is websub:Hub) { + webSubHub = result; + } else if (result is websub:HubStartedUpError) { + webSubHub = result.startedUpHub; + } else { + io:println("Hub start error:" + result.detail()?.message); + return; + } // Registers a topic at the hub. var registrationResponse = webSubHub.registerTopic( diff --git a/examples/websub-internal-hub-sample/publisher.out b/examples/websub-internal-hub-sample/publisher.out index de79a01d2b71..36bff80b5ba5 100644 --- a/examples/websub-internal-hub-sample/publisher.out +++ b/examples/websub-internal-hub-sample/publisher.out @@ -3,9 +3,13 @@ # `.bal` file, and execute the `ballerina run` command. $ ballerina run publisher.bal Starting up the Ballerina Hub Service -[ballerina/http] started HTTP/WS listener 0.0.0.0:9191 -[ballerina/websub] Default Ballerina WebSub Hub started up at http://localhost:9191/websub/hub +[ballerina/websub] Ballerina WebSub Hub started up. +[ballerina/websub] Publish URL: http://localhost:9191/websub/publish +[ballerina/websub] Subscription URL: http://localhost:9191/websub/hub Topic registration successful! -2018-04-26 21:43:17,627 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/websub] +[ballerina/http] started HTTP/WS listener 0.0.0.0:9191 +2019-11-01 14:12:22,809 INFO [ballerina/websub] - Subscription request received for topic[http://websubpubtopic.com] with callback[http://localhost:8181/websub] +2019-11-01 14:12:22,906 INFO [ballerina/websub] - Sending intent verification request to callback[http://localhost:8181/websub] for topic[http://websubpubtopic.com] +2019-11-01 14:12:23,139 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/websub] Publishing update to internal Hub Update notification successful! diff --git a/examples/websub-internal-hub-sample/subscriber.out b/examples/websub-internal-hub-sample/subscriber.out index c8536a51a09f..bb9ca55c984c 100644 --- a/examples/websub-internal-hub-sample/subscriber.out +++ b/examples/websub-internal-hub-sample/subscriber.out @@ -2,6 +2,6 @@ # `.bal` file, and use the `ballerina run` command. $ ballerina run subscriber.bal [ballerina/http] started HTTP/WS listener 0.0.0.0:8181 -2018-04-26 21:43:17,452 INFO [ballerina/websub] - Subscription Request successful at Hub[http://localhost:9191/websub/hub], for Topic[http://websubpubtopic.com], with Callback [http://localhost:8181/websub] -2018-04-26 21:43:17,555 INFO [] - Intent verified for subscription request -2018-04-26 21:43:36,309 INFO [] - WebSub Notification Received: {"action":"publish", "mode":"internal-hub"} +2019-11-01 14:12:22,870 INFO [ballerina/websub] - Subscription Request successfully sent to Hub[http://localhost:9191/websub/hub], for Topic[http://websubpubtopic.com], with Callback [http://localhost:8181/websub] +2019-11-01 14:12:23,074 INFO [] - Intent verified for subscription request +2019-11-01 14:12:25,035 INFO [] - WebSub Notification Received: {"action":"publish", "mode":"internal-hub"} diff --git a/examples/websub-remote-hub-sample/hub.bal b/examples/websub-remote-hub-sample/hub.bal index ab6c2525b308..5d2d860e0b5e 100644 --- a/examples/websub-remote-hub-sample/hub.bal +++ b/examples/websub-remote-hub-sample/hub.bal @@ -10,12 +10,21 @@ public function main() { // updates of the topics. io:println("Starting up the Ballerina Hub Service"); - var result = websub:startHub(new http:Listener(9191), "/websub", "/hub", { - remotePublish : { - enabled : true - }}); - websub:Hub webSubHub = result is websub:HubStartedUpError ? - result.startedUpHub : result; + websub:Hub webSubHub; + var result = websub:startHub(new http:Listener(9191), "/websub", "/hub", + hubConfiguration = { + remotePublish : { + enabled : true + }}); + + if (result is websub:Hub) { + webSubHub = result; + } else if (result is websub:HubStartedUpError) { + webSubHub = result.startedUpHub; + } else { + io:println("Hub start error:" + result.detail()?.message); + return; + } // Waits for the subscriber to subscribe at this hub and for the publisher to publish the notifications. runtime:sleep(10000); diff --git a/examples/websub-remote-hub-sample/hub.out b/examples/websub-remote-hub-sample/hub.out index d697a5b67ef5..46db5db9db51 100644 --- a/examples/websub-remote-hub-sample/hub.out +++ b/examples/websub-remote-hub-sample/hub.out @@ -5,8 +5,12 @@ # `.bal` file, and execute the `ballerina run` command. $ ballerina run hub.bal Starting up the Ballerina Hub Service +[ballerina/websub] Ballerina WebSub Hub started up. +[ballerina/websub] Publish URL: http://localhost:9191/websub/publish +[ballerina/websub] Subscription URL: http://localhost:9191/websub/hub [ballerina/http] started HTTP/WS listener 0.0.0.0:9191 -[ballerina/websub] Default Ballerina WebSub Hub started up at http://localhost:9191/websub/hub -2018-04-26 22:20:43,096 INFO [ballerina/websub] - Topic registration successful at Hub, for topic[http://websubpubtopic.com] -2018-04-26 22:20:45,960 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/websub] -2018-04-26 22:20:53,377 INFO [ballerina/websub] - Update notification done for Topic [http://websubpubtopic.com] +2019-11-01 14:36:36,782 INFO [ballerina/websub] - Topic registration successful at Hub, for topic[http://websubpubtopic.com] +2019-11-01 14:36:42,764 INFO [ballerina/websub] - Subscription request received for topic[http://websubpubtopic.com] with callback[http://localhost:8181/websub] +2019-11-01 14:36:42,807 INFO [ballerina/websub] - Sending intent verification request to callback[http://localhost:8181/websub] for topic[http://websubpubtopic.com] +2019-11-01 14:36:43,116 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/websub] +2019-11-01 14:36:46,952 INFO [ballerina/websub] - Update notification done for Topic [http://websubpubtopic.com] diff --git a/examples/websub-remote-hub-sample/publisher.bal b/examples/websub-remote-hub-sample/publisher.bal index 2a7eb828ab4e..e0191fb31c78 100644 --- a/examples/websub-remote-hub-sample/publisher.bal +++ b/examples/websub-remote-hub-sample/publisher.bal @@ -5,7 +5,7 @@ import ballerina/websub; // This is the remote WebSub Hub Endpoint to which registration and publish requests are sent. websub:PublisherClient websubHubClientEP = - new ("http://localhost:9191/websub/hub"); + new ("http://localhost:9191/websub/publish"); public function main() { diff --git a/examples/websub-remote-hub-sample/subscriber.out b/examples/websub-remote-hub-sample/subscriber.out index e5037266fff1..1f495747862a 100644 --- a/examples/websub-remote-hub-sample/subscriber.out +++ b/examples/websub-remote-hub-sample/subscriber.out @@ -2,6 +2,6 @@ # `.bal` file, and use the `ballerina run` command. $ ballerina run subscriber.bal [ballerina/http] started HTTP/WS listener 0.0.0.0:8181 -2018-04-26 22:20:45,790 INFO [ballerina/websub] - Subscription Request successful at Hub[http://localhost:9191/websub/hub], for Topic[http://websubpubtopic.com], with Callback [http://localhost:8181/websub] -2018-04-26 22:20:45,888 INFO [] - Intent verified for subscription request -2018-04-26 22:20:53,456 INFO [] - WebSub Notification Received: {"action":"publish", "mode":"remote-hub"} +2019-11-01 14:36:42,797 INFO [ballerina/websub] - Subscription Request successfully sent to Hub[http://localhost:9191/websub/hub], for Topic[http://websubpubtopic.com], with Callback [http://localhost:8181/websub] +2019-11-01 14:36:43,050 INFO [] - Intent verified for subscription request +2019-11-01 14:36:47,098 INFO [] - WebSub Notification Received: {"action":"publish", "mode":"remote-hub"} diff --git a/examples/websub-service-integration-sample/order_mgmt_service.server.out b/examples/websub-service-integration-sample/order_mgmt_service.server.out index 5b67daa3426e..6ef4cd771536 100644 --- a/examples/websub-service-integration-sample/order_mgmt_service.server.out +++ b/examples/websub-service-integration-sample/order_mgmt_service.server.out @@ -2,8 +2,12 @@ # To start the service, navigate to the directory that contains the # `.bal` file, and use the `ballerina run` command. $ ballerina run order_mgmt_service.bal +[ballerina/websub] Ballerina WebSub Hub started up. +[ballerina/websub] Publish URL: http://localhost:9191/websub/publish +[ballerina/websub] Subscription URL: http://localhost:9191/websub/hub [ballerina/http] started HTTP/WS listener 0.0.0.0:9191 -[ballerina/websub] Default Ballerina WebSub Hub started up at http://localhost:9191/websub/hub [ballerina/http] started HTTP/WS listener 0.0.0.0:9090 -2018-08-08 10:56:50,220 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/ordereventsubscriber] -2018-08-08 10:57:00,921 INFO [] - New Order Added: 1001 +2019-11-01 14:15:05,814 INFO [ballerina/websub] - Subscription request received for topic[http://localhost:9090/ordermgt/ordertopic] with callback[http://localhost:8181/ordereventsubscriber] +2019-11-01 14:15:05,858 INFO [ballerina/websub] - Sending intent verification request to callback[http://localhost:8181/ordereventsubscriber] for topic[http://localhost:9090/ordermgt/ordertopic] +2019-11-01 14:15:06,037 INFO [ballerina/websub] - Intent verification successful for mode: [subscribe], for callback URL: [http://localhost:8181/ordereventsubscriber] +2019-11-01 14:15:58,756 INFO [] - New Order Added: 1001 diff --git a/examples/websub-service-integration-sample/subscriber.out b/examples/websub-service-integration-sample/subscriber.out index a265c7abf2c7..ce99477a435b 100644 --- a/examples/websub-service-integration-sample/subscriber.out +++ b/examples/websub-service-integration-sample/subscriber.out @@ -2,6 +2,6 @@ # `.bal` file, and use the `ballerina run` command. $ ballerina run subscriber.bal [ballerina/http] started HTTP/WS listener 0.0.0.0:8181 -2018-08-08 10:56:50,048 INFO [ballerina/websub] - Subscription Request successful at Hub[http://localhost:9191/websub/hub], for Topic[http://localhost:9090/ordermgt/ordertopic], with Callback [http://localhost:8181/ordereventsubscriber] +2019-11-01 14:15:05,823 INFO [ballerina/websub] - Subscription Request successfully sent to Hub[http://localhost:9191/websub/hub], for Topic[http://localhost:9090/ordermgt/ordertopic], with Callback [http://localhost:8181/ordereventsubscriber] ballerina: Intent Verification agreed - Mode [subscribe], Topic [http://localhost:9090/ordermgt/ordertopic], Lease Seconds [3600] -2018-08-08 10:57:00,991 INFO [] - WebSub Notification Received: New Order Added: 1001 +2019-11-01 14:15:58,892 INFO [] - WebSub Notification Received: New Order Added: 1001 diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index 1dc6c2feac88..02b3ae37952d 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -548,7 +548,7 @@ public type Hub object { # # + return - `boolean` indicating whether the internal Ballerina Hub was stopped public function stop() returns error? { - var stopResult = self.hubHttpListener.__immediateStop(); + var stopResult = self.hubHttpListener.__gracefulStop(); var stopHubServiceResult = stopHubService(self); if (stopResult is () && stopHubServiceResult is ()) { diff --git a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal index 2f7b6a46e2b4..55a1d5500d87 100644 --- a/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal +++ b/stdlib/websub/src/test/resources/test-src/hub/test_hub_startup.bal @@ -46,12 +46,12 @@ function testHubStartUp() returns boolean { if (err is error) { return false; } - err = lis0.__immediateStop(); - err = lis1.__immediateStop(); + err = lis0.__gracefulStop(); + err = lis1.__gracefulStop(); http:Listener lis2 = new (9393); res2 = websub:startHub(lis2); - err = lis2.__immediateStop(); + err = lis2.__gracefulStop(); if res2 is websub:Hub { boolean b = res2.publishUrl == "http://localhost:9393/publish" && res2.subscriptionUrl == "http://localhost:9393/"; @@ -66,7 +66,7 @@ function testPublisherAndSubscriptionInvalidSameResourcePath() returns boolean { websub:Hub|websub:HubStartedUpError|websub:HubStartupError res = websub:startHub(lis, "/websub", "/hub", "/hub"); - var err = lis.__immediateStop(); + var err = lis.__gracefulStop(); if (res is websub:HubStartupError) { return res.reason() == "{ballerina/websub}HubStartupError" && diff --git a/stdlib/websub/src/test/resources/test-src/specific_subscriber/test_specific_subscriber.bal b/stdlib/websub/src/test/resources/test-src/specific_subscriber/test_specific_subscriber.bal index cbdd33f0c509..f0d2960c2037 100644 --- a/stdlib/websub/src/test/resources/test-src/specific_subscriber/test_specific_subscriber.bal +++ b/stdlib/websub/src/test/resources/test-src/specific_subscriber/test_specific_subscriber.bal @@ -66,7 +66,7 @@ public type WebhookServerForPayload object { } public function __gracefulStop() returns error? { - return (); + return self.websubListener.__gracefulStop(); } public function __immediateStop() returns error? { From 3436d8dfa5fae1c01a151fa7926958472377de06 Mon Sep 17 00:00:00 2001 From: Pubudu Fernando Date: Fri, 1 Nov 2019 14:03:08 +0530 Subject: [PATCH 166/167] Fix unknown type issues in websub --- stdlib/websub/src/main/ballerina/src/websub/commons.bal | 6 +++--- .../src/main/ballerina/src/websub/hub_configuration.bal | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/stdlib/websub/src/main/ballerina/src/websub/commons.bal b/stdlib/websub/src/main/ballerina/src/websub/commons.bal index aac8cfe00307..04dd9e4330db 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/commons.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/commons.bal @@ -481,9 +481,9 @@ public function startHub(http:Listener hubServiceListener, public string basePath = "/", public string subscriptionResourcePath = "/", public string publishResourcePath = "/publish", - public http:ServiceResourceAuth serviceAuth = {enabled:false}, - public http:ServiceResourceAuth subscriptionResourceAuth = {enabled:false}, - public http:ServiceResourceAuth publisherResourceAuth = {enabled:false}, + public http:ServiceAuth serviceAuth = {enabled:false}, + public http:ResourceAuth subscriptionResourceAuth = {enabled:false}, + public http:ResourceAuth publisherResourceAuth = {enabled:false}, public string? publicUrl = (), public HubConfiguration hubConfiguration = {}) returns Hub|HubStartedUpError|HubStartupError { diff --git a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal index ea917ac3b08e..13a3123f9728 100644 --- a/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal +++ b/stdlib/websub/src/main/ballerina/src/websub/hub_configuration.bal @@ -26,9 +26,9 @@ string hubBasePath = "/"; string hubSubscriptionResourcePath = "/"; string hubPublishResourcePath = "/publish"; -http:ServiceResourceAuth hubServiceAuth = {enabled: false}; -http:ServiceResourceAuth hubSubscriptionResourceAuth = {enabled: false}; -http:ServiceResourceAuth hubPublisherResourceAuth = {enabled: false}; +http:ServiceAuth hubServiceAuth = {enabled: false}; +http:ResourceAuth hubSubscriptionResourceAuth = {enabled: false}; +http:ResourceAuth hubPublisherResourceAuth = {enabled: false}; int hubLeaseSeconds = DEFAULT_LEASE_SECONDS_VALUE; string hubSignatureMethod = DEFAULT_SIGNATURE_METHOD; From 0f1b50ceaedba91077e483741c6b33d3ad73c062 Mon Sep 17 00:00:00 2001 From: nadeeshaan Date: Wed, 6 Nov 2019 08:12:15 +0530 Subject: [PATCH 167/167] Fix failing tests --- .../delimiterBasedCompletionForCompleteSource1.json | 11 +++++++++++ .../function/ifWhileConditionContextCompletion4.json | 11 +++++++++++ .../function/matchStatementSuggestions4.json | 11 +++++++++++ .../function/workerDeclarationContext4.json | 11 +++++++++++ .../resources/completion/object/objectTest13.json | 11 +++++++++++ .../completion/packageimport/packageImport1.json | 11 +++++++++++ 6 files changed, 66 insertions(+) diff --git a/language-server/modules/langserver-core/src/test/resources/completion/function/delimiterBasedCompletionForCompleteSource1.json b/language-server/modules/langserver-core/src/test/resources/completion/function/delimiterBasedCompletionForCompleteSource1.json index 0255cb9efb9e..a3b42a6c0532 100644 --- a/language-server/modules/langserver-core/src/test/resources/completion/function/delimiterBasedCompletionForCompleteSource1.json +++ b/language-server/modules/langserver-core/src/test/resources/completion/function/delimiterBasedCompletionForCompleteSource1.json @@ -3544,6 +3544,17 @@ "insertText": "WebSocketClientConfiguration", "insertTextFormat": "Snippet" }, + { + "label": "WebSocketRetryConfig", + "kind": "Struct", + "detail": "Record", + "documentation": { + "left": "Configurations for reconnecting to the WebSocket.\n" + }, + "sortText": "180", + "insertText": "WebSocketRetryConfig", + "insertTextFormat": "Snippet" + }, { "label": "WsConnectionClosureError", "kind": "Event", diff --git a/language-server/modules/langserver-core/src/test/resources/completion/function/ifWhileConditionContextCompletion4.json b/language-server/modules/langserver-core/src/test/resources/completion/function/ifWhileConditionContextCompletion4.json index 3bc80ff8577f..c6ce17f17e40 100644 --- a/language-server/modules/langserver-core/src/test/resources/completion/function/ifWhileConditionContextCompletion4.json +++ b/language-server/modules/langserver-core/src/test/resources/completion/function/ifWhileConditionContextCompletion4.json @@ -1065,6 +1065,17 @@ "insertText": "WebSocketClientConfiguration", "insertTextFormat": "Snippet" }, + { + "label": "WebSocketRetryConfig", + "kind": "Struct", + "detail": "Record", + "documentation": { + "left": "Configurations for reconnecting to the WebSocket.\n" + }, + "sortText": "180", + "insertText": "WebSocketRetryConfig", + "insertTextFormat": "Snippet" + }, { "label": "WebSocketConnector", "kind": "Interface", diff --git a/language-server/modules/langserver-core/src/test/resources/completion/function/matchStatementSuggestions4.json b/language-server/modules/langserver-core/src/test/resources/completion/function/matchStatementSuggestions4.json index 0d000f71ac8d..6cc4d1c208e5 100644 --- a/language-server/modules/langserver-core/src/test/resources/completion/function/matchStatementSuggestions4.json +++ b/language-server/modules/langserver-core/src/test/resources/completion/function/matchStatementSuggestions4.json @@ -3544,6 +3544,17 @@ "insertText": "WebSocketClientConfiguration", "insertTextFormat": "Snippet" }, + { + "label": "WebSocketRetryConfig", + "kind": "Struct", + "detail": "Record", + "documentation": { + "left": "Configurations for reconnecting to the WebSocket.\n" + }, + "sortText": "180", + "insertText": "WebSocketRetryConfig", + "insertTextFormat": "Snippet" + }, { "label": "WsConnectionClosureError", "kind": "Event", diff --git a/language-server/modules/langserver-core/src/test/resources/completion/function/workerDeclarationContext4.json b/language-server/modules/langserver-core/src/test/resources/completion/function/workerDeclarationContext4.json index d053db8605ff..213934ed9f97 100644 --- a/language-server/modules/langserver-core/src/test/resources/completion/function/workerDeclarationContext4.json +++ b/language-server/modules/langserver-core/src/test/resources/completion/function/workerDeclarationContext4.json @@ -1065,6 +1065,17 @@ "insertText": "WebSocketClientConfiguration", "insertTextFormat": "Snippet" }, + { + "label": "WebSocketRetryConfig", + "kind": "Struct", + "detail": "Record", + "documentation": { + "left": "Configurations for reconnecting to the WebSocket.\n" + }, + "sortText": "180", + "insertText": "WebSocketRetryConfig", + "insertTextFormat": "Snippet" + }, { "label": "WebSocketConnector", "kind": "Interface", diff --git a/language-server/modules/langserver-core/src/test/resources/completion/object/objectTest13.json b/language-server/modules/langserver-core/src/test/resources/completion/object/objectTest13.json index f7ea33385fce..15f4c014a693 100644 --- a/language-server/modules/langserver-core/src/test/resources/completion/object/objectTest13.json +++ b/language-server/modules/langserver-core/src/test/resources/completion/object/objectTest13.json @@ -1065,6 +1065,17 @@ "insertText": "WebSocketClientConfiguration", "insertTextFormat": "Snippet" }, + { + "label": "WebSocketRetryConfig", + "kind": "Struct", + "detail": "Record", + "documentation": { + "left": "Configurations for reconnecting to the WebSocket.\n" + }, + "sortText": "221", + "insertText": "WebSocketRetryConfig", + "insertTextFormat": "Snippet" + }, { "label": "WebSocketConnector", "kind": "Interface", diff --git a/language-server/modules/langserver-core/src/test/resources/completion/packageimport/packageImport1.json b/language-server/modules/langserver-core/src/test/resources/completion/packageimport/packageImport1.json index 7a806e1fc9d0..5196ac4cdbdc 100644 --- a/language-server/modules/langserver-core/src/test/resources/completion/packageimport/packageImport1.json +++ b/language-server/modules/langserver-core/src/test/resources/completion/packageimport/packageImport1.json @@ -3544,6 +3544,17 @@ "insertText": "WebSocketClientConfiguration", "insertTextFormat": "Snippet" }, + { + "label": "WebSocketRetryConfig", + "kind": "Struct", + "detail": "Record", + "documentation": { + "left": "Configurations for reconnecting to the WebSocket.\n" + }, + "sortText": "180", + "insertText": "WebSocketRetryConfig", + "insertTextFormat": "Snippet" + }, { "label": "WsConnectionClosureError", "kind": "Event",