]> granicus.if.org Git - clang/commit
clang-format: [JS] simplify import/export.
authorMartin Probst <martin@probst.io>
Tue, 19 Apr 2016 14:55:37 +0000 (14:55 +0000)
committerMartin Probst <martin@probst.io>
Tue, 19 Apr 2016 14:55:37 +0000 (14:55 +0000)
commitdfafb4ac7fb0fd9387f1065f010d78a02b379888
tree79d503ae9852f5fec160af6490cc97361759da5f
parentfa459139770761a95ba6570e227c4b30d573bf5e
clang-format: [JS] simplify import/export.

Summary:
Change `import` and `export` parsing to special case the renaming
syntax (`import x, {y as bar} ...`, `export {x}`) and otherwise just
parse a regular structural element.

This simplifies the code a bit and should be more correct - it's easier
to recognise the specific import syntax than to recognise arbitrary
expressions and declarations.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D19242

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266743 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTestJS.cpp