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

Commit

Permalink
now, works with Parrot r37824
Browse files Browse the repository at this point in the history
COMPATIBILITY BREAK
  • Loading branch information
fperrad committed Mar 31, 2009
1 parent 302e4a4 commit ae0b52b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
56 changes: 28 additions & 28 deletions src/parser/actions.pm
Expand Up @@ -135,11 +135,11 @@ method Line($/) {
}

method BlankLine($/) {
make Markdown::Newline.new( :text( $/.text() ) );
make Markdown::Newline.new( :text( $/.Str() ) );
}

method NonblankIndentedLine($/) {
make Markdown::Line.new( :text( ~$<IndentedLine><Line><RawLine>.text() ),
make Markdown::Line.new( :text( ~$<IndentedLine><Line><RawLine>.Str() ),
:detab( 1 ) );
}

Expand Down Expand Up @@ -256,7 +256,7 @@ method OrderedListItem($/) {
}

method HtmlBlock($/) {
make Markdown::Html.new( :text( $/.text() ),
make Markdown::Html.new( :text( $/.Str() ),
:detab( 1 ) );
}

Expand Down Expand Up @@ -319,22 +319,22 @@ method ReferenceLink($/, $key) {
}

method ReferenceLinkDouble($/) {
my $mast := Markdown::RefLink.new( :key( ~$<Label>[1].text() ),
:text( $/.text() ) );
my $mast := Markdown::RefLink.new( :key( ~$<Label>[1].Str() ),
:text( $/.Str() ) );
for $<Label>[0]<Inline> {
$mast.push( $( $_ ) );
}
make $mast;
}

method ReferenceLinkSingle($/) {
make Markdown::RefLink.new( :key( ~$<Label>.text() ),
:text( $/.text() ) );
make Markdown::RefLink.new( :key( ~$<Label>.Str() ),
:text( $/.Str() ) );
}

method ExplicitLink($/) {
my $mast := Markdown::Link.new( :title( ~$<Title>[0].text() ),
:url( ~$<Source><SourceContents>.text() ) );
my $mast := Markdown::Link.new( :title( ~$<Title>[0].Str() ),
:url( ~$<Source><SourceContents>.Str() ) );
for $<Label><Inline> {
$mast.push( $( $_ ) );
}
Expand All @@ -346,60 +346,60 @@ method AutoLink($/, $key) {
}

method AutoLinkUrl($/) {
my $mast := Markdown::Link.new( :url( $/[0].text() ) );
$mast.push( Markdown::Line.new( :text( $/[0].text() ) ));
my $mast := Markdown::Link.new( :url( $/[0].Str() ) );
$mast.push( Markdown::Line.new( :text( $/[0].Str() ) ));
make $mast
}

method AutoLinkEmail($/) {
make Markdown::Email.new( :text( $/[0].text() ) );
make Markdown::Email.new( :text( $/[0].Str() ) );
}

method Reference($/) {
my $mast := Markdown::Reference.new( );
$mast.insert( ~$<Label>.text(), ~$<RefSrc>.text(), ~$<RefTitle>[0].text() );
$mast.insert( ~$<Label>.Str(), ~$<RefSrc>.Str(), ~$<RefTitle>[0].Str() );
make $mast
}

method Code($/) {
make Markdown::Code.new( :text( $/[0].text() ) );
make Markdown::Code.new( :text( $/[0].Str() ) );
}

method RawHtml($/, $key) {
make $( $/{$key} );
}

method HtmlComment($/) {
make Markdown::Html.new( :text( $/.text() ),
make Markdown::Html.new( :text( $/.Str() ),
:detab( 1 ) );
}

method HtmlTag($/) {
make Markdown::Html.new( :text( $/.text() ) );
make Markdown::Html.new( :text( $/.Str() ) );
}

method EscapedChar($/) {
make Markdown::Word.new( :text( $/[0].text() ) );
make Markdown::Word.new( :text( $/[0].Str() ) );
}

method Entity($/) {
make Markdown::Html.new( :text( $/.text() ) );
make Markdown::Html.new( :text( $/.Str() ) );
}

method Symbol($/) {
make Markdown::Word.new( :text( $/.text() ) );
make Markdown::Word.new( :text( $/.Str() ) );
}

method Endline($/) {
make Markdown::Word.new( :text( $/.text() ) );
make Markdown::Word.new( :text( $/.Str() ) );
}

method Str($/) {
make Markdown::Word.new( :text( $/.text() ) );
method String($/) {
make Markdown::Word.new( :text( $/.Str() ) );
}

method Space($/) {
make Markdown::Space.new( :text( $/.text() ) );
make Markdown::Space.new( :text( $/.Str() ) );
}

method Smart($/, $key) {
Expand All @@ -408,7 +408,7 @@ method Smart($/, $key) {

method Apostrophe($/) {
# if ( $/.is_strict() ) {
make Markdown::Word.new( :text( $/.text() ) );
make Markdown::Word.new( :text( $/.Str() ) );
# }
# else {
# make Markdown::Html.new( :text( '&rsquo;' ) );
Expand All @@ -417,7 +417,7 @@ method Apostrophe($/) {

method Ellipsis($/) {
if ( $/.is_strict() ) {
make Markdown::Word.new( :text( $/.text() ) );
make Markdown::Word.new( :text( $/.Str() ) );
}
else {
make Markdown::Html.new( :text( '&hellip;' ) );
Expand All @@ -430,7 +430,7 @@ method Dash($/, $key) {

method EnDash($/) {
# if ( $/.is_strict() ) {
make Markdown::Word.new( :text( $/.text() ) );
make Markdown::Word.new( :text( $/.Str() ) );
# }
# else {
# make Markdown::Html.new( :text( '&ndash;' ) );
Expand All @@ -439,15 +439,15 @@ method EnDash($/) {

method EmDash($/) {
if ( $/.is_strict() ) {
make Markdown::Word.new( :text( $/.text() ) );
make Markdown::Word.new( :text( $/.Str() ) );
}
else {
make Markdown::Html.new( :text( '&mdash;' ) );
}
}

method DoubleQuoted($/) {
make Markdown::Line.new( :text( $/.text() ) );
make Markdown::Line.new( :text( $/.Str() ) );
}

# Local Variables:
Expand Down
4 changes: 2 additions & 2 deletions src/parser/grammar.pg
Expand Up @@ -241,7 +241,7 @@ token _Inline {
}

token Inline {
| <Str> {*} #= Str
| <String> {*} #= String
# | <Endline> {*} #= Endline
| <Space> {*} #= Space
| <Strong> {*} #= Strong
Expand All @@ -260,7 +260,7 @@ token Space {
<.Spacechar>+ {*}
}

token Str {
token String {
<.NormalChar>+ {*}
}

Expand Down

0 comments on commit ae0b52b

Please sign in to comment.