Skip to content
xZise edited this page Mar 4, 2011 · 3 revisions

Since version 1.6.10 xWarp is using a new parser to read the command from a player. Before it simply splits the text at the spaces, but with the new parser you could prevent that it split the command at a space.

Functionality

The following chapters describes the functionality of this feature. To show the spaces directly a “␣” was placed instead of the space directly.

Escape character

The difference is only, that there is a possibility to prevent interpreting the following sign. This is commonly known by Escape character. In many languages this character is the backslash (“\”) and forces the parser to ignore the following character.

So to add a space into a word you simple place a escape character right before the space: Hello\␣World The parser will return one segment here (“Hello␣World”). If the space delimits two values don't escape them: Hello␣World There xWarp will read two segments: “Hello” and “World”.

Place forbidden characters

If you want to use interpreted characters this character also can be used right in front of it. The interpreted/forbidden characters are:

  • Spaces (␣)
  • Quotes (")
  • Escape characters ()

So if you want to write the text “Hello "you"” you simply escape the quotes: Hello\␣"you"

Escaping characters without function

The parser is error tolerant as every character that is escaped will be ignored. It is not relevant if the escaped character has a function.

Quotes

The other way to prevent interpreting the space is, that you quote the space/value. The easiest way is to quote the complete value: "Hello␣World" This will return one segment (“Hello␣World”). This technique has the advantage that you don't have to escape every space and only have to place two quotes.

Examples

Input Output
Hello␣World { Hello, World }
"Hello␣World" { Hello␣World }
Hello\␣World { Hello␣World }
\"Hello␣World\" { "Hello, World" }
"Hello␣World␣\"Bukkit\"" { Hello␣World␣"Bukkit" }
Hello␣World\␣\"Bukkit\" { Hello␣World␣"Bukkit" }
\T\o\l\e\r\a\n\t\␣\e\s\c\a\p\i\n\g { Tolerant␣escaping }
Escape\␣escapes:\␣\\ { Escape␣escapes:␣\ }
# Availably The parser is available in all build of xWarp for the warp commands. If you use the xwarp command the parser got enabled with version 2.6.2.

Clone this wiki locally