From 072e7a6862ade22103191784255468c3d682f867 Mon Sep 17 00:00:00 2001 From: Lukas Rieger Date: Tue, 1 Oct 2019 22:35:16 +0200 Subject: [PATCH] escape the root module name --- src/bridge.fs | 5 ++--- test/fragments/regressions/#275-private-members.expected.fs | 2 +- test/fragments/regressions/#277-unwrap-options.expected.fs | 2 +- .../regressions/#278-typeliterals-return.expected.fs | 2 +- .../regressions/#288-type-alias-float-number.expected.fs | 2 +- .../regressions/#289-recursive-merge-modules.expected.fs | 2 +- test/fragments/regressions/#292-static-props.expected.fs | 2 +- .../regressions/#xxx-error-to-exception.expected.fs | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/bridge.fs b/src/bridge.fs index f4d32781..38e81b42 100644 --- a/src/bridge.fs +++ b/src/bridge.fs @@ -179,9 +179,8 @@ module internal Bridge = ) { - // use the F# file name as the module namespace - // TODO ensure valid name - Namespace = nameSpace + // use the escaped F# file name as the module namespace + Namespace = Naming.escapeWord nameSpace Opens = [ "System" diff --git a/test/fragments/regressions/#275-private-members.expected.fs b/test/fragments/regressions/#275-private-members.expected.fs index 42b26dde..9ddae528 100644 --- a/test/fragments/regressions/#275-private-members.expected.fs +++ b/test/fragments/regressions/#275-private-members.expected.fs @@ -1,5 +1,5 @@ // ts2fable 0.0.0 -module rec #275-private-members +module rec ``#275-private-members`` open System open Fable.Core open Fable.Import.JS diff --git a/test/fragments/regressions/#277-unwrap-options.expected.fs b/test/fragments/regressions/#277-unwrap-options.expected.fs index d9d48909..b75a0cab 100644 --- a/test/fragments/regressions/#277-unwrap-options.expected.fs +++ b/test/fragments/regressions/#277-unwrap-options.expected.fs @@ -1,5 +1,5 @@ // ts2fable 0.0.0 -module rec #277-unwrap-options +module rec ``#277-unwrap-options`` open System open Fable.Core open Fable.Import.JS diff --git a/test/fragments/regressions/#278-typeliterals-return.expected.fs b/test/fragments/regressions/#278-typeliterals-return.expected.fs index a7b0aae5..339630f2 100644 --- a/test/fragments/regressions/#278-typeliterals-return.expected.fs +++ b/test/fragments/regressions/#278-typeliterals-return.expected.fs @@ -1,5 +1,5 @@ // ts2fable 0.0.0 -module rec #278-typeliterals-return +module rec ``#278-typeliterals-return`` open System open Fable.Core open Fable.Import.JS diff --git a/test/fragments/regressions/#288-type-alias-float-number.expected.fs b/test/fragments/regressions/#288-type-alias-float-number.expected.fs index c6637939..92a3fb86 100644 --- a/test/fragments/regressions/#288-type-alias-float-number.expected.fs +++ b/test/fragments/regressions/#288-type-alias-float-number.expected.fs @@ -1,5 +1,5 @@ // ts2fable 0.0.0 -module rec #288-type-alias-float-number +module rec ``#288-type-alias-float-number`` open System open Fable.Core open Fable.Import.JS diff --git a/test/fragments/regressions/#289-recursive-merge-modules.expected.fs b/test/fragments/regressions/#289-recursive-merge-modules.expected.fs index f71dc2d1..05450756 100644 --- a/test/fragments/regressions/#289-recursive-merge-modules.expected.fs +++ b/test/fragments/regressions/#289-recursive-merge-modules.expected.fs @@ -1,5 +1,5 @@ // ts2fable 0.0.0 -module rec #289-recursive-merge-modules +module rec ``#289-recursive-merge-modules`` open System open Fable.Core open Fable.Import.JS diff --git a/test/fragments/regressions/#292-static-props.expected.fs b/test/fragments/regressions/#292-static-props.expected.fs index d8098bea..302853c0 100644 --- a/test/fragments/regressions/#292-static-props.expected.fs +++ b/test/fragments/regressions/#292-static-props.expected.fs @@ -1,5 +1,5 @@ // ts2fable 0.0.0 -module rec #292-static-props +module rec ``#292-static-props`` open System open Fable.Core open Fable.Import.JS diff --git a/test/fragments/regressions/#xxx-error-to-exception.expected.fs b/test/fragments/regressions/#xxx-error-to-exception.expected.fs index 79903f9f..bd5b2ae4 100644 --- a/test/fragments/regressions/#xxx-error-to-exception.expected.fs +++ b/test/fragments/regressions/#xxx-error-to-exception.expected.fs @@ -1,5 +1,5 @@ // ts2fable 0.0.0 -module rec #xxx-error-to-exception +module rec ``#xxx-error-to-exception`` open System open Fable.Core open Fable.Import.JS