code: func NewPolicyFromSource(id string, revision uint64, rules string, syntax SyntaxVersion, sentinel sentinel.Evaluator) (*Policy, error) {
  	if rules == "" {
  		// Hot path for empty source
  		return &Policy{ID: id, Revision: revision}, nil
  	}
  
  	var policy *Policy
  	var err error
  	switch syntax {
  	case SyntaxLegacy:
  		policy, err = parseLegacy(rules, sentinel)
  	case SyntaxCurrent:
  		policy, err = parseCurrent(rules, sentinel)
  	default:
  		return nil, fmt.Errorf("Invalid rules version: %d", syntax)
  	}
  
  	if err == nil {
  		policy.ID = id
  		policy.Revision = revision
  	}
  	return policy, err
  }
docs: // NewPolicyFromSource is used to parse the specified ACL rules into an
  // intermediary set of policies, before being compiled into
  // the ACL