Question about console reporting error

In the following code I forgot the semicolon in the first line after expanding the outputs
The console hower said there was a syntax error in the envgen , pointing to the curve

ERROR: syntax error, unexpected NAME, expecting '}'
  in interpreted text
  line 5 char 4:

  	env=EnvGen.ar(Env([0,1,0],[0.001,0.250],[0,-5]),Impulse.ar(4));
   ^^^
  	sig*env;
////
(
{ var sig,env;

	sig=PMOsc.ar(48.midicps,60.midicps,LFNoise0.ar(4,mul:10))*0.1!2
	env=EnvGen.ar(Env([0,1,0],[0.001,0.250],[0,-5]),Impulse.ar(4));
	sig*env;
}.play
)
////

I think it’s rather pointing to the env variable declaration, where he expects another character (another type of data, not a NAME, i.e. a variable name).

It cannot understand what your code is supposed to look like, so it supposes you forgot to close a function, the one you opened line 2, thus proposing you to close it with }.

My guess would be that it’s pointing to the curve because the code is wrapped in the console, but if you look at the code you pasted here, it’s pointing to env.

As a personal rule of thumb when confronted with error messages such as these, I look at the line of code above the one referenced in the error.

In your example, sig=PMOsc.ar..... is missing its semicolon. What the error is telling you that it doesn’t understand env=...., because, without the preceding semicolon, it considers this line a continuation of the previous line.