summary refs log tree commit diff stats
path: root/compiler/sourcemap.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/sourcemap.nim')
-rw-r--r--compiler/sourcemap.nim7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/sourcemap.nim b/compiler/sourcemap.nim
index b0b6fea2e..1395168cd 100644
--- a/compiler/sourcemap.nim
+++ b/compiler/sourcemap.nim
@@ -11,7 +11,7 @@ type
   Mapping = object
     ## Mapping refers to a line in the JS output.
     ## It is made up of segments which refer to the tokens in the line
-    case inSource: bool # Whether the line in JS has Nim equivilant
+    case inSource: bool # Whether the line in JS has Nim equivalent
     of true:
       file: int # Index into files list
       line: int # 0 indexed line of code in the Nim source
@@ -160,10 +160,7 @@ func parse*(source: string): SourceInfo =
 func toSourceMap*(info: SourceInfo, file: string): SourceMap {.raises: [].} =
   ## Convert from high level SourceInfo into the required SourceMap object
   # Add basic info
-  result.version = 3
-  result.file = file
-  result.sources = info.files
-  result.names = info.names
+  result = SourceMap(version: 3, file: file, sources: info.files, names: info.names)
   # Convert nodes into mappings.
   # Mappings are split into blocks where each block referes to a line in the outputted JS.
   # Blocks can be separated into statements which refere to tokens on the line.