diff options
author | Marc Laukien <marc@zeroc.com> | 2003-12-04 21:39:25 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2003-12-04 21:39:25 +0000 |
commit | 869eedff41e8bfde5afc6020b46bc3426cdd1d1e (patch) | |
tree | 01fa181261a1352bbb8b66368e2825cee1f66663 /cpp | |
parent | Replaced exit by _exit before fork an exec (diff) | |
download | ice-869eedff41e8bfde5afc6020b46bc3426cdd1d1e.tar.bz2 ice-869eedff41e8bfde5afc6020b46bc3426cdd1d1e.tar.xz ice-869eedff41e8bfde5afc6020b46bc3426cdd1d1e.zip |
floating constant fixes
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Slice/Scanner.l | 4 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/ConstDef.err | 42 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/ConstDef.ice | 24 |
3 files changed, 47 insertions, 23 deletions
diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 1c00d815e6e..7bf294dd4c2 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -56,9 +56,9 @@ int checkKeyword(string&); identifier \\?[[:alpha:]_][[:alnum:]_]* integer_constant (\+|-)?((0[0-7]+)|(0x[[:xdigit:]]+)|([[:digit:]]+)) -fractional_constant ([[:digit:]]*\.[[:digit:]]+)|([[:digit:]]+\.) +fractional_constant (\+|-)?(([[:digit:]]*\.[[:digit:]]+)|([[:digit:]]+\.)) exponent_part (e|E)(\+|-)?[[:digit:]]+ -floating_literal (({fractional_constant}{exponent_part}?)|([[:digit:]]+{exponent_part}))[fF]? +floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{exponent_part}))[fF]? %% diff --git a/cpp/test/Slice/errorDetection/ConstDef.err b/cpp/test/Slice/errorDetection/ConstDef.err index 20a82b3dec4..27d7bcafe9e 100644 --- a/cpp/test/Slice/errorDetection/ConstDef.err +++ b/cpp/test/Slice/errorDetection/ConstDef.err @@ -1,21 +1,21 @@ -ConstDef.ice:51: `XXX' is not defined -ConstDef.ice:52: redefinition of constant `f11' as constant -ConstDef.ice:53: constant `F10' differs only in capitalization from constant `f10' -ConstDef.ice:56: constant `ic2' has illegal type -ConstDef.ice:57: constant `ic3' has illegal type: `Object' -ConstDef.ice:59: initializer of type `long' is incompatible with the type `bool' of constant `ic4' -ConstDef.ice:60: initializer of type `string' is incompatible with the type `byte' of constant `ic5' -ConstDef.ice:61: initializer of type `double' is incompatible with the type `short' of constant `ic6' -ConstDef.ice:62: type of initializer is incompatible with the type `int' of constant `ic7' -ConstDef.ice:63: initializer of type `bool' is incompatible with the type `long' of constant `ic8' -ConstDef.ice:65: missing constant name -ConstDef.ice:68: enumerator `two' is not defined in enumeration `::color' -ConstDef.ice:69: type of initializer is incompatible with the type of constant `ic10' -ConstDef.ice:85: integer constant `-9223372036854775809' out of range -ConstDef.ice:86: integer constant `+9223372036854775808' out of range -ConstDef.ice:90: initializer `-2147483649' for constant `i3' out of range for type int -ConstDef.ice:91: initializer `2147483648' for constant `i4' out of range for type int -ConstDef.ice:95: initializer `-32769' for constant `s3' out of range for type short -ConstDef.ice:96: initializer `32768' for constant `s4' out of range for type short -ConstDef.ice:100: initializer `-1' for constant `b3' out of range for type byte -ConstDef.ice:101: initializer `256' for constant `b4' out of range for type byte +ConstDef.ice:75: `XXX' is not defined +ConstDef.ice:76: redefinition of constant `f11' as constant +ConstDef.ice:77: constant `F10' differs only in capitalization from constant `f10' +ConstDef.ice:80: constant `ic2' has illegal type +ConstDef.ice:81: constant `ic3' has illegal type: `Object' +ConstDef.ice:83: initializer of type `long' is incompatible with the type `bool' of constant `ic4' +ConstDef.ice:84: initializer of type `string' is incompatible with the type `byte' of constant `ic5' +ConstDef.ice:85: initializer of type `double' is incompatible with the type `short' of constant `ic6' +ConstDef.ice:86: type of initializer is incompatible with the type `int' of constant `ic7' +ConstDef.ice:87: initializer of type `bool' is incompatible with the type `long' of constant `ic8' +ConstDef.ice:89: missing constant name +ConstDef.ice:92: enumerator `two' is not defined in enumeration `::color' +ConstDef.ice:93: type of initializer is incompatible with the type of constant `ic10' +ConstDef.ice:109: integer constant `-9223372036854775809' out of range +ConstDef.ice:110: integer constant `+9223372036854775808' out of range +ConstDef.ice:114: initializer `-2147483649' for constant `i3' out of range for type int +ConstDef.ice:115: initializer `2147483648' for constant `i4' out of range for type int +ConstDef.ice:119: initializer `-32769' for constant `s3' out of range for type short +ConstDef.ice:120: initializer `32768' for constant `s4' out of range for type short +ConstDef.ice:124: initializer `-1' for constant `b3' out of range for type byte +ConstDef.ice:125: initializer `256' for constant `b4' out of range for type byte diff --git a/cpp/test/Slice/errorDetection/ConstDef.ice b/cpp/test/Slice/errorDetection/ConstDef.ice index 34f68db93da..e82b9f9c0ea 100644 --- a/cpp/test/Slice/errorDetection/ConstDef.ice +++ b/cpp/test/Slice/errorDetection/ConstDef.ice @@ -48,6 +48,30 @@ const float f9 = 1E+1; const float f10 = 1E+1f; const float f11 = 1E1F; +const float pf1 = +.1; +const float pf2 = +1.1; +const float pf3 = +1.; +const float pf4 = +.1e1; +const float pf5 = +1.E1; +const float pf6 = +1.1e+1; +const float pf7 = +1.1e-1; +const float pf8 = +1e-1; +const float pf9 = +1E+1; +const float pf10 = +1E+1f; +const float pf11 = +1E1F; + +const float nf1 = -.1; +const float nf2 = -1.1; +const float nf3 = -1.; +const float nf4 = -.1e1; +const float nf5 = -1.E1; +const float nf6 = -1.1e+1; +const float nf7 = -1.1e-1; +const float nf8 = -1e-1; +const float nf9 = -1E+1; +const float nf10 = -1E+1f; +const float nf11 = -1E1F; + const XXX ic1 = 1; // no such type const long f11 = 1; // redifinition const long F10 = 1; // case-insensitive redefinition |