Skip to content

Commit 0e9aaa9

Browse files
authored
[parser config] do not override whitespace with _undefined_str (#372)
* [parser config] do not override whitespace with `_undefined_str` fixes #371 * [docs] include new contributor * fix credits
1 parent 404dbe8 commit 0e9aaa9

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

docs/contributors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ features, bug reports, bug fixes, or suggestions:
2929
`Karthikeyan Singaravelan`_,
3030
`Manuel Jacob`_,
3131
`Marcus Brinkmann`_,
32+
`Matt Piekenbrock`_,
3233
`Mark Jason Dominus`_,
3334
`Max Liebkies`_,
3435
`Michael Noronha`_,

docs/links_contributors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@
7575
.. _commonism: https://github.com/commonism
7676
.. _Vincent Fazio: https://github.com/vfazio
7777
.. _Benjamin Beasley: https://github.com/musicinmybrain
78+
.. _Matt Piekenbrock: https://github.com/peekxc

tatsu/infos.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ def _filter_non_init_fields(self, settings: MutableMapping[str, Any]) -> Mutable
129129
return settings
130130

131131
def replace(self, **settings: Any) -> ParserConfig:
132+
if settings.get('whitespace') is _undefined_str:
133+
del settings['whitespace']
134+
settings = dict(self._filter_non_init_fields(settings))
132135
overrides = self._filter_non_init_fields(self._find_common(**settings))
133136
result = dataclasses.replace(self, **overrides)
134137
if 'grammar' in overrides:

0 commit comments

Comments
 (0)