Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
2,601 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Port from './Port'; | ||
import { extractExpression, extractType } from '../parser/WDL/utils/utils'; | ||
|
||
/** | ||
* Class representing binding points of workflow steps. | ||
*/ | ||
export default class Declaration extends Port { | ||
/** | ||
* Create a Declaration. | ||
* | ||
* @param {string} name - Declaration name | ||
* @param {ast} declaration - Declaration ast tree node | ||
* @param {Step} step - Parent step this Declaration belongs to. | ||
*/ | ||
constructor(name, declaration, step) { | ||
if (!name) { | ||
throw new Error('Declaration must have a name'); | ||
} | ||
if (!declaration.expression || !declaration.type) { | ||
throw new Error('Declaration could be created only using declaration object'); | ||
} | ||
super(name, step, {}); | ||
|
||
delete this.desc; | ||
|
||
/** | ||
* Declaration expression extracted object. | ||
* @type {string} | ||
*/ | ||
this.expression = extractExpression(declaration.expression); | ||
/** | ||
* Declaration type. | ||
* @type {string} | ||
*/ | ||
this.type = extractType(declaration.type); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.