Fresh IDE . Check-in [edecd1bc56]
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Procedure arguments hint support for OOP method calls. It needs update of the OOP macro library as well. Fixed small bug in PAHint.asm;
Timelines: family | ancestors | OOP_PAHint
Files: files | file ages | folders
SHA1:edecd1bc56344472c1b38bcab63de28d54a43b7f
User & Date: johnfound 2017-12-07 08:44:43
Context
2017-12-07
08:44
Procedure arguments hint support for OOP method calls. It needs update of the OOP macro library as well. Fixed small bug in PAHint.asm; Leaf check-in: edecd1bc56 user: johnfound tags: OOP_PAHint
2017-12-04
19:25
The stylesheets for the help, as external file. This actually was a bug. check-in: 84b51549b7 user: johnfound tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to source/PAHint.asm.

1
2
3
4
5
6
7

8

9
10
11
12
13
14
15
...
251
252
253
254
255
256
257





258
















259
260
261
262
263
264
265
...
272
273
274
275
276
277
278





279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295






296

297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
...
382
383
384
385
386
387
388

389
390
391
392
393
394
395
; checks for procedure call on current line of text and then shows a hint window with
; procedure definition line (if available)

cCallStdCall text 'stdcall'
cCallCCall   text 'ccall'
cCallInvoke  text 'invoke'
cCallCInvoke text 'cinvoke'

cProcName    text 'proc '


iglobal
  cPAFontName du 'Trebuchet MS', 0
endg


uglobal
................................................................................
        stdcall StrPos, esi, cCallCInvoke
        test    eax, eax
        jnz     .found

        mov     ebx, cCallStdCall.length
        stdcall StrPos, esi, cCallStdCall
        test    eax, eax





        jz      .notfound

















; search the name of the procedure
.found:
        lea     esi, [eax + ebx]

.loop:
        inc     esi
................................................................................
        mov     ebx, esi        ; begin of the name.

.endloop:
        inc     esi
        mov     al, [esi]
        cmp     al, 0
        je      .endfound






        cmp     al, ','
        je      .endfound

        cmp     al, ' '
        jne     .endloop

.endfound:
        mov     [.begarg], esi
        pushd   [esi]
        popd    [.save]
        mov     byte [esi], 0

        mov     edi, [ptrPreprocessed]
        test    edi, edi
        jz      .notfound







        stdcall SearchTreeExact, ebx, ptrLabels

        test    eax, eax
        jz      .notfound

        push    eax
        stdcall StrCat, [.arg], ebx

        mov     eax, [.save]
        mov     [esi], eax
        pop     esi             ; esi - pointer to TLabel with the procedure label.

        mov     esi, [esi+TLabel.Children]
        test    esi, esi
        jz      .endsearch

        mov     edi, [esi+TArray.count]
        lea     esi, [esi+TArray.array]
................................................................................
        cmp     al, ah
        je      .commaloop
        cmp     esi, ebx
        jb      .quoteloop

.endcount:
        invoke  SetWindowLongW, [hPAHint], GWL_USERDATA, ecx


locals
  .info   MONITORINFO
  .height dd ?
endl
; then set the possition
  ; first, compute the size of the window.







>

>







 







>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>









<
<
<





>
>
>
>
>
>

>



<
<
<
|
<
<







 







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
...
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
...
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315



316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331



332


333
334
335
336
337
338
339
...
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
; checks for procedure call on current line of text and then shows a hint window with
; procedure definition line (if available)

cCallStdCall text 'stdcall'
cCallCCall   text 'ccall'
cCallInvoke  text 'invoke'
cCallCInvoke text 'cinvoke'
cExecMethod  text 'exec'
cProcName    text 'proc '
cMethName    text 'method '

iglobal
  cPAFontName du 'Trebuchet MS', 0
endg


uglobal
................................................................................
        stdcall StrPos, esi, cCallCInvoke
        test    eax, eax
        jnz     .found

        mov     ebx, cCallStdCall.length
        stdcall StrPos, esi, cCallStdCall
        test    eax, eax
        jnz     .found

        mov     ebx, cExecMethod.length
        stdcall StrPos, esi, cExecMethod
        test    eax, eax
        jz      .notfound

; found object method call:

        push    eax
        stdcall StrDel, [.arg]
        stdcall StrDup, cMethName
        mov     [.arg], eax
        pop     eax

.skipobj:
        cmp     byte [eax+ebx], 0
        je      .notfound

        cmp     byte [eax+ebx], ','
        lea     ebx, [ebx+1]
        jne     .skipobj

; search the name of the procedure
.found:
        lea     esi, [eax + ebx]

.loop:
        inc     esi
................................................................................
        mov     ebx, esi        ; begin of the name.

.endloop:
        inc     esi
        mov     al, [esi]
        cmp     al, 0
        je      .endfound

        cmp     al, ':'
        jne     @f
        mov     byte [esi], '.'
@@:

        cmp     al, ','
        je      .endfound

        cmp     al, ' '
        jne     .endloop

.endfound:
        mov     [.begarg], esi




        mov     edi, [ptrPreprocessed]
        test    edi, edi
        jz      .notfound

        sub     esi, ebx
        stdcall StrExtract, ebx, 0, esi
        mov     ebx, eax

        stdcall StrCat, [.arg], ebx

        stdcall SearchTreeExact, ebx, ptrLabels
        stdcall StrDel, ebx
        test    eax, eax
        jz      .notfound




        mov     esi, eax



        mov     esi, [esi+TLabel.Children]
        test    esi, esi
        jz      .endsearch

        mov     edi, [esi+TArray.count]
        lea     esi, [esi+TArray.array]
................................................................................
        cmp     al, ah
        je      .commaloop
        cmp     esi, ebx
        jb      .quoteloop

.endcount:
        invoke  SetWindowLongW, [hPAHint], GWL_USERDATA, ecx


locals
  .info   MONITORINFO
  .height dd ?
endl
; then set the possition
  ; first, compute the size of the window.