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

line context is not correctly produced (th2 to json to th2) #9

Closed
CaverBruce opened this issue Jul 27, 2022 · 2 comments
Closed

line context is not correctly produced (th2 to json to th2) #9

CaverBruce opened this issue Jul 27, 2022 · 2 comments

Comments

@CaverBruce
Copy link

Original th2

line arrow -context point label -scale xs
  5779.0 8828.0
  5768.0 8884.0 5702.0 9103.0 5702.0 9103.0
  smooth off
endline

Resultant th2

	line arrow  -context point
		5779 8828
		5768 8884 5702 9103 5702 9103
		smooth off
	endline

The object name and optional subsequent -scale property is missing.

@daem-on
Copy link
Owner

daem-on commented Jul 27, 2022

Yep this and #7 are both weird edge cases which could have been avoided if therion's file formats weren't absolutely terrible.
Currently the importer assumes that "options" which follow a command look like this:

Option name, a space, option value, where the option value contains no spaces unless it's enclosed in brackets or quote marks.

Here and in #7 there are some options which do have a space in them and also are not enclosed in anything. This type of inconsistency makes it basically impossible to write an elegant and fast parser.
Actually we were talking about adding the parser from the Mapiah project into wtherion, but I haven't heard anything about it since.

I'll try to find a better solution for the parser.

@CaverBruce
Copy link
Author

Original th2
line arrow -context point label -scale xs 5779.0 8828.0 5768.0 8884.0 5702.0 9103.0 5702.0 9103.0 smooth off endline

resultant th2
line arrow -context point label -scale xs 5779 8828 5768 8884 5702 9103 5702 9103 smooth off endline
Success, this issue can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants