summaryrefslogtreecommitdiff
path: root/src/cmd/gc/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/gc/lex.c')
-rw-r--r--src/cmd/gc/lex.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c
index f818a641f..126a201d6 100644
--- a/src/cmd/gc/lex.c
+++ b/src/cmd/gc/lex.c
@@ -742,6 +742,8 @@ dc:
goto casedot;
if(c == 'e' || c == 'E')
goto casee;
+ if(c == 'p' || c == 'P')
+ goto casep;
ncu:
*cp = 0;
@@ -780,6 +782,22 @@ casee:
*cp++ = c;
c = getc();
}
+ goto caseout;
+
+casep:
+ *cp++ = 'p';
+ c = getc();
+ if(c == '+' || c == '-') {
+ *cp++ = c;
+ c = getc();
+ }
+ if(!isdigit(c))
+ yyerror("malformed fp constant exponent");
+ while(isdigit(c)) {
+ *cp++ = c;
+ c = getc();
+ }
+ goto caseout;
caseout:
*cp = 0;