From 1c0f3e699cc859e74bf95fc4340de105c09c9a32 Mon Sep 17 00:00:00 2001 From: dsiders Date: Tue, 28 Sep 2021 18:59:14 +0100 Subject: [PATCH] Docs: LazUtils/lazstringutils. Updates LazIsValidIdent for revert in de4f7249. --- docs/xml/lazutils/lazstringutils.xml | 31 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/xml/lazutils/lazstringutils.xml b/docs/xml/lazutils/lazstringutils.xml index e7b00b7b4b..6818844cf6 100644 --- a/docs/xml/lazutils/lazstringutils.xml +++ b/docs/xml/lazutils/lazstringutils.xml @@ -22,7 +22,6 @@ - @@ -1059,23 +1058,29 @@ - This is a modified version of IsValidIdent from the FPC 3.1 FCL library. + This is a copy of IsValidIdent from the FPC 3.1 FCL library.

- LazIsValidIdent is a Boolean function used to determine if the name specified in Ident contains a valid identifier name value. + LazIsValidIdent is a Boolean function used to determine if the name specified in Ident contains a valid identifier name. The identifier name can represent a Namespace, Package, Unit, Component, or a Member.

- The return value is True when Ident contains a valid identifier name using the Pascal naming convention, and does not contain an unquoted reserved keyword. The IsKeyword method in TPascalCodeGenerator is used to check the value in Ident, and the return value is set to False if it contains one of the reserved keywords. + The return value is True when Ident contains a valid identifier name using the Pascal naming convention. The return value is False if Ident contains an empty string (''). +

+

+ AllowDots indicates whether Period ('.') characters are allowed in the identifier name. The default value for the argument is False (not allowed). +

+

+ StrictDots indicates whether a Period character in the identifier name causes name validation to restart at the next character in the identifier name. When set to False, a Period character is ignored during identifier name validation. The default value for the argument is False, and is significant only when AllowDots is set to True. +

+

+ LazIsValidIdent examines each of the characters in Ident to ensure that the value uses the Pascal identifier naming convention. This requires the value to contain only alphanumeric characters or the Underscore ('_') character. It must start with an alphabetic character or the Underscore character; numeric characters cannot be used at the start of the identifier name. The remaining characters in the identifier name can be any alphanumeric character. +

+

+ Case is not significant when determining the validity of an identifier name. +

+

+ LazIsValidIdent is used in the implementation of various tools in the Lazarus IDE. (IDEIntf, CodeTools, BuildIntf)

-

- If the value is a keyword prefixed with an Ampersand (&) character, it is "quoted' and considered a valid identifier name if the Pascal naming convention is satisfied. That naming convention requires the identifier to start with an alphabetic character in the range 'a-z', 'A-Z' or the '_' character. The other characters can be any of the alphanumeric characters. Case is not significant in the identifier name. -

-

- AllowDots indicates whether Period ('.') characters are allowed in the identifier name. The default value for the argument is False (not allowed). -

-

- StrictDots indicates whether the position of a given Period character is validated. In other words, the Period character cannot be first or last character in the identifier name. The default value for the argument is False, and is significant only when AllowDots is set to True. -

Use the IsValidIdent routine from FPC 3.2.X when version 3.2 is the minimum requirement.