Created
March 1, 2015 08:27
-
-
Save ashgti/055797e1199b5cff4e43 to your computer and use it in GitHub Desktop.
Perl6 Grammar with syntax applied from the perl.tmbundle
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Perl6Grammar.nqp</title> | |
<style media="screen"> | |
atom-text-editor, | |
:host { | |
background-color: #002b36; | |
color: #839496; | |
} | |
atom-text-editor .invisible-character, | |
:host .invisible-character { | |
color: rgba(101, 123, 131, 0.2); | |
} | |
atom-text-editor .indent-guide, | |
:host .indent-guide { | |
color: rgba(101, 123, 131, 0.2); | |
} | |
atom-text-editor .gutter, | |
:host .gutter { | |
background-color: #073642; | |
color: #839496; | |
} | |
atom-text-editor .gutter .line-number, | |
:host .gutter .line-number { | |
opacity: 1; | |
} | |
atom-text-editor .gutter .line-number.folded, | |
:host .gutter .line-number.folded, | |
atom-text-editor .gutter .line-number:after, | |
:host .gutter .line-number:after, | |
atom-text-editor .fold-marker:after, | |
:host .fold-marker:after { | |
color: #d33682; | |
} | |
atom-text-editor .cursor, | |
:host .cursor { | |
border-color: #fdf6e3; | |
} | |
atom-text-editor .selection .region, | |
:host .selection .region { | |
background-color: #073a47; | |
} | |
atom-text-editor .line-number.cursor-line-no-selection, | |
:host .line-number.cursor-line-no-selection { | |
background-color: #0a4d5e; | |
} | |
.bracket-matcher .region { | |
background-color: rgba(88, 110, 117, 0.8); | |
opacity: 0.3; | |
} | |
.comment { | |
color: #586e75; | |
font-style: italic; | |
} | |
.entity { | |
color: #839496; | |
} | |
.entity .punctuation { | |
color: #dc322f; | |
} | |
.entity.name { | |
color: #cb4b16; | |
} | |
.entity.name.tag { | |
color: #268bd2; | |
} | |
.entity.constant { | |
color: #dc322f; | |
} | |
.entity.attribute-name { | |
color: #586e75; | |
} | |
.keyword { | |
color: #859900; | |
} | |
.keyword.other.special-method { | |
color: #cb4b16; | |
} | |
.storage.type { | |
color: #268bd2; | |
} | |
.storage.class.type { | |
color: #d33682; | |
} | |
.storage.modifier { | |
color: #268bd2; | |
} | |
.constant { | |
color: #b58900; | |
} | |
.constant.numeric, | |
.constant.boolean, | |
.constant.symbol, | |
.constant.symbol .punctuation { | |
color: #2aa198; | |
} | |
.constant.symbol.hashkey { | |
color: #dc322f; | |
} | |
.constant.symbol.hashkey .punctuation { | |
color: #dc322f; | |
} | |
.delimiter, | |
.brace { | |
color: #268bd2; | |
} | |
.delimiter, | |
.round { | |
color: #859900; | |
} | |
.delimiter.period { | |
color: #859900; | |
} | |
.invalid.deprecated { | |
text-decoration: underline; | |
color: #dc322f; | |
} | |
.invalid.illegal { | |
color: #dc322f; | |
} | |
.method .name { | |
color: #268bd2; | |
} | |
.operator.assignment { | |
color: #93a1a1; | |
} | |
.parameter { | |
color: #dc322f; | |
} | |
.property-name { | |
color: #859900; | |
} | |
.property-value .unit { | |
color: #839496; | |
} | |
.string { | |
color: #2aa198; | |
} | |
.string .constant.character.escape { | |
color: #dc322f; | |
font-weight: bold; | |
} | |
.string .punctuation.string { | |
color: #2aa198; | |
} | |
.string.regexp { | |
color: #2aa198; | |
} | |
.string.regexp .string.regexp.arbitrary-repetition { | |
color: #2aa198; | |
} | |
.variable { | |
color: #2aa198; | |
} | |
.variable.instance { | |
color: #268bd2; | |
} | |
.variable.constant { | |
color: #586e75; | |
} | |
.variable.parameter { | |
color: #dc322f; | |
} | |
.support { | |
color: #cb4b16; | |
} | |
.support.class { | |
color: #dc322f; | |
} | |
.terminator { | |
color: #859900; | |
} | |
.source.c .meta.preprocessor, | |
.source.c\+\+ .meta.preprocessor { | |
color: #dc322f; | |
} | |
.source.c .keyword.control.import, | |
.source.c\+\+ .keyword.control.import { | |
color: #dc322f; | |
} | |
.source.c .punctuation.string, | |
.source.c\+\+ .punctuation.string { | |
color: #2aa198; | |
} | |
.source.c .constant, | |
.source.c\+\+ .constant { | |
color: #dc322f; | |
} | |
.source.c .constant.numeric, | |
.source.c\+\+ .constant.numeric, | |
.source.c .constant.language.c, | |
.source.c\+\+ .constant.language.c { | |
color: #2aa198; | |
} | |
.source.c .storage, | |
.source.c\+\+ .storage { | |
color: #b58900; | |
} | |
.source.c .entity, | |
.source.c\+\+ .entity { | |
color: #839496; | |
} | |
.source.c .entity.name.function.preprocessor, | |
.source.c\+\+ .entity.name.function.preprocessor { | |
color: #dc322f; | |
} | |
.source.c .support.type, | |
.source.c\+\+ .support.type { | |
color: #b58900; | |
} | |
.source.c .support.type.posix-reserved, | |
.source.c\+\+ .support.type.posix-reserved { | |
color: #839496; | |
} | |
.source.c .variable.other.dot-access, | |
.source.c\+\+ .variable.other.dot-access { | |
color: #839496; | |
} | |
.source.c .variable.parameter.preprocessor, | |
.source.c\+\+ .variable.parameter.preprocessor { | |
color: #dc322f; | |
} | |
.source.css .entity.name { | |
color: #859900; | |
} | |
.source.css .punctuation.section { | |
color: #268bd2; | |
} | |
.source.css .punctuation.separator { | |
color: #839496; | |
} | |
.source.css .punctuation.terminator { | |
color: #839496; | |
} | |
.source.css .punctuation.definition.entity { | |
color: #268bd2; | |
} | |
.source.css .punctuation.definition.constant { | |
color: #839496; | |
} | |
.source.css .brace { | |
color: #268bd2; | |
} | |
.source.css .variable { | |
color: #268bd2; | |
} | |
.source.css .attribute-name.class { | |
color: #268bd2; | |
} | |
.source.css .property-name { | |
color: #b58900; | |
} | |
.source.css .property-value { | |
color: #2aa198; | |
} | |
.source.css .unit { | |
color: #2aa198; | |
} | |
.source.css .support.function { | |
color: #268bd2; | |
} | |
.source.css .rgb-value { | |
color: #2aa198; | |
} | |
.source.css .id { | |
color: #268bd2; | |
} | |
.source.css .pseudo-element { | |
color: #cb4b16; | |
} | |
.source.css .pseudo-class { | |
color: #cb4b16; | |
} | |
.source.css .pseudo-class.attribute-name { | |
color: #cb4b16; | |
} | |
atom-text-editor .gutter .git-line-modified, | |
:host .gutter .git-line-modified { | |
border-left: 2px solid #b58900; | |
padding-left: calc(0.5em - 2px); | |
color: #839496; | |
} | |
atom-text-editor .gutter .git-line-added, | |
:host .gutter .git-line-added { | |
border-left: 2px solid #859900; | |
padding-left: calc(0.5em - 2px); | |
color: #839496; | |
} | |
atom-text-editor .gutter .git-line-removed, | |
:host .gutter .git-line-removed { | |
border-left: 2px solid #dc322f; | |
padding-left: calc(0.5em - 2px); | |
color: #839496; | |
} | |
.source.js .constant { | |
color: #859900; | |
} | |
.source.js .comma { | |
color: #839496; | |
} | |
.source.js .support.class { | |
color: #859900; | |
} | |
.source.js .entity.name.type { | |
color: #b58900; | |
} | |
.source.js .entity.name { | |
color: #839496; | |
} | |
.source.js .meta.brace { | |
color: #839496; | |
} | |
.source.js .keyword { | |
color: #839496; | |
} | |
.source.js .keyword.operator.new { | |
color: #859900; | |
} | |
.source.js .keyword.control { | |
color: #859900; | |
} | |
.source.js .keyword.control.regexp { | |
color: #2aa198; | |
} | |
.source.js .variable { | |
color: #268bd2; | |
} | |
.source.js .variable.parameter { | |
color: #839496; | |
} | |
.source.js .regexp { | |
color: #2aa198; | |
} | |
.source.js .support.function { | |
color: #839496; | |
} | |
.source.js .support.constant { | |
color: #839496; | |
} | |
.source.js .constant.numeric { | |
color: #839496; | |
} | |
.source.js .punctuation.terminator.statement { | |
color: #839496; | |
} | |
.source.js .meta.delimiter.method.period { | |
color: #839496; | |
} | |
.source.js .meta.brace.square { | |
color: #268bd2; | |
} | |
.source.js .meta.brace.curly { | |
color: #268bd2; | |
} | |
atom-text-editor .gutter .line-number.linter-warning .icon-right:before, | |
:host .gutter .line-number.linter-warning .icon-right:before { | |
color: #b58900; | |
} | |
atom-text-editor .gutter .line-number.linter-error .icon-right:before, | |
:host .gutter .line-number.linter-error .icon-right:before { | |
color: #dc322f; | |
} | |
atom-text-editor .highlights .linter-warning .region, | |
:host .highlights .linter-warning .region { | |
border: 1px solid #b58900; | |
background-image: none; | |
background-color: rgba(181, 137, 0, 0.2); | |
} | |
atom-text-editor .highlights .linter-error .region, | |
:host .highlights .linter-error .region { | |
border: 1px solid #dc322f; | |
background-image: none; | |
background-color: rgba(255, 16, 12, 0.2); | |
} | |
atom-text-editor .gfm .markup.italic, | |
:host .gfm .markup.italic { | |
font-style: italic; | |
} | |
atom-text-editor .gfm .markup.bold, | |
:host .gfm .markup.bold { | |
font-weight: bold; | |
} | |
atom-text-editor .gfm .markup.heading, | |
:host .gfm .markup.heading { | |
color: #cb4b16; | |
} | |
atom-text-editor .gfm .link, | |
:host .gfm .link { | |
color: #2aa198; | |
} | |
atom-text-editor .gfm .link .entity, | |
:host .gfm .link .entity { | |
color: #6c71c4; | |
} | |
atom-text-editor .gfm .raw, | |
:host .gfm .raw { | |
font-style: italic; | |
} | |
atom-text-editor .gfm.support, | |
:host .gfm.support { | |
color: #dc322f; | |
} | |
.source.php .storage.type.class { | |
color: #b58900; | |
} | |
.source.php .storage.type.function { | |
color: #dc322f; | |
} | |
.source.php .storage.modifier { | |
color: #b58900; | |
} | |
.source.php .entity.name.type.class { | |
color: #839496; | |
} | |
.source.php .entity.name.function { | |
color: #839496; | |
} | |
.source.php .entity.other { | |
color: #839496; | |
} | |
.source.php .variable { | |
color: #268bd2; | |
} | |
.source.php .punctuation.definition { | |
color: #839496; | |
} | |
.source.php .punctuation.definition.comment { | |
color: #586e75; | |
} | |
.source.php .punctuation.definition.array { | |
color: #dc322f; | |
} | |
.source.php .punctuation.definition.string { | |
color: #839496; | |
} | |
.source.php .punctuation.definition.variable { | |
color: #859900; | |
} | |
.source.php .punctuation.section.scope { | |
color: #dc322f; | |
} | |
.source.php .support.function.construct { | |
color: #b58900; | |
} | |
.source.php .support.function.array { | |
color: #859900; | |
} | |
.source.php .keyword.operator.class { | |
color: #b58900; | |
} | |
.source.php .keyword.operator.assignment { | |
color: #859900; | |
} | |
.source.php .keyword.other { | |
color: #dc322f; | |
} | |
.source.python .entity { | |
color: #839496; | |
} | |
.source.python .entity.name { | |
color: #268bd2; | |
} | |
.source.python .entity.other { | |
color: #268bd2; | |
} | |
.source.python .function { | |
color: #268bd2; | |
} | |
.source.python .function.magic { | |
color: #268bd2; | |
} | |
.source.python .punctuation.string { | |
color: #2aa198; | |
} | |
.source.python .keyword.operator { | |
color: #839496; | |
} | |
.source.python .keyword.operator.quantifier { | |
color: #2aa198; | |
} | |
.source.python .keyword.operator.logical { | |
color: #859900; | |
} | |
.source.python .keyword.control.import { | |
color: #cb4b16; | |
} | |
.source.python .keyword.other { | |
color: #859900; | |
} | |
.source.python .constant.language { | |
color: #268bd2; | |
} | |
.source.python .constant.character { | |
color: #2aa198; | |
} | |
.source.python .constant.other { | |
color: #dc322f; | |
} | |
.source.python .entity.name.type.class { | |
color: #268bd2; | |
} | |
.source.python .variable { | |
color: #839496; | |
} | |
.source.python .support.function.builtin { | |
color: #268bd2; | |
} | |
.source.python .support.type.exception.python { | |
color: #b58900; | |
} | |
.source.python .support.type.python { | |
color: #268bd2; | |
} | |
.source.python .storage.type.string { | |
color: #2aa198; | |
} | |
.source.python .storage.type.class { | |
color: #859900; | |
} | |
.source.python .storage.type.class.todo { | |
color: #d33682; | |
} | |
.source.python .storage.type.function { | |
color: #859900; | |
} | |
.source.python .punctuation.definition.parameters { | |
color: #839496; | |
} | |
.source.python .punctuation.section.function.begin { | |
color: #839496; | |
} | |
.source.python .punctuation.separator.parameters { | |
color: #839496; | |
} | |
.source.ruby .meta.embedded .punctuation.section { | |
color: #dc322f; | |
} | |
.source.ruby .punctuation.definition { | |
color: #839496; | |
} | |
.source.ruby .punctuation.definition.string { | |
color: #dc322f; | |
} | |
.source.ruby .punctuation.definition.comment { | |
color: #586e75; | |
} | |
.source.ruby .entity.inherited-class { | |
color: #b58900; | |
} | |
.source.ruby .variable.parameter { | |
color: #839496; | |
} | |
.source.ruby .variable.constant { | |
color: #b58900; | |
} | |
.source.ruby .instance .punctuation.definition { | |
color: #268bd2; | |
} | |
.source.ruby .class { | |
color: #b58900; | |
} | |
.source.ruby .class.control { | |
color: #839496; | |
} | |
.source.ruby .module { | |
color: #b58900; | |
} | |
.source.ruby .require .keyword.other.special-method { | |
color: #cb4b16; | |
} | |
.source.ruby .keyword.other.special-method { | |
color: #cb4b16; | |
} | |
.source.ruby .keyword.other { | |
color: #859900; | |
} | |
.source.ruby .keyword.control { | |
color: #859900; | |
} | |
.source.ruby .special-method { | |
color: #268bd2; | |
} | |
.source.ruby .symbol { | |
color: #2aa198; | |
} | |
.source.ruby .symbol .punctuation.definition { | |
color: #2aa198; | |
} | |
.source.ruby .hashkey { | |
color: #dc322f; | |
} | |
.source.ruby .hashkey .punctuation.definition { | |
color: #dc322f; | |
} | |
.source.ruby .string.regexp { | |
color: #dc322f; | |
} | |
.source.ruby .todo { | |
color: #d33682; | |
} | |
.source.ruby .variable.ruby.global { | |
color: #268bd2; | |
} | |
.source.ruby .variable.ruby.global .punctuation { | |
color: #268bd2; | |
} | |
.source.ruby .variable.block { | |
color: #268bd2; | |
} | |
.source.ruby .punctuation.separator { | |
color: #839496; | |
} | |
.source.ruby .string.interpolated .embedded.line.ruby .punctuation .source.ruby { | |
color: #dc322f; | |
} | |
.source.ruby .string.interpolated .embedded.line.ruby .source.ruby { | |
color: #839496; | |
} | |
.source.ruby .string.interpolated .embedded.line.ruby .source.ruby .punctuation.array, | |
.source.ruby .string.interpolated .embedded.line.ruby .source.ruby .punctuation.function { | |
color: #839496; | |
} | |
.source.ruby .support.function { | |
color: #839496; | |
} | |
.source.ruby .support.function.kernel { | |
color: #859900; | |
} | |
.source.scala .variable { | |
color: #93a1a1; | |
} | |
.source.scala .declaration { | |
color: #93a1a1; | |
font-weight: bold; | |
} | |
.source.scala .comparison { | |
color: #93a1a1; | |
} | |
.source.scala .class, | |
.source.scala .type { | |
color: #b58900; | |
} | |
.source.scala .val { | |
font-weight: normal; | |
} | |
.source.scala .variable { | |
font-weight: bold; | |
} | |
.source.scala .variable.parameter { | |
color: #6c71c4; | |
font-weight: normal; | |
} | |
.source.scala .control.flow { | |
color: #93a1a1; | |
font-weight: bold; | |
} | |
.source.scala .constant.language { | |
color: #93a1a1; | |
font-weight: bold; | |
} | |
.source.scala .function.declaration { | |
color: #6c71c4; | |
} | |
.source.scala .modifier.other { | |
font-weight: bold; | |
} | |
.source.scala .package { | |
color: #93a1a1; | |
} | |
.source.scala .variable.import { | |
font-weight: normal; | |
} | |
.source.scala .type .bounds, | |
.source.scala .type .class { | |
color: #6c71c4; | |
} | |
.source.scala .documentation :not(.embedded).link.entity { | |
color: #268bd2; | |
text-decoration: underline; | |
} | |
.source.scala .documentation :not(.embedded) .class, | |
.source.scala .documentation :not(.embedded) .parameter { | |
color: #93a1a1; | |
} | |
.source.scala .documentation :not(.embedded) .description { | |
color: #586e75; | |
} | |
.source.scala .embedded { | |
color: #93a1a1; | |
opacity: 0.8; | |
font-style: italic; | |
} | |
.source.scala .embedded .margin, | |
.source.scala .embedded .delimiters { | |
font-style: normal; | |
} | |
.terminal { | |
background-color: #002b36; | |
} | |
.terminal .color-0 { | |
color: #839496; | |
} | |
.terminal .background-0 { | |
background-color: #002b36; | |
} | |
.terminal .color-1 { | |
color: #dc322f; | |
} | |
.terminal .background-1 { | |
background-color: #dc322f; | |
} | |
.terminal .color-2 { | |
color: #859900; | |
} | |
.terminal .background-2 { | |
background-color: #859900; | |
} | |
.terminal .color-3 { | |
color: #b58900; | |
} | |
.terminal .background-3 { | |
background-color: #b58900; | |
} | |
.terminal .color-4 { | |
color: #268bd2; | |
} | |
.terminal .background-4 { | |
background-color: #268bd2; | |
} | |
.terminal .color-5 { | |
color: #d33682; | |
} | |
.terminal .background-5 { | |
background-color: #d33682; | |
} | |
.terminal .color-6 { | |
color: #2aa198; | |
} | |
.terminal .background-6 { | |
background-color: #2aa198; | |
} | |
.terminal .color-7 { | |
color: #fdf6e3; | |
} | |
.terminal .background-7 { | |
background-color: #fdf6e3; | |
} | |
atom-text-editor .wrap-guide, | |
:host .wrap-guide { | |
background-color: #073642; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Syntax Example for: <strong>Perl6Grammar.nqp</strong> | |
<pre class="editor editor-colors"><div class="line"><span class="source perl6"><span class="keyword other include perl6"><span>use</span></span><span> QRegex;</span></span></div><div class="line"><span class="source perl6"><span class="keyword other include perl6"><span>use</span></span><span> NQPP6QRegex;</span></span></div><div class="line"><span class="source perl6"><span class="keyword other include perl6"><span>use</span></span><span> NQPP5QRegex;</span></span></div><div class="line"><span class="source perl6"><span class="keyword other include perl6"><span>use</span></span><span> Perl6::Actions;</span></span></div><div class="line"><span class="source perl6"><span class="keyword other include perl6"><span>use</span></span><span> Perl6::World;</span></span></div><div class="line"><span class="source perl6"><span class="keyword other include perl6"><span>use</span></span><span> Perl6::Pod;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span class="keyword other module perl6"><span>role</span></span><span> startstop[</span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>] {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> starter { </span><span class="variable other basic perl6"><span>$start</span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> stopper { </span><span class="variable other basic perl6"><span>$stop</span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span>}</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span class="keyword other module perl6"><span>role</span></span><span> stop[</span><span class="variable other basic perl6"><span>$stop</span></span><span>] {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> starter { <!> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> stopper { </span><span class="variable other basic perl6"><span>$stop</span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span>}</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span class="comment line number-sign perl6"><span># This role captures things that STD factors out from any individual grammar,</span></span></span></div><div class="line"><span class="source perl6"><span class="comment line number-sign perl6"><span># but that don't make sense to go in HLL::Grammar.</span></span></span></div><div class="line"><span class="source perl6"><span class="keyword other module perl6"><span>role</span></span><span> STD {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> opener {</span></span></div><div class="line"><span class="source perl6"><span> <[</span></span></div><div class="line"><span class="source perl6"><span> \x0028 \x003C \x005B \x007B \x00AB \x0F3A \x0F3C \x169B \x2018 \x201A \x201B</span></span></div><div class="line"><span class="source perl6"><span> \x201C \x201E \x201F \x2039 \x2045 \x207D \x208D \x2208 \x2209 \x220A \x2215</span></span></div><div class="line"><span class="source perl6"><span> \x223C \x2243 \x2252 \x2254 \x2264 \x2266 \x2268 \x226A \x226E \x2270 \x2272</span></span></div><div class="line"><span class="source perl6"><span> \x2274 \x2276 \x2278 \x227A \x227C \x227E \x2280 \x2282 \x2284 \x2286 \x2288</span></span></div><div class="line"><span class="source perl6"><span> \x228A \x228F \x2291 \x2298 \x22A2 \x22A6 \x22A8 \x22A9 \x22AB \x22B0 \x22B2</span></span></div><div class="line"><span class="source perl6"><span> \x22B4 \x22B6 \x22C9 \x22CB \x22D0 \x22D6 \x22D8 \x22DA \x22DC \x22DE \x22E0</span></span></div><div class="line"><span class="source perl6"><span> \x22E2 \x22E4 \x22E6 \x22E8 \x22EA \x22EC \x22F0 \x22F2 \x22F3 \x22F4 \x22F6</span></span></div><div class="line"><span class="source perl6"><span> \x22F7 \x2308 \x230A \x2329 \x23B4 \x2768 \x276A \x276C \x276E \x2770 \x2772</span></span></div><div class="line"><span class="source perl6"><span> \x2774 \x27C3 \x27C5 \x27D5 \x27DD \x27E2 \x27E4 \x27E6 \x27E8 \x27EA \x2983</span></span></div><div class="line"><span class="source perl6"><span> \x2985 \x2987 \x2989 \x298B \x298D \x298F \x2991 \x2993 \x2995 \x2997 \x29C0</span></span></div><div class="line"><span class="source perl6"><span> \x29C4 \x29CF \x29D1 \x29D4 \x29D8 \x29DA \x29F8 \x29FC \x2A2B \x2A2D \x2A34</span></span></div><div class="line"><span class="source perl6"><span> \x2A3C \x2A64 \x2A79 \x2A7D \x2A7F \x2A81 \x2A83 \x2A8B \x2A91 \x2A93 \x2A95</span></span></div><div class="line"><span class="source perl6"><span> \x2A97 \x2A99 \x2A9B \x2AA1 \x2AA6 \x2AA8 \x2AAA \x2AAC \x2AAF \x2AB3 \x2ABB</span></span></div><div class="line"><span class="source perl6"><span> \x2ABD \x2ABF \x2AC1 \x2AC3 \x2AC5 \x2ACD \x2ACF \x2AD1 \x2AD3 \x2AD5 \x2AEC</span></span></div><div class="line"><span class="source perl6"><span> \x2AF7 \x2AF9 \x2E02 \x2E04 \x2E09 \x2E0C \x2E1C \x2E20 \x3008 \x300A \x300C</span></span></div><div class="line"><span class="source perl6"><span> \x300E \x3010 \x3014 \x3016 \x3018 \x301A \x301D \xFD3E \xFE17 \xFE35 \xFE37</span></span></div><div class="line"><span class="source perl6"><span> \xFE39 \xFE3B \xFE3D \xFE3F \xFE41 \xFE43 \xFE47 \xFE59 \xFE5B \xFE5D \xFF08</span></span></div><div class="line"><span class="source perl6"><span> \xFF1C \xFF3B \xFF5B \xFF5F \xFF62</span></span></div><div class="line"><span class="source perl6"><span> ]></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> balanced(</span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.mixin(</span><span class="variable language perl6"><span>self</span></span><span>, startstop.</span><span class="support function"><span>HOW</span></span><span>.curry(startstop, </span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> unbalanced(</span><span class="variable other basic perl6"><span>$stop</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.mixin(</span><span class="variable language perl6"><span>self</span></span><span>, stop.</span><span class="support function"><span>HOW</span></span><span>.curry(stop, </span><span class="variable other basic perl6"><span>$stop</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> starter { <!> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> stopper { <!> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%quote_lang_cache</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> quote_lang(</span><span class="variable other basic perl6"><span>$l</span></span><span>, </span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>, </span><span class="variable other basic perl6"><span>@base_tweaks</span></span><span>?, </span><span class="variable other basic perl6"><span>@extra_tweaks</span></span><span>?) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>sub</span></span><span> lang_key() {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@keybits</span></span><span> := [</span><span class="variable other basic perl6"><span>$l</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.</span><span class="support function"><span>name</span></span><span>(</span><span class="variable other basic perl6"><span>$l</span></span><span>), </span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>];</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>@base_tweaks</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>@keybits</span></span><span>.</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>$_</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>@extra_tweaks</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$_</span></span><span>[0] </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>to</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>return</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>NOCACHE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>@keybits</span></span><span>.</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>$_</span></span><span>[0] ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$_</span></span><span>[1]);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>join</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>\0</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="variable other basic perl6"><span>@keybits</span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>sub</span></span><span> con_lang() {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lang</span></span><span> := </span><span class="variable other basic perl6"><span>$l</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>@base_tweaks</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$lang</span></span><span> := </span><span class="variable other basic perl6"><span>$lang</span></span><span>.</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>tweak_$_</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>(1);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>@extra_tweaks</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$t</span></span><span> := </span><span class="variable other basic perl6"><span>$_</span></span><span>[0];</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::</span><span class="support function"><span>can</span></span><span>(</span><span class="variable other basic perl6"><span>$lang</span></span><span>, </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>tweak_$t</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$lang</span></span><span> := </span><span class="variable other basic perl6"><span>$lang</span></span><span>.</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>tweak_$t</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>(</span><span class="variable other basic perl6"><span>$_</span></span><span>[1]);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.sorry(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Unrecognized adverb: :$t</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$start</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="variable other basic perl6"><span>$stop</span></span><span> ?? </span><span class="variable other basic perl6"><span>$lang</span></span><span>.balanced(</span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> !! </span><span class="variable other basic perl6"><span>$lang</span></span><span>.unbalanced(</span><span class="variable other basic perl6"><span>$stop</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Get language from cache or derive it.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$key</span></span><span> := lang_key();</span></span></div><div class="line"><span class="source perl6"><span> nqp::ifnull(</span><span class="variable other basic perl6"><span>%quote_lang_cache</span></span><span>, </span><span class="variable other basic perl6"><span>%quote_lang_cache</span></span><span> := nqp::hash());</span></span></div><div class="line"><span class="source perl6"><span> nqp::existskey(</span><span class="variable other basic perl6"><span>%quote_lang_cache</span></span><span>, </span><span class="variable other basic perl6"><span>$key</span></span><span>) && </span><span class="variable other basic perl6"><span>$key</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>NOCACHE</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> ?? </span><span class="variable other basic perl6"><span>%quote_lang_cache</span></span><span>{</span><span class="variable other basic perl6"><span>$key</span></span><span>}</span></span></div><div class="line"><span class="source perl6"><span> !! (</span><span class="variable other basic perl6"><span>%quote_lang_cache</span></span><span>{</span><span class="variable other basic perl6"><span>$key</span></span><span>} := con_lang());</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> babble(</span><span class="variable other basic perl6"><span>$l</span></span><span>, </span><span class="variable other basic perl6"><span>@base_tweaks</span></span><span>?) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@extra_tweaks</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> <.ws></span></span></div><div class="line"><span class="source perl6"><span> [ <quotepair> <.ws></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$kv</span></span><span> := </span><span class="variable other basic perl6"><span>$<quotepair</span></span><span>>[-1].ast;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$k</span></span><span> := </span><span class="variable other basic perl6"><span>$kv</span></span><span>.named;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::istype(</span><span class="variable other basic perl6"><span>$kv</span></span><span>, QAST::Stmts) || nqp::istype(</span><span class="variable other basic perl6"><span>$kv</span></span><span>, QAST::Stmt) && +@(</span><span class="variable other basic perl6"><span>$kv</span></span><span>) == 1 {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$kv</span></span><span> := </span><span class="variable other basic perl6"><span>$kv</span></span><span>[0];</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$v</span></span><span> := nqp::istype(</span><span class="variable other basic perl6"><span>$kv</span></span><span>, QAST::IVal)</span></span></div><div class="line"><span class="source perl6"><span> ?? </span><span class="variable other basic perl6"><span>$kv</span></span><span>.</span><span class="support function"><span>value</span></span></span></div><div class="line"><span class="source perl6"><span> !! </span><span class="variable other basic perl6"><span>$kv</span></span><span>.has_compile_time_value</span></span></div><div class="line"><span class="source perl6"><span> ?? </span><span class="variable other basic perl6"><span>$kv</span></span><span>.compile_time_value</span></span></div><div class="line"><span class="source perl6"><span> !! </span><span class="variable language perl6"><span>self</span></span><span>.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Invalid adverb value for </span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$<quotepair</span></span><span>>[-1].</span><span class="support type perl6"><span>Str</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>@extra_tweaks</span></span><span>, [</span><span class="variable other basic perl6"><span>$k</span></span><span>, </span><span class="variable other basic perl6"><span>$v</span></span><span>]);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> ]*</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<B</span></span><span>>=[<?>]</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Work out the delimeters.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$c</span></span><span> := $/.CURSOR;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@delims</span></span><span> := </span><span class="variable other basic perl6"><span>$c</span></span><span>.peek_delimiters(</span><span class="variable other basic perl6"><span>$c</span></span><span>.target, </span><span class="variable other basic perl6"><span>$c</span></span><span>.</span><span class="support function"><span>pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$start</span></span><span> := </span><span class="variable other basic perl6"><span>@delims</span></span><span>[0];</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$stop</span></span><span> := </span><span class="variable other basic perl6"><span>@delims</span></span><span>[1];</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Get the language.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lang</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.quote_lang(</span><span class="variable other basic perl6"><span>$l</span></span><span>, </span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>, </span><span class="variable other basic perl6"><span>@base_tweaks</span></span><span>, </span><span class="variable other basic perl6"><span>@extra_tweaks</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<B</span></span><span>>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!make</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>([</span><span class="variable other basic perl6"><span>$lang</span></span><span>, </span><span class="variable other basic perl6"><span>$start</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>]);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@herestub_queue</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="keyword other module perl6"><span>class</span></span><span> Herestub {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>has</span></span><span> </span><span class="variable other basic perl6"><span>$!delim</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>has</span></span><span> </span><span class="variable other basic perl6"><span>$!orignode</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>has</span></span><span> </span><span class="variable other basic perl6"><span>$!lang</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> delim() { </span><span class="variable other basic perl6"><span>$!delim</span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> orignode() { </span><span class="variable other basic perl6"><span>$!orignode</span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> lang() { </span><span class="variable other basic perl6"><span>$!lang</span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword other module perl6"><span>role</span></span><span> herestop {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> starter { <!> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> stopper { ^^ {} </span><span class="variable other basic perl6"><span>$<ws</span></span><span>>=(\h*) </span><span class="variable other basic perl6"><span>$*DELIM</span></span><span> \h* $$ [\r\n | \v]? }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> heredoc () {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>@herestub_queue</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$here</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_start_cur</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$here</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>while</span></span><span> </span><span class="variable other basic perl6"><span>@herestub_queue</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$herestub</span></span><span> := nqp::</span><span class="support function"><span>shift</span></span><span>(</span><span class="variable other basic perl6"><span>@herestub_queue</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DELIM</span></span><span> := </span><span class="variable other basic perl6"><span>$herestub</span></span><span>.delim;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lang</span></span><span> := </span><span class="variable other basic perl6"><span>$herestub</span></span><span>.lang.</span><span class="support function"><span>HOW</span></span><span>.mixin(</span><span class="variable other basic perl6"><span>$herestub</span></span><span>.lang, herestop);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$doc</span></span><span> := </span><span class="variable other basic perl6"><span>$here</span></span><span>.nibble(</span><span class="variable other basic perl6"><span>$lang</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$doc</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Match stopper.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$stop</span></span><span> := </span><span class="variable other basic perl6"><span>$lang</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_init</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), :p(</span><span class="variable other basic perl6"><span>$doc</span></span><span>.</span><span class="support function"><span>pos</span></span><span>), :shared(</span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!shared</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>())).stopper();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$stop</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Ending delimiter $*DELIM not found</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$here</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$stop</span></span><span>.</span><span class="support function"><span>pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Get it trimmed and AST updated.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span>.trim_heredoc(</span><span class="variable other basic perl6"><span>$doc</span></span><span>, </span><span class="variable other basic perl6"><span>$stop</span></span><span>, </span><span class="variable other basic perl6"><span>$herestub</span></span><span>.orignode.MATCH.ast);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Ending delimiter $*DELIM not found</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$here</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pass</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$here</span></span><span>.</span><span class="support function"><span>pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$here</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> queue_heredoc(</span><span class="variable other basic perl6"><span>$delim</span></span><span>, </span><span class="variable other basic perl6"><span>$lang</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> nqp::ifnull(</span><span class="variable other basic perl6"><span>@herestub_queue</span></span><span>, </span><span class="variable other basic perl6"><span>@herestub_queue</span></span><span> := []);</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>@herestub_queue</span></span><span>, Herestub.</span><span class="support function"><span>new</span></span><span>(:</span><span class="variable other basic perl6"><span>$delim</span></span><span>, :</span><span class="variable other basic perl6"><span>$lang</span></span><span>, :orignode(</span><span class="variable language perl6"><span>self</span></span><span>)));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>return</span></span><span> </span><span class="variable language perl6"><span>self</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> quibble(</span><span class="variable other basic perl6"><span>$l</span></span><span>, *</span><span class="variable other basic perl6"><span>@base_tweaks</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lang</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$start</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$stop</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <babble(</span><span class="variable other basic perl6"><span>$l</span></span><span>, </span><span class="variable other basic perl6"><span>@base_tweaks</span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$B</span></span><span> := </span><span class="variable other basic perl6"><span>$<babble</span></span><span>><B>.ast; </span><span class="variable other basic perl6"><span>$lang</span></span><span> := </span><span class="variable other basic perl6"><span>$B</span></span><span>[0]; </span><span class="variable other basic perl6"><span>$start</span></span><span> := </span><span class="variable other basic perl6"><span>$B</span></span><span>[1]; </span><span class="variable other basic perl6"><span>$stop</span></span><span> := </span><span class="variable other basic perl6"><span>$B</span></span><span>[2]; }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$start</span></span><span> <nibble(</span><span class="variable other basic perl6"><span>$lang</span></span><span>)> [ </span><span class="variable other basic perl6"><span>$stop</span></span><span> || { $/.CURSOR.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Couldn't find terminator $stop</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>) } ]</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>can</span></span><span>(</span><span class="variable other basic perl6"><span>$lang</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>herelang</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) && </span><span class="variable language perl6"><span>self</span></span><span>.queue_heredoc(</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.nibble_to_str($/, </span><span class="variable other basic perl6"><span>$<nibble</span></span><span>>.ast[1], -> { </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Stopper '</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$<nibble</span></span><span>> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>' too complex for heredoc</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> }),</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$lang</span></span><span>.herelang)</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> nibble(</span><span class="variable other basic perl6"><span>$lang</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lang_cursor</span></span><span> := </span><span class="variable other basic perl6"><span>$lang</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_init</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), :p(</span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>pos</span></span><span>()), :shared(</span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!shared</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>()));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::istype(</span><span class="variable other basic perl6"><span>$lang</span></span><span>, </span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span> := </span><span class="variable other basic perl6"><span>%*LANG</span></span><span>{</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>key</span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>-actions</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>};</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>last</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$lang_cursor</span></span><span>.nibbler();</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> panic(*</span><span class="variable other basic perl6"><span>@args</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Comp::AdHoc</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, payload => nqp::</span><span class="support function"><span>join</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>@args</span></span><span>))</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> sorry(*</span><span class="variable other basic perl6"><span>@args</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Comp::AdHoc</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, payload => nqp::</span><span class="support function"><span>join</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>@args</span></span><span>))</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> worry(*</span><span class="variable other basic perl6"><span>@args</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_worry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Comp::AdHoc</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, payload => nqp::</span><span class="support function"><span>join</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>@args</span></span><span>))</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> typed_panic(</span><span class="variable other basic perl6"><span>$type_str</span></span><span>, *</span><span class="variable other basic perl6"><span>%opts</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw(</span><span class="variable language perl6"><span>self</span></span><span>.MATCH(), nqp::</span><span class="support function"><span>split</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$type_str</span></span><span>), |</span><span class="variable other basic perl6"><span>%opts</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> typed_sorry(</span><span class="variable other basic perl6"><span>$type_str</span></span><span>, *</span><span class="variable other basic perl6"><span>%opts</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> +</span><span class="variable other basic perl6"><span>@*SORROWS</span></span><span> + 1 == </span><span class="variable other basic perl6"><span>$*SORRY_LIMIT</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw(</span><span class="variable language perl6"><span>self</span></span><span>.MATCH(), nqp::</span><span class="support function"><span>split</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$type_str</span></span><span>), |</span><span class="variable other basic perl6"><span>%opts</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>@*SORROWS</span></span><span>.</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>$*W</span></span><span>.typed_exception(</span><span class="variable language perl6"><span>self</span></span><span>.MATCH(), nqp::</span><span class="support function"><span>split</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$type_str</span></span><span>), |</span><span class="variable other basic perl6"><span>%opts</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> typed_worry(</span><span class="variable other basic perl6"><span>$type_str</span></span><span>, *</span><span class="variable other basic perl6"><span>%opts</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>@*WORRIES</span></span><span>.</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>$*W</span></span><span>.typed_exception(</span><span class="variable language perl6"><span>self</span></span><span>.MATCH(), nqp::</span><span class="support function"><span>split</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$type_str</span></span><span>), |</span><span class="variable other basic perl6"><span>%opts</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> malformed(</span><span class="variable other basic perl6"><span>$what</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Malformed</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, :</span><span class="variable other basic perl6"><span>$what</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> missing(</span><span class="variable other basic perl6"><span>$what</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Missing</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, :</span><span class="variable other basic perl6"><span>$what</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> NYI(</span><span class="variable other basic perl6"><span>$feature</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Comp::NYI</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, :</span><span class="variable other basic perl6"><span>$feature</span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> EXPR_nonassoc(</span><span class="variable other basic perl6"><span>$cur</span></span><span>, </span><span class="variable other basic perl6"><span>$left</span></span><span>, </span><span class="variable other basic perl6"><span>$right</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::NonAssociative</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, :left(~</span><span class="variable other basic perl6"><span>$left</span></span><span>), :right(~</span><span class="variable other basic perl6"><span>$right</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># "when" arg assumes more things will become obsolete after Perl 6 comes out...</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> obs(</span><span class="variable other basic perl6"><span>$old</span></span><span>, </span><span class="variable other basic perl6"><span>$new</span></span><span>, </span><span class="variable other basic perl6"><span>$when</span></span><span> = </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>in Perl 6</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw(</span><span class="variable language perl6"><span>self</span></span><span>.MATCH(), [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Obsolete</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>],</span></span></div><div class="line"><span class="source perl6"><span> old => </span><span class="variable other basic perl6"><span>$old</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> replacement => </span><span class="variable other basic perl6"><span>$new</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>when</span></span><span> => </span><span class="variable other basic perl6"><span>$when</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> obsvar(</span><span class="variable other basic perl6"><span>$name</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw(</span><span class="variable language perl6"><span>self</span></span><span>.MATCH(), [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Syntax</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Perl5Var</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>], :</span><span class="variable other basic perl6"><span>$name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> sorryobs(</span><span class="variable other basic perl6"><span>$old</span></span><span>, </span><span class="variable other basic perl6"><span>$new</span></span><span>, </span><span class="variable other basic perl6"><span>$when</span></span><span> = </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>in Perl 6</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw(</span><span class="variable language perl6"><span>self</span></span><span>.MATCH(), [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Obsolete</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>],</span></span></div><div class="line"><span class="source perl6"><span> old => </span><span class="variable other basic perl6"><span>$old</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> replacement => </span><span class="variable other basic perl6"><span>$new</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>when</span></span><span> => </span><span class="variable other basic perl6"><span>$when</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> worryobs(</span><span class="variable other basic perl6"><span>$old</span></span><span>, </span><span class="variable other basic perl6"><span>$new</span></span><span>, </span><span class="variable other basic perl6"><span>$when</span></span><span> = </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>in Perl 6</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_worry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Obsolete</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> old => </span><span class="variable other basic perl6"><span>$old</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> replacement => </span><span class="variable other basic perl6"><span>$new</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>when</span></span><span> => </span><span class="variable other basic perl6"><span>$when</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> check_variable(</span><span class="variable other basic perl6"><span>$var</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$varast</span></span><span> := </span><span class="variable other basic perl6"><span>$var</span></span><span>.ast;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::istype(</span><span class="variable other basic perl6"><span>$varast</span></span><span>, QAST::Op) && </span><span class="variable other basic perl6"><span>$varast</span></span><span>.op </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>ifnull</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$varast</span></span><span> := </span><span class="variable other basic perl6"><span>$varast</span></span><span>[0];</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> !</span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> && nqp::istype(</span><span class="variable other basic perl6"><span>$varast</span></span><span>, QAST::Var) && </span><span class="variable other basic perl6"><span>$varast</span></span><span>.scope </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>lexical</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$name</span></span><span> := </span><span class="variable other basic perl6"><span>$varast</span></span><span>.</span><span class="support function"><span>name</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$name</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%_</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> && </span><span class="variable other basic perl6"><span>$name</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@_</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> && !</span><span class="variable other basic perl6"><span>$*W</span></span><span>.is_lexical(</span><span class="variable other basic perl6"><span>$name</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$var</span></span><span><sigil> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>&</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> !</span><span class="variable other basic perl6"><span>$*STRICT</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.auto_declare_var(</span><span class="variable other basic perl6"><span>$var</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@suggestions</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.suggest_lexicals(</span><span class="variable other basic perl6"><span>$name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::</span><span class="support function"><span>can</span></span><span>(</span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>get_attribute_for_usage</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$sigil</span></span><span> := nqp::</span><span class="support function"><span>substr</span></span><span>(</span><span class="variable other basic perl6"><span>$name</span></span><span>, 0, 1);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$twigil</span></span><span> := nqp::concat(</span><span class="variable other basic perl6"><span>$sigil</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$basename</span></span><span> := nqp::</span><span class="support function"><span>substr</span></span><span>(</span><span class="variable other basic perl6"><span>$name</span></span><span>, 1, nqp::</span><span class="support function"><span>chars</span></span><span>(</span><span class="variable other basic perl6"><span>$name</span></span><span>) - 1);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$attrname</span></span><span> := nqp::concat(</span><span class="variable other basic perl6"><span>$twigil</span></span><span>, </span><span class="variable other basic perl6"><span>$basename</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$attribute</span></span><span> := </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.get_attribute_for_usage(</span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>, </span><span class="variable other basic perl6"><span>$attrname</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>@suggestions</span></span><span>, </span><span class="variable other basic perl6"><span>$attrname</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="meta function perl6"><span>CATCH</span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw(</span><span class="variable other basic perl6"><span>$var</span></span><span>, [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Undeclared</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>], symbol => </span><span class="variable other basic perl6"><span>$name</span></span><span>, suggestions => </span><span class="variable other basic perl6"><span>@suggestions</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$var</span></span><span>.CURSOR.add_mystery(</span><span class="variable other basic perl6"><span>$name</span></span><span>, </span><span class="variable other basic perl6"><span>$var</span></span><span>.</span><span class="support function"><span>to</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>var</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lex</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.cur_lexpad();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%sym</span></span><span> := </span><span class="variable other basic perl6"><span>$lex</span></span><span>.symbol(</span><span class="variable other basic perl6"><span>$name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>%sym</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%sym</span></span><span><used> := 1;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Add mention-only record (used to poison outer</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># usages and disambiguate hashes/blocks by use of</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># $_ when $*IMPLICIT is in force).</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$au</span></span><span> := </span><span class="variable other basic perl6"><span>$lex</span></span><span>.ann(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>also_uses</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$lex</span></span><span>.annotate(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>also_uses</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$au</span></span><span> := {}) </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$au</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$au</span></span><span>{</span><span class="variable other basic perl6"><span>$name</span></span><span>} := 1;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span>}</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span class="keyword other module perl6"><span>grammar</span></span><span> Perl6::Grammar </span><span class="storage modifier type constraints perl6"><span>is</span></span><span> HLL::Grammar does STD {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$sc_id</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> TOP() {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Language braid.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><</span><span class="support type perl6"><span>Regex</span></span><span>> := Perl6::RegexGrammar;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><</span><span class="support type perl6"><span>Regex</span></span><span>-actions> := Perl6::RegexActions;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><P5Regex> := Perl6::P5RegexGrammar;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><P5Regex-actions> := Perl6::P5RegexActions;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><Q> := Perl6::QGrammar;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><Q-actions> := Perl6::QActions;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><MAIN> := Perl6::Grammar;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><MAIN-actions> := Perl6::Actions;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Package declarator to meta-package mapping. Starts pretty much empty;</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># we get the mappings either imported or supplied by the setting. One</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># issue is that we may have no setting to provide them, e.g. when we</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># compile the setting, but it still wants some kinda package. We just</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># fudge in knowhow for that.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*HOWUSE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span><knowhow> := nqp::knowhow();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span><</span><span class="keyword other module perl6"><span>package</span></span><span>> := nqp::knowhow();</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Symbol table and serialization context builder - keeps track of</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># objects that cross the compile-time/run-time boundary that are</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># associated with this compilation unit.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$file</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?FILES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$source_id</span></span><span> := nqp::sha1(</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>defined</span></span><span>(</span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><outer_ctx>)</span></span></div><div class="line"><span class="source perl6"><span> ?? </span><span class="variable language perl6"><span>self</span></span><span>.target() ~ </span><span class="variable other basic perl6"><span>$sc_id</span></span><span>++</span></span></div><div class="line"><span class="source perl6"><span> !! </span><span class="variable language perl6"><span>self</span></span><span>.target());</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span> := nqp::isnull(</span><span class="variable other basic perl6"><span>$file</span></span><span>) ??</span></span></div><div class="line"><span class="source perl6"><span> Perl6::World.</span><span class="support function"><span>new</span></span><span>(:handle(</span><span class="variable other basic perl6"><span>$source_id</span></span><span>)) !!</span></span></div><div class="line"><span class="source perl6"><span> Perl6::World.</span><span class="support function"><span>new</span></span><span>(:handle(</span><span class="variable other basic perl6"><span>$source_id</span></span><span>), :description(</span><span class="variable other basic perl6"><span>$file</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.add_initializations();</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$cursor</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.comp_unit;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pop_lexpad(); </span><span class="comment line number-sign perl6"><span># UNIT</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pop_lexpad(); </span><span class="comment line number-sign perl6"><span># UNIT_OUTER</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$cursor</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span>## Lexer stuff</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> apostrophe {</span></span></div><div class="line"><span class="source perl6"><span> <[ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> \- ]></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token identifier {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <.ident> [ <.apostrophe> <.ident> ]*</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token name {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <identifier> <morename>*</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <morename>+</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token morename {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*QSIGIL := </span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>::</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> || <?before </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> | <alpha> ></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <identifier></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | :dba(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>indirect </span><span class="support function"><span>name</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>) </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> <EXPR></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> || <?before </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>::</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>> <.typed_panic: "X::Syntax::Name::Null"></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token longname {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <name> {} [ <?before </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>:</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> <+alpha+[\< \[ \« ]>> <colonpair> ]*</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token deflongname {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :dba(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="support function"><span>new</span></span><span> </span><span class="support function"><span>name</span></span><span> </span><span class="support function"><span>to</span></span><span> be </span><span class="support function"><span>defined</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <name> <colonpair>*</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token subshortname {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <desigilname></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token sublongname {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <subshortname> <sigterm>?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token defterm { # XXX this is probably too general</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :dba(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="support function"><span>new</span></span><span> term </span><span class="support function"><span>to</span></span><span> be </span><span class="support function"><span>defined</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <identifier></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <colonpair>+</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> if $<colonpair>[0]<coloncircumfix> -> $cf {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> my $category := $<identifier>.Str;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> my $opname := $cf<circumfix></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ?? $*W.colonpair_nibble_to_str($/, $cf<circumfix><nibble>)</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> !! </span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> my $canname := $category ~ ":sym<" ~ $opname ~ ">";</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> my $termname := $category ~ ":<" ~ $opname ~ ">";</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> $/.CURSOR.add_categorical($category, $opname, $canname, $termname, :defterm);</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <?></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token module_name {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <longname></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [ <?[[]> :dba(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>generic </span><span class="keyword other module perl6"><span>role</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>) </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> <arglist> ]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token end_keyword {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <!before <[ \( </span><span class="constant character escape"><span>\\</span></span><span> </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \- ]> || \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> »</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> spacey { <?[\</span><span class="keyword operator perl6"><span>s</span></span><span class="comment line number-sign perl6"><span>#]> }</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> ENDSTMT {</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | \h* $$ <.ws> <?MARKER(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>endstmt</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> | <.unv>? $$ <.ws> <?MARKER(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>endstmt</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># ws is highly performance sensitive. So, we check if we already marked it</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># at this point with a simple method, and only if that is not the case do</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># we bother doing any pattern matching.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> ws() {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable language perl6"><span>self</span></span><span>.MARKED(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>ws</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>._ws()</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> _ws {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$old_highexpect</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!fresh_highexpect</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>whitespace</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> <!ww></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <.vws> <.heredoc></span></span></div><div class="line"><span class="source perl6"><span> | <.unv></span></span></div><div class="line"><span class="source perl6"><span> | <.unsp></span></span></div><div class="line"><span class="source perl6"><span> ]*</span></span></div><div class="line"><span class="source perl6"><span> <?MARKER(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>ws</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$stub</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!fresh_highexpect</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> unsp {</span></span></div><div class="line"><span class="source perl6"><span> \\ <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>#</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>unspace</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <.vws></span></span></div><div class="line"><span class="source perl6"><span> | <.unv></span></span></div><div class="line"><span class="source perl6"><span> | <.unsp></span></span></div><div class="line"><span class="source perl6"><span> ]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> vws {</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>vertical whitespace</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | \v</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span><<<<<<<</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {} <?</span><span class="keyword operator perl6"><span>before</span></span><span> [.*? \v </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=======</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]: .*? \v </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>>>>>>>></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> > <.sorry: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Found a version control conflict marker</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> \V* \v</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=======</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {} .*? \v </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>>>>>>>></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \V* \v </span><span class="comment line number-sign perl6"><span># ignore second half</span></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> ]+</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> unv {</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>horizontal whitespace</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | \h+</span></span></div><div class="line"><span class="source perl6"><span> | \h* <.comment></span></span></div><div class="line"><span class="source perl6"><span> | <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> [ \w | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="constant character escape"><span>\\</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>] > ^^ <.pod_content_toplevel></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> comment { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> comment:sym<</span><span class="comment line number-sign perl6"><span>#> {</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>#</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {} \N*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> comment:sym<</span><span class="comment line number-sign perl6"><span>#`(...)> {</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>#`</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <?opener> {}</span></span></div><div class="line"><span class="source perl6"><span> [ <.quibble(</span><span class="variable other basic perl6"><span>%*LANG</span></span><span><Q>)> || <.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Comment::Embedded</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> comment:sym<</span><span class="comment line number-sign perl6"><span>#|(...)> {</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>#|</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <?opener> <attachment=.quibble(</span><span class="variable other basic perl6"><span>%*LANG</span></span><span><Q>)></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS_SEEN</span></span><span>{ </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>() } {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS_SEEN</span></span><span>{ </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>() } := 1;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := </span><span class="variable other basic perl6"><span>$<attachment</span></span><span>><nibble>;</span></span></div><div class="line"><span class="source perl6"><span> } </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := nqp::concat(</span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span>, nqp::concat(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span class="constant character escape perl6"><span>\n</span></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="variable other basic perl6"><span>$<attachment</span></span><span>><nibble>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> comment:sym<</span><span class="comment line number-sign perl6"><span>#|> {</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>#|</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="variable other basic perl6"><span>$<attachment</span></span><span>>=[\N*]</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS_SEEN</span></span><span>{ </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>() } {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS_SEEN</span></span><span>{ </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>() } := 1;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := </span><span class="variable other basic perl6"><span>$<attachment</span></span><span>>;</span></span></div><div class="line"><span class="source perl6"><span> } </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := nqp::concat(</span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span>, nqp::concat(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span class="constant character escape perl6"><span>\n</span></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="variable other basic perl6"><span>$<attachment</span></span><span>>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> comment:sym<</span><span class="comment line number-sign perl6"><span>#=(...)> {</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>#=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <?opener> <attachment=.quibble(</span><span class="variable other basic perl6"><span>%*LANG</span></span><span><Q>)></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.attach_trailing_docs(~</span><span class="variable other basic perl6"><span>$<attachment</span></span><span>><nibble>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> comment:sym<</span><span class="comment line number-sign perl6"><span>#=> {</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>#=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="variable other basic perl6"><span>$<attachment</span></span><span>>=[\N*]</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.attach_trailing_docs(~</span><span class="variable other basic perl6"><span>$<attachment</span></span><span>>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> attach_leading_docs() {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> ~</span><span class="variable other basic perl6"><span>$*DOC</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$cont</span></span><span> := Perl6::Pod::serialize_aos(</span></span></div><div class="line"><span class="source perl6"><span> [Perl6::Pod::formatted_text(~</span><span class="variable other basic perl6"><span>$*DOC</span></span><span>)]</span></span></div><div class="line"><span class="source perl6"><span> ).compile_time_value;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$block</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.add_constant(</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Pod::Block::Declarator</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>type_new</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> :nocache, :leading([</span><span class="variable other basic perl6"><span>$cont</span></span><span>]),</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCK</span></span><span> := </span><span class="variable other basic perl6"><span>$block</span></span><span>.compile_time_value;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS</span></span><span>.</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>$*POD_BLOCK</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> attach_trailing_docs(</span><span class="variable other basic perl6"><span>$doc</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS_SEEN</span></span><span>{ </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>() } {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS_SEEN</span></span><span>{ </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>() } := 1;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$pod_block</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$doc</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$cont</span></span><span> := Perl6::Pod::serialize_aos(</span></span></div><div class="line"><span class="source perl6"><span> [Perl6::Pod::formatted_text(</span><span class="variable other basic perl6"><span>$doc</span></span><span>)]</span></span></div><div class="line"><span class="source perl6"><span> ).compile_time_value;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$block</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.add_constant(</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Pod::Block::Declarator</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>type_new</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> :nocache, :trailing([</span><span class="variable other basic perl6"><span>$cont</span></span><span>]),</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$pod_block</span></span><span> := </span><span class="variable other basic perl6"><span>$block</span></span><span>.compile_time_value;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span> =:= Mu {</span></span></div><div class="line"><span class="source perl6"><span> Perl6::Pod::document($/, </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span>, </span><span class="variable other basic perl6"><span>$pod_block</span></span><span>, :trailing);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_content_toplevel {</span></span></div><div class="line"><span class="source perl6"><span> <pod_block></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_content { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_content:sym<block> {</span></span></div><div class="line"><span class="source perl6"><span> <pod_newline>*</span></span></div><div class="line"><span class="source perl6"><span> <pod_block></span></span></div><div class="line"><span class="source perl6"><span> <pod_newline>*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># any number of paragraphs of text</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_content:sym<text> {</span></span></div><div class="line"><span class="source perl6"><span> <pod_newline>*</span></span></div><div class="line"><span class="source perl6"><span> <pod_textcontent>+ % <pod_newline>+</span></span></div><div class="line"><span class="source perl6"><span> <pod_newline>*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># not a block, just a directive</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_content:sym<config> {</span></span></div><div class="line"><span class="source perl6"><span> <pod_newline>*</span></span></div><div class="line"><span class="source perl6"><span> ^^ \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=config</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="variable other basic perl6"><span>$<type</span></span><span>>=\S+ <pod_configuration></span></span></div><div class="line"><span class="source perl6"><span> <pod_newline>+</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_textcontent { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># text not being code</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_textcontent:sym<regular> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>=[ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> <?{ </span><span class="variable other basic perl6"><span>$*POD_IN_CODE_BLOCK</span></span></span></div><div class="line"><span class="source perl6"><span> || !</span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span></span></div><div class="line"><span class="source perl6"><span> || (</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>to</span></span><span> - </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>from</span></span><span>) <= </span><span class="variable other basic perl6"><span>$*VMARGIN</span></span><span> }></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<text</span></span><span>> = [</span></span></div><div class="line"><span class="source perl6"><span> \h* <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> <pod_string> [ <pod_newline> | $ ]</span></span></div><div class="line"><span class="source perl6"><span> ] +</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_textcontent:sym<code> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>=[ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> <?{ !</span><span class="variable other basic perl6"><span>$*POD_IN_CODE_BLOCK</span></span></span></div><div class="line"><span class="source perl6"><span> && </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span></span></div><div class="line"><span class="source perl6"><span> && (</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>to</span></span><span> - </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>from</span></span><span>) > </span><span class="variable other basic perl6"><span>$*VMARGIN</span></span><span> }></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<text</span></span><span>> = [</span></span></div><div class="line"><span class="source perl6"><span> [<!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> \N+]+ % [<pod_newline>+ </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>]</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_formatting_code {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_IN_FORMATTINGCODE</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_IN_FORMATTINGCODE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ANGLE_COUNT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> <?{ </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> }></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <code=[A..</span><span class="keyword operator perl6"><span>Z</span></span><span>]></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<begin-tag</span></span><span>>=[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span><</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>+ <![<]> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>«</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>] { </span><span class="variable other basic perl6"><span>$*POD_IN_FORMATTINGCODE</span></span><span> := 1 }</span></span></div><div class="line"><span class="source perl6"><span> <?{</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$codenum</span></span><span> := nqp::</span><span class="support function"><span>ord</span></span><span>(</span><span class="variable other basic perl6"><span>$<code</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>) - nqp::</span><span class="support function"><span>ord</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>A</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> !(</span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> +& (2 ** </span><span class="variable other basic perl6"><span>$codenum</span></span><span>)) {</span></span></div><div class="line"><span class="source perl6"><span> 0</span></span></div><div class="line"><span class="source perl6"><span> } </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> ~</span><span class="variable other basic perl6"><span>$<begin-tag</span></span><span>> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>«</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span> := </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>»</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> := -1;</span></span></div><div class="line"><span class="source perl6"><span> 1</span></span></div><div class="line"><span class="source perl6"><span> } </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>int</span></span><span> </span><span class="variable other basic perl6"><span>$ct</span></span><span> := nqp::</span><span class="support function"><span>chars</span></span><span>(</span><span class="variable other basic perl6"><span>$<begin-tag</span></span><span>>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span> := nqp::</span><span class="keyword operator perl6"><span>x</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="variable other basic perl6"><span>$ct</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$rv</span></span><span> := </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> <= 0 || </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> >= </span><span class="variable other basic perl6"><span>$ct</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> := </span><span class="variable other basic perl6"><span>$ct</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$rv</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$<code</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>V</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> || </span><span class="variable other basic perl6"><span>$<code</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>C</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> [ <!{</span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>E</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<contents</span></span><span>>=[</span></span></div><div class="line"><span class="source perl6"><span> <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> [ <?{</span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>L</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> && </span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>D</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> && </span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }> || <!</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span>* \| > ]</span></span></div><div class="line"><span class="source perl6"><span> <pod_string_character></span></span></div><div class="line"><span class="source perl6"><span> ]*</span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <?{</span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>L</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}> \</span><span class="keyword operator perl6"><span>s</span></span><span>* \| \</span><span class="keyword operator perl6"><span>s</span></span><span>* </span><span class="variable other basic perl6"><span>$<meta</span></span><span>>=[<!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span>>.]+</span></span></div><div class="line"><span class="source perl6"><span> | <?{</span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}> \</span><span class="keyword operator perl6"><span>s</span></span><span>* \| \</span><span class="keyword operator perl6"><span>s</span></span><span>* ( [</span><span class="variable other basic perl6"><span>$<meta</span></span><span>>=[<!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span> | <[,;]> >.]+] +% \, ) +% \;</span></span></div><div class="line"><span class="source perl6"><span> | <?{</span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>D</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}> \</span><span class="keyword operator perl6"><span>s</span></span><span>* \| \</span><span class="keyword operator perl6"><span>s</span></span><span>* [</span><span class="variable other basic perl6"><span>$<meta</span></span><span>>=[<!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span> | \; >.]+] +% \;</span></span></div><div class="line"><span class="source perl6"><span> | <?{</span><span class="variable other basic perl6"><span>$<code</span></span><span>> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>E</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}> ( <integer> | </span><span class="variable other basic perl6"><span>$<uni_name</span></span><span>>=<[A..</span><span class="keyword operator perl6"><span>Z</span></span><span>\</span><span class="keyword operator perl6"><span>s</span></span><span>]>+ <![a..z]> || </span><span class="variable other basic perl6"><span>$<html_ref</span></span><span>>=<[A..Za..z]>+ ) +% \;</span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="variable other basic perl6"><span>$endtag</span></span><span> || <.worry: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Pod formatting code $<code> missing endtag '$endtag'.</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_balanced_braces {</span></span></div><div class="line"><span class="source perl6"><span> <?{ </span><span class="variable other basic perl6"><span>$*POD_IN_FORMATTINGCODE</span></span><span> }></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<braces</span></span><span>>=[</span></span></div><div class="line"><span class="source perl6"><span> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span><</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>+ <![<]></span></span></div><div class="line"><span class="source perl6"><span> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>+ <![>]></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> <?{ nqp::</span><span class="support function"><span>chars</span></span><span>(</span><span class="variable other basic perl6"><span>$<braces</span></span><span>>) < </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> || </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> < 0 }></span></span></div><div class="line"><span class="source perl6"><span> ||</span></span></div><div class="line"><span class="source perl6"><span> <?{ </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> >= 1 }></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<start</span></span><span>>=[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span><</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>+] <![<]></span></span></div><div class="line"><span class="source perl6"><span> <?{ nqp::</span><span class="support function"><span>chars</span></span><span>(</span><span class="variable other basic perl6"><span>$<start</span></span><span>>) == </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> || </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> < 0 }></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$endtag</span></span><span> := nqp::</span><span class="keyword operator perl6"><span>x</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, nqp::</span><span class="support function"><span>chars</span></span><span>(</span><span class="variable other basic perl6"><span>$<start</span></span><span>>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<contents</span></span><span>>=[ <pod_string_character>*?]</span></span></div><div class="line"><span class="source perl6"><span> <!</span><span class="keyword operator perl6"><span>after</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> </span><span class="variable other basic perl6"><span>$<endtag</span></span><span>>=[</span><span class="variable other basic perl6"><span>$endtag</span></span><span>]</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_string {</span></span></div><div class="line"><span class="source perl6"><span> <pod_string_character>+</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_string_character {</span></span></div><div class="line"><span class="source perl6"><span> <pod_balanced_braces> || <pod_formatting_code> || </span><span class="variable other basic perl6"><span>$<char</span></span><span>>=[ \N || [</span></span></div><div class="line"><span class="source perl6"><span> <?{ </span><span class="variable other basic perl6"><span>$*POD_IN_FORMATTINGCODE</span></span><span> }> \n [</span></span></div><div class="line"><span class="source perl6"><span> <?{ </span><span class="variable other basic perl6"><span>$*POD_DELIMITED_CODE_BLOCK</span></span><span> }> <!</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ code> ||</span></span></div><div class="line"><span class="source perl6"><span> <!</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_configuration(</span><span class="variable other basic perl6"><span>$spaces</span></span><span> = </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> [ [\n </span><span class="variable other basic perl6"><span>$spaces</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]? \h+ <colonpair> ]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<delimited_comment> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=begin</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>comment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline>+</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<pod_content</span></span><span>> = [ .*? ]</span></span></div><div class="line"><span class="source perl6"><span> ^^ </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>comment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> [ <pod_newline> | $ ]</span></span></div><div class="line"><span class="source perl6"><span> || {$/.CURSOR.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Pod::BeginWithoutEnd</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, type => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>comment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, spaces => ~</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>}</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<delimited> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=begin</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> [ <?pod_newline></span></span></div><div class="line"><span class="source perl6"><span> <.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Pod::BeginWithoutIdentifier</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> \h+ <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>finish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*VMARGIN</span></span><span> := </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>to</span></span><span> - </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>from</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<type</span></span><span>> = [</span></span></div><div class="line"><span class="source perl6"><span> <pod_code_parent> { </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span><span> := 1 }</span></span></div><div class="line"><span class="source perl6"><span> || <identifier></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline>+</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> <pod_content> *</span></span></div><div class="line"><span class="source perl6"><span> ^^ </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="variable other basic perl6"><span>$<type</span></span><span>> [ <pod_newline> | $ ]</span></span></div><div class="line"><span class="source perl6"><span> || {$/.CURSOR.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Pod::BeginWithoutEnd</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, type => ~</span><span class="variable other basic perl6"><span>$<type</span></span><span>>, spaces => ~</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>}</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<delimited_table> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=begin</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>table</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline>+</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="variable other basic perl6"><span>$<table_row</span></span><span>>=<.table_row_or_blank> ]*</span></span></div><div class="line"><span class="source perl6"><span> ^^ \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>table</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> [ <pod_newline> | $ ]</span></span></div><div class="line"><span class="source perl6"><span> || {$/.CURSOR.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Pod::BeginWithoutEnd</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, type => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>table</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, spaces => ~</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>}</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<delimited_code> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=begin</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>code</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_IN_CODE_BLOCK</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_DELIMITED_CODE_BLOCK</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline>+</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <delimited_code_content(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)></span></span></div><div class="line"><span class="source perl6"><span> || {$/.CURSOR.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Pod::BeginWithoutEnd</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, type => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>code</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, spaces => ~</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>}</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> delimited_code_content(</span><span class="variable other basic perl6"><span>$spaces</span></span><span> = </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> (</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="variable other basic perl6"><span>$spaces</span></span></span></div><div class="line"><span class="source perl6"><span> <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>code</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> [ <pod_newline> | $ ]></span></span></div><div class="line"><span class="source perl6"><span> <pod_string>**0..1 <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> | <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> )*</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$spaces</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>code</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> [ <pod_newline> | $ ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> table_row {</span></span></div><div class="line"><span class="source perl6"><span> \h* <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> \N+ [ \n | $ ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> table_row_or_blank {</span></span></div><div class="line"><span class="source perl6"><span> <.table_row> | [\h* <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> \n ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<finish> {</span></span></div><div class="line"><span class="source perl6"><span> ^^ \h*</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=begin</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>finish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=for</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>finish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=finish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> .*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<paragraph> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=for</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>finish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*VMARGIN</span></span><span> := </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>to</span></span><span> - </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>from</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<type</span></span><span>> = [</span></span></div><div class="line"><span class="source perl6"><span> <pod_code_parent> { </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span><span> := 1 }</span></span></div><div class="line"><span class="source perl6"><span> || <identifier></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> <pod_content=.pod_textcontent>**0..1</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<paragraph_comment> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=for</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>comment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<pod_content</span></span><span>> = [ \h* <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> \N+ [ \n | $ ] ]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<paragraph_table> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=for</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>table</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> [ <!</span><span class="keyword operator perl6"><span>before</span></span><span> \h* \n> <table_row>]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<paragraph_code> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=for</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>code</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_IN_CODE_BLOCK</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> <pod_configuration(</span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>)> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> [ <!</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> <pod_line> ]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<abbreviated> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <!</span><span class="keyword operator perl6"><span>before</span></span><span> begin || </span><span class="support function"><span>end</span></span><span> || </span><span class="keyword control repeat perl6"><span>for</span></span><span> || finish || config></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*VMARGIN</span></span><span> := </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>to</span></span><span> - </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>>.</span><span class="support function"><span>from</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<type</span></span><span>> = [</span></span></div><div class="line"><span class="source perl6"><span> <pod_code_parent> { </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span><span> := 1 }</span></span></div><div class="line"><span class="source perl6"><span> || <identifier></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> [\h*\n|\h+]</span></span></div><div class="line"><span class="source perl6"><span> <pod_content=.pod_textcontent>**0..1</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<abbreviated_comment> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=comment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> [\h*\n|\h+]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<pod_content</span></span><span>> = [ \h* <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> \N+ [ \n | $ ] ]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<abbreviated_table> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=table</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*POD_ALLOW_FCODES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> <pod_newline></span></span></div><div class="line"><span class="source perl6"><span> [ <!</span><span class="keyword operator perl6"><span>before</span></span><span> \h* \n> <table_row>]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_block:sym<abbreviated_code> {</span></span></div><div class="line"><span class="source perl6"><span> ^^</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<spaces</span></span><span>> = [ \h* ]</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=code</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {}</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_IN_CODE_BLOCK</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> [\h*\n|\h+]</span></span></div><div class="line"><span class="source perl6"><span> [ <!</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \w> <pod_line> ]*</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_line { <pod_string>**1 [ <pod_newline> | $ ] }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_newline {</span></span></div><div class="line"><span class="source perl6"><span> \h* \n</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pod_code_parent {</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>pod</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>item</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \d* | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>nested</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>defn</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>finish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ]</span></span></div><div class="line"><span class="source perl6"><span> | <upper>+</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> <![\w]></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> install_doc_phaser { <?> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> vnum {</span></span></div><div class="line"><span class="source perl6"><span> \d+ | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>*</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> version {</span></span></div><div class="line"><span class="source perl6"><span> <?</span><span class="keyword operator perl6"><span>before</span></span><span> v\d+> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>v</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> </span><span class="variable other basic perl6"><span>$<vstr</span></span><span>>=[<vnum>+ % </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>.</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>+</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>?]</span></span></div><div class="line"><span class="source perl6"><span> <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>-</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>|\</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>> # cheat because of LTM fail</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ## Top-level rules</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token comp_unit {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> # From STD.pm.</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LEFTSIGIL; # sigil of LHS for item vs list assignment</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*SCOPE := </span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span>; # which scope declarator we</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="support function"><span>re</span></span><span> under</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; </span><span class="comment line number-sign perl6"><span># which multi declarator we're under</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*QSIGIL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; </span><span class="comment line number-sign perl6"><span># sigil of current interpolation</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_META</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; </span><span class="comment line number-sign perl6"><span># parsing a metaoperator like [..]</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_REDUCE</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># attempting to parse an [op] construct</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span>; </span><span class="comment line number-sign perl6"><span># what declaration we're in</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*HAS_SELF</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; </span><span class="comment line number-sign perl6"><span># is 'self' available? (for $.foo style calls)</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*MONKEY_TYPING</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># whether augment/supersede are allowed</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*begin_compunit</span></span><span> := 1; </span><span class="comment line number-sign perl6"><span># whether we're at start of a compilation unit</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>; </span><span class="comment line number-sign perl6"><span># the current thingy we're declaring, and subject of traits</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*METHODTYPE</span></span><span>; </span><span class="comment line number-sign perl6"><span># the current type of method we're in, if any</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>; </span><span class="comment line number-sign perl6"><span># what type of package we're in, if any</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*MYSTERY</span></span><span>; </span><span class="comment line number-sign perl6"><span># names we assume may be post-declared functions</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*BORG</span></span><span>; </span><span class="comment line number-sign perl6"><span># who gets blamed for a missing block</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*CCSTATE</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*STRICT</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*INVOCANT_OK</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*INVOCANT</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Error related. There are three levels: worry (just a warning), sorry</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># (fatal but not immediately so) and panic (immediately deadly). There</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># is a limit on the number of sorrows also. Unlike STD, which emits the</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># textual messages as it goes, we keep track of the exception objects</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># and, if needed, make a compositite exception group.</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@*WORRIES</span></span><span>; </span><span class="comment line number-sign perl6"><span># exception objects resulting from worry</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@*SORROWS</span></span><span>; </span><span class="comment line number-sign perl6"><span># exception objects resulting from sorry</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*SORRY_LIMIT</span></span><span> := 10; </span><span class="comment line number-sign perl6"><span># when sorrow turns to panic</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Extras.</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*METAOPGEN</span></span><span>; </span><span class="comment line number-sign perl6"><span># hash of generated metaops</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*HANDLERS</span></span><span>; </span><span class="comment line number-sign perl6"><span># block exception handlers</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IMPLICIT</span></span><span>; </span><span class="comment line number-sign perl6"><span># whether we allow an implicit param</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*FORBID_PIR</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># whether pir::op and Q:PIR { } are disallowed</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*HAS_YOU_ARE_HERE</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># whether {YOU_ARE_HERE} has shown up</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*OFTYPE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*VMARGIN</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># pod stuff</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ALLOW_INLINE_CODE</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># pod stuff</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_IN_CODE_BLOCK</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># pod stuff</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_IN_FORMATTINGCODE</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># pod stuff</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ALLOW_FCODES</span></span><span> := 0b11111111111111111111111111; </span><span class="comment line number-sign perl6"><span># allow which fcodes?</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_ANGLE_COUNT</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># pod stuff</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_REGEX_ASSERTION</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*SOFT</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># is the soft pragma in effect</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_PROTO</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># are we inside a proto?</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Various interesting scopes we'd like to keep to hand.</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*SETTING</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*EXPORT</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># stack of packages, which the 'is export' needs</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@*PACKAGES</span></span><span> := [];</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># A place for Pod</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS</span></span><span> := [];</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCKS_SEEN</span></span><span> := {};</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_PAST</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span>; </span><span class="comment line number-sign perl6"><span># for #= comments</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> := -1; </span><span class="comment line number-sign perl6"><span># XXX update this when I see another comment like it?</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Quasis and unquotes</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_QUASI</span></span><span> := 0; </span><span class="comment line number-sign perl6"><span># whether we're currently in a quasi block</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*MAIN</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>MAIN</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># performance improvement stuff</span></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*FAKE_INFIX_FOUND</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Setting loading and symbol setup.</span></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Create unit outer (where we assemble any lexicals accumulated</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># from e.g. REPL) and the real UNIT.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.push_lexpad($/);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*UNIT</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.push_lexpad($/);</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># If we already have a specified outer context, then that's</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># our setting. Otherwise, load one.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> := nqp::</span><span class="support function"><span>defined</span></span><span>(</span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><outer_ctx>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>.annotate(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>IN_DECL</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>eval</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*SETTING</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.load_setting($/, </span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><setting> // </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>CORE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>.annotate(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>IN_DECL</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>mainline</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.unitstart();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control control-handlers perl6"><span>try</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$EXPORTHOW</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORTHOW</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$EXPORTHOW</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span>{</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>key</span></span><span>} := </span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Create GLOBAL(ish), unless we were given one.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>global</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span> := </span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><global>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> && </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>GLOBALish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.force_value(</span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>GLOBALish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>GLOBALish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>%*HOW</span></span><span><</span><span class="keyword other module perl6"><span>package</span></span><span>>, :</span><span class="support function"><span>name</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>GLOBAL</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_compose(</span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Create or pull in existing EXPORT.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> && </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*EXPORT</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.force_value(</span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*EXPORT</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>%*HOW</span></span><span><</span><span class="keyword other module perl6"><span>package</span></span><span>>, :</span><span class="support function"><span>name</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_compose(</span><span class="variable other basic perl6"><span>$*EXPORT</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># If there's a self in scope, set $*HAS_SELF.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> && </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>self</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*HAS_SELF</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>complete</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Take current package from outer context if any, otherwise for a</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># fresh compilation unit we start in GLOBAL.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> && </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.force_value(</span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span> := </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># If we're eval'ing in the context of a %?LANG, set up our own</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># %*LANG based on it.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> && </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%?LANG</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.force_value(</span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%?LANG</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%?LANG</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1).FLATTENABLE_HASH() {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span>{</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>key</span></span><span>} := </span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> && </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*MAIN</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*MAIN</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.force_value(</span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*MAIN</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*MAIN</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$have_outer</span></span><span> && </span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?STRICT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*STRICT</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.force_value(</span><span class="variable other basic perl6"><span>$*UNIT_OUTER</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*STRICT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*STRICT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$FILES</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?FILES</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*STRICT</span></span><span> := !nqp::isnull(</span><span class="variable other basic perl6"><span>$FILES</span></span><span>) && </span><span class="variable other basic perl6"><span>$FILES</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>-e</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Install unless we've no setting, in which case we've likely no</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># static lexpad class yet either. Also, UNIT needs a code object.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><setting> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>NULL</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>GLOBALish</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*EXPORT</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stub_code_object(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$M</span></span><span> := </span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><M>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::</span><span class="support function"><span>defined</span></span><span>(</span><span class="variable other basic perl6"><span>$M</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> nqp::islist(</span><span class="variable other basic perl6"><span>$M</span></span><span>) ?? </span><span class="variable other basic perl6"><span>$M</span></span><span> !! [</span><span class="variable other basic perl6"><span>$M</span></span><span>] -> </span><span class="variable other basic perl6"><span>$longname</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$module</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.load_module($/, </span><span class="variable other basic perl6"><span>$longname</span></span><span>, {}, </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> do_import($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>, </span><span class="variable other basic perl6"><span>$longname</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.import_EXPORTHOW($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> <.finishpad></span></span></div><div class="line"><span class="source perl6"><span> <.bom>?</span></span></div><div class="line"><span class="source perl6"><span> <statementlist=.FOREIGN_LANG(</span><span class="variable other basic perl6"><span>$*MAIN</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>statementlist</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1)></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> <.install_doc_phaser></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> [ $ || <.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Confused</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> ]</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Emit any errors/worries.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.explain_mystery();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>@*SORROWS</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> +</span><span class="variable other basic perl6"><span>@*SORROWS</span></span><span> == 1 && !</span><span class="variable other basic perl6"><span>@*WORRIES</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>@*SORROWS</span></span><span>[0].throw()</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.group_exception(</span><span class="variable other basic perl6"><span>@*SORROWS</span></span><span>.</span><span class="support function"><span>pop</span></span><span>).throw();</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>@*WORRIES</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::printfh(nqp::getstderr(), </span><span class="variable other basic perl6"><span>$*W</span></span><span>.group_exception().</span><span class="support function"><span>gist</span></span><span>());</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Install POD-related variables.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*POD_PAST</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.add_constant(</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Array</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>type_new</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, :nocache, |</span><span class="variable other basic perl6"><span>$*POD_BLOCKS</span></span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$=pod</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*POD_PAST</span></span><span>.compile_time_value</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Tag UNIT with a magical lexical. Also if we're compiling CORE,</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># give it such a tag too.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><setting> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>NULL</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$marker</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>%*HOW</span></span><span><</span><span class="keyword other module perl6"><span>package</span></span><span>>, :</span><span class="support function"><span>name</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!CORE_MARKER</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$marker</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.compose(</span><span class="variable other basic perl6"><span>$marker</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!CORE_MARKER</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$marker</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$marker</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>%*HOW</span></span><span><</span><span class="keyword other module perl6"><span>package</span></span><span>>, :</span><span class="support function"><span>name</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!UNIT_MARKER</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$marker</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.compose(</span><span class="variable other basic perl6"><span>$marker</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!UNIT_MARKER</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$marker</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># CHECK time.</span></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*W</span></span><span>.</span><span class="meta function perl6"><span>CHECK</span></span><span>(); }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> import_EXPORTHOW($/, </span><span class="variable other basic perl6"><span>$UNIT</span></span><span>) { </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>$UNIT</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORTHOW</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$UNIT</span></span><span><EXPORTHOW>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>str</span></span><span> </span><span class="variable other basic perl6"><span>$key</span></span><span> := </span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>key</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$key</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>SUPERSEDE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%SUPERSEDE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>%SUPERSEDE</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>str</span></span><span> </span><span class="variable other basic perl6"><span>$pdecl</span></span><span> := </span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>key</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$meta</span></span><span> := nqp::decont(</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>%*HOW</span></span><span>, </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::EXPORTHOW::NothingToSupersede</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> declarator => </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>%*HOWUSE</span></span><span>, </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::EXPORTHOW::Conflict</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> declarator => </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>, directive => </span><span class="variable other basic perl6"><span>$key</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span>{</span><span class="variable other basic perl6"><span>$pdecl</span></span><span>} := </span><span class="variable other basic perl6"><span>$meta</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOWUSE</span></span><span>{</span><span class="variable other basic perl6"><span>$pdecl</span></span><span>} := nqp::hash(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>SUPERSEDE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$meta</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$key</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>DECLARE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%DECLARE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>%DECLARE</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>str</span></span><span> </span><span class="variable other basic perl6"><span>$pdecl</span></span><span> := </span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>key</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$meta</span></span><span> := nqp::decont(</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>%*HOW</span></span><span>, </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::EXPORTHOW::Conflict</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> declarator => </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>, directive => </span><span class="variable other basic perl6"><span>$key</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span>{</span><span class="variable other basic perl6"><span>$pdecl</span></span><span>} := </span><span class="variable other basic perl6"><span>$meta</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOWUSE</span></span><span>{</span><span class="variable other basic perl6"><span>$pdecl</span></span><span>} := nqp::hash(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>DECLARE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$meta</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.add_package_declarator(</span><span class="variable other basic perl6"><span>$pdecl</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$key</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>COMPOSE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%COMPOSE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.NYI(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORTHOW::COMPOSE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$key</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> nqp::</span><span class="support function"><span>lc</span></span><span>(</span><span class="variable other basic perl6"><span>$key</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Support legacy API, which behaves like an unchecked</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># supersede.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># XXX Can give deprecation warning in the future, remove</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># before 6.0.0.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span>{</span><span class="variable other basic perl6"><span>$key</span></span><span>} := nqp::decont(</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::EXPORTHOW::InvalidDirective</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, directive => </span><span class="variable other basic perl6"><span>$key</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> add_package_declarator(</span><span class="support type perl6"><span>str</span></span><span> </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Compute name of grammar/action entry.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$canname</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>package_declarator:sym<</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$pdecl</span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Add to grammar if needed.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> nqp::</span><span class="support function"><span>can</span></span><span>(</span><span class="variable language perl6"><span>self</span></span><span>, </span><span class="variable other basic perl6"><span>$canname</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="keyword other module perl6"><span>role</span></span><span> PackageDeclarator[</span><span class="variable other basic perl6"><span>$meth_name</span></span><span>, </span><span class="variable other basic perl6"><span>$declarator</span></span><span>] {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> ::(</span><span class="variable other basic perl6"><span>$meth_name</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*OUTERPACKAGE</span></span><span> := </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> := </span><span class="variable other basic perl6"><span>$declarator</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<sym</span></span><span>>=[</span><span class="variable other basic perl6"><span>$declarator</span></span><span>] <.end_keyword> <package_def></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.mixin(</span><span class="variable language perl6"><span>self</span></span><span>, PackageDeclarator.</span><span class="support function"><span>HOW</span></span><span>.curry(PackageDeclarator, </span><span class="variable other basic perl6"><span>$canname</span></span><span>, </span><span class="variable other basic perl6"><span>$pdecl</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># This also becomes the current MAIN. Also place it in %?LANG.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><MAIN> := </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>WHAT</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*W</span></span><span>.cur_lexpad(), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%?LANG</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.p6ize_recursive(</span><span class="variable other basic perl6"><span>%*LANG</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Add action method if needed.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> nqp::</span><span class="support function"><span>can</span></span><span>(</span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span>, </span><span class="variable other basic perl6"><span>$canname</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="keyword other module perl6"><span>role</span></span><span> PackageDeclaratorAction[</span><span class="variable other basic perl6"><span>$meth</span></span><span>] {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> ::(</span><span class="variable other basic perl6"><span>$meth</span></span><span>)($/) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>make</span></span><span> </span><span class="variable other basic perl6"><span>$<package_def</span></span><span>>.ast;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> };</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><MAIN-actions> := </span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.mixin(</span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> PackageDeclaratorAction.</span><span class="support function"><span>HOW</span></span><span>.curry(PackageDeclaratorAction, </span><span class="variable other basic perl6"><span>$canname</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statementlist(</span><span class="variable other basic perl6"><span>$*statement_level</span></span><span> = 0) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*LANG</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.shallow_copy(nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%*LANG</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*HOW</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.shallow_copy(nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%*HOW</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*HOWUSE</span></span><span> := nqp::hash();</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*STRICT</span></span><span> := nqp::getlexdyn(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*STRICT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>statement list</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | $</span></span></div><div class="line"><span class="source perl6"><span> | <?</span><span class="keyword operator perl6"><span>before</span></span><span> <[\)\]\}]>></span></span></div><div class="line"><span class="source perl6"><span> | [ <statement> <.eat_terminator> ]*</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> shallow_copy(</span><span class="variable other basic perl6"><span>%hash</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%result</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>%hash</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%result</span></span><span>{</span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>key</span></span><span>} := </span><span class="variable other basic perl6"><span>$_</span></span><span>.</span><span class="support function"><span>value</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%result</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> semilist {</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>lol composer</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <?</span><span class="keyword operator perl6"><span>before</span></span><span> <[)\]}]> ></span></span></div><div class="line"><span class="source perl6"><span> | [<statement><.eat_terminator> ]*</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> sequence {</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>sequence of statements</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <?</span><span class="keyword operator perl6"><span>before</span></span><span> <[)\]}]> ></span></span></div><div class="line"><span class="source perl6"><span> | [<statement><.eat_terminator> ]*</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> label {</span></span></div><div class="line"><span class="source perl6"><span> <identifier> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>:</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <?[\</span><span class="keyword operator perl6"><span>s</span></span><span>]> <.ws></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*LABEL</span></span><span> := ~</span><span class="variable other basic perl6"><span>$<identifier</span></span><span>>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.already_declared(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>my</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.cur_lexpad(), [</span><span class="variable other basic perl6"><span>$*LABEL</span></span><span>]) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw($/, [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Redeclaration</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>], symbol => </span><span class="variable other basic perl6"><span>$*LABEL</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>str</span></span><span> </span><span class="variable other basic perl6"><span>$orig</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.orig();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>int</span></span><span> </span><span class="variable other basic perl6"><span>$total</span></span><span> := nqp::</span><span class="support function"><span>chars</span></span><span>(</span><span class="variable other basic perl6"><span>$orig</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>int</span></span><span> </span><span class="variable other basic perl6"><span>$from</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.MATCH.</span><span class="support function"><span>from</span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>int</span></span><span> </span><span class="variable other basic perl6"><span>$to</span></span><span> := </span><span class="variable language perl6"><span>self</span></span><span>.MATCH.</span><span class="support function"><span>to</span></span><span>() + nqp::</span><span class="support function"><span>chars</span></span><span>(</span><span class="variable other basic perl6"><span>$*LABEL</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>int</span></span><span> </span><span class="variable other basic perl6"><span>$line</span></span><span> := HLL::Compiler.lineof(</span><span class="variable other basic perl6"><span>$orig</span></span><span>, </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>());</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>str</span></span><span> </span><span class="variable other basic perl6"><span>$prematch</span></span><span> := nqp::</span><span class="support function"><span>substr</span></span><span>(</span><span class="variable other basic perl6"><span>$orig</span></span><span>, </span><span class="variable other basic perl6"><span>$from</span></span><span> > 20 ?? </span><span class="variable other basic perl6"><span>$from</span></span><span> - 20 !! 0, </span><span class="variable other basic perl6"><span>$from</span></span><span> > 20 ?? 20 !! </span><span class="variable other basic perl6"><span>$from</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="support type perl6"><span>str</span></span><span> </span><span class="variable other basic perl6"><span>$postmatch</span></span><span> := nqp::</span><span class="support function"><span>substr</span></span><span>(</span><span class="variable other basic perl6"><span>$orig</span></span><span>, </span><span class="variable other basic perl6"><span>$to</span></span><span>, 20);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$label</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Label</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]).</span><span class="support function"><span>new</span></span><span>( :</span><span class="support function"><span>name</span></span><span>(</span><span class="variable other basic perl6"><span>$*LABEL</span></span><span>), :</span><span class="variable other basic perl6"><span>$line</span></span><span>, :</span><span class="variable other basic perl6"><span>$prematch</span></span><span>, :</span><span class="variable other basic perl6"><span>$postmatch</span></span><span> );</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.add_object(</span><span class="variable other basic perl6"><span>$label</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$*W</span></span><span>.cur_lexpad(), </span><span class="variable other basic perl6"><span>$*LABEL</span></span><span>, </span><span class="variable other basic perl6"><span>$label</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement(</span><span class="variable other basic perl6"><span>$*LABEL</span></span><span> = </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*QSIGIL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span> := </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><MAIN-actions>;</span></span></div><div class="line"><span class="source perl6"><span> <!</span><span class="keyword operator perl6"><span>before</span></span><span> <[\])}]> | $ ></span></span></div><div class="line"><span class="source perl6"><span> <!stopper></span></span></div><div class="line"><span class="source perl6"><span> <!!{ nqp::rebless($/.CURSOR, </span><span class="variable other basic perl6"><span>%*LANG</span></span><span><MAIN>) }></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <label> <statement(</span><span class="variable other basic perl6"><span>$*LABEL</span></span><span>)> { </span><span class="variable other basic perl6"><span>$*LABEL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*LABEL</span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> | <statement_control></span></span></div><div class="line"><span class="source perl6"><span> | <EXPR> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>statement end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <?MARKED(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>endstmt</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> || :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>statement modifier</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) <.ws> <statement_mod_cond> <statement_mod_loop>?</span></span></div><div class="line"><span class="source perl6"><span> || :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>statement modifier loop</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) <.ws> <statement_mod_loop></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$sp</span></span><span> := </span><span class="variable other basic perl6"><span>$<EXPR</span></span><span>><statement_prefix>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$sp</span></span><span> && </span><span class="variable other basic perl6"><span>$sp</span></span><span><sym> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>do</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$s</span></span><span> := </span><span class="variable other basic perl6"><span>$<statement_mod_loop</span></span><span>><sym>;</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.obs(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>do...</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$s</span></span><span>, </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>repeat...while or repeat...until</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> | <?[;]></span></span></div><div class="line"><span class="source perl6"><span> | <?stopper></span></span></div><div class="line"><span class="source perl6"><span> | {} <.panic: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Bogus statement</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> eat_terminator {</span></span></div><div class="line"><span class="source perl6"><span> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> || <?MARKED(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>endstmt</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> <.ws></span></span></div><div class="line"><span class="source perl6"><span> || <?</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>]</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ></span></span></div><div class="line"><span class="source perl6"><span> || $</span></span></div><div class="line"><span class="source perl6"><span> || <?stopper></span></span></div><div class="line"><span class="source perl6"><span> || { $/.CURSOR.typed_panic( </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Confused</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, reason => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Missing semicolon.</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ) }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> xblock(</span><span class="variable other basic perl6"><span>$*IMPLICIT</span></span><span> = 0) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*GOAL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*BORG</span></span><span> := {};</span></span></div><div class="line"><span class="source perl6"><span> <EXPR> <.ws> <pblock(</span><span class="variable other basic perl6"><span>$*IMPLICIT</span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> pblock(</span><span class="variable other basic perl6"><span>$*IMPLICIT</span></span><span> = 0) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stub_code_object(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>parameterized block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <lambda></span></span></div><div class="line"><span class="source perl6"><span> <.newpad></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>my</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*GOAL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <</span><span class="support function"><span>signature</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <blockoid></span></span></div><div class="line"><span class="source perl6"><span> | <?[{]></span></span></div><div class="line"><span class="source perl6"><span> <.newpad></span></span></div><div class="line"><span class="source perl6"><span> <blockoid></span></span></div><div class="line"><span class="source perl6"><span> || {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::ishash(</span><span class="variable other basic perl6"><span>$*BORG</span></span><span>) && </span><span class="variable other basic perl6"><span>$*BORG</span></span><span><block> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$pos</span></span><span> := $/.CURSOR.</span><span class="support function"><span>pos</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*BORG</span></span><span><</span><span class="support function"><span>name</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!clear_highwater</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$*BORG</span></span><span><block>.CURSOR.</span><span class="support function"><span>pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::BlockGobbled</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, what => ~</span><span class="variable other basic perl6"><span>$*BORG</span></span><span><</span><span class="support function"><span>name</span></span><span>>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.missing(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>block (apparently taken by '</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$*BORG</span></span><span><</span><span class="support function"><span>name</span></span><span>> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>')</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> } </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!clear_highwater</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$*BORG</span></span><span><block>.CURSOR.</span><span class="support function"><span>pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::BlockGobbled</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.missing(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>block (apparently taken by expression)</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> } </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>%*MYSTERY</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.missing(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>block (taken by some undeclared routine?)</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> } </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.missing(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>block</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> lambda { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>-></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span><-></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> block(</span><span class="variable other basic perl6"><span>$*IMPLICIT</span></span><span> = 0) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stub_code_object(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>scoped block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [ <?[{]> || <.missing: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>>]</span></span></div><div class="line"><span class="source perl6"><span> <.newpad></span></span></div><div class="line"><span class="source perl6"><span> <blockoid></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> blockoid {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*CURPAD</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%*HANDLERS</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <.finishpad></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{YOU_ARE_HERE}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <you_are_here></span></span></div><div class="line"><span class="source perl6"><span> | :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <statementlist(1)> <?ENDSTMT></span></span></div><div class="line"><span class="source perl6"><span> | <?terminator> { </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Missing</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, what =></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) }</span></span></div><div class="line"><span class="source perl6"><span> | <?> { </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Missing</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, what => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>block</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) }</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*CURPAD</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pop_lexpad() }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> unitstart { <?> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> you_are_here { <?> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> newpad { <?> { </span><span class="variable other basic perl6"><span>$*W</span></span><span>.push_lexpad($/) } }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> finishpad { <?> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> bom { \xFEFF }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<;> { <?[;]> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<)> { <?[)]> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<]> { <?[\]]> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<}> { <?[}]> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<ang> { <?[>]> <?{ </span><span class="variable other basic perl6"><span>$*IN_REGEX_ASSERTION</span></span><span> }> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<</span><span class="keyword control conditional perl6"><span>if</span></span><span>> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>if</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.end_keyword> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<</span><span class="keyword control conditional perl6"><span>unless</span></span><span>> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>unless</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.end_keyword> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<</span><span class="keyword control repeat perl6"><span>while</span></span><span>> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>while</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.end_keyword> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<</span><span class="keyword control repeat perl6"><span>until</span></span><span>> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>until</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.end_keyword> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<</span><span class="keyword control repeat perl6"><span>for</span></span><span>> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>for</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.end_keyword> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<</span><span class="keyword control repeat perl6"><span>given</span></span><span>> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>given</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.end_keyword> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<</span><span class="keyword control flowcontrol perl6"><span>when</span></span><span>> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>when</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.end_keyword> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> terminator:sym<arrow> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>--></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> stdstopper {</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <?MARKED(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>endstmt</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> <?></span></span></div><div class="line"><span class="source perl6"><span> || [</span></span></div><div class="line"><span class="source perl6"><span> | <?terminator></span></span></div><div class="line"><span class="source perl6"><span> | $</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span>## Statement control</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control conditional perl6"><span>if</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> {}</span></span></div><div class="line"><span class="source perl6"><span> <xblock></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>else</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>\h*</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>if</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Malformed::Elsif</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>elif</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> { $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Malformed::Elsif</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, what => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>elif</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>) }</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>elsif</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>\</span><span class="keyword operator perl6"><span>s</span></span><span> <xblock></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> ]*</span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>else</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>\</span><span class="keyword operator perl6"><span>s</span></span><span> <</span><span class="keyword control conditional perl6"><span>else</span></span><span>=.pblock> ]?</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control conditional perl6"><span>unless</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> {}</span></span></div><div class="line"><span class="source perl6"><span> <xblock></span></span></div><div class="line"><span class="source perl6"><span> [ <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>else</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> || <.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::UnlessElse</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control repeat perl6"><span>while</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<sym</span></span><span>>=[</span><span class="keyword control repeat perl6"><span>while</span></span><span>|</span><span class="keyword control repeat perl6"><span>until</span></span><span>]<.end_keyword> {}</span></span></div><div class="line"><span class="source perl6"><span> <xblock></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control repeat perl6"><span>repeat</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> {}</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="variable other basic perl6"><span>$<wu</span></span><span>>=[</span><span class="keyword control repeat perl6"><span>while</span></span><span>|</span><span class="keyword control repeat perl6"><span>until</span></span><span>]\</span><span class="keyword operator perl6"><span>s</span></span><span> <xblock></span></span></div><div class="line"><span class="source perl6"><span> | <pblock></span></span></div><div class="line"><span class="source perl6"><span> [</span><span class="variable other basic perl6"><span>$<wu</span></span><span>>=[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>while</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>|</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>until</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]\</span><span class="keyword operator perl6"><span>s</span></span><span> || <.missing(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>"while" or "until"</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)>]</span></span></div><div class="line"><span class="source perl6"><span> <EXPR></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control repeat perl6"><span>for</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> {}</span></span></div><div class="line"><span class="source perl6"><span> [ <?</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>my</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>\w+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ></span></span></div><div class="line"><span class="source perl6"><span> <.typed_panic: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::P5</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> ]?</span></span></div><div class="line"><span class="source perl6"><span> [ <?</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.EXPR>? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.EXPR>? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.EXPR>? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ></span></span></div><div class="line"><span class="source perl6"><span> <.obs(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>C-style "for (;;)" loop</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>"loop (;;)"</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> ]?</span></span></div><div class="line"><span class="source perl6"><span> <xblock(1)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<foreach> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> <.obs(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>'foreach'</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>'for'</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_control:sym<</span><span class="keyword control repeat perl6"><span>loop</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword></span></span></div><div class="line"><span class="source perl6"><span> [ <?[({]> <.sorry: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Whitespace required after 'loop'</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>> ]?</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="keyword operator perl6"><span>s</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <e1=.EXPR>? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <e2=.EXPR>? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <e3=.EXPR>?</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> <block></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<need> {</span></span></div><div class="line"><span class="source perl6"><span> <sym></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <version></span></span></div><div class="line"><span class="source perl6"><span> | <module_name></span></span></div><div class="line"><span class="source perl6"><span> ] +% </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>$<module_name</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lnd</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.dissect_longname(</span><span class="variable other basic perl6"><span>$_</span></span><span><longname>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$name</span></span><span> := </span><span class="variable other basic perl6"><span>$lnd</span></span><span>.</span><span class="support function"><span>name</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%cp</span></span><span> := </span><span class="variable other basic perl6"><span>$lnd</span></span><span>.colonpairs_hash(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>need</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.load_module($/, </span><span class="variable other basic perl6"><span>$name</span></span><span>, </span><span class="variable other basic perl6"><span>%cp</span></span><span>, </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_control:sym<import> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <.ws></span></span></div><div class="line"><span class="source perl6"><span> <module_name> [ <.spacey> <arglist> ]? <.ws></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*HAS_SELF</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.dissect_longname(</span><span class="variable other basic perl6"><span>$<module_name</span></span><span>><longname>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$module</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$found</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control control-handlers perl6"><span>try</span></span><span> { </span><span class="variable other basic perl6"><span>$module</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol(</span><span class="variable other basic perl6"><span>$longname</span></span><span>.components()); </span><span class="variable other basic perl6"><span>$found</span></span><span> := 1; }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$found</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># todo: fix arglist</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$arglist</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$<arglist</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$arglist</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.compile_time_evaluate($/, </span><span class="variable other basic perl6"><span>$<arglist</span></span><span>><EXPR>.ast);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$arglist</span></span><span> := nqp::getattr(</span><span class="variable other basic perl6"><span>$arglist</span></span><span>.list.</span><span class="support function"><span>eager</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>List</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!items</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> do_import($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>.</span><span class="support function"><span>WHO</span></span><span>, </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support function"><span>name</span></span><span>, </span><span class="variable other basic perl6"><span>$arglist</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Could not find module </span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ ~</span><span class="variable other basic perl6"><span>$<module_name</span></span><span>> ~</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span> to import symbols from</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_control:sym<no> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <sym> <.ws></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <module_name></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> := </span><span class="variable other basic perl6"><span>$<module_name</span></span><span>><longname>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>strict</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Turn on lax mode.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*STRICT</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="keyword control control-handlers perl6"><span>die</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Unknown pragma '$longname'</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> <.ws></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_control:sym<</span><span class="keyword other include perl6"><span>use</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>use</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*HAS_SELF</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>use</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$OLD_MAIN</span></span><span> := ~</span><span class="variable other basic perl6"><span>$*MAIN</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<doc</span></span><span>>=[ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>DOC</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ ]**0..1</span></span></div><div class="line"><span class="source perl6"><span> <sym> <.ws></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <version> [ <?{ ~</span><span class="variable other basic perl6"><span>$<version</span></span><span>><vnum>[0] </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>5</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$module</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.load_module($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Perl5</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, {}, </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> do_import($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Perl5</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.import_EXPORTHOW($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> } ]?</span></span></div><div class="line"><span class="source perl6"><span> [ <?{ ~</span><span class="variable other basic perl6"><span>$<version</span></span><span>><vnum>[0] </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>6</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*MAIN</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>MAIN</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*STRICT</span></span><span> := 1 </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*begin_compunit</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> } ]?</span></span></div><div class="line"><span class="source perl6"><span> | <module_name></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> := </span><span class="variable other basic perl6"><span>$<module_name</span></span><span>><longname>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Some modules are handled in the actions are just turn on a</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># setting of some kind.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>MONKEY_TYPING</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*MONKEY_TYPING</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> := </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>soft</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># This is an approximation; need to pay attention to argument</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># list really.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*SOFT</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> := </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>strict</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Turn off lax mode.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*STRICT</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> := </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>FORBID_PIR</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ||</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Devel::Trace</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ||</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support type perl6"><span>Str</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>fatal</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> := </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <.spacey> <arglist> <?{ </span><span class="variable other basic perl6"><span>$<arglist</span></span><span>><EXPR> }></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lnd</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.dissect_longname(</span><span class="variable other basic perl6"><span>$longname</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$name</span></span><span> := </span><span class="variable other basic perl6"><span>$lnd</span></span><span>.</span><span class="support function"><span>name</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%cp</span></span><span> := </span><span class="variable other basic perl6"><span>$lnd</span></span><span>.colonpairs_hash(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>use</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$arglist</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.compile_time_evaluate($/,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<arglist</span></span><span>><EXPR>.ast);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$arglist</span></span><span> := nqp::getattr(</span><span class="variable other basic perl6"><span>$arglist</span></span><span>.list.</span><span class="support function"><span>eager</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>List</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]), </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!items</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$module</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.load_module($/, </span><span class="variable other basic perl6"><span>$name</span></span><span>, </span><span class="variable other basic perl6"><span>%cp</span></span><span>, </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> do_import($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>, </span><span class="variable other basic perl6"><span>$name</span></span><span>, </span><span class="variable other basic perl6"><span>$arglist</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.import_EXPORTHOW($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> || { </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> ~</span><span class="variable other basic perl6"><span>$<doc</span></span><span>> && !</span><span class="variable other basic perl6"><span>%*COMPILING</span></span><span><</span><span class="variable other basic perl6"><span>%?OPTIONS</span></span><span>><doc> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lnd</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.dissect_longname(</span><span class="variable other basic perl6"><span>$longname</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$name</span></span><span> := </span><span class="variable other basic perl6"><span>$lnd</span></span><span>.</span><span class="support function"><span>name</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%cp</span></span><span> := </span><span class="variable other basic perl6"><span>$lnd</span></span><span>.colonpairs_hash(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>use</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$module</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.load_module($/, </span><span class="variable other basic perl6"><span>$name</span></span><span>, </span><span class="variable other basic perl6"><span>%cp</span></span><span>, </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> do_import($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>, </span><span class="variable other basic perl6"><span>$name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.import_EXPORTHOW($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> [ <?{ </span><span class="variable other basic perl6"><span>$*MAIN</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="variable other basic perl6"><span>$OLD_MAIN</span></span><span> }></span></span></div><div class="line"><span class="source perl6"><span> <.eat_terminator></span></span></div><div class="line"><span class="source perl6"><span> <statementlist=.FOREIGN_LANG(</span><span class="variable other basic perl6"><span>$*MAIN</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>statementlist</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, 1)></span></span></div><div class="line"><span class="source perl6"><span> || <?> ]</span></span></div><div class="line"><span class="source perl6"><span> <.ws></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># This is like HLL::Grammar.LANG but it allows to call a token of a Perl 6 level grammar.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>method</span></span><span> FOREIGN_LANG(</span><span class="variable other basic perl6"><span>$lang</span></span><span>, </span><span class="variable other basic perl6"><span>$regex</span></span><span>, *</span><span class="variable other basic perl6"><span>@args</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::istype(</span><span class="variable other basic perl6"><span>%*LANG</span></span><span>{</span><span class="variable other basic perl6"><span>$lang</span></span><span>}, NQPCursor) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>return</span></span><span> </span><span class="variable language perl6"><span>self</span></span><span>.LANG(</span><span class="variable other basic perl6"><span>$lang</span></span><span>, </span><span class="variable other basic perl6"><span>$regex</span></span><span>, </span><span class="variable other basic perl6"><span>@args</span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$Str</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Str</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lang_cursor</span></span><span> := </span><span class="variable other basic perl6"><span>%*LANG</span></span><span>{</span><span class="variable other basic perl6"><span>$lang</span></span><span>}.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_init</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$Str</span></span><span>.</span><span class="support function"><span>new</span></span><span>( :</span><span class="support function"><span>value</span></span><span>(</span><span class="variable language perl6"><span>self</span></span><span>.orig())), :p(</span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>pos</span></span><span>()));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.traced(</span><span class="variable language perl6"><span>self</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$lang_cursor</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.trace-on(</span><span class="variable other basic perl6"><span>$lang_cursor</span></span><span>, </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.trace_depth(</span><span class="variable language perl6"><span>self</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ACTIONS</span></span><span> := </span><span class="variable other basic perl6"><span>%*LANG</span></span><span>{</span><span class="variable other basic perl6"><span>$lang</span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>-actions</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>};</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$ret</span></span><span> := </span><span class="variable other basic perl6"><span>$lang_cursor</span></span><span>.</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>$regex</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>(|</span><span class="variable other basic perl6"><span>@args</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Build up something NQP-levelish we can return.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$new</span></span><span> := NQPCursor.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_init</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), :p(</span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>pos</span></span><span>()), :shared(</span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!shared</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>()));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$p6cursor</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Cursor</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]);</span></span></div><div class="line"><span class="source perl6"><span> nqp::bindattr_i(</span><span class="variable other basic perl6"><span>$new</span></span><span>, NQPCursor, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!from</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, nqp::getattr_i(</span><span class="variable other basic perl6"><span>$ret</span></span><span>, </span><span class="variable other basic perl6"><span>$p6cursor</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!from</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> nqp::bindattr_i(</span><span class="variable other basic perl6"><span>$new</span></span><span>, NQPCursor, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, nqp::getattr_i(</span><span class="variable other basic perl6"><span>$ret</span></span><span>, </span><span class="variable other basic perl6"><span>$p6cursor</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> nqp::bindattr(</span><span class="variable other basic perl6"><span>$new</span></span><span>, NQPCursor, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!name</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, nqp::getattr(</span><span class="variable other basic perl6"><span>$ret</span></span><span>, </span><span class="variable other basic perl6"><span>$p6cursor</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!name</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$match</span></span><span> := nqp::create(NQPMatch);</span></span></div><div class="line"><span class="source perl6"><span> nqp::bindattr(</span><span class="variable other basic perl6"><span>$match</span></span><span>, NQPMatch, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!made</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, nqp::getattr(</span><span class="variable other basic perl6"><span>$ret</span></span><span>, </span><span class="variable other basic perl6"><span>$p6cursor</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!made</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> nqp::bindattr(</span><span class="variable other basic perl6"><span>$new</span></span><span>, NQPCursor, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!match</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$match</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$new</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>sub</span></span><span> do_import($/, </span><span class="variable other basic perl6"><span>$module</span></span><span>, </span><span class="variable other basic perl6"><span>$package_source_name</span></span><span>, </span><span class="variable other basic perl6"><span>$arglist</span></span><span>?) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>$module</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EXPORT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$EXPORT</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$module</span></span><span><EXPORT>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@to_import</span></span><span> := [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>MANDATORY</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>];</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@positional_imports</span></span><span> := [];</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::</span><span class="support function"><span>defined</span></span><span>(</span><span class="variable other basic perl6"><span>$arglist</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$Pair</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Pair</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>$arglist</span></span><span> -> </span><span class="variable other basic perl6"><span>$tag</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::istype(</span><span class="variable other basic perl6"><span>$tag</span></span><span>, </span><span class="variable other basic perl6"><span>$Pair</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$tag</span></span><span> := nqp::unbox_s(</span><span class="variable other basic perl6"><span>$tag</span></span><span>.</span><span class="support function"><span>key</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>$EXPORT</span></span><span>, </span><span class="variable other basic perl6"><span>$tag</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.import($/, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$EXPORT</span></span><span>{</span><span class="variable other basic perl6"><span>$tag</span></span><span>}), </span><span class="variable other basic perl6"><span>$package_source_name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="keyword control control-handlers perl6"><span>die</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Error while importing from '$package_source_name': no such tag '$tag'</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>@positional_imports</span></span><span>, </span><span class="variable other basic perl6"><span>$tag</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>@to_import</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>DEFAULT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>@to_import</span></span><span> -> </span><span class="variable other basic perl6"><span>$tag</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>$EXPORT</span></span><span>, </span><span class="variable other basic perl6"><span>$tag</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.import($/, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stash_hash(</span><span class="variable other basic perl6"><span>$EXPORT</span></span><span>{</span><span class="variable other basic perl6"><span>$tag</span></span><span>}), </span><span class="variable other basic perl6"><span>$package_source_name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::existskey(</span><span class="variable other basic perl6"><span>$module</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>&EXPORT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$result</span></span><span> := </span><span class="variable other basic perl6"><span>$module</span></span><span><</span><span class="variable other basic perl6"><span>&EXPORT</span></span><span>>(|</span><span class="variable other basic perl6"><span>@positional_imports</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$EnumMap</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol([</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>EnumMap</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::istype(</span><span class="variable other basic perl6"><span>$result</span></span><span>, </span><span class="variable other basic perl6"><span>$EnumMap</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$storage</span></span><span> := </span><span class="variable other basic perl6"><span>$result</span></span><span>.hash.FLATTENABLE_HASH();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.import($/, </span><span class="variable other basic perl6"><span>$storage</span></span><span>, </span><span class="variable other basic perl6"><span>$package_source_name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="keyword control control-handlers perl6"><span>die</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>&EXPORT sub did not return an EnumMap</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> +</span><span class="variable other basic perl6"><span>@positional_imports</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> nqp::</span><span class="keyword control control-handlers perl6"><span>die</span></span><span>(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Error while importing from '$package_source_name': no EXPORT sub, but you provided positional argument in the 'use' statement</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword other include perl6"><span>require</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <module_name></span></span></div><div class="line"><span class="source perl6"><span> | <file=.variable></span></span></div><div class="line"><span class="source perl6"><span> | <!sigil> <file=.term></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> <EXPR>?</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control repeat perl6"><span>given</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> <xblock(1)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control flowcontrol perl6"><span>when</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> <xblock></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="keyword control flowcontrol perl6"><span>default</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym><.end_keyword> <block></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="meta function perl6"><span>CATCH</span></span><span>> {<sym> <block(1)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="meta function perl6"><span>CONTROL</span></span><span>> {<sym> <block(1)> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>BEGIN</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<COMPOSE> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>TEMP</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>CHECK</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>INIT</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>ENTER</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>FIRST</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>END</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>LEAVE</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>KEEP</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>UNDO</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>NEXT</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>LAST</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>PRE</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="meta function perl6"><span>POST</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="support function"><span>eager</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="support function"><span>lazy</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<sink> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="keyword control control-handlers perl6"><span>try</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="keyword control repeat perl6"><span>gather</span></span><span>>{ <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="support function"><span>once</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<</span><span class="keyword control flowcontrol perl6"><span>do</span></span><span>> { <sym> <blorst> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> statement_prefix:sym<DOC> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> \</span><span class="keyword operator perl6"><span>s</span></span><span> <.ws> </span><span class="variable other basic perl6"><span>$<phase</span></span><span>>=[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>BEGIN</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>CHECK</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>INIT</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]</span></span></div><div class="line"><span class="source perl6"><span> <blorst></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> blorst {</span></span></div><div class="line"><span class="source perl6"><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> <.ws> [ <?[{]> <block> | <![;]> <statement> || <.missing: </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>block or statement</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span>## Statement modifiers</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_cond { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> modifier_expr { <EXPR> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_cond:sym<</span><span class="keyword control conditional perl6"><span>if</span></span><span>> { <sym> <modifier_expr> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_cond:sym<</span><span class="keyword control conditional perl6"><span>unless</span></span><span>> { <sym> <modifier_expr> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_cond:sym<</span><span class="keyword control flowcontrol perl6"><span>when</span></span><span>> { <sym> <modifier_expr> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_loop { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_loop:sym<</span><span class="keyword control repeat perl6"><span>while</span></span><span>> { <sym> <smexpr=.EXPR> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_loop:sym<</span><span class="keyword control repeat perl6"><span>until</span></span><span>> { <sym> <smexpr=.EXPR> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_loop:sym<</span><span class="keyword control repeat perl6"><span>for</span></span><span>> { <sym> <smexpr=.EXPR> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_mod_loop:sym<</span><span class="keyword control repeat perl6"><span>given</span></span><span>> { <sym> <smexpr=.EXPR> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span>## Terms</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<fatarrow> { <fatarrow> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<colonpair> { <colonpair> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<variable> { <variable> { </span><span class="variable other basic perl6"><span>$*VAR</span></span><span> := </span><span class="variable other basic perl6"><span>$<variable</span></span><span>> } }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<package_declarator> { <package_declarator> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<scope_declarator> { <scope_declarator> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<routine_declarator> { <routine_declarator> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<multi_declarator> { <?</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>multi</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>|</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>proto</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>|</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>only</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> <multi_declarator> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<regex_declarator> { <regex_declarator> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<</span><span class="support function"><span>circumfix</span></span><span>> { <</span><span class="support function"><span>circumfix</span></span><span>> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<statement_prefix> { <statement_prefix> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<**> { <sym> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<*> { <sym> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<lambda> { <?lambda> <pblock> {</span><span class="variable other basic perl6"><span>$*BORG</span></span><span><block> := </span><span class="variable other basic perl6"><span>$<pblock</span></span><span>> </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::ishash(</span><span class="variable other basic perl6"><span>$*BORG</span></span><span>)} }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<type_declarator> { <type_declarator> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<</span><span class="support function"><span>value</span></span><span>> { <</span><span class="support function"><span>value</span></span><span>> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<unquote> { </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{{{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <?{ </span><span class="variable other basic perl6"><span>$*IN_QUASI</span></span><span> }> <statementlist> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}}}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<::?IDENT> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<sym</span></span><span>> = [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::?</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <identifier> ] »</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> </span><span class="support function"><span>infix</span></span><span>:sym<lambda> {</span></span></div><div class="line"><span class="source perl6"><span> <?</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>-></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> > <!{ </span><span class="variable other basic perl6"><span>$*IN_META</span></span><span> }> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$needparens</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$pos</span></span><span> := $/.</span><span class="support function"><span>from</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$line</span></span><span> := HLL::Compiler.lineof($/.orig, $/.</span><span class="support function"><span>from</span></span><span>, :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$lex</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.cur_lexpad();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>if</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>unless</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>while</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>until</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>for</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>given</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>when</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>loop</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>method</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$needparens</span></span><span>++ </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$_</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>loop</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$m</span></span><span> := </span><span class="variable other basic perl6"><span>%*MYSTERY</span></span><span>{</span><span class="variable other basic perl6"><span>$_</span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>-</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$lex</span></span><span>.cuid};</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>next</span></span><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$m</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$m_pos</span></span><span> := </span><span class="variable other basic perl6"><span>$m</span></span><span><</span><span class="support function"><span>pos</span></span><span>>[nqp::</span><span class="support function"><span>elems</span></span><span>(</span><span class="variable other basic perl6"><span>$m</span></span><span><</span><span class="support function"><span>pos</span></span><span>>) - 1];</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$m_line</span></span><span> := HLL::Compiler.lineof($/.orig, </span><span class="variable other basic perl6"><span>$m_pos</span></span><span>, :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$line</span></span><span> - </span><span class="variable other basic perl6"><span>$m_line</span></span><span> < 5 {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$m</span></span><span><ctx> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!clear_highwater</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$m_pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::KeywordAsFunction</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> word => </span><span class="variable other basic perl6"><span>$_</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="variable other basic perl6"><span>$needparens</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Unexpected block in infix position (two terms in a row)</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!clear_highwater</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$m_pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.sorry(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Word '$_' interpreted as a listop; please use 'do $_' to introduce the statement control word</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!cursor_pos</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="variable other basic perl6"><span>$pos</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Unexpected block in infix position (two terms in a row)</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <!{ </span><span class="variable other basic perl6"><span>$*IN_REDUCE</span></span><span> }> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?)</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> || <!></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<</span><span class="support function"><span>undef</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> >> {}</span></span></div><div class="line"><span class="source perl6"><span> [ <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h*</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$/</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ></span></span></div><div class="line"><span class="source perl6"><span> <.obs(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$/ variable as input record separator</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>the filehandle's .slurp method</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> [ <?</span><span class="keyword operator perl6"><span>before</span></span><span> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> || \h*<sigil><twigil>?\w ] ></span></span></div><div class="line"><span class="source perl6"><span> <.obs(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>undef as a verb</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>undefine function or assignment of Nil</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> <.obs(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>undef as a value</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>something more specific:</span><span class="constant character escape perl6"><span>\n</span><span>\t</span></span><span>an undefined type object such as Any or Int,</span><span class="constant character escape perl6"><span>\n</span><span>\t</span></span><span>:!defined as a matcher,</span><span class="constant character escape perl6"><span>\n</span><span>\t</span></span><span>Any:U as a type constraint,</span><span class="constant character escape perl6"><span>\n</span><span>\t</span></span><span>Nil as the absence of an expected value</span><span class="constant character escape perl6"><span>\n</span><span>\t</span></span><span>or fail() as a failure return</span><span class="constant character escape perl6"><span>\n</span><span>\t</span></span><span> </span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> term:sym<</span><span class="support function"><span>new</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>new</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> \h+ <longname> \h* <![:]> <.obs(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>C++ constructor syntax</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>method call syntax</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> fatarrow {</span></span></div><div class="line"><span class="source perl6"><span> <</span><span class="support function"><span>key</span></span><span>=.identifier> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.ws> <val=.EXPR(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>i=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> coloncircumfix(</span><span class="variable other basic perl6"><span>$front</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span><></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.worry(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Pair with <> really means an empty list, not null string; use :$front</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>('') to represent the null string,</span><span class="constant character escape perl6"><span>\n</span></span><span> or :$front</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>() to represent the empty list more accurately</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> | {} <</span><span class="support function"><span>circumfix</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> colonpair {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*key</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*value</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>:</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>colon pair</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>!</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> [ <identifier> || <.panic: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Malformed False pair; expected identifier</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>> ]</span></span></div><div class="line"><span class="source perl6"><span> [ <[ \[ \( \< \{ ]> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::NegatedPair</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="support function"><span>key</span></span><span> => ~</span><span class="variable other basic perl6"><span>$<identifier</span></span><span>>) } ]?</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*key</span></span><span> := </span><span class="variable other basic perl6"><span>$<identifier</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>; </span><span class="variable other basic perl6"><span>$*value</span></span><span> := 0; }</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="variable other basic perl6"><span>$<num</span></span><span>> = [\d+] <identifier> [ <?</span><span class="keyword operator perl6"><span>before</span></span><span> <[ \[ \( \< \{ ]>> {} <.sorry(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Extra argument not allowed; pair already has argument of </span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$<num</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>)> <.</span><span class="support function"><span>circumfix</span></span><span>> ]?</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*key</span></span><span> := </span><span class="variable other basic perl6"><span>$<identifier</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>; </span><span class="variable other basic perl6"><span>$*value</span></span><span> := +</span><span class="variable other basic perl6"><span>$<num</span></span><span>>; }</span></span></div><div class="line"><span class="source perl6"><span> | <identifier></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*key</span></span><span> := </span><span class="variable other basic perl6"><span>$<identifier</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>; }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <.unsp>? :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>pair value</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) <coloncircumfix(</span><span class="variable other basic perl6"><span>$*key</span></span><span>)> { </span><span class="variable other basic perl6"><span>$*value</span></span><span> := </span><span class="variable other basic perl6"><span>$<coloncircumfix</span></span><span>>; }</span></span></div><div class="line"><span class="source perl6"><span> || { </span><span class="variable other basic perl6"><span>$*value</span></span><span> := 1; }</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> | :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>signature</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <fakesignature></span></span></div><div class="line"><span class="source perl6"><span> | <coloncircumfix(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*key</span></span><span> := </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>; </span><span class="variable other basic perl6"><span>$*value</span></span><span> := </span><span class="variable other basic perl6"><span>$<coloncircumfix</span></span><span>>; }</span></span></div><div class="line"><span class="source perl6"><span> | <var=.colonpair_variable></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*key</span></span><span> := </span><span class="variable other basic perl6"><span>$<var</span></span><span>><desigilname>.</span><span class="support type perl6"><span>Str</span></span><span>; </span><span class="variable other basic perl6"><span>$*value</span></span><span> := </span><span class="variable other basic perl6"><span>$<var</span></span><span>>; </span><span class="variable language perl6"><span>self</span></span><span>.check_variable(</span><span class="variable other basic perl6"><span>$*value</span></span><span>); }</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> colonpair_variable {</span></span></div><div class="line"><span class="source perl6"><span> <sigil> {}</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <twigil>? <desigilname></span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="variable other basic perl6"><span>$<capvar</span></span><span>>=</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span><</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <desigilname> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$!{ }> {</span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$!{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> .*? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%!</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ]</span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%!</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$~> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$~</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$`> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$`</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$@> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <[ \</span><span class="keyword operator perl6"><span>s</span></span><span> ; , ) ]> .</span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$@</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># TODO: use actual variable in error message</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$</span><span class="comment line number-sign perl6"><span>#> {</span></span></span></div><div class="line"><span class="source perl6"><span> <sym></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || \w+ <.obs(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$#variable</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@variable.end</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> || <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$#</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$$> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> \W</span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$$</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$%> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$%</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># TODO: $^X and other "caret" variables</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$^> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$^</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$&> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$&</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$*> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$*</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$=> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h+ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<@+> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@+</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<%+> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%+</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$+[ ]> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$+[</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@+</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<@+[ ]> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@+[</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@+</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<@+{ }> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@+{</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%+</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<@-> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@-</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<%-> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%-</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$-[ ]> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$-[</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@-</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<@-[ ]> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@-[</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@-</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<%-{ }> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@-{</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%-</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$\\> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$</span><span class="constant character escape"><span>\\</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$</span><span class="constant character escape"><span>\\</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$|> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$|</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$:> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$:</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$;> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \h* </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$;</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>> { #</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <sym> <?</span><span class="keyword operator perl6"><span>before</span></span><span> \</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | <terminator> ></span></span></div><div class="line"><span class="source perl6"><span> <.obsvar(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>'</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> special_variable:sym<$</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted double perl6"><span> <sym> <?before \h* '='></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted double perl6"><span> <.obsvar('$</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token special_variable:sym<$,> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <?before \h* </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>=</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <.obsvar(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>$,</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token special_variable:sym<$.> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> {} <!before \w | </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <.obsvar(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>$.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token special_variable:sym<$?> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> {} <!before \w | </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <.obsvar(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>$?</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token special_variable:sym<$]> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> {} <!before \w | </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <.obsvar(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>$]</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> regex special_variable:sym<${ }> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sigil> </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>{</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> {} $<text>=[.*?] </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <!{ $*QSIGIL }></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <?{</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> my $sigil := $<sigil>.Str;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> my $text := $<text>.Str;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> my $bad := $sigil ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>{</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ $text ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> $text := $text - 1 if $text ~~ /^\d+$/ && $text > 0;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> if !($text ~~ /^(\w|\:)+$/) {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> $/.CURSOR.obs($bad, $sigil ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ $text ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>);</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> elsif $*QSIGIL {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> $/.CURSOR.obs($bad, </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>{</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ $sigil ~ $text ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>}</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>);</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> else {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> $/.CURSOR.obs($bad, $sigil ~ $text);</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token desigilname {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <?before <.sigil> <.sigil> > <variable></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <?sigil></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [ <?{ $*IN_DECL }> <.typed_panic: </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword operator perl6"><span>X</span></span><span>::Syntax::Variable::IndirectDeclaration</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>> ]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <variable> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> $*VAR := $<variable>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> self.check_variable($*VAR);</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <longname></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token variable {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*IN_META := </span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | :dba(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="support function"><span>infix</span></span><span> noun</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>) </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>&[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> <infixish(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>[]</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <sigil> <twigil>? <desigilname></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <special_variable></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <sigil> $<index>=[\d+] [<?{ $*IN_DECL }> <.typed_panic: "X::Syntax::Variable::Numeric">]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | <sigil> <?[<]> <postcircumfix> [<?{ $*IN_DECL }> <.typed_panic(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword operator perl6"><span>X</span></span><span>::Syntax::Variable::Match</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)>]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | :dba(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>contextualizer</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>) <sigil> </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> <sequence> [<?{ $*IN_DECL }> <.panic: "Cannot declare a contextualizer">]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | $<sigil>=[</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>$</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>] $<desigilname>=[<[/_!]>]</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> | {} <sigil> <!{ $*QSIGIL }> # try last, to allow sublanguages to redefine sigils (like & in regex)</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [ <?{ $<twigil> && $<twigil> eq </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>.</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> }></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [ <.unsp> | </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>\\</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> | <?> ] <?[(]> <arglist=.postcircumfix></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> { $*LEFTSIGIL := nqp::substr(self.orig(), self.from, 1) unless $*LEFTSIGIL }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token sigil { <[$@%&]> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> proto token twigil { <...> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<.> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<!> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<^> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<:> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<*> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<?> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<=> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token twigil:sym<~> { <sym> <?before \w> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> proto token package_declarator { <...> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<package> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>package</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<module> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>module</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<class> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>class</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<grammar> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>grammar</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<role> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>role</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<knowhow> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>knowhow</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<native> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>native</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<slang> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*OUTERPACKAGE := $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PKGDECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>slang</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.end_keyword> <package_def></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> token package_declarator:sym<trusts> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym> <.ws> <typename></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> rule package_declarator:sym<also> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <sym></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [ <trait>+ || <.panic: "No valid trait found after also"> ]</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> rule package_def {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $longname;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $outer := $*W.cur_lexpad();</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*IMPLICIT := 0;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*DECLARAND;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*IN_DECL := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>package</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*HAS_SELF := </span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*CURPAD;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*DOC := $*DECLARATOR_DOCS;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*POD_BLOCK;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> { $*DECLARATOR_DOCS := </span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span> }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <.attach_leading_docs></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> # Type-object will live in here; also set default REPR (a trait</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> # may override this, e.g. is repr(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>...</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)).</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*PACKAGE;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my %*ATTR_USAGES;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> :my $*REPR;</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> # Default to our scoped.</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> { unless $*SCOPE { $*SCOPE := </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="storage type variable perl6"><span>our</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>; } }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [ <longname> { $longname := $*W.dissect_longname($<longname>); } ]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <.newpad></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> [ :dba(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>generic </span><span class="keyword other module perl6"><span>role</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <?{ ($*PKGDECL//</span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span>) eq </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="keyword other module perl6"><span>role</span></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> }></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> { $*PACKAGE := $*OUTERPACKAGE } # in case signature tries to declare a package</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> ~ </span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>]</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> <signature></span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> { $*IN_DECL := </span><span class="punctuation definition string end perl6"><span>'</span></span><span class="punctuation definition string begin perl6"><span>'</span></span><span>; }</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> ]?</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> <trait>*</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> </span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> {</span></span></span></div><div class="line"><span class="source perl6"><span class="string quoted single perl6"><span> # Unless we</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span class="support function"><span>re</span></span><span> augmenting...</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>augment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Locate any existing symbol. Note that it's only a match</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># with "my" if we already have a declaration in this scope.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$exists</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@name</span></span><span> := </span><span class="variable other basic perl6"><span>$longname</span></span><span> ??</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.type_name_parts(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>package name</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, :decl(1)) !!</span></span></div><div class="line"><span class="source perl6"><span> [];</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$target_package</span></span><span> := </span><span class="variable other basic perl6"><span>$longname</span></span><span> && </span><span class="variable other basic perl6"><span>$longname</span></span><span>.is_declared_in_global()</span></span></div><div class="line"><span class="source perl6"><span> ?? </span><span class="variable other basic perl6"><span>$*GLOBALish</span></span></span></div><div class="line"><span class="source perl6"><span> !! </span><span class="variable other basic perl6"><span>$*OUTERPACKAGE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>@name</span></span><span> && </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>anon</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>@name</span></span><span> && </span><span class="variable other basic perl6"><span>$*W</span></span><span>.already_declared(</span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span>, </span><span class="variable other basic perl6"><span>$target_package</span></span><span>, </span><span class="variable other basic perl6"><span>$outer</span></span><span>, </span><span class="variable other basic perl6"><span>@name</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol(</span><span class="variable other basic perl6"><span>@name</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$exists</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># If it exists already, then it's either uncomposed (in which</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># case we just stubbed it), a role (in which case multiple</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># variants are OK) or else an illegal redecl.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$exists</span></span><span> && (</span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>role</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> || !nqp::</span><span class="support function"><span>can</span></span><span>(</span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>configure_punning</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>role</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> || </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.is_composed(</span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw($/, [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Redeclaration</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>],</span></span></div><div class="line"><span class="source perl6"><span> symbol => </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support function"><span>name</span></span><span>(),</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># If it's not a role, or it is a role but one with no name,</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># then just needs meta-object construction and installation.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>role</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> || !</span><span class="variable other basic perl6"><span>@name</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Construct meta-object for this package.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>%args</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>@name</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%args</span></span><span><</span><span class="support function"><span>name</span></span><span>> := </span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support function"><span>name</span></span><span>();</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*REPR</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>%args</span></span><span><repr> := </span><span class="variable other basic perl6"><span>$*REPR</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.resolve_mo($/, </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>), |</span><span class="variable other basic perl6"><span>%args</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Install it in the symbol table if needed.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>@name</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_package($/, </span><span class="variable other basic perl6"><span>@name</span></span><span>, </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span>, </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>, </span><span class="variable other basic perl6"><span>$target_package</span></span><span>, </span><span class="variable other basic perl6"><span>$outer</span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># If it's a named role, a little trickier. We need to make</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># a parametric role group for it (unless we got one), and</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># then install it in that.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># If the group doesn't exist, create it.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$group</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$exists</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$group</span></span><span> := </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$group</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.resolve_mo($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>role-group</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), :</span><span class="support function"><span>name</span></span><span>(</span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support function"><span>name</span></span><span>()), :repr(</span><span class="variable other basic perl6"><span>$*REPR</span></span><span>));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_package($/, </span><span class="variable other basic perl6"><span>@name</span></span><span>, </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span>, </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>, </span><span class="variable other basic perl6"><span>$target_package</span></span><span>, </span><span class="variable other basic perl6"><span>$outer</span></span><span>, </span><span class="variable other basic perl6"><span>$group</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Construct role meta-object with group.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>sub</span></span><span> needs_args(</span><span class="variable other basic perl6"><span>$s</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>return</span></span><span> 0 </span><span class="keyword control conditional perl6"><span>if</span></span><span> !</span><span class="variable other basic perl6"><span>$s</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@params</span></span><span> := </span><span class="variable other basic perl6"><span>$s</span></span><span>.ast<parameters>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>return</span></span><span> 0 </span><span class="keyword control conditional perl6"><span>if</span></span><span> nqp::</span><span class="support function"><span>elems</span></span><span>(</span><span class="variable other basic perl6"><span>@params</span></span><span>) == 0;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control flowcontrol perl6"><span>return</span></span><span> nqp::</span><span class="support function"><span>elems</span></span><span>(</span><span class="variable other basic perl6"><span>@params</span></span><span>) > 1 || !</span><span class="variable other basic perl6"><span>@params</span></span><span>[0]<optional>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.resolve_mo($/, </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>), :</span><span class="support function"><span>name</span></span><span>(</span><span class="variable other basic perl6"><span>$longname</span></span><span>.</span><span class="support function"><span>name</span></span><span>()),</span></span></div><div class="line"><span class="source perl6"><span> :repr(</span><span class="variable other basic perl6"><span>$*REPR</span></span><span>), :group(</span><span class="variable other basic perl6"><span>$group</span></span><span>), :signatured(needs_args(</span><span class="variable other basic perl6"><span>$<signature</span></span><span>>)));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Augment. Ensure we can.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> !</span><span class="variable other basic perl6"><span>$*MONKEY_TYPING</span></span><span> && </span><span class="variable other basic perl6"><span>$longname</span></span><span>.text </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Cool</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Augment::WithoutMonkeyTyping</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> !</span><span class="variable other basic perl6"><span>$longname</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Anon::Augment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="keyword other module perl6"><span>package</span></span><span>-kind => </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Locate type.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@name</span></span><span> := </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span>.type_name_parts(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>package name</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, :decl(1));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$found</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control control-handlers perl6"><span>try</span></span><span> { </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.find_symbol(</span><span class="variable other basic perl6"><span>@name</span></span><span>); </span><span class="variable other basic perl6"><span>$found</span></span><span> := 1 }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$found</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.throw($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Augment::NoSuchType</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword other module perl6"><span>package</span></span><span>-kind => </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword other module perl6"><span>package</span></span><span> => </span><span class="variable other basic perl6"><span>$longname</span></span><span>.text(),</span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>.</span><span class="support function"><span>HOW</span></span><span>.archetypes.augmentable {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Augment::Illegal</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword other module perl6"><span>package</span></span><span> => </span><span class="variable other basic perl6"><span>$longname</span></span><span>.text);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Install $?PACKAGE, $?ROLE, $?CLASS, and :: variants as needed.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$curpad</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.cur_lexpad();</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$curpad</span></span><span>.symbol(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::?PACKAGE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>role</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?ROLE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::?ROLE</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?CLASS</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.resolve_mo($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>generic</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), :</span><span class="support function"><span>name</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?CLASS</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)));</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::?CLASS</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pkg_create_mo($/, </span><span class="variable other basic perl6"><span>$*W</span></span><span>.resolve_mo($/, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>generic</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>), :</span><span class="support function"><span>name</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::?CLASS</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)));</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>package</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> && </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>module</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>$?CLASS</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*W</span></span><span>.install_lexical_symbol(</span><span class="variable other basic perl6"><span>$curpad</span></span><span>, </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>::?CLASS</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Set declarand as the package.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span> := </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> < </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> := </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Apply any traits.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control repeat perl6"><span>for</span></span><span> </span><span class="variable other basic perl6"><span>$<trait</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$applier</span></span><span> := </span><span class="variable other basic perl6"><span>$_</span></span><span>.ast;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$applier</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$applier</span></span><span>(</span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> :!</span><span class="keyword operator perl6"><span>s</span></span></span></div><div class="line"><span class="source perl6"><span> { nqp::</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>@*PACKAGES</span></span><span>, </span><span class="variable other basic perl6"><span>$*PACKAGE</span></span><span>); }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <?[{]> </span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*begin_compunit</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <blockoid></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <?{ </span><span class="variable other basic perl6"><span>$*begin_compunit</span></span><span> }></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$longname</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Compilation unit cannot be anonymous</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$outer</span></span><span> =:= </span><span class="variable other basic perl6"><span>$*UNIT</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>X::SemicolonForm::Invalid</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, what => </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>, </span><span class="storage modifier type constraints perl6"><span>where</span></span><span> => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>in subscopes</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>package</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.panic(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>This appears to be Perl 5 code. If you intended it to be Perl 6 code, please use a Perl 6 style package block like "package Foo { ... }", or "module Foo; ...".</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*begin_compunit</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; }</span></span></div><div class="line"><span class="source perl6"><span> <.finishpad></span></span></div><div class="line"><span class="source perl6"><span> <statementlist(1)> </span><span class="comment line number-sign perl6"><span># whole rest of file, presumably</span></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*CURPAD</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pop_lexpad() }</span></span></div><div class="line"><span class="source perl6"><span> || { $/.CURSOR.typed_panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>X::SemicolonForm::TooLate</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, what => </span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>); }</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> || <.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Unable to parse $*PKGDECL definition</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> { nqp::</span><span class="support function"><span>pop</span></span><span>(</span><span class="variable other basic perl6"><span>@*PACKAGES</span></span><span>); }</span></span></div><div class="line"><span class="source perl6"><span> ]:!</span><span class="keyword operator perl6"><span>s</span></span><span> || { $/.CURSOR.malformed(</span><span class="variable other basic perl6"><span>$*PKGDECL</span></span><span>) }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> declarator {</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># STD.pm6 uses <defterm> here, but we need different </span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># action methods</span></span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="constant character escape"><span>\\</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <defterm></span></span></div><div class="line"><span class="source perl6"><span> [ <.ws> <term_init=initializer> || <.typed_panic: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>X::Syntax::Term::MissingInitializer</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>> ]</span></span></div><div class="line"><span class="source perl6"><span> | <variable_declarator></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <?{ </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>has</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }> <.newpad> [ <.ws> <initializer> ]? { </span><span class="variable other basic perl6"><span>$*ATTR_INIT_BLOCK</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pop_lexpad() }</span></span></div><div class="line"><span class="source perl6"><span> || [ <.ws> <initializer> ]?</span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <</span><span class="support function"><span>signature</span></span><span>> [ <.ws> <trait>+ ]? [ <.ws> <initializer> ]?</span></span></div><div class="line"><span class="source perl6"><span> | <routine_declarator></span></span></div><div class="line"><span class="source perl6"><span> | <regex_declarator></span></span></div><div class="line"><span class="source perl6"><span> | <type_declarator></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> term:sym<winner> { <sym><.end_keyword> <xblock> } </span><span class="comment line number-sign perl6"><span># DEPRECATED</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> term:sym<earliest> { <sym><.end_keyword> <xblock> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> term:sym<combine>{ <sym><.end_keyword> <xblock> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<more> { <sym><.end_keyword> <xblock(1)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="support function"><span>done</span></span><span>> { <sym><.end_keyword> <xblock(1)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<quit> { <sym><.end_keyword> <xblock(1)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> statement_control:sym<</span><span class="support function"><span>wait</span></span><span>> { <sym><.end_keyword> <xblock(1)> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> multi_declarator { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> multi_declarator:sym<</span><span class="storage type declare routine perl6"><span>multi</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>multi</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; <.end_keyword></span></span></div><div class="line"><span class="source perl6"><span> <.ws> [ <declarator> || <routine_def(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> || <.malformed(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>multi</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> multi_declarator:sym<</span><span class="storage type declare routine perl6"><span>proto</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>proto</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_PROTO</span></span><span> := 1; <.end_keyword></span></span></div><div class="line"><span class="source perl6"><span> <.ws> [ <declarator> || <routine_def(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> || <.malformed(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>proto</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> multi_declarator:sym<</span><span class="storage type declare routine perl6"><span>only</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>only</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; <.end_keyword></span></span></div><div class="line"><span class="source perl6"><span> <.ws> [ <declarator> || <routine_def(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> || <.malformed(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>only</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)>]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> multi_declarator:sym<null> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <declarator></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator:sym<</span><span class="storage type variable perl6"><span>my</span></span><span>> { <sym> <scoped(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>my</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator:sym<</span><span class="storage type variable perl6"><span>our</span></span><span>> { <sym> <scoped(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>our</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator:sym<</span><span class="storage type variable perl6"><span>has</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym></span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*HAS_SELF</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>partial</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*ATTR_INIT_BLOCK</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <scoped(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>has</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator:sym<</span><span class="storage modifier type constraints perl6"><span>augment</span></span><span>> { <sym> <scoped(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>augment</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator:sym<anon> { <sym> <scoped(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>anon</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator:sym<</span><span class="storage type variable perl6"><span>state</span></span><span>> { <sym> <scoped(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>state</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scope_declarator:sym<</span><span class="storage modifier type constraints perl6"><span>supersede</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> <sym> <scoped(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>supersede</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> <.NYI(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>"supersede"</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> scoped(</span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> <.end_keyword></span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>scoped declarator</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DOC</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCK</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>has</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> < </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> := </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span> := Mu; </span><span class="comment line number-sign perl6"><span># actual declarand comes later, in Actions::declare_variable</span></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.attach_leading_docs;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <.ws></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <DECL=declarator></span></span></div><div class="line"><span class="source perl6"><span> | <DECL=regex_declarator></span></span></div><div class="line"><span class="source perl6"><span> | <DECL=package_declarator></span></span></div><div class="line"><span class="source perl6"><span> | [<typename><.ws>]+</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> +</span><span class="variable other basic perl6"><span>$<typename</span></span><span>> > 1 {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.NYI(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Multiple prefix constraints</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*OFTYPE</span></span><span> := </span><span class="variable other basic perl6"><span>$<typename</span></span><span>>[0];</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <DECL=multi_declarator></span></span></div><div class="line"><span class="source perl6"><span> | <DECL=multi_declarator></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> || <.ws>[<typename><.ws>]* <ident> <?</span><span class="keyword operator perl6"><span>before</span></span><span> <.ws> [</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>:</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>?</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>:</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>?</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>=</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ]> {}</span></span></div><div class="line"><span class="source perl6"><span> <.malformed(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>$*SCOPE (did you mean to declare a sigilless </span><span class="constant character escape perl6"><span>\\</span></span><span>{~$<ident>} or \${~$<ident>}?)</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> || <.ws><typo_typename> <!></span></span></div><div class="line"><span class="source perl6"><span> || <.malformed(</span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> variable_declarator {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>variable</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$var</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <variable></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$var</span></span><span> := </span><span class="variable other basic perl6"><span>$<variable</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.add_variable(</span><span class="variable other basic perl6"><span>$var</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> <.unsp>?</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$<shape</span></span><span>>=[</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <</span><span class="support function"><span>signature</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$sigil</span></span><span> := nqp::</span><span class="support function"><span>substr</span></span><span>(</span><span class="variable other basic perl6"><span>$var</span></span><span>, 0, 1);</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$sigil</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>&</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Reserved</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> reserved => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>() shape syntax in routine declarations</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> instead => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span> (maybe use :() to declare a longname?)</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> );</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$sigil</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Reserved</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> reserved => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>() shape syntax in array declarations</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>elsif</span></span><span> </span><span class="variable other basic perl6"><span>$sigil</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>%</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Reserved</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> reserved => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>() shape syntax in hash declarations</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>else</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable language perl6"><span>self</span></span><span>.typed_sorry(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>X::Syntax::Reserved</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>,</span></span></div><div class="line"><span class="source perl6"><span> reserved => </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>() shape syntax in variable declarations</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> | :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>shape definition</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>[</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>]</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <semilist> <.NYI: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Shaped variable declarations</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> | :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>shape definition</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>) </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <semilist></span></span></div><div class="line"><span class="source perl6"><span> | <?[<]> <</span><span class="support function"><span>postcircumfix</span></span><span>> <.NYI: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Shaped variable declarations</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> ]+</span></span></div><div class="line"><span class="source perl6"><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> [ <.ws> <trait>+ ]?</span></span></div><div class="line"><span class="source perl6"><span> [ <.ws> <post_constraint>+ <.NYI: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Post-constraints on variables</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>> ]?</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>proto</span></span><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> routine_declarator { <...> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> routine_declarator:sym<</span><span class="storage type declare routine perl6"><span>sub</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym> <.end_keyword> <routine_def(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> routine_declarator:sym<</span><span class="storage type declare routine perl6"><span>method</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym> <.end_keyword> <method_def(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>method</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> routine_declarator:sym<</span><span class="storage type declare routine perl6"><span>submethod</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym> <.end_keyword> <method_def(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>submethod</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> routine_declarator:sym<</span><span class="storage type declare routine perl6"><span>macro</span></span><span>> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> := HLL::Compiler.lineof(</span><span class="variable language perl6"><span>self</span></span><span>.orig(), </span><span class="variable language perl6"><span>self</span></span><span>.</span><span class="support function"><span>from</span></span><span>(), :cache(1));</span></span></div><div class="line"><span class="source perl6"><span> <sym> <.end_keyword> <macro_def()></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> routine_def(</span><span class="variable other basic perl6"><span>$d</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="variable other basic perl6"><span>$d</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*METHODTYPE</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IMPLICIT</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DOC</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCK</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stub_code_object(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Sub</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*CURPAD</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$outer</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.cur_lexpad();</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> < </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> := </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <.attach_leading_docs></span></span></div><div class="line"><span class="source perl6"><span> <deflongname>?</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>> && </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>><colonpair>[0]<coloncircumfix> -> </span><span class="variable other basic perl6"><span>$cf</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># It's an (potentially new) operator, circumfix, etc. that we</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># need to tweak into the grammar.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$category</span></span><span> := </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>><</span><span class="support function"><span>name</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$opname</span></span><span> := </span><span class="variable other basic perl6"><span>$cf</span></span><span><</span><span class="support function"><span>circumfix</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> ?? </span><span class="variable other basic perl6"><span>$*W</span></span><span>.colonpair_nibble_to_str($/, </span><span class="variable other basic perl6"><span>$cf</span></span><span><</span><span class="support function"><span>circumfix</span></span><span>><nibble>)</span></span></div><div class="line"><span class="source perl6"><span> !! </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$canname</span></span><span> := </span><span class="variable other basic perl6"><span>$category</span></span><span> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>:sym<</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$opname</span></span><span> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.add_categorical(</span><span class="variable other basic perl6"><span>$category</span></span><span>, </span><span class="variable other basic perl6"><span>$opname</span></span><span>, </span><span class="variable other basic perl6"><span>$canname</span></span><span>, </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>>.ast, </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <.newpad></span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <multisig> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> <trait>* :!</span><span class="keyword operator perl6"><span>s</span></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>> </span><span class="keyword operator perl6"><span>ne</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>MAIN</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>X::SemicolonForm::Invalid</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, what => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="storage modifier type constraints perl6"><span>where</span></span><span> => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>except on MAIN subs</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$*begin_compunit</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>X::SemicolonForm::TooLate</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, what => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> || </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>only</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>X::SemicolonForm::Invalid</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, what => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="storage modifier type constraints perl6"><span>where</span></span><span> => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>on $*MULTINESS subs</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>unless</span></span><span> </span><span class="variable other basic perl6"><span>$outer</span></span><span> =:= </span><span class="variable other basic perl6"><span>$*UNIT</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.typed_panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>X::SemicolonForm::Invalid</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, what => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>sub</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>, </span><span class="storage modifier type constraints perl6"><span>where</span></span><span> => </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>in subscopes</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*begin_compunit</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <.finishpad></span></span></div><div class="line"><span class="source perl6"><span> <statementlist(1)></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*CURPAD</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pop_lexpad() }</span></span></div><div class="line"><span class="source perl6"><span> || <onlystar></span></span></div><div class="line"><span class="source perl6"><span> || <!</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>> <possibly_subname=.deflongname> { </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable language perl6"><span>self</span></span><span>.parse(</span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>, :</span><span class="storage type declare routine perl6"><span>rule</span></span><span>(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>typename</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)) { $/.CURSOR.panic(</span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>Did you mean to write </span><span class="constant character escape perl6"><span>\"</span></span><span>my $<deflongname> sub $<possibly_subname></span><span class="constant character escape perl6"><span>\"</span></span><span> or put </span><span class="constant character escape perl6"><span>\"</span></span><span>returns $<deflongname></span><span class="constant character escape perl6"><span>\"</span></span><span> before the block?</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>); } } <!></span></span></div><div class="line"><span class="source perl6"><span> || <blockoid></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> method_def(</span><span class="variable other basic perl6"><span>$d</span></span><span>) {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="variable other basic perl6"><span>$d</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*METHODTYPE</span></span><span> := </span><span class="variable other basic perl6"><span>$d</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*HAS_SELF</span></span><span> := </span><span class="variable other basic perl6"><span>$d</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>submethod</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ?? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>partial</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> !! </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>complete</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DOC</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCK</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stub_code_object(</span><span class="variable other basic perl6"><span>$d</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>submethod</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ?? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Submethod</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> !! </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Method</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> < </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> := </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <.attach_leading_docs></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> <.newpad></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="variable other basic perl6"><span>$<specials</span></span><span>>=[<[ ! ^ ]>?]<longname> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <multisig> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ]? <trait>*</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <multisig> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <trait>*</span></span></div><div class="line"><span class="source perl6"><span> | <sigil></span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>.</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>:!</span><span class="keyword operator perl6"><span>s</span></span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>subscript signature</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <multisig></span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>[</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>]</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <multisig></span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <multisig></span></span></div><div class="line"><span class="source perl6"><span> ]:</span><span class="keyword operator perl6"><span>s</span></span></span></div><div class="line"><span class="source perl6"><span> <trait>*</span></span></div><div class="line"><span class="source perl6"><span> | <?></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <onlystar></span></span></div><div class="line"><span class="source perl6"><span> || <blockoid></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> ] || <.malformed(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>method</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> macro_def() {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>macro</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IMPLICIT</span></span><span> := 0;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DOC</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*DECLARATOR_DOCS</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*POD_BLOCK</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.stub_code_object(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>Macro</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> < </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL_LINE</span></span><span> := </span><span class="variable other basic perl6"><span>$*LINE_NO</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="variable other basic perl6"><span>$*PRECEDING_DECL</span></span><span> := </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <.attach_leading_docs></span></span></div><div class="line"><span class="source perl6"><span> <deflongname>?</span></span></div><div class="line"><span class="source perl6"><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="keyword control conditional perl6"><span>if</span></span><span> </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>> && </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>><colonpair>[0]<coloncircumfix> -> </span><span class="variable other basic perl6"><span>$cf</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># It's an (potentially new) operator, circumfix, etc. that we</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># need to tweak into the grammar.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$category</span></span><span> := </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>><</span><span class="support function"><span>name</span></span><span>>.</span><span class="support type perl6"><span>Str</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$opname</span></span><span> := </span><span class="variable other basic perl6"><span>$cf</span></span><span><</span><span class="support function"><span>circumfix</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> ?? </span><span class="variable other basic perl6"><span>$*W</span></span><span>.colonpair_nibble_to_str($/, </span><span class="variable other basic perl6"><span>$cf</span></span><span><</span><span class="support function"><span>circumfix</span></span><span>><nibble>)</span></span></div><div class="line"><span class="source perl6"><span> !! </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$canname</span></span><span> := </span><span class="variable other basic perl6"><span>$category</span></span><span> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>:sym<</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span> ~ </span><span class="variable other basic perl6"><span>$opname</span></span><span> ~ </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>></span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> $/.CURSOR.add_categorical(</span><span class="variable other basic perl6"><span>$category</span></span><span>, </span><span class="variable other basic perl6"><span>$opname</span></span><span>, </span><span class="variable other basic perl6"><span>$canname</span></span><span>, </span><span class="variable other basic perl6"><span>$<deflongname</span></span><span>>.ast, </span><span class="variable other basic perl6"><span>$*DECLARAND</span></span><span>);</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> <.newpad></span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <multisig> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ]?</span></span></div><div class="line"><span class="source perl6"><span> <trait>*</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; }</span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> || <onlystar></span></span></div><div class="line"><span class="source perl6"><span> || <blockoid></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> onlystar {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*CURPAD</span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <?{ </span><span class="variable other basic perl6"><span>$*MULTINESS</span></span><span> </span><span class="keyword operator perl6"><span>eq</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>proto</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> }></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.ws> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>*</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.ws> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>}</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> <?ENDSTMT></span></span></div><div class="line"><span class="source perl6"><span> <.finishpad></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*CURPAD</span></span><span> := </span><span class="variable other basic perl6"><span>$*W</span></span><span>.pop_lexpad() }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span>###########################</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># Captures and Signatures #</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span>###########################</span></span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> capterm {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="constant character escape"><span>\\</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.ws> <capture>? </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span></span></div><div class="line"><span class="source perl6"><span> | <?</span><span class="keyword operator perl6"><span>before</span></span><span> \S> <termish></span></span></div><div class="line"><span class="source perl6"><span> | {} <.panic: </span><span class="string quoted double perl6"><span class="punctuation definition string begin perl6"><span>"</span></span><span>You can't backslash that</span><span class="punctuation definition string end perl6"><span>"</span></span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> ]</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> capture {</span></span></div><div class="line"><span class="source perl6"><span> <EXPR></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>rule</span></span><span> param_sep {</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> </span><span class="variable other basic perl6"><span>$<sep</span></span><span>>=[</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>,</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>|</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>:</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>|</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;;</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>|</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>] { </span><span class="variable other basic perl6"><span>@*seps</span></span><span>.</span><span class="support function"><span>push</span></span><span>(</span><span class="variable other basic perl6"><span>$<sep</span></span><span>>) }</span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="comment line number-sign perl6"><span># XXX Not really implemented yet.</span></span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> multisig {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*SCOPE</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>my</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> <</span><span class="support function"><span>signature</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> sigterm {</span></span></div><div class="line"><span class="source perl6"><span> :dba(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>signature</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)</span></span></div><div class="line"><span class="source perl6"><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>:(</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ~ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <fakesignature></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> fakesignature {</span></span></div><div class="line"><span class="source perl6"><span> <.newpad></span></span></div><div class="line"><span class="source perl6"><span> <</span><span class="support function"><span>signature</span></span><span>></span></span></div><div class="line"><span class="source perl6"><span> }</span></span></div><div class="line"><span class="source perl6"><span> </span></span></div><div class="line"><span class="source perl6"><span> </span><span class="storage type declare routine perl6"><span>token</span></span><span> </span><span class="support function"><span>signature</span></span><span> {</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>sig</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*zone</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>posreq</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>;</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>@*seps</span></span><span> := nqp::list();</span></span></div><div class="line"><span class="source perl6"><span> :</span><span class="storage type variable perl6"><span>my</span></span><span> </span><span class="variable other basic perl6"><span>$*INVOCANT_OK</span></span><span> := 1;</span></span></div><div class="line"><span class="source perl6"><span> <.ws></span></span></div><div class="line"><span class="source perl6"><span> [</span></span></div><div class="line"><span class="source perl6"><span> | <?</span><span class="keyword operator perl6"><span>before</span></span><span> </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>--></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>)</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>]</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>{</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>:</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>\</span><span class="keyword operator perl6"><span>s</span></span><span> | </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>;;</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> ></span></span></div><div class="line"><span class="source perl6"><span> | [ <parameter> || <.malformed(</span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>parameter</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>)> ]</span></span></div><div class="line"><span class="source perl6"><span> ]+ % <param_sep></span></span></div><div class="line"><span class="source perl6"><span> <.ws></span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*IN_DECL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; }</span></span></div><div class="line"><span class="source perl6"><span> [ </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>--></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.ws> <typename> || </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>--></span><span class="punctuation definition string end perl6"><span>'</span></span></span><span> <.ws> <typo_typename> ]?</span></span></div><div class="line"><span class="source perl6"><span> { </span><span class="variable other basic perl6"><span>$*LEFTSIGIL</span></span><span> := </span><span class="string quoted single perl6"><span class="punctuation definition string begin perl6"><span>'</span></span><span>@</span><span class="punctuation definition string end perl6"><span>'</span></span></span><span>; }</span></span></div><div class="line"><span class="source perl6"><span> & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment