Ignore:
Timestamp:
Aug 26, 2024, 9:15:43 PM (3 months ago)
Author:
chronos
Message:
  • Added: Ruby target.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Target/TargetPython.pas

    r161 r180  
    5959
    6060  AddLine('# ' + ProgramName);
    61   AddLine('');
     61  AddLine;
    6262  AddLine('class _Getch:');
    6363  AddLine('    """Gets a single character from standard input.  Does not echo to the screen."""');
     
    6767  AddLine('        except ImportError:');
    6868  AddLine('            self.impl = _GetchUnix()');
    69   AddLine('');
     69  AddLine;
    7070  AddLine('    def __call__(self): return self.impl()');
    71   AddLine('');
    72   AddLine('');
     71  AddLine;
     72  AddLine;
    7373  AddLine('class _GetchUnix:');
    7474  AddLine('    def __init__(self):');
    7575  AddLine('        import tty, sys');
    76   AddLine('');
     76  AddLine;
    7777  AddLine('    def __call__(self):');
    7878  AddLine('        import sys, tty, termios');
     
    8585  AddLine('            termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)');
    8686  AddLine('        return ch');
    87   AddLine('');
    88   AddLine('');
     87  AddLine;
     88  AddLine;
    8989  AddLine('class _GetchWindows:');
    9090  AddLine('    def __init__(self):');
    9191  AddLine('        import msvcrt');
    92   AddLine('');
     92  AddLine;
    9393  AddLine('    def __call__(self):');
    9494  AddLine('        import msvcrt');
    9595  AddLine('        return msvcrt.getch()');
    96   AddLine('');
     96  AddLine;
    9797  AddLine('getchar = _Getch()');
    98   AddLine('');
     98  AddLine;
    9999  AddLine('import sys');
    100100  AddLine('memory = [0] * ' + IntToStr(MemorySize));
Note: See TracChangeset for help on using the changeset viewer.