public override void Validate(Context context, JsxProperty property) { IJsxValue value = property.GetValue(); if (value.IsLiteral()) { String text = value.ToString(); if (text.StartsWith("\"") && text.EndsWith("\"")) { text = text.Substring(1, text.Length - 1); } if (!values.Contains(text)) { throw new SyntaxError("Illegal value " + value.ToString()); } } }
public JsxProperty(String name, IJsxValue value, String suite) { this.name = name; this.value = value; this.suite = (suite != null && suite.Length > 0) ? suite : null; }