mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Fix #3705. Fix ambiguity in using commas in unquoted strings in facet selector.
This commit is contained in:
@@ -51,7 +51,7 @@ filter_elements_grammar = lark.Lark(
|
||||
ifc_class: /Ifc\\w+/
|
||||
|
||||
value: special | quoted_string | regex_string | unquoted_string
|
||||
unquoted_string: /[^.=\\s]+/
|
||||
unquoted_string: /[^,.=\\s]+/
|
||||
regex_string: "/" /[^\\/]+/ "/"
|
||||
quoted_string: ESCAPED_STRING
|
||||
|
||||
|
||||
@@ -147,6 +147,9 @@ class TestFilterElements(test.bootstrap.IFC4):
|
||||
assert subject.filter_elements(self.file, 'IfcWall, Name="Foo\'s \\"quoted\\" name..."') == {element}
|
||||
assert subject.filter_elements(self.file, "IfcWall, Name=/Fo.*/") == {element}
|
||||
assert subject.filter_elements(self.file, "IfcWall, Description=NULL") == {element, element2}
|
||||
element.Name = "Foo"
|
||||
element.Description = "Foobar"
|
||||
assert subject.filter_elements(self.file, "IfcWall, Name=Foo, Description=Foobar") == {element}
|
||||
|
||||
def test_selecting_by_type(self):
|
||||
element = ifcopenshell.api.run("root.create_entity", self.file, ifc_class="IfcWall")
|
||||
|
||||
Reference in New Issue
Block a user