Last active
January 13, 2019 20:48
-
-
Save oliwer/642e13a6b72f86b6b37bbdae49a358a8 to your computer and use it in GitHub Desktop.
C like Algol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* if ... then | |
* ... | |
* elif ... then | |
* ... | |
* else | |
* ... | |
* end | |
*/ | |
#define if if( | |
#define then ){ | |
#define elif ;}else if | |
#define else ;}else{ | |
#define end ;} | |
/* | |
* repeat | |
* ... | |
* until ... done | |
*/ | |
#define repeat do{ | |
#define until ;}while(!( | |
#define done )); | |
/* | |
* while ... do | |
* ... | |
* end | |
*/ | |
#define while while( | |
#define do ){ | |
/* | |
* for ... do | |
* ... | |
* end | |
*/ | |
#define for for( | |
/* | |
* switch ... in | |
* case ...: ...; break; | |
* default: ... | |
* end | |
*/ | |
#define in { | |
/* | |
* int func(...) | |
* begin | |
* ... | |
* end | |
*/ | |
#define begin { | |
/* | |
* struct ... begin | |
* ... | |
* end | |
* | |
* union ... begin | |
* ... | |
* end | |
*/ | |
#define nil ((void*)0) | |
#define and && | |
#define or || | |
// static void freep(void **ptr) { free(*ptr); } | |
#define auto(fn) __attribute__((cleanup(fn))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment