influxdata / flux

Flux is a lightweight scripting language for querying databases (like InfluxDB) and working with data. It's part of InfluxDB 1.7 and 2.0, but can be run independently of those.
https://influxdata.com
MIT License
769 stars 153 forks source link

definition of a integer literal must include optional leading sign #1324

Closed DG12 closed 3 weeks ago

DG12 commented 5 years ago

The definition of an itteger literal https://v2.docs.influxdata.com/v2.0/reference/flux/language/lexical-elements/#integer-literals

must include optional leading sign as seen in the example at https://docs.influxdata.com/influxdb/v1.3/write_protocols/line_protocol_reference/#data-types.

Does it also require a training letter I ?

nathanielc commented 5 years ago

Leading signs are implemented as unary operators, not as part of the numeric literal itself.

Is there a specific query that doesn't work with a leading sign?

wolffcm commented 5 years ago

I agree that - should be part of the literal token, rather than an operator, because otherwise it's not possible to represent min int64:

-9223372036854775808

Since the value 9223372036854775808 is out of range for int64.

(Current behavior of Flux is to just return max int64 for this expression, due to https://github.com/influxdata/flux/issues/1560)

DG12 commented 5 years ago

Although the theoretical / academic discussion, and exact implementation are surely important, I am requesting a change in the documentation!

github-actions[bot] commented 3 months ago

This issue has had no recent activity and will be closed soon.

DG12 commented 3 months ago

I request a review of this documentation issue. according to : https://docs.influxdata.com/flux/v0/spec/lexical-elements/ "An integer literal is a sequence of digits representing an integer value. Only decimal integers are supported."

The string -34 is not a valid integer literal!

github-actions[bot] commented 1 month ago

This issue has had no recent activity and will be closed soon.