287287 implicitCmd* : bool # whether some flag triggered an implicit `command`
288288 selectedGC* : TGCMode # the selected GC (+)
289289 exc* : ExceptionSystem
290+ hintProcessingDots* : bool # true for dots, false for filenames
290291 verbosity* : int # how verbose the compiler is
291292 numberOfProcessors* : int # number of processors
292293 lastCmdTime* : float # when caas is enabled, we measure each command
@@ -458,20 +459,25 @@ proc isDefined*(conf: ConfigRef; symbol: string): bool
458459when defined (nimDebugUtils):
459460 import debugutils
460461
462+ proc initConfigRefCommon (conf: ConfigRef ) =
463+ conf.selectedGC = gcRefc
464+ conf.verbosity = 1
465+ conf.hintProcessingDots = true
466+ conf.options = DefaultOptions
467+ conf.globalOptions = DefaultGlobalOptions
468+ conf.filenameOption = foAbs
469+ conf.foreignPackageNotes = foreignPackageNotesDefault
470+ conf.notes = NotesVerbosity [1 ]
471+ conf.mainPackageNotes = NotesVerbosity [1 ]
472+
461473proc newConfigRef * (): ConfigRef =
462474 result = ConfigRef (
463- selectedGC: gcRefc,
464475 cCompiler: ccGcc,
465- verbosity: 1 ,
466- options: DefaultOptions ,
467- globalOptions: DefaultGlobalOptions ,
468476 macrosToExpand: newStringTable (modeStyleInsensitive),
469477 arcToExpand: newStringTable (modeStyleInsensitive),
470478 m: initMsgConfig (),
471- filenameOption: foAbs,
472479 cppDefines: initHashSet [string ](),
473- headerFile: " " , features: {}, legacyFeatures: {}, foreignPackageNotes: foreignPackageNotesDefault,
474- notes: NotesVerbosity [1 ], mainPackageNotes: NotesVerbosity [1 ],
480+ headerFile: " " , features: {}, legacyFeatures: {},
475481 configVars: newStringTable (modeStyleInsensitive),
476482 symbols: newStringTable (modeStyleInsensitive),
477483 packageCache: newPackageCache (),
@@ -513,6 +519,7 @@ proc newConfigRef*(): ConfigRef =
513519 vmProfileData: newProfileData (),
514520 spellSuggestMax: spellSuggestSecretSauce,
515521 )
522+ initConfigRefCommon (result )
516523 setTargetFromSystem (result .target)
517524 # enable colors by default on terminals
518525 if terminal.isatty (stderr):
@@ -522,18 +529,11 @@ proc newConfigRef*(): ConfigRef =
522529
523530proc newPartialConfigRef * (): ConfigRef =
524531 # # create a new ConfigRef that is only good enough for error reporting.
525- # xxx FACTOR with `newConfigRef`
526532 when defined (nimDebugUtils):
527533 result = getConfigRef ()
528534 else :
529- result = ConfigRef (
530- selectedGC: gcRefc,
531- verbosity: 1 ,
532- options: DefaultOptions ,
533- globalOptions: DefaultGlobalOptions ,
534- filenameOption: foAbs,
535- foreignPackageNotes: foreignPackageNotesDefault,
536- notes: NotesVerbosity [1 ], mainPackageNotes: NotesVerbosity [1 ])
535+ result = ConfigRef ()
536+ initConfigRefCommon (result )
537537
538538proc cppDefine * (c: ConfigRef ; define: string ) =
539539 c.cppDefines.incl define
0 commit comments