(ctx: PragmaDirectiveContext)
| 117 | } |
| 118 | |
| 119 | processPragma(ctx: PragmaDirectiveContext): void { |
| 120 | const pragmaName = getPragmaName(ctx.pragmaName().getText()); |
| 121 | if (pragmaName !== PragmaName.CASHSCRIPT) throw new Error(); // Shouldn't happen |
| 122 | |
| 123 | // Strip any -beta tags |
| 124 | const actualVersion = version.replace(/-.*/g, ''); |
| 125 | |
| 126 | ctx.pragmaValue().versionConstraint_list().forEach((constraint) => { |
| 127 | const op = getVersionOpFromCtx(constraint.versionOperator()); |
| 128 | const versionConstraint = `${op}${constraint.VersionLiteral().getText()}`; |
| 129 | if (!semver.satisfies(actualVersion, versionConstraint)) { |
| 130 | throw new VersionError(actualVersion, versionConstraint); |
| 131 | } |
| 132 | }); |
| 133 | } |
| 134 | |
| 135 | visitContractDefinition(ctx: ContractDefinitionContext): ContractNode { |
| 136 | const name = ctx.Identifier().getText(); |
no test coverage detected