From 2df28c317bfe9153909506156f4ba591131c4c0f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 23 Apr 2024 16:36:11 +0000 Subject: [PATCH] WIP: Add indentation queries for multi-value 'select' FIXME: add insertion tests for both cases... --- queries/indents.scm | 9 +++++++++ test/indent/select.bp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/queries/indents.scm b/queries/indents.scm index 9e63d1e..cd5b726 100644 --- a/queries/indents.scm +++ b/queries/indents.scm @@ -11,6 +11,15 @@ (select_expression ")" @indent.branch) +(select_value) @indent.begin +(select_value + ")" @indent.branch) + +; (select_pattern +; "(" @indent.begin) +; (select_pattern +; ")" @indent.branch) + (select_cases) @indent.begin (select_cases "}" @indent.branch) diff --git a/test/indent/select.bp b/test/indent/select.bp index 6d95b2c..6c432b2 100644 --- a/test/indent/select.bp +++ b/test/indent/select.bp @@ -26,3 +26,35 @@ foo = select( default: 0, } ) + +foo = select(( + arch(), + os(), +), { + (default, default): [], +}) + +foo = select( + (arch(), os()), + { + (default, default): [], + } +) + +// We're really getting into more and more unlikely choices here... +foo = select( + ( + arch(), + os(), + ), + { + (default, default): [], + } +) + +foo = select((arch(), os()), { + ( + default, + default, + ): [], +})