Labs/Ubiquity/Parser 2 API Conversion Tutorial: Difference between revisions

Jump to navigation Jump to search
Line 4: Line 4:


== A note on (backwards) compatibility ==
== A note on (backwards) compatibility ==
=== Parser 1 API commands in Parser 2 ===
[[Image:Ubiquity_Old_API_badge.png|right]]
All commands in the previous style (Parser 1 API) will be marked with an Old API badge in the Ubiquity command list, as seen on the right. Of these commands, those which do not take any arguments (no modifiers and no direct objects, in the Parser 1 API lingo) will be automatically converted and made to work with Parser 2, but all others will be ignored by Parser 2.
=== Parser 2 API commands in Parser 1 ===
While Parser 2 commands were built with some backwards compatibility in mind, there are some notable limitations. With Ubiquity 0.5 in Parser 1 mode (the "Use Parser 2" setting turned off), Parser 2 commands should be usable but they will only respond to specific prepositions. For example, a command which expects a <code>location</code> will only work with the preposition "near" rather than "near," "on," and "at," which all work for this argument with Parser 2 (see below for more information on semantic roles). In addition, commands will only work in English and localization does not work in Parser 1 mode.
Note, however, that Parser 2-style commands will ''not'' work at all in Ubiquity 0.1.x installs.
We strongly encourage that all community commands be rewritten in Parser 2 format to take advantage of new (and upcoming) features.


== Converting your command ==
== Converting your command ==
308

edits

Navigation menu