edbee - Qt Editor Library
|
Our first version of scope-selector only support a list of scopes Thus the Descendant (space) selector only. More...
#include <textdocumentscopes.h>
Public Member Functions | |
TextScopeSelector (const QString &selector) | |
The textscope selector. More... | |
virtual | ~TextScopeSelector () |
The destructor. More... | |
double | calculateMatchScore (const TextScopeList *scopeList) |
This method calculates the matching score of the scope with this selector Currently the scope-calculation is very 'basic'. Just enough to perform the most basic form of matching. More... | |
QString | toString () |
Converts the scope to a string. More... | |
Our first version of scope-selector only support a list of scopes Thus the Descendant (space) selector only.
Full Scope selectors: (FUTURE)
, = grouping (multiple seperate selectors) (space) = descendent (supported)
Extra From the textmate author: http://blog.macromates.com/2005/introduction-to-scopes/ discuession on: http://textmate.1073791.n5.nabble.com/formal-definition-of-scope-selector-syntax-td12109.html
Update: Starting with 1.1b17 it's also possible to AND, OR, and subtract scope selectors,
e.g.: (a | b) & c - d
would select the scope which is not matched by d, and matched by both c, and a or b.
OFFICIAL BNF: atom: «string» | '*' scope: «atom» ('.' «atom»)* path: '^'? «scope» ('>'? «scope»)* '$'? group: '(' «selector» ')' filter: ("L:"|"R:"|"B:") («group» | «path») expression: '-'? («filter» | «group» | «path») composite: «expression» ([|&-] «expression»)* selector: «composite» (',' «composite»)*
edbee::TextScopeSelector::TextScopeSelector | ( | const QString & | selector | ) |
The textscope selector.
selector | the selector to select a scope |
|
virtual |
The destructor.
double edbee::TextScopeSelector::calculateMatchScore | ( | const TextScopeList * | scopeList | ) |
This method calculates the matching score of the scope with this selector Currently the scope-calculation is very 'basic'. Just enough to perform the most basic form of matching.
The algorithm returns 1.0 on a full match...
scopeList | the list of scopes |
QString edbee::TextScopeSelector::toString | ( | ) |
Converts the scope to a string.