Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Grammar: Support strict UTF-8 strings and be strict regarding numbers #18

Merged
merged 8 commits into from
Aug 15, 2016

Commits on Feb 5, 2016

  1. Grammar: Strict number token.

    We avoid using `\d` instead of `[0-9]` because `\d` _might_ match other
    characters.
    Hywan committed Feb 5, 2016
    Configuration menu
    Copy the full SHA
    c32426e View commit details
    Browse the repository at this point in the history
  2. Composer: Add RFC references.

    Hywan committed Feb 5, 2016
    Configuration menu
    Copy the full SHA
    854adad View commit details
    Browse the repository at this point in the history
  3. Grammar: Support UTF-8 strings.

    UTF-8 is an issue with JSON, because we must handle surrogate pairs
    ([1], [2]). This patch implements UTF-8 not only for validating a datum
    but also for generating a datum. It means that we only generate valid
    UTF-8 strings and we only validate/recognize valid UTF-8 strings.
    
    UTF-16 strings will follow in another patch.
    
    Unfortunately, we decided to implement the whole string as a token, not
    as rules. This is unfortunate because grammar coverage algorithms in
    `Hoa\Compiler` applies only on rules, not on tokens. This is a potential
    optimisation.
    
    [1]: http://tools.ietf.org/html/rfc7159#section-7
    [2]: http://tools.ietf.org/html/rfc7159#section-8
    Hywan committed Feb 5, 2016
    Configuration menu
    Copy the full SHA
    2e03cb3 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2016

  1. Configuration menu
    Copy the full SHA
    5a303a5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    76423cd View commit details
    Browse the repository at this point in the history

Commits on Aug 8, 2016

  1. Configuration menu
    Copy the full SHA
    f8256eb View commit details
    Browse the repository at this point in the history
  2. Grammar: Fix lookahead to zero (LL(0)).

    JSON grammar is $LL(k=0)$. This is good for performance to fix $k$ to
    $0$, it avoids potential useless lookahead and it will fail early.
    Hywan committed Aug 8, 2016
    Configuration menu
    Copy the full SHA
    631a119 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2016

  1. Test: Use a hoa:// path.

    Hywan committed Aug 15, 2016
    Configuration menu
    Copy the full SHA
    368eb22 View commit details
    Browse the repository at this point in the history