Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
some beautification
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Mar 28, 2009
1 parent e4af77a commit 669e593
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
48 changes: 24 additions & 24 deletions src/Compiler.pir
Expand Up @@ -13,14 +13,14 @@ Markdown::HTML::Compiler implements a compiler for MAST nodes.

=cut

.namespace [ 'Markdown';'HTML';'Compiler' ]
.namespace ['Markdown'; 'HTML'; 'Compiler']

.sub '__onload' :anon :load :init
$P0 = get_hll_global 'P6metaclass'
$P0 = $P0.'new_class'('Markdown::HTML::Compiler')

$P0 = new 'Hash'
set_hll_global [ 'Markdown';'HTML';'Compiler' ], '%ref', $P0
set_hll_global ['Markdown'; 'HTML'; 'Compiler'], '%ref', $P0
.end

.sub 'to_html' :method
Expand Down Expand Up @@ -104,7 +104,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,_)
.sub 'html' :method :multi(_, _)
.param pmc node
.tailcall self.'html_children'(node)
.end
Expand All @@ -114,7 +114,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Document'])
.sub 'html' :method :multi(_, ['Markdown'; 'Document'])
.param pmc node
.tailcall self.'html_children'(node)
.end
Expand All @@ -124,7 +124,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'HorizontalRule'])
.sub 'html' :method :multi(_, ['Markdown'; 'HorizontalRule'])
.param pmc node
.local pmc code
new code, 'CodeString'
Expand All @@ -137,7 +137,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Title'])
.sub 'html' :method :multi(_, ['Markdown'; 'Title'])
.param pmc node
$S1 = self.'html_children'(node)
$S2 = node.'level'()
Expand All @@ -159,7 +159,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Para'])
.sub 'html' :method :multi(_, ['Markdown'; 'Para'])
.param pmc node
$S1 = self.'html_children'(node)
$S0 = "<p>"
Expand All @@ -175,7 +175,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'CodeBlock'])
.sub 'html' :method :multi(_, ['Markdown'; 'CodeBlock'])
.param pmc node
$S1 = self.'html_children'(node)
$S1 = escape_code($S1)
Expand All @@ -192,7 +192,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'BlockQuote'])
.sub 'html' :method :multi(_, ['Markdown'; 'BlockQuote'])
.param pmc node
$S0 = "<blockquote>\n"
$S0 .= " "
Expand Down Expand Up @@ -220,7 +220,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'ItemizedList'])
.sub 'html' :method :multi(_, ['Markdown'; 'ItemizedList'])
.param pmc node
$S1 = self.'html_children'(node)
$S0 = "<ul>\n"
Expand All @@ -236,7 +236,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'OrderedList'])
.sub 'html' :method :multi(_, ['Markdown'; 'OrderedList'])
.param pmc node
$S1 = self.'html_children'(node)
$S0 = "<ol>\n"
Expand All @@ -252,7 +252,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'ListItem'])
.sub 'html' :method :multi(_, ['Markdown'; 'ListItem'])
.param pmc node
$S1 = self.'html_children'(node)
$S0 = "<li>"
Expand All @@ -268,7 +268,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Link'])
.sub 'html' :method :multi(_, ['Markdown'; 'Link'])
.param pmc node
.local string url, title, content, image
url = node.'url'()
Expand Down Expand Up @@ -325,11 +325,11 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'RefLink'])
.sub 'html' :method :multi(_, ['Markdown'; 'RefLink'])
.param pmc node
.local string key
key = node.'key'()
$P0 = get_hll_global [ 'Markdown';'HTML';'Compiler' ], '%ref'
$P0 = get_hll_global ['Markdown'; 'HTML'; 'Compiler'], '%ref'
$S0 = downcase key
$P1 = $P0[$S0]
if null $P1 goto L1
Expand Down Expand Up @@ -365,7 +365,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Reference'])
.sub 'html' :method :multi(_, ['Markdown'; 'Reference'])
.param pmc node
.local pmc code
new code, 'CodeString'
Expand All @@ -377,7 +377,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Email'])
.sub 'html' :method :multi(_, ['Markdown'; 'Email'])
.param pmc node
$S0 = "<a href=\""
$S1 = node.'text'()
Expand All @@ -400,7 +400,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Emphasis'])
.sub 'html' :method :multi(_, ['Markdown'; 'Emphasis'])
.param pmc node
$S1 = self.'html_children'(node)
$S0 = "<em>"
Expand All @@ -416,7 +416,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Strong'])
.sub 'html' :method :multi(_, ['Markdown'; 'Strong'])
.param pmc node
$S1 = self.'html_children'(node)
$S0 = "<strong>"
Expand All @@ -432,7 +432,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Code'])
.sub 'html' :method :multi(_, ['Markdown'; 'Code'])
.param pmc node
$S1 = node.'text'()
$S1 = escape_xml($S1)
Expand All @@ -450,7 +450,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Entity'])
.sub 'html' :method :multi(_, ['Markdown'; 'Entity'])
.param pmc node
$S0 = node.'text'()
.local pmc code
Expand All @@ -463,7 +463,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Line'])
.sub 'html' :method :multi(_, ['Markdown'; 'Line'])
.param pmc node
$S1 = node.'text'()
$S0 = escape_xml($S1)
Expand All @@ -477,7 +477,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Word'])
.sub 'html' :method :multi(_, ['Markdown'; 'Word'])
.param pmc node
$S1 = node.'text'()
$S0 = escape_xml($S1)
Expand All @@ -491,7 +491,7 @@ Return generated HTML for all of its children.

=cut

.sub 'html' :method :multi(_,['Markdown';'Space'])
.sub 'html' :method :multi(_, ['Markdown'; 'Space'])
.param pmc node
.local pmc code
new code, 'CodeString'
Expand Down
12 changes: 6 additions & 6 deletions src/Node.pir
Expand Up @@ -10,7 +10,7 @@ for Markdown.

=cut

.namespace [ 'Markdown';'Node' ]
.namespace ['Markdown'; 'Node']

.sub 'onload' :anon :load :init
.local pmc p6meta, base
Expand Down Expand Up @@ -47,7 +47,7 @@ for Markdown.
.end
.namespace [ 'Markdown';'Link' ]
.namespace ['Markdown'; 'Link']
.sub 'image' :method
.param pmc value :optional
Expand All @@ -68,7 +68,7 @@ for Markdown.
.end
.namespace [ 'Markdown';'RefLink' ]
.namespace ['Markdown'; 'RefLink']
.sub 'image' :method
.param pmc value :optional
Expand All @@ -83,13 +83,13 @@ for Markdown.
.end
.namespace [ 'Markdown';'Reference' ]
.namespace ['Markdown'; 'Reference']
.sub 'insert' :method
.param string key
.param string url
.param string title
$P0 = get_hll_global [ 'Markdown';'HTML';'Compiler' ], '%ref'
$P0 = get_hll_global ['Markdown'; 'HTML'; 'Compiler'], '%ref'
$P1 = new 'FixedStringArray'
set $P1, 2
$P1[0] = url
Expand All @@ -99,7 +99,7 @@ for Markdown.
.end
.namespace [ 'Markdown';'Title' ]
.namespace ['Markdown'; 'Title']
.sub 'level' :method
.param pmc value :optional
Expand Down

0 comments on commit 669e593

Please sign in to comment.