Make --parse-only not highlight and redo format of parse errors so that kraken.vim syntax checking works, fix naming to allow multiple instantiations of object templates, fix so that template type replacements go through to bodies of methods of object templates in the fourth_pass

This commit is contained in:
Nathan Braswell
2016-02-15 16:31:01 -05:00
parent 3da140cc5e
commit 815c213270
11 changed files with 115 additions and 31 deletions

View File

@@ -74,6 +74,20 @@ obj map<T,U> (Object, Serializable) {
}
return values.get(key_loc)
}
fun get_with_default(key: T, default_val: ref U): ref U {
if (contains_key(key))
return get(key)
return default_val
}
fun reverse_get(value: U): ref T {
/*return values.get(keys.find(key))*/
var value_loc = values.find(value)
if (value_loc == -1) {
io::println("trying to access nonexistant value-key!")
while (true) {}
}
return keys.get(value_loc)
}
fun remove(key: T) {
var idx = keys.find(key)
if (idx < 0) {