Fix some crashes in GN.

GN would read past the end of the file if the last line was a comment that didn't end in a newline.

It also would get confused if an end-of-file was reached after an assignment or a unary operator.

BUG=478169

Review URL: https://codereview.chromium.org/1275853006

Cr-Original-Commit-Position: refs/heads/master@{#342417}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 693c60569dce46d5b1d5e2befcce95f9c8f171da
3 files changed
tree: 6d0a4108824b87af4cb9698a077743d126a1fff1
  1. tools/