)]}'
{
  "commit": "b8906889861d0efaf5682a7d26417111eaba3480",
  "tree": "7d7870c860fd8f586f958259cc091ad662a71055",
  "parents": [
    "670494827c42d4ac64a52dfa909cf6048308e133"
  ],
  "author": {
    "name": "Robert Griesemer",
    "email": "gri@golang.org",
    "time": "Wed Jan 17 21:42:51 2018 -0800"
  },
  "committer": {
    "name": "Robert Griesemer",
    "email": "gri@golang.org",
    "time": "Mon Feb 12 22:57:57 2018 +0000"
  },
  "message": "cmd/compile/internal/syntax: implement comment reporting in scanner\n\nR\u003dgo1.11\n\nIn order to collect comments in the AST and for error testing purposes,\nthe scanner needs to not only recognize and skip comments, but also be\nable to report them if so desired. This change adds a mode flag to the\nscanner\u0027s init function which controls the scanner behavior around\ncomments.\n\nIn the common case where comments are not needed, there must be no\nsignificant overhead. Thus, comments are reported via a handler upcall\nrather than being returned as a _Comment token (which the parser would\nhave to filter out with every scanner.next() call).\n\nBecause the handlers for error messages, directives, and comments all\nlook the same (they take a position and text), and because directives\nlook like comments, and errors never start with a \u0027/\u0027, this change\nsimplifies the scanner\u0027s init call to only take one (error) handler\ninstead of 2 or 3 different handlers with identical signature. It is\ntrivial in the handler to determine if we have an error, directive,\nor general comment.\n\nFinally, because directives are comments, when reporting directives\nthe full comment text is returned now rather than just the directive\ntext. This simplifies the implementation and makes the scanner API\nmore regular. Furthermore, it provides important information about\nthe comment style used by a directive, which may matter eventually\nwhen we fully implement /*line file:line:col*/ directives.\n\nChange-Id: I2adbfcebecd615e4237ed3a832b6ceb9518bf09c\nReviewed-on: https://go-review.googlesource.com/88215\nReviewed-by: Matthew Dempsky \u003cmdempsky@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0a872e03ef9b0961f1095412ec90233cef4d31c4",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/syntax/parser.go",
      "new_id": "25bbbeec69a9b79deefe5a67b6db239264ff1f78",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/syntax/parser.go"
    },
    {
      "type": "modify",
      "old_id": "be406d9753030d810ca4edb1bc08ede53df36f9e",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/syntax/scanner.go",
      "new_id": "1e0ff2e3cc27c7f64ba12b2575f973848f2bc1d1",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/syntax/scanner.go"
    },
    {
      "type": "modify",
      "old_id": "160bcbee267060a6d9afeb829a7853e3ab98e9e8",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/syntax/scanner_test.go",
      "new_id": "4bfe5871fabe13bad73e2ec91c9ade18d6cf2f0c",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/syntax/scanner_test.go"
    },
    {
      "type": "modify",
      "old_id": "4e3551225aad7f53d50979044e4b25a939be3ef5",
      "old_mode": 33188,
      "old_path": "src/cmd/compile/internal/syntax/source.go",
      "new_id": "62eb0fdc30140988ca4333183b75c775cbd94f3d",
      "new_mode": 33188,
      "new_path": "src/cmd/compile/internal/syntax/source.go"
    }
  ]
}
