diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/scanners/coderay_suite.rb | 6 | ||||
-rw-r--r-- | test/scanners/html/coderay-output.expected.raydebug | 2 | ||||
-rw-r--r-- | test/scanners/html/tolkien.expected.raydebug | 2 | ||||
-rw-r--r-- | test/scanners/xml/kate.expected.raydebug | 2 | ||||
-rw-r--r-- | test/scanners/yaml/basic.expected.raydebug | 956 | ||||
-rw-r--r-- | test/scanners/yaml/faq.expected.raydebug | 730 | ||||
-rw-r--r-- | test/scanners/yaml/multiline.expected.raydebug | 21 | ||||
-rw-r--r-- | test/scanners/yaml/multiline.in.yml | 21 | ||||
-rw-r--r-- | test/scanners/yaml/threshold.expected.raydebug | 660 | ||||
-rw-r--r-- | test/scanners/yaml/website.expected.raydebug | 24 |
10 files changed, 1234 insertions, 1190 deletions
diff --git a/test/scanners/coderay_suite.rb b/test/scanners/coderay_suite.rb index 751b8b7..f5fb7fe 100644 --- a/test/scanners/coderay_suite.rb +++ b/test/scanners/coderay_suite.rb @@ -143,7 +143,7 @@ module CodeRay def test_ALL puts - puts ' >> Testing '.magenta + self.class.name.cyan + + puts ' >> Testing '.magenta + self.class.name[/\w+$/].cyan + ' scanner <<'.magenta puts @@ -230,7 +230,9 @@ module CodeRay begin scanner.tokenize rescue - flunk "Random test failed at #{size} #{RUBY_VERSION < '1.9' ? 'bytes' : 'chars'}" if ENV['assert'] + assert_nothing_raised "Random test failed at #{size} #{RUBY_VERSION < '1.9' ? 'bytes' : 'chars'}" do + raise + end if ENV['assert'] okay = false break end diff --git a/test/scanners/html/coderay-output.expected.raydebug b/test/scanners/html/coderay-output.expected.raydebug index 18b7722..b8dc626 100644 --- a/test/scanners/html/coderay-output.expected.raydebug +++ b/test/scanners/html/coderay-output.expected.raydebug @@ -1,4 +1,4 @@ -preprocessor(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" +doctype(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">) tag(<html) attribute_name(xmlns)operator(=)string<delimiter(")content(http://www.w3.org/1999/xhtml)delimiter(")> attribute_name(xml:lang)operator(=)string<delimiter(")content(en)delimiter(")> attribute_name(lang)operator(=)string<delimiter(")content(de)delimiter(")>tag(>) tag(<head>) diff --git a/test/scanners/html/tolkien.expected.raydebug b/test/scanners/html/tolkien.expected.raydebug index 653ddd0..df61b19 100644 --- a/test/scanners/html/tolkien.expected.raydebug +++ b/test/scanners/html/tolkien.expected.raydebug @@ -1,4 +1,4 @@ -preprocessor(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">) +doctype(<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">) tag(<html) attribute_name(xmlns)operator(=)string<delimiter(")content(http://www.w3.org/1999/xhtml)delimiter(")> attribute_name(xml:lang)operator(=)string<delimiter(")content(de)delimiter(")> attribute_name(lang)operator(=)string<delimiter(")content(de)delimiter(")>tag(>) tag(<head>)tag(<title>)plain(Faszination Tolkien - Herr der Ringe )entity(&) plain(Co.)tag(</title>) tag(<meta) attribute_name(name)operator(=)string<delimiter(")content(description)delimiter(")> attribute_name(content)operator(=)string<delimiter(")content(J.R.R. Tolkien und seine Werke (Schwerpunkt: Der Herr der Ringe\). Anf)entity(ä)content(ngerfreundlich gestaltet. Gro)entity(ß)content(e kommentierte Galerie, Downloads, Forum, Postkarten, etc.)delimiter(")> tag(/>) diff --git a/test/scanners/xml/kate.expected.raydebug b/test/scanners/xml/kate.expected.raydebug index 01eec5a..2e3204c 100644 --- a/test/scanners/xml/kate.expected.raydebug +++ b/test/scanners/xml/kate.expected.raydebug @@ -1,5 +1,5 @@ preprocessor(<?xml version="1.0" encoding="UTF-8"?>) -preprocessor(<!DOCTYPE language SYSTEM "language.dtd">) +doctype(<!DOCTYPE language SYSTEM "language.dtd">) tag(<language) attribute_name(name)operator(=)string<delimiter(")content(Eiffel)delimiter(")> attribute_name(version)operator(=)string<delimiter(")content(1.02)delimiter(")> attribute_name(kateversion)operator(=)string<delimiter(")content(2.1)delimiter(")> attribute_name(section)operator(=)string<delimiter(")content(Sources)delimiter(")> attribute_name(extensions)operator(=)string<delimiter(")content(*.e)delimiter(")> attribute_name(mimetype)operator(=)string<delimiter(")content(text/x-eiffel-src)delimiter(")>tag(>) tag(<highlighting>) tag(<list) attribute_name(name)operator(=)string<delimiter(")content(keywords)delimiter(")>tag(>) diff --git a/test/scanners/yaml/basic.expected.raydebug b/test/scanners/yaml/basic.expected.raydebug index 6ffde52..810b400 100644 --- a/test/scanners/yaml/basic.expected.raydebug +++ b/test/scanners/yaml/basic.expected.raydebug @@ -1,110 +1,110 @@ head<head(---)> key(name)operator(:) string(paragraphs) key(desc)operator(:) string(Textile looks for paragraphs in your text. Paragraphs are separated by one blank line. Every paragraph is translated as an HTML paragraph.) -key(in)operator(:) string(|-) - string(A single paragraph.) +key(in)operator(:) string<delimiter(|-)content( + A single paragraph. - string(Followed by another.) -key(html)operator(:) string(|-) - string(<p>A single paragraph.</p>) - string(<p>Followed by another.</p>) + Followed by another.)> +key(html)operator(:) string<delimiter(|-)content( + <p>A single paragraph.</p> + <p>Followed by another.</p>)> head<head(---)> key(name)operator(:) string(block containing block start) -key(in)operator(:) string(|-) - string(I saw a ship. It ate my elephant.) -key(html)operator(:) string(|-) - string(<p>I saw a ship. It ate my elephant.</p>) +key(in)operator(:) string<delimiter(|-)content( + I saw a ship. It ate my elephant.)> +key(html)operator(:) string<delimiter(|-)content( + <p>I saw a ship. It ate my elephant.</p>)> head<head(---)> key(name)operator(:) string(extended block containing block start) -key(in)operator(:) string(|-) - string(p.. I saw a ship. It ate my elephant.) +key(in)operator(:) string<delimiter(|-)content( + p.. I saw a ship. It ate my elephant. - string(When the elephant comes to take a p. you...) -key(html)operator(:) string(|-) - string(<p>I saw a ship. It ate my elephant.</p>) - string(<p>When the elephant comes to take a p. you…</p>) + When the elephant comes to take a p. you...)> +key(html)operator(:) string<delimiter(|-)content( + <p>I saw a ship. It ate my elephant.</p> + <p>When the elephant comes to take a p. you…</p>)> head<head(---)> key(name)operator(:) string(blockquote containing block start) -key(in)operator(:) string(|-) - string(bq. I saw a ship. It ate my elephant.) -key(html)operator(:) string(|-) - string(<blockquote>) - string(<p>I saw a ship. It ate my elephant.</p>) - string(</blockquote>) +key(in)operator(:) string<delimiter(|-)content( + bq. I saw a ship. It ate my elephant.)> +key(html)operator(:) string<delimiter(|-)content( + <blockquote> + <p>I saw a ship. It ate my elephant.</p> + </blockquote>)> head<head(---)> key(name)operator(:) string(extended blockquote containing block start) -key(in)operator(:) string(|-) - string(bq.. I saw a ship. It ate my elephant.) +key(in)operator(:) string<delimiter(|-)content( + bq.. I saw a ship. It ate my elephant. - string(When the elephant comes to take a p. you...) -key(html)operator(:) string(|-) - string(<blockquote>) - string(<p>I saw a ship. It ate my elephant.</p>) - string(<p>When the elephant comes to take a p. you…</p>) - string(</blockquote>) + When the elephant comes to take a p. you...)> +key(html)operator(:) string<delimiter(|-)content( + <blockquote> + <p>I saw a ship. It ate my elephant.</p> + <p>When the elephant comes to take a p. you…</p> + </blockquote>)> head<head(---)> key(name)operator(:) string(notextile block containing block start) -key(in)operator(:) string(|-) - string(notextile. I saw a ship. It ate my elephant.) -key(html)operator(:) string(|-) - string(I saw a ship. It ate my elephant.) +key(in)operator(:) string<delimiter(|-)content( + notextile. I saw a ship. It ate my elephant.)> +key(html)operator(:) string<delimiter(|-)content( + I saw a ship. It ate my elephant.)> key(valid_html)operator(:) string(false) head<head(---)> key(name)operator(:) string(extended notextile block containing block start) -key(in)operator(:) string(|-) - string(notextile.. I saw a ship. It ate my elephant.) +key(in)operator(:) string<delimiter(|-)content( + notextile.. I saw a ship. It ate my elephant. - string(When the elephant comes to take a p. you...) -key(html)operator(:) string(|-) - string(I saw a ship. It ate my elephant.) + When the elephant comes to take a p. you...)> +key(html)operator(:) string<delimiter(|-)content( + I saw a ship. It ate my elephant. - string(When the elephant comes to take a p. you...) + When the elephant comes to take a p. you...)> key(valid_html)operator(:) string(false) head<head(---)> key(name)operator(:) string(pre block containing block start) -key(in)operator(:) string(|-) - string(pre. I saw a ship. It ate my elephant.) -key(html)operator(:) string(|-) - string(<pre>I saw a ship. It ate my elephant.</pre>) +key(in)operator(:) string<delimiter(|-)content( + pre. I saw a ship. It ate my elephant.)> +key(html)operator(:) string<delimiter(|-)content( + <pre>I saw a ship. It ate my elephant.</pre>)> head<head(---)> key(name)operator(:) string(extended pre block containing block start) -key(in)operator(:) string(|-) - string(pre.. I saw a ship. It ate my elephant.) +key(in)operator(:) string<delimiter(|-)content( + pre.. I saw a ship. It ate my elephant. - string(When the elephant comes to take a p. you...) -key(html)operator(:) string(|-) - string(<pre>I saw a ship. It ate my elephant.</pre>) + When the elephant comes to take a p. you...)> +key(html)operator(:) string<delimiter(|-)content( + <pre>I saw a ship. It ate my elephant.</pre> - string(<pre>When the elephant comes to take a p. you…</pre>) - string(--- ) + <pre>When the elephant comes to take a p. you…</pre> + --- )> key(name)operator(:) string(html tags) key(desc)operator(:) string(You can certainly use HTML tags inside your Textile documents. HTML will only be escaped if it’s found in a <code>pre</code> or <code>code</code> block.) -key(in)operator(:) string(|-) - string(I am <b>very</b> serious.) +key(in)operator(:) string<delimiter(|-)content( + I am <b>very</b> serious. - string(<pre>) - string(I am <b>very</b> serious.) - string(</pre>) -key(html)operator(:) string(|-) - string(<p>I am <b>very</b> serious.</p>) - string(<pre>) - string(I am <b>very</b> serious.) - string(</pre>) + <pre> + I am <b>very</b> serious. + </pre>)> +key(html)operator(:) string<delimiter(|-)content( + <p>I am <b>very</b> serious.</p> + <pre> + I am <b>very</b> serious. + </pre>)> head<head(---)> key(name)operator(:) string(line breaks) key(desc)operator(:) string(Line breaks are converted to HTML breaks.) -key(in)operator(:) string(|-) - string(I spoke.) - string(And none replied.) -key(html)operator(:) string(|-) - string(<p>I spoke.<br />) - string(And none replied.</p>) -key(html_no_breaks)operator(:) string(|-) - string(<p>I spoke.) - string(And none replied.</p>) -key(lite_mode_html)operator(:) string(|-) - string(I spoke.<br />) - string(And none replied.) +key(in)operator(:) string<delimiter(|-)content( + I spoke. + And none replied.)> +key(html)operator(:) string<delimiter(|-)content( + <p>I spoke.<br /> + And none replied.</p>)> +key(html_no_breaks)operator(:) string<delimiter(|-)content( + <p>I spoke. + And none replied.</p>)> +key(lite_mode_html)operator(:) string<delimiter(|-)content( + I spoke.<br /> + And none replied.)> head<head(---)> key(name)operator(:) string(curly quotes) key(desc)operator(:) string(Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye.) @@ -112,13 +112,13 @@ key(in)operator(:) string<delimiter(")content(\\"Observe!\\")delimiter(")> key(html)operator(:) string(<p>“Observe!”</p>) head<head(---)> key(name)operator(:) string(quotes contained in multi-paragraph quotes) -key(in)operator(:) string(|-) - string("I first learned about this thing called "Redcloth" several years ago.) +key(in)operator(:) string<delimiter(|-)content( + "I first learned about this thing called "Redcloth" several years ago. - string("It's wonderful.") -key(html)operator(:) string(|-) - string(<p>“I first learned about this thing called “Redcloth” several years ago.</p>) - string(<p>“It’s wonderful.”</p>) + "It's wonderful.")> +key(html)operator(:) string<delimiter(|-)content( + <p>“I first learned about this thing called “Redcloth” several years ago.</p> + <p>“It’s wonderful.”</p>)> head<head(---)> key(name)operator(:) string(double hyphens) key(desc)operator(:) string(Double hyphens are replaced with an em-dash.) @@ -200,18 +200,18 @@ key(html)operator(:) string(<h3>Header 3</h3>) head<head(---)> key(name)operator(:) string(blockquote) key(desc)operator(:) string(To make an entire paragraph into a block quotation, place “bq.” before it.) -key(in)operator(:) string(|-) - string(Any old text) +key(in)operator(:) string<delimiter(|-)content( + Any old text - string(bq. A block quotation.) + bq. A block quotation. - string(Any old text) -key(html)operator(:) string(|-) - string(<p>Any old text</p>) - string(<blockquote>) - string(<p>A block quotation.</p>) - string(</blockquote>) - string(<p>Any old text</p>) + Any old text)> +key(html)operator(:) string<delimiter(|-)content( + <p>Any old text</p> + <blockquote> + <p>A block quotation.</p> + </blockquote> + <p>Any old text</p>)> head<head(---)> key(name)operator(:) string(footnote reference) key(desc)operator(:) string(Numeric references within text to footnotes appear between square brackets.) @@ -242,12 +242,12 @@ key(html)operator(:) string<delimiter(")content(<p><strong>10 times as many</str head<head(---)> key(name)operator(:) string(force bold italics) key(desc)operator(:) string(Both italics and bold can be forced by doubling the underscores or asterisks.) -key(in)operator(:) string(|-) - string(I __know__.) - string(I **really** __know__.) -key(html)operator(:) string(|-) - string(<p>I <i>know</i>.<br />) - string(I <b>really</b> <i>know</i>.</p>) +key(in)operator(:) string<delimiter(|-)content( + I __know__. + I **really** __know__.)> +key(html)operator(:) string<delimiter(|-)content( + <p>I <i>know</i>.<br /> + I <b>really</b> <i>know</i>.</p>)> head<head(---)> key(name)operator(:) string(citation) key(desc)operator(:) string(Use double question marks to indicate <em>citation</em>. The title of a book, for instance.) @@ -304,24 +304,24 @@ key(html)operator(:) string(<p>I’m <span>unaware</span> of most soft drink head<head(---)> key(name)operator(:) string(style span) key(desc)operator(:) string(This way, you can apply style settings, as described in the next section to arbitrary phrases.) -key(in)operator(:) string(|-) - string(I'm %{color:red}unaware%) - string(of most soft drinks.) -key(html)operator(:) string(|-) - string(<p>I’m <span style="color:red;">unaware</span><br />) - string(of most soft drinks.</p>) -key(lite_mode_html)operator(:) string(|-) - string(I’m <span style="color:red;">unaware</span><br />) - string(of most soft drinks.) +key(in)operator(:) string<delimiter(|-)content( + I'm %{color:red}unaware% + of most soft drinks.)> +key(html)operator(:) string<delimiter(|-)content( + <p>I’m <span style="color:red;">unaware</span><br /> + of most soft drinks.</p>)> +key(lite_mode_html)operator(:) string<delimiter(|-)content( + I’m <span style="color:red;">unaware</span><br /> + of most soft drinks.)> head<head(---)> key(name)operator(:) string(percent sign) key(desc)operator(:) string(though percent signs indicate a span, they shouldn't be overly greedy.) -key(in)operator(:) string(|-) - string(http://blah.com/one%20two%20three) - string((min\)5%-95%(max\)) -key(html)operator(:) string(|-) - string(<p>http://blah.com/one%20two%20three<br />) - string((min\)5%-95%(max\)</p>) +key(in)operator(:) string<delimiter(|-)content( + http://blah.com/one%20two%20three + (min\)5%-95%(max\))> +key(html)operator(:) string<delimiter(|-)content( + <p>http://blah.com/one%20two%20three<br /> + (min\)5%-95%(max\)</p>)> head<head(---)> key(name)operator(:) string(css class) key(desc)operator(:) string(A block can be tagged with a CSS class by circling the class in parentheses and placing it just before the period which marks the block.) @@ -350,29 +350,29 @@ key(html)operator(:) string(<p lang="fr">rouge</p>) head<head(---)> key(name)operator(:) string(block attributes on phrase modifiers) key(desc)operator(:) string(All block attributes can be applied to phrases as well by placing them just inside the opening modifier.) -key(in)operator(:) string(|-) - string(I seriously *{color:red}blushed*) - string(when I _(big\)sprouted_ that) - string(corn stalk from my) - string(%[es]cabeza%.) -key(html)operator(:) string(|-) - string(<p>I seriously <strong style="color:red;">blushed</strong><br />) - string(when I <em class="big">sprouted</em> that<br />) - string(corn stalk from my<br />) - string(<span lang="es">cabeza</span>.</p>) +key(in)operator(:) string<delimiter(|-)content( + I seriously *{color:red}blushed* + when I _(big\)sprouted_ that + corn stalk from my + %[es]cabeza%.)> +key(html)operator(:) string<delimiter(|-)content( + <p>I seriously <strong style="color:red;">blushed</strong><br /> + when I <em class="big">sprouted</em> that<br /> + corn stalk from my<br /> + <span lang="es">cabeza</span>.</p>)> head<head(---)> key(name)operator(:) string(inline attributes preceded by text are treated as literal) key(desc)operator(:) string(modifiers must come first, without anything before them) -key(in)operator(:) string(|-) - string(I *seriously {color:red}blushed*) - string(when I _first (big\)sprouted_ that) - string(corn stalk from my) - string(%grande [es]cabeza%.) -key(html)operator(:) string(|-) - string(<p>I <strong>seriously {color:red}blushed</strong><br />) - string(when I <em>first (big\)sprouted</em> that<br />) - string(corn stalk from my<br />) - string(<span>grande [es]cabeza</span>.</p>) +key(in)operator(:) string<delimiter(|-)content( + I *seriously {color:red}blushed* + when I _first (big\)sprouted_ that + corn stalk from my + %grande [es]cabeza%.)> +key(html)operator(:) string<delimiter(|-)content( + <p>I <strong>seriously {color:red}blushed</strong><br /> + when I <em>first (big\)sprouted</em> that<br /> + corn stalk from my<br /> + <span>grande [es]cabeza</span>.</p>)> head<head(---)> key(name)operator(:) string(align justified) key(desc)operator(:) string(Text inside blocks can be aligned in four basic ways.) @@ -396,115 +396,115 @@ key(html)operator(:) string(<h3 style="padding-left:1em;padding-right:1em;text-a head<head(---)> key(name)operator(:) string(code blocks) key(desc)operator(:) string(For example, long code blocks belong between <code>pre</code> and <code>code</code> tags. Please also indent your code inside the tags to be sure that all Textile processors out there will ignore the contents.) -key(in)operator(:) string(|) - string(<pre>) - string(<code>) - string(a.gsub!( /</, '' \)) - string(</code>) - string(</pre>) -key(html)operator(:) string(|-) - string(<pre>) - string(<code>) - string(a.gsub!( /</, '' \)) - string(</code>) - string(</pre>) +key(in)operator(:) string<delimiter(|)content( + <pre> + <code> + a.gsub!( /</, '' \) + </code> + </pre>)> +key(html)operator(:) string<delimiter(|-)content( + <pre> + <code> + a.gsub!( /</, '' \) + </code> + </pre>)> head<head(---)> key(name)operator(:) string(div tags) key(desc)operator(:) string(You may also choose to surround sections with <code>div</code> tags to separate your document into sections. <a href="http://www.instiki.org/">Instiki</a> uses this technique to float a sidebar to the right.) -key(in)operator(:) string(|) - string(<div style="float:right;">) +key(in)operator(:) string<delimiter(|)content( + <div style="float:right;"> - string(h3. Sidebar) + h3. Sidebar - string("Hobix":http://hobix.com/) - string("Ruby":http://ruby-lang.org/) + "Hobix":http://hobix.com/ + "Ruby":http://ruby-lang.org/ - string(</div>) + </div> - string(The main text of the page goes here and will stay to the left of the sidebar.) -key(html)operator(:) string(|-) - string(<div style="float:right;">) - string(<h3>Sidebar</h3>) - string(<p><a href="http://hobix.com/">Hobix</a><br />) - string(<a href="http://ruby-lang.org/">Ruby</a></p>) - string(</div>) - string(<p>The main text of the page goes here and will stay to the left of the sidebar.</p>) + The main text of the page goes here and will stay to the left of the sidebar.)> +key(html)operator(:) string<delimiter(|-)content( + <div style="float:right;"> + <h3>Sidebar</h3> + <p><a href="http://hobix.com/">Hobix</a><br /> + <a href="http://ruby-lang.org/">Ruby</a></p> + </div> + <p>The main text of the page goes here and will stay to the left of the sidebar.</p>)> head<head(---)> key(name)operator(:) string(numbered list) key(desc)operator(:) string(To make a numbered list, place each item in its own paragraph, preceded by ”#”.) -key(in)operator(:) string(|-) - comment(# A first item) - comment(# A second item) - comment(# A third) -key(html)operator(:) string(|-) - string(<ol>) - string(<li>A first item</li>) - string(<li>A second item</li>) - string(<li>A third</li>) - string(</ol>) +key(in)operator(:) string<delimiter(|-)content( + # A first item + # A second item + # A third)> +key(html)operator(:) string<delimiter(|-)content( + <ol> + <li>A first item</li> + <li>A second item</li> + <li>A third</li> + </ol>)> head<head(---)> key(name)operator(:) string(nested numbered lists) key(desc)operator(:) string(These lists may be nested by increasing the number of pound symbols preceding child entries.) -key(in)operator(:) string(|-) - comment(# Fuel could be:) - comment(## Coal) - comment(## Gasoline) - comment(## Electricity) - comment(# Humans need only:) - comment(## Water) - comment(## Protein) -key(html)operator(:) string(|-) - string(<ol>) - string(<li>Fuel could be:) - string(<ol>) - string(<li>Coal</li>) - string(<li>Gasoline</li>) - string(<li>Electricity</li>) - string(</ol></li>) - string(<li>Humans need only:) - string(<ol>) - string(<li>Water</li>) - string(<li>Protein</li>) - string(</ol></li>) - string(</ol>) +key(in)operator(:) string<delimiter(|-)content( + # Fuel could be: + ## Coal + ## Gasoline + ## Electricity + # Humans need only: + ## Water + ## Protein)> +key(html)operator(:) string<delimiter(|-)content( + <ol> + <li>Fuel could be: + <ol> + <li>Coal</li> + <li>Gasoline</li> + <li>Electricity</li> + </ol></li> + <li>Humans need only: + <ol> + <li>Water</li> + <li>Protein</li> + </ol></li> + </ol>)> head<head(---)> key(name)operator(:) string(bulleted list) key(desc)operator(:) string(Bulleted lists use an asterisk in place of the pound.) -key(in)operator(:) string(|-) - string(* A first item) - string(* A second item) - string(* A third) -key(html)operator(:) string(|-) - string(<ul>) - string(<li>A first item</li>) - string(<li>A second item</li>) - string(<li>A third</li>) - string(</ul>) +key(in)operator(:) string<delimiter(|-)content( + * A first item + * A second item + * A third)> +key(html)operator(:) string<delimiter(|-)content( + <ul> + <li>A first item</li> + <li>A second item</li> + <li>A third</li> + </ul>)> head<head(---)> key(name)operator(:) string(nested bulleted lists) key(desc)operator(:) string(These lists may be nested in like manner.) -key(in)operator(:) string(|-) - string(* Fuel could be:) - string(** Coal) - string(** Gasoline) - string(** Electricity) - string(* Humans need only:) - string(** Water) - string(** Protein) -key(html)operator(:) string(|-) - string(<ul>) - string(<li>Fuel could be:) - string(<ul>) - string(<li>Coal</li>) - string(<li>Gasoline</li>) - string(<li>Electricity</li>) - string(</ul></li>) - string(<li>Humans need only:) - string(<ul>) - string(<li>Water</li>) - string(<li>Protein</li>) - string(</ul></li>) - string(</ul>) +key(in)operator(:) string<delimiter(|-)content( + * Fuel could be: + ** Coal + ** Gasoline + ** Electricity + * Humans need only: + ** Water + ** Protein)> +key(html)operator(:) string<delimiter(|-)content( + <ul> + <li>Fuel could be: + <ul> + <li>Coal</li> + <li>Gasoline</li> + <li>Electricity</li> + </ul></li> + <li>Humans need only: + <ul> + <li>Water</li> + <li>Protein</li> + </ul></li> + </ul>)> head<head(---)> key(name)operator(:) string(links) key(desc)operator(:) string(Basic links are comprised of a phrase which is linked to a <acronym title="Universal Resource Locator">URL</acronym>. Place the descriptive phrase in quotation marks. Follow it immediately by a colon and the URL.) @@ -514,16 +514,16 @@ key(lite_mode_html)operator(:) string(I searched <a href="http://google.com">Goo head<head(---)> key(name)operator(:) string(link aliases) key(desc)operator(:) string(If you are using the same link several times in your document, or you’d just like to be a tad more organized, you can use a link alias. Place the URL anywhere in your document, beginning with its alias in square brackets. Then, use the alias in place of the URL, using the link format above.) -key(in)operator(:) string(|-) - string(I am crazy about "Hobix":hobix) - string(and "it's":hobix "all":hobix I ever) - string("link to":hobix!) +key(in)operator(:) string<delimiter(|-)content( + I am crazy about "Hobix":hobix + and "it's":hobix "all":hobix I ever + "link to":hobix! - operator([)string(hobix]http://hobix.com) -key(html)operator(:) string(|-) - string(<p>I am crazy about <a href="http://hobix.com">Hobix</a><br />) - string(and <a href="http://hobix.com">it’s</a> <a href="http://hobix.com">all</a> I ever<br />) - string(<a href="http://hobix.com">link to</a>!</p>) + [hobix]http://hobix.com)> +key(html)operator(:) string<delimiter(|-)content( + <p>I am crazy about <a href="http://hobix.com">Hobix</a><br /> + and <a href="http://hobix.com">it’s</a> <a href="http://hobix.com">all</a> I ever<br /> + <a href="http://hobix.com">link to</a>!</p>)> head<head(---)> key(name)operator(:) string(image) key(desc)operator(:) string(You can embed an image in your Textile document by surrounding its URL with exclamation marks.) @@ -543,15 +543,15 @@ key(html)operator(:) string(<p><a href="http://hobix.com/"><img src="openwindow1 head<head(---)> key(name)operator(:) string(image alignments) key(desc)operator(:) string(Alignments can be applied as well to images.) -key(in)operator(:) string(|-) - string(!>obake.gif!) +key(in)operator(:) string<delimiter(|-)content( + !>obake.gif! - string(And others sat all round the small) - string(machine and paid it to sing to them.) -key(html)operator(:) string(|-) - string(<p style="float:right;"><img src="obake.gif" alt="" /></p>) - string(<p>And others sat all round the small<br />) - string(machine and paid it to sing to them.</p>) + And others sat all round the small + machine and paid it to sing to them.)> +key(html)operator(:) string<delimiter(|-)content( + <p style="float:right;"><img src="obake.gif" alt="" /></p> + <p>And others sat all round the small<br /> + machine and paid it to sing to them.</p>)> head<head(---)> key(name)operator(:) string(acronym definitions) key(desc)operator(:) string(Definitions for acronyms can be provided by following an acronym with its definition in parens.) @@ -562,288 +562,288 @@ key(no_span_caps_html)operator(:) string(<p>We use <acronym title="Cascading Sty head<head(---)> key(name)operator(:) string(tables) key(desc)operator(:) string(Simple tables can be built by separating fields with pipe characters) -key(in)operator(:) string(|-) - string(| name | age | sex |) - string(| joan | 24 | f |) - string(| archie | 29 | m |) - string(| bella | 45 | f |) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td> name </td>) - string(<td> age </td>) - string(<td> sex </td>) - string(</tr>) - string(<tr>) - string(<td> joan </td>) - string(<td> 24 </td>) - string(<td> f </td>) - string(</tr>) - string(<tr>) - string(<td> archie </td>) - string(<td> 29 </td>) - string(<td> m </td>) - string(</tr>) - string(<tr>) - string(<td> bella </td>) - string(<td> 45 </td>) - string(<td> f </td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + | name | age | sex | + | joan | 24 | f | + | archie | 29 | m | + | bella | 45 | f |)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td> name </td> + <td> age </td> + <td> sex </td> + </tr> + <tr> + <td> joan </td> + <td> 24 </td> + <td> f </td> + </tr> + <tr> + <td> archie </td> + <td> 29 </td> + <td> m </td> + </tr> + <tr> + <td> bella </td> + <td> 45 </td> + <td> f </td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(table headers) key(desc)operator(:) string(Specify header cells by marking them with an underscore and period.) -key(in)operator(:) string(|-) - string(|_. name |_. age |_. sex |) - string(| joan | 24 | f |) - string(| archie | 29 | m |) - string(| bella | 45 | f |) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<th>name </th>) - string(<th>age </th>) - string(<th>sex </th>) - string(</tr>) - string(<tr>) - string(<td> joan </td>) - string(<td> 24 </td>) - string(<td> f </td>) - string(</tr>) - string(<tr>) - string(<td> archie </td>) - string(<td> 29 </td>) - string(<td> m </td>) - string(</tr>) - string(<tr>) - string(<td> bella </td>) - string(<td> 45 </td>) - string(<td> f </td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |_. name |_. age |_. sex | + | joan | 24 | f | + | archie | 29 | m | + | bella | 45 | f |)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <th>name </th> + <th>age </th> + <th>sex </th> + </tr> + <tr> + <td> joan </td> + <td> 24 </td> + <td> f </td> + </tr> + <tr> + <td> archie </td> + <td> 29 </td> + <td> m </td> + </tr> + <tr> + <td> bella </td> + <td> 45 </td> + <td> f </td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(table cell attributes) key(desc)operator(:) string(The period used above marks the end of a cell’s attributes. Other attributes can be applied as well.) -key(in)operator(:) string(|-) - string(|_. attribute list |) - string(|<. align left |) - string(|>. align right|) - string(|=. center |) - string(|<>. justify |) - string(|^. valign top |) - string(|~. bottom |) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<th>attribute list </th>) - string(</tr>) - string(<tr>) - string(<td style="text-align:left;">align left </td>) - string(</tr>) - string(<tr>) - string(<td style="text-align:right;">align right</td>) - string(</tr>) - string(<tr>) - string(<td style="text-align:center;">center </td>) - string(</tr>) - string(<tr>) - string(<td style="text-align:justify;">justify </td>) - string(</tr>) - string(<tr>) - string(<td style="vertical-align:top;">valign top </td>) - string(</tr>) - string(<tr>) - string(<td style="vertical-align:bottom;">bottom </td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |_. attribute list | + |<. align left | + |>. align right| + |=. center | + |<>. justify | + |^. valign top | + |~. bottom |)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <th>attribute list </th> + </tr> + <tr> + <td style="text-align:left;">align left </td> + </tr> + <tr> + <td style="text-align:right;">align right</td> + </tr> + <tr> + <td style="text-align:center;">center </td> + </tr> + <tr> + <td style="text-align:justify;">justify </td> + </tr> + <tr> + <td style="vertical-align:top;">valign top </td> + </tr> + <tr> + <td style="vertical-align:bottom;">bottom </td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(table colspan) key(desc)operator(:) string(You can also specify colspans with a backslash, followed by the cell width.) -key(in)operator(:) string(|-) - string(|\\2. spans two cols |) - string(| col 1 | col 2 |) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td colspan="2">spans two cols </td>) - string(</tr>) - string(<tr>) - string(<td> col 1 </td>) - string(<td> col 2 </td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |\\2. spans two cols | + | col 1 | col 2 |)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td colspan="2">spans two cols </td> + </tr> + <tr> + <td> col 1 </td> + <td> col 2 </td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(table rowspan) key(desc)operator(:) string(Rowspan is specified by a forward slash, followed by the row height.) -key(in)operator(:) string(|-) - string(|/3. spans 3 rows | a |) - string(| b |) - string(| c |) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td rowspan="3">spans 3 rows </td>) - string(<td> a </td>) - string(</tr>) - string(<tr>) - string(<td> b </td>) - string(</tr>) - string(<tr>) - string(<td> c </td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |/3. spans 3 rows | a | + | b | + | c |)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td rowspan="3">spans 3 rows </td> + <td> a </td> + </tr> + <tr> + <td> b </td> + </tr> + <tr> + <td> c </td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(block attributes applied to table cells) key(desc)operator(:) string(All block attributes can be applied to table cells as well.) key(in)operator(:) string<delimiter(")content(|{background:#ddd}. Grey cell|)delimiter(")> -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td style="background:#ddd;">Grey cell</td>) - string(</tr>) - string(</table>) +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td style="background:#ddd;">Grey cell</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(black attributes applied to a table) key(desc)operator(:) string(Table-wide attributes can be applied before the first row of the table. On its own line, followed by a period.) -key(in)operator(:) string(|-) - string(table{border:1px solid black}.) - string(|This|is|a|row|) - string(|This|is|a|row|) -key(html)operator(:) string(|-) - string(<table style="border:1px solid black;">) - string(<tr>) - string(<td>This</td>) - string(<td>is</td>) - string(<td>a</td>) - string(<td>row</td>) - string(</tr>) - string(<tr>) - string(<td>This</td>) - string(<td>is</td>) - string(<td>a</td>) - string(<td>row</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + table{border:1px solid black}. + |This|is|a|row| + |This|is|a|row|)> +key(html)operator(:) string<delimiter(|-)content( + <table style="border:1px solid black;"> + <tr> + <td>This</td> + <td>is</td> + <td>a</td> + <td>row</td> + </tr> + <tr> + <td>This</td> + <td>is</td> + <td>a</td> + <td>row</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(black attributes applied to a table row) key(desc)operator(:) string(Attributes can be applied to a single row by supplying the attribute before the row starts, using a <code>table</code> modifier and following it by a period.) -key(in)operator(:) string(|-) - string(|This|is|a|row|) - operator({)string(background:#ddd}. |This|is|grey|row|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td>This</td>) - string(<td>is</td>) - string(<td>a</td>) - string(<td>row</td>) - string(</tr>) - string(<tr style="background:#ddd;">) - string(<td>This</td>) - string(<td>is</td>) - string(<td>grey</td>) - string(<td>row</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |This|is|a|row| + {background:#ddd}. |This|is|grey|row|)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td>This</td> + <td>is</td> + <td>a</td> + <td>row</td> + </tr> + <tr style="background:#ddd;"> + <td>This</td> + <td>is</td> + <td>grey</td> + <td>row</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(extended block followed by pre block) -key(in)operator(:) string(|-) - string(div.. Just a test.) +key(in)operator(:) string<delimiter(|-)content( + div.. Just a test. - string(Second div.) + Second div. - string(pre. A pre block ends it.) -key(html)operator(:) string(|-) - string(<div>Just a test.</div>) - string(<div>Second div.</div>) - string(<pre>A pre block ends it.</pre>) + pre. A pre block ends it.)> +key(html)operator(:) string<delimiter(|-)content( + <div>Just a test.</div> + <div>Second div.</div> + <pre>A pre block ends it.</pre>)> head<head(---)> key(name)operator(:) string(extended block followed by blockquote) -key(in)operator(:) string(|-) - string(div.. Just a test.) +key(in)operator(:) string<delimiter(|-)content( + div.. Just a test. - string(Second div.) + Second div. - string(bq. A blockquote ends it.) -key(html)operator(:) string(|-) - string(<div>Just a test.</div>) - string(<div>Second div.</div>) - string(<blockquote>) - string(<p>A blockquote ends it.</p>) - string(</blockquote>) + bq. A blockquote ends it.)> +key(html)operator(:) string<delimiter(|-)content( + <div>Just a test.</div> + <div>Second div.</div> + <blockquote> + <p>A blockquote ends it.</p> + </blockquote>)> head<head(---)> key(name)operator(:) string(extended block followed by block code) -key(in)operator(:) string(|-) - string(div.. Just a test.) +key(in)operator(:) string<delimiter(|-)content( + div.. Just a test. - string(Second div.) + Second div. - string(bc. A blockcode ends it.) -key(html)operator(:) string(|-) - string(<div>Just a test.</div>) - string(<div>Second div.</div>) - string(<pre><code>A blockcode ends it.</code></pre>) + bc. A blockcode ends it.)> +key(html)operator(:) string<delimiter(|-)content( + <div>Just a test.</div> + <div>Second div.</div> + <pre><code>A blockcode ends it.</code></pre>)> head<head(---)> key(name)operator(:) string(extended block followed by notextile block) -key(in)operator(:) string(|-) - string(div.. Just a test.) +key(in)operator(:) string<delimiter(|-)content( + div.. Just a test. - string(Second div.) + Second div. - string(notextile. A notextile block ends it.) -key(html)operator(:) string(|-) - string(<div>Just a test.</div>) - string(<div>Second div.</div>) - string(A notextile block ends it.) + notextile. A notextile block ends it.)> +key(html)operator(:) string<delimiter(|-)content( + <div>Just a test.</div> + <div>Second div.</div> + A notextile block ends it.)> key(valid_html)operator(:) string(false) head<head(---)> key(name)operator(:) string(simple parentheses) -key(in)operator(:) string(|-) - string(before (in parens\) after) -key(html)operator(:) string(|-) - string(<p>before (in parens\) after</p>) +key(in)operator(:) string<delimiter(|-)content( + before (in parens\) after)> +key(html)operator(:) string<delimiter(|-)content( + <p>before (in parens\) after</p>)> head<head(---)> key(name)operator(:) string(parentheses in underscores) -key(in)operator(:) string(|-) - string(before _(in parens\)_ after) -key(html)operator(:) string(|-) - string(<p>before <em>(in parens\)</em> after</p>) +key(in)operator(:) string<delimiter(|-)content( + before _(in parens\)_ after)> +key(html)operator(:) string<delimiter(|-)content( + <p>before <em>(in parens\)</em> after</p>)> head<head(---)> key(name)operator(:) string(parentheses in asterisks) -key(in)operator(:) string(|-) - string(before *(in parens\)* after) -key(html)operator(:) string(|-) - string(<p>before <strong>(in parens\)</strong> after</p>) +key(in)operator(:) string<delimiter(|-)content( + before *(in parens\)* after)> +key(html)operator(:) string<delimiter(|-)content( + <p>before <strong>(in parens\)</strong> after</p>)> head<head(---)> key(name)operator(:) string(parentheses in underscores in quotes) -key(in)operator(:) string(|-) - string("before _(in parens\)_ after") -key(html)operator(:) string(|-) - string(<p>“before <em>(in parens\)</em> after”</p>) +key(in)operator(:) string<delimiter(|-)content( + "before _(in parens\)_ after")> +key(html)operator(:) string<delimiter(|-)content( + <p>“before <em>(in parens\)</em> after”</p>)> head<head(---)> key(name)operator(:) string(underscores in parentheses) -key(in)operator(:) string(|-) - string(one _two three_ (four _five six_\) seven) -key(html)operator(:) string(|-) - string(<p>one <em>two three</em> (four <em>five six</em>\) seven</p>) +key(in)operator(:) string<delimiter(|-)content( + one _two three_ (four _five six_\) seven)> +key(html)operator(:) string<delimiter(|-)content( + <p>one <em>two three</em> (four <em>five six</em>\) seven</p>)> head<head(---)> key(name)operator(:) string(underscores in parentheses in quotes) -key(in)operator(:) string(|-) - string("one _two three_ (four _five six_\) seven") -key(html)operator(:) string(|-) - string(<p>“one <em>two three</em> (four <em>five six</em>\) seven”</p>) +key(in)operator(:) string<delimiter(|-)content( + "one _two three_ (four _five six_\) seven")> +key(html)operator(:) string<delimiter(|-)content( + <p>“one <em>two three</em> (four <em>five six</em>\) seven”</p>)> head<head(---)> key(name)operator(:) string(underscores in parentheses 2) -key(in)operator(:) string(|-) - string(one (two _three four_\) five) -key(html)operator(:) string(|-) - string(<p>one (two <em>three four</em>\) five</p>) +key(in)operator(:) string<delimiter(|-)content( + one (two _three four_\) five)> +key(html)operator(:) string<delimiter(|-)content( + <p>one (two <em>three four</em>\) five</p>)> head<head(---)> key(name)operator(:) string(underscores in parentheses in quotes 2) -key(in)operator(:) string(|-) - string("one (two _three four_\) five") -key(html)operator(:) string(|-) - string(<p>“one (two <em>three four</em>\) five”</p>) +key(in)operator(:) string<delimiter(|-)content( + "one (two _three four_\) five")> +key(html)operator(:) string<delimiter(|-)content( + <p>“one (two <em>three four</em>\) five”</p>)> head<head(---)> key(name)operator(:) string(caps in parentheses) key(desc)operator(:) string(Uppercase words of three or more characters that are in parentheses should be recognized as well as those not in parentheses.) @@ -853,19 +853,19 @@ key(no_span_caps_html)operator(:) string(<p>IBM or (HAL\)</p>) head<head(---)> key(name)operator(:) string(phrase modifiers in parentheses) key(desc)operator(:) string(Inline modifiers are expected to work in parentheses as well.) -key(in)operator(:) string(|-) - string(__Amanita__s are mushrooms.) - string(Lungworts (__Lobaria__\) are lichens.) - string(Blah blah (normal text **bold**\) blah.) -key(html)operator(:) string(|-) - string(<p>__Amanita__s are mushrooms.<br />) - string(Lungworts (<i>Lobaria</i>\) are lichens.<br />) - string(Blah blah (normal text <b>bold</b>\) blah.</p>) +key(in)operator(:) string<delimiter(|-)content( + __Amanita__s are mushrooms. + Lungworts (__Lobaria__\) are lichens. + Blah blah (normal text **bold**\) blah.)> +key(html)operator(:) string<delimiter(|-)content( + <p>__Amanita__s are mushrooms.<br /> + Lungworts (<i>Lobaria</i>\) are lichens.<br /> + Blah blah (normal text <b>bold</b>\) blah.</p>)> head<head(---)> key(name)operator(:) string(square brackets are preserved) -key(in)operator(:) string(|-) - string(citation ["(Berk.\) Hilton"], see) - operator([)string(Papers "blah blah."]) -key(html)operator(:) string(|-) - string(<p>citation [“(Berk.\) Hilton”], see<br />) - operator([)string(Papers “blah blah.”]</p>)
\ No newline at end of file +key(in)operator(:) string<delimiter(|-)content( + citation ["(Berk.\) Hilton"], see + [Papers "blah blah."])> +key(html)operator(:) string<delimiter(|-)content( + <p>citation [“(Berk.\) Hilton”], see<br /> + [Papers “blah blah.”]</p>)>
\ No newline at end of file diff --git a/test/scanners/yaml/faq.expected.raydebug b/test/scanners/yaml/faq.expected.raydebug index 77b9b30..96af243 100644 --- a/test/scanners/yaml/faq.expected.raydebug +++ b/test/scanners/yaml/faq.expected.raydebug @@ -1,492 +1,492 @@ head<head(---)> operator(-) key<delimiter(")content(What is a...)delimiter(")>operator(:) - operator(-) key<delimiter(")content(container?)delimiter(")>operator(:) string(>-) - string(A _container_ is collection of service points and other containers. It) - string(is used to organize services. Each container has access to all of the) - string(service points in its ancestor containers.) - - operator(-) key<delimiter(")content(registry?)delimiter(")>operator(:) string(>-) - string(A _registry_ is a special kind of container that has no parent container.) - string(It also defines a few services (such as the LoggingInterceptor, and) - string(the various service models and pipeline elements\), so that they are) - string(available by default to all of the services it contains.) - - operator(-) key<delimiter(")content(service point?)delimiter(")>operator(:) string(>-) - string(A _service point_ is the definition of a service. Just as a class is the) - string(definition of an object, and you instantiate an object from a class, so) - string(do you instantiate services from service points.) - - operator(-) key<delimiter(")content(service?)delimiter(")>operator(:) string(>-) - string(A _service_ is the instantiation of a service point.) - - operator(-) key<delimiter(")content(parameterized service?)delimiter(")>operator(:) string(>-) - string(A _parameterized_ service is a service that allows contextual parameters) - string(to be passed to the service when it is created. Such services are) - string(typically used in conjunction with the @multiton@ service model, but) - string(the only real requirement is that they _not_ be used with a service model) - string(that does not support multiple parameters (like @singleton@ or) - string(@threaded@\).) - - operator(-) key<delimiter(")content(service model?)delimiter(")>operator(:) string(>-) - string(A _service model_ is a description of the lifecycle of a service. By) - string(default, all services are _singletons_, meaning that every time you ask) - string(a container for a particular service, you'll get the same object) - string(instance back.) - - - string(There are other service models available, though, including "prototype") - string((which returns a new instance for each request of a service\) and) - string("deferred" (which returns a proxy, deferring the instatiation of the) - string(service itself until a method is invoked on the service\). ) - - operator(-) key<delimiter(")content(interceptor?)delimiter(")>operator(:) string(>-) - string(An _interceptor_ is an object that may be placed between the client and) - string(a service. Every request to the service is thus _intercepted_ by that) - string(object, which can do operations on the request (such as logging\) and may) - string(even reroute or ignore the request altogether. This provides a kind of) - string("poor man's AOP", since you can do "before", "after", and "around" advice) - string(on the methods of a service.) - - - string(Needle comes with one standard interceptor, the LoggingInterceptor. It) - string(will log a message on method entry and exit, and also when an exception) - string(is raised.) - - operator(-) key<delimiter(")content(pipeline?)delimiter(")>operator(:) string(>-) - string(In Needle, the _instantiation pipeline_ is used to control how and when) - string(services are instantiated. The _service models_ are implemented as) - string(pipelines.) - - - string(Just as the _interceptors_ are for hooking into method invocations, the) - string(pipelines are for hooking into service instantiations. Every time a) - string(service is requested, it's instantiation pipeline is executed. By) - string(choosing the appropriate kinds of pipeline elements, all of the available) - string(service models can be implemented (prototype, prototype_deferred,) - string(singleton, singleton_deferred, etc.\).) + operator(-) key<delimiter(")content(container?)delimiter(")>operator(:) string<delimiter(>-)content( + A _container_ is collection of service points and other containers. It + is used to organize services. Each container has access to all of the + service points in its ancestor containers.)> + + operator(-) key<delimiter(")content(registry?)delimiter(")>operator(:) string<delimiter(>-)content( + A _registry_ is a special kind of container that has no parent container. + It also defines a few services (such as the LoggingInterceptor, and + the various service models and pipeline elements\), so that they are + available by default to all of the services it contains.)> + + operator(-) key<delimiter(")content(service point?)delimiter(")>operator(:) string<delimiter(>-)content( + A _service point_ is the definition of a service. Just as a class is the + definition of an object, and you instantiate an object from a class, so + do you instantiate services from service points.)> + + operator(-) key<delimiter(")content(service?)delimiter(")>operator(:) string<delimiter(>-)content( + A _service_ is the instantiation of a service point.)> + + operator(-) key<delimiter(")content(parameterized service?)delimiter(")>operator(:) string<delimiter(>-)content( + A _parameterized_ service is a service that allows contextual parameters + to be passed to the service when it is created. Such services are + typically used in conjunction with the @multiton@ service model, but + the only real requirement is that they _not_ be used with a service model + that does not support multiple parameters (like @singleton@ or + @threaded@\).)> + + operator(-) key<delimiter(")content(service model?)delimiter(")>operator(:) string<delimiter(>-)content( + A _service model_ is a description of the lifecycle of a service. By + default, all services are _singletons_, meaning that every time you ask + a container for a particular service, you'll get the same object + instance back. + + + There are other service models available, though, including "prototype" + (which returns a new instance for each request of a service\) and + "deferred" (which returns a proxy, deferring the instatiation of the + service itself until a method is invoked on the service\). )> + + operator(-) key<delimiter(")content(interceptor?)delimiter(")>operator(:) string<delimiter(>-)content( + An _interceptor_ is an object that may be placed between the client and + a service. Every request to the service is thus _intercepted_ by that + object, which can do operations on the request (such as logging\) and may + even reroute or ignore the request altogether. This provides a kind of + "poor man's AOP", since you can do "before", "after", and "around" advice + on the methods of a service. + + + Needle comes with one standard interceptor, the LoggingInterceptor. It + will log a message on method entry and exit, and also when an exception + is raised.)> + + operator(-) key<delimiter(")content(pipeline?)delimiter(")>operator(:) string<delimiter(>-)content( + In Needle, the _instantiation pipeline_ is used to control how and when + services are instantiated. The _service models_ are implemented as + pipelines. + + + Just as the _interceptors_ are for hooking into method invocations, the + pipelines are for hooking into service instantiations. Every time a + service is requested, it's instantiation pipeline is executed. By + choosing the appropriate kinds of pipeline elements, all of the available + service models can be implemented (prototype, prototype_deferred, + singleton, singleton_deferred, etc.\).)> operator(-) key<delimiter(")content(How do I...)delimiter(")>operator(:) - operator(-) key<delimiter(")content(create a new registry?)delimiter(")>operator(:) string(>-) - string(There are several ways to create a new registry. The simplist is just to) - string(invoke Registry#new.) + operator(-) key<delimiter(")content(create a new registry?)delimiter(")>operator(:) string<delimiter(>-)content( + There are several ways to create a new registry. The simplist is just to + invoke Registry#new. - string(<pre>) - string(reg = Needle::Registry.new) - string(</pre>) + <pre> + reg = Needle::Registry.new + </pre> - string(This will create a new Registry instance. You can also send a block to) - comment(#new, in which case the new registry will be yielded to it:) + This will create a new Registry instance. You can also send a block to + #new, in which case the new registry will be yielded to it: - string(<pre>) - string(reg = Needle::Registry.new do |r|) - string(...) - string(end) - string(</pre>) + <pre> + reg = Needle::Registry.new do |r| + ... + end + </pre> - string(There are two other factory methods you can use for creating a Registry) - string(instance. Both require a block.) + There are two other factory methods you can use for creating a Registry + instance. Both require a block. - string(<pre>) - string(r1 = Needle::Registry.define do |builder|) - string(...) - string(end) + <pre> + r1 = Needle::Registry.define do |builder| + ... + end - string(r2 = Needle::Registry.define! do) - string(...) - string(end) - string(</pre>) + r2 = Needle::Registry.define! do + ... + end + </pre> - string(Registry#define creates a "builder" object that you can use define) - string(services more conveniently. Register#define! (with a bang\) does the same) - string(thing, but evaluates the block within the context of the builder.) + Registry#define creates a "builder" object that you can use define + services more conveniently. Register#define! (with a bang\) does the same + thing, but evaluates the block within the context of the builder.)> - operator(-) key<delimiter(")content(register a service?)delimiter(")>operator(:) string(>-) - string(The first way to register a service is by calling #register on the) - key(registry (or a namespace\))operator(:) + operator(-) key<delimiter(")content(register a service?)delimiter(")>operator(:) string<delimiter(>-)content( + The first way to register a service is by calling #register on the + registry (or a namespace\): - string(<pre>) - string(reg.register( :foo \) { Foo.new }) - string(</pre>) + <pre> + reg.register( :foo \) { Foo.new } + </pre> - string(The (first\) parameter to #register is the name of the service, and the) - string(block should return the implementation of the service. If needed, the) - string(block can accept two parameters--the container that the service is being) - string(registered with, and an object that represents the service being defined) - string((called a "service point"\):) + The (first\) parameter to #register is the name of the service, and the + block should return the implementation of the service. If needed, the + block can accept two parameters--the container that the service is being + registered with, and an object that represents the service being defined + (called a "service point"\): - string(<pre>) - string(reg.register( :foo \) do |container,point|) - string(Foo.new( container[:bar], point.fullname \)) - string(end) - string(</pre>) + <pre> + reg.register( :foo \) do |container,point| + Foo.new( container[:bar], point.fullname \) + end + </pre> - string(You can also use Container#define and Container#define! to register) - string(services. These approaches are friendlier if you are needing to register) - string(several services at once.) + You can also use Container#define and Container#define! to register + services. These approaches are friendlier if you are needing to register + several services at once. - string(<pre>) - string(reg.define do |builder|) - string(builder.foo { Foo.new }) - string(builder.bar { |c,p| Bar.new( c[:foo], p.name \) }) - string(end) + <pre> + reg.define do |builder| + builder.foo { Foo.new } + builder.bar { |c,p| Bar.new( c[:foo], p.name \) } + end - string(reg.define! do) - string(baz { |c,p| Baz.new( c[:bar], p.name \) }) - string(zoom { Buggy.new }) - string(end) - string(</pre>) + reg.define! do + baz { |c,p| Baz.new( c[:bar], p.name \) } + zoom { Buggy.new } + end + </pre> - string(Container#define yields a new "builder" object to the block. Messages) - string(sent to the builder are interpreted as service names, and if a block is) - string(sent with the message, a new service is registered under that name.) + Container#define yields a new "builder" object to the block. Messages + sent to the builder are interpreted as service names, and if a block is + sent with the message, a new service is registered under that name. - string(Container#define! does likewise, except it evaluates the block within the) - string(context of the builder object.) + Container#define! does likewise, except it evaluates the block within the + context of the builder object. - string(If you do not pass a block to #define, it will return the builder object,) - string(so you could do something like the following if you only need to define) - key(one or two services)operator(:) + If you do not pass a block to #define, it will return the builder object, + so you could do something like the following if you only need to define + one or two services: - string(<pre>) - string(reg.define.foo { ... }) - string(</pre>) + <pre> + reg.define.foo { ... } + </pre> - string(Lastly, you can get the builder directly and add services using it:) + Lastly, you can get the builder directly and add services using it: - string(<pre>) - string(builder = reg.builder) - string(builder.baz { ... }) - string(builder.bar { ... }) - string(</pre>) + <pre> + builder = reg.builder + builder.baz { ... } + builder.bar { ... } + </pre> - string((This last is the same as calling #define without arguments, but is more) - string(readable if you intend to use the builder object multiple times.\)) - - operator(-) key<delimiter(")content(reference a service?)delimiter(")>operator(:) string(>-) - string(Referencing a service can be done in either of two ways. The first is to) - string(treat the container (i.e., registry\) as a hash, passing the name of the) - string(service as an argument to Container#[]:) + (This last is the same as calling #define without arguments, but is more + readable if you intend to use the builder object multiple times.\) + )> + operator(-) key<delimiter(")content(reference a service?)delimiter(")>operator(:) string<delimiter(>-)content( + Referencing a service can be done in either of two ways. The first is to + treat the container (i.e., registry\) as a hash, passing the name of the + service as an argument to Container#[]: - string(<pre>) - string(svc = registry[:foo]) - string(svc.do_something_interesting) - string(</pre>) + <pre> + svc = registry[:foo] + svc.do_something_interesting + </pre> - string(A more convenient (but slightly more peril-fraught\) approach is to send) - key(the name of the method to the registry as a message)operator(:) + A more convenient (but slightly more peril-fraught\) approach is to send + the name of the method to the registry as a message: - string(<pre>) - string(svc = registry.foo) - string(</pre>) + <pre> + svc = registry.foo + </pre> - string(Be aware that this latter approach will only work when the service name) - string(does not conflict with the name of an existing method on the container.) - string(For example, if you were to do:) + Be aware that this latter approach will only work when the service name + does not conflict with the name of an existing method on the container. + For example, if you were to do: - string(<pre>) - string(registry.register( :hash \) { "hello, world" }) - string(p registry.hash) - string(</pre>) + <pre> + registry.register( :hash \) { "hello, world" } + p registry.hash + </pre> - string(You would get the hash value of the registry object, instead of the value) - string(value of the service (which would be "hello, world"\).) + You would get the hash value of the registry object, instead of the value + value of the service (which would be "hello, world"\).)> - operator(-) key<delimiter(")content(select a service model for a service (i.e., change the default model of lifecycle management\)?)delimiter(")>operator(:) string(>-) - string(By default, a service will be managed as a singleton, i.e., every request) - string(of that service will return the same object instance. This is the) - string(_singleton_ service model.) + operator(-) key<delimiter(")content(select a service model for a service (i.e., change the default model of lifecycle management\)?)delimiter(")>operator(:) string<delimiter(>-)content( + By default, a service will be managed as a singleton, i.e., every request + of that service will return the same object instance. This is the + _singleton_ service model. - string(To select a different service model, pass it as an option when you) - key(register the service)operator(:) + To select a different service model, pass it as an option when you + register the service: - string(<pre>) - string(registry.register( :foo, :model => :prototype \) {...}) - string(registry.define.bar( :model => :threaded \) {...}) - string(registry.define! do) - string(baz( :model => :singleton_deferred \) {...}) - string(...) - string(end) - string(...) - string(</pre>) + <pre> + registry.register( :foo, :model => :prototype \) {...} + registry.define.bar( :model => :threaded \) {...} + registry.define! do + baz( :model => :singleton_deferred \) {...} + ... + end + ... + </pre>)> - operator(-) key<delimiter(")content(create a namespace?)delimiter(")>operator(:) string(>-) - string(Namespaces allow you to organize your services into hierarchical) - string(packages. You can create namespaces in a few ways. The first (and) - string(simplest\) is to just call Container#namespace:) + operator(-) key<delimiter(")content(create a namespace?)delimiter(")>operator(:) string<delimiter(>-)content( + Namespaces allow you to organize your services into hierarchical + packages. You can create namespaces in a few ways. The first (and + simplest\) is to just call Container#namespace: - string(<pre>) - string(registry.namespace( :stuff \)) - string(</pre>) + <pre> + registry.namespace( :stuff \) + </pre> - string(This will create a namespace in the registry, called stuff. If you send a) - string(block as well, the block will be invoked (with the new namespace yielded) - key(to it\) the first time the namespace is requested)operator(:) + This will create a namespace in the registry, called stuff. If you send a + block as well, the block will be invoked (with the new namespace yielded + to it\) the first time the namespace is requested: - string(<pre>) - string(registry.namespace( :stuff \) do |ns|) - string(ns.register( :foo \) {...}) - string(ns.define.bar {...}) - string(ns.define! do) - string(baz {...}) - string(buf {...}) - string(end) - string(end) - string(</pre>) + <pre> + registry.namespace( :stuff \) do |ns| + ns.register( :foo \) {...} + ns.define.bar {...} + ns.define! do + baz {...} + buf {...} + end + end + </pre> - string(Because it is so common to immediately define services on the new) - string(namespace, there are some convenience methods to make this more...) - string(convenient.) + Because it is so common to immediately define services on the new + namespace, there are some convenience methods to make this more... + convenient. - string(<pre>) - string(registry.namespace_define!( :stuff \) do) - string(foo {...}) - string(bar {...}) - string(baz {...}) - string(end) + <pre> + registry.namespace_define!( :stuff \) do + foo {...} + bar {...} + baz {...} + end - string(registry.namespace_define( :more_stuff \) do |b|) - string(b.blah {...}) - string(b.argh {...}) - string(b.hack {...}) - string(end) - string(</pre>) + registry.namespace_define( :more_stuff \) do |b| + b.blah {...} + b.argh {...} + b.hack {...} + end + </pre> - string(The first one, above, creates the namespace and calls Container#define!.) - string(The second creates the namespace and calls Container#define. In both) - string(cases, _the namespace is created immediately_, unlike Container#namespace) - string(which only creates the namespace when it is first requested.) + The first one, above, creates the namespace and calls Container#define!. + The second creates the namespace and calls Container#define. In both + cases, _the namespace is created immediately_, unlike Container#namespace + which only creates the namespace when it is first requested. - string(Lastly, note that namespace's are just special services. Thus, you can) - string(pass options to the namespace methods just as you can with) - string(Container#register and friends.) + Lastly, note that namespace's are just special services. Thus, you can + pass options to the namespace methods just as you can with + Container#register and friends.)> - operator(-) key<delimiter(")content(write log messages?)delimiter(")>operator(:) string(>-) - string(You can obtain a new logger instance from the @:logs@ and @:log_for@) - string(services. Once you have a logger instance, you can invoke the #debug,) - comment(#info, #warn, #error, and #fatal methods on the instance to log messages) - string(of the corresponding severity.) + operator(-) key<delimiter(")content(write log messages?)delimiter(")>operator(:) string<delimiter(>-)content( + You can obtain a new logger instance from the @:logs@ and @:log_for@ + services. Once you have a logger instance, you can invoke the #debug, + #info, #warn, #error, and #fatal methods on the instance to log messages + of the corresponding severity. - string(<pre>) - string(logger = registry.logs.get( "a name for my logger" \)) - string(logger.debug "This is a debug message") - string(logger.info "This is an informational message") - string(...) - string(logger2 = registry.log_for( "another logger name" \)) - string(...) - string(</pre>) + <pre> + logger = registry.logs.get( "a name for my logger" \) + logger.debug "This is a debug message" + logger.info "This is an informational message" + ... + logger2 = registry.log_for( "another logger name" \) + ... + </pre> - string(The two approaches shown above are identical--the second approach (using) - string(the @log_for@ service\) is just a convenience for @logs.get@.) + The two approaches shown above are identical--the second approach (using + the @log_for@ service\) is just a convenience for @logs.get@. - string(Log messages are written, by default, to a file called "needle.log", in) - string(the same directory that the application was invoked from.) + Log messages are written, by default, to a file called "needle.log", in + the same directory that the application was invoked from. - string(You can also use a logging interceptor to automatically log all external) - string(method invocations on a service. This includes method entry and exit, as) - string(well as any exceptions that are raised inside the method.) + You can also use a logging interceptor to automatically log all external + method invocations on a service. This includes method entry and exit, as + well as any exceptions that are raised inside the method. - string(<pre>) - string(registry.register( :foo \) { ... }) - string(registry.intercept( :foo \).with { |r| r.logging_interceptor }) + <pre> + registry.register( :foo \) { ... } + registry.intercept( :foo \).with { |r| r.logging_interceptor } - string(foo.something) - string(foo.another_method( 1, 2, 3 \)) - string(</pre>) + foo.something + foo.another_method( 1, 2, 3 \) + </pre> - string(See the chapter in the "User's Manual":http://needle.rubyforge.org about) - string(logging for more information on how to use and configure loggers.) + See the chapter in the "User's Manual":http://needle.rubyforge.org about + logging for more information on how to use and configure loggers.)> - operator(-) key<delimiter(")content(exclude methods from being intercepted?)delimiter(")>operator(:) string(>-) - string(Only interceptors that explicitly support exclusion of methods can help) - string(you here. Fortunately, the LoggingInterceptor is one of them. (If you) - string(write your own interceptor and would like similar functionality, see the) - string(IncludeExclude module.\)) + operator(-) key<delimiter(")content(exclude methods from being intercepted?)delimiter(")>operator(:) string<delimiter(>-)content( + Only interceptors that explicitly support exclusion of methods can help + you here. Fortunately, the LoggingInterceptor is one of them. (If you + write your own interceptor and would like similar functionality, see the + IncludeExclude module.\) - string(In the case of the LoggingInterceptor, just pass an array of patterns) - string((matching method names and/or arities\) as the "exclude" option, when) - key(declaring the interceptor)operator(:) + In the case of the LoggingInterceptor, just pass an array of patterns + (matching method names and/or arities\) as the "exclude" option, when + declaring the interceptor: - string(<pre>) - string(registry.register( :foo \) { ... }) - string(registry.intercept( :foo \).) - string(with { |r| r.logging_interceptor }.) - string(with_options :exclude => [ 'foo', 'bar(>4\)', '*(<2\)' ]) - string(</pre>) + <pre> + registry.register( :foo \) { ... } + registry.intercept( :foo \). + with { |r| r.logging_interceptor }. + with_options :exclude => [ 'foo', 'bar(>4\)', '*(<2\)' ] + </pre> - string(The above will exclude from interception any method named 'foo', or any) - string(invocation of 'bar' with more than 4 arguments, or any method invocation) - string(with fewer than two arguments.) + The above will exclude from interception any method named 'foo', or any + invocation of 'bar' with more than 4 arguments, or any method invocation + with fewer than two arguments. - string(You can also give an array of patterns to _include_. These cause methods) - key(to be explicitly intercepted even if they match an exclude pattern)operator(:) + You can also give an array of patterns to _include_. These cause methods + to be explicitly intercepted even if they match an exclude pattern: - string(<pre>) - string(registry.register( :foo \) { ... }) - string(registry.intercept( :foo \).) - string(with { |r| r.logging_interceptor }.) - string(with_options :exclude => [ 'foo', 'bar(>4\)', '*(<2\)' ],) - symbol(:include) string(=> [ 'baz' ]) + <pre> + registry.register( :foo \) { ... } + registry.intercept( :foo \). + with { |r| r.logging_interceptor }. + with_options :exclude => [ 'foo', 'bar(>4\)', '*(<2\)' ], + :include => [ 'baz' ] - string(foo = registry.foo) - string(foo.baz) - string(</pre>) + foo = registry.foo + foo.baz + </pre> - string(This would result in the call to #baz being intercepted, even though it) - string(matches an exclude pattern (@*(<2\)@\).) + This would result in the call to #baz being intercepted, even though it + matches an exclude pattern (@*(<2\)@\).)> - operator(-) key<delimiter(")content(include services defined in another library?)delimiter(")>operator(:) string(>-) - string(This requires that the other library be implemented in such a way that it) - string(expects to be "included" by other libraries/applications. For example,) - string(Needle encourages the use of a method called @register_services@, which) - key(accepts a container as a parameter)operator(:) + operator(-) key<delimiter(")content(include services defined in another library?)delimiter(")>operator(:) string<delimiter(>-)content( + This requires that the other library be implemented in such a way that it + expects to be "included" by other libraries/applications. For example, + Needle encourages the use of a method called @register_services@, which + accepts a container as a parameter: - string(<pre>) - string(module A) - string(module B) - string(def register_services( container \)) - string(...) - string(end) - string(module_function :register_services) - string(end) - string(end) - string(</pre>) + <pre> + module A + module B + def register_services( container \) + ... + end + module_function :register_services + end + end + </pre> - string(If the library has been implemented in this way, you can simply do a) - string(require of the library and then invoke the @register_services@ method.) + If the library has been implemented in this way, you can simply do a + require of the library and then invoke the @register_services@ method. - string(There is a convenience method in Container for doing this. Just call) - string(Container#require, passing the file to require and a string (or symbol\)) - string(identifying the name of the module that contains the registration method.) - string(You can also pass a symbol as the third parameter naming the registration) - string(method, but it defaults to @:register_services@.) + There is a convenience method in Container for doing this. Just call + Container#require, passing the file to require and a string (or symbol\) + identifying the name of the module that contains the registration method. + You can also pass a symbol as the third parameter naming the registration + method, but it defaults to @:register_services@. - string(<pre>) - string(require 'a/b') - string(A::B.register_services( container \)) + <pre> + require 'a/b' + A::B.register_services( container \) - comment(# or) + # or - string(container.require( 'a/b', "A::B" \)) - string(</pre>) + container.require( 'a/b', "A::B" \) + </pre> - string(The definition context (i.e., the "builder" object\) also supports the) - string(require method, so you can do:) + The definition context (i.e., the "builder" object\) also supports the + require method, so you can do: - string(<pre>) - string(container.define do |b|) - string(b.require "a/b", "A::B") - string(b.foo { ... }) - string(...) - string(end) - string(</pre>) + <pre> + container.define do |b| + b.require "a/b", "A::B" + b.foo { ... } + ... + end + </pre>)> operator(-) key<delimiter(")content(When should I...)delimiter(")>operator(:) operator(-) key<delimiter(")content(use a different service model?)delimiter(")>operator(:) - operator(-) key<delimiter(")content(Like, :prototype?)delimiter(")>operator(:) string(>-) - key(The prototype service model is appropriate when the service)operator(:) + operator(-) key<delimiter(")content(Like, :prototype?)delimiter(")>operator(:) string<delimiter(>-)content( + The prototype service model is appropriate when the service: - string(* has internal state) + * has internal state - string(* will be used multiple times for different situations) + * will be used multiple times for different situations - string(For example, if you have a GUI library, a "button" service could be a) - string(prototype, because you will likely have many buttons in an application,) - string(with each button being an independent instance.) + For example, if you have a GUI library, a "button" service could be a + prototype, because you will likely have many buttons in an application, + with each button being an independent instance.)> - operator(-) key<delimiter(")content(Like, :singleton?)delimiter(")>operator(:) string(>-) - string(The singleton service model is the default, so you should rarely need) - string(to explicitly specify it as a model. It is appropriate for services) - key(that)operator(:) - - - string(* guard some specific functionality) - - string(* represent state that is global across an application) - - operator(-) key<delimiter(")content(Like, :threaded?)delimiter(")>operator(:) string(>-) - string(Threaded is similar to singleton, but it allows one unique instance of) - string(the service _per thread_. Thus, it is appropriate to the same) - string(situations as singleton, but specific to a thread, instead of an) - string(application. This is useful for web applications that are run in a) - string(single virtual machine, and which share a single registry.) - - operator(-) key<delimiter(")content(Like, deferred?)delimiter(")>operator(:) string(>-) - string(Deferred models use a proxy to enforce lazy initialization of the) - string(service. A service using a deferred service model (ie,) - string(@:prototype_deferred@, @:multiton_deferred@, @:singleton_deferred@, or) - string(@:threaded_deferred@\) will not be instantiated until the first time a) - string(method is invoked on the service.) - - - string(This makes a deferred model appropriate when a service is expensive to) - string(instantiate, since you can wait to do the expensive initialization) - string(until it is really needed. Applications will start up faster when their) - string(dependences use deferred instantiation.) - - operator(-) key<delimiter(")content(Like, initialize?)delimiter(")>operator(:) string(>-) - string(This is useful when you have a method that you want to be invoked) - string(automatically after a service has been instantiated. Consider the case) - string(where a service is initialized primarily using setters, but requires) - string(some logic to be executed to complete the initialization phase. In this) - string(case, you could always explicitly invoke the initialization method(s\)) - string(in the constructor block, but if many services use the same) - string(initialization method, it can be more convenient to use an "initialize") - string(service model.) - - operator(-) key<delimiter(")content(Like, multiton?)delimiter(")>operator(:) string(>-) - string(Multitons are useful for factories, where you have a class that) - string(differentiates its instances based on some construction parameters that) - string(need to be determined at runtime. Thus, multitons are always used with) - string(parameterized services.) + operator(-) key<delimiter(")content(Like, :singleton?)delimiter(")>operator(:) string<delimiter(>-)content( + The singleton service model is the default, so you should rarely need + to explicitly specify it as a model. It is appropriate for services + that: + + + * guard some specific functionality + + * represent state that is global across an application)> + + operator(-) key<delimiter(")content(Like, :threaded?)delimiter(")>operator(:) string<delimiter(>-)content( + Threaded is similar to singleton, but it allows one unique instance of + the service _per thread_. Thus, it is appropriate to the same + situations as singleton, but specific to a thread, instead of an + application. This is useful for web applications that are run in a + single virtual machine, and which share a single registry.)> + + operator(-) key<delimiter(")content(Like, deferred?)delimiter(")>operator(:) string<delimiter(>-)content( + Deferred models use a proxy to enforce lazy initialization of the + service. A service using a deferred service model (ie, + @:prototype_deferred@, @:multiton_deferred@, @:singleton_deferred@, or + @:threaded_deferred@\) will not be instantiated until the first time a + method is invoked on the service. + + + This makes a deferred model appropriate when a service is expensive to + instantiate, since you can wait to do the expensive initialization + until it is really needed. Applications will start up faster when their + dependences use deferred instantiation.)> + + operator(-) key<delimiter(")content(Like, initialize?)delimiter(")>operator(:) string<delimiter(>-)content( + This is useful when you have a method that you want to be invoked + automatically after a service has been instantiated. Consider the case + where a service is initialized primarily using setters, but requires + some logic to be executed to complete the initialization phase. In this + case, you could always explicitly invoke the initialization method(s\) + in the constructor block, but if many services use the same + initialization method, it can be more convenient to use an "initialize" + service model.)> + + operator(-) key<delimiter(")content(Like, multiton?)delimiter(")>operator(:) string<delimiter(>-)content( + Multitons are useful for factories, where you have a class that + differentiates its instances based on some construction parameters that + need to be determined at runtime. Thus, multitons are always used with + parameterized services.)> diff --git a/test/scanners/yaml/multiline.expected.raydebug b/test/scanners/yaml/multiline.expected.raydebug new file mode 100644 index 0000000..cf5a987 --- /dev/null +++ b/test/scanners/yaml/multiline.expected.raydebug @@ -0,0 +1,21 @@ +head<head(---)> +key(What It Is)operator(:) string(YAML is a human friendly data serialization)string( + standard for all programming languages.) +head<head(---)> +key(What It Is)operator(:) string(YAML is a human friendly data serialization)string( + standard for all programming languages.) +head<head(---)> +key(What It Is)operator(:) string(YAML is a human friendly data serialization) +error(standard for all programming languages.) +head<head(---)> +operator(-) string(What It Is: YAML is a human friendly data serialization)string( + standard for all programming languages.) +head<head(---)> +operator(-) string(What It Is: YAML is a human friendly data serialization)string( + standard for all programming languages.) +head<head(---)> +operator(-) string(What It Is: YAML is a human friendly data serialization) + error(standard for all programming languages.) +head<head(---)> +operator(-) string(What It Is: YAML is a human friendly data serialization) +error(standard for all programming languages.) diff --git a/test/scanners/yaml/multiline.in.yml b/test/scanners/yaml/multiline.in.yml new file mode 100644 index 0000000..83c0867 --- /dev/null +++ b/test/scanners/yaml/multiline.in.yml @@ -0,0 +1,21 @@ +--- +What It Is: YAML is a human friendly data serialization + standard for all programming languages. +--- +What It Is: YAML is a human friendly data serialization + standard for all programming languages. +--- +What It Is: YAML is a human friendly data serialization +standard for all programming languages. +--- +- What It Is: YAML is a human friendly data serialization + standard for all programming languages. +--- +- What It Is: YAML is a human friendly data serialization + standard for all programming languages. +--- +- What It Is: YAML is a human friendly data serialization + standard for all programming languages. +--- +- What It Is: YAML is a human friendly data serialization +standard for all programming languages. diff --git a/test/scanners/yaml/threshold.expected.raydebug b/test/scanners/yaml/threshold.expected.raydebug index 55a33e4..7ad0e65 100644 --- a/test/scanners/yaml/threshold.expected.raydebug +++ b/test/scanners/yaml/threshold.expected.raydebug @@ -1,22 +1,22 @@ head<head(---)> comment(# From http://thresholdstate.com/articles/4312/the-textile-reference-manual) key(name)operator(:) string(paragraph) key(desc)operator(:) string(Paragraphs are separated by blank lines. Each paragraph of text is transformed into a XHTML <p> paragraph block.) -key(in)operator(:) string(|-) - string(A paragraph.) +key(in)operator(:) string<delimiter(|-)content( + A paragraph. - string(Another paragraph.) -key(html)operator(:) string(|-) - string(<p>A paragraph.</p>) - string(<p>Another paragraph.</p>) + Another paragraph.)> +key(html)operator(:) string<delimiter(|-)content( + <p>A paragraph.</p> + <p>Another paragraph.</p>)> head<head(---)> key(name)operator(:) string(line breaks) key(desc)operator(:) string(Line breaks within paragraphs are transformed into XHTML line breaks.) -key(in)operator(:) string(|-) - string(A paragraph with) - string(a line break.) -key(html)operator(:) string(|-) - string(<p>A paragraph with<br />) - string(a line break.</p>) +key(in)operator(:) string<delimiter(|-)content( + A paragraph with + a line break.)> +key(html)operator(:) string<delimiter(|-)content( + <p>A paragraph with<br /> + a line break.</p>)> head<head(---)> key(name)operator(:) string(xhtml tags) key(desc)operator(:) string(Simple XHTML tags may be included in a paragraph.) @@ -40,16 +40,16 @@ key(html)operator(:) string<delimiter(")content(<p>‘Proceed!’ said h head<head(---)> key(name)operator(:) string(nested quotation marks) key(desc)operator(:) string(Single and double quotation marks may be nested one inside the other.) -key(in)operator(:) string(|-) - string("'I swear, captain,' replied I.") -key(html)operator(:) string(|-) - string(<p>“‘I swear, captain,’ replied I.”</p>) +key(in)operator(:) string<delimiter(|-)content( + "'I swear, captain,' replied I.")> +key(html)operator(:) string<delimiter(|-)content( + <p>“‘I swear, captain,’ replied I.”</p>)> head<head(---)> key(name)operator(:) string(nested quotation marks 2) -key(in)operator(:) string(|-) - string('"I swear, captain," replied I.') -key(html)operator(:) string(|-) - string(<p>‘“I swear, captain,” replied I.’</p>) +key(in)operator(:) string<delimiter(|-)content( + '"I swear, captain," replied I.')> +key(html)operator(:) string<delimiter(|-)content( + <p>‘“I swear, captain,” replied I.’</p>)> head<head(---)> key(name)operator(:) string(apostrophe glyphs) key(desc)operator(:) string(Single quotation marks ' will be turned into apostrophe glyphs when used as such.) @@ -168,14 +168,14 @@ key(html)operator(:) string(<p><a href="http://example.com/" title="with title"> head<head(---)> key(name)operator(:) string(link alias) key(desc)operator(:) string(For frequent linking to a single URL, you can specify a link alias with [] square brackets.) -key(in)operator(:) string(|-) - string(Here's "a link":tstate, and) - string("another link":tstate to the same site.) +key(in)operator(:) string<delimiter(|-)content( + Here's "a link":tstate, and + "another link":tstate to the same site. - operator([)string(tstate]http://thresholdstate.com/) -key(html)operator(:) string(|-) - string(<p>Here’s <a href="http://thresholdstate.com/">a link</a>, and<br />) - string(<a href="http://thresholdstate.com/">another link</a> to the same site.</p>) + [tstate]http://thresholdstate.com/)> +key(html)operator(:) string<delimiter(|-)content( + <p>Here’s <a href="http://thresholdstate.com/">a link</a>, and<br /> + <a href="http://thresholdstate.com/">another link</a> to the same site.</p>)> head<head(---)> key(name)operator(:) string(image) key(desc)operator(:) string(Use ! exclamation marks to insert an image tag.) @@ -211,47 +211,47 @@ key(html)operator(:) string(<h6>Heading 6</h6>) head<head(---)> key(name)operator(:) string(paragraph text) key(desc)operator(:) string<delimiter(")content(Paragraph p text is represented by p.. This is the default block type: any paragraph without a block modifier will automatically be enclosed with p tags.)delimiter(")> -key(in)operator(:) string(|-) - string(p. A paragraph.) - string(Continued.) +key(in)operator(:) string<delimiter(|-)content( + p. A paragraph. + Continued. - string(Also a paragraph.) -key(html)operator(:) string(|-) - string(<p>A paragraph.<br />) - string(Continued.</p>) - string(<p>Also a paragraph.</p>) + Also a paragraph.)> +key(html)operator(:) string<delimiter(|-)content( + <p>A paragraph.<br /> + Continued.</p> + <p>Also a paragraph.</p>)> head<head(---)> key(name)operator(:) string(block quote) key(desc)operator(:) string(bq. indicates a quoted block of text.) -key(in)operator(:) string(|-) - string(bq. A quotation.) - string(Continued.) +key(in)operator(:) string<delimiter(|-)content( + bq. A quotation. + Continued. - string(Regular paragraph.) -key(html)operator(:) string(|-) - string(<blockquote>) - string(<p>A quotation.<br />) - string(Continued.</p>) - string(</blockquote>) - string(<p>Regular paragraph.</p>) + Regular paragraph.)> +key(html)operator(:) string<delimiter(|-)content( + <blockquote> + <p>A quotation.<br /> + Continued.</p> + </blockquote> + <p>Regular paragraph.</p>)> head<head(---)> key(name)operator(:) string(block quote citation) key(desc)operator(:) string(Block quotes may include a citation URL immediately following the period.) key(in)operator(:) string(bq.:http://thresholdstate.com/ A cited quotation.) -key(html)operator(:) string(|-) - string(<blockquote cite="http://thresholdstate.com/">) - string(<p>A cited quotation.</p>) - string(</blockquote>) +key(html)operator(:) string<delimiter(|-)content( + <blockquote cite="http://thresholdstate.com/"> + <p>A cited quotation.</p> + </blockquote>)> head<head(---)> key(name)operator(:) string(footnotes) key(desc)operator(:) string(Footnotes are represented by the fn1., fn2., … block modifiers.) -key(in)operator(:) string(|-) - string(A footnote reference[1].) +key(in)operator(:) string<delimiter(|-)content( + A footnote reference[1]. - string(fn1. The footnote.) -key(html)operator(:) string(|-) - string(<p>A footnote reference<sup class="footnote"><a href="#fn1">1</a></sup>.</p>) - string(<p class="footnote" id="fn1"><sup>1</sup> The footnote.</p>) + fn1. The footnote.)> +key(html)operator(:) string<delimiter(|-)content( + <p>A footnote reference<sup class="footnote"><a href="#fn1">1</a></sup>.</p> + <p class="footnote" id="fn1"><sup>1</sup> The footnote.</p>)> comment(# html: |-) comment(# <p>A footnote reference<sup class="footnote"><a href="#fn1216642796463b1223ae29d">1</a></sup>.</p>) comment(# <p class="footnote" id="fn1216642796463b1223ae29d"><sup>1</sup> The footnote.</p>) @@ -259,39 +259,39 @@ head<head(---)> key(name)operator(:) string(block code) key(desc)operator(:) string(Code such as XHTML, Javascript or PHP may be displayed using the bc. “block code” modifier. XHTML significant characters such as < and > will be escaped within code blocks – bc is used for displaying code to the reader, not for executing it.) key(note)operator(:) string(Note that Textile will interpret any blank lines within the code as indicating the end of the code block. See Extended Blocks below for an explanation of how to display longer blocks of code.) -key(in)operator(:) string(|-) - string(bc. <script>) - string(// a Javascript example) - string(alert("Hello World"\);) - string(</script>) -key(html)operator(:) string(|-) - string(<pre><code><script>) - string(// a Javascript example) - string(alert("Hello World"\);) - variable(</script></code></pre>) +key(in)operator(:) string<delimiter(|-)content( + bc. <script> + // a Javascript example + alert("Hello World"\); + </script>)> +key(html)operator(:) string<delimiter(|-)content( + <pre><code><script> + // a Javascript example + alert("Hello World"\); + </script></code></pre>)> head<head(---)> key(name)operator(:) string(preformatted text) key(desc)operator(:) string(Use the pre. block modifier for pre-formatted text. XHTML significant characters within the block will be escaped.) key(note)operator(:) string(pre. is almost identical to bc., with the exception that <code>...</code> tags are not used within the <pre> block.) -key(in)operator(:) string(|-) - string(pre. Pre-formatted) - string(text) -key(html)operator(:) string(|-) - string(<pre>Pre-formatted) - string(text</pre>) +key(in)operator(:) string<delimiter(|-)content( + pre. Pre-formatted + text)> +key(html)operator(:) string<delimiter(|-)content( + <pre>Pre-formatted + text</pre>)> head<head(---)> key(name)operator(:) string(notextile) key(desc)operator(:) string(The notextile. block modifier applies no Textile processing at all to a block. Raw XHTML characters are passed through untouched, so this may be used to insert explicit XHTML markup, or execute Javascript or PHP code.) -key(in)operator(:) string(|-) - string(notextile. <script type="text/javascript">) - string(document.write("Hello World!"\);) - string(</script>) - string(<noscript>Your browser doesn't support Javascript</noscript>) -key(html)operator(:) string(|-) - string(<script type="text/javascript">) - string(document.write("Hello World!"\);) - string(</script>) - string(<noscript>Your browser doesn't support Javascript</noscript>) +key(in)operator(:) string<delimiter(|-)content( + notextile. <script type="text/javascript"> + document.write("Hello World!"\); + </script> + <noscript>Your browser doesn't support Javascript</noscript>)> +key(html)operator(:) string<delimiter(|-)content( + <script type="text/javascript"> + document.write("Hello World!"\); + </script> + <noscript>Your browser doesn't support Javascript</noscript>)> key(valid_html)operator(:) string(false) head<head(---)> key(name)operator(:) string(class attribute) @@ -338,81 +338,81 @@ key(html)operator(:) string(<p>A <cite style="color:green;" class="myclass" lang head<head(---)> key(name)operator(:) string(extended blocks) key(desc)operator(:) string(Normally a block modifier covers a single block of text, and ends at the first blank line. To extend a block over multiple paragraphs that include blank lines, use a block modifier with two period marks instead of one. To close the extended block, use a different block modifier on the next paragraph.) -key(in)operator(:) string(|-) - string(bq.. A quote.) +key(in)operator(:) string<delimiter(|-)content( + bq.. A quote. - string(The quote continued.) + The quote continued. - string(p. Back to paragraph text.) -key(html)operator(:) string(|-) - string(<blockquote>) - string(<p>A quote.</p>) - string(<p>The quote continued.</p>) - string(</blockquote>) - string(<p>Back to paragraph text.</p>) + p. Back to paragraph text.)> +key(html)operator(:) string<delimiter(|-)content( + <blockquote> + <p>A quote.</p> + <p>The quote continued.</p> + </blockquote> + <p>Back to paragraph text.</p>)> head<head(---)> key(name)operator(:) string(extended block code) key(desc)operator(:) string(Extended blocks are useful for displaying longer examples of code that contain blank lines.) -key(in)operator(:) string(|-) - string(A PHP code example.) +key(in)operator(:) string<delimiter(|-)content( + A PHP code example. - string(bc.. <?php) - string(function hello(\) {) - string(// display a hello message) + bc.. <?php + function hello(\) { + // display a hello message - string(print "Hello, World";) - operator(}) - string(?>) + print "Hello, World"; + } + ?> - string(p. Following paragraph.) -key(html)operator(:) string(|-) - string(<p>A <span class="caps">PHP</span> code example.</p>) - string(<pre><code><?php) - string(function hello(\) {) - string(// display a hello message</code>) + p. Following paragraph.)> +key(html)operator(:) string<delimiter(|-)content( + <p>A <span class="caps">PHP</span> code example.</p> + <pre><code><?php + function hello(\) { + // display a hello message</code> - string(<code>print "Hello, World";) - operator(}) - string(?></code>) + <code>print "Hello, World"; + } + ?></code> - string(</pre>) - string(<p>Following paragraph.</p>) + </pre> + <p>Following paragraph.</p>)> head<head(---)> key(name)operator(:) string(extended block attributes) key(desc)operator(:) string(Any block attributes on an extended block will be included on each following block.) -key(in)operator(:) string(|-) - string(p(myclass\).. A classy paragraph.) +key(in)operator(:) string<delimiter(|-)content( + p(myclass\).. A classy paragraph. - string(Another classy paragraph.) + Another classy paragraph. - string(p. Not so classy.) -key(html)operator(:) string(|-) - string(<p class="myclass">A classy paragraph.</p>) - string(<p class="myclass">Another classy paragraph.</p>) - string(<p>Not so classy.</p>) + p. Not so classy.)> +key(html)operator(:) string<delimiter(|-)content( + <p class="myclass">A classy paragraph.</p> + <p class="myclass">Another classy paragraph.</p> + <p>Not so classy.</p>)> head<head(---)> key(name)operator(:) string(extended block quote attributes) key(desc)operator(:) string(Attributes on bq.. extended blocks will be included on both the inner and outer blocks.) -key(in)operator(:) string(|-) - string(bq(myclass\).. Quote paragraph 1.) +key(in)operator(:) string<delimiter(|-)content( + bq(myclass\).. Quote paragraph 1. - string(Paragraph 2.) -key(html)operator(:) string(|-) - string(<blockquote class="myclass">) - string(<p class="myclass">Quote paragraph 1.</p>) - string(<p class="myclass">Paragraph 2.</p>) - string(</blockquote>) + Paragraph 2.)> +key(html)operator(:) string<delimiter(|-)content( + <blockquote class="myclass"> + <p class="myclass">Quote paragraph 1.</p> + <p class="myclass">Paragraph 2.</p> + </blockquote>)> head<head(---)> key(name)operator(:) string(extended block code attributes) key(desc)operator(:) string(Attributes on bc.. extended blocks will be included on both the inner and outer blocks.) -key(in)operator(:) string(|-) - string(bc(myclass\).. Code block 1.) +key(in)operator(:) string<delimiter(|-)content( + bc(myclass\).. Code block 1. - string(Code block 2.) -key(html)operator(:) string(|-) - string(<pre class="myclass"><code class="myclass">Code block 1.</code>) + Code block 2.)> +key(html)operator(:) string<delimiter(|-)content( + <pre class="myclass"><code class="myclass">Code block 1.</code> - string(<code class="myclass">Code block 2.</code></pre>) + <code class="myclass">Code block 2.</code></pre>)> head<head(---)> key(name)operator(:) string(raw xhtml left in tact) key(desc)operator(:) string(Raw XHTML tags are generally left untouched by Textile. Span tags that enclose only part of a block of text will be left intact, while the block itself is treated normally.) @@ -446,18 +446,18 @@ key(html)operator(:) string<delimiter(")content(<div>\\n<span>My div</span>\\n</ head<head(---)> key(name)operator(:) string(complex xhtml blocks 2) key(desc)operator(:) string(...or a notexile.. extended block.) -key(in)operator(:) string(|-) - string(notextile.. <div>) +key(in)operator(:) string<delimiter(|-)content( + notextile.. <div> - string(<span>My div</span>) + <span>My div</span> - string(</div>) -key(html)operator(:) string(|-) - string(<div>) + </div>)> +key(html)operator(:) string<delimiter(|-)content( + <div> - string(<span>My div</span>) + <span>My div</span> - string(</div>) + </div>)> head<head(---)> key(name)operator(:) string(complex xhtml blocks with inline formatting) key(desc)operator(:) string(Textile will not wrap lines that start with a space in paragraph tags, but it should parse inline signatures) @@ -466,36 +466,36 @@ key(html)operator(:) string<delimiter(")content(<div>\\n<span>My <strong>div</st head<head(---)> key(name)operator(:) string(explicit pre escapement) key(desc)operator(:) string(The contents of explicit <pre>...</pre> tags are escaped for display. ) -key(in)operator(:) string(|-) - string(<pre>) - string(A HTML <b>example</b>) - string(</pre>) -key(html)operator(:) string(|-) - string(<pre>) - string(A HTML <b>example</b>) - string(</pre>) +key(in)operator(:) string<delimiter(|-)content( + <pre> + A HTML <b>example</b> + </pre>)> +key(html)operator(:) string<delimiter(|-)content( + <pre> + A HTML <b>example</b> + </pre>)> key(note)operator(:) string(This syntax is supported for backwards compatibility only, and doesn’t always work as expected. The block modifier pre. should be used instead.) head<head(---)> key(name)operator(:) string(explicit code escapement) key(desc)operator(:) string(The contents of explicit <code>...</code> tags are escaped for display.) -key(in)operator(:) string(|-) - string(<code>) - string(Another HTML <b>example</b>) - string(</code>) -key(html)operator(:) string(|-) - string(<p><code>) - string(Another HTML <b>example</b>) - string(</code></p>) +key(in)operator(:) string<delimiter(|-)content( + <code> + Another HTML <b>example</b> + </code>)> +key(html)operator(:) string<delimiter(|-)content( + <p><code> + Another HTML <b>example</b> + </code></p>)> key(note)operator(:) string(This syntax is supported for backwards compatibility only, and doesn’t always work as expected. The block modifier bc. should be used instead.) head<head(---)> key(name)operator(:) string(notextile tags) key(desc)operator(:) string(Blocks enclosed by the pseudo tag <notextile>...</notextile> will be left untouched.) -key(in)operator(:) string(|-) - string(<notextile>) - string(p. Leave me alone) - string(</notextile>) -key(html)operator(:) string(|-) - string(p. Leave me alone) +key(in)operator(:) string<delimiter(|-)content( + <notextile> + p. Leave me alone + </notextile>)> +key(html)operator(:) string<delimiter(|-)content( + p. Leave me alone)> comment(# html: |-) comment(# <p>) comment(# p. Leave me alone) @@ -538,204 +538,204 @@ key(html)operator(:) string(<p style="padding-left:1em;padding-right:1em;">Left head<head(---)> key(name)operator(:) string(numeric lists) key(desc)operator(:) string(Numeric lists are represented by lines beginning with) comment(#.) -key(in)operator(:) string(|-) - comment(# Item one) - comment(# Item two) - comment(# Item three) -key(html)operator(:) string(|-) - string(<ol>) - string(<li>Item one</li>) - string(<li>Item two</li>) - string(<li>Item three</li>) - string(</ol>) +key(in)operator(:) string<delimiter(|-)content( + # Item one + # Item two + # Item three)> +key(html)operator(:) string<delimiter(|-)content( + <ol> + <li>Item one</li> + <li>Item two</li> + <li>Item three</li> + </ol>)> head<head(---)> key(name)operator(:) string(bulleted lists) key(desc)operator(:) string(Bulleted lists are represented by lines beginning with *.) -key(in)operator(:) string(|-) - string(* Item A) - string(* Item B) - string(* Item C) -key(html)operator(:) string(|-) - string(<ul>) - string(<li>Item A</li>) - string(<li>Item B</li>) - string(<li>Item C</li>) - string(</ul>) +key(in)operator(:) string<delimiter(|-)content( + * Item A + * Item B + * Item C)> +key(html)operator(:) string<delimiter(|-)content( + <ul> + <li>Item A</li> + <li>Item B</li> + <li>Item C</li> + </ul>)> head<head(---)> key(name)operator(:) string(list attributes) key(desc)operator(:) string(Attributes applied to the first list item will apply to the list itself.) -key(in)operator(:) string(|-) - string(*{color:red} Item one) - string(* Item two) - string(* Item three) -key(html)operator(:) string(|-) - string(<ul style="color:red;">) - string(<li>Item one</li>) - string(<li>Item two</li>) - string(<li>Item three</li>) - string(</ul>) +key(in)operator(:) string<delimiter(|-)content( + *{color:red} Item one + * Item two + * Item three)> +key(html)operator(:) string<delimiter(|-)content( + <ul style="color:red;"> + <li>Item one</li> + <li>Item two</li> + <li>Item three</li> + </ul>)> head<head(---)> key(name)operator(:) string(nested lists) key(desc)operator(:) string(Use multiple) comment(# or * symbols to create nested lists.) -key(in)operator(:) string(|-) - comment(# Item one) - comment(## Item one-A) - comment(## Item one-B) - comment(### Item one-B-a) - comment(# Item two) -key(html)operator(:) string(|-) - string(<ol>) - string(<li>Item one) - string(<ol>) - string(<li>Item one-A</li>) - string(<li>Item one-B) - string(<ol>) - string(<li>Item one-B-a</li>) - string(</ol></li>) - string(</ol></li>) - string(<li>Item two</li>) - string(</ol>) +key(in)operator(:) string<delimiter(|-)content( + # Item one + ## Item one-A + ## Item one-B + ### Item one-B-a + # Item two)> +key(html)operator(:) string<delimiter(|-)content( + <ol> + <li>Item one + <ol> + <li>Item one-A</li> + <li>Item one-B + <ol> + <li>Item one-B-a</li> + </ol></li> + </ol></li> + <li>Item two</li> + </ol>)> head<head(---)> key(name)operator(:) string(tables) key(desc)operator(:) string(Tables can be constructed using | “pipe” symbols to separate cells.) -key(in)operator(:) string(|a|simple|table|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td>a</td>) - string(<td>simple</td>) - string(<td>table</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|)>string(a|simple|table|) +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td>a</td> + <td>simple</td> + <td>table</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(table heading cells) key(desc)operator(:) string(Use _. to indicate table heading cells.) -key(in)operator(:) string(|-) - string(|_. a|_. table|_. heading|) - string(|a|table|row|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<th>a</th>) - string(<th>table</th>) - string(<th>heading</th>) - string(</tr>) - string(<tr>) - string(<td>a</td>) - string(<td>table</td>) - string(<td>row</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |_. a|_. table|_. heading| + |a|table|row|)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <th>a</th> + <th>table</th> + <th>heading</th> + </tr> + <tr> + <td>a</td> + <td>table</td> + <td>row</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(cell attributes) key(desc)operator(:) string(Attributes may be applied separately to individual cells, rows, and entire tables. Cell attributes are placed within each cell.) -key(in)operator(:) string(|a|{color:red}. styled|cell|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td>a</td>) - string(<td style="color:red;">styled</td>) - string(<td>cell</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|)>string(a|{color:red}. styled|cell|) +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td>a</td> + <td style="color:red;">styled</td> + <td>cell</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(row attributes) key(desc)operator(:) string(Row attributes are placed at the beginning of a row, followed by a dot and a space.) key(in)operator(:) string((rowclass\). |a|classy|row|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr class="rowclass">) - string(<td>a</td>) - string(<td>classy</td>) - string(<td>row</td>) - string(</tr>) - string(</table>) +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr class="rowclass"> + <td>a</td> + <td>classy</td> + <td>row</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(table attributes) key(desc)operator(:) string(Table attributes are specified by placing the special table. block modifier immediately before the table.) -key(in)operator(:) string(|-) - string(table(tableclass\).) - string(|a|classy|table|) - string(|a|classy|table|) -key(html)operator(:) string(|-) - string(<table class="tableclass">) - string(<tr>) - string(<td>a</td>) - string(<td>classy</td>) - string(<td>table</td>) - string(</tr>) - string(<tr>) - string(<td>a</td>) - string(<td>classy</td>) - string(<td>table</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + table(tableclass\). + |a|classy|table| + |a|classy|table|)> +key(html)operator(:) string<delimiter(|-)content( + <table class="tableclass"> + <tr> + <td>a</td> + <td>classy</td> + <td>table</td> + </tr> + <tr> + <td>a</td> + <td>classy</td> + <td>table</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(vertical alignment) key(desc)operator(:) string(Special alignment symbols are available for vertical alignment within table cells.) -key(in)operator(:) string(|^. top alignment|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td style="vertical-align:top;">top alignment</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|)>string(^. top alignment|) +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td style="vertical-align:top;">top alignment</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(vertical alignment 2) -key(in)operator(:) string(|-) - string(|-. middle alignment|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td style="vertical-align:middle;">middle alignment</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |-. middle alignment|)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td style="vertical-align:middle;">middle alignment</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(vertical alignment 3) -key(in)operator(:) string(|-) - string(|~. bottom alignment|) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td style="vertical-align:bottom;">bottom alignment</td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |~. bottom alignment|)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td style="vertical-align:bottom;">bottom alignment</td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(column span) key(desc)operator(:) string(Use a \\ backslash to indicate a column span.) -key(in)operator(:) string(|-) - string(|\\2. spans two cols |) - string(| col 1 | col 2 |) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td colspan="2">spans two cols </td>) - string(</tr>) - string(<tr>) - string(<td> col 1 </td>) - string(<td> col 2 </td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |\\2. spans two cols | + | col 1 | col 2 |)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td colspan="2">spans two cols </td> + </tr> + <tr> + <td> col 1 </td> + <td> col 2 </td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(row span) key(desc)operator(:) string(Use a / forward slash to indicate a row span.) -key(in)operator(:) string(|-) - string(|/3. spans 3 rows | row a |) - string(| row b |) - string(| row c |) -key(html)operator(:) string(|-) - string(<table>) - string(<tr>) - string(<td rowspan="3">spans 3 rows </td>) - string(<td> row a </td>) - string(</tr>) - string(<tr>) - string(<td> row b </td>) - string(</tr>) - string(<tr>) - string(<td> row c </td>) - string(</tr>) - string(</table>) +key(in)operator(:) string<delimiter(|-)content( + |/3. spans 3 rows | row a | + | row b | + | row c |)> +key(html)operator(:) string<delimiter(|-)content( + <table> + <tr> + <td rowspan="3">spans 3 rows </td> + <td> row a </td> + </tr> + <tr> + <td> row b </td> + </tr> + <tr> + <td> row c </td> + </tr> + </table>)> head<head(---)> key(name)operator(:) string(whitespace required) key(desc)operator(:) string(Links, images and phrase modifiers normally require surrounding whitespace.) @@ -758,14 +758,14 @@ key(html)operator(:) string(<p>2 log<sub>n</sub></p>) head<head(---)> key(name)operator(:) string(modifier without whitespace 4) key(desc)operator(:) string(It can also be used to include links and images without surrounding whitespace.) -key(in)operator(:) string(|-) - string(A close[!/img.gif!]image.) - string(A tight["text":http://thresholdstate.com/]link.) - string(A ["footnoted link":http://thresholdstate.com/][1].) -key(html)operator(:) string(|-) - string(<p>A close<img src="/img.gif" alt="" />image.<br />) - string(A tight<a href="http://thresholdstate.com/">text</a>link.<br />) - string(A <a href="http://thresholdstate.com/">footnoted link</a><sup class="footnote"><a href="#fn1">1</a></sup>.</p>) +key(in)operator(:) string<delimiter(|-)content( + A close[!/img.gif!]image. + A tight["text":http://thresholdstate.com/]link. + A ["footnoted link":http://thresholdstate.com/][1].)> +key(html)operator(:) string<delimiter(|-)content( + <p>A close<img src="/img.gif" alt="" />image.<br /> + A tight<a href="http://thresholdstate.com/">text</a>link.<br /> + A <a href="http://thresholdstate.com/">footnoted link</a><sup class="footnote"><a href="#fn1">1</a></sup>.</p>)> comment(# html: |-) comment(# <p>A close<img src="/img.gif" alt="" />image.<br />) comment(# A tight<a href="http://thresholdstate.com/">text</a>link.<br />) diff --git a/test/scanners/yaml/website.expected.raydebug b/test/scanners/yaml/website.expected.raydebug index 171afa3..45b2498 100644 --- a/test/scanners/yaml/website.expected.raydebug +++ b/test/scanners/yaml/website.expected.raydebug @@ -1,9 +1,9 @@ -string(%YAML 1.2) +doctype(%YAML 1.2) head<head(---)> key(YAML)operator(:) string(YAML Ain't Markup Language) -key(What It Is)operator(:) string(YAML is a human friendly data serialization) - string(standard for all programming languages.) +key(What It Is)operator(:) string(YAML is a human friendly data serialization)string( + standard for all programming languages.) key(YAML Resources)operator(:) key(YAML 1.2 Specification)operator(:) string(http://yaml.org/spec/1.2/) @@ -52,18 +52,18 @@ key(News)operator(:) operator(-) string(01-OCT-2004 -- YAML for Cocoa was released by Will Thimbley) operator(-) string(08-FEB-2004 -- Slaven Rezic announced a new version of his Javascript binding) operator(-) string(29-JAN-2004 -- Ingy, Oren, and Clark spent 4 days hacking on the spec in Portland.) - operator(-) string(10-OCT-2003 -- The Syck implementation with bindings for Ruby, Python,) - string(and PHP is now at version .41) + operator(-) string(10-OCT-2003 -- The Syck implementation with bindings for Ruby, Python,)string( + and PHP is now at version .41) operator(-) string(26-APR-2003 -- Mike Orr has taken over the Pure Python development.) operator(-) string(26-APR-2003 -- Brian Ingerson has created a FIT platform for Wiki-like testing.) operator(-) string(24-JAN-2003 -- Updates to specification.) - operator(-) string(25-JUL-2002 -- Both the Ruby and Python parsers have made significant progress.) - string(There is an article about YAML by Kendall Grant Clark at xml.com.) - string(There is also a draft XML binding.) - operator(-) string(02-JUL-2002 -- Brian Ingerson will be giving a 45 minute presentation on YAML at the) - string(O'Reilly Open Source Conference in San Diego on July 24th 2002.) - operator(-) string(01-FEB-2002 -- Brian's Perl implementation YAML.pm, has been updated with new documentation.) - string(Included in this release is YSH, a test shell for learning how YAML works.) + operator(-) string(25-JUL-2002 -- Both the Ruby and Python parsers have made significant progress.)string( + There is an article about YAML by Kendall Grant Clark at xml.com. + There is also a draft XML binding.) + operator(-) string(02-JUL-2002 -- Brian Ingerson will be giving a 45 minute presentation on YAML at the)string( + O'Reilly Open Source Conference in San Diego on July 24th 2002.) + operator(-) string(01-FEB-2002 -- Brian's Perl implementation YAML.pm, has been updated with new documentation.)string( + Included in this release is YSH, a test shell for learning how YAML works.) operator(-) string(03-JAN-2002 -- YAML(tm\) starts the new year with a new name YAML Ain't Markup Language.) operator(-) string(17-MAY-2001 -- YAML now has a mailing list at SourceForge.) operator(-) string(15-MAY-2001 -- YAML is started with a first pass specification.) |