Skip to content

ayonious/C-Code-Beautifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beautify/format your C/C++ code

Build Status

Build instructions:

You can download the binary directly. Make sure you put the proper latest version instead of v0.7

curl -O "https://github.com/ayonious/C-Code-Beautifier/releases/download/v0.7/C-Code-Beautifier"
chmod +x C-Code-Beautifier

Or you can build it from source:

g++ src/Main.cpp src/parselib.cpp src/tokenlib.cpp -o C-Code-Beautifier

Now you will get the executables as 'C-Code-Beautifier'

Running instructions:

./C-Code-Beautifier <inputfile_to_beformatted> <formatted_outputfile>

Find the beautiful output in . You can try the test cases avilable in 'testcases' folder.

Sample Input

#include<stdio.h> #include<conio.h>  if ( ) {
	    if ( ) the quik ; 
    else if ( ) 
		asdlkfjaskdjf ; 
else 
		asdfkljsdf ; }

Sample output

#include<stdio.h>
#include<conio.h>
if ( ) 
{
	if ( ) 
		the quik ; 
	else if ( ) 
		asdlkfjaskdjf ; 
	else 
		asdfkljsdf ; 
}