csx parsing problems
See original GitHub issueI found a few problems with csx parsing:
- #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();
- 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}");
}
Issue Analytics
- State:
- Created 4 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Example: CSX-Lite
In LL(1) parsing, syntax errors are automatically detected as soon as the first illegal token is seen. How? When an illegal token is...
Read more >what would you use to write a parser in 2021? : r/Compilers
LR parser generators will catch a lot of grammar issues for you automatically. Upvote 1
Read more >Parsing absolutely anything in JavaScript using Earley algorithm
Ambiguity will present performance issues (multiple routes need to be analysed to complete parsing). It will also lead to hard to catch bugs...
Read more >Rewriting the Ruby parser
But I'm no longer as optimistic. The main problem is that nearly all languages have syntax that cannot be easily formalized using declarative...
Read more >A Beginner's Guide to Parsing in Rust | Depth-First
The problem is that the current Scanner API forces mutators and accessors to be applied in separate operations. Given a complex language with ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok, thx.
I run it with c# scripting and this code throw (1,11): error CS1002
@i-mark LINQPad doesn’t use C# scripting like this tool so it’s not bound to the same restrictions. LINQPad turns your query/script into a whole C# program, somewhat like what I emulate in LINQPadless.