Workflowy selector parser

A parser for a DSL used to select specific items in a Workflowy hierarchy.

נכון ליום 12-08-2016. ראה הגרסה האחרונה.

אין להתקין סקריפט זה ישירות. זוהי ספריה עבור סקריפטים אחרים // @require https://update.greasyfork.org/scripts/22247/141330/Workflowy%20selector%20parser.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

יוצר
fiatjaf
גרסה
0.0.1.20160812143603
נוצר
12-08-2016
עודכן
12-08-2016
Size
16.8 קילו-בייט
רישיון
לא זמין

Intended to be required by Workflowy userscripts.

pegjs source:

expr
  = s:selector _ ch:(connector? _ selector _)* {
    return [[null, s]].concat(ch.map(s => [s[0], s[2]]))
  }

selector
  = id:('#' [a-z0-9-]i+) { return {type: 'id', val: id[1].join('')} }
  / re:('/' [^/]+ '/') { return {type: 'regex', val: re[1].join('')} }
  / name:("'" [^']i+ "'") { return {type: 'name', val: name[1].join('')} }
  / any:'*' { return {type: 'any'} }

connector
  = '>' { return 'directchild' }

_ = ' '*