unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Philipp Stephani <phst@google.com>, Eli Zaretskii <eliz@gnu.org>,
	emacs-devel@gnu.org, "wsnyder@wsnyder.org" <wsnyder@wsnyder.org>
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	[thread overview]
Message-ID: <CAFyQvY2hxtWiJVHPstuHit5pEohuenRdpUy6MKPB_Py=kF9Muw@mail.gmail.com> (raw)
In-Reply-To: CAFyQvY2WJGfSRur-7xFnMXOKh93xswszp4RM23wVwCi8o=w2Mw@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 2801 bytes --]

On Fri, May 5, 2017 at 3:49 PM Kaushal Modi <kaushal.modi@gmail.com> 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

[-- Attachment #2: Type: text/html, Size: 4683 bytes --]

  reply	other threads:[~2017-05-05 20:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 14:38 "unescaped character literals detected" Eli Zaretskii
2017-05-05 19:49 ` Kaushal Modi
2017-05-05 20:00   ` Kaushal Modi [this message]
2017-05-05 20:02     ` Help fix unescaped character literals detected warnings in verilog-mode (Was: Re: "unescaped character literals detected") Philipp Stephani
2017-05-05 20:14       ` Kaushal Modi
2017-05-05 21:35         ` Philipp Stephani
2017-05-07 12:36           ` Philipp Stephani
2017-05-07 12:48             ` Kaushal Modi
2017-05-07 16:36             ` Eli Zaretskii
2017-05-05 20:33     ` Help fix unescaped character literals detected warnings in verilog-mode Stefan Monnier
2017-05-06 22:44       ` Richard Stallman
2017-05-13 10:31         ` Philipp Stephani
2017-05-05 20:04   ` "unescaped character literals detected" Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFyQvY2hxtWiJVHPstuHit5pEohuenRdpUy6MKPB_Py=kF9Muw@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=phst@google.com \
    --cc=wsnyder@wsnyder.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).