File: repl.pl

package info (click to toggle)
notion 4.0.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,676 kB
  • sloc: ansic: 47,508; sh: 2,096; makefile: 603; perl: 270
file content (17 lines) | stat: -rwxr-xr-x 332 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

use strict;

print "lua> ";

while (my $command = <STDIN>) {
  if ($command =~ /^\s*([a-zA-Z_0-9]+)\s*=(.*)/) {
    $command = "$command; return $1;";
  } elsif ($command =~ /return/) {
    $command = $command;
  } else {
    $command = "return $command";
  }
  print `notionflux -e "$command"`;
  print "lua> ";
}