diff --git a/Expr.g.cs b/Expr.g.cs index 3414526..b2c5169 100644 --- a/Expr.g.cs +++ b/Expr.g.cs @@ -3,7 +3,7 @@ // DO NOT EDIT. // //////////////////////////////////////////////////////////// -using System; +#nullable enable namespace Finn.AST; diff --git a/Parser.cs b/Parser.cs index 2a2dd86..a63ce43 100644 --- a/Parser.cs +++ b/Parser.cs @@ -199,7 +199,7 @@ class Parser if (match(TokenType.At)) { Token literal = consume(TokenType.String, "Expect string literal after '@'."); - return new((string)(literal.literal ?? ""), true); + return new((string)(literal.literal!), true); } return null; } @@ -254,7 +254,8 @@ class Parser { if (match(TokenType.Number, TokenType.String)) { - return new Literal { Value = previous().literal }; + object literal = previous().literal!; + return new Literal { Value = previous().literal! }; } var ident = name(); diff --git a/ast_classes.fsx b/ast_classes.fsx index 0b689f6..abe7d3d 100644 --- a/ast_classes.fsx +++ b/ast_classes.fsx @@ -76,7 +76,7 @@ let renderAST outputDir baseName types = // DO NOT EDIT. // //////////////////////////////////////////////////////////// -using System; +#nullable enable namespace Finn.AST;