Open
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
Bar
that uses lineno. - Split it into two functions
Bar
andBarl
;Barl
takes an additionalpos src.XPos
parameter, andBar
just callsBarl
withlineno
. - Change callers of
Bar
to useBarl
. Ideally, the caller can supply the position information directly (e.g., vian.Pos
or something); but if necessary, just uselineno
and 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 / 80c4b53). 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).