Repository metrics
- Stars
- (133,883 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
This is an umbrella issue for eliminating the global lineno variable from package gc. Filing as a HelpWanted issue because I think it's a relatively low-barrier-to-entry issue that people can usefully contribute to the compiler with small incremental improvements.
Here's the general algorithm:
- Identify a function
Barthat uses lineno. - Split it into two functions
BarandBarl;Barltakes an additionalpos src.XPosparameter, andBarjust callsBarlwithlineno. - Change callers of
Barto useBarl. Ideally, the caller can supply the position information directly (e.g., vian.Posor something); but if necessary, just uselinenoand later we'll recursively apply this procedure on the caller function.
An example of this is yyerror and Warn now have yyerrorl and `Warnl' functions that we're trying to use instead.
Note: sometimes uses of lineno should just go away entirely (e.g., CL 38393 / 80c4b53e1e5159cc440e52c906583edc1eb79abc). I suggest pinging here to discuss instances and/or express interest in working on this to avoid duplicating work (e.g., @josharian and I are looking at this in the backend for #15756).