From 563e415e07ea45df8c80fc9a2afc652e3e6d8c83 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 4 Jun 2018 17:56:09 -0700 Subject: Switched from Node(Tuple(values...), source) to Node(source, values...), thanks to support from immutable-tables for mixed tables. --- core/control_flow.nom | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'core/control_flow.nom') diff --git a/core/control_flow.nom b/core/control_flow.nom index 77e55c6..f5c61e3 100644 --- a/core/control_flow.nom +++ b/core/control_flow.nom @@ -188,14 +188,14 @@ immediately %body has subtree % where (%.type = "Action") and (%.stub is "do next %") and - %.value.3.value = %var.value + %.3.value = %var.value ..: to %lua write (Lua "\n ::continue_\(%var as lua identifier)::") to %lua write "\nend --foreach-loop" if %body has subtree % where (%.type = "Action") and (%.stub is "stop %") and - %.value.2.value = %var.value + %.2.value = %var.value .. %lua <- Lua ".." @@ -222,14 +222,14 @@ immediately %body has subtree % where (%.type = "Action") and (%.stub is "do next %") and - %.value.3.value = %key.value + %.3.value = %key.value ..: to %lua write (Lua "\n ::continue_\(%key as lua identifier)::") if %body has subtree % where (%.type = "Action") and (%.stub is "do next %") and - %.value.3.value = %value.value + %.3.value = %value.value ..: to %lua write (Lua "\n ::continue_\(%value as lua identifier)::") to %lua write "\nend --foreach-loop" @@ -238,14 +238,14 @@ immediately %body has subtree % where (%.type = "Action") and (%.stub is "stop %") and - %.value.2.value = %key.value + %.2.value = %key.value ..: to %stop_labels write "\n::stop_\(%key as lua identifier)::" if %body has subtree % where (%.type = "Action") and (%.stub is "stop %") and - %.value.2.value = %value.value + %.2.value = %value.value ..: to %stop_labels write "\n::stop_\(%value as lua identifier)::" if: (length of %stop_labels) > 0 @@ -265,14 +265,14 @@ immediately %is_first <- (yes) %seen_else <- (no) %branches <- - %body.value if (%body.type = "Block") else [%body] + %body if (%body.type = "Block") else [%body] for %func_call in %branches assume (%func_call.type is "Action") or barf ".." Invalid format for 'when' statement. Only '*' blocks are allowed. with {..} - %star: %func_call.value.1 - %condition: %func_call.value.2 - %action: %func_call.value.3 + %star: %func_call.1 + %condition: %func_call.2 + %action: %func_call.3 .. assume (%star = "*") or barf ".." Invalid format for 'when' statement. Lines must begin with '*' @@ -313,11 +313,11 @@ immediately %is_first <- (yes) %seen_else <- (no) %branches <- - %body.value if (%body.type = "Block") else [%body] + %body if (%body.type = "Block") else [%body] for %func_call in %branches assume (%func_call.type is "Action") or barf ".." Invalid format for 'when' statement. Only '*' blocks are allowed. - with {%star:%func_call.value.1, %condition:%func_call.value.2, %action:%func_call.value.3} + with {%star:%func_call.1, %condition:%func_call.2, %action:%func_call.3} assume (%star = "*") or barf ".." Invalid format for 'when' statement. Lines must begin with '*' assume %condition or barf ".." -- cgit v1.2.3