Commit graph

1865 commits

Author SHA1 Message Date
Translation updater bot 1c09d86f32 Localisation updates from https://translatewiki.net.
Change-Id: Idd2006160bb2e1ca2b1b982a534ef49aed0ec0fa
2021-11-29 08:10:29 +01:00
Translation updater bot 4160d5ad20 Localisation updates from https://translatewiki.net.
Change-Id: Ica2a7564bdb490e6553f02b9e1c8fd7fdcb7d265
2021-11-26 08:21:56 +01:00
Translation updater bot 24e5f5f33d Localisation updates from https://translatewiki.net.
Change-Id: Ice17e7aff031cca0ae12750032d08dd9d0a22494
2021-11-25 08:23:40 +01:00
Translation updater bot 24012cd014 Localisation updates from https://translatewiki.net.
Change-Id: Ie8fe398c3220ab5d7a75fcee83e8d185e9243762
2021-11-24 08:20:59 +01:00
Translation updater bot 9b473dfafe Localisation updates from https://translatewiki.net.
Change-Id: I0a70841d2c76312bccfa08a82bd8343167588420
2021-11-22 09:01:41 +01:00
Translation updater bot d3aee7e069 Localisation updates from https://translatewiki.net.
Change-Id: I2b7f6eda9abc8b2623d45e1145782bfdcbcb5031
2021-11-19 08:25:53 +01:00
Translation updater bot 90195a6fca Localisation updates from https://translatewiki.net.
Change-Id: If5c853ae5a1ba74d247cb93458b3655220fa979f
2021-11-17 08:29:55 +01:00
Translation updater bot 5475070695 Localisation updates from https://translatewiki.net.
Change-Id: Ib9ba5dcc9b9c471a40878d4135b4747e3cbb751a
2021-11-16 08:15:40 +01:00
Translation updater bot 1c885863a0 Localisation updates from https://translatewiki.net.
Change-Id: Ie817e3bdc41de0ef51e34a6ebd6d6669a4b30501
2021-11-15 08:10:53 +01:00
Translation updater bot a6444d5d85 Localisation updates from https://translatewiki.net.
Change-Id: I53d1d9c5252d9de201629a20d1aeb6dc52db9a5f
2021-11-12 08:29:00 +01:00
Translation updater bot 060e892b16 Localisation updates from https://translatewiki.net.
Change-Id: I7c08d2b66308e0c3b9fae68d3f3aadb67c182f73
2021-11-11 10:01:36 +01:00
Translation updater bot f68fedfdaf Localisation updates from https://translatewiki.net.
Change-Id: I0fac154c46cb1ff29ecd430cba0ab97789eaeeba
2021-11-08 08:16:10 +01:00
Translation updater bot b7cfaecc6c Localisation updates from https://translatewiki.net.
Change-Id: If52a72c316e003d2481eb4b022a6b9f4bf73856e
2021-11-05 08:16:43 +01:00
Translation updater bot 0451d1302f Localisation updates from https://translatewiki.net.
Change-Id: I82da0688a3dc9499b322e768720842a2a7e47f18
2021-11-04 10:07:41 +01:00
Translation updater bot b14296d33f Localisation updates from https://translatewiki.net.
Change-Id: I9647ba46f5c608baca77e6ea4247e14cdce39a05
2021-11-02 08:06:30 +01:00
Translation updater bot db24ba30ee Localisation updates from https://translatewiki.net.
Change-Id: I55a19617b2990a5e78a5fb2f7720a7eef17846ae
2021-11-01 09:32:36 +01:00
Translation updater bot f96d627beb Localisation updates from https://translatewiki.net.
Change-Id: If7a616542a2f90f52c17a27978f5a71986dddaec
2021-10-28 08:26:02 +02:00
Translation updater bot e5c3ad5fa4 Localisation updates from https://translatewiki.net.
Change-Id: I1b2db1eba1bc39715bba6dd4c380b8c3ff402798
2021-10-27 08:21:21 +02:00
Translation updater bot 538050c600 Localisation updates from https://translatewiki.net.
Change-Id: Icd8f9efe21dec78baccdfab32dd4ad0cdb3acbc6
2021-10-26 08:16:14 +02:00
Translation updater bot ffd2be90f9 Localisation updates from https://translatewiki.net.
Change-Id: Ic0e68b628a734a8162d64f2a362f47b8b01c2ff0
2021-10-25 08:50:01 +02:00
Translation updater bot 27953a6a6e Localisation updates from https://translatewiki.net.
Change-Id: Ib51eeeee2270e760f2124e4b17ffce210b81b607
2021-10-22 08:14:22 +02:00
Translation updater bot ca58393d23 Localisation updates from https://translatewiki.net.
Change-Id: I31928502bcb1ddbbc2ee0e5081b519db918526b7
2021-10-21 08:21:00 +02:00
Translation updater bot f0f6f41d04 Localisation updates from https://translatewiki.net.
Change-Id: I4ff263755397081d0821b16845bc9506193dddad
2021-10-20 08:35:49 +02:00
Translation updater bot cfca6824a1 Localisation updates from https://translatewiki.net.
Change-Id: If5db8aaef08eea40560532d8a43b349f9dc4c93b
2021-10-18 15:18:46 +02:00
Translation updater bot 8c4524031b Localisation updates from https://translatewiki.net.
Change-Id: I059c932edec75149551bc7b417693885d18f2e3f
2021-10-07 09:02:12 +02:00
Translation updater bot 774c769c42 Localisation updates from https://translatewiki.net.
Change-Id: I818c3831ea59139e49b50eb847195eb7f92cb5a6
2021-10-05 08:28:51 +02:00
Translation updater bot 7a66312227 Localisation updates from https://translatewiki.net.
Change-Id: I606bdc7dd32f892137bdbfb35f55fdb5fa421535
2021-10-04 08:54:54 +02:00
Translation updater bot fbcaf0c9aa Localisation updates from https://translatewiki.net.
Change-Id: Ia8724716d1a5e1e4f4d9da99b85b4b22c72a46ff
2021-10-01 09:29:17 +02:00
Translation updater bot 208398d96b Localisation updates from https://translatewiki.net.
Change-Id: I58f108045ce27c2bf77c3e5f0818bd700676c06c
2021-09-29 09:01:15 +02:00
Translation updater bot 971ca55488 Localisation updates from https://translatewiki.net.
Change-Id: Idf49765c5ce886675a722bb712a96162aac4a7b4
2021-09-28 08:18:07 +02:00
Translation updater bot f7e760712d Localisation updates from https://translatewiki.net.
Change-Id: I39a24349158a4d57f30312a26b403faf4726a998
2021-09-27 08:33:50 +02:00
Translation updater bot 3f6fc1d9dd Localisation updates from https://translatewiki.net.
Change-Id: I751c4d4d6e972bbfad8d2e656fe362fc3bfa7f8d
2021-09-24 08:25:47 +02:00
Translation updater bot c34a3d9931 Localisation updates from https://translatewiki.net.
Change-Id: I383927110c4eec1dbdeece6c0ff1aec7dad8d2bb
2021-09-23 12:27:03 +02:00
Translation updater bot 1a28b6423d Localisation updates from https://translatewiki.net.
Change-Id: I508bd1915e179ebb375440ce14f34a9b4cd72fbc
2021-09-22 08:10:15 +02:00
Translation updater bot 5d6c62434b Localisation updates from https://translatewiki.net.
Change-Id: I4ed41c20eb7fcbf9e05a7c238a63296f21b21f8f
2021-09-21 08:08:33 +02:00
Translation updater bot a4f9d42705 Localisation updates from https://translatewiki.net.
Change-Id: Icba9f24b2c87ce6e6652044112d44e336adb0eed
2021-09-20 08:17:57 +02:00
Translation updater bot f2cd8ab803 Localisation updates from https://translatewiki.net.
Change-Id: Ie2e7e0053c1c58b10035d48b15919577e9967426
2021-09-17 08:44:35 +02:00
Translation updater bot c42f2b6aae Localisation updates from https://translatewiki.net.
Change-Id: I8cdb41723f2599a2610eb672ae3eb6b1fd240a5b
2021-09-14 08:32:05 +02:00
Translation updater bot 0d2bc7ca17 Localisation updates from https://translatewiki.net.
Change-Id: Icf05d17f79ea9cfaa17fccec25b424c989131b62
2021-09-13 08:28:40 +02:00
Translation updater bot a934ecc3b1 Localisation updates from https://translatewiki.net.
Change-Id: I9ba1b2f7a1d80538502d0ccbf22584c3d0c00ff6
2021-09-10 08:14:57 +02:00
Translation updater bot 4d8242f429 Localisation updates from https://translatewiki.net.
Change-Id: I3981778e72e2ae315f8765cbd294ec9395519269
2021-09-09 08:16:53 +02:00
Translation updater bot 79c7f568f5 Localisation updates from https://translatewiki.net.
Change-Id: I56b56c165580f4ddf7960b94fa39c55d9cd043ca
2021-09-08 08:09:47 +02:00
Translation updater bot 8fe4c04aed Localisation updates from https://translatewiki.net.
Change-Id: I776ede58099f8264e0c61a46bf1bd6446709eace
2021-09-07 08:10:08 +02:00
Translation updater bot 9c8af59d2c Localisation updates from https://translatewiki.net.
Change-Id: I0e6ec717baff0495aabe9f9c3a0f5125ae68335a
2021-09-06 08:19:58 +02:00
jenkins-bot 199cf1edf8 Merge "Add a static analyzer for the filter language" 2021-09-03 19:51:58 +00:00
Translation updater bot c93662e240 Localisation updates from https://translatewiki.net.
Change-Id: Ia0a0f86728aa0431624d9d01c92db9ef0434c427
2021-09-02 08:25:21 +02:00
Translation updater bot fcfd5fbdf6 Localisation updates from https://translatewiki.net.
Change-Id: I20ea2a972c577c87b471ab68a7e503d658b88c23
2021-09-01 08:15:40 +02:00
Translation updater bot 4b01397324 Localisation updates from https://translatewiki.net.
Change-Id: I566cec67a166c1891b4b34d233260e414c1f9503
2021-08-31 08:15:08 +02:00
Sorawee Porncharoenwase 320e3d696f Add a static analyzer for the filter language
This commit adds a class AFPSyntaxChecker which can statically analyze
a filter code to detect the following errors:

- unbound variables (which comes in two modes: conservative and liberal,
  default to conservative)
- unused variables (disabled by default for compatibilty)
- assignment on built-in identifiers
- function application's arity mismatch
- function application's invalid function name
- non-string literal in the first argument of set / set_var

The existing parser and evaluator are modified as follows:

- The new (caching) evaluator no longer needs to perform variable
  hoisting at runtime.
  - Note that for array assignment, this changes the semantics.
- The new parser is more lenient, reducing parsing errors.
  The static analyzer will catch these errors instead, allowing us
  to give a much better error message and reduces the complexity of
  the parser.
  * The parser now allows function name to be any identifier.
  * The parser now allows arity mismatch to occur.
  * The parser now allows the first argument of set to be any expression.

Concretely, obvious changes that users will see are:

1. a := [1]; false & (a[] := 2); a[0] === 1

   would evaluate to true, while it used to evaluate to the undefined value
   due to hoisting

2. f(1)

   will now error with 'f is not a valid function' as opposed to
   'Unexpected "T_BRACE"'

3. length

   will now error with 'Illegal use of built-in identifier "length"'
   as opposed to 'Expected a ('

Appendix: conservative and liberal mode

The conservative mode is completely compatible with the current evaluator.
That is,

false & (a := 1); a

will not deem `a` as unbound, though this is actually undesirable because
`a` would then be bound to the troublesome undefined value.

The liberal mode rejects the above pattern by deeming `a` as unbound.
However, it also rejects

true & (a := 1); a

even though (a := 1) is always executed. Since there are several filters
in Wikimedia projects that rely on this behavior, we default the mode
to conservative for now.

Note that even the liberal mode doesn't really respect lexical scope
appeared in some other programming languages (see also T234690).
For instance:

(if true then (a := 1) else (a := 2) end); a

would be accepted by the liberal checker, even though under lexical scope,
`a` would be unbound. However, it is unlikely that lexical scope
will be suitable for the filter language, as most filters in
Wikimedia projects that have user-defined variable do violate lexical scope.

Bug: T260903
Bug: T238709
Bug: T237610
Bug: T234690
Bug: T231536
Change-Id: Ic6d030503e554933f8d220c6f87b680505918ae2
2021-08-31 03:28:24 +02:00
Translation updater bot 32d5fd0218 Localisation updates from https://translatewiki.net.
Change-Id: Ifcff6e49b0690ebd9dca0a897d49f83f20dbb6a1
2021-08-30 08:19:21 +02:00