Store number values as strings of digits · Issue #239 · projectfluent/fluent · GitHub
Skip to content

Store number values as strings of digits #239

Description

@stasm

I like to think about AST as a structured, semantic view of the source string.

From that perspective, what if we stored a number as a slice [start;end] and parsed it in the resolver instead?

My concern here is that storing numbers and parsing them differs between different programming languages Fluent may work in. Number is a low level primitive, but it still can differ in how it stores fractions, unsigned vs signed etc. By keeping AST free of that logic, we ensure that the AST is portable between the implementations irrelevant of how JS, Python or Rust treat numerical values.

Not a blocker, just a suggestion.

Originally posted by @zbraniecki in projectfluent/fluent.js#342

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions