diff --git a/src/compiler/passes/fix_bin_ops.fut b/src/compiler/passes/fix_bin_ops.fut index 203a402..beca4ff 100644 --- a/src/compiler/passes/fix_bin_ops.fut +++ b/src/compiler/passes/fix_bin_ops.fut @@ -210,7 +210,7 @@ let fix_bin_ops [n] (node_types: [n]production.t) (parents: [n]i32) = -- Generate the new nodes list simply by scattering. To avoid a filter here, simply set the scatter target -- index of a node that shouldn't be moved up to out of bounds, which scatter will ignore for us. -- - -- Use the old parents here so it also works for right-associative nodes. + -- Use the old parents here so it also works for right-associative nodes and also scatters up the list ends. |> map2 (\parent is_tail_node -> if is_tail_node then parent else -1) parents |> map i64.i32 in scatter diff --git a/src/compiler/passes/symbol_resolution.fut b/src/compiler/passes/symbol_resolution.fut index 208aa4b..436f2e0 100644 --- a/src/compiler/passes/symbol_resolution.fut +++ b/src/compiler/passes/symbol_resolution.fut @@ -93,7 +93,7 @@ let resolve_vars [n] (node_types: [n]production.t) (parents: [n]i32) (prev_sibli else if prev_siblings[prev_sibling] == -1 then parent -- Else point to the right leaf of the second sibling, which is the condition else right_leafs[prev_sibling] - else if node_types[parent] == production_stat_if || node_types[parent] == production_stat_if_else || node_types[parent] == production_stat_while then + else if node_types[parent] == production_stat_if || node_types[parent] == production_stat_if_else then -- For ` condition block...;` type statements, we want don't want declarations in the condition or children -- to be visible from a node after the statement, but we do want declarations in the condition to be visible in the -- children. We also don't want declarations in child A to be visible in child B, so if the parent of a node is @@ -163,8 +163,6 @@ let resolve_args [n] (node_types: [n]production.t) (parents: [n]i32) (prev_sibli -- of the called function. let grandparents = map (\parent -> if parent == -1 then -1 else parents[parent]) parents -- Some useful masks --- let grandparent_is_proto = map (\gp -> gp != -1 && node_types[gp] == production_atom_fn_proto) grandparents --- let grandparent_is_call = map (\gp -> gp != -1 && node_types[gp] == production_atom_fn_call) grandparents let is_first_child = map (== -1) prev_siblings let is_last_child = map (== -1) next_siblings -- Scatter up that first parameter. diff --git a/src/lpg/parser/llp/render.cpp b/src/lpg/parser/llp/render.cpp index a660f1e..4c85815 100644 --- a/src/lpg/parser/llp/render.cpp +++ b/src/lpg/parser/llp/render.cpp @@ -139,8 +139,8 @@ namespace pareas::parser::llp { uint64_t ParserRenderer::bracket_id(const Symbol& sym, bool left) const { auto id = this->symbol_mapping.at(sym); - // Left brackets get odd ID's, rightb rackets get even ID's. - // This way, we can perform a simply subtract and reduce by bit and to + // Left brackets get odd ID's, right brackets get even ID's. + // This way, we can perform a simple subtract and reduce by bit and to // check if all the brackets match up. return left ? id * 2 + 1 : id * 2; }