Skip to content

Commit e214fbd

Browse files
committed
fixed codegen, default target
1 parent d6e04c7 commit e214fbd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

fcs/build.fsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ Target "CodeGen.Fable" (fun _ ->
113113
// Fable-specific (comment the #line directive as it is not supported)
114114
["lex.fs"; "pplex.fs"; "illex.fs"; "ilpars.fs"; "pars.fs"; "pppars.fs"]
115115
|> Seq.map (fun fileName -> outDir + fileName)
116-
|> RegexReplaceInFilesWithEncoding @"# (?=\d)" "//# " Text.Encoding.UTF8
116+
|> RegexReplaceInFilesWithEncoding @"(?<!/)# (?=\d)" "//# " Text.Encoding.UTF8
117+
118+
// prevent stack overflows on large files (make lexer rules inline)
119+
let pattern = @"(?<=and )(?!inline )([a-zA-Z]+ )+\(lexbuf "
120+
["lex.fs"; "pplex.fs"; "illex.fs"]
121+
|> Seq.map (fun fileName -> outDir + fileName)
122+
|> RegexReplaceInFilesWithEncoding pattern @"inline $0" Text.Encoding.UTF8
117123
)
118124

119125
Target "GenerateDocsEn" (fun _ ->

src/fsharp/CompileOps.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5402,7 +5402,7 @@ type TcConfig (optimize: bool, defines: string list) =
54025402
member x.emitDebugInfoInQuotations = false
54035403
member x.errorSeverityOptions = FSharpErrorSeverityOptions.Default
54045404
member x.light = Some true
5405-
member x.target = CompilerTarget.WinExe
5405+
member x.target = CompilerTarget.Dll
54065406
member x.extraOptimizationIterations = if optimize then 0 else 0
54075407
#if DEBUG
54085408
member x.showOptimizationData = false

0 commit comments

Comments
 (0)