diff --git a/Cursor.pmc b/Cursor.pmc index 10fefc4..4ac46ee 100644 --- a/Cursor.pmc +++ b/Cursor.pmc @@ -245,12 +245,13 @@ sub from { $_[0]->{_from} // $_[0]->{_pos} } sub to { $_[0]->{_pos} } sub pos { $_[0]->{_pos} } sub chars { $_[0]->{_pos} - ($_[0]->{_from} // $_[0]->{_pos}) } -sub text { exists $_[0]->{_from} ? substr($::ORIG, $_[0]->{_from}, $_[0]->{_pos} - $_[0]->{_from}) : '' } +sub Str { exists $_[0]->{_from} ? substr($::ORIG, $_[0]->{_from}, $_[0]->{_pos} - $_[0]->{_from}) : '' } sub peek { $_[0]->{_peek} } sub orig { \$::ORIG } sub WHAT { ref $_[0] || $_[0] } -sub item { exists $_[0]->{''} ? $_[0]->{''} : $_[0]->text } +sub item { $_[0] } +sub result { exists $_[0]->{''} ? $_[0]->{''} : $_[0]->Str } sub list { my $self = shift; my @result; @@ -725,7 +726,7 @@ sub cursor_herelang { my $self = shift; sub trim_heredoc { my $doc = shift; my ($stopper) = $doc->{stopper}[0] or $doc->panic("Couldn't find delimiter for heredoc\n"); - my $ws = $stopper->{ws}->text; + my $ws = $stopper->{ws}->Str; return $stopper if $ws eq ''; my $wsequiv = $ws; @@ -954,7 +955,7 @@ sub add_macro { my $lang = shift; my $start = shift; state $GEN = "500"; $lang->{_from} = $start->{_from}; - my $name = $lang->text; + my $name = $lang->Str; my $WHAT = ref $lang; if ($name =~ s/^(\w+):(?=[«<({[])/$1:sym/) { my ($sym) = $name =~ /:sym(.*)/; @@ -1098,7 +1099,7 @@ sub do_imports { my $self = shift; my $module = shift; my $args = shift; my @imports; - my $text = $args->text; + my $text = $args->Str; if ($text ne '') { return unless $text; while ($text =~ s/^\s*:?(OUR|MY|STATE)?<(.*?)>,?//) { @@ -1607,7 +1608,7 @@ sub _BACKREFn { my $self = shift; local $CTX = $self->callm($n) if $DEBUG & DEBUG::trace_call; my $P = $self->{_pos} // 0; - my $s = $self->{$n}->text; + my $s = $self->{$n}->Str; my $len = length($s); if (substr($::ORIG, $P, $len) eq $s) { $self->deb("EXACT $s matched @{[substr($::ORIG,$P,$len)]} at $P $len") if $DEBUG & DEBUG::matchers; diff --git a/STD.pm b/STD.pm index d9afa7c..1b88b4a 100644 --- a/STD.pm +++ b/STD.pm @@ -1024,7 +1024,7 @@ token label { :my $label; ':' <.ws> - [ .text) }> + [ .Str) }> <.panic("Illegal redeclaration of '$label'")> ]? @@ -1084,7 +1084,7 @@ token statement_control:use { | | ? {{ - my $longname = $.text; + my $longname = $.Str; $¢.add_our_name($longname); # XXX cheat on import list for now $¢.do_imports($longname, $[0]); @@ -1236,7 +1236,7 @@ token PRE { { $ = $; $ = $ } {*} #= prefix | - { $ = $; $ = $.text } + { $ = $; $ = $.Str } {*} #= precircum ] # XXX assuming no precedence change @@ -1276,7 +1276,7 @@ token noun { :my $SCOPE is context = "our"; [ | - | <.check_variable($.text)> + | <.check_variable($.Str)> | | | @@ -1307,11 +1307,11 @@ token colonpair { :dba('colon pair') [ | '!' - { $key = $.text; $value = 0; } + { $key = $.Str; $value = 0; } {*} #= false | $ = [\d+] | - { $key = $.text; } + { $key = $.Str; } [ || <.unsp>? '.'? { $value = $; } || { $value = 1; } @@ -1322,7 +1322,7 @@ token colonpair { { $key = ""; $value = $; } {*} #= structural | $ = ( {} ? ) - { $key = $.text; $value = $; } + { $key = $.Str; $value = $; } {*} #= varname ] { $ = $key; $ = $value; } @@ -1336,17 +1336,17 @@ token quotepair { :dba('colon pair (restricted)') [ | '!' - { $key = $.text; $value = 0; } + { $key = $.Str; $value = 0; } {*} #= false | - { $key = $.text; } + { $key = $.Str; } [ || <.unsp>? '.'? { $value = $; } || { $value = 1; } ] {*} #= value | $=(\d+) $=(<[a..z]>+) - { $key = $.text; $value = $.text; } + { $key = $.Str; $value = $.Str; } {*} #= nth ] { $ = $key; $ = $value; } @@ -1383,7 +1383,7 @@ token infixish ($in_meta = $*IN_META) { # doing fancy as one rule simplifies LTM token dotty:sym<.*> ( --> Methodcall) { ('.' [ <[+*?=]> | '^' '!'? ]) :: <.unspacey> - { $ = $0.item; } + { $ = $0.Str; } } token dotty:sym<.> ( --> Methodcall) { @@ -1450,7 +1450,7 @@ regex prefix_circumfix_meta_operator:reduce (--> List_prefix) { ] { $ = $; $ = 'unary'; $ = 'left'; } - { $ = $.text; } + { $ = $.Str; } } @@ -1462,7 +1462,7 @@ token infix_prefix_meta_operator:sym ( --> Transparent) { {} [ - || .text eq '=' }> + || .Str eq '=' }> { $¢ = ::Chaining.coerce($¢); } || <.can_meta($, "negate")> @@ -1524,7 +1524,7 @@ token postcircumfix:sym<( )> ( --> Methodcall) { :dba('argument list') '(' ~ ')' } token postcircumfix:sym<[ ]> ( --> Methodcall) - { :dba('subscript') '[' ~ ']' { $.text eq '-1' and $¢.obs("[-1] subscript to access final element","[*-1]") } } + { :dba('subscript') '[' ~ ']' { $.Str eq '-1' and $¢.obs("[-1] subscript to access final element","[*-1]") } } token postcircumfix:sym<{ }> ( --> Methodcall) { :dba('subscript') '{' ~ '}' } @@ -1546,7 +1546,7 @@ token postop { token methodop { [ | - | <.check_variable($.text)> + | <.check_variable($.Str)> | > { $ ~~ /\W/ or $¢.panic("Useless use of quotes") } ] <.unsp>? @@ -1591,7 +1591,7 @@ token circumfix:sym<{ }> ( --> Term) { token variable_declarator { :my $IN_DECL is context = 1; - { $*IN_DECL = 0; self.add_variable($.text) } + { $*IN_DECL = 0; self.add_variable($.Str) } [ # Is it a shaped array or hash declaration? # eq '@' | '%' }> <.unsp>? @@ -1617,7 +1617,7 @@ rule scoped { | ] || > {{ - my $t = $.text; + my $t = $.Str; if not $¢.is_known($t) { $¢.panic("In \"$*SCOPE\" declaration, typename $t must be predeclared (or marked as declarative with :: prefix)"); } @@ -1690,7 +1690,7 @@ rule package_def { [ { $longname = $[0]; - $¢.add_name($longname.text); + $¢.add_name($longname.Str); } ]? * @@ -1701,7 +1701,7 @@ rule package_def { my $pkg = $*PKGNAME || "GLOBAL"; my $shortname; if $longname { - $shortname = $longname..text; + $shortname = $longname..Str; } else { $shortname = '_anon_'; @@ -1722,7 +1722,7 @@ rule package_def { || {} {{ $longname orelse $¢.panic("Compilation unit cannot be anonymous"); - my $shortname = $longname..text; + my $shortname = $longname..Str; $*PKGNAME = $shortname; my $newpkg = $*CURPKG.{$shortname ~ '::'} //= {}; $newpkg. = $*CURPKG; @@ -1768,7 +1768,7 @@ token special_variable:sym<$!> { } token special_variable:sym<$!{ }> { # XXX the backslashes are necessary here for bootstrapping, not for P6... ( '$!{' :: (.*?) '}' ) - <.obs($0.text ~ " variable", 'smart match against $!')> + <.obs($0.Str ~ " variable", 'smart match against $!')> } token special_variable:sym<$/> { @@ -1798,7 +1798,7 @@ token special_variable:sym<$@> { token special_variable:sym<$#> { :: [ - || (\w+) <.obs("\$#" ~ $0.text ~ " variable", "\@\{" ~ $0.text ~ "}.end")> + || (\w+) <.obs("\$#" ~ $0.Str ~ " variable", "\@\{" ~ $0.Str ~ "}.end")> || <.obs('$# variable', '.fmt')> ] } @@ -1814,7 +1814,7 @@ token special_variable:sym<$%> { # Note: this works because placeholders are restricted to lowercase token special_variable:sym<$^X> { '^' $ = [<[A..Z]>] \W - <.obscaret($.text ~ '^' ~ $.text, $, $.text)> + <.obscaret($.Str ~ '^' ~ $.Str, $, $.Str)> } token special_variable:sym<$^> { @@ -1904,7 +1904,7 @@ token special_variable:sym<$+> { token special_variable:sym<${^ }> { ( '{^' :: (.*?) '}' ) - <.obscaret($0.text, $, $0.{0}.text)> + <.obscaret($0.Str, $, $0.{0}.Str)> } # XXX should eventually rely on multi instead of nested cases here... @@ -1957,7 +1957,7 @@ token special_variable:sym<::{ }> { token special_variable:sym<${ }> { ( <[$@%]> '{' :: (.*?) '}' ) - <.obs("" ~ $0.text ~ " variable", "\{" ~ $.text ~ "}(" ~ $0.{0}.text ~ ")")> + <.obs("" ~ $0.Str ~ " variable", "\{" ~ $.Str ~ "}(" ~ $0.{0}.Str ~ ")")> } token special_variable:sym<$[> { @@ -2029,7 +2029,7 @@ token special_variable:sym<$?> { token desigilname { [ - | <.check_variable($.text)> + | <.check_variable($.Str)> | ] } @@ -2039,18 +2039,18 @@ token variable { :my $sigil = ''; :my $twigil = ''; :my $name; - { $*SIGIL ||= $sigil = $.text } > {} + { $*SIGIL ||= $sigil = $.Str } > {} [ || '&' [ - | ? { $name = $.text } {*} #= subnoun + | ? { $name = $.Str } {*} #= subnoun | '[' ~ ']' ] || '$' ? || '$::' ? # XXX || '$:' ? # XXX || [ - | ? { $name = $.text } {*} #= desigilname + | ? { $name = $.Str } {*} #= desigilname | {*} #= special | $=[\d+] {*} #= $0 # Note: $() can also parse as contextualizer in an expression; should have same effect @@ -2059,12 +2059,12 @@ token variable { ] ] - { my $t = $; $twigil = $t.[0].text if @$t; } + { my $t = $; $twigil = $t.[0].Str if @$t; } [ <.unsp>? {*} #= methcall || {{ - $name //= $[0].text if $; + $name //= $[0].Str if $; given $sigil { when '$' { given $name { @@ -2136,7 +2136,7 @@ token deflongname { # XXX too soon [ + { $¢.add_macro($) if $*IN_DECL; } ]? - { $¢.add_routine($.text) if $*IN_DECL; } + { $¢.add_routine($.Str) if $*IN_DECL; } } token longname { @@ -2165,7 +2165,7 @@ token subshortname { [ | [ + { $¢.add_macro($) if $*IN_DECL; } ]? - | { $¢.add_routine($.text) if $*IN_DECL; } + | { $¢.add_routine($.Str) if $*IN_DECL; } ] } @@ -2202,7 +2202,7 @@ token typename { | '::?' # parse ::?CLASS as special case | .text; + my $longname = $.Str; if substr($longname, 0, 2) eq '::' { $¢.add_my_name(substr($longname, 2)); } @@ -2432,8 +2432,8 @@ token nibbler { { my $n = $[*-1]; my @n = @$n; - $text ~= $[*-1].text ~ shift(@n); - $text = (@n ?? pop(@n) !! '') ~ $[*-1].text; + $text ~= $[*-1].Str ~ shift(@n); + $text = (@n ?? pop(@n) !! '') ~ $[*-1].Str; push @nibbles, @n; } || { @@ -2485,7 +2485,7 @@ token quote:qq { :my $qm; 'qq' [ - | » { $qm = $.text } <.ws> 1))> + | » { $qm = $.Str } <.ws> 1))> | » <.ws> ] } @@ -2493,7 +2493,7 @@ token quote:q { :my $qm; 'q' [ - | » { $qm = $.text } 1))> + | » { $qm = $.Str } 1))> | » <.ws> ] } @@ -2502,7 +2502,7 @@ token quote:Q { :my $qm; 'Q' [ - | » { $qm = $.text } 1))> + | » { $qm = $.Str } 1))> | » <.ws> ] } @@ -2555,7 +2555,7 @@ token quote:tr { token old_rx_mods { (< i g s m x c e >+) {{ - given $0.text { + given $0.Str { $_ ~~ /i/ and $¢.worryobs('/i',':i'); $_ ~~ /g/ and $¢.worryobs('/g',':g'); $_ ~~ /s/ and $¢.worryobs('/s','^^ and $$ anchors'); @@ -2571,7 +2571,7 @@ token old_rx_mods { token old_tr_mods { (< c d s ] >+) {{ - given $0.text { + given $0.Str { $_ ~~ /c/ and $¢.worryobs('/c',':c'); $_ ~~ /d/ and $¢.worryobs('/g',':d'); $_ ~~ /s/ and $¢.worryobs('/s',':s'); @@ -2812,7 +2812,7 @@ grammar Q is STD { } # end role role s1 { - token escape:sym<$> { [ :lang($*LANG) ? <.check_variable($.text)> ] || <.panic: "Non-variable \$ must be backslashed"> } + token escape:sym<$> { [ :lang($*LANG) ? <.check_variable($.Str)> ] || <.panic: "Non-variable \$ must be backslashed"> } token special_variable:sym<$"> { '$' <.panic: "Can't use a \$ in the last position of an interpolating string"> @@ -2826,7 +2826,7 @@ grammar Q is STD { } # end role role a1 { - token escape:sym<@> { :my $IN_QUOTE is context = 1; [ :lang($*LANG) <.check_variable($.text)> | ] } # trap ABORTBRANCH from variable's :: + token escape:sym<@> { :my $IN_QUOTE is context = 1; [ :lang($*LANG) <.check_variable($.Str)> | ] } # trap ABORTBRANCH from variable's :: } # end role role a0 { @@ -2834,7 +2834,7 @@ grammar Q is STD { } # end role role h1 { - token escape:sym<%> { :my $IN_QUOTE is context = 1; [ :lang($*LANG) <.check_variable($.text)> | ] } + token escape:sym<%> { :my $IN_QUOTE is context = 1; [ :lang($*LANG) <.check_variable($.Str)> | ] } } # end role role h0 { @@ -2842,7 +2842,7 @@ grammar Q is STD { } # end role role f1 { - token escape:sym<&> { :my $IN_QUOTE is context = 1; [ :lang($*LANG) <.check_variable($.text)> | ] } + token escape:sym<&> { :my $IN_QUOTE is context = 1; [ :lang($*LANG) <.check_variable($.Str)> | ] } } # end role role f0 { @@ -2883,7 +2883,7 @@ grammar Q is STD { token backslash:stopper { } # in single quotes, keep backslash on random character by default - token backslash:misc { {} (.) { $ = "\\" ~ $0.text; } } + token backslash:misc { {} (.) { $ = "\\" ~ $0.Str; } } # begin tweaks (DO NOT ERASE) multi method tweak (:single(:$q)) { self.panic("Too late for :q") } @@ -2895,7 +2895,7 @@ grammar Q is STD { role qq does b1 does c1 does s1 does a1 does h1 does f1 { token stopper { \" } # in double quotes, omit backslash on random \W backslash by default - token backslash:misc { {} [ (\W) { $ = $0.text; } | $=(\w) <.panic("Unrecognized backslash sequence: '\\" ~ $.text ~ "'")> ] } + token backslash:misc { {} [ (\W) { $ = $0.Str; } | $=(\w) <.panic("Unrecognized backslash sequence: '\\" ~ $.Str ~ "'")> ] } # begin tweaks (DO NOT ERASE) multi method tweak (:single(:$q)) { self.panic("Too late for :q") } @@ -3109,7 +3109,7 @@ token signature { token type_declarator:subset { :s [ - { $¢.add_name($.text); } + { $¢.add_name($.Str); } [ of ]? [where ]? # (EXPR can parse multiple where clauses) ] || <.panic: "Malformed subset definition"> @@ -3120,7 +3120,7 @@ token type_declarator:enum { <.ws> [ || $l = <.ws> <.ws> - { $¢.add_name($l.text); $¢.add_enum($l.text, $.text); } + { $¢.add_name($l.Str); $¢.add_enum($l.Str, $.Str); } || <.ws> ] } @@ -3159,11 +3159,11 @@ token param_var { | [\w> ]? [ # Is it a longname declaration? - || .text eq '&' }> {} + || .Str eq '&' }> {} {{ $*REALLYADD = 0 }} # sublongname adds symbol || # Is it a shaped array or hash declaration? - .text eq '@' || $.text eq '%' }> + .Str eq '@' || $.Str eq '%' }> ? > @@ -3175,12 +3175,12 @@ token param_var { # bare sigil? ]? {{ - my $vname = $.text; + my $vname = $.Str; my $t = $; my $twigil = ''; - $twigil = $t.[0].text if @$t; + $twigil = $t.[0].Str if @$t; $vname ~= $twigil; - my $n = try { $[0].text } // ''; + my $n = try { $[0].Str } // ''; $vname ~= $n; if $*REALLYADD { given $twigil { @@ -3377,7 +3377,7 @@ token infix:lambda ( --> Term) { } token circumfix:sigil ( --> Term) - { :dba('contextualizer') '(' ~ ')' { $*SIGIL ||= $.text } } + { :dba('contextualizer') '(' ~ ')' { $*SIGIL ||= $.Str } } #token circumfix:typecast ( --> Term) # { '(' ~ ')' } @@ -3795,11 +3795,11 @@ token term:sym ( --> List_prefix) token term:sigil ( --> List_prefix) { - { $ = $.item; } + { $ = $.Str; } } # token term:typecast ( --> List_prefix) -# { { $ = $.item; } } +# { { $ = $.Str; } } # force identifier(), identifier.(), etc. to be a function call always token term:identifier ( --> Term ) @@ -3807,7 +3807,7 @@ token term:identifier ( --> Term ) :my $name; :my $pos; - { $name = $.text; $pos = $¢.pos; } + { $name = $.Str; $pos = $¢.pos; } { self.add_mystery($name,$pos) unless $; } } @@ -3846,12 +3846,12 @@ token term:name ( --> Term) :my $pos; { - $name = $.text; + $name = $.Str; $pos = $¢.pos; } [ || .text) or substr($.text,0,2) eq '::' + $¢.is_name($.Str) or substr($.Str,0,2) eq '::' }> # parametric type? <.unsp>? [ ]? @@ -4177,7 +4177,7 @@ method EXPR ($preclvl) # Equal precedence, so use associativity to decide. if @opstack[*-1] eq $inprec { given $inO { - when 'non' { $here.panic('"' ~ $infix.text ~ '" is not associative') } + when 'non' { $here.panic('"' ~ $infix.Str ~ '" is not associative') } when 'left' { reduce() } # reduce immediately when 'right' { } # just shift when 'chain' { } # just shift @@ -4393,7 +4393,7 @@ grammar Regex is STD { token metachar:sym<^> { } token metachar:sym<$$> { - [ (\w+) <.obs("\$\$" ~ $0.text ~ " to deref var inside a regex", "\$(\$" ~ $0.text ~ ")")> ]? + [ (\w+) <.obs("\$\$" ~ $0.Str ~ " to deref var inside a regex", "\$(\$" ~ $0.Str ~ ")")> ]? } token metachar:sym<$> { '$' @@ -4415,9 +4415,9 @@ grammar Regex is STD { token metachar:var { > - [:lang($¢.cursor_fresh($*LANG)) <.ws> <.check_variable($.text)> ] + [:lang($¢.cursor_fresh($*LANG)) <.ws> <.check_variable($.Str)> ] $ = ( <.ws> '=' <.ws> )? - { $ = $.item; } + { $ = $.Str; } } token backslash:unspace { <.SUPER::ws> } @@ -4516,22 +4516,22 @@ grammar Regex is STD { token mod_internal:sym<:i> { $=[':i'|':ignorecase'] » { $*ignorecase = 1 } } token mod_internal:sym<:!i> { $=[':!i'|':!ignorecase'] » { $*ignorecase = 0 } } - token mod_internal:sym<:i( )> { $=[':i'|':ignorecase'] { $*ignorecase = eval $.text } } + token mod_internal:sym<:i( )> { $=[':i'|':ignorecase'] { $*ignorecase = eval $.Str } } token mod_internal:sym<:0i> { ':' (\d+) ['i'|'ignorecase'] { $*ignorecase = $0 } } token mod_internal:sym<:a> { $=[':a'|':ignoreaccent'] » { $*ignoreaccent = 1 } } token mod_internal:sym<:!a> { $=[':!a'|':!ignoreaccent'] » { $*ignoreaccent = 0 } } - token mod_internal:sym<:a( )> { $=[':a'|':ignoreaccent'] { $*ignoreaccent = eval $.text } } + token mod_internal:sym<:a( )> { $=[':a'|':ignoreaccent'] { $*ignoreaccent = eval $.Str } } token mod_internal:sym<:0a> { ':' (\d+) ['a'|'ignoreaccent'] { $*ignoreaccent = $0 } } token mod_internal:sym<:s> { ':s' 'igspace'? » { $*sigspace = 1 } } token mod_internal:sym<:!s> { ':!s' 'igspace'? » { $*sigspace = 0 } } - token mod_internal:sym<:s( )> { ':s' 'igspace'? { $*sigspace = eval $.text } } + token mod_internal:sym<:s( )> { ':s' 'igspace'? { $*sigspace = eval $.Str } } token mod_internal:sym<:0s> { ':' (\d+) 's' 'igspace'? » { $*sigspace = $0 } } token mod_internal:sym<:r> { ':r' 'atchet'? » { $*ratchet = 1 } } token mod_internal:sym<:!r> { ':!r' 'atchet'? » { $*ratchet = 0 } } - token mod_internal:sym<:r( )> { ':r' 'atchet'? » { $*ratchet = eval $.text } } + token mod_internal:sym<:r( )> { ':r' 'atchet'? » { $*ratchet = eval $.Str } } token mod_internal:sym<:0r> { ':' (\d+) 'r' 'atchet'? » { $*ratchet = $0 } } token mod_internal:sym<:Perl5> { [':Perl5' | ':P5'] [ :lang( $¢.cursor_fresh( ::STD::P5Regex ).unbalanced($*GOAL) ) ] } diff --git a/gimme5 b/gimme5 index 066ba17..cc2b776 100755 --- a/gimme5 +++ b/gimme5 @@ -157,7 +157,7 @@ sub un6 { $f =~ s/^\|%/%/ and next; $f =~ s/^\.HOW// and $t .= qq/->meta/, next; $f =~ s/^HOW// and $t .= qq/meta/, next; - $f =~ s/^\.([a-z]\w+)// and $t .= qq/->$1/, next; + $f =~ s/^\.([A-Za-z]\w+)// and $t .= qq/->$1/, next; $f =~ s/^!===?// and $t .= qq/!=/, next; $f =~ s/^===// and $t .= qq/==/, next; $f =~ s/^!eqv// and $t .= qq/ne/, next; diff --git a/tryfile b/tryfile index dbb583a..6e140d0 100755 --- a/tryfile +++ b/tryfile @@ -12,6 +12,7 @@ if (not @ARGV) { for my $file (@ARGV) { warn $file,"\n" if @ARGV > 1; + next unless -f $file; eval { warn "Undefined\n" unless defined STD->parsefile($file); }; diff --git a/viv b/viv index 597d8c9..4c60602 100755 --- a/viv +++ b/viv @@ -239,7 +239,7 @@ sub VIV::SET_OPT { } } elsif ($sym eq 'identifier') { - $text .= join('', reverse @zyg); + $text .= join('', @zyg); } else { $text .= join('', @zyg); @@ -251,6 +251,9 @@ sub VIV::SET_OPT { elsif (@sym) { $text .= join('', @sym); } + else { + $text .= ref $self; + } $self->ret($text); } @@ -324,9 +327,9 @@ sub VIV::SET_OPT { { package VAST::CircumSym; our @ISA = 'VAST::Base'; sub emit_p6 { my $self = shift; my $text = $self->get_ws; - $text .= $self->{sym}[0]; + $text .= $self->{sym}[0]//''; $text .= $self->SUPER::emit_p6(@_); - $text .= $self->{sym}[1]; + $text .= $self->{sym}[1]//''; $text; } } @@ -334,9 +337,9 @@ sub VIV::SET_OPT { { package VAST::FirstLast; our @ISA = 'VAST::Base'; sub emit_p6 { my $self = shift; my $text = $self->get_ws; - $text .= $self->{FIRST}; + $text .= $self->{FIRST}//''; $text .= $self->SUPER::emit_p6(@_); - $text .= $self->{LAST}; + $text .= $self->{LAST}//''; $text; } } @@ -352,6 +355,10 @@ sub VIV::SET_OPT { } } +{ package VAST::CORE; our @ISA = 'VAST::Base'; + sub emit_p6 { '' } +} + { package VAST::Comma; our @ISA = 'VAST::Base'; sub emit_p6 { my $self = shift; my $text = $self->get_ws;