Skip to content

Commit ab28a97

Browse files
committed
#help work with longidents and idents
1 parent 7e4755d commit ab28a97

File tree

1 file changed

+16
-20
lines changed
  • src/Compiler/Interactive

1 file changed

+16
-20
lines changed

src/Compiler/Interactive/fsi.fs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,25 +3818,20 @@ type FsiInteractionProcessor
38183818
let istate = { istate with debugBreak = true }
38193819
istate, Completed None
38203820

3821-
| ParsedHashDirective("time", [], _) ->
3822-
if istate.timing then
3823-
fsiConsoleOutput.uprintnfnn "%s" (FSIstrings.SR.fsiTurnedTimingOff ())
3824-
else
3825-
fsiConsoleOutput.uprintnfnn "%s" (FSIstrings.SR.fsiTurnedTimingOn ())
3826-
3827-
let istate =
3828-
{ istate with
3829-
timing = not istate.timing
3830-
}
3831-
3832-
istate, Completed None
3833-
38343821
| ParsedHashDirective("time", switch, m) ->
38353822
let arguments = parsedHashDirectiveArguments switch tcConfigB.langVersion
38363823

38373824
let istate =
38383825
match arguments with
3839-
| [] -> istate
3826+
| [] ->
3827+
if istate.timing then
3828+
fsiConsoleOutput.uprintnfnn "%s" (FSIstrings.SR.fsiTurnedTimingOff ())
3829+
else
3830+
fsiConsoleOutput.uprintnfnn "%s" (FSIstrings.SR.fsiTurnedTimingOn ())
3831+
3832+
{ istate with
3833+
timing = not istate.timing
3834+
}
38403835
| [ "on" ] ->
38413836
fsiConsoleOutput.uprintnfnn "%s" (FSIstrings.SR.fsiTurnedTimingOn ())
38423837
{ istate with timing = true }
@@ -3877,13 +3872,14 @@ type FsiInteractionProcessor
38773872

38783873
| ParsedHashDirective(("q" | "quit"), [], _) -> fsiInterruptController.Exit()
38793874

3880-
| ParsedHashDirective("help", [], m) ->
3881-
fsiOptions.ShowHelp(m)
3882-
istate, Completed None
3875+
| ParsedHashDirective("help", hashArguments, m) ->
3876+
let args = (parsedHashDirectiveArguments hashArguments tcConfigB.langVersion)
3877+
3878+
match args with
3879+
| [] -> fsiOptions.ShowHelp(m)
3880+
| [ arg ] -> runhDirective diagnosticsLogger ctok istate arg
3881+
| _ -> warning (Error((FSComp.SR.fsiInvalidDirective ("help", String.concat " " args)), m))
38833882

3884-
| ParsedHashDirective("help", hashArguments, _m) ->
3885-
let arg = (parsedHashDirectiveArguments hashArguments tcConfigB.langVersion)
3886-
runhDirective diagnosticsLogger ctok istate source
38873883
istate, Completed None
38883884

38893885
| ParsedHashDirective(c, hashArguments, m) ->

0 commit comments

Comments
 (0)