1. insolor
  2. pas2c

Commits

Insolor  committed 6743f0c

Using postfix [256] for string instead of prefix []

  • Participants
  • Parent commits 3903e72
  • Branches default

Comments (0)

Files changed (1)

File pas2c.py

View file
 type_dict = {
   "word":"short int",
   "integer":"int",
-  "string":("char","[]"),
+  "string":("char","","[256]"),
   "real":"float",
   "double":"double",
   "char":"char"
               waiting=tok_alphanumeric
             if token[0]==';' and var_type:
               if type(var_type)==tuple: # "составной" тип, например char[]
-                print(var_type[0], var_type[1]+(', '+var_type[1]).join(var_names)+';')
+                print(var_type[0], var_type[1]+(var_type[2]+', '+var_type[1]).join(var_names)+var_type[2]+';')
               else:
                 print(var_type, ', '.join(var_names)+';')
               var_type=None