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

introduce proper parsing of math expressions in config files #29

Open
doudou opened this issue Nov 13, 2014 · 1 comment
Open

introduce proper parsing of math expressions in config files #29

doudou opened this issue Nov 13, 2014 · 1 comment

Comments

@doudou
Copy link
Member

doudou commented Nov 13, 2014

We should aim at allowing math expressions in config files without resorting to eval(). eval() is horribly dangerous and yukky.

The general scheme would IMO be:

  • if the target type is numeric and
  • the YAML-parsed type is a string
  • then parse the string

Convenience unit operators (5.deg, 22.mm, 1.bar) should be added to the parser.

Ready-to-use math expression parsers are already available as gems. Or, I always wanted to try treetop/parslet to see what they could do.

@jakobs
Copy link
Member

jakobs commented Jan 15, 2015

sounds good. especially for using things like Math::PI * 0.5, a.s.o.

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

No branches or pull requests

2 participants