HomePhabricator

Improve support for non-ASCII characters in variable names

Description

Improve support for non-ASCII characters in variable names

Currently, Sparql.js uses a regex which allows all non-ASCII characters (in the
basic multilingual plane) that are allowed by the SPARQL specification.
Elsewhere in the code, such as in the query helper, a regex which only accepts
basic ASCII is used.
This extracts the information about what consistitutes a valid variable name
from Sparql.js into a separate file, which has three varibles and one function:

  • VariablePattern, a regex pattern for a valid variable
  • PrefixPattern, a regex pattern for a valid prefix
  • ValidCharacters, a regex pattern for any character valid in a variable name
  • makeVariableName(), which takes a string and returns a valid variable

and then updates the files to use these new functions and variables.

Bug: T308855
Change-Id: I5c4f19c0ff73e681f802165de100e40fc04506dc

Details

Provenance
NikkiAuthored on Jul 31 2022, 10:49 PM
Parents
rWDQG9ecb61379604: Localisation updates from https://translatewiki.net.
Branches
Unknown
Tags
Unknown
ChangeId
I5c4f19c0ff73e681f802165de100e40fc04506dc