2009-04-19 18:07:22 +00:00
#region = = = = = = = = = = = = = = = = = = Copyright ( c ) 2007 Pascal vd Heiden
/ *
* Copyright ( c ) 2007 Pascal vd Heiden , www . codeimp . com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* /
#endregion
#region = = = = = = = = = = = = = = = = = = Namespaces
2014-02-26 14:11:06 +00:00
using System ;
2009-04-19 18:07:22 +00:00
using System.Collections.Generic ;
using System.IO ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
using CodeImp.DoomBuilder.Config ;
2014-11-25 11:52:01 +00:00
using CodeImp.DoomBuilder.Data ;
2009-04-19 18:07:22 +00:00
#endregion
namespace CodeImp.DoomBuilder.ZDoom
{
public sealed class TexturesParser : ZDTextParser
{
#region = = = = = = = = = = = = = = = = = = Delegates
#endregion
#region = = = = = = = = = = = = = = = = = = Constants
#endregion
#region = = = = = = = = = = = = = = = = = = Variables
2014-11-25 11:52:01 +00:00
private readonly Dictionary < string , TextureStructure > textures ;
private readonly Dictionary < string , TextureStructure > flats ;
private readonly Dictionary < string , TextureStructure > sprites ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
private readonly char [ ] pathtrimchars = { '_' , '.' , ' ' , '-' } ; //mxd
2009-04-19 18:07:22 +00:00
#endregion
#region = = = = = = = = = = = = = = = = = = Properties
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
internal override ScriptType ScriptType { get { return ScriptType . TEXTURES ; } } //mxd
2015-12-17 10:07:28 +00:00
public IEnumerable < TextureStructure > Textures { get { return textures . Values ; } }
public IEnumerable < TextureStructure > Flats { get { return flats . Values ; } }
public IEnumerable < TextureStructure > Sprites { get { return sprites . Values ; } }
2009-04-19 18:07:22 +00:00
#endregion
#region = = = = = = = = = = = = = = = = = = Constructor / Disposer
// Constructor
public TexturesParser ( )
{
// Syntax
2013-09-11 09:47:53 +00:00
whitespace = "\n \t\r\u00A0" ; //mxd. non-breaking space is also space :)
2009-04-19 18:07:22 +00:00
specialtokens = ",{}\n" ;
// Initialize
2014-02-26 14:11:06 +00:00
textures = new Dictionary < string , TextureStructure > ( StringComparer . Ordinal ) ;
flats = new Dictionary < string , TextureStructure > ( StringComparer . Ordinal ) ;
sprites = new Dictionary < string , TextureStructure > ( StringComparer . Ordinal ) ;
2009-04-19 18:07:22 +00:00
}
#endregion
#region = = = = = = = = = = = = = = = = = = Parsing
// This parses the given stream
// Returns false on errors
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
public override bool Parse ( TextResourceData data , bool clearerrors )
2009-04-19 18:07:22 +00:00
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
//mxd. Already parsed?
if ( ! base . AddTextResource ( data ) )
{
if ( clearerrors ) ClearError ( ) ;
return true ;
}
// Cannot process?
if ( ! base . Parse ( data , clearerrors ) ) return false ;
2015-03-04 09:37:30 +00:00
//mxd. Make vitrual path from filename
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
string virtualpath ;
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
if ( data . LumpIndex ! = - 1 ) // It's TEXTURES lump
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
virtualpath = data . Filename ;
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
}
else // If it's actual filename, try to use extension(s) as virtualpath
{
Added, Sector Edit window, UDMF: added UI for sector damage-realted properties.
Added, DECORATE parser: damage types are now parsed.
Added: the editor now reports duplicate textures/flats/patches/sprites/colormaps/voxels in the loaded wads.
Added, all text parsers: added #region/#endregion support.
Added TERRAIN parser.
Added, Script Editor: added special handling for DECORATE special comments.
Added, Sector Edit window, UDMF: Soundsequence value was setup incorrectly when showing the window for multiple sectors with mixed Soundsequence value.
Fixed, Map Options window: "Strictly load patches between P_START and P_END" was not applied when applying the changes.
Fixed, MAPINFO parser: MapInfo should be treated as defined when a map MAPINFO block corresponding to current map is encountered even if it doesn't define any properties recognized by the editor.
Fixed, all text parsers: in some cases error line was calculated incorrectly when reporting an error detected by a text parser.
Cosmetic: changed ' to " in the rest of Error and Warning messages.
Internal: added text resource tracking.
Updated ZDoom_DECORATE.cfg.
Updated documentation ("Game Configuration - Basic Settings" page).
2016-02-22 12:33:19 +00:00
virtualpath = Path . GetFileName ( data . Filename ) ;
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
if ( ! string . IsNullOrEmpty ( virtualpath ) ) virtualpath = virtualpath . Substring ( 8 ) . TrimStart ( pathtrimchars ) ;
if ( ! string . IsNullOrEmpty ( virtualpath ) & & virtualpath . ToLowerInvariant ( ) = = "txt" ) virtualpath = string . Empty ;
if ( string . IsNullOrEmpty ( virtualpath ) ) virtualpath = "[TEXTURES]" ;
}
2009-04-19 18:07:22 +00:00
// Continue until at the end of the stream
while ( SkipWhitespace ( true ) )
{
// Read a token
string objdeclaration = ReadToken ( ) ;
2015-06-18 19:45:39 +00:00
if ( ! string . IsNullOrEmpty ( objdeclaration ) )
2009-04-19 18:07:22 +00:00
{
objdeclaration = objdeclaration . ToLowerInvariant ( ) ;
2015-12-17 10:07:28 +00:00
switch ( objdeclaration )
2009-04-19 18:07:22 +00:00
{
2015-12-17 10:07:28 +00:00
case "texture" :
2009-06-08 18:52:56 +00:00
{
2015-12-17 10:07:28 +00:00
// Read texture structure
TextureStructure tx = new TextureStructure ( this , "texture" , virtualpath ) ;
if ( this . HasError ) return false ;
// if a limit for the texture name length is set make sure that it's not exceeded
if ( tx . Name . Length > General . Map . Config . MaxTextureNameLength )
{
ReportError ( "Texture name \"" + tx . Name + "\" too long. Texture names must have a length of " + General . Map . Config . MaxTextureNameLength + " characters or less" ) ;
return false ;
}
//mxd. Can't load image without name
if ( string . IsNullOrEmpty ( tx . Name ) )
{
2015-12-21 14:17:47 +00:00
ReportError ( "Can't load an unnamed texture. Please consider giving names to your resources" ) ;
2015-12-17 10:07:28 +00:00
return false ;
}
2009-06-08 18:52:56 +00:00
// Add the texture
2010-08-18 05:49:15 +00:00
textures [ tx . Name ] = tx ;
2013-07-29 08:50:50 +00:00
if ( ! General . Map . Config . MixTexturesFlats ) flats [ tx . Name ] = tx ; //mxd. If MixTexturesFlats is set, textures and flats will be mixed in DataManager anyway
2009-06-08 18:52:56 +00:00
}
2015-12-17 10:07:28 +00:00
break ;
2009-06-08 18:52:56 +00:00
2015-12-17 10:07:28 +00:00
case "sprite" :
2009-06-08 18:52:56 +00:00
{
2015-12-17 10:07:28 +00:00
// Read sprite structure
TextureStructure tx = new TextureStructure ( this , "sprite" , virtualpath ) ;
if ( this . HasError ) return false ;
2016-04-08 14:02:08 +00:00
//mxd. Sprite name length must be either 6 or 8 chars
if ( tx . Name . Length ! = 6 & & tx . Name . Length ! = 8 )
2015-12-17 10:07:28 +00:00
{
2016-04-08 14:02:08 +00:00
ReportError ( "Sprite name \"" + tx . Name + "\" is incorrect. Sprite names must have a length of 6 or 8 characters" ) ;
2015-12-17 10:07:28 +00:00
return false ;
}
//mxd. Can't load image without name
if ( string . IsNullOrEmpty ( tx . Name ) )
{
2015-12-21 14:17:47 +00:00
ReportError ( "Can't load an unnamed sprite. Please consider giving names to your resources" ) ;
2015-12-17 10:07:28 +00:00
return false ;
}
2009-06-08 18:52:56 +00:00
// Add the sprite
2010-08-18 05:49:15 +00:00
sprites [ tx . Name ] = tx ;
}
2015-12-17 10:07:28 +00:00
break ;
2010-08-18 05:49:15 +00:00
2015-12-17 10:07:28 +00:00
case "walltexture" :
2010-08-18 05:49:15 +00:00
{
2015-12-17 10:07:28 +00:00
// Read walltexture structure
TextureStructure tx = new TextureStructure ( this , "walltexture" , virtualpath ) ;
if ( this . HasError ) return false ;
// if a limit for the walltexture name length is set make sure that it's not exceeded
if ( tx . Name . Length > General . Map . Config . MaxTextureNameLength )
{
ReportError ( "WallTexture name \"" + tx . Name + "\" too long. WallTexture names must have a length of " + General . Map . Config . MaxTextureNameLength + " characters or less" ) ;
return false ;
}
//mxd. Can't load image without name
if ( string . IsNullOrEmpty ( tx . Name ) )
{
2015-12-21 14:17:47 +00:00
ReportError ( "Can't load an unnamed WallTexture. Please consider giving names to your resources" ) ;
2015-12-17 10:07:28 +00:00
return false ;
}
2010-08-18 05:49:15 +00:00
// Add the walltexture
if ( ! textures . ContainsKey ( tx . Name ) | | ( textures [ tx . Name ] . TypeName ! = "texture" ) )
textures [ tx . Name ] = tx ;
}
2015-12-17 10:07:28 +00:00
break ;
2010-08-18 05:49:15 +00:00
2015-12-17 10:07:28 +00:00
case "flat" :
2010-08-18 05:49:15 +00:00
{
2015-12-17 10:07:28 +00:00
// Read flat structure
TextureStructure tx = new TextureStructure ( this , "flat" , virtualpath ) ;
if ( this . HasError ) return false ;
// if a limit for the flat name length is set make sure that it's not exceeded
if ( tx . Name . Length > General . Map . Config . MaxTextureNameLength )
{
ReportError ( "Flat name \"" + tx . Name + "\" too long. Flat names must have a length of " + General . Map . Config . MaxTextureNameLength + " characters or less" ) ;
return false ;
}
//mxd. Can't load image without name
if ( string . IsNullOrEmpty ( tx . Name ) )
{
2015-12-21 14:17:47 +00:00
ReportError ( "Can't load an unnamed flat. Please consider giving names to your resources" ) ;
2015-12-17 10:07:28 +00:00
return false ;
}
2010-08-18 05:49:15 +00:00
// Add the flat
if ( ! flats . ContainsKey ( tx . Name ) | | ( flats [ tx . Name ] . TypeName ! = "texture" ) )
flats [ tx . Name ] = tx ;
2009-06-08 18:52:56 +00:00
}
2015-03-04 09:37:30 +00:00
break ;
2015-12-17 10:07:28 +00:00
Fixed, Visual mode: in some cases ceiling glow effect was interfering with Transfer Brightness effect resulting in incorrectly lit sidedef geometry.
Fixed, Visual mode: UDMF sidedef brightness should be ignored when a wall section is affected by Transfer Brightness effect.
Fixed, Visual mode: any custom fog should be rendered regardless of sector brightness.
Fixed, Visual mode: "fogdensity" and "outsidefogdensity" MAPINFO values were processed incorrectly.
Fixed, Visual mode: in some cases Things were rendered twice during a render pass.
Fixed, Visual mode: floor glow effect should affect thing brightness only when applied to floor of the sector thing is in.
Fixed, TEXTURES parser: TEXTURES group was named incorrectly in the Textures Browser window when parsed from a WAD file.
Fixed, MAPINFO, GLDEFS, DECORATE parsers: "//$GZDB_SKIP" special comment was processed incorrectly.
Fixed, MAPINFO parser: "fogdensity" and "outsidefogdensity" properties are now initialized using GZDoom default value (255) instead of 0.
2016-01-25 13:42:53 +00:00
case "$gzdb_skip" : return ! this . HasError ;
2015-12-17 10:07:28 +00:00
default :
2009-04-19 18:07:22 +00:00
{
2015-12-17 10:07:28 +00:00
// Unknown structure!
// Best we can do now is just find the first { and then
// follow the scopes until the matching } is found
string token2 ;
do
{
if ( ! SkipWhitespace ( true ) ) break ;
token2 = ReadToken ( ) ;
if ( string . IsNullOrEmpty ( token2 ) ) break ;
}
while ( token2 ! = "{" ) ;
int scopelevel = 1 ;
do
{
if ( ! SkipWhitespace ( true ) ) break ;
token2 = ReadToken ( ) ;
if ( string . IsNullOrEmpty ( token2 ) ) break ;
if ( token2 = = "{" ) scopelevel + + ;
if ( token2 = = "}" ) scopelevel - - ;
}
while ( scopelevel > 0 ) ;
2009-04-19 18:07:22 +00:00
}
2015-12-17 10:07:28 +00:00
break ;
2009-04-19 18:07:22 +00:00
}
}
}
// Return true when no errors occurred
return ( ErrorDescription = = null ) ;
}
#endregion
}
}