mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Support block comments in selector filter syntax (#5023)
The filter_elements selector grammar had no way to comment out part of a
query, so users had to delete and retype text to temporarily toggle a
facet. Add a /* ... */ block comment terminal that is ignored by the
lexer, and tolerate a trailing "+" so that commenting out the final
operand (e.g. "IfcWall + /* IfcSlab */") parses cleanly. Comments may
span multiple lines; a /* sequence inside a quoted string is not treated
as a comment. Only the filter grammar is affected, not get_element or
format which use "/" for regex and division.
Adds a regression test and documents the syntax.
Generated with the assistance of an AI coding tool.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
(cherry picked from commit 5c11946470)
This commit is contained in:
committed by
Dion Moult
parent
d39b1c56f8
commit
007573cea5
@@ -89,6 +89,11 @@ The filters are chained and apply from left to right.
|
||||
|
||||
filter[, filter]*
|
||||
|
||||
Any part of a query may be commented out using a ``/* ... */`` block comment.
|
||||
This lets you temporarily disable part of a query without deleting the text, for
|
||||
example ``IfcWall + /* IfcSlab, material=concrete */`` selects only walls while
|
||||
keeping the slab criteria on hand. Block comments may span multiple lines.
|
||||
|
||||
Below is the table of filters to choose from. Most of these filters will filter
|
||||
previously added elements in your filter group based on their criteria.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user