Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We still don't have the NIL parser, but subclassing technology works. An installable STD would help a lot.
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
Kernel.exe | ||
Program.cs | ||
*.swp | ||
*.pmc |
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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
STDBASE=/usr/local/src/pugs/src/perl6 | ||
STDENV=PERL5LIB=$(STDBASE) PERL6LIB=$(STDBASE):$(STDBASE)/lib \ | ||
STD5PREFIX=$(STDBASE)/ | ||
|
||
all: | ||
perl Compiler.pm > Program.cs | ||
gmcs /target:exe Kernel.cs Program.cs | ||
|
||
Niecza/Grammar.pmc: Niecza/Grammar.pm6 | ||
$(STDENV) $(STDBASE)/viv -5 -o Niecza/Grammar.pmc Niecza/Grammar.pm6 |
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,30 @@ | ||
use STD; | ||
|
||
class Niecza; | ||
grammar Grammar is STD { # viv doesn't handle :: in definitions well atm | ||
|
||
method p6class () { ::Niecza::Grammar::P6 } | ||
|
||
grammar P6 is STD::P6 { | ||
method unitstart() { | ||
%*LANG<Q> = ::Niecza::Grammar::Q ; | ||
%*LANG<MAIN> = ::Niecza::Grammar::P6 ; | ||
self; | ||
} | ||
|
||
token statement_prefix:sym<PRE-INIT> | ||
{ :my %*MYSTERY; <sym> <.spacey> <blast> <.explain_mystery> } | ||
token statement_control:sym<PRELUDE> | ||
{ <sym> <.spacey> <quibble($¢.cursor_fresh( %*LANG<Q> ).tweak(:NIL))> } | ||
} | ||
|
||
grammar Q is STD::Q { | ||
#} | ||
|
||
multi method tweak(:$NIL!) { self.cursor_fresh( ::Niecza::Grammar::NIL ) } | ||
} | ||
|
||
grammar NIL is STD { | ||
} | ||
|
||
} |