Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
vipentti committed Dec 6, 2023
1 parent 4e4b679 commit 684906d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
31 changes: 16 additions & 15 deletions src/Visp.Compiler/Syntax/LexHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,21 @@ let syntaxErrorToParseError (syn: SyntaxError) =
match syn.Data0 with
| :? FSharp.Text.Parsing.ParseErrorContext<SyntaxParser.token> as ctx ->
let (startPos, _) = ctx.ParseState.ResultRange
let r = new ParseError (
{
ReduceTokens = ctx.ReduceTokens
ReducibleProductions = ctx.ReducibleProductions
ShiftTokens = ctx.ShiftTokens
StateStack = ctx.StateStack
CurrentToken = ctx.CurrentToken
Message = ctx.Message
FileName = startPos.FileName
Line = startPos.Line
Column = startPos.Column
},
syn,
syn.range
)

let r =
new ParseError(
{ ReduceTokens = ctx.ReduceTokens
ReducibleProductions = ctx.ReducibleProductions
ShiftTokens = ctx.ShiftTokens
StateStack = ctx.StateStack
CurrentToken = ctx.CurrentToken
Message = ctx.Message
FileName = startPos.FileName
Line = startPos.Line
Column = startPos.Column },
syn,
syn.range
)

r
| _ -> failwith "not a valid syntax error"
4 changes: 2 additions & 2 deletions src/Visp.Compiler/Syntax/Syntax.fs
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ and [<RequireQualifiedAccess>] SynArg =

member d.NameText =
match d with
| TypedArg (name = name)
| InferredArg (name = name) -> name.Text
| TypedArg(name = name)
| InferredArg(name = name) -> name.Text

and VispProgram = VispProgram of directives: SynDirective list * exprs: SynExpr list

Expand Down
2 changes: 2 additions & 0 deletions tests/Visp.Compiler.UnitTests/TestUtils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ let parseCoreLibs () =

for lib in libs do
let path = lib.Path

CoreParser.parseFile path lib.ReturnLast
// TODO: We only really want macros here?
|> CoreParser.transformFile
|> ignore

()

with :? ParseHelpers.SyntaxError as syn ->
Expand Down

0 comments on commit 684906d

Please sign in to comment.