lib/fdoc.fy in fancy-0.3.0 vs lib/fdoc.fy in fancy-0.3.1
- old
+ new
@@ -90,15 +90,15 @@
str join
}
def to_json: obj {
# Reimplement now we have pattern matching dispatch.
- match obj -> {
- case Hash -> self hash_to_json: obj
- case Array -> self array_to_json: obj
- case Symbol -> self symbol_to_json: obj
- case String -> self string_to_json: obj
+ match obj {
+ case Hash -> hash_to_json: obj
+ case Array -> array_to_json: obj
+ case Symbol -> symbol_to_json: obj
+ case String -> string_to_json: obj
case Numeric -> obj
case nil -> "null"
case _ -> "Dont know how to convert " ++ (obj inspect) ++ " to JSON" raise!
}
}
@@ -169,11 +169,11 @@
map
}
def write: filename call: name ("fancy.fdoc") {
- map = self generate_map
- json = self to_json: map
+ map = generate_map
+ json = to_json: map
js = "(function() { " ++ name ++ "(" ++ json ++ "); })();"
File open: filename modes: ['write] with: |out| { out print: js }
}
}