Commit graph

21 commits

Author SHA1 Message Date
Robert Rohde a0fdcf7415 Adds explicit fractional tolerance checks to comparison functions. Currently set to 1e-10.
Addresses concerns related to r46671.
2009-02-01 18:40:26 +00:00
Robert Rohde 8f6382337c Adds explicit round-off checking to operations that are sensitive to floating point vs. integer round-off errors.
Where applied, it assumes that any floating point number that is an integer to within one part in 10^10 should be replaced with that integer.
2009-02-01 03:56:24 +00:00
Aryeh Gregor d8a4a48904 (bug 15349) Accept more types of minuses in #expr
{{#expr:1 − 2}} and {{#expr:1 − 2}} now work, in the same vein as {{#ifexpr:3 < 4|...}} does.  This allows human-formatted template values to work more reliably when fed to #expr.  Patch by Doug Strain.
2008-09-12 22:06:58 +00:00
Raimond Spekking 6bab1db29b * (bug 13216 ) Add trigonometrical functions sin, cos, tan, asin, acos, atan and exp, ln, abs, floor, trunc, ceil, ^, and the constants pi and e.
This should help to avoid complicate templates which simulates these functions for geocoding purposes.
Patch by Rene Kijewski
2008-04-23 15:08:39 +00:00
Andrew Garrett 559348494d Allow expr parser function to accept exponent input (i.e. 3e8). It seems silly to output in a format that we don't accept as input. 2008-03-28 11:59:12 +00:00
Siebrand Mazeland 04a88ee436 * use wfLoadExtensionMessages
* remove some unneeded blackslashes in messages (caused malformed error message)
* put Magic in separate file
* delay message loading
* add version in extension credits, remove EOL whitespace
* update Translate extension
2008-01-13 01:06:28 +00:00
Tim Starling e1ca28d2f9 * Strip comments early, before template expansion. This mimics the behaviour in the old parser. Added parser tests demonstrating the regression this fixes. The syntactic effect is fairly elegant, with comments taking effect at source level, as expected. The removeHTMLcomments() and preprocessToDom() passes could be merged at a later date.
* No need for comment stripping in Expr.php anymore
* Updated srvus() to roughly account for these changes
* Gave comment handling its own preprocessor tag, and split off comment handling from extensionSubstitution(). This only applies for the non-HTML modes, since in HTML mode, comments are stripped early. 
* Strip comments from template argument names (PPFrame::newChild).
2007-12-17 15:07:25 +00:00
Tim Starling f06807863c * Object versions of #ifexpr, #switch and #ifexist
* Fix for lack of StubObject in ~1.7
* Ignore HTML comments in expressions, which may now appear due to the parse order change
2007-12-09 08:11:38 +00:00
Raimond Spekking 5944437cb1 Use <strong> not <span>, per hint of Simetrical on wikitech-l. Thanks. 2007-11-19 15:37:49 +00:00
Raimond Spekking e470229df5 * (bug 8773) Make error messages from expr.php localizable
** Move error messages to ParserFunctions.i18n.php
** Rename 'expr_...' to 'pfunc_expr_...' to be consistent with other messages which are localizable already
* Add CSS class 'error' to output of error messages
2007-11-16 08:02:24 +00:00
Brion Vibber 6f8f28792c Renormalize invalid utf-8 byte in error message.
Would be better to work with an entire character, but it isn't that big a deal. :)
2007-08-31 14:08:16 +00:00
Aryeh Gregor ddab9b72ee Extensions too! 2007-06-29 01:36:09 +00:00
Antoine Musso ccc136f753 remove some ending whitespaces 2007-01-06 20:56:46 +00:00
Brion Vibber c8e0d935c0 fix line endings 2007-01-05 02:13:39 +00:00
Tim Starling 2477d59ae4 Exception-based error handling for expressions, plus a few other tweaks. Patch by AzaToth. 2006-11-21 07:22:13 +00:00
Jimmy Collins d6b7f6f759 update for XHTML conformance 2006-07-07 18:01:48 +00:00
Tim Starling 3092bf1db5 Proper handling of division by zero 2006-04-12 04:00:46 +00:00
Tim Starling 4265df9c9a Yay! Synonyms for all! 2006-04-07 00:23:46 +00:00
Tim Starling c592fdf295 fixed stack check 2006-04-06 08:46:34 +00:00
Tim Starling a49014ff5a * Better error reporting
* Inequality operators
* rand function
2006-04-06 08:14:56 +00:00
Tim Starling 6d93dfe6b8 Mathematical expressions and conditional constructs implemented as parser functions. Documentation to follow. 2006-04-05 13:22:51 +00:00