Port DeclModeSmartConstructors
commit6a26264cbb6778381bbc1cc2795be44919c712d0
authorLeo Osvald <leoo@fb.com>
Tue, 30 Apr 2019 00:38:16 +0000 (29 17:38 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 30 Apr 2019 00:48:52 +0000 (29 17:48 -0700)
treec70a18af7d4c5d63ec8276cd613857b7fc1f963a
parent3e431d4c7f3e9172305b70da1b9062b5fc5dfbff
Port DeclModeSmartConstructors

Summary:
Port `DeclModeSmartConstructors`, one of the specializations
of `SyntaxSmartConstructors`.  The state (i.e., vector of booleans)
is reversed compared to OCaml implementation so that push/pop run in
amortized O(1) (note: no need for &Vec/&[], as moving takes O(1)) time.

The implementation is specialized via type params `Token` & `Value`,
which is equiavlent to `Syntax.t` in Ocaml via `Syntax<Token, Value>`.

Reviewed By: dabek

Differential Revision: D15112859

fbshipit-source-id: 9e5f1d0eafa0a402957b5846f3f15d47b631f68e
hphp/hack/src/generate_full_fidelity.ml
hphp/hack/src/parser/decl_mode_smart_constructors.rs [new file with mode: 0644]
hphp/hack/src/parser/decl_mode_smart_constructors_generated.rs [new file with mode: 0644]
hphp/hack/src/parser/lib.rs