use of org.wso2.siddhi.query.api.expression.constant.Constant in project ballerina by ballerina-lang.
the class CodeGenerator method createTransformerInfoEntry.
private void createTransformerInfoEntry(BLangInvokableNode invokable) {
BInvokableSymbol transformerSymbol = invokable.symbol;
BInvokableType transformerType = (BInvokableType) transformerSymbol.type;
// Add transformer name as an UTFCPEntry to the constant pool
int transformerNameCPIndex = this.addUTF8CPEntry(currentPkgInfo, transformerSymbol.name.value);
TransformerInfo transformerInfo = new TransformerInfo(currentPackageRefCPIndex, transformerNameCPIndex);
transformerInfo.paramTypes = transformerType.paramTypes.toArray(new BType[0]);
transformerInfo.retParamTypes = transformerType.retTypes.toArray(new BType[0]);
transformerInfo.flags = transformerSymbol.flags;
this.addWorkerInfoEntries(transformerInfo, invokable.getWorkers());
// Add parameter default value info
addParameterDefaultValues(invokable, transformerInfo);
transformerInfo.signatureCPIndex = addUTF8CPEntry(this.currentPkgInfo, generateFunctionSig(transformerInfo.paramTypes, transformerInfo.retParamTypes));
this.currentPkgInfo.transformerInfoMap.put(transformerSymbol.name.value, transformerInfo);
}
use of org.wso2.siddhi.query.api.expression.constant.Constant in project ballerina by ballerina-lang.
the class DocumentationTest method testNestedInlineDeprecated.
@Test(description = "Test doc nested inline inside deprecated tag.")
public void testNestedInlineDeprecated() {
CompileResult compileResult = BCompileUtil.compile("test-src/documentation/nested_inline_deprecated.bal");
Assert.assertEquals(0, compileResult.getWarnCount());
PackageNode packageNode = compileResult.getAST();
BLangVariable constant = (BLangVariable) packageNode.getGlobalVariables().get(0);
List<BLangDeprecatedNode> docNodes = constant.deprecatedAttachments;
BLangDeprecatedNode dNode = docNodes.get(0);
Assert.assertNotNull(dNode);
Assert.assertEquals(dNode.documentationText, "\n" + " Example of a string templates:\n" + " ``` This starts ends triple backtick ``string s = string `hello {{name}}`;`` " + "ends triple backtick```\n" + "\n" + " Example for an xml literal:\n" + " ``xml x = xml `<{{tagName}}>hello</{{tagName}}>`;``\n");
}
Aggregations