summary refs log tree commit diff stats
path: root/note/pronouns.html
Commit message (Collapse)AuthorAgeFilesLines
* Pronouns updateRunxi Yu2023-08-311-1/+0
|
* Remove HTML smart quotesRunxi Yu2023-08-171-1/+1
|
* meta viewportRunxi Yu2023-08-161-0/+1
|
* Public-domain footer on every pageRunxi Yu2023-08-061-0/+1
|
* cronie: update website1337 h4xx0r2023-07-311-38/+8
|
* Andrew -> Runxi1337 h4xx0r2023-07-271-3/+3
|
* Change contact details, masculine names suck.1337 h4xx0r2023-07-231-0/+1
|
* Use ``TeX-style quotes'' instead of “unicode quotes”Andrew Yu2023-07-151-1/+1
|
* plain.css -> style.cssAndrew Yu2023-07-151-1/+1
|
* Mode modificationsAndrew Yu2023-07-151-0/+0
|
* Pronouns table style changes againAndrew2023-07-151-1/+1
|
* Table style change for pronouns pageAndrew2023-07-151-8/+8
|
* Adjust tableAndrew2023-07-151-10/+10
|
* Pronouns and stuffAndrew2023-07-151-0/+57
im/blame/compiler/packagehandling.nim?h=devel&id=ab9e44dc966cba2c57cfff25d42ca927a7942faa'>^
9eb909baf ^

7eb39d9d2 ^
9eb909baf ^


7ec7731f8 ^
bbe49a14a ^
7ec7731f8 ^


0121dda9b ^
378289c6a ^


5783cd67a ^
796498525 ^

0121dda9b ^
ddad57e7a ^
657e09e79 ^
7804b5c55 ^
86556ebfd ^

832b0a023 ^



9eb909baf ^
832b0a023 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60


                            
                                         












                                                                              
                                                            
                                                                      


                                
                                     
                                                                               
                                   

                                            
                     
                           
                                             

                                                     
                                 


                          
                                                             
                                                


                                      
                                                                    


                                                             
                                                 

                                                                          
 
                                                 
                                                                                    
 

                                                                          



                                                                 
       
                                                          
#
#
#           The Nim Compiler
#        (c) Copyright 2017 Andreas Rumpf
#
#    See the file "copying.txt", included in this
#    distribution, for details about the copyright.
#

iterator myParentDirs(p: string): string =
  # XXX os's parentDirs is stupid (multiple yields) and triggers an old bug...
  var current = p
  while true:
    current = current.parentDir
    if current.len == 0: break
    yield current

proc getNimbleFile*(conf: ConfigRef; path: string): string =
  ## returns absolute path to nimble file, e.g.: /pathto/cligen.nimble
  var parents = 0
  block packageSearch:
    for d in myParentDirs(path):
      if conf.packageCache.hasKey(d):
        #echo "from cache ", d, " |", packageCache[d], "|", path.splitFile.name
        return conf.packageCache[d]
      inc parents
      for file in walkFiles(d / "*.nimble"):
        result = file
        break packageSearch
  # we also store if we didn't find anything:
  for d in myParentDirs(path):
    #echo "set cache ", d, " |", result, "|", parents
    conf.packageCache[d] = result
    dec parents
    if parents <= 0: break

proc getPackageName*(conf: ConfigRef; path: string): string =
  ## returns nimble package name, e.g.: `cligen`
  let path = getNimbleFile(conf, path)
  result = path.splitFile.name

proc fakePackageName*(conf: ConfigRef; path: AbsoluteFile): string =
  # Convert `path` so that 2 modules with same name
  # in different directory get different name and they can be
  # placed in a directory.
  # foo-#head/../bar becomes @foo-@hhead@s..@sbar
  result = "@m" & relativeTo(path, conf.projectPath).string.multiReplace(
    {$os.DirSep: "@s", $os.AltSep: "@s", "#": "@h", "@": "@@", ":": "@c"})

proc demanglePackageName*(path: string): string =
  result = path.multiReplace({"@@": "@", "@h": "#", "@s": "/", "@m": "", "@c": ":"})

proc withPackageName*(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile =
  let x = getPackageName(conf, path.string)
  let (p, file, ext) = path.splitFile
  if x == "stdlib":
    # Hot code reloading now relies on 'stdlib_system' names etc.
    result = p / RelativeFile((x & '_' & file) & ext)
  else:
    result = p / RelativeFile(fakePackageName(conf, path))