Skip to content

Commit 86ae8cf

Browse files
author
_
committed
properly tokenize exponentials
1 parent 866f47f commit 86ae8cf

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

pfa.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,12 +445,17 @@ static void pyformat(FILE *file, FILE *out, struct vlbuf *origfile,
445445
proctok = TOK_EXP;
446446
} else if (lopchar == '/' && nxt == '/') {
447447
} else if (nxt == '=') {
448-
} else {
449-
if (lopchar == '-' || lopchar == '+' || lopchar == '*') {
450-
otok = TOK_UNARYOP;
448+
if (proctok == TOK_EXP) {
449+
proctok = TOK_OPERATOR;
451450
}
452-
if (lopchar == '=' && !isoptype(cur[-2])) {
453-
otok = TOK_EQUAL;
451+
} else {
452+
if (proctok != TOK_EXP) {
453+
if (lopchar == '-' || lopchar == '+' || lopchar == '*') {
454+
otok = TOK_UNARYOP;
455+
}
456+
if (lopchar == '=' && !isoptype(cur[-2])) {
457+
otok = TOK_EQUAL;
458+
}
454459
}
455460
tokfin = 1;
456461
proctok = TOK_INBETWEEN;

0 commit comments

Comments
 (0)