Fixed the parse bug. I think it's legal for the post-shift table check to be invalid and you have to account for that in the table
This commit is contained in:
@@ -598,7 +598,9 @@ obj table (Object, Serializable) {
|
|||||||
}
|
}
|
||||||
fun get(state: int, on_symbol: symbol::symbol): vector::vector<action> {
|
fun get(state: int, on_symbol: symbol::symbol): vector::vector<action> {
|
||||||
var cleaned_symbol = clean_symbol(on_symbol)
|
var cleaned_symbol = clean_symbol(on_symbol)
|
||||||
return items[state][cleaned_symbol]
|
if (items[state].contains_key(cleaned_symbol))
|
||||||
|
return items[state][cleaned_symbol]
|
||||||
|
return vector::vector<action>()
|
||||||
}
|
}
|
||||||
fun get_shift(state: int, on_symbol: symbol::symbol): action {
|
fun get_shift(state: int, on_symbol: symbol::symbol): action {
|
||||||
var actions = get(state, on_symbol)
|
var actions = get(state, on_symbol)
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ obj map<T,U> (Object, Serializable) {
|
|||||||
var key_loc = keys.find(key)
|
var key_loc = keys.find(key)
|
||||||
if (key_loc == -1) {
|
if (key_loc == -1) {
|
||||||
io::println("trying to access nonexistant key-value!")
|
io::println("trying to access nonexistant key-value!")
|
||||||
/*while (true) {}*/
|
while (true) {}
|
||||||
}
|
}
|
||||||
return values.get(key_loc)
|
return values.get(key_loc)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ import tree:*
|
|||||||
import serialize:*
|
import serialize:*
|
||||||
|
|
||||||
fun main():int {
|
fun main():int {
|
||||||
|
|
||||||
var a.construct(): grammer
|
var a.construct(): grammer
|
||||||
|
|
||||||
/*var file_name = string("../krakenGrammer.kgm")*/
|
var file_name = string("../krakenGrammer.kgm")
|
||||||
var file_name = string("../simplifiedKrakenGrammer.kgm")
|
/*var file_name = string("../simplifiedKrakenGrammer.kgm")*/
|
||||||
/*var file_name = string("grammer.kgm")*/
|
/*var file_name = string("grammer.kgm")*/
|
||||||
|
|
||||||
var compiled_name = file_name + string(".comp_new")
|
var compiled_name = file_name + string(".comp_new")
|
||||||
|
|||||||
5
tests/to_import.krak
Normal file
5
tests/to_import.krak
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
var a = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1 +1,6 @@
|
|||||||
why {}
|
import to_import
|
||||||
|
|
||||||
|
fun main(): int {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user