Skip to content

Commit

Permalink
[Yapsi.pm] renamed 'lexvar' into 'var'
Browse files Browse the repository at this point in the history
This is after realizing that both 'state' variables and contextual variables
are really lexical variables underneath; having all of these be called
'lexvar' just seemed wrong. So 'var' now introduces a lexical variable, and
future flags (something like :dynamic and :state, perhaps) will modify those
lexvars to be have like contextual variables and state variables, respectively.
  • Loading branch information
Carl Masak committed Aug 5, 2010
1 parent 715b5ea commit d5ed674
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Yapsi.pm
Expand Up @@ -114,7 +114,7 @@ class Yapsi::Compiler {
push @sic, '';
push @sic, "block '$m.ast<name>':";
for $m.ast<vars>.list -> $var {
push @sic, " `lexvar '$var'";
push @sic, " `var '$var'";
}
my @blocksic;
my $*c = 0; # unique register counter
Expand Down Expand Up @@ -361,15 +361,15 @@ class Closure {
}

sub new-lexpad-from(@sic, $line is copy, Lexpad $outer?) {
my @lexvars;
my @vars;
while @sic[++$line] ~~ / ' `' (\S*) \s+ \'(<-[']>+)\' / {
given $0 {
when "lexvar" { push @lexvars, ~$1 }
when "var" { push @vars, ~$1 }
default { die "Unknown directive $0"; }
}
}
return Lexpad.new(:slots(map { Container.new }, ^@lexvars),
:names((hash @lexvars.kv).invert),
return Lexpad.new(:slots(map { Container.new }, ^@vars),
:names((hash @vars.kv).invert),
:$outer);
}

Expand Down

0 comments on commit d5ed674

Please sign in to comment.