8000 GitHub - DolphyWind/CWS: C with semicolons
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

DolphyWind/CWS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C With Semicolons

A fork of TCC that implements a new language I call "C With Semicolons" (or CWS for short) where you have to put semicolons after if(...), while(...), for(...) and switch(...). I tested this on a x86-64 machine and it works. It would probably break on a different architecture, but it works on my machine™ so that's enough for me. Feel free to open up a PR if you want.

The compiler also exports C_WITH_SEMICOLONS macro by default, so you can write a code that supports both CWS and C at the same time.

Example

#include <stdio.h>

int main()
{
  int a, b;
  printf("First number: ");
  scanf("%d", &a);
  printf("Second number: ");
  scanf("%d", &b);

  if(a > b); // <--- CWS extension
  {
    printf("%d is greater than %d\n", a, b);
  }
  else if(a == b); // <--- Here's another
  {
    printf("Both numbers are equal\n");
  }
  else
  {
    printf("%d is less than %d\n", a, b);
  }

  return 0;
}

Why?

This project exists solely to show to my teacher that language syntax is completely arbitrary, and it is not a good idea to derive meanings from it. That's all.

About

C with semicolons

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 96.7%
  • Assembly 1.0%
  • Makefile 1.0%
  • C++ 0.5%
  • Perl 0.3%
  • Shell 0.3%
  • Batchfile 0.2%
0