Skip to content

Commit

Permalink
Cleanup unused locals & parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
vipentti committed Dec 26, 2023
1 parent 8e5ab91 commit fd3ad22
Show file tree
Hide file tree
Showing 9 changed files with 426 additions and 466 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<Features>strict</Features>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<InvariantGlobalization>true</InvariantGlobalization>
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
</PropertyGroup>

<!-- Build -->
Expand Down
7 changes: 0 additions & 7 deletions src/Visp.Compiler/CoreParser.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@ type ParserOptions =
module CoreParser =
let getLibFilePath name =
let src_dir = __SOURCE_DIRECTORY__

let my2DArray: int array2d = array2D [ [ 1; 0 ]; [ 0; 1 ] ]

let xx = Array2D.length1 my2DArray

let yy = my2DArray[0, 0]

Path.Combine(src_dir, "..", "..", "visp", "lib", name) |> Path.GetFullPath

let private tfs =
Expand Down
31 changes: 5 additions & 26 deletions src/Visp.Compiler/Lexer.fsl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ let startString nesting (lexbuf: LexBuffer<_>) =
// Adjust the start-of-token mark back to the true start of the token
lexbuf.StartPos <- startp

let isPart = context.HasFlag(LexerStringFinisherContext.InterpolatedPart)
let isTripleQuote = context.HasFlag(LexerStringFinisherContext.TripleQuote)

let synStringKind =
Expand All @@ -136,20 +135,6 @@ let startString nesting (lexbuf: LexBuffer<_>) =
else
Syntax.SynStringKind.Regular

// if kind.IsInterpolated then
// let s = buf.ToString()
// // if kind.IsInterpolatedFirst then
// // if isPart then
// // INTERP_STRING_BEGIN_PART (s, synStringKind, cont)
// // else
// // INTERP_STRING_BEGIN_END (s, synStringKind, cont)
// // else
// // if isPart then
// // INTERP_STRING_PART (s, cont)
// // else
// // INTERP_STRING_END (s, cont)
// STRING(buf.ToString(), Syntax.SynStringKind.Interpolated, cont)
// else
STRING(buf.ToString(), synStringKind, cont)
)

Expand Down Expand Up @@ -823,18 +808,18 @@ and singleQuoteString (sargs: LexerStringArgs) (skip: bool) = parse
}
| newline
{ newline lexbuf;
let (buf, _fin, m, kind, args) = sargs
let (buf, _fin, _m, _kind, _args) = sargs
addUnicodeString buf (lexeme lexbuf)
singleQuoteString sargs skip lexbuf
}
| escape_char
{
let (buf, _fin, m, kind, args) = sargs
let (buf, _fin, _m, _kind, _args) = sargs
addUnicodeString buf (lexeme lexbuf)
singleQuoteString sargs skip lexbuf
}
| _
{ let (buf, _fin, m, kind, args) = sargs
{ let (buf, _fin, _m, _kind, _args) = sargs
addUnicodeString buf (lexeme lexbuf)
singleQuoteString sargs skip lexbuf }

Expand All @@ -846,17 +831,11 @@ and tripleQuoteString (sargs: LexerStringArgs) (skip: bool) = parse
}
| newline
{ newline lexbuf;
let (buf, _fin, m, kind, args) = sargs
let (buf, _fin, _m, _kind, _args) = sargs
addUnicodeString buf (lexeme lexbuf)
tripleQuoteString sargs skip lexbuf
}
// | escape_char
// {
// let (buf, _fin, m, kind, args) = sargs
// addUnicodeString buf (lexeme lexbuf)
// singleQuoteString sargs skip lexbuf
// }
| _
{ let (buf, _fin, m, kind, args) = sargs
{ let (buf, _fin, _m, _kind, _args) = sargs
addUnicodeString buf (lexeme lexbuf)
tripleQuoteString sargs skip lexbuf }
Loading

0 comments on commit fd3ad22

Please sign in to comment.