Skip to content

csx parsing problems #720

Closed
Closed
@i-mark

Description

@i-mark

I found a few problems with csx parsing:

  1. #load directive with next expression start with string
#nullable enable
#load "ScriptHelper.csx"

"Hello world".Dump();

Produce error:
Could not find file '/Users/mark/Code/CSharpLab/ScriptHelper.csx"'.

Although it works:

#nullable enable
#load "ScriptHelper.csx"

;
"Hello world".Dump();
  1. using statement without parenthesis or a block on top level
using var connection = new SqliteConnection($"Data Source={dbPath}");

Produce errors:
error CS0103: The name 'connection' does not exist in the current context
error CS1002: ; expected

Although it works:

void Func()
{
  using var connection = new SqliteConnection($"Data Source={dbPath}");
}
  1. Reference to Microsoft.NET.Sdk.Web not work · Issue #716 · dotnet-script/dotnet-script

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions