File tree 2 files changed +11
-11
lines changed
2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ module Attr =
97
97
98
98
module Naming =
99
99
let removeInvalidChars ( s : string ) =
100
- s.ToCharArray()
100
+ s.Trim ( '"' ) . ToCharArray()
101
101
|> Array.map ( fun c -> if Char.isAlphabetOrDigit c || c = '_' || c = '\'' then c else '_' )
102
102
|> System.String
103
103
Original file line number Diff line number Diff line change @@ -1556,23 +1556,23 @@ let createStructuredText (rootCtx: Context) (stmts: Statement list) : Structured
1556
1556
let addAnonymousInterfaceExcluding ais current = addAnonymousInterfaceExcludingWithKnownTypes ( knownTypes ()) ais current
1557
1557
1558
1558
match s with
1559
- | Module m ->
1559
+ | Namespace m ->
1560
1560
let module ' =
1561
- let scope =
1562
- if m.isNamespace then Scope.Default
1563
- else Scope.Module m.name
1564
- let node = {| StructuredTextNode.empty with comments = comments; scope = scope |}
1561
+ let node = {| StructuredTextNode.empty with comments = comments; scope = Scope.Default |}
1565
1562
let module ' = current |> getTrie [ m.name] |> set node
1566
1563
let ctx = ctx |> Context.ofChildNamespace m.name
1567
1564
m.statements |> List.fold ( folder ctx) module'
1568
1565
let current = current |> setTrie [ m.name] module'
1569
1566
match module'.value with
1570
1567
| None -> current
1571
- | Some _ ->
1572
- let kind =
1573
- if m.isNamespace then Kind.OfNamespace
1574
- else Kind.OfModule
1575
- current |> addExport m.name kind ( if m.isNamespace then " namespace" else " module" )
1568
+ | Some _ -> current |> addExport m.name Kind.OfNamespace " namespace"
1569
+ | AmbientModule m ->
1570
+ let module ' =
1571
+ let node = {| StructuredTextNode.empty with comments = comments; scope = Scope.Module m.name.unquoted |}
1572
+ let module ' = current |> getTrie [ m.name.orig] |> set node
1573
+ let ctx = ctx |> Context.ofChildNamespace m.name.orig
1574
+ m.statements |> List.fold ( folder ctx) module'
1575
+ current |> setTrie [ m.name.orig] module'
1576
1576
| Global m ->
1577
1577
current |> inTrie [ " global" ] ( fun g ->
1578
1578
let node = {| StructuredTextNode.empty with scope = Scope.Global |}
You can’t perform that action at this time.
0 commit comments