Home GnuPG

Extend nodes in both directions in XHPAST
31110f222572Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Extend nodes in both directions in XHPAST

Summary:
Currently, appendChild() extends tokens only to the right, so this produces the wrong result:

NLMORE($$, $2);
$$->apppendChild($1);

Instead of separate setBegin() + setEnd() operations, just always extend both sides of the range if applicable. This reduces NLMORE to NMORE and removes the pitfall from the codebase.

(I retained NEXTEND() because I think it makes the code a little more clear.)

Test Plan:

  • Unit tests.
  • Parsed a snippet with methods-with-modifiers and methods-without-modifiers and saw the whole method definition end up in the n_METHOD_DECLARATION node.

Reviewers: joshuaspence, richardvanvelzen

Reviewed By: richardvanvelzen

Subscribers: epriestley

Maniphest Tasks: T6885

Differential Revision: https://secure.phabricator.com/D11268

Details

Provenance
epriestley <git@epriestley.com>Authored on Jan 7 2015, 2:49 PM
Parents
rPHUTIL00fe30dd9ebf: Fix a minor XHPAST bug
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUTIL31110f222572: Extend nodes in both directions in XHPAST (authored by epriestley <git@epriestley.com>).Jan 7 2015, 2:49 PM