Permalink
Browse files

Perlito5 - javascript: eval-block works

  • Loading branch information...
fglock committed Mar 12, 2012
1 parent 0c8a7e9 commit 7a03ff4ea3cbcb62636f00f68271eb92e73f61a0
View
@@ -39,6 +39,7 @@ TODO list for Perlito5
-- double-quoted here-docs
-- parse "local $x[1]"
+-- parse local $@
-- $v{x} doesn't autoquote the index
-- $v{x} doesn't interpolate inside double quotes
@@ -51,6 +52,10 @@ TODO list for Perlito5
* Javascript backend
+-- no global error handler when running in node.js;
+ there is no catch for the syntax error in:
+ $ node perlito5.js -Bjs -e ' { '
+
-- "autoload" the compiler if eval-string is used (eval-string needs the compiler at run-time)
-- symbol variables like $] ${"main::\$"} $#_
View
@@ -1821,14 +1821,25 @@ CORE.prototype = function(List__, data) {
if ( (v_code == 'eval') ) {
(function () {
(NAMESPACE["Perlito5"].v_THROW = 1);
- var v_var_env_perl5 = null;
- (v_var_env_perl5 = NAMESPACE["Perlito5::Dumper"].Dumper([NAMESPACE["Perlito5"].v_VAR]));
- var v_m = null;
- (v_m = _call_(NAMESPACE["Perlito5::Expression"], "term_square", [v_var_env_perl5,0]));
- (v_m = NAMESPACE["Perlito5::Expression"].expand_list([(_call_(v_m, "flat", []) || (_call_(v_m, "flat", []) = new ArrayRef([])))._array_[2]]));
- var v_var_env_js = null;
- (v_var_env_js = ('(new ArrayRef(' + string(NAMESPACE["Perlito5::Javascript"].to_list([v_m])) + '))'));
- throw(('(function () {' + String.fromCharCode(10) + 'var r = null;' + String.fromCharCode(10) + 'NAMESPACE["main"]["v_@"] = "";' + String.fromCharCode(10) + 'try {' + String.fromCharCode(10) + 'r = eval(perl5_to_js(' + string(NAMESPACE["Perlito5::Javascript"].to_str([((v_self || (v_self = new HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new HashRef({})))._hash_['arguments'] = new ArrayRef([])))._array_[0]])) + ', ' + '"' + string(NAMESPACE["Perlito5"].v_PKG_NAME) + '", ' + string(v_var_env_js) + '))' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'catch(err) {' + String.fromCharCode(10) + 'if ( err instanceof p5_error ) {' + String.fromCharCode(10) + 'NAMESPACE["main"]["v_@"] = err.v;' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'else if ( err instanceof Error ) {' + String.fromCharCode(10) + 'NAMESPACE["main"]["v_@"] = err;' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'else {' + String.fromCharCode(10) + 'throw(err);' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'return r;' + String.fromCharCode(10) + '})()'));
+ var v_arg = null;
+ (v_arg = ((v_self || (v_self = new HashRef({})))._hash_['arguments'] || ((v_self || (v_self = new HashRef({})))._hash_['arguments'] = new ArrayRef([])))._array_[0]);
+ var v_eval = null;
+ if ( bool(_call_(v_arg, "isa", ['Perlito5::AST::Do'])) ) {
+ (v_eval = _call_(v_arg, "emit_javascript", [add(v_level, 1)]));
+ }
+ else {
+ (function () {
+ var v_var_env_perl5 = null;
+ (v_var_env_perl5 = NAMESPACE["Perlito5::Dumper"].Dumper([NAMESPACE["Perlito5"].v_VAR]));
+ var v_m = null;
+ (v_m = _call_(NAMESPACE["Perlito5::Expression"], "term_square", [v_var_env_perl5,0]));
+ (v_m = NAMESPACE["Perlito5::Expression"].expand_list([(_call_(v_m, "flat", []) || (_call_(v_m, "flat", []) = new ArrayRef([])))._array_[2]]));
+ var v_var_env_js = null;
+ (v_var_env_js = ('(new ArrayRef(' + string(NAMESPACE["Perlito5::Javascript"].to_list([v_m])) + '))'));
+ (v_eval = ('eval(perl5_to_js(' + string(NAMESPACE["Perlito5::Javascript"].to_str([v_arg])) + ', ' + '"' + string(NAMESPACE["Perlito5"].v_PKG_NAME) + '", ' + string(v_var_env_js) + '))'));
+ })();
+ };
+ throw(('(function () {' + String.fromCharCode(10) + 'var r = null;' + String.fromCharCode(10) + 'NAMESPACE["main"]["v_@"] = "";' + String.fromCharCode(10) + 'try {' + String.fromCharCode(10) + 'r = ' + string(v_eval) + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'catch(err) {' + String.fromCharCode(10) + 'if ( err instanceof p5_error ) {' + String.fromCharCode(10) + 'NAMESPACE["main"]["v_@"] = err.v;' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'else if ( err instanceof Error ) {' + String.fromCharCode(10) + 'NAMESPACE["main"]["v_@"] = err;' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'else {' + String.fromCharCode(10) + 'throw(err);' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + '}' + String.fromCharCode(10) + 'return r;' + String.fromCharCode(10) + '})()'));
})();
};
if ( (v_code == 'undef') ) {
@@ -2271,7 +2282,7 @@ CORE.prototype = function(List__, data) {
return (_call_(NAMESPACE["Perlito5::Expression"], "term_arrow", [List__[0],List__[1]]));
}))))));
var List_Term_chars = [];
- (List_Term_chars = interpolate_array(7, 5, 3, 2, 1));
+ (List_Term_chars = interpolate_array(7, 5, 4, 3, 2, 1));
var List_Term = [];
(List_Term = interpolate_array((new HashRef(array_to_hash([]))), (new HashRef(array_to_hash(interpolate_array('$', function (List__) {
return (_call_(NAMESPACE["Perlito5::Expression"], "term_sigil", [List__[0],List__[1]]));
@@ -4186,20 +4197,9 @@ CORE.prototype = function(List__, data) {
var v_pos1 = null;
(v_pos1 = (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']);
return (((function () {
- return (and(and(and(and(and(and(and((and(('eval' == NAMESPACE["Perlito5::Expression"].substr([v_str, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'], 4])), function () { return (((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = add(4, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']))); })), function () { return ((function () {
+ return (and(and(and(and((and(('eval' == NAMESPACE["Perlito5::Expression"].substr([v_str, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'], 4])), function () { return (((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = add(4, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']))); })), function () { return ((function () {
var v_m2 = null;
- (v_m2 = _call_(v_grammar, "opt_ws", [v_str,(v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']]));
- if ( bool((v_m2 || (v_m2 = new HashRef({})))._hash_['bool']) ) {
- ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = (v_m2 || (v_m2 = new HashRef({})))._hash_['to']);
- return (1);
- }
-
- else {
- return (0);
- }
-})()); }), function () { return (and(('{' == NAMESPACE["Perlito5::Expression"].substr([v_str, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'], 1])), function () { return (((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = add(1, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']))); })); }), function () { return ((function () {
- var v_m2 = null;
- (v_m2 = _call_(v_grammar, "opt_ws", [v_str,(v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']]));
+ (v_m2 = _call_(NAMESPACE["Perlito5::Grammar"], "ws", [v_str,(v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']]));
if ( bool((v_m2 || (v_m2 = new HashRef({})))._hash_['bool']) ) {
((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = (v_m2 || (v_m2 = new HashRef({})))._hash_['to']);
return (1);
@@ -4209,42 +4209,33 @@ CORE.prototype = function(List__, data) {
return (0);
}
})()); }), function () { return ((function () {
- var v_m2 = null;
- (v_m2 = _call_(v_grammar, "exp_stmts", [v_str,(v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']]));
- if ( bool((v_m2 || (v_m2 = new HashRef({})))._hash_['bool']) ) {
- ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = (v_m2 || (v_m2 = new HashRef({})))._hash_['to']);
- ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['exp_stmts'] = v_m2);
- return (1);
- }
-
- else {
- return (0);
- }
+ var v_tmp = null;
+ (v_tmp = v_MATCH);
+ (v_MATCH = _call_(NAMESPACE["Perlito5::Match"], "new", ['str', v_str,'from', (v_tmp || (v_tmp = new HashRef({})))._hash_['to'],'to', (v_tmp || (v_tmp = new HashRef({})))._hash_['to'],'bool', 1]));
+ ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['bool'] = ((function () {
+ var v_pos1 = null;
+ (v_pos1 = (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']);
+ return (((function () {
+ return (and(('{' == NAMESPACE["Perlito5::Expression"].substr([v_str, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'], 1])), function () { return (((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = add(1, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']))); }));
+ })()));
+ })()));
+ ((v_tmp || (v_tmp = new HashRef({})))._hash_['bool'] = ( bool((v_MATCH || (v_MATCH = new HashRef({})))._hash_['bool']) ? 1 : 0));
+ (v_MATCH = v_tmp);
+ return (( bool((v_MATCH || (v_MATCH = new HashRef({})))._hash_['bool']) ? 1 : 0));
})()); }), function () { return ((function () {
var v_m2 = null;
- (v_m2 = _call_(v_grammar, "opt_ws", [v_str,(v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']]));
+ (v_m2 = _call_(v_grammar, "statement_parse", [v_str,(v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']]));
if ( bool((v_m2 || (v_m2 = new HashRef({})))._hash_['bool']) ) {
((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = (v_m2 || (v_m2 = new HashRef({})))._hash_['to']);
+ ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['statement_parse'] = v_m2);
return (1);
}
else {
return (0);
}
})()); }), function () { return ((function () {
- var v_pos1 = null;
- (v_pos1 = (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']);
- return (or(((function () {
- return (and(('}' == NAMESPACE["Perlito5::Expression"].substr([v_str, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'], 1])), function () { return (((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = add(1, (v_MATCH || (v_MATCH = new HashRef({})))._hash_['to']))); }));
-})()), function () { return ((function () {
- ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['to'] = v_pos1);
- return ((((function () {
- NAMESPACE["Perlito5::Expression"].die(['Syntax Error in eval block']);
- return (1);
- })())));
-})()); }));
-})()); }), function () { return ((function () {
- ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['capture'] = (new ArrayRef(interpolate_array('term', _call_(NAMESPACE["Perlito5::AST::Apply"], "new", ['code', 'eval','arguments', (new ArrayRef(interpolate_array(_call_(NAMESPACE["Perlito5::AST::Sub"], "new", ['name', null,'namespace', null,'sig', '','block', _call_((v_MATCH || (v_MATCH = new HashRef({})))._hash_['exp_stmts'], "flat", [])])))),'namespace', ''])))));
+ ((v_MATCH || (v_MATCH = new HashRef({})))._hash_['capture'] = (new ArrayRef(interpolate_array('term', _call_(NAMESPACE["Perlito5::AST::Apply"], "new", ['code', 'eval','arguments', (new ArrayRef(interpolate_array(_call_(NAMESPACE["Perlito5::AST::Do"], "new", ['block', _call_((v_MATCH || (v_MATCH = new HashRef({})))._hash_['statement_parse'], "flat", [])])))),'namespace', ''])))));
return (1);
})()); }));
})()));
@@ -1034,17 +1034,8 @@ sub Perlito5::Expression::term_eval {
($MATCH->{'bool'} = (((do {
((my $pos1) = $MATCH->{'to'});
((do {
- (((((((((('eval' eq substr($str, $MATCH->{'to'}, 4)) && (($MATCH->{'to'} = (4 + $MATCH->{'to'}))))) && ((do {
- ((my $m2) = $grammar->opt_ws($str, $MATCH->{'to'}));
- if ($m2->{'bool'}) {
- ($MATCH->{'to'} = $m2->{'to'});
- 1
- }
- else {
- 0
- }
-}))) && ((('{' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'})))))) && ((do {
- ((my $m2) = $grammar->opt_ws($str, $MATCH->{'to'}));
+ ((((((('eval' eq substr($str, $MATCH->{'to'}, 4)) && (($MATCH->{'to'} = (4 + $MATCH->{'to'}))))) && ((do {
+ ((my $m2) = Perlito5::Grammar->ws($str, $MATCH->{'to'}));
if ($m2->{'bool'}) {
($MATCH->{'to'} = $m2->{'to'});
1
@@ -1053,37 +1044,29 @@ sub Perlito5::Expression::term_eval {
0
}
}))) && ((do {
- ((my $m2) = $grammar->exp_stmts($str, $MATCH->{'to'}));
- if ($m2->{'bool'}) {
- ($MATCH->{'to'} = $m2->{'to'});
- ($MATCH->{'exp_stmts'} = $m2);
- 1
- }
- else {
- 0
- }
+ ((my $tmp) = $MATCH);
+ ($MATCH = Perlito5::Match->new(('str' => $str), ('from' => $tmp->{'to'}), ('to' => $tmp->{'to'}), ('bool' => 1)));
+ ($MATCH->{'bool'} = ((do {
+ ((my $pos1) = $MATCH->{'to'});
+ ((do {
+ (('{' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
+}))
+})));
+ ($tmp->{'bool'} = ($MATCH->{'bool'} ? 1 : 0));
+ ($MATCH = $tmp);
+ ($MATCH->{'bool'} ? 1 : 0)
}))) && ((do {
- ((my $m2) = $grammar->opt_ws($str, $MATCH->{'to'}));
+ ((my $m2) = $grammar->statement_parse($str, $MATCH->{'to'}));
if ($m2->{'bool'}) {
($MATCH->{'to'} = $m2->{'to'});
+ ($MATCH->{'statement_parse'} = $m2);
1
}
else {
0
}
}))) && ((do {
- ((my $pos1) = $MATCH->{'to'});
- (((do {
- (('}' eq substr($str, $MATCH->{'to'}, 1)) && (($MATCH->{'to'} = (1 + $MATCH->{'to'}))))
-})) || ((do {
- ($MATCH->{'to'} = $pos1);
- (((do {
- die('Syntax Error in eval block');
- 1
-})))
-})))
-}))) && ((do {
- ($MATCH->{'capture'} = ['term', Perlito5::AST::Apply->new(('code' => 'eval'), ('arguments' => [Perlito5::AST::Sub->new(('name' => undef()), ('namespace' => undef()), ('sig' => ''), ('block' => $MATCH->{'exp_stmts'}->flat()))]), ('namespace' => ''))]);
+ ($MATCH->{'capture'} = ['term', Perlito5::AST::Apply->new(('code' => 'eval'), ('arguments' => [Perlito5::AST::Do->new(('block' => $MATCH->{'statement_parse'}->flat()))]), ('namespace' => ''))]);
1
})))
}))
@@ -593,11 +593,19 @@ for ($_) {
};
if (($code eq 'eval')) {
($Perlito5::THROW = 1);
- ((my $var_env_perl5) = Perlito5::Dumper::Dumper($Perlito5::VAR));
- ((my $m) = Perlito5::Expression->term_square($var_env_perl5, 0));
- ($m = Perlito5::Expression::expand_list($m->flat()->[2]));
- ((my $var_env_js) = ('(new ArrayRef(' . Perlito5::Javascript::to_list($m) . '))'));
- return (('(function () {' . chr(10) . 'var r = null;' . chr(10) . 'NAMESPACE["main"]["v_@"] = "";' . chr(10) . 'try {' . chr(10) . 'r = eval(perl5_to_js(' . Perlito5::Javascript::to_str($self->{'arguments'}->[0]) . ', ' . '"' . $Perlito5::PKG_NAME . '", ' . $var_env_js . '))' . chr(10) . '}' . chr(10) . 'catch(err) {' . chr(10) . 'if ( err instanceof p5_error ) {' . chr(10) . 'NAMESPACE["main"]["v_@"] = err.v;' . chr(10) . '}' . chr(10) . 'else if ( err instanceof Error ) {' . chr(10) . 'NAMESPACE["main"]["v_@"] = err;' . chr(10) . '}' . chr(10) . 'else {' . chr(10) . 'throw(err);' . chr(10) . '}' . chr(10) . '}' . chr(10) . 'return r;' . chr(10) . '})()'))
+ ((my $arg) = $self->{'arguments'}->[0]);
+ (my $eval);
+ if ($arg->isa('Perlito5::AST::Do')) {
+ ($eval = $arg->emit_javascript(($level + 1)))
+ }
+ else {
+ ((my $var_env_perl5) = Perlito5::Dumper::Dumper($Perlito5::VAR));
+ ((my $m) = Perlito5::Expression->term_square($var_env_perl5, 0));
+ ($m = Perlito5::Expression::expand_list($m->flat()->[2]));
+ ((my $var_env_js) = ('(new ArrayRef(' . Perlito5::Javascript::to_list($m) . '))'));
+ ($eval = ('eval(perl5_to_js(' . Perlito5::Javascript::to_str($arg) . ', ' . '"' . $Perlito5::PKG_NAME . '", ' . $var_env_js . '))'))
+ };
+ return (('(function () {' . chr(10) . 'var r = null;' . chr(10) . 'NAMESPACE["main"]["v_@"] = "";' . chr(10) . 'try {' . chr(10) . 'r = ' . $eval . chr(10) . '}' . chr(10) . 'catch(err) {' . chr(10) . 'if ( err instanceof p5_error ) {' . chr(10) . 'NAMESPACE["main"]["v_@"] = err.v;' . chr(10) . '}' . chr(10) . 'else if ( err instanceof Error ) {' . chr(10) . 'NAMESPACE["main"]["v_@"] = err;' . chr(10) . '}' . chr(10) . 'else {' . chr(10) . 'throw(err);' . chr(10) . '}' . chr(10) . '}' . chr(10) . 'return r;' . chr(10) . '})()'))
};
if (($code eq 'undef')) {
if (($self->{'arguments'} && @{$self->{'arguments'}})) {
@@ -45,7 +45,7 @@ sub Perlito5::Precedence::is_ident_middle {
})}, {('->' => sub {
Perlito5::Expression->term_arrow($_[0], $_[1])
})}));
-((my @Term_chars) = (7, 5, 3, 2, 1));
+((my @Term_chars) = (7, 5, 4, 3, 2, 1));
((my @Term) = ({}, {('$' => sub {
Perlito5::Expression->term_sigil($_[0], $_[1])
}), ('@' => sub {
View
@@ -149,7 +149,11 @@ sub Perlito::add_comp_unit {
($Perlito5::PKG_NAME = 'main');
($Perlito5::PROTO = {});
if ($execute) {
- eval($source)
+ eval($source);
+ ((my $error) = $@);
+ if ($error) {
+ warn(('Error in eval: ' . $error))
+ }
}
else {
((my $m) = Perlito5::Grammar->exp_stmts($source, 0));
@@ -612,18 +612,14 @@ package Perlito5::Expression;
token term_eval {
# Note: this is eval-block; eval-string is parsed as a normal subroutine
- 'eval' <.opt_ws> \{ <.opt_ws> <exp_stmts> <.opt_ws>
- [ \} | { die 'Syntax Error in eval block' } ]
+ 'eval' <.Perlito5::Grammar.ws> <before '{'> <statement_parse>
{
$MATCH->{"capture"} = [ 'term',
Perlito5::AST::Apply->new(
code => 'eval',
arguments => [
- Perlito5::AST::Sub->new(
- name => undef,
- namespace => undef,
- sig => '',
- block => $MATCH->{"exp_stmts"}->flat()
+ Perlito5::AST::Do->new(
+ block => $MATCH->{"statement_parse"}->flat()
)
],
namespace => ''
@@ -840,12 +840,25 @@ package Perlito5::AST::Apply;
if ($code eq 'eval') {
$Perlito5::THROW = 1; # we can return() from inside eval
- my $var_env_perl5 = Perlito5::Dumper::Dumper( $Perlito5::VAR );
- # say "at eval: ", $var_env_perl5;
- my $m = Perlito5::Expression->term_square( $var_env_perl5, 0 );
- $m = Perlito5::Expression::expand_list( $m->flat()->[2] );
- # say Perlito5::Dumper::Dumper( $m );
- my $var_env_js = '(new ArrayRef(' . Perlito5::Javascript::to_list($m) . '))';
+
+ my $arg = $self->{"arguments"}->[0];
+ my $eval;
+ if ($arg->isa( "Perlito5::AST::Do" )) {
+ $eval = $arg->emit_javascript( $level + 1 );
+ }
+ else {
+ my $var_env_perl5 = Perlito5::Dumper::Dumper( $Perlito5::VAR );
+ # say "at eval: ", $var_env_perl5;
+ my $m = Perlito5::Expression->term_square( $var_env_perl5, 0 );
+ $m = Perlito5::Expression::expand_list( $m->flat()->[2] );
+ # say Perlito5::Dumper::Dumper( $m );
+ my $var_env_js = '(new ArrayRef(' . Perlito5::Javascript::to_list($m) . '))';
+ $eval ='eval(perl5_to_js('
+ . Perlito5::Javascript::to_str($arg) . ", "
+ . '"' . $Perlito5::PKG_NAME . '", '
+ . $var_env_js
+ . "))";
+ }
# TODO - test return() from inside eval
@@ -854,11 +867,7 @@ package Perlito5::AST::Apply;
. "var r = null;\n"
. 'NAMESPACE["main"]["v_@"] = "";' . "\n"
. "try {\n"
- . 'r = eval(perl5_to_js('
- . Perlito5::Javascript::to_str($self->{"arguments"}->[0]) . ", "
- . '"' . $Perlito5::PKG_NAME . '", '
- . $var_env_js
- . "))\n"
+ . 'r = ' . $eval . "\n"
. "}\n"
. "catch(err) {\n"
. "if ( err instanceof p5_error ) {\n"
@@ -55,7 +55,7 @@ my @Parsed_op = (
},
);
-my @Term_chars = (7, 5, 3, 2, 1);
+my @Term_chars = (7, 5, 4, 3, 2, 1);
my @Term = (
# 0 chars
{},
View
@@ -186,6 +186,9 @@ sub add_comp_unit {
if ( $execute ) {
eval $source;
+ my $error = $@;
+ warn "Error in eval: $error"
+ if $error;
}
else {

0 comments on commit 7a03ff4

Please sign in to comment.