using-statements in syntax modules apply to the scope they are declared in:
namespace Foo
{
syntax module Bar
{
using Nitra.Core;
[StartRule]
syntax Start = "foo" sm "bar"; // Nitra.Core visible here
}
}
For namespaces however this is not not the case. The types opened by the using-statement are only visible in nested namepaces:
namespace Foo
{
using Nitra;
using Nitra.Declarations;
declaration Root : Container {} // error : Unbound name 'Container'
namespace Bar
{
declaration Root : Container {} // works fine in here
}
}
This is somewhat inconsistent and should be changed so that elements opened through the using-statement are visible in the scope of that using-statement.
using
-statements insyntax module
s apply to the scope they are declared in:For
namespace
s however this is not not the case. The types opened by theusing
-statement are only visible in nested namepaces:This is somewhat inconsistent and should be changed so that elements opened through the using-statement are visible in the scope of that using-statement.