Descriptiontools/gn: disallow non-canonical integer literals
In most languages familiar to Chromium developers (e.g., C++,
JavaScript, Python, Java, Go, Bash, Perl, Ruby), a leading 0 in an
integer literal indicates an octal number. For example, "010" and
"-010" represent 8 and -8, respectively.
GN doesn't have any use for octal integer literals, so reject integers
with leading zeros to avoid confusion rather than interpreting them as
decimal values.
While here, "-0" isn't useful either since it's equivalent to "0", so
reject that too.
No Chromium BUILD.gn files are affected by this change.
Committed: https://crrev.com/b45ed217c61cd69eee2eafd9dbf5798520685538
Cr-Commit-Position: refs/heads/master@{#323142}
Patch Set 1 #Patch Set 2 : Add note to "gn help grammar" #
Total comments: 3
Patch Set 3 : Just "auto"; it's cleaner #
Total comments: 2
Patch Set 4 : Replace "auto" with "base::StringPiece" #
Total comments: 3
Patch Set 5 : Move kBad tests down by usage #
Messages
Total messages: 16 (3 generated)
|