Allow consecutives '_' in VST identifiers. Replace '/' by '_'.

This commit is contained in:
Jean-Paul Chaput 2020-09-30 17:15:14 +02:00
parent 3495536268
commit 9d56066c2d
2 changed files with 5 additions and 4 deletions

View File

@ -228,7 +228,7 @@ base_specifier (B|b|O|o|X|x)
\. { return Dot; }
\/ { return Slash; }
{letter}(_?{letter_or_digit})* {
{letter}(_|{letter_or_digit})* {
char keyword[512];
strncpy( keyword, yytext, 511 );
lower( keyword );

View File

@ -1,14 +1,14 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC 2008-2018, All Rights Reserved
// Copyright (c) UPMC 2008-2020, All Rights Reserved
//
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | Alliance / Hurricane Interface |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== |
// | C++ Module : "./toolbox/ToVhdlName.h" |
// +-----------------------------------------------------------------+
@ -72,6 +72,7 @@ namespace CRL {
vhdlName += 'n';
if (translated == '\\') translated = '_';
if (translated == '/' ) translated = '_';
if (translated == '.' ) translated = '_';
if (translated == '%' ) translated = '_';
if (translated == '$' ) translated = '_';
@ -83,7 +84,7 @@ namespace CRL {
if (translated == '_') {
if (vhdlName.empty() ) continue;
if (i == refName.size()-1) break;
if (vhdlName.back() == '_') continue;
//if (vhdlName.back() == '_') continue;
}
vhdlName += translated;