diff --git a/doc/misc/parser/README b/doc/misc/parser/README index d60806542..fe8db036a 100644 --- a/doc/misc/parser/README +++ b/doc/misc/parser/README @@ -1,5 +1,5 @@ The main focus of the 2.4.0 release is a new command line parser that has more -capabilities, and fewer quirks and bugs. +capabilities with fewer quirks and bugs. Improvements needed: @@ -62,7 +62,7 @@ from the parser, yielding a single value. As an example, the command line: task add one due:eoy wait:due-2wks -Is parsed as: +Is to be parsed as: raw | add one due:eoy wait:due-2wks type | command string attr attr diff --git a/doc/misc/parser/expressions.txt b/doc/misc/parser/expressions.txt index 2a125e48b..adf973837 100644 --- a/doc/misc/parser/expressions.txt +++ b/doc/misc/parser/expressions.txt @@ -15,7 +15,7 @@ There are several forms of literals: either ISO-8601 or rc.dateformat dates either ISO-8601 or durations -There are several supported operators: +There are many supported operators: + addition, concatenation - subtraction, unary minus @@ -27,7 +27,7 @@ There are several supported operators: = != equality operators ~ !~ match operators -There are also helper operators to perform odd operations: +There are helper operators to perform odd operations: __hastag__ presence of a tag __notag__ absence of a tag diff --git a/doc/misc/parser/grammar.txt b/doc/misc/parser/grammar.txt index 0470f7038..52247f74a 100644 --- a/doc/misc/parser/grammar.txt +++ b/doc/misc/parser/grammar.txt @@ -1,21 +1,17 @@ -The command line needs to obey a grammar. It is then against this grammar that -bugs will be identified. +# The command line needs to obey a grammar. It is then against this grammar +# that bugs will be identified. +# +# Conventions: +# - Literals are always double-quoted. +# - "*", "+" and "?" suffixes have POSIX semantics. +# - Low-level primitives are in . +# - @reports for dynamic lists such as custom report names. +# +# The general form of commands is: +# task [ all-commands ] +# -Conventions: - - Literals are double-quoted. - - "*", "+" and "?" suffixes have POSIX semantics. - - Low-level primitives are in . - - @reports for dynamic lists such as custom report names. - - -The general form of commands is: - - task [ all-commands ] - - -This breaks down into a supported grammar: - - command ::= all-commands? + grammar ::= all-commands? ; all-commands ::= custom-report @@ -25,19 +21,17 @@ This breaks down into a supported grammar: ; custom-report ::= filter? @report ; - read-command ::= ; - write-command ::= ; + read-command ::= filter? @readcmd ; + write-command ::= filter? @writecmd modifiers ; special-command ::= ; filter ::= expression ; expression ::= ; -Dynamic lists: + modifiers ::= ; - @report ::= all custom reports ; - -Low-level: +# Low-level: dom ::= context-value | system-value @@ -55,119 +49,31 @@ Low-level: | "system.os" ; - rc-value ::= "rc." name + rc-value ::= /rc\.[a-zA-Z.]+/ ; task-value ::= "." attribute | "." attribute ; - + literal ::= | | | ; -Supported primitives: - - - - - - - - - - - ---- - -Default: - task - -Custom reports: - task active - task all - task blocked - task blocking - task completed - task list - task long - task ls - task minimal - task newest - task next - task oldest - task overdue - task ready - task recurring - task unblocked - task waiting - -Build-in read-only: - task burndown.daily - task burndown.monthly - task burndown.weekly - task calendar [due| |] [y] - task colors [sample | legend] - task columns [substring] - task count - task diagnostics - task execute - task export - task ghistory.annual - task ghistory.monthly - task help - task history.annual - task history.monthly - task ids - task information - task logo - task projects - task reports - task show [all | substring] - task stats - task tags - task timesheet [weeks] - task udas - task uuids - task version - task _aliases - task _columns - task _commands - task _config - task _ids - task _projects - task _show - task _tags - task _udas - task _urgency - task _uuids - task _version - task _zshcommands - task _zshids - task _zshuuids - -Write commands: - task add - task annotate - task append - task config [name [value | '']] - task delete - task denotate - task done - task duplicate - task edit - task import [ ...] - task log - task merge - task modify - task prepend - task pull - task push - task start - task stop - task summary - task synchronize - task undo +# Supported primitives: +# +# +# +# +# +# +# +# +# @command all commands +# @report all custom reports +# @attributes all attributes, UDAs +# @readcmd all read-only commands +# @writecmd all write commands