Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler does not parse [POD] =defn block correctly #4752

Open
p6rt opened this issue Nov 15, 2015 · 3 comments
Open

Compiler does not parse [POD] =defn block correctly #4752

p6rt opened this issue Nov 15, 2015 · 3 comments

Comments

@p6rt
Copy link

p6rt commented Nov 15, 2015

Migrated from rt.perl.org#126651 (status was 'new')

Searchable as RT126651$

@p6rt
Copy link
Author

p6rt commented Nov 15, 2015

From @autarch

perl6 --version
This is perl6 version 2015.10-220-g4988c70 built on MoarVM version
2015.10-61-g624d504

Given this code​:

  =begin pod

  =defn Item
  Definition

  =end pod

  dd $=pod;

I note that the "Item" text is gone entirely. It looks like the parser is
not saving that for some reason.

Cheers,

-dave

/*============================================================
http://VegGuide.org http://blog.urth.org
Your guide to all that's veg House Absolute(ly Pointless)
============================================================*/

@p6rt
Copy link
Author

p6rt commented Nov 15, 2015

From @autarch

I note that the "Item" text is gone entirely. It looks like the parser is
not saving that for some reason.

Actually, looking more close, it's not gone, it's simply indistinguishable from the next line. This means that there's no way to tell the item text from the definition text.

@p6rt
Copy link
Author

p6rt commented Nov 15, 2015

From @autarch

What I did ... run this code​:

  =begin pod

  =defn Item
  Definition

  =end pod

  dd $=pod;

What I got​:

  Array $var = $[Pod​::Block​::Named.new(name => "pod", config => {}, contents => [Pod​::Block​::Named.new(name => "defn", config => {}, contents => [Pod​::Block​::Para.new(config => {}, contents => ["Item Definition"])])])]

What I expected​:

I'd expect the text on the "=defn" line to be distinguished from the text on the next line (item vs definition). The simplest way would be to simply make the Named block's contents attribute contain multiple items.

However, a better fix IMO would be to introduce a new class, Pod​::Block​::Defn, with an additional attribute like "term" or "item", and then contents would just contain the next line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant