Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuation strips or places comments in wrong spot #296

Open
Banaanae opened this issue Oct 3, 2024 · 2 comments
Open

Continuation strips or places comments in wrong spot #296

Banaanae opened this issue Oct 3, 2024 · 2 comments

Comments

@Banaanae
Copy link
Collaborator

Banaanae commented Oct 3, 2024

V1:

var := DllCall("Func"
     , "Str", "ABC" ; Comment
     , "Str", "123"   ; Comment
     , "Str", "DEF") ;Comment

hCtrl := DllCall("CreateWindowEx"
      , "Uint", 0x200        ; WS_EX_CLIENTEDGE
      , "str",  "HiEdit"     ; ClassName
      , "str",  ""		     ; WindowName
      , "Uint", WS_CLIPCHILDREN | WS_CHILD | WS_VISIBLE | hStyle
      , "int",  X            ; Left
      , "int",  Y            ; Top
      , "int",  W            ; Width
      , "int",  H            ; Height
      , "Uint", HParent      ; hWndParent
      , "Uint", MODULEID	 ; hMenu
      , "Uint", 0            ; hInstance
      , "Uint", 0, "Uint")

V2 (Converted):

var := DllCall("Func"
     , "Str", "ABC"
     , "Str", "123"
     , "Str", "DEF")

hCtrl := DllCall("CreateWindowEx"

V2 (Expected):

var := DllCall("Func"
     , "Str", "ABC" ; Comment
     , "Str", "123"   ; Comment
     , "Str", "DEF") ;Comment

hCtrl := DllCall("CreateWindowEx"
      , "Uint", 0x200        ; WS_EX_CLIENTEDGE
      , "str",  "HiEdit"     ; ClassName
      , "str",  ""		     ; WindowName
      , "Uint", WS_CLIPCHILDREN | WS_CHILD | WS_VISIBLE | hStyle
      , "int",  X            ; Left
      , "int",  Y            ; Top
      , "int",  W            ; Width
      , "int",  H            ; Height
      , "Uint", HParent      ; hWndParent
      , "Uint", MODULEID	 ; hMenu
      , "Uint", 0            ; hInstance
      , "Uint", 0, "Uint")

Two examples, second one came when trying to reproduce first
Need to look into it further
Example 1: Comments are stripped

When return variables are removed comments are still missing

Banaanae added a commit that referenced this issue Oct 3, 2024
added f tests for #294 #295 #296 #298 #299 #300 #301
cleanup return tests
@Banaanae
Copy link
Collaborator Author

Banaanae commented Oct 8, 2024

, "str", "" causes issues in the second example

Banaanae added a commit that referenced this issue Nov 5, 2024
see #296 comments for info
@Banaanae Banaanae changed the title Contiuation DllCall issues Contiuation strips or places comments in wrong spot Nov 5, 2024
@Banaanae
Copy link
Collaborator Author

Banaanae commented Nov 5, 2024

Issues with large portions of code going missing are now fixed

Comments in continuations face 1 of 2 issues

var := "line 1" ; comment 1
    . "line 2" ; comment 2
; -> converts to ->
var := "line 1"
    . "line 2" ; comment 1

The converter treats above as one line (rather than 2, this is intended behaviour)
Fix would likely be

; Store comment in map
; line comment is on: comment

; restore once line conversion is done

Same issue with function continuations but they are stripped instead
Maybe same fix as above?

@Banaanae Banaanae changed the title Contiuation strips or places comments in wrong spot Continuation strips or places comments in wrong spot Jan 18, 2025
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

No branches or pull requests

1 participant