prettypr.cpp

来自「COCO類似C的編譯器」· C++ 代码 · 共 49 行

CPP
49
字号
//**********************************************************
//   PRETTYPR.CPP
//   Coco/R C++ Taste Example.
//   Adapted to C++ by Frankie Arzu <farzu@uvg.edu.gt>
//      from Moessenboeck's (1990) Oberon example
//
//   May 24, 1996  Version 1.06
//**********************************************************

#include "prettypr.hpp"
#include <stdio.h>

static int Indentation = 0;

void Append(char String[])
{  
  printf("%s",String);
}

void NewLine(void)
{
  int i = 1;
  printf("\n");
  while (i <= Indentation) { printf(" "); i++; }
}

void IndentNextLine(void)
{ 
  Indentation += 2;
  NewLine();
}

void ExdentNextLine(void)
{  
  Indentation -= 2;
  NewLine();
}

void Indent(void)
{ 
  Indentation += 2;
}

void Exdent(void)
{ 
  Indentation -= 2;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?