Skip to content

Commit

Permalink
rearrange the main file a little bit to do what it should
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Oct 21, 2009
1 parent 73c3d83 commit 9821908
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions matrixy.pir
Expand Up @@ -27,7 +27,7 @@ object.

.namespace [ 'Matrixy';'Compiler' ]

.sub 'onload' :anon :load :init
.sub '__onload' :anon :load :init
load_bytecode 'PCT.pbc'

$P0 = get_hll_global ['PCT'], 'HLLCompiler'
Expand All @@ -40,30 +40,11 @@ object.

$P1.'commandline_prompt'("\nmatrixy:1> ")
$P1.'commandline_banner'("Matrixy, version 0.1.\nCopyright (C) 2009 Blair Sutton and Andrew Whitworth.\n\n")
.end
=item main(args :slurpy) :main
Start compilation by passing any command line C<args>
to the Matrixy compiler.
=cut
.sub 'main' :main
.param pmc args
$P0 = compreg 'matrixy'
$P1 = $P0.'command_line'(args)
'__initglobals'()
.end
.include 'src/gen_internals.pir'
.include 'src/gen_builtins.pir'
.include 'src/gen_grammar.pir'
.include 'src/gen_actions.pir'
.namespace []
.sub 'initglobals' :anon :load :init
.sub '__initglobals'
$P0 = new 'ResizablePMCArray'
set_hll_global ['Matrixy';'Grammar';'Actions'], '@?BLOCK', $P0
$P0 = new 'Undef'
Expand All @@ -83,12 +64,31 @@ to the Matrixy compiler.
$P0 = new 'ResizablePMCArray'
set_hll_global['Matrixy';'Grammar';'Actions'], '@?PARAMS', $P0
.end
=item main(args :slurpy) :main
Start compilation by passing any command line C<args>
to the Matrixy compiler.
=cut
.sub 'main' :main
.param pmc args
# load start up file
$P0 = null
'!dispatch'('matrixyrc', $P0, 1, 1, 1)
$P0 = compreg 'matrixy'
$P1 = $P0.'command_line'(args)
.end
.include 'src/gen_internals.pir'
.include 'src/gen_builtins.pir'
.include 'src/gen_grammar.pir'
.include 'src/gen_actions.pir'
.namespace []
.sub '!hash'
Expand Down

0 comments on commit 9821908

Please sign in to comment.