Gendoc.e

From Erights

Jump to: navigation, search

User:Kevin Reid found this code generating an unlinked document on his web site. He doesn't remember where he was going with it. What it does is produce a list of every noun in the privilegedScope, and report whether it is also part of the safeScope.

It was probably part of some larger project to autogenerate documentation for the E environment/standard library.

#!/usr/bin/env rune

var out := <file:std-scope.html>.textWriter()

var grouped := [].asMap()

out.print(`
<html><head><title>scope</title>

</head><body>

<dl>
`)

for `&@name` => slot in privilegedScope {
  def group
  if (name.endsWith("__uriGetter")) {
    bind group := "uriGetters"
  } else {
    bind group := "other"
  }
  grouped with= ...
  out.print(`
    <dt>$name</dt><dd>
      <p><strong>${if (safeScope.maps(name)) {"Safe"} else {"Unsafe"}}</strong></p>
    </dd>
  `)
}

out.print(`
</dl>
</body></html>
`)
out.close()

makeCommand("/usr/bin/open")("std-scope.html")

Its output when it was run in January 2004 was:

null
Safe
false
Safe
true
Safe
throw
Safe
__loop
Safe
__makeList
Safe
__makeMap
Safe
__makeProtocolDesc
Safe
__makeMessageDesc
Safe
__makeParamDesc
Safe
any
Safe
void
Safe
boolean
Safe
__makeOrderedSpace
Safe
ValueGuard
Safe
__MatchContext
Safe
NaN
Safe
Infinity
Safe
__identityFunc
Safe
__makeInt
Safe
__makeFinalSlot
Safe
__makeVarSlot
Safe
__makeGuardedSlot
Safe
__templateGuard
Safe
__makeTwine
Safe
__makeSourceSpan
Safe
__auditedBy
Safe
Guard
Safe
near
Safe
pbc
Safe
PassByCopy
Safe
DeepPassByCopy
Safe
PersistentAuditor
Safe
DeepFrozen
Safe
int
Safe
float64
Safe
char
Safe
String
Safe
Twine
Safe
TextWriter
Safe
require
Safe
List
Safe
Map
Safe
nullOk
Safe
Tuple
Safe
__Portrayal
Safe
notNull
Safe
vow
Safe
rcvr
Safe
SturdyRef
Safe
simple__quasiParser
Safe
twine__quasiParser
Safe
rx__quasiParser
Safe
e__quasiParser
Safe
epatt__quasiParser
Safe
sml__quasiParser
Safe
term__quasiParser
Safe
__equalizer
Safe
__comparer
Safe
Ref
Safe
E
Safe
promiseAllFulfilled
Safe
EIO
Safe
help
Safe
safeScope
Safe
__eval
Safe
resource__uriGetter
Safe
type__uriGetter
Safe
import__uriGetter
Safe
elib__uriGetter
Safe
elang__uriGetter
Safe
opaque__uriGetter
Safe
file__uriGetter
Unsafe
fileURL__uriGetter
Unsafe
http__uriGetter
Unsafe
ftp__uriGetter
Unsafe
gopher__uriGetter
Unsafe
news__uriGetter
Unsafe
cap__uriGetter
Unsafe
makeCommand
Unsafe
stdout
Unsafe
stderr
Unsafe
print
Unsafe
println
Unsafe
interp
Unsafe
entropy
Unsafe
timer
Unsafe
introducer
Unsafe
identityMgr
Unsafe
getPrivilegedJOSSSuture
Unsafe
Persistent
Unsafe
makeSturdyRef
Unsafe
timeMachine
Unsafe
unsafe__uriGetter
Unsafe
currentVat
Unsafe
rune
Unsafe
awt__uriGetter
Unsafe
swing__uriGetter
Unsafe
JPanel__quasiParser
Unsafe
swt__uriGetter
Unsafe
currentDisplay
Unsafe
swtGrid__quasiParser
Unsafe
privilegedScope
Unsafe
out
Unsafe
Personal tools
more tools