Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Enable TableInterpreter to trim leading and trailing whitespace #647

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

TungstnBallon
Copy link
Contributor

Adds two properties to TableInterpreter: skipLeadingWhitespace and skipTrailingWhitespace. Both are true by default.
If enabled InternalRepresentationParserVisitor will trim whitespace for integer, decimal and boolean.

Part of #641.

Copy link
Member

@georg-schwarz georg-schwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Having it in the TableInterpreter seems a good solution to me.

We might want to define it column-specific in the future, esp. if we have a nicer syntax to apply transformations. Example (just spitballing):

    block TestBlock oftype TableInterpreter {
		header: false;
		columns: [
			"index" oftype integer <- stripWhitespaces,
			"name" oftype text,
			"flag" oftype boolean <- stripWhitespaces
		];\
	}

Copy link
Contributor

@joluj joluj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @georg-schwarz's comments.

We might want to define it column-specific in the future

I agree, but it's something for another PR.

@TungstnBallon TungstnBallon merged commit 233bafe into main Feb 5, 2025
3 checks passed
@TungstnBallon TungstnBallon deleted the 641-leading-whitespace branch February 5, 2025 14:24
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants