)]}'
{
  "commit": "75d0d58cffada7fe02db980f5dcb74e9908fa185",
  "tree": "1542f663aa1fc15c618946da17e7055d62976141",
  "parents": [
    "93375f97c22a045a810ee9afceee9ad7ca24a782"
  ],
  "author": {
    "name": "Enes Cevik",
    "email": "nsvke@proton.me",
    "time": "Mon Apr 06 13:16:35 2026 +0300"
  },
  "committer": {
    "name": "Arthur Cohen",
    "email": "arthur.cohen@embecosm.com",
    "time": "Mon Jun 01 15:24:51 2026 +0200"
  },
  "message": "gccrs: Defer literal suffix validation to parser and preserve source fidelity\n\nNumber literal evaluation and suffix validation should be done after macro expansion,\nso we defer these to the parser phase. This preserves source fidelity for macro token\ntrees.\n\ngcc/rust/ChangeLog:\n\n\t* ast/rust-ast-collector.cc (TokenCollector::visit): Update Token::make_int and\n\tToken::make_float calls to include suffix_start and IntegerLiteralBase::Decimal.\n\t* expand/rust-macro-builtins-location.cc (MacroBuiltin::column_handler): Pass string\n\tlength and base to Token::make_int.\n\t(MacroBuiltin::line_handler): Likewise.\n\t* lex/rust-lex.cc (Lexer::parse_in_type_suffix): Rename to parse_in_suffix and return\n\tstring instead of PrimitiveCoreType.\n\t(Lexer::parse_in_suffix): Remove underscore stripping to preserve source fidelity for\n\tmacros.\n\t(Lexer::parse_in_exponent_part): Preserve \u0027+\u0027 and \u0027-\u0027 characters in the raw string.\n\t(Lexer::parse_in_decimal): Remove underscore stripping.\n\t(Lexer::parse_non_decimal_int_literal): Track suffix start index and pass literal base.\n\t(Lexer::parse_non_decimal_int_literals): Use IntegerLiteralBase enum values instead of\n\traw integers.\n\t(Lexer::parse_decimal_int_or_float): Track suffix string length and pass base parameters\n\tto token creation.\n\t* lex/rust-lex.h: Update method signatures for suffix parsing.\n\t* lex/rust-token.h (enum class IntegerLiteralBase): New enum to represent numeric bases.\n\t* parse/rust-parse-impl-expr.hxx: use LiteralResolve functions to evaluate raw token\n\tstrings.\n\t* parse/rust-parse-impl-pattern.hxx: Use evaluated literal strings for INT and FLOAT\n\ttokens.\n\t* parse/rust-parse.cc (resolve_literal_suffix): Move suffix validation logic from lexer\n\tto parser.\n\t(evaluate_integer_literal): New function to strip underscores and convert to decimal via\n\tGMP.\n\t(evaluate_float_literal): New function to strip underscores from floats.\n\t* parse/rust-parse.h (evaluate_integer_literal): Declare in LiteralResolve namespace.\n\t(evaluate_float_literal): Likewise.\n\t(resolve_literal_suffix): Likewise.\n\t* util/rust-token-converter.cc (from_literal): Safely reconstruct raw text and suffix to\n\tdynamically determine base and suffix_start for ProcMacros.\n\ngcc/testsuite/ChangeLog:\n\n\t* rust/compile/deferred-suffix-validation.rs: New test.\n\t* rust/compile/evaluate-integer-or-float.rs: New test.\n\t* rust/compile/tuple-index.rs: New test.\n\nSigned-off-by: Enes Cevik \u003cnsvke@proton.me\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e6072a80bcaa473f6e2260fab1d1d2bd14f05fa8",
      "old_mode": 33188,
      "old_path": "gcc/rust/ast/rust-ast-collector.cc",
      "new_id": "12f3e106c8f0ffd6c7fddaffa8662678d0c11f33",
      "new_mode": 33188,
      "new_path": "gcc/rust/ast/rust-ast-collector.cc"
    },
    {
      "type": "modify",
      "old_id": "3960e0fbd03bac6fd9b20585862a59b76cbbf64f",
      "old_mode": 33188,
      "old_path": "gcc/rust/expand/rust-macro-builtins-location.cc",
      "new_id": "7a6d1471e2624832a701727238c59271b8b41e47",
      "new_mode": 33188,
      "new_path": "gcc/rust/expand/rust-macro-builtins-location.cc"
    },
    {
      "type": "modify",
      "old_id": "681219160c502b5ca8d747640b509349c536283a",
      "old_mode": 33188,
      "old_path": "gcc/rust/lex/rust-lex.cc",
      "new_id": "6fcbc1ea98283a723f684e92b49c969947f31154",
      "new_mode": 33188,
      "new_path": "gcc/rust/lex/rust-lex.cc"
    },
    {
      "type": "modify",
      "old_id": "b14dffb2c9af6a48a5ec4a6b47422fb7f4b469d7",
      "old_mode": 33188,
      "old_path": "gcc/rust/lex/rust-lex.h",
      "new_id": "132005a164f18a2a387aabbeadfe62089e380441",
      "new_mode": 33188,
      "new_path": "gcc/rust/lex/rust-lex.h"
    },
    {
      "type": "modify",
      "old_id": "f6741363fec976bf36a54216bb890c16d77f432e",
      "old_mode": 33188,
      "old_path": "gcc/rust/lex/rust-token.h",
      "new_id": "f3e2e944100ddd61d8fde241093bb7fd290ea2d8",
      "new_mode": 33188,
      "new_path": "gcc/rust/lex/rust-token.h"
    },
    {
      "type": "modify",
      "old_id": "306a0958d829aae64ed7f84d679b173572596473",
      "old_mode": 33188,
      "old_path": "gcc/rust/parse/rust-parse-impl-expr.hxx",
      "new_id": "887991541631b503e637170a3cfc27932b987342",
      "new_mode": 33188,
      "new_path": "gcc/rust/parse/rust-parse-impl-expr.hxx"
    },
    {
      "type": "modify",
      "old_id": "e28dc8656a668fbd2850e9d10290591cc989f976",
      "old_mode": 33188,
      "old_path": "gcc/rust/parse/rust-parse-impl-pattern.hxx",
      "new_id": "ab972d61ed25654e103945f768417571db117e78",
      "new_mode": 33188,
      "new_path": "gcc/rust/parse/rust-parse-impl-pattern.hxx"
    },
    {
      "type": "modify",
      "old_id": "860fd11612adb8860ae557cdbad2a2c842e9f295",
      "old_mode": 33188,
      "old_path": "gcc/rust/parse/rust-parse.cc",
      "new_id": "8711021bd7ba564ea5c0df2834858e6ee59830f5",
      "new_mode": 33188,
      "new_path": "gcc/rust/parse/rust-parse.cc"
    },
    {
      "type": "modify",
      "old_id": "dac39da3660ca2650c7b7bbafbeb1e9247b3bb5a",
      "old_mode": 33188,
      "old_path": "gcc/rust/parse/rust-parse.h",
      "new_id": "84f7d17435e9d9376169a9a635db1d8abf5fe3a3",
      "new_mode": 33188,
      "new_path": "gcc/rust/parse/rust-parse.h"
    },
    {
      "type": "modify",
      "old_id": "0865bf92c68763a05cf3c9612b96423609cbf1ee",
      "old_mode": 33188,
      "old_path": "gcc/rust/util/rust-token-converter.cc",
      "new_id": "078c38fb3dce2e0fdfb15eac6b55a6c0c49d2d1f",
      "new_mode": 33188,
      "new_path": "gcc/rust/util/rust-token-converter.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6e44ea15710fa0fdb38390b1ef475ec47f487c10",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/rust/compile/deferred-suffix-validation.rs"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "32c1cec0b266a4a6061a681218f7919e5f10896f",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/rust/compile/evaluate-integer-or-float.rs"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "faf08db2d925115ba2e435cf406625216591a255",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/rust/compile/tuple-index.rs"
    }
  ]
}
