From 465a1b3b4936b6c1ab12b2eb2133fb9cc61e5a5f 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 | 10 ++++++++++ test/indent/select.bp | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/queries/indents.scm b/queries/indents.scm index 9e63d1e..8fc46fc 100644 --- a/queries/indents.scm +++ b/queries/indents.scm @@ -11,6 +11,16 @@ (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..2f589a9 100644 --- a/test/indent/select.bp +++ b/test/indent/select.bp @@ -26,3 +26,25 @@ 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, + ): [], +})