Homec4science

Improve XHPAST consistency around statement lists

Authored by epriestley <git@epriestley.com> on Aug 1 2011, 22:15.

Description

Improve XHPAST consistency around statement lists

Summary:
XHPAST is inconsistent about whether or not braces are included in the token
range for n_STATEMENT_LIST nodes. Make it alwyas include them.

(This came up while writing a lint rule for brace formatting.)

NEXPAND(x, y, z) is a macro which takes y, extends is initial token range
leftward to x, extends its terminal token range rightward to z, and returns y.
It is equivalent to NMORE(y, z); NLMORE(y, x);

NOTE: This will require a rebuild of XHPAST in the Facebook stack.

Test Plan:

  • Used XHPAST web viewer to verify resulting AST/CTS output.
  • Wrote a lint rule which fixes brace formatting (see next revision).

Reviewers: jungejason, tuomaspelkonen, aran, pad, scoates
CC: hunterbridges, aran, epriestley
Differential Revision: 754

Details

Committed
epriestley <git@epriestley.com>Aug 2 2011, 19:14
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU0acf708b9b0f: Allow escaping of formatting sequences with a backslash
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU0e17561b5a11: Improve XHPAST consistency around statement lists (authored by epriestley <git@epriestley.com>).Aug 2 2011, 19:14