Permalink
Browse files

[Cursor] Rewrite in Perl 6, bring under bootstrap control

git-svn-id: http://svn.pugscode.org/pugs@31098 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 17a49a4 commit 27777d6d626ef336d5839346319c04bf0377a423 sorear committed Jun 4, 2010
Showing with 58 additions and 28 deletions.
  1. +9 −9 Cursor.pm6
  2. +0 −13 Cursor.pmc
  3. +9 −0 CursorBase.pm6
  4. +12 −6 Makefile
  5. +28 −0 boot/Cursor.pmc
View
@@ -1,9 +1,9 @@
-# fake Cursor file to get symbols into p6 symbol tables
-class Cursor;
-our $BLUE;
-our $GREEN;
-our $CYAN;
-our $MAGENTA;
-our $YELLOW;
-our $RED;
-our $CLEAR;
+use CursorBase;
+class Cursor is CursorBase;
+our $BLUE = $CursorBase::BLUE;
+our $GREEN = $CursorBase::GREEN;
+our $CYAN = $CursorBase::CYAN;
+our $MAGENTA = $CursorBase::MAGENTA;
+our $YELLOW = $CursorBase::YELLOW;
+our $RED = $CursorBase::RED;
+our $CLEAR = $CursorBase::CLEAR;
View
@@ -1,13 +0,0 @@
-package Cursor;
-use Moose ':all' => { -prefix => "moose_" };
-moose_extends('CursorBase');
-
-our $BLUE = $CursorBase::BLUE;
-our $GREEN = $CursorBase::GREEN;
-our $CYAN = $CursorBase::CYAN;
-our $MAGENTA = $CursorBase::MAGENTA;
-our $YELLOW = $CursorBase::YELLOW;
-our $RED = $CursorBase::RED;
-our $CLEAR = $CursorBase::CLEAR;
-
-1;
View
@@ -0,0 +1,9 @@
+# Just a stub to fake out viv/STD.pm6
+class CursorBase;
+our $RED;
+our $GREEN;
+our $BLUE;
+our $CYAN;
+our $MAGENTA;
+our $YELLOW;
+our $CLEAR;
View
@@ -29,15 +29,19 @@ boot/syml/CORE.syml: CORE.setting
# .store files depend little on viv; ideally it should be factored into two
# programs; this rule is missing a few dependencies!
# boot/STD.pm because boot/STD.pmc doesn't take precedence over ./STD.pm
-STD.store: STD.pm6 boot/STD.pm Actions.pm boot/syml/CORE.syml
+STD.store: STD.pm6 boot/STD.pm boot/Cursor.pmc Actions.pm boot/syml/CORE.syml
STD5PREFIX=boot/ PERL5LIB=boot perl viv -o STD.store --freeze STD.pm6
STD.pmc: STD.store viv
perl -Iboot viv --no-indent -5 -o STD.pmc --thaw STD.store
rm -rf lex syml/*.pad.store
+Cursor.store: Cursor.pm6 boot/STD.pm boot/Cursor.pmc Actions.pm boot/syml/CORE.syml
+ STD5PREFIX=boot/ PERL5LIB=boot perl viv -o Cursor.store --freeze Cursor.pm6
+Cursor.pmc: Cursor.store viv
+ perl -Iboot viv --no-indent -5 -o Cursor.pmc --thaw Cursor.store
# for debugging
STD.pm5: STD.store viv
perl -Iboot viv -5 -o STD.pm5 --thaw STD.store
-STD_P5.store: STD_P5.pm6 boot/STD.pm Actions.pm boot/syml/CORE.syml
+STD_P5.store: STD_P5.pm6 boot/STD.pm boot/Cursor.pmc Actions.pm boot/syml/CORE.syml
STD5PREFIX=boot/ PERL5LIB=boot perl viv -o STD_P5.store --freeze STD_P5.pm6
STD_P5.pmc: STD_P5.store viv
perl -Iboot viv --no-indent -5 -o STD_P5.pmc --thaw STD_P5.store
@@ -47,23 +51,25 @@ syml/CORE.syml: CORE.setting
-rm -f syml/CORE.syml.store
-./std CORE.setting
-check: STD.pmc STD_P5.pmc
+check: STD.pmc STD_P5.pmc Cursor.pmc
/usr/local/bin/perl -c STD.pmc
+ /usr/local/bin/perl -c Cursor.pmc
/usr/local/bin/perl -c STD_P5.pmc
-reboot: STD.pmc
+reboot: STD.pmc Cursor.pmc
cp STD.pmc boot/STD.pm
+ cp Cursor.pmc boot/Cursor.pmc
# pre-generate common sublexers
-lex/STD/termish: STD.pmc STD_P5.pmc syml/CORE.syml
+lex/STD/termish: Cursor.pmc STD.pmc STD_P5.pmc syml/CORE.syml
@echo 'Generating STD lexers...'
./tryfile STD.pm6
cat:
cat try5.out
clean:
- rm -rf lex try5.* *.pad.store syml boot/lex boot/syml STD.pmc STD_P5.pmc STD.store STD_P5.store
+ rm -rf lex try5.* *.pad.store syml boot/lex boot/syml STD.pmc STD_P5.pmc STD.store STD_P5.store Cursor.store Cursor.pmc STD.pm5
# purge is an alias for distclean
distclean purge: clean
View
@@ -0,0 +1,28 @@
+use 5.010;
+use utf8;
+use CursorBase;
+{ package Cursor;
+use Moose ':all' => { -prefix => "moose_" };
+use Cursor; # for DEBUG::, etc
+moose_extends('CursorBase');
+
+no warnings 'qw', 'recursion';
+my $retree;
+
+$DB::deep = $DB::deep = 1000; # suppress used-once warning
+
+use YAML::XS;
+
+$SIG{__WARN__} = sub { die @_," statement started at line ", 'STD'->lineof($::LASTSTATE), "
+" } if $::DEBUG;
+
+;
+our $BLUE = $CursorBase::BLUE;
+our $GREEN = $CursorBase::GREEN;
+our $CYAN = $CursorBase::CYAN;
+our $MAGENTA = $CursorBase::MAGENTA;
+our $YELLOW = $CursorBase::YELLOW;
+our $RED = $CursorBase::RED;
+our $CLEAR = $CursorBase::CLEAR;
+ 1; };
+

0 comments on commit 27777d6

Please sign in to comment.