consider the first letter

This commit is contained in:
rlar 2012-04-12 22:23:46 +02:00
parent 4ba8ef34f0
commit 570bb98061
2 changed files with 20 additions and 4 deletions

View File

@ -177,9 +177,20 @@ struct admsaux {
int n_admsaux;
struct admsaux *a_admsaux;
unsigned int adms_candidates;
void
mark_adms_candidates(char c)
{
if('A' <= c && c <= 'Z')
adms_candidates |= (1 << (c - 'A'));
}
void
mark_adms(int type)
{
mark_adms_candidates('U');
if(type >= n_admsaux) {
int i;
a_admsaux = TREALLOC(struct admsaux, a_admsaux, type+1);

View File

@ -96,6 +96,14 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task)
if(islower(c))
c = (char) toupper(c);
extern unsigned int adms_candidates;
if('A' <= c && c <= 'Z' &&
((adms_candidates >> (c - 'A')) & 1) &&
INP2tryadms(ckt, tab, current)) {
INP2tryadms_do(ckt, tab, current);
continue;
}
switch (c) {
case ' ':
@ -223,10 +231,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task)
case 'U':
/* Uname <node> <node> <model> [l=<val>] [n=<val>] */
if(INP2tryadms(ckt, tab, current))
INP2tryadms_do(ckt, tab, current);
else
INP2U(ckt, tab, current);
INP2U(ckt, tab, current);
break;
/* Kspice addition - saj */