Skip to content

Commit

Permalink
add $nim to path, controlled by define (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn authored Oct 8, 2024
1 parent b8e53ac commit c2ebddd
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/gear2/bridge.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ when defined(nifBench):

import std / [strutils]

import "$nim" / compiler / [
import compiler / [
ast, options, pathutils, renderer, lineinfos,
parser, llstream, idents, msgs]

Expand Down
2 changes: 2 additions & 0 deletions src/gear2/config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
when not defined(nifCompilerInPath):
switch("path", "$nim")
2 changes: 1 addition & 1 deletion src/gear2/enum2nif.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by enumgen.nim. DO NOT EDIT!

import "$nim" / compiler / [ast, options]
import compiler / [ast, options]

proc toNifTag*(s: TNodeKind): string =
case s
Expand Down
2 changes: 1 addition & 1 deletion src/gear2/gear2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ when not defined(nimcore):
{.error: "nimcore MUST be defined for Nim's core tooling".}

import std / [os, times, parseopt]
import "$nim" / compiler / [
import compiler / [
llstream, ast, options, msgs, condsyms, idents, platform, reorder,
modules, pipelineutils, pipelines, packages, modulegraphs, lineinfos, pathutils,
cmdlinehelper, commands, sem, renderer, syntaxes, parser]
Expand Down
4 changes: 2 additions & 2 deletions src/gear2/generator/enumgen.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Generate effective NIF representation for `Enum`

import "$nim" / compiler / [ast, options]
import compiler / [ast, options]

import std / [strutils, tables]

Expand Down Expand Up @@ -216,7 +216,7 @@ proc genFlags[E](f: var File; enumName: string; prefixLen = 2) =

var f = open("src/gear2/enum2nif.nim", fmWrite)
f.write "# Generated by enumgen.nim. DO NOT EDIT!\n\n"
f.write "import \"$nim\" / compiler / [ast, options]\n\n"
f.write "import compiler / [ast, options]\n\n"
# use the same mapping for TNodeKind and TMagic so that we can detect conflicts!
var nodeTags = initOrderedTable[string, bool]()

Expand Down
2 changes: 1 addition & 1 deletion src/gear2/modnames.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# See the file "license.txt", included in this
# distribution, for details about the copyright.

import "$nim" / compiler / [pathutils]
import compiler / [pathutils]

# --------------------------------------------------
# Fast&sufficient string hashing. We use custom code here so that we're independent
Expand Down
2 changes: 1 addition & 1 deletion src/nifler/bridge.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
when defined(nifBench):
import std / monotimes

import "$nim" / compiler / [
import compiler / [
ast, options, pathutils, renderer, lineinfos,
parser, llstream, idents, msgs]

Expand Down
2 changes: 2 additions & 0 deletions src/nifler/config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
when not defined(nifCompilerInPath):
switch("path", "$nim")

0 comments on commit c2ebddd

Please sign in to comment.