Reduce deprecated script warning text

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

Reduce deprecated script warning text

Postby Major Cooke » Tue Aug 13, 2019 6:03 pm

I would like to suggest that warnings like this:

Code: Select allExpand view
Script warning, "AEoDdat.pk3:zaeod/eventhandler.txt" line 428:
Call to deprecated function CharAt
Script warning, "AEoDdat.pk3:zaeod/eventhandler.txt" line 428:
Accessing deprecated function CharAt - deprecated since 4.1.0


...be squished down to:

Code: Select allExpand view
Script warning, "AEoDdat.pk3:zaeod/eventhandler.txt" line 428:
Accessing deprecated function CharAt - deprecated since 4.1.0


When there's a lot to read, that's a lot of needless text being duplicated, especially the "script warning" lines being needlessly duplicated.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Reduce deprecated script warning text

Postby Nash » Tue Aug 13, 2019 6:59 pm

On a related note, would it be possible to suggest what to replace the deprecated function with, so that people can stop making forum posts asking "what should I use in place of CharAt"? :P
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Reduce deprecated script warning text

Postby Major Cooke » Wed Aug 14, 2019 7:09 am

I don't think that should be too hard, if the deprecated function is expanded to include an extra parameter.
User avatar
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

Re: Reduce deprecated script warning text

Postby phantombeta » Wed Aug 14, 2019 12:24 pm

Major Cooke wrote:I don't think that should be too hard, if the deprecated function is expanded to include an extra parameter.

It's not a function, it's an attribute. And ZScript's attributes are built into the ZScript parser. So, uh... Good luck. This is coming from someone who worked on the JIT and made several PRs for the ZScript compiler.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Reduce deprecated script warning text

Postby Graf Zahl » Wed Aug 14, 2019 12:35 pm

You'd have to make a change to the grammar but this won't have to filter down to the JIT, the message should be emitted in the resolving pass.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Reduce deprecated script warning text

Postby phantombeta » Wed Aug 14, 2019 12:40 pm

Graf Zahl wrote:You'd have to make a change to the grammar but this won't have to filter down to the JIT, the message should be emitted in the resolving pass.

???
I never said it would affect the JIT, I was saying it would be a pain in the ass, because the lemon and the parser are ass.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland
Discord: phantombeta#2461
Twitch ID: phantombeta_
Github ID: Doom2fan
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Reduce deprecated script warning text

Postby Graf Zahl » Wed Aug 14, 2019 12:44 pm

Code: Select allExpand view
decl_flags(X) ::= decl_flags(F) DEPRECATED(B) LPAREN STRCONST(A) COMMA STRCONST(C) RPAREN.   
{
   if (F == nullptr)
   {
      NEW_AST_NODE(DeclFlags,nil_f,B.SourceLoc);
      X = nil_f;
      X->Flags = ZCC_Deprecated;
      X->Id = nullptr;
      X->Version = { 0, 0 };
   }
   else
   {
      X = F;
      X->Flags |= ZCC_Deprecated;
   }
   X->Version = A.String->GetChars();
   // Do something with C here.
}


That's all you need in the parser.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 2 guests