logos icon indicating copy to clipboard operation
logos copied to clipboard

[Bug]: space/newline in %init causes issues

Open HearseDev opened this issue 4 years ago • 0 comments

What are the steps to reproduce this issue?

Tested in an empty project using the tweak template

This example code compiles fine

%hook ViewController
%end

%ctor{
  %init(ViewController = objc_getClass("App.ViewController"))
}

as opposed to this example code, which throws an error because of the space/newline

%hook ViewController
%end

%ctor{
  %init(
ViewController = objc_getClass("App.ViewController"))
}

What happens?

Error

%init(
ViewController = objc_getClass("App.ViewController")) 

vs No Error

%init(ViewController = objc_getClass("App.ViewController")) 

The newly added space/newline in the init causes logos to throw an error of which the log is provided below.

What were you expecting to happen?

I was expecting for it to compile successfully

Paste any relevant logs, error output, etc.

==> Preprocessing Tweak.xm…
logos: warnings being treated as errors
Tweak.xm:8: warning: tried to set expression for unknown class or function  ViewController in group _ungrouped
make[3]: *** [/home/admin/.theos/makefiles/instance/rules.mk:266: /home/admin/test/.theos/obj/debug/armv7/Tweak.xm.mm] Error 1
rm /home/admin/test/.theos/obj/debug/armv7/Tweak.xm.mm
make[2]: *** [/home/admin/.theos/makefiles/instance/library.mk:52: /home/admin/test/.theos/obj/debug/armv7/test.dylib] Error 2
make[2]: *** Waiting for unfinished jobs....

Additional context

No response

What OS are you seeing the problem on?

Linux/WSL

What OS version does it have installed?

Arch Linux

What toolchain and version are you using?

https://github.com/CRKatri/llvm-project/releases/download/swift-5.3.2-RELEASE/swift-5.3.2-RELEASE-ubuntu18.04.tar.zst

Which SDK version are you using?

latest 14.4

What OS is your client device running?

iOS

What OS version does it have installed?

ios 14.8/ client device info isn't relevant to the issue

Which device model is it?

iphone X

Which jailbreak is it using (if relevant)?

odysseyra1n

HearseDev avatar Dec 09 '21 00:12 HearseDev