Confuser.Core/Marker.cs
/// <summary>
///     Parses the rules' patterns.
/// </summary>
/// <param name="proj">The project.</param>
/// <param name="module">The module description.</param>
/// <param name="context">The working context.</param>
/// <returns>Parsed rule patterns.</returns>
/// <exception cref="T:System.ArgumentException">
///     One of the rules has invalid pattern.
/// </exception>
// Token: 0x06000195 RID: 405 RVA: 0x0000D320 File Offset: 0x0000B520
Parses the rules' patterns.
Parses the rules ' patterns .
protected Dictionary<Rule, PatternExpression> ParseRules(ConfuserProject proj, ProjectModule module, ConfuserContext context)
		{
			Dictionary<Rule, PatternExpression> ret = new Dictionary<Rule, PatternExpression>();
			PatternParser parser = new PatternParser();
			foreach (Rule rule in proj.Rules.Concat(module.Rules))
			{
				try
				{
					ret.Add(rule, parser.Parse(rule.Pattern));
				}
				catch (InvalidPatternException ex)
				{
					context.Logger.ErrorFormat("Invalid rule pattern: " + rule.Pattern + ".", new object[]
					{
						ex
					});
					throw new ConfuserException(ex);
				}
				foreach (SettingItem<Protection> setting in rule)
				{
					if (!this.protections.ContainsKey(setting.Id))
					{
						context.Logger.ErrorFormat("Cannot find protection with ID '{0}'.", new object[]
						{
							setting.Id
						});
						throw new ConfuserException(null);
					}
				}
			}
			return ret;
		}
protected Dictionary < Rule , PatternExpression > ParseRules ( ConfuserProject proj , ProjectModule module , ConfuserContext context ) { Dictionary < Rule , PatternExpression > ret = new Dictionary < Rule , PatternExpression > ( ) ; PatternParser parser = new PatternParser ( ) ; foreach ( Rule rule in proj . Rules . Concat ( module . Rules ) ) { try { ret . Add ( rule , parser . Parse ( rule . Pattern ) ) ; } catch ( InvalidPatternException ex ) { context . Logger . ErrorFormat ( " " + rule . Pattern + " " , new object [ ] { ex } ) ; throw new ConfuserException ( ex ) ; } foreach ( SettingItem < Protection > setting in rule ) { if ( ! this . protections . ContainsKey ( setting . Id ) ) { context . Logger . ErrorFormat ( " " , new object [ ] { setting . Id } ) ; throw new ConfuserException ( null ) ; } } } return ret ; }
Parses the rules' patterns.
Parses the rules ' patterns .
Parsed rule patterns.
Parsed rule patterns .
One of the rules has invalid pattern.
One of the rules has invalid pattern .
proj
ConfuserProject
None
module
ProjectModule
The module description.
The module description .
context
ConfuserContext
The working context.
The working context .