summaryrefslogtreecommitdiff
path: root/mh/tests/fmtfunc.at
AgeCommit message (Collapse)AuthorFiles
2017-07-05Fix the nohost MH format functionmhfmtSergey Poznyakoff1
2017-07-05MH: Rewrite the mymbox function.Sergey Poznyakoff1
* mh/mh_init.c (emailcmp): Rewrite. (email_match): New function. (mh_is_my_name): Cache Alternate-Mailboxes and mh_my_email in a static mu_address_t; use email_match to compare. * mh/tests/fmtfunc.at: Test mymbox function.
2017-07-04Add more fmtfunc testsSergey Poznyakoff1
2017-07-04Minor fixesSergey Poznyakoff1
* mh/mh_fmtgram.y (yyerror): Cast * arguments to int * mh/mh_format.h (mh_instr_t)<size>: New member. * mh/tests/fmtfunc.at (FMTFUNC): Enforce Charset:auto.
2017-07-04Improve parsedate & related MH formatsSergey Poznyakoff1
* libmailutils/datetime/parsedate.y (spec production): If a non-signed number is given, treat it as a (positive) timezone, unless tz is already set, or as a year number, unless a year is already set, or throw an error otherwise. (mu_parse_date_dtl): Revert sign of the returned utc_offset * mh/mh_format.c (builtin_tzone): Compatibility fix * mh/tests/fmtfunc.at: Test more functions.
2017-07-04Revamp MH datetime format functionsSergey Poznyakoff1
* mh/mh_format.c (_parse_date): Use mu_parse_date_dtl instead of much stricter mu_parse822_date_time. Return more info. All callers changed (builtin_sday,builtin_szone): Implemented * mh/tests/fmtfunc.at: Comment out (temporarly) the tzone test
2017-07-03Test mh format date functionsSergey Poznyakoff1
* mh/mh_format.c (builtin_sday, builtin_szone): Mark as not implemented (builtin_zone): Fix output (builtin_tzone): Fix output * mh/tests/fmtfunc.at: Test most date functions.
2017-07-02MH: fix formataddr.Sergey Poznyakoff1
* mh/mh_fmtgram.y (emit_funcall): Emit mhop_movs acc, reg if MHA_ACC flag is set. * mh/mh_format.c (mh_fvm_run): Clear all registers. (builtin_formataddr): Get previously accumulated addresses from R_ACC (builtin_tab): Mark formataddr with MHA_ACC, remove MHA_OPTARG (mh_format_dump_disass): Account for the new register. (mh_fvm_destroy): Free all registers. * mh/mh_format.h: New register R_ACC. It is needed to implement proper formataddr and concataddr functionality. * mh/tests/fmtcomp.at: Update. * mh/tests/fmtfunc.at: Update.
2017-07-02MH: fix the nodate format functionSergey Poznyakoff1
* mh/mh_format.c (builtin_nodate): Call mu_parse822_date_time directly. (mh_format_dump_disass): Escape literal strings on output. * mh/tests/fmtfunc.at: Test nodate.
2017-07-01Minor fixesSergey Poznyakoff1
2017-07-01MH format: fix processing of special functions: putstrf, putnumf, lit, and numSergey Poznyakoff1
* mh/mh_fmtgram.y (node): Replace noprint with printflag. (escape production): Consult printflag to decide whether to amd how to print (funcall production): Rewrite logic (yylex_func): Make a clear distinction between literals and inlined ctls, which require leading whitespace, and funcalls and components, that don't tolerate it. (emit_funcall): Process special functions separately * mh/mh_format.c (builtin_tab): Mark lit, num, putstrf, and putnumf as specials. * mh/mh_format.h: Revamp MHA_ flags * mh/tests/fmtcomp.at: Update. * mh/tests/fmtfunc.at: Add tests for putstrf and putnumf
2017-07-01More fixes in MH format parserSergey Poznyakoff1
* mh/mh_fmtgram.y (codegen_node): Generate mhop_printlit instruction for fmtnode_print node with a literal or number argument. * mh/mh_format.c (mh_fvm_run): Handle mhop_printlit * mh/mh_format.h (mhop_printlit): New opcode. * mh/tests/fmtcomp.at: Update. * mh/tests/fmtfunc.at: Add more tests.
2017-06-30Improve MH format parser.Sergey Poznyakoff1
* mh/fmtcheck.c (main): Assume -dump if no input message and no -disass is given. * mh/mh_fmtgram.y: Enable error-verbose mode (funcall production): Use MHA_OPTARG_NIL flag to provide 0 (or "") default argument. (yyerror): Improve location printer (yylex_initial): Correctly handle %% * mh/mh_format.c (mh_string_move): Rename to mh_string_copy (builtin_msg, builtin_cur): Try to obtain message number only if msgno is 0. (builtin_tab): Fix definitions of comp, lit, and num (mh_format_dump_disass): Print width. * mh/mh_format.h (MHA_OPTARG_NIL): New flag. * mh/tests/fmtcomp.at: New file. * mh/tests/fmtfunc.at: New file. * mh/tests/Makefile.am: Add new files. * mh/tests/testsuite.at: Likewise. * mh/tests/atlocal.in (MHETCDIR): New variable. * mh/tests/scan.at: Test external formats.

Return to:

Send suggestions and report system problems to the System administrator.