[ClavaLaraApi] Adds ClavaJoinPoints.declLiteral()
@@ -224,7 +224,6 @@ class ClavaJoinPoints {
static scope() {
const $stmts = arrayFromArgs(arguments);
-
if ($stmts.length === 0) {
return AstFactory.scope();
}
@@ -235,13 +234,14 @@ class ClavaJoinPoints {
const $normalizedStmt = $stmt.stmt;
if ($normalizedStmt === undefined) {
- throw new Error(`Could not convert ${$stmt} to a statement, and a scope only accepts statements`);
+ throw new Error(
+ `Could not convert ${$stmt} to a statement, and a scope only accepts statements`
+ );
}
$normalizedStmts.push($normalizedStmt);
}
-
return AstFactory.scope($normalizedStmts);
}
@@ -655,4 +655,13 @@ class ClavaJoinPoints {
checkJoinPointType(labelDecl, "labelDecl");
return AstFactory.gotoStmt(labelDecl);
}
+
+ /**
+ * Creates a new literal join point 'decl'.
+ *
+ * @param {string} declString The literal code of the decl.
+ */
+ static declLiteral(declString) {
+ return AstFactory.declLiteral(declString);
+ }
}
