daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

[DAPHNE-#659] Scientific notation for float literals and digit separators #677

Closed AlexRTer closed 6 months ago

AlexRTer commented 8 months ago

This PR closes #659. It adds scientific notation for float literals as well as digit separators for both float and integer literals to improve readability.

Features:

Changes:

AlexRTer commented 7 months ago

Thank you for your feedback, I will go ahead and implement some better testing as well.

AlexRTer commented 6 months ago

I changed the grammar slightly to disallow digit separators right behind the decimal point.

The tests now include some negative tests, i.e.

and cover (corresponding file index in brackets)

For all tested ordinary values there is a test without signs, with a negative sign, as float type and mixed (negative and float type). The tests also cover small and capital e for scientific notation as well as +, - signs.

I believe a test to verify that e.g. 1.0f is of float type is still missing in Daphne. Maybe a built-in typeof function would be a good addition to DaphneDSL.

pdamme commented 6 months ago

By the way, there is an open issue on introducing a typeof() built-in function in DaphneDSL: #357.