Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

doc

  • Loading branch information...
commit d39a8258b6ce16229ebfb86b39f10f758cfc8fc2 1 parent 9d0db47
Steven Haryanto authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 lib/Language/Expr.pm
View
15 lib/Language/Expr.pm
@@ -183,6 +183,21 @@ using the interpreter to using one of the available compilers.
This is a TODO item.
+=head2 How to convert Expr expression into Perl code?
+
+ use Language::Expr::Compiler::Perl;
+ my $plc = Language::Expr::Compiler::Perl;
+ print $plc->perl('1 ^^ 2'); # prints '1 xor 2'
+
+See L<Language::Expr::Compiler::Perl> for more details.
+
+=head2 How to convert Expr expression into JavaScript code?
+
+ use Language::Expr::Compiler::JS;
+ my $jsc = Language::Expr::Compiler::JS;
+ print $jsc->js('map({$_**2}, [1, 2, 3])'); # prints '[1, 2, 3].map(function(_){ Math.pow(_, 2) })'
+
+See L<Language::Expr::Compiler::JS> for more details.
=head1 BUGS
Please sign in to comment.
Something went wrong with that request. Please try again.