Browse Source

* support ranges in case-options of variant records

git-svn-id: trunk@5553 -
Jonas Maebe 18 years ago
parent
commit
72c7d5b6c0
3 changed files with 17 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 2 0
      compiler/pdecvar.pas
  3. 14 0
      tests/tbs/tb0516.pp

+ 1 - 0
.gitattributes

@@ -6197,6 +6197,7 @@ tests/tbs/tb0512.pp svneol=native#text/plain
 tests/tbs/tb0513.pp svneol=native#text/plain
 tests/tbs/tb0514.pp svneol=native#text/plain
 tests/tbs/tb0515.pp svneol=native#text/plain
+tests/tbs/tb0516.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 2 - 0
compiler/pdecvar.pas

@@ -1315,6 +1315,8 @@ implementation
                   pt:=comp_expr(true);
                   if not(pt.nodetype=ordconstn) then
                     Message(parser_e_illegal_expression);
+                  if try_to_consume(_POINTPOINT) then
+                    pt:=crangenode.create(pt,comp_expr(true));
                   pt.free;
                   if token=_COMMA then
                     consume(_COMMA)

+ 14 - 0
tests/tbs/tb0516.pp

@@ -0,0 +1,14 @@
+{$mode delphi}
+
+type
+  ta = (ea,eb);
+  tb = (e1,e2);
+  tr = record
+    case a: byte of
+      -1,'c'..ea,e2..-5: (l: longint);
+      'b'..eb,-1,-1,-1..-38,-100..e2: (c: cardinal);
+  end;
+
+begin
+end.
+