Skip to content
Browse files

Fix "\r\n".perl

  • Loading branch information...
1 parent b2c1062 commit 566fb13d298341ba9fea17520ddaef46ed8e195f @sorear committed Jan 23, 2012
Showing with 12 additions and 87 deletions.
  1. +1 −1 lib/CORE.setting
  2. +11 −86 main.pl
View
2 lib/CORE.setting
@@ -901,7 +901,7 @@ my class Str is Cool {
'\\' => '\\\\' };
method perl() {
self // nextsame;
- '"' ~ self.subst(/ <[$@%&{\b\n\r\t\"\\]> /, { $esc{$/} }, :g)\
+ '"' ~ self.subst(/ <[$@%&{\b\cJ\cM\t\"\\]> /, { $esc{$/} }, :g)\
.subst(/ <-print> /, { ord($/).fmt('\x[%x]') }, :g) ~ '"'
}
}
View
97 main.pl
@@ -8,7 +8,8 @@
# * Allow exact Perl 6 forms, quoted away from shell
# * Fix remaining XXXX
-# TODO (sorear): add True, False to val(); (eval) becomes -e
+# TODO (sorear): add True, False to val(); (eval) becomes -e; change param
+# names to be name-of-var or ""; Str.perl escaping
use MONKEY_TYPING;
augment class Code {
@@ -73,95 +74,19 @@
method named_names() { !!! }
method type() { !!! }
method optional() { !!! }
+ method positional() { !!! }
method value_constraint_list() { !!! }
method name() { !!! }
method slurpy() { !!! }
- method name() {
- $!variable_name
- }
-
- method constraint_list() {
- pir::isnull($!post_constraints) ?? () !!
- pir::perl6ize_type__PP($!post_constraints)
- }
-
- method constraints() {
- all(pir::isnull($!post_constraints) ?? () !!
- pir::perl6ize_type__PP($!post_constraints))
- }
-
- method type() {
- $!nominal_type
- }
-
- method named() {
- !nqp::p6bool(nqp::isnull($!named_names)) ||
- nqp::p6bool($!flags +& $SIG_ELEM_SLURPY_NAMED)
- }
-
- method named_names() {
- if !pir::isnull($!named_names) {
- my Int $count = nqp::p6box_i(nqp::elems($!named_names));
- my Int $i = 0;
- my @res;
- while $i < $count {
- @res.push: nqp::p6box_s(nqp::atpos($!named_names, nqp::unbox_i($i)));
- $i++;
- }
- @res;
- } else {
- ().list
- }
- }
-
- method positional() {
- nqp::p6bool(
- ($!flags +& ($SIG_ELEM_SLURPY_POS +| $SIG_ELEM_SLURPY_NAMED)) == 0 &&
- nqp::isnull($!named_names)
- )
- }
-
- method slurpy() {
- nqp::p6bool(
- $!flags +& ($SIG_ELEM_SLURPY_POS
- +| $SIG_ELEM_SLURPY_NAMED
- +| $SIG_ELEM_SLURPY_BLOCK)
- )
- }
-
- method optional() {
- ?($!flags +& $SIG_ELEM_IS_OPTIONAL)
- }
-
- method parcel() {
- ?($!flags +& $SIG_ELEM_IS_PARCEL)
- }
-
- method capture() {
- ?($!flags +& $SIG_ELEM_IS_CAPTURE)
- }
-
- method rw() {
- ?($!flags +& $SIG_ELEM_IS_RW)
- }
-
- method copy() {
- ?($!flags +& $SIG_ELEM_IS_COPY)
- }
-
- method readonly() {
- !($.rw || $.copy || $.parcel)
- }
-
- method invocant() {
- ?($!flags +& $SIG_ELEM_INVOCANT)
- }
-
- method default() {
- nqp::isnull($!default_value) ?? Any !!
- $!default_value ~~ Code ?? $!default_value !! { $!default_value }
- }
+ # no constraint_list! niecza's SubInfo constraints don't reflect well :|
+ method parcel() { !!! }
+ method capture() { !!! }
+ method rw() { !!! }
+ method copy() { !!! }
+ method readonly() { !!! }
+ method invocant() { !!! }
+ method default() { !!! }
# XXX TODO: A few more bits :-)
multi method perl(Parameter:D:) {

0 comments on commit 566fb13

Please sign in to comment.
Something went wrong with that request. Please try again.