@@ -473,7 +473,7 @@ If your provide 0 for COUNT then the entire regex match is returned."
473
473
(let ((pos 0 )
474
474
matches)
475
475
(while (string-match regexp string pos)
476
- (push (match-string count string) matches)
476
+ (push (match-string-no-properties count string) matches)
477
477
(setq pos (match-end 0 )))
478
478
matches)))
479
479
@@ -488,13 +488,16 @@ EVENT is isgnored."
488
488
(matches (solidity--re-matches (format " %s (.*?):.*?\\ ([0-9]+\\ |infinite\\ )" funcname) output 1 ))
489
489
(result (car matches)))
490
490
(kill-buffer buffer)
491
- (if result
491
+ (if ( not result)
492
492
(let* ((clearfilename (file-name-nondirectory filename))
493
493
(ctor-matches (solidity--re-matches (format " =.*?%s :%s .*?= " clearfilename funcname) output 0 )))
494
494
(if ctor-matches
495
- (message " Gas for '%s ' constructor is %s " funcname (car (solidity--re-matches " construction:
495
+ (message " Gas estimate for '%s ' constructor is %s " funcname (car (solidity--re-matches " construction:
496
496
.*?=.*?\\ ([0-9]+\\ |infinite\\ )" output 1 )))
497
- (message " No gas estimate found for '%s ' " funcname)))))))
497
+ ; ;innermost else
498
+ (message " No gas estimate found for '%s ' " funcname)))
499
+ ; ; outermost else
500
+ (message " Gas estimate for '%s ' is %s " funcname result)))))
498
501
499
502
500
503
(defun solidity--start-gasestimate (func )
@@ -508,17 +511,17 @@ Does not currently work for constructors."
508
511
process-name
509
512
(format " *%s * " process-name)
510
513
command)))
511
- (set-process-query-on-exit-flag process nil )
512
- (set-process-sentinel process 'solidity--handle-gasestimate-finish )
513
- (process-put process 'solidity-gasestimate-for-function func)
514
- (process-put process 'solidity-gasestimate-for-filename filename)))
514
+ (set-process-query-on-exit-flag process nil )
515
+ (set-process-sentinel process 'solidity--handle-gasestimate-finish )
516
+ (process-put process 'solidity-gasestimate-for-function func)
517
+ (process-put process 'solidity-gasestimate-for-filename filename)))
515
518
516
519
(defun solidity-estimate-gas-at-point ()
517
520
" Estimate gas of the function at point.
518
521
519
522
Cursor must be at the function's name. Does not currently work for constructors."
520
523
(interactive )
521
- (solidity--start-gasestimate (thing-at-point 'word 'no-properties )))
524
+ (solidity--start-gasestimate (thing-at-point 'symbol 'no-properties )))
522
525
523
526
;;;### autoload
524
527
(define-derived-mode solidity-mode c-mode " solidity"
0 commit comments