diff --git a/tools/mutt2meli/.muttrc b/tools/mutt2meli/.muttrc new file mode 100644 index 000000000..d68bb6bf9 --- /dev/null +++ b/tools/mutt2meli/.muttrc @@ -0,0 +1,51 @@ +set imap_user = "username@gmail.com" +set imap_pass = "" + +set smtp_url = "smtp://username@smtp.gmail.com:587" +set smtp_pass = "" +set from = "username@gmail.com" +set realname = "FirstName LastName" + +set folder = "imaps://imap.gmail.com:993" +set spoolfile = "+INBOX" +set postponed = "+[Gmail]/Drafts" + +set header_cache = ~/.mutt/cache/headers +set message_cachedir = ~/.mutt/cache/bodies +set certificate_file = ~/.mutt/certificates + +set move = no + +set sort = 'threads' +set sort_aux = 'last-date-received' +set imap_check_subscribed + +set editor='vim "+normal \\ec" +/^$/' + +# Colors + +color normal white default +color hdrdefault cyan default +color attachment yellow default + +color header brightyellow default "From: " +color header brightyellow default "Subject: " +color header brightyellow default "Date: " + +color quoted green default +color quoted1 cyan default +color quoted2 green default +color quoted3 cyan default + +color error red default # error messages +color message white default # message informational messages +color indicator white red # indicator for the "current message" +color status white blue # status lines in the folder index sed for the mini-help line +color tree red default # the "tree" display of threads within the folder index +color search white blue # search matches found with search within the internal pager +color markers red default # The markers indicate a wrapped line hen showing messages with looong lines + +color index yellow default '~O' +color index yellow default '~N' +color index brightred default '~F' # Flagged Messages are important! +color index blue default '~D' # Deleted Mails - use dark color as these are already "dealt with" diff --git a/tools/mutt2meli/src/lexer.rs b/tools/mutt2meli/src/lexer.rs index 717c64e4a..1ba3afe9f 100644 --- a/tools/mutt2meli/src/lexer.rs +++ b/tools/mutt2meli/src/lexer.rs @@ -1,3 +1,8 @@ +pub enum Statement { + Command { inner: MuttrcCommand }, + Value { inner: MuttrcConfigurationValues }, +} + pub enum MuttrcCommand { /// alias [-group name [...]] key address [, address [ ... ]] /// unalias [ * | key ] diff --git a/tools/mutt2meli/src/main.rs b/tools/mutt2meli/src/main.rs index 675059239..c3096ae04 100644 --- a/tools/mutt2meli/src/main.rs +++ b/tools/mutt2meli/src/main.rs @@ -5,8 +5,9 @@ pub mod lexer; lalrpop_mod!(pub muttrc); // synthesized by LALRPOP fn main() { + let muttrc = std::fs::read_to_string("./.muttrc").unwrap(); println!( "Hello, world! {:?}", - muttrc::MuttrcCommandParser::new().parse("").unwrap() + muttrc::MuttrcCommandParser::new().parse(&muttrc).unwrap() ); } diff --git a/tools/mutt2meli/src/muttrc.lalrpop b/tools/mutt2meli/src/muttrc.lalrpop index 13e56e7c6..106ee39c6 100644 --- a/tools/mutt2meli/src/muttrc.lalrpop +++ b/tools/mutt2meli/src/muttrc.lalrpop @@ -1,14 +1,717 @@ use std::str::FromStr; -use crate::lexer::{MuttrcCommand, MuttrcConfigurationValues}; +use crate::lexer as ast; +use crate::*; grammar; -pub Command: MuttrcCommand = { - => c, - <_s:String> => c, +pub Muttrc = ; + +Statement: ast::Statement = { + => ast::Statement::Command { inner }, + => ast::Statement::Value { inner }, +} + +Command: MuttrcCommand = { + "alias" => ast::MuttrcCommand::Alias, + "unalias", => ast::MuttrcCommand::Unalias, + "group", => ast::MuttrcCommand::Group, + "ungroup", => ast::MuttrcCommand::Ungroup, + "alternates", => ast::MuttrcCommand::Alternates, + "unalternates", => ast::MuttrcCommand::Unalternates, + "alternative_order", => ast::MuttrcCommand::AlternativeOrder, + "unalternative_order", => ast::MuttrcCommand::UnalternativeOrder, + "auto_view", => ast::MuttrcCommand::AutoView, + "unauto_view", => ast::MuttrcCommand::UnautoView, + "mime_lookup", => ast::MuttrcCommand::MimeLookup, + "unmime_lookup", => ast::MuttrcCommand::UnmimeLookup, + "color", => ast::MuttrcCommand::Color, + "uncolor", => ast::MuttrcCommand::Uncolor, + "mono", => ast::MuttrcCommand::Mono, + "lists", => ast::MuttrcCommand::Lists, + "unlists", => ast::MuttrcCommand::Unlists, + "subscribe", => ast::MuttrcCommand::Subscribe, + "unsubscribe", => ast::MuttrcCommand::Unsubscribe, + "mailboxes", => ast::MuttrcCommand::Mailboxes, + "unmailboxes", => ast::MuttrcCommand::Unmailboxes, + "my_hdr", => ast::MuttrcCommand::MyHdr, + "unmy_hdr", => ast::MuttrcCommand::UnmyHdr, + "hdr_order", => ast::MuttrcCommand::HdrOrder, + "save_hook", => ast::MuttrcCommand::SaveHook, + "fcc_hook", => ast::MuttrcCommand::FccHook, + "fcc_save_hook", => ast::MuttrcCommand::FccSaveHook, + "send_hook", => ast::MuttrcCommand::SendHook, + "send2_hook", => ast::MuttrcCommand::Send2Hook, + "reply_hook", => ast::MuttrcCommand::ReplyHook, + "crypt_hook", => ast::MuttrcCommand::CryptHook, + "push", => ast::MuttrcCommand::Push, + "set", => ast::MuttrcCommand::Set, + "toggle", => ast::MuttrcCommand::Toggle, + "unset", => ast::MuttrcCommand::Unset, + "reset", => ast::MuttrcCommand::Reset, + "source", => ast::MuttrcCommand::Source, + "spam", => ast::MuttrcCommand::Spam, + "nospam", => ast::MuttrcCommand::Nospam, + "unhook", => ast::MuttrcCommand::Unhook, }; -pub Configuration: MuttrcConfigurationValues = { - => c, - <_s:String> => c, -}; +Value: MuttrcConfigurationValues = { + "abort_nosubject", => ast::MuttrcConfigurationValues::AbortNosubject, + "abort_unmodified", => ast::MuttrcConfigurationValues::AbortUnmodified, + "alias_file", => ast::MuttrcConfigurationValues::AliasFile, + "alias_format", => ast::MuttrcConfigurationValues::AliasFormat, + "allow8bit", => ast::MuttrcConfigurationValues::Allow8bit, + "allow_ansi", => ast::MuttrcConfigurationValues::AllowAnsi, + "arrow_cursor", => ast::MuttrcConfigurationValues::ArrowCursor, + "ascii_chars", => ast::MuttrcConfigurationValues::AsciiChars, + "askbcc", => ast::MuttrcConfigurationValues::Askbcc, + "askcc", => ast::MuttrcConfigurationValues::Askcc, + "assumed_charset", => ast::MuttrcConfigurationValues::AssumedCharset, + "attach_charset", => ast::MuttrcConfigurationValues::AttachCharset, + "attach_format", => ast::MuttrcConfigurationValues::AttachFormat, + "attach_sep", => ast::MuttrcConfigurationValues::AttachSep, + "attach_split", => ast::MuttrcConfigurationValues::AttachSplit, + "attribution", => ast::MuttrcConfigurationValues::Attribution, + "auto_tag", => ast::MuttrcConfigurationValues::AutoTag, + "autoedit", => ast::MuttrcConfigurationValues::Autoedit, + "beep", => ast::MuttrcConfigurationValues::Beep, + "beep_new", => ast::MuttrcConfigurationValues::BeepNew, + "bounce", => ast::MuttrcConfigurationValues::Bounce, + "bounce_delivered", => ast::MuttrcConfigurationValues::BounceDelivered, + "braille_friendly", => ast::MuttrcConfigurationValues::BrailleFriendly, + "certificate_file", => ast::MuttrcConfigurationValues::CertificateFile, + "charset", => ast::MuttrcConfigurationValues::Charset, + "check_mbox_size", => ast::MuttrcConfigurationValues::CheckMboxSize, + "check_new", => ast::MuttrcConfigurationValues::CheckNew, + "collapse_unread", => ast::MuttrcConfigurationValues::CollapseUnread, + "compose_format", => ast::MuttrcConfigurationValues::ComposeFormat, + "config_charset", => ast::MuttrcConfigurationValues::ConfigCharset, + "confirm_append", => ast::MuttrcConfigurationValues::ConfirmAppend, + "confirm_create", => ast::MuttrcConfigurationValues::ConfirmCreate, + "connect_timeout", => ast::MuttrcConfigurationValues::ConnectTimeout, + "content_type", => ast::MuttrcConfigurationValues::ContentType, + "copy", => ast::MuttrcConfigurationValues::Copy, + "crypt_autoencrypt", => ast::MuttrcConfigurationValues::CryptAutoencrypt, + "crypt_autopgp", => ast::MuttrcConfigurationValues::CryptAutopgp, + "crypt_autosign", => ast::MuttrcConfigurationValues::CryptAutosign, + "crypt_autosmime", => ast::MuttrcConfigurationValues::CryptAutosmime, + "crypt_replyencrypt", => ast::MuttrcConfigurationValues::CryptReplyencrypt, + "crypt_replysign", => ast::MuttrcConfigurationValues::CryptReplysign, + "crypt_replysignencrypted", => ast::MuttrcConfigurationValues::CryptReplysignencrypted, + "crypt_timestamp", => ast::MuttrcConfigurationValues::CryptTimestamp, + "cryptuse_gpgme", => ast::MuttrcConfigurationValues::CryptuseGpgme, + "cryptuse_pka", => ast::MuttrcConfigurationValues::CryptusePka, + "cryptverify_sig", => ast::MuttrcConfigurationValues::CryptverifySig, + "date_format", => ast::MuttrcConfigurationValues::DateFormat, + "default_hook", => ast::MuttrcConfigurationValues::DefaultHook, + "delete", => ast::MuttrcConfigurationValues::Delete, + "delete_untag", => ast::MuttrcConfigurationValues::DeleteUntag, + "digest_collapse", => ast::MuttrcConfigurationValues::DigestCollapse, + "display_filter", => ast::MuttrcConfigurationValues::DisplayFilter, + "dsn_notify", => ast::MuttrcConfigurationValues::DsnNotify, + "dsn_return", => ast::MuttrcConfigurationValues::DsnReturn, + "duplicate_threads", => ast::MuttrcConfigurationValues::DuplicateThreads, + "edit_headers", => ast::MuttrcConfigurationValues::EditHeaders, + "editor", => ast::MuttrcConfigurationValues::Editor, + "encode_from", => ast::MuttrcConfigurationValues::EncodeFrom, + "envelope_from_address", => ast::MuttrcConfigurationValues::EnvelopeFromAddress, + "escape", => ast::MuttrcConfigurationValues::Escape, + "fast_reply", => ast::MuttrcConfigurationValues::FastReply, + "fcc_attach", => ast::MuttrcConfigurationValues::FccAttach, + "fcc_clear", => ast::MuttrcConfigurationValues::FccClear, + "folder", => ast::MuttrcConfigurationValues::Folder, + "folder_format", => ast::MuttrcConfigurationValues::FolderFormat, + "followup_to", => ast::MuttrcConfigurationValues::FollowupTo, + "force_name", => ast::MuttrcConfigurationValues::ForceName, + "forward_decode", => ast::MuttrcConfigurationValues::ForwardDecode, + "forward_decrypt", => ast::MuttrcConfigurationValues::ForwardDecrypt, + "forward_edit", => ast::MuttrcConfigurationValues::ForwardEdit, + "forward_format", => ast::MuttrcConfigurationValues::ForwardFormat, + "forward_quote", => ast::MuttrcConfigurationValues::ForwardQuote, + "from", => ast::MuttrcConfigurationValues::From, + "gecos_mask", => ast::MuttrcConfigurationValues::GecosMask, + "hdrs", => ast::MuttrcConfigurationValues::Hdrs, + "header", => ast::MuttrcConfigurationValues::Header, + "header_cache", => ast::MuttrcConfigurationValues::HeaderCache, + "header_cache_compress", => ast::MuttrcConfigurationValues::HeaderCacheCompress, + "help", => ast::MuttrcConfigurationValues::Help, + "hidden_host", => ast::MuttrcConfigurationValues::HiddenHost, + "hide_limited", => ast::MuttrcConfigurationValues::HideLimited, + "hide_missing", => ast::MuttrcConfigurationValues::HideMissing, + "hide_thread_subject", => ast::MuttrcConfigurationValues::HideThreadSubject, + "hide_top_limited", => ast::MuttrcConfigurationValues::HideTopLimited, + "hide_top_missing", => ast::MuttrcConfigurationValues::HideTopMissing, + "history", => ast::MuttrcConfigurationValues::History, + "history_file", => ast::MuttrcConfigurationValues::HistoryFile, + "honor_disposition", => ast::MuttrcConfigurationValues::HonorDisposition, + "honor_followup_to", => ast::MuttrcConfigurationValues::HonorFollowupTo, + "hostname", => ast::MuttrcConfigurationValues::Hostname, + "ignore_linear_white_space", => ast::MuttrcConfigurationValues::IgnoreLinearWhiteSpace, + "ignore_list_reply_to", => ast::MuttrcConfigurationValues::IgnoreListReplyTo, + "imap_authenticators", => ast::MuttrcConfigurationValues::ImapAuthenticators, + "imap_check_subscribed", => ast::MuttrcConfigurationValues::ImapCheckSubscribed, + "imap_delim_chars", => ast::MuttrcConfigurationValues::ImapDelimChars, + "imap_headers", => ast::MuttrcConfigurationValues::ImapHeaders, + "imap_idle", => ast::MuttrcConfigurationValues::ImapIdle, + "imap_keepalive", => ast::MuttrcConfigurationValues::ImapKeepalive, + "imap_list_subscribed", => ast::MuttrcConfigurationValues::ImapListSubscribed, + "imap_login", => ast::MuttrcConfigurationValues::ImapLogin, + "imap_pass", => ast::MuttrcConfigurationValues::ImapPass, + "imap_passive", => ast::MuttrcConfigurationValues::ImapPassive, + "imap_peek", => ast::MuttrcConfigurationValues::ImapPeek, + "imap_pipeline_depth", => ast::MuttrcConfigurationValues::ImapPipelineDepth, + "imap_servernoise", => ast::MuttrcConfigurationValues::ImapServernoise, + "imap_user", => ast::MuttrcConfigurationValues::ImapUser, + "implicit_autoview", => ast::MuttrcConfigurationValues::ImplicitAutoview, + "include", => ast::MuttrcConfigurationValues::Include, + "include_onlyfirst", => ast::MuttrcConfigurationValues::IncludeOnlyfirst, + "indent_string", => ast::MuttrcConfigurationValues::IndentString, + "index_format", => ast::MuttrcConfigurationValues::IndexFormat, + "ispell", => ast::MuttrcConfigurationValues::Ispell, + "keep_flagged", => ast::MuttrcConfigurationValues::KeepFlagged, + "locale", => ast::MuttrcConfigurationValues::Locale, + "mail_check", => ast::MuttrcConfigurationValues::MailCheck, + "mailcap_path", => ast::MuttrcConfigurationValues::MailcapPath, + "mailcap_sanitize", => ast::MuttrcConfigurationValues::MailcapSanitize, + "maildir_header_cache_verify", => ast::MuttrcConfigurationValues::MaildirHeaderCacheVerify, + "maildir_trash", => ast::MuttrcConfigurationValues::MaildirTrash, + "mark_old", => ast::MuttrcConfigurationValues::MarkOld, + "markers", => ast::MuttrcConfigurationValues::Markers, + "mask", => ast::MuttrcConfigurationValues::Mask, + "mbox", => ast::MuttrcConfigurationValues::Mbox, + "mbox_type", => ast::MuttrcConfigurationValues::MboxType, + "menu_context", => ast::MuttrcConfigurationValues::MenuContext, + "menu_move_off", => ast::MuttrcConfigurationValues::MenuMoveOff, + "menu_scroll", => ast::MuttrcConfigurationValues::MenuScroll, + "message_cache_clean", => ast::MuttrcConfigurationValues::MessageCacheClean, + "message_cachedir", => ast::MuttrcConfigurationValues::MessageCachedir, + "message_format", => ast::MuttrcConfigurationValues::MessageFormat, + "meta_key", => ast::MuttrcConfigurationValues::MetaKey, + "metoo", => ast::MuttrcConfigurationValues::Metoo, + "mh_purge", => ast::MuttrcConfigurationValues::MhPurge, + "mh_seq_flagged", => ast::MuttrcConfigurationValues::MhSeqFlagged, + "mh_seq_replied", => ast::MuttrcConfigurationValues::MhSeqReplied, + "mh_seq_unseen", => ast::MuttrcConfigurationValues::MhSeqUnseen, + "mime_forward", => ast::MuttrcConfigurationValues::MimeForward, + "mime_forward_decode", => ast::MuttrcConfigurationValues::MimeForwardDecode, + "mime_forward_rest", => ast::MuttrcConfigurationValues::MimeForwardRest, + "move", => ast::MuttrcConfigurationValues::Move, + "narrow_tree", => ast::MuttrcConfigurationValues::NarrowTree, + "net_inc", => ast::MuttrcConfigurationValues::NetInc, + "pager", => ast::MuttrcConfigurationValues::Pager, + "pager_context", => ast::MuttrcConfigurationValues::PagerContext, + "pager_format", => ast::MuttrcConfigurationValues::PagerFormat, + "pager_index_lines", => ast::MuttrcConfigurationValues::PagerIndexLines, + "pager_stop", => ast::MuttrcConfigurationValues::PagerStop, + "pgp_auto_decode", => ast::MuttrcConfigurationValues::PgpAutoDecode, + "pgp_autoinline", => ast::MuttrcConfigurationValues::PgpAutoinline, + "pgp_check_exit", => ast::MuttrcConfigurationValues::PgpCheckExit, + "pgp_clearsign_command", => ast::MuttrcConfigurationValues::PgpClearsignCommand, + "pgp_decode_command", => ast::MuttrcConfigurationValues::PgpDecodeCommand, + "pgp_decrypt_command", => ast::MuttrcConfigurationValues::PgpDecryptCommand, + "pgp_encrypt_only_command", => ast::MuttrcConfigurationValues::PgpEncryptOnlyCommand, + "pgp_encrypt_sign_command", => ast::MuttrcConfigurationValues::PgpEncryptSignCommand, + "pgp_entry_format", => ast::MuttrcConfigurationValues::PgpEntryFormat, + "pgp_export_command", => ast::MuttrcConfigurationValues::PgpExportCommand, + "pgp_getkeys_command", => ast::MuttrcConfigurationValues::PgpGetkeysCommand, + "pgp_good_sign", => ast::MuttrcConfigurationValues::PgpGoodSign, + "pgp_ignore_subkeys", => ast::MuttrcConfigurationValues::PgpIgnoreSubkeys, + "pgp_import_command", => ast::MuttrcConfigurationValues::PgpImportCommand, + "pgp_list_pubring_command", => ast::MuttrcConfigurationValues::PgpListPubringCommand, + "pgp_list_secring_command", => ast::MuttrcConfigurationValues::PgpListSecringCommand, + "pgp_long_ids", => ast::MuttrcConfigurationValues::PgpLongIds, + "pgp_mime_auto", => ast::MuttrcConfigurationValues::PgpMimeAuto, + "pgp_replyinline", => ast::MuttrcConfigurationValues::PgpReplyinline, + "pgp_retainable_sigs", => ast::MuttrcConfigurationValues::PgpRetainableSigs, + "pgp_show_unusable", => ast::MuttrcConfigurationValues::PgpShowUnusable, + "pgp_sign_as", => ast::MuttrcConfigurationValues::PgpSignAs, + "pgp_sign_command", => ast::MuttrcConfigurationValues::PgpSignCommand, + "pgp_sort_keys", => ast::MuttrcConfigurationValues::PgpSortKeys, + "pgp_strict_enc", => ast::MuttrcConfigurationValues::PgpStrictEnc, + "pgp_timeout", => ast::MuttrcConfigurationValues::PgpTimeout, + "pgp_use_gpg_agent", => ast::MuttrcConfigurationValues::PgpUseGpgAgent, + "pgp_verify_command", => ast::MuttrcConfigurationValues::PgpVerifyCommand, + "pgp_verify_key_command", => ast::MuttrcConfigurationValues::PgpVerifyKeyCommand, + "pipe_decode", => ast::MuttrcConfigurationValues::PipeDecode, + "pipe_sep", => ast::MuttrcConfigurationValues::PipeSep, + "pipe_split", => ast::MuttrcConfigurationValues::PipeSplit, + "pop_auth_try_all", => ast::MuttrcConfigurationValues::PopAuthTryAll, + "pop_authenticators", => ast::MuttrcConfigurationValues::PopAuthenticators, + "pop_checkinterval", => ast::MuttrcConfigurationValues::PopCheckinterval, + "pop_delete", => ast::MuttrcConfigurationValues::PopDelete, + "pop_host", => ast::MuttrcConfigurationValues::PopHost, + "pop_last", => ast::MuttrcConfigurationValues::PopLast, + "pop_pass", => ast::MuttrcConfigurationValues::PopPass, + "pop_reconnect", => ast::MuttrcConfigurationValues::PopReconnect, + "pop_user", => ast::MuttrcConfigurationValues::PopUser, + "post_indent_string", => ast::MuttrcConfigurationValues::PostIndentString, + "postpone", => ast::MuttrcConfigurationValues::Postpone, + "postponed", => ast::MuttrcConfigurationValues::Postponed, + "preconnect", => ast::MuttrcConfigurationValues::Preconnect, + "print", => ast::MuttrcConfigurationValues::Print, + "print_command", => ast::MuttrcConfigurationValues::PrintCommand, + "print_decode", => ast::MuttrcConfigurationValues::PrintDecode, + "print_split", => ast::MuttrcConfigurationValues::PrintSplit, + "prompt_after", => ast::MuttrcConfigurationValues::PromptAfter, + "query_command", => ast::MuttrcConfigurationValues::QueryCommand, + "query_format", => ast::MuttrcConfigurationValues::QueryFormat, + "quit", => ast::MuttrcConfigurationValues::Quit, + "quote_regexp", => ast::MuttrcConfigurationValues::QuoteRegexp, + "read_inc", => ast::MuttrcConfigurationValues::ReadInc, + "read_only", => ast::MuttrcConfigurationValues::ReadOnly, + "realname", => ast::MuttrcConfigurationValues::Realname, + "recall", => ast::MuttrcConfigurationValues::Recall, + "record", => ast::MuttrcConfigurationValues::Record, + "reply_regexp", => ast::MuttrcConfigurationValues::ReplyRegexp, + "reply_self", => ast::MuttrcConfigurationValues::ReplySelf, + "reply_to", => ast::MuttrcConfigurationValues::ReplyTo, + "resolve", => ast::MuttrcConfigurationValues::Resolve, + "reverse_alias", => ast::MuttrcConfigurationValues::ReverseAlias, + "reverse_name", => ast::MuttrcConfigurationValues::ReverseName, + "reverse_realname", => ast::MuttrcConfigurationValues::ReverseRealname, + "rfc2047_parameters", => ast::MuttrcConfigurationValues::Rfc2047Parameters, + "save_address", => ast::MuttrcConfigurationValues::SaveAddress, + "save_empty", => ast::MuttrcConfigurationValues::SaveEmpty, + "save_history", => ast::MuttrcConfigurationValues::SaveHistory, + "save_name", => ast::MuttrcConfigurationValues::SaveName, + "score", => ast::MuttrcConfigurationValues::Score, + "score_threshold_delete", => ast::MuttrcConfigurationValues::ScoreThresholdDelete, + "score_threshold_flag", => ast::MuttrcConfigurationValues::ScoreThresholdFlag, + "score_threshold_read", => ast::MuttrcConfigurationValues::ScoreThresholdRead, + "search_context", => ast::MuttrcConfigurationValues::SearchContext, + "send_charset", => ast::MuttrcConfigurationValues::SendCharset, + "sendmail", => ast::MuttrcConfigurationValues::Sendmail, + "sendmail_wait", => ast::MuttrcConfigurationValues::SendmailWait, + "shell", => ast::MuttrcConfigurationValues::Shell, + "sig_dashes", => ast::MuttrcConfigurationValues::SigDashes, + "sig_on_top", => ast::MuttrcConfigurationValues::SigOnTop, + "signature", => ast::MuttrcConfigurationValues::Signature, + "simple_search", => ast::MuttrcConfigurationValues::SimpleSearch, + "sleep_time", => ast::MuttrcConfigurationValues::SleepTime, + "smart_wrap", => ast::MuttrcConfigurationValues::SmartWrap, + "smileys", => ast::MuttrcConfigurationValues::Smileys, + "smime_ask_cert_label", => ast::MuttrcConfigurationValues::SmimeAskCertLabel, + "smime_ca_location", => ast::MuttrcConfigurationValues::SmimeCaLocation, + "smime_certificates", => ast::MuttrcConfigurationValues::SmimeCertificates, + "smime_decrypt_command", => ast::MuttrcConfigurationValues::SmimeDecryptCommand, + "smime_decrypt_use_default_key", => ast::MuttrcConfigurationValues::SmimeDecryptUseDefaultKey, + "smime_default_key", => ast::MuttrcConfigurationValues::SmimeDefaultKey, + "smime_encrypt_command", => ast::MuttrcConfigurationValues::SmimeEncryptCommand, + "smime_encrypt_with", => ast::MuttrcConfigurationValues::SmimeEncryptWith, + "smime_get_cert_command", => ast::MuttrcConfigurationValues::SmimeGetCertCommand, + "smime_get_cert_email_command", => ast::MuttrcConfigurationValues::SmimeGetCertEmailCommand, + "smime_get_signer_cert_command", => ast::MuttrcConfigurationValues::SmimeGetSignerCertCommand, + "smime_import_cert_command", => ast::MuttrcConfigurationValues::SmimeImportCertCommand, + "smime_is_default", => ast::MuttrcConfigurationValues::SmimeIsDefault, + "smime_keys", => ast::MuttrcConfigurationValues::SmimeKeys, + "smimepk7out_command", => ast::MuttrcConfigurationValues::Smimepk7outCommand, + "smime_sign_command", => ast::MuttrcConfigurationValues::SmimeSignCommand, + "smime_sign_opaque_command", => ast::MuttrcConfigurationValues::SmimeSignOpaqueCommand, + "smime_timeout", => ast::MuttrcConfigurationValues::SmimeTimeout, + "smime_verify_command", => ast::MuttrcConfigurationValues::SmimeVerifyCommand, + "smime_verify_opaque_command", => ast::MuttrcConfigurationValues::SmimeVerifyOpaqueCommand, + "smtp_authenticators", => ast::MuttrcConfigurationValues::SmtpAuthenticators, + "smtp_pass", => ast::MuttrcConfigurationValues::SmtpPass, + "smtp_url", => ast::MuttrcConfigurationValues::SmtpUrl, + "sort", => ast::MuttrcConfigurationValues::Sort, + "sort_alias", => ast::MuttrcConfigurationValues::SortAlias, + "sort_aux", => ast::MuttrcConfigurationValues::SortAux, + "sort_browser", => ast::MuttrcConfigurationValues::SortBrowser, + "sort_re", => ast::MuttrcConfigurationValues::SortRe, + "spam_separator", => ast::MuttrcConfigurationValues::SpamSeparator, + "spoolfile", => ast::MuttrcConfigurationValues::Spoolfile, + "ssl_ca_certificates_file", => ast::MuttrcConfigurationValues::SslCaCertificatesFile, + "ssl_client_cert", => ast::MuttrcConfigurationValues::SslClientCert, + "ssl_force_tls", => ast::MuttrcConfigurationValues::SslForceTls, + "ssl_min_dh_prime_bits", => ast::MuttrcConfigurationValues::SslMinDhPrimeBits, + "ssl_starttls", => ast::MuttrcConfigurationValues::SslStarttls, + "ssl_use_sslv3", => ast::MuttrcConfigurationValues::SslUseSslv3, + "ssl_use_tlsv1", => ast::MuttrcConfigurationValues::SslUseTlsv1, + "ssl_verify_dates", => ast::MuttrcConfigurationValues::SslVerifyDates, + "ssl_verify_host", => ast::MuttrcConfigurationValues::SslVerifyHost, + "status_chars", => ast::MuttrcConfigurationValues::StatusChars, + "status_format", => ast::MuttrcConfigurationValues::StatusFormat, + "status_on_top", => ast::MuttrcConfigurationValues::StatusOnTop, + "strict_threads", => ast::MuttrcConfigurationValues::StrictThreads, + "suspend", => ast::MuttrcConfigurationValues::Suspend, + "text_flowed", => ast::MuttrcConfigurationValues::TextFlowed, + "thorough_search", => ast::MuttrcConfigurationValues::ThoroughSearch, + "thread_received", => ast::MuttrcConfigurationValues::ThreadReceived, + "tilde", => ast::MuttrcConfigurationValues::Tilde, + "time_inc", => ast::MuttrcConfigurationValues::TimeInc, + "timeout", => ast::MuttrcConfigurationValues::Timeout, + "tmpdir", => ast::MuttrcConfigurationValues::Tmpdir, + "to_chars", => ast::MuttrcConfigurationValues::ToChars, + "tunnel", => ast::MuttrcConfigurationValues::Tunnel, + "uncollapse_jump", => ast::MuttrcConfigurationValues::UncollapseJump, + "use8bitmime", => ast::MuttrcConfigurationValues::Use8bitmime, + "use_domain", => ast::MuttrcConfigurationValues::UseDomain, + "use_envelope_from", => ast::MuttrcConfigurationValues::UseEnvelopeFrom, + "use_from", => ast::MuttrcConfigurationValues::UseFrom, + "use_idn", => ast::MuttrcConfigurationValues::UseIdn, + "use_ipv6", => ast::MuttrcConfigurationValues::UseIpv6, + "user_agent", => ast::MuttrcConfigurationValues::UserAgent, + "visual", => ast::MuttrcConfigurationValues::Visual, + "wait_key", => ast::MuttrcConfigurationValues::WaitKey, + "weed", => ast::MuttrcConfigurationValues::Weed, + "wrap", => ast::MuttrcConfigurationValues::Wrap, + "wrap_headers", => ast::MuttrcConfigurationValues::WrapHeaders, + "wrap_search", => ast::MuttrcConfigurationValues::WrapSearch, + "wrapmargin", => ast::MuttrcConfigurationValues::Wrapmargin, + "write_bcc", => ast::MuttrcConfigurationValues::WriteBcc, + "write_inc", => ast::MuttrcConfigurationValues::WriteInc, +} + +extern { + type Location = usize; + type Error = lexer::LexicalError; + + enum lexer::Tok { + " " => lexer::Tok::Space, + "\t" => lexer::Tok::Tab, + "\n" => lexer::Tok::Linefeed, + "abort_nosubject" => lexer::Tok::Value, + "abort_unmodified" => lexer::Tok::Value, + "alias_file" => lexer::Tok::Value, + "alias_format" => lexer::Tok::Value, + "allow8bit" => lexer::Tok::Value, + "allow_ansi" => lexer::Tok::Value, + "arrow_cursor" => lexer::Tok::Value, + "ascii_chars" => lexer::Tok::Value, + "askbcc" => lexer::Tok::Value, + "askcc" => lexer::Tok::Value, + "assumed_charset" => lexer::Tok::Value, + "attach_charset" => lexer::Tok::Value, + "attach_format" => lexer::Tok::Value, + "attach_sep" => lexer::Tok::Value, + "attach_split" => lexer::Tok::Value, + "attribution" => lexer::Tok::Value, + "auto_tag" => lexer::Tok::Value, + "autoedit" => lexer::Tok::Value, + "beep" => lexer::Tok::Value, + "beep_new" => lexer::Tok::Value, + "bounce" => lexer::Tok::Value, + "bounce_delivered" => lexer::Tok::Value, + "braille_friendly" => lexer::Tok::Value, + "certificate_file" => lexer::Tok::Value, + "charset" => lexer::Tok::Value, + "check_mbox_size" => lexer::Tok::Value, + "check_new" => lexer::Tok::Value, + "collapse_unread" => lexer::Tok::Value, + "compose_format" => lexer::Tok::Value, + "config_charset" => lexer::Tok::Value, + "confirm_append" => lexer::Tok::Value, + "confirm_create" => lexer::Tok::Value, + "connect_timeout" => lexer::Tok::Value, + "content_type" => lexer::Tok::Value, + "copy" => lexer::Tok::Value, + "crypt_autoencrypt" => lexer::Tok::Value, + "crypt_autopgp" => lexer::Tok::Value, + "crypt_autosign" => lexer::Tok::Value, + "crypt_autosmime" => lexer::Tok::Value, + "crypt_replyencrypt" => lexer::Tok::Value, + "crypt_replysign" => lexer::Tok::Value, + "crypt_replysignencrypted" => lexer::Tok::Value, + "crypt_timestamp" => lexer::Tok::Value, + "cryptuse_gpgme" => lexer::Tok::Value, + "cryptuse_pka" => lexer::Tok::Value, + "cryptverify_sig" => lexer::Tok::Value, + "date_format" => lexer::Tok::Value, + "default_hook" => lexer::Tok::Value, + "delete" => lexer::Tok::Value, + "delete_untag" => lexer::Tok::Value, + "digest_collapse" => lexer::Tok::Value, + "display_filter" => lexer::Tok::Value, + "dsn_notify" => lexer::Tok::Value, + "dsn_return" => lexer::Tok::Value, + "duplicate_threads" => lexer::Tok::Value, + "edit_headers" => lexer::Tok::Value, + "editor" => lexer::Tok::Value, + "encode_from" => lexer::Tok::Value, + "envelope_from_address" => lexer::Tok::Value, + "escape" => lexer::Tok::Value, + "fast_reply" => lexer::Tok::Value, + "fcc_attach" => lexer::Tok::Value, + "fcc_clear" => lexer::Tok::Value, + "folder" => lexer::Tok::Value, + "folder_format" => lexer::Tok::Value, + "followup_to" => lexer::Tok::Value, + "force_name" => lexer::Tok::Value, + "forward_decode" => lexer::Tok::Value, + "forward_decrypt" => lexer::Tok::Value, + "forward_edit" => lexer::Tok::Value, + "forward_format" => lexer::Tok::Value, + "forward_quote" => lexer::Tok::Value, + "from" => lexer::Tok::Value, + "gecos_mask" => lexer::Tok::Value, + "hdrs" => lexer::Tok::Value, + "header" => lexer::Tok::Value, + "header_cache" => lexer::Tok::Value, + "header_cache_compress" => lexer::Tok::Value, + "help" => lexer::Tok::Value, + "hidden_host" => lexer::Tok::Value, + "hide_limited" => lexer::Tok::Value, + "hide_missing" => lexer::Tok::Value, + "hide_thread_subject" => lexer::Tok::Value, + "hide_top_limited" => lexer::Tok::Value, + "hide_top_missing" => lexer::Tok::Value, + "history" => lexer::Tok::Value, + "history_file" => lexer::Tok::Value, + "honor_disposition" => lexer::Tok::Value, + "honor_followup_to" => lexer::Tok::Value, + "hostname" => lexer::Tok::Value, + "ignore_linear_white_space" => lexer::Tok::Value, + "ignore_list_reply_to" => lexer::Tok::Value, + "imap_authenticators" => lexer::Tok::Value, + "imap_check_subscribed" => lexer::Tok::Value, + "imap_delim_chars" => lexer::Tok::Value, + "imap_headers" => lexer::Tok::Value, + "imap_idle" => lexer::Tok::Value, + "imap_keepalive" => lexer::Tok::Value, + "imap_list_subscribed" => lexer::Tok::Value, + "imap_login" => lexer::Tok::Value, + "imap_pass" => lexer::Tok::Value, + "imap_passive" => lexer::Tok::Value, + "imap_peek" => lexer::Tok::Value, + "imap_pipeline_depth" => lexer::Tok::Value, + "imap_servernoise" => lexer::Tok::Value, + "imap_user" => lexer::Tok::Value, + "implicit_autoview" => lexer::Tok::Value, + "include" => lexer::Tok::Value, + "include_onlyfirst" => lexer::Tok::Value, + "indent_string" => lexer::Tok::Value, + "index_format" => lexer::Tok::Value, + "ispell" => lexer::Tok::Value, + "keep_flagged" => lexer::Tok::Value, + "locale" => lexer::Tok::Value, + "mail_check" => lexer::Tok::Value, + "mailcap_path" => lexer::Tok::Value, + "mailcap_sanitize" => lexer::Tok::Value, + "maildir_header_cache_verify" => lexer::Tok::Value, + "maildir_trash" => lexer::Tok::Value, + "mark_old" => lexer::Tok::Value, + "markers" => lexer::Tok::Value, + "mask" => lexer::Tok::Value, + "mbox" => lexer::Tok::Value, + "mbox_type" => lexer::Tok::Value, + "menu_context" => lexer::Tok::Value, + "menu_move_off" => lexer::Tok::Value, + "menu_scroll" => lexer::Tok::Value, + "message_cache_clean" => lexer::Tok::Value, + "message_cachedir" => lexer::Tok::Value, + "message_format" => lexer::Tok::Value, + "meta_key" => lexer::Tok::Value, + "metoo" => lexer::Tok::Value, + "mh_purge" => lexer::Tok::Value, + "mh_seq_flagged" => lexer::Tok::Value, + "mh_seq_replied" => lexer::Tok::Value, + "mh_seq_unseen" => lexer::Tok::Value, + "mime_forward" => lexer::Tok::Value, + "mime_forward_decode" => lexer::Tok::Value, + "mime_forward_rest" => lexer::Tok::Value, + "move" => lexer::Tok::Value, + "narrow_tree" => lexer::Tok::Value, + "net_inc" => lexer::Tok::Value, + "pager" => lexer::Tok::Value, + "pager_context" => lexer::Tok::Value, + "pager_format" => lexer::Tok::Value, + "pager_index_lines" => lexer::Tok::Value, + "pager_stop" => lexer::Tok::Value, + "pgp_auto_decode" => lexer::Tok::Value, + "pgp_autoinline" => lexer::Tok::Value, + "pgp_check_exit" => lexer::Tok::Value, + "pgp_clearsign_command" => lexer::Tok::Value, + "pgp_decode_command" => lexer::Tok::Value, + "pgp_decrypt_command" => lexer::Tok::Value, + "pgp_encrypt_only_command" => lexer::Tok::Value, + "pgp_encrypt_sign_command" => lexer::Tok::Value, + "pgp_entry_format" => lexer::Tok::Value, + "pgp_export_command" => lexer::Tok::Value, + "pgp_getkeys_command" => lexer::Tok::Value, + "pgp_good_sign" => lexer::Tok::Value, + "pgp_ignore_subkeys" => lexer::Tok::Value, + "pgp_import_command" => lexer::Tok::Value, + "pgp_list_pubring_command" => lexer::Tok::Value, + "pgp_list_secring_command" => lexer::Tok::Value, + "pgp_long_ids" => lexer::Tok::Value, + "pgp_mime_auto" => lexer::Tok::Value, + "pgp_replyinline" => lexer::Tok::Value, + "pgp_retainable_sigs" => lexer::Tok::Value, + "pgp_show_unusable" => lexer::Tok::Value, + "pgp_sign_as" => lexer::Tok::Value, + "pgp_sign_command" => lexer::Tok::Value, + "pgp_sort_keys" => lexer::Tok::Value, + "pgp_strict_enc" => lexer::Tok::Value, + "pgp_timeout" => lexer::Tok::Value, + "pgp_use_gpg_agent" => lexer::Tok::Value, + "pgp_verify_command" => lexer::Tok::Value, + "pgp_verify_key_command" => lexer::Tok::Value, + "pipe_decode" => lexer::Tok::Value, + "pipe_sep" => lexer::Tok::Value, + "pipe_split" => lexer::Tok::Value, + "pop_auth_try_all" => lexer::Tok::Value, + "pop_authenticators" => lexer::Tok::Value, + "pop_checkinterval" => lexer::Tok::Value, + "pop_delete" => lexer::Tok::Value, + "pop_host" => lexer::Tok::Value, + "pop_last" => lexer::Tok::Value, + "pop_pass" => lexer::Tok::Value, + "pop_reconnect" => lexer::Tok::Value, + "pop_user" => lexer::Tok::Value, + "post_indent_string" => lexer::Tok::Value, + "postpone" => lexer::Tok::Value, + "postponed" => lexer::Tok::Value, + "preconnect" => lexer::Tok::Value, + "print" => lexer::Tok::Value, + "print_command" => lexer::Tok::Value, + "print_decode" => lexer::Tok::Value, + "print_split" => lexer::Tok::Value, + "prompt_after" => lexer::Tok::Value, + "query_command" => lexer::Tok::Value, + "query_format" => lexer::Tok::Value, + "quit" => lexer::Tok::Value, + "quote_regexp" => lexer::Tok::Value, + "read_inc" => lexer::Tok::Value, + "read_only" => lexer::Tok::Value, + "realname" => lexer::Tok::Value, + "recall" => lexer::Tok::Value, + "record" => lexer::Tok::Value, + "reply_regexp" => lexer::Tok::Value, + "reply_self" => lexer::Tok::Value, + "reply_to" => lexer::Tok::Value, + "resolve" => lexer::Tok::Value, + "reverse_alias" => lexer::Tok::Value, + "reverse_name" => lexer::Tok::Value, + "reverse_realname" => lexer::Tok::Value, + "rfc2047_parameters" => lexer::Tok::Value, + "save_address" => lexer::Tok::Value, + "save_empty" => lexer::Tok::Value, + "save_history" => lexer::Tok::Value, + "save_name" => lexer::Tok::Value, + "score" => lexer::Tok::Value, + "score_threshold_delete" => lexer::Tok::Value, + "score_threshold_flag" => lexer::Tok::Value, + "score_threshold_read" => lexer::Tok::Value, + "search_context" => lexer::Tok::Value, + "send_charset" => lexer::Tok::Value, + "sendmail" => lexer::Tok::Value, + "sendmail_wait" => lexer::Tok::Value, + "shell" => lexer::Tok::Value, + "sig_dashes" => lexer::Tok::Value, + "sig_on_top" => lexer::Tok::Value, + "signature" => lexer::Tok::Value, + "simple_search" => lexer::Tok::Value, + "sleep_time" => lexer::Tok::Value, + "smart_wrap" => lexer::Tok::Value, + "smileys" => lexer::Tok::Value, + "smime_ask_cert_label" => lexer::Tok::Value, + "smime_ca_location" => lexer::Tok::Value, + "smime_certificates" => lexer::Tok::Value, + "smime_decrypt_command" => lexer::Tok::Value, + "smime_decrypt_use_default_key" => lexer::Tok::Value, + "smime_default_key" => lexer::Tok::Value, + "smime_encrypt_command" => lexer::Tok::Value, + "smime_encrypt_with" => lexer::Tok::Value, + "smime_get_cert_command" => lexer::Tok::Value, + "smime_get_cert_email_command" => lexer::Tok::Value, + "smime_get_signer_cert_command" => lexer::Tok::Value, + "smime_import_cert_command" => lexer::Tok::Value, + "smime_is_default" => lexer::Tok::Value, + "smime_keys" => lexer::Tok::Value, + "smimepk7out_command" => lexer::Tok::Value, + "smime_sign_command" => lexer::Tok::Value, + "smime_sign_opaque_command" => lexer::Tok::Value, + "smime_timeout" => lexer::Tok::Value, + "smime_verify_command" => lexer::Tok::Value, + "smime_verify_opaque_command" => lexer::Tok::Value, + "smtp_authenticators" => lexer::Tok::Value, + "smtp_pass" => lexer::Tok::Value, + "smtp_url" => lexer::Tok::Value, + "sort" => lexer::Tok::Value, + "sort_alias" => lexer::Tok::Value, + "sort_aux" => lexer::Tok::Value, + "sort_browser" => lexer::Tok::Value, + "sort_re" => lexer::Tok::Value, + "spam_separator" => lexer::Tok::Value, + "spoolfile" => lexer::Tok::Value, + "ssl_ca_certificates_file" => lexer::Tok::Value, + "ssl_client_cert" => lexer::Tok::Value, + "ssl_force_tls" => lexer::Tok::Value, + "ssl_min_dh_prime_bits" => lexer::Tok::Value, + "ssl_starttls" => lexer::Tok::Value, + "ssl_use_sslv3" => lexer::Tok::Value, + "ssl_use_tlsv1" => lexer::Tok::Value, + "ssl_verify_dates" => lexer::Tok::Value, + "ssl_verify_host" => lexer::Tok::Value, + "status_chars" => lexer::Tok::Value, + "status_format" => lexer::Tok::Value, + "status_on_top" => lexer::Tok::Value, + "strict_threads" => lexer::Tok::Value, + "suspend" => lexer::Tok::Value, + "text_flowed" => lexer::Tok::Value, + "thorough_search" => lexer::Tok::Value, + "thread_received" => lexer::Tok::Value, + "tilde" => lexer::Tok::Value, + "time_inc" => lexer::Tok::Value, + "timeout" => lexer::Tok::Value, + "tmpdir" => lexer::Tok::Value, + "to_chars" => lexer::Tok::Value, + "tunnel" => lexer::Tok::Value, + "uncollapse_jump" => lexer::Tok::Value, + "use8bitmime" => lexer::Tok::Value, + "use_domain" => lexer::Tok::Value, + "use_envelope_from" => lexer::Tok::Value, + "use_from" => lexer::Tok::Value, + "use_idn" => lexer::Tok::Value, + "use_ipv6" => lexer::Tok::Value, + "user_agent" => lexer::Tok::Value, + "visual" => lexer::Tok::Value, + "wait_key" => lexer::Tok::Value, + "weed" => lexer::Tok::Value, + "wrap" => lexer::Tok::Value, + "wrap_headers" => lexer::Tok::Value, + "wrap_search" => lexer::Tok::Value, + "wrapmargin" => lexer::Tok::Value, + "write_bcc" => lexer::Tok::Value, + "write_inc" => lexer::Tok::Value, + "alias" => lexer::Tok::Value, + "unalias" => lexer::Tok::Value, + "group" => lexer::Tok::Value, + "ungroup" => lexer::Tok::Value, + "alternates" => lexer::Tok::Value, + "unalternates" => lexer::Tok::Value, + "alternative_order" => lexer::Tok::Value, + "unalternative_order" => lexer::Tok::Value, + "auto_view" => lexer::Tok::Value, + "unauto_view" => lexer::Tok::Value, + "mime_lookup" => lexer::Tok::Value, + "unmime_lookup" => lexer::Tok::Value, + "color" => lexer::Tok::Value, + "uncolor" => lexer::Tok::Value, + "mono" => lexer::Tok::Value, + "lists" => lexer::Tok::Value, + "unlists" => lexer::Tok::Value, + "subscribe" => lexer::Tok::Value, + "unsubscribe" => lexer::Tok::Value, + "mailboxes" => lexer::Tok::Value, + "unmailboxes" => lexer::Tok::Value, + "my_hdr" => lexer::Tok::Value, + "unmy_hdr" => lexer::Tok::Value, + "hdr_order" => lexer::Tok::Value, + "save_hook" => lexer::Tok::Value, + "fcc_hook" => lexer::Tok::Value, + "fcc_save_hook" => lexer::Tok::Value, + "send_hook" => lexer::Tok::Value, + "send2_hook" => lexer::Tok::Value, + "reply_hook" => lexer::Tok::Value, + "crypt_hook" => lexer::Tok::Value, + "push" => lexer::Tok::Value, + "set" => lexer::Tok::Value, + "toggle" => lexer::Tok::Value, + "unset" => lexer::Tok::Value, + "reset" => lexer::Tok::Value, + "source" => lexer::Tok::Value, + "spam" => lexer::Tok::Value, + "nospam" => lexer::Tok::Value, + "unhook" => lexer::Tok::Value, + } +}