Explorar el Código

+ also support & to escape identifiers (and for octal notation) in Delplhi
mode (patch by Blaise Thorn, mantis #15930)

git-svn-id: trunk@15031 -

Jonas Maebe hace 15 años
padre
commit
87c9773ac0
Se han modificado 3 ficheros con 18 adiciones y 1 borrados
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/scanner.pas
  3. 16 0
      tests/webtbs/tw15930.pp

+ 1 - 0
.gitattributes

@@ -10317,6 +10317,7 @@ tests/webtbs/tw15777f.pp svneol=native#text/plain
 tests/webtbs/tw15812.pp svneol=native#text/plain
 tests/webtbs/tw15909.pp svneol=native#text/plain
 tests/webtbs/tw1592.pp svneol=native#text/plain
+tests/webtbs/tw15930.pp svneol=native#text/plain
 tests/webtbs/tw1617.pp svneol=native#text/plain
 tests/webtbs/tw1622.pp svneol=native#text/plain
 tests/webtbs/tw1623.pp svneol=native#text/plain

+ 1 - 1
compiler/scanner.pas

@@ -3494,7 +3494,7 @@ In case not, the value returned can be arbitrary.
 
              '&' :
                begin
-                 if m_fpc in current_settings.modeswitches then
+                 if [m_fpc,m_delphi] * current_settings.modeswitches <> [] then
                   begin
                     readnumber;
                     if length(pattern)=1 then

+ 16 - 0
tests/webtbs/tw15930.pp

@@ -0,0 +1,16 @@
+{ %norun }
+
+{$mode delphi}
+
+var
+  &file: integer;
+  &do: string;
+  &in: boolean;
+  &for: char;
+begin
+  &file:=1;
+  &do:='abc';
+  &in:=true;
+  &for:='h'
+end.
+