Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2946 from vrurg/problem-solving-3
Make subsets validate against their constraints same way as definites do. See Raku/problem-solving#3 for details.
- Loading branch information
Showing
6 changed files
with
82 additions
and
15 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
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,20 @@ | ||
# This role is for metaclasses with languare-revision dependent behavior. | ||
role Perl6::Metamodel::LanguageRevision | ||
does Perl6::Metamodel::Versioning | ||
{ | ||
has $!lang_rev; | ||
|
||
# The only allowed version format is 6.X | ||
method set_language_version($obj, $ver) { | ||
(nqp::iseq_i(nqp::chars($ver), 3) && nqp::eqat($ver, '6.', 0)) | ||
|| nqp::die("Language version must be a string in '6.<rev>' format, got `$ver`."); | ||
self.set_ver($obj, $ver); | ||
$!lang_rev := nqp::substr($ver, 2, 1); | ||
} | ||
|
||
method lang-rev-before($rev) { | ||
nqp::iseq_i(nqp::chars($rev), 1) | ||
|| nqp::die("Language revision must be a single letter, got `$rev`."); | ||
nqp::iseq_i(nqp::cmp_s($!lang_rev, $rev), -1) | ||
} | ||
} |
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