Page MenuHomeSoftware Heritage
Paste P1090

swl_ql
ActivePublic

Authored by KShivendu on Jul 9 2021, 8:33 AM.
query ::= ( patternFilter | booleanFilter | numericFilter | boundedListFilter | unboundedListFilter | dateFilter )*
patternFilter ::= ( patternField patternOp patternVal )
patternField ::= ( 'url' | 'metadata' )
patternOp ::= ( ':' | '=' )
patternVal ::= ( string )
booleanFilter ::= ( booleanField booleanOp booleanVal )
booleanField ::= ( 'with_visit' )
booleanOp ::= ( '=' | ':' )
booleanVal ::= ( True | False )
numericFilter ::= ( numericField numericOp numericVal )
numericField ::= ( 'nb_visits' | 'limit' )
numericOp ::= ( rangeOp )
numericVal ::= ( number )
boundedListFilter ::= ( visitTypeFilter | sortByFilter )
visitTypeFilter ::= ( visitTypeField visitTypeOp visitTypeVal )
visitTypeField ::= "visit_types"
visitTypeOp ::= ":"
visitTypeVal ::= ( '[' visitTypeOptions ( "," visitTypeOptions )* ']' )
visitTypeOptions ::= ( "any" | "cran" | "deb" | "deposit" | "ftp" | "hg" | "git" | "nixguix" | "npm" | "pypi" | "svn" | "tar" )
sortByFilter ::= ( sortByField sortByOp sortByVal )
sortByField ::= "sort_by"
sortByOp ::= ":"
sortByVal ::= ( '[' sortByOptions ( "," sortByOptions )* ']' )
sortByOptions ::= ( 'nb_visits' | 'last_visit_date' | 'last_eventful_visit_date' | 'last_revision_date' | 'last_release_date' | 'date_created' | 'date_modified' |
'date_published' )
unboundedListFilter ::= ( listField listOp listVal )
listField ::= ( 'programming_languages' | 'licenses' | 'keywords' )
listOp ::= ( 'in' | 'not in' )
listVal ::= ( array )
dateFilter ::= ( dateField dateOp dateVal )
dateField ::= ( 'last_visit_date' | 'last_eventful_visit_date' | 'last_revision_date' | 'last_release_date' | 'date_created' | 'date_modified' | 'date_published' )
dateOp ::= ( rangeOp )
dateVal ::= ( dateWithOptionalTime )
rangeOp ::= ( '<' | '<=' | '=' | '!=' | '>=' | '>' )
array ::= '[' string ( "," string )* ']'
dateWithOptionalTime ::= '/\d{4}[-]\d{2}[-]\d{2} (\d{2}:\d{2}(:\d{2})*)*/'
string ::= ( string_content | ( ['] string_content ['] ) | ( ["] string_content ["]) )
number ::= [0-9]+
True ::= 'true'
False ::= 'false'
string_content ::= ( '/[^\\"\n]+/' | escape_sequence)+
escape_sequence ::= ('\' '/(\"|\\|\/|b|n|r|t|u)/')

Event Timeline

KShivendu created this object in space S1 Public.
  • I highly recommend you to generate/visualise the corresponding Railroad diagram with https://www.bottlecaps.de/rr/ui
  • Checkout P1091 for the Treesitter implementation and some example queries.

string_content and escape_sequence have been adapted from JSON Treesitter grammar