Skip to content

move variable declarations out of control structures to avoid warning on SC 3.15#264

Open
HotwheelsSisyphus wants to merge 2 commits intodavidgranstrom:mainfrom
HotwheelsSisyphus:avoid-variable-warning
Open

move variable declarations out of control structures to avoid warning on SC 3.15#264
HotwheelsSisyphus wants to merge 2 commits intodavidgranstrom:mainfrom
HotwheelsSisyphus:avoid-variable-warning

Conversation

@HotwheelsSisyphus
Copy link
Copy Markdown

Some of Jordan's recent work on SC's parser (PyrParseNode.cpp) seems to have resulted in SC now displaying "uninlineable" warnings on startup where it didn't previously... they're still just warnings, but it's easy enough to fix the scnvim code that generates them, so I did.

The warnings in question:

WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Code/scnvim/scide_scnvim/Classes/SCNvimDoc/SCNvimDoc.sc'
  line 265 char 63:
  			var keys = #[ "superclasses", "subclasses", "implementor" ];
                                                                 
  			klass.superclasses !? {
-----------------------------------
WARNING: FunctionDef contains variable declarations and so will not be inlined.
  in file '~/Code/scnvim/scide_scnvim/Classes/SCNvim.sc'
  line 230 char 106:
                            var description = "Snippet for %, auto generated by SCNvim".format(snippetName);
                                                                                                            
                              snippet = "s( {trig = \"%\", name = \"%\", dscr = \"%\" }, {%}),".format(snippetName, snippetName, description, snippet);
-----------------------------------

Everything works as before, but no warning on startup, and it saves you probably 0.0002 picoseconds of your precious time (very scientific estimate) because the code now presumably inlines properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant