formatter: add DATA_BLOCK to BLOCKS + DECLARATIONS
Without this, DATA_BLOCK wasn't recognized as a declaration block, so the stack was never populated for DB files. END_DATA_BLOCK fell through to regular-line handling and got a tab prefix (from body get_indent()), while DATA_BLOCK itself was flush-left. Added DATA_BLOCK to both BLOCKS (ender = END_DATA_BLOCK) and DECLARATIONS so it gets the same treatment as FUNCTION_BLOCK: stack cleared, no_indent=true, and END_DATA_BLOCK handled by the declaration ender path (flush-left output).
This commit is contained in:
@@ -43,6 +43,7 @@ local BLOCKS = {
|
||||
["FUNCTION"] = "END_FUNCTION",
|
||||
["FUNCTION_BLOCK"] = "END_FUNCTION_BLOCK",
|
||||
["ORGANIZATION_BLOCK"] = "END_ORGANIZATION_BLOCK",
|
||||
["DATA_BLOCK"] = "END_DATA_BLOCK",
|
||||
["TYPE"] = "END_TYPE",
|
||||
["STRUCT"] = "END_STRUCT",
|
||||
["VAR"] = "END_VAR",
|
||||
@@ -91,6 +92,7 @@ local DECLARATIONS = {
|
||||
["FUNCTION"] = true,
|
||||
["FUNCTION_BLOCK"] = true,
|
||||
["ORGANIZATION_BLOCK"] = true,
|
||||
["DATA_BLOCK"] = true,
|
||||
["TYPE"] = true,
|
||||
["STRUCT"] = true,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user