Skip to content

Commit

Permalink
Merge pull request #4197 from WalterBright/scopeswitch
Browse files Browse the repository at this point in the history
DIP69: add -scope switch
  • Loading branch information
yebblies committed Dec 7, 2014
2 parents f06c486 + c2b2746 commit 8ff302a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/mars.c
Expand Up @@ -304,6 +304,7 @@ Usage:\n\
-property enforce property syntax\n\
-release compile release version\n\
-run srcfile args... run resulting program, passing args\n\
-scope diagnose scope errors (experimental)\n\
-shared generate shared library (DLL)\n\
-transition=id show additional info about language change identified by 'id'\n\
-transition=? list all language changes\n\
Expand Down Expand Up @@ -816,6 +817,8 @@ Language changes listed by -transition=id:\n\
global.params.enforcePropertySyntax = true;
else if (strcmp(p + 1, "inline") == 0)
global.params.useInline = true;
else if (strcmp(p + 1, "scope") == 0)
global.params.useScope = true;
else if (strcmp(p + 1, "lib") == 0)
global.params.lib = true;
else if (strcmp(p + 1, "nofloat") == 0)
Expand Down
1 change: 1 addition & 0 deletions src/mars.h
Expand Up @@ -124,6 +124,7 @@ struct Param
bool useSwitchError; // check for switches without a default
bool useUnitTests; // generate unittest code
bool useInline; // inline expand functions
bool useScope; // diagnose 'scope' errors
bool release; // build release version
bool preservePaths; // true means don't strip path from source file
char warnings; // 0: enable warnings
Expand Down
11 changes: 11 additions & 0 deletions test/runnable/testscope2.d
@@ -0,0 +1,11 @@
// PERMUTE_ARGS: -scope

import core.stdc.stdio;

/********************************************/

void main()
{
printf("Success\n");
}

0 comments on commit 8ff302a

Please sign in to comment.