Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed references to IKanServe... Added some ioke dependencies
- Loading branch information
Showing
37 changed files
with
2,854 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
|
|||
BlankSlate = Origin mimic do( | |||
create = method(callback, | |||
bs = BlankSlate mimic | |||
callback call(bs) | |||
bs removeAllMimics! | |||
bs | |||
) | |||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,55 @@ | |||
|
|||
IokeDebugger = Origin mimic do( | |||
NoSuchRestart = Condition Error mimic | |||
|
|||
currentlyRunning = [] | |||
|
|||
invoke = method(condition, context, | |||
newDebugger = self with(condition: condition, context: context) | |||
newDebugger runDebugSession | |||
) | |||
|
|||
runDebugSession = method( | |||
IokeDebugger currentlyRunning << self | |||
len = IokeDebugger currentlyRunning length | |||
|
|||
|
|||
newIo = io mimic | |||
newIo prompt = " dbg:#{len}> " | |||
|
|||
ensure( | |||
loop( | |||
restarts = availableRestarts(self condition) | |||
|
|||
"The following restarts are available:" println | |||
restarts each(ix, re, out println(" %s: %-20s (%s)" format(ix, re name, re report call(re)))) | |||
out println | |||
|
|||
value = Message fromText(newIo gets) | |||
if((value name == :"internal:createNumber") && (value next name == :"."), | |||
restartToInvoke = value evaluateOn(condition context) | |||
if(restarts[restartToInvoke], | |||
argumentNames = restarts[restartToInvoke] argumentNames | |||
restartArguments = argumentNames map(name, | |||
newIo prompt = " dbg:#{len}:#{name}> " | |||
argVal = Message fromText(newIo gets) evaluateOn(condition context) | |||
out println(" +> #{cell(:argVal) inspect}") | |||
out println | |||
|
|||
cell(:argVal) | |||
) | |||
|
|||
out println | |||
invokeRestart(restarts[restartToInvoke], *restartArguments) | |||
) | |||
error!(IokeDebugger NoSuchRestart, number: restartToInvoke), | |||
|
|||
out println(" +> #{value evaluateOn(condition context) inspect}") | |||
out println) | |||
) | |||
|
|||
invokeRestart(:abort), | |||
|
|||
IokeDebugger currentlyRunning = IokeDebugger currentlyRunning[0..-2]) | |||
) | |||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
|
|||
DokGen = Origin mimic | |||
|
|||
use("dokgen/collector") | |||
use("dokgen/generator") | |||
use("dokgen/runner") | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,116 @@ | |||
|
|||
DokGen do( | |||
KindsToAvoid = [DokGen, JavaGround] | |||
|
|||
collect = method( | |||
current, collected, | |||
visited set, | |||
idGenerator fn(current, fn(current++)) call(0), | |||
|
|||
cell(:current) cells each(c, | |||
unless((KindsToAvoid include?(c value)), | |||
if(kindName?(c key), | |||
if(!(visited include?(c value kind)), | |||
visited << c value kind | |||
collected collectedKinds[c value kind] = [c value, {}] | |||
collect(c value, collected, visited, idGenerator)), | |||
|
|||
id = idGenerator call | |||
if(code?(c value), | |||
fname = c value message filename | |||
(collected collectedFiles[fname] ||= []) << [cell(:current), c key, c value, id]) | |||
(collected collectedCells[c key asText] ||= []) << [cell(:current), c key, c value, id, {}])))) | |||
|
|||
kindName? = method(name, | |||
if((#/^[A-Z]/ =~ name) || ([:nil, :true, :false] include?(name)), | |||
true, | |||
false)) | |||
|
|||
code? = method(val, | |||
((cell(:val) kind?("DefaultMethod")) || | |||
(cell(:val) kind?("LexicalBlock")) || | |||
(cell(:val) kind?("DefaultMacro")) || | |||
(cell(:val) kind?("LexicalMacro")) || | |||
(cell(:val) kind?("DefaultSyntax")))) | |||
|
|||
collectSpecs = method(specsPattern, collectedSpecs, collected, | |||
use("ispec") | |||
|
|||
ISpec Options shouldRun? = false | |||
ISpec shouldExit? = false | |||
|
|||
FileSystem[specsPattern] each(f, use(f)) | |||
|
|||
ISpec specifications each(spec, | |||
collectSpec(spec, collectedSpecs) | |||
) | |||
|
|||
collectedSpecs each(cspec, | |||
unless(cspec value cell?(:dokgenSpecAlreadyCollected), | |||
;; also check cells in the sub thingy | |||
|
|||
fixed = false | |||
segments = cspec key split(" ") | |||
kindName = "%[%s %]" format(segments[0..-2])[0..-2] | |||
|
|||
cellForSegment = collected collectedCells[segments[-1]] | |||
if(cellForSegment, | |||
place = cellForSegment find(x, (x[0] kind == kindName) || ((x[0] kind == "Ground") && kindName == "") || ((x[0] kind == "IokeGround") && kindName == "")) | |||
|
|||
if(place, | |||
place[4][cspec key] = cspec value | |||
cspec value dokgenSpecAlreadyCollected = true | |||
fixed = true | |||
) | |||
) | |||
|
|||
segments = segments[0..-2] | |||
|
|||
cellForKind = collected collectedKinds[cspec key] | |||
if(cellForKind, | |||
cellForKind[1][cspec key] = cspec value | |||
cspec value dokgenSpecAlreadyCollected = true | |||
fixed = true | |||
) | |||
|
|||
while(!fixed && (segments length > 0), | |||
kindName = "%[%s %]" format(segments)[0..-2] | |||
kindNameX = "%[%s %]" format(segments[0..-2])[0..-2] | |||
|
|||
cellForSegment = collected collectedCells[segments[-1]] | |||
if(cellForSegment, | |||
place = cellForSegment find(x, (x[0] kind == kindNameX) || ((x[0] kind == "Ground") && kindNameX == "")) | |||
|
|||
if(place, | |||
place[4][cspec key] = cspec value | |||
cspec value dokgenSpecAlreadyCollected = true | |||
fixed = true | |||
) | |||
) | |||
|
|||
unless(fixed, | |||
cellForKind = collected collectedKinds[kindName] | |||
|
|||
if(cellForKind, | |||
cellForKind[1][cspec key] = cspec value | |||
cspec value dokgenSpecAlreadyCollected = true | |||
fixed = true | |||
) | |||
) | |||
|
|||
segments = segments[0..-2] | |||
) | |||
) | |||
) | |||
) | |||
|
|||
collectSpec = method(spec, collectedSpecs, | |||
theList = (collectedSpecs[spec fullName] ||= []) | |||
|
|||
spec specs each(sp, | |||
if(sp[0] == :description, | |||
collectSpec(sp[1], collectedSpecs), | |||
if(sp[0] == :test, | |||
theList << [sp[1], sp[2]], | |||
theList << [sp[1]])))) | |||
) |
Oops, something went wrong.