From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Help fix unescaped character literals detected warnings in verilog-mode (Was: Re: "unescaped character literals detected") Date: Fri, 05 May 2017 20:00:23 +0000 Message-ID: References: <834lx0hekg.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11402d9c98603b054ecc576f X-Trace: blaine.gmane.org 1494014480 32355 195.159.176.226 (5 May 2017 20:01:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 5 May 2017 20:01:20 +0000 (UTC) To: Philipp Stephani , Eli Zaretskii , emacs-devel@gnu.org, "wsnyder@wsnyder.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 05 22:01:15 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6jPf-0008Ih-9r for ged-emacs-devel@m.gmane.org; Fri, 05 May 2017 22:01:15 +0200 Original-Received: from localhost ([::1]:48759 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6jPk-0004so-OD for ged-emacs-devel@m.gmane.org; Fri, 05 May 2017 16:01:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6jP3-0004sf-Th for emacs-devel@gnu.org; Fri, 05 May 2017 16:00:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6jP2-0005Oo-Uk for emacs-devel@gnu.org; Fri, 05 May 2017 16:00:38 -0400 Original-Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:36781) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d6jP0-0005O5-Vk; Fri, 05 May 2017 16:00:35 -0400 Original-Received: by mail-lf0-x22c.google.com with SMTP id h4so9027592lfj.3; Fri, 05 May 2017 13:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:from:date:message-id:subject:to; bh=KJlD3jpYyI2jrV0qw1wskb3LwPhX1iQgqj9BO+9OzLQ=; b=AFGL4k27YYRDh0Stecb/WuReg/Y8RijRxAIqkrILhW41OYauBLGkkZyO3as87eBZ4I jjj+QApKA7Q0jeZ8s4FQjfDoQzQJE++0cKTcms6bi8sENK9gdPQMp7S68RraVdhelAAW 4TdKpCMwSGTwckK/GACgyPhQrk/chm1QJMVjFjlrGAMQdVQALySAFU1+hTWc6HaOFEM3 z9mochyljJAluiIran/EX3Xrf1CsiidZWzSYp+KmG/6qnrn8WguC9l1m4QbY+x+z5N9A KK7zLMRCuBDh/yqrCnmPlaofP3WQcr+eKkcli6v9oktraJ7UX6W0qr6TBRbCcecj7nXr 09Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:from:date:message-id :subject:to; bh=KJlD3jpYyI2jrV0qw1wskb3LwPhX1iQgqj9BO+9OzLQ=; b=LedYC6nw68zIyOjnHpspytbtcphy1WmxiWDITWWrnhpDLupKVvy6+l0dX+F5nhCW1O 4OPpCqRfBNdNjOIA3JvSB7rC6SIqbOYEFGnvgISIkQf3GSjscih404Qvu+dwpH+AGfZ7 XipY+60KGuldXcbAm0+kzsPwVW1iYgGeagALGXlc7NNl8kT3nNzFwb3cR3fxwXAwSS0T Iq4rIQqMV59w4jw30Gaz+g8sWpEjWs/5ommAqRWuAEglFGRn8VU1Yrp72PwKrUti1ZGl gKsNOg2kty7Gbej6cvVAzfKbb2Q2GK5keWV99R6BypL9ZAChlxoJfcIED/L5VWTLTYPe 1OKQ== X-Gm-Message-State: AODbwcAfabfjGFNP5Gk4g9ljuFIjRU0lGPDTtyzcqHHZJrO5o7nJFraP /HggC4dAIMjXH6h9sunuozPylp2INA== X-Received: by 10.25.16.219 with SMTP id 88mr648627lfq.134.1494014433449; Fri, 05 May 2017 13:00:33 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214584 Archived-At: --001a11402d9c98603b054ecc576f Content-Type: text/plain; charset=UTF-8 On Fri, May 5, 2017 at 3:49 PM Kaushal Modi wrote: > verilog-mode.el has 14.5k lines. It would be very helpful to print the > line number where unescapted character literals are detected so that I can > attempt to fix it. > A quick followup: I byte-compiled verilog-mode.el, and it throws these warnings: verilog-mode.el:14003:1:Warning: unescaped character literals ; detected! verilog-mode.el:14013:1:Warning: unescaped character literals ; detected! verilog-mode.el:14205:1:Warning: unescaped character literals ; detected! I believe that the compiler does not like lines like > "task " '(verilog-sk-prompt-name) & ?; \n Changing that to the below fixes the warning: > "task " '(verilog-sk-prompt-name) & \?; \n But I am not familiar with the define-skeleton syntax. Does anyone know if changing "?" to "\?" in the below 3 instances of skeleton definitions would be fine? On line 14003, there is: (define-skeleton verilog-sk-task "Insert a task definition." () > "task " '(verilog-sk-prompt-name) & ?; \n > _ \n > "begin" \n > \n > (- verilog-indent-level-behavioral) "end" \n > (- verilog-indent-level-behavioral) "endtask" (progn (electric-verilog-terminate-line) nil)) On line 14013, there is: (define-skeleton verilog-sk-function "Insert a function definition." () > "function [" '(verilog-sk-prompt-width) | -1 '(verilog-sk-prompt-name) ?; \n > _ \n > "begin" \n > \n > (- verilog-indent-level-behavioral) "end" \n > (- verilog-indent-level-behavioral) "endfunction" (progn (electric-verilog-terminate-line) nil)) On line 14205, there is: (define-skeleton verilog-sk-state-machine "Insert a state machine definition." "Name of state variable: " '(setq input "state") > "// State registers for " str | -23 \n '(setq verilog-sk-state str) > "reg [" '(verilog-sk-prompt-width) | -1 verilog-sk-state ", next_" verilog-sk-state ?; \n '(setq input nil) > \n > "// State FF for " verilog-sk-state \n > "always @ ( " (read-string "clock:" "posedge clk") " or " (verilog-sk-prompt-reset) " ) begin" \n > "if ( " verilog-sk-reset " ) " verilog-sk-state " = 0; else" \n > verilog-sk-state " = next_" verilog-sk-state ?; \n > (- verilog-indent-level-behavioral) "end" (progn (electric-verilog-terminate-line) nil) > \n > "// Next State Logic for " verilog-sk-state \n > "always @ ( /*AUTOSENSE*/ ) begin\n" > "case (" '(verilog-sk-prompt-state-selector) ") " \n > ("case selector: " str ": begin" \n > "next_" verilog-sk-state " = " _ ";" \n > (- verilog-indent-level-behavioral) "end" \n ) resume: > (- verilog-case-indent) "endcase" (progn (electric-verilog-terminate-line) nil) > (- verilog-indent-level-behavioral) "end" (progn (electric-verilog-terminate-line) nil)) -- Kaushal Modi --001a11402d9c98603b054ecc576f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, May 5,= 2017 at 3:49 PM Kaushal Modi <kaushal.modi@gmail.com> wrote:
verilog-mo= de.el has 14.5k lines. It would be very helpful to print the line number wh= ere unescapted character literals are detected so that I can attempt to fix= it.

A quick followup:

I byte-compiled verilog-mode.el, and it throws these= warnings:

verilog-mode.el:14003:1:Warning: unesca= ped character literals ; detected!
verilog-mode.el:14013:1:Warnin= g: unescaped character literals ; detected!
verilog-mode.el:14205= :1:Warning: unescaped character literals ; detected!

I believe that the compiler does not like lines like=C2=A0
> "task " '(verilog-sk-prompt-name) & ?; \= n

Changing that to the below fixes the warning= :

> "task " '(verilog-sk-pro= mpt-name) & \?; \n


But I am not familiar with the define-sk= eleton syntax. Does anyone know if changing "?" to "\?"= in the below 3 instances of skeleton definitions would be fine?
=

On line 14003, there is:

(define-skeleton verilog-sk-task
=C2=A0 "Insert a task= definition."
=C2=A0 ()
=C2=A0 > "task &qu= ot; '(verilog-sk-prompt-name) & ?; \n
=C2=A0 > _ \n
=C2=A0 > "begin" \n
=C2=A0 > \n
=C2=A0 > (- verilog-indent-level-behavioral) "end" \n
=C2=A0 > (- verilog-indent-level-behavioral) "endtask" (pro= gn (electric-verilog-terminate-line) nil))

On= line 14013, there is:

(define-skeleton verilog-sk-function
=C2=A0 "= ;Insert a function definition."
=C2=A0 ()
=C2=A0 &= gt; "function [" '(verilog-sk-prompt-width) | -1 '(verilo= g-sk-prompt-name) ?; \n
=C2=A0 > _ \n
=C2=A0 > &q= uot;begin" \n
=C2=A0 > \n
=C2=A0 > (- verilo= g-indent-level-behavioral) "end" \n
=C2=A0 > (- veri= log-indent-level-behavioral) "endfunction" (progn (electric-veril= og-terminate-line) nil))

On line 14205, ther= e is:

(define-skeleton verilog-sk-state-machi= ne
=C2=A0 "Insert a state machine definition."
=C2=A0 "Name of state variable: "
=C2=A0 '(setq i= nput "state")
=C2=A0 > "// State registers for = " str | -23 \n
=C2=A0 '(setq verilog-sk-state str)
=
=C2=A0 > "reg [" '(verilog-sk-prompt-width) | -1 veri= log-sk-state ", next_" verilog-sk-state ?; \n
=C2=A0 &#= 39;(setq input nil)
=C2=A0 > \n
=C2=A0 > "//= State FF for " verilog-sk-state \n
=C2=A0 > "always= @ ( " (read-string "clock:" "posedge clk") "= or " (verilog-sk-prompt-reset) " ) begin" \n
=C2= =A0 > "if ( " verilog-sk-reset " ) " verilog-sk-stat= e " =3D 0; else" \n
=C2=A0 > verilog-sk-state "= =3D next_" verilog-sk-state ?; \n
=C2=A0 > (- verilog-in= dent-level-behavioral) "end" (progn (electric-verilog-terminate-l= ine) nil)
=C2=A0 > \n
=C2=A0 > "// Next Stat= e Logic for " verilog-sk-state \n
=C2=A0 > "always @= ( /*AUTOSENSE*/ ) begin\n"
=C2=A0 > "case (" &= #39;(verilog-sk-prompt-state-selector) ") " \n
=C2=A0 &= gt; ("case selector: " str ": begin" \n > "next= _" verilog-sk-state " =3D " _ ";" \n > (- veril= og-indent-level-behavioral) "end" \n )
=C2=A0 resume: &= gt; =C2=A0(- verilog-case-indent) "endcase" (progn (electric-veri= log-terminate-line) nil)
=C2=A0 > (- verilog-indent-level-beha= vioral) "end" (progn (electric-verilog-terminate-line) nil))

--

Kaushal Modi

--001a11402d9c98603b054ecc576f--