Child pages
  • KeywordRegex
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

KeywordRegex lets you specify the regular expression that describes language keywords and  the rule name that will substitute a whitespace rule during an automatic whitespace rule placement.

The inserted rule should verify that the characters following the keyword are not parts of identifiers. Otherwise the identifier prefixes that match keywords will be mistakenly parsed (e.g. “do” in doStaff, when “do” is a keyword). For that reason the specified rule should contain a corresponding predicate.

For example, the following definition places the S rule after the literals that consist of lowercase alphabet characters:

This rule is defined in the Whitespaces module as follows:

This rule verifies that the current character is not one of the characters allowed in the identifier, next it recognizes the standard whitespace s rule declared in the same module.

If parsing of whitespace character in your language doesn’t follow the standard rules, you can declare your own s and S rules versions.

See also

QualifiedName
RegexExpression
Whitespaces

  • No labels