# HG changeset patch # User unc0rr # Date 1322252555 -10800 # Node ID 2d44f6561e723b11e97be509f629e3774513ab14 # Parent 1ef4192aa80de7f96a093a2ca703b3bec35c99e7 Help parser a bit diff -r 1ef4192aa80d -r 2d44f6561e72 hedgewars/ArgParsers.inc --- a/hedgewars/ArgParsers.inc Fri Nov 25 18:36:12 2011 +0300 +++ b/hedgewars/ArgParsers.inc Fri Nov 25 23:22:35 2011 +0300 @@ -159,7 +159,7 @@ recordFileName:= ParamStr(3); paramIndex:= 4; wrongParameter:= false; - while (paramIndex <= ParamCount) and not wrongParameter do + while (paramIndex <= ParamCount) and (not wrongParameter) do begin if ParamStr(paramIndex) = '--set-video' then //--set-video [screen width] [screen height] [color dept] diff -r 1ef4192aa80d -r 2d44f6561e72 hedgewars/uTypes.pas --- a/hedgewars/uTypes.pas Fri Nov 25 18:36:12 2011 +0300 +++ b/hedgewars/uTypes.pas Fri Nov 25 23:22:35 2011 +0300 @@ -256,7 +256,7 @@ PortalCounter: LongWord; // Hopefully temporary, but avoids infinite portal loops in a guaranteed fashion. LastDamage: PHedgehog; end; - TPGearArray = Array of PGear; + TPGearArray = array of PGear; PVisualGear = ^TVisualGear; TVGearStepProcedure = procedure (Gear: PVisualGear; Steps: Longword); @@ -324,7 +324,7 @@ THHAmmo = array[0..cMaxSlotIndex, 0..cMaxSlotAmmoIndex] of TAmmo; THedgehog = record - Name: string[MAXNAMELEN]; + Name: string[192]; Gear: PGear; GearHidden: PGear; SpeechGear: PVisualGear; @@ -345,12 +345,12 @@ King: boolean; // Flag for a bunch of hedgehog attributes Unplaced: boolean; // Flag for hog placing mode Timer: Longword; - Effects: Array[THogEffect] of boolean; + Effects: array[THogEffect] of boolean; end; TTeam = record Clan: PClan; - TeamName: string[MAXNAMELEN]; + TeamName: string[192]; ExtDriven: boolean; Binds: TBinds; Hedgehogs: array[0..cMaxHHIndex] of THedgehog; diff -r 1ef4192aa80d -r 2d44f6561e72 hedgewars/uVariables.pas --- a/hedgewars/uVariables.pas Fri Nov 25 18:36:12 2011 +0300 +++ b/hedgewars/uVariables.pas Fri Nov 25 23:22:35 2011 +0300 @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA *) -{$INCLUDE options.inc} +{$INCLUDE "options.inc"} unit uVariables; interface @@ -264,7 +264,7 @@ ); SpritesData: array[TSprite] of record - FileName: String[16]; + FileName: string[16]; Path, AltPath: TPathType; Texture: PTexture; Surface: PSDL_Surface; @@ -635,7 +635,7 @@ Sprite: TSprite; FramesCount: Longword; Interval: Longword; - cmd: String[20]; + cmd: string[20]; Voice: TSound; VoiceDelay: LongWord; end = ( @@ -649,7 +649,7 @@ ); Soundz: array[TSound] of record - FileName: String[25]; + FileName: string[25]; Path : TPathType; end = ( (FileName: ''; Path: ptNone ),// sndNone diff -r 1ef4192aa80d -r 2d44f6561e72 tools/PascalParser.hs --- a/tools/PascalParser.hs Fri Nov 25 18:36:12 2011 +0300 +++ b/tools/PascalParser.hs Fri Nov 25 23:22:35 2011 +0300 @@ -204,16 +204,19 @@ optional $ (try $ string "packed") >> comments string "array" comments - r <- optionMaybe $ do + r <- option [] $ do char '[' - r <- rangeDecl + r <- commaSep pas rangeDecl char ']' comments return r string "of" comments t <- typeDecl - return $ ArrayDecl r t + if null r then + return $ ArrayDecl Nothing t + else + return $ foldr (\a b -> ArrayDecl (Just a) b) (ArrayDecl (Just $ head r) t) (tail r) recordDecl = do try $ do optional $ (try $ string "packed") >> comments