Skip to content
This repository has been archived by the owner on Mar 30, 2020. It is now read-only.
/ wsd Public archive

A proof of concept for a whitespace-based D dialect.

License

Notifications You must be signed in to change notification settings

ColdenCullen/wsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wsd Build Status

A whitespace-based D dialect. I should note that this a proof of concept, and no more.

Running wsd

Running wsd is as simple as passing it the filename and any args you want to pass to rdmd. For example:

./wsd test1.wsd

wsd Code

wsd code is basically D code, but with 2 fundamental changes:

  1. Braces are illegal. Blocks are specified by indenting another level. Currently only hardware tabs are supported, but I'm looking into adding space support. Also, any declaration or block specifier (if, while, function declarations, etc.) must be followed by a colon. See example for details.
  2. Certain keywords (currently if, while, for, and foreach) do not allow parenthesis around their conditional expression. Again, see the example for more information

Sample Code

import std.stdio

void main():
	for int i = 0; i < 10; ++i:
		writeln( i )

	writeln( "Outer code" )

		writeln( "Inside a block" )

This outputs the following code:

import std.stdio;

void main()
{
	for( int i = 0; i < 10; ++i )
	{
		writeln( i );
	}

	writeln( "Outer code" );
	{

		writeln( "Inside a block" );
	}
}

About

A proof of concept for a whitespace-based D dialect.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages