Commit graph

50 commits

Author SHA1 Message Date
Paul Beckingham
c7464a59b3 Parsing
- Tags may no longer begin with a digit.
2011-09-11 00:49:08 -04:00
Paul Beckingham
1994240899 Parsing
- Created A3::is_operator to allow for more complex processing.  Renamed
  old A3::is_operator to A3::which_operator.
2011-09-10 13:25:46 -04:00
Paul Beckingham
38c325d469 Bug - Tag Recognition
- Lowered the precedence of tag detection so that dates and durations are
  recognized first.
- Modified the allowable tokens for a tag to be almost anything.
2011-09-08 22:49:58 -04:00
Paul Beckingham
9ed0c5c86d Shadow Files
- Re-enabled shadow files, but in a new, simpler manner, that allows the
  rc.shadow.command to override settings like color if necessary.
- Modifed A3 to capture program name and store it in the Context.
2011-09-07 00:24:00 -04:00
Paul Beckingham
c62f36ef87 Bug - tags
- Modified A3::is_tag to allow @, # and $ in tag names.
2011-09-06 23:54:31 -04:00
Paul Beckingham
69aa041218 Bug - tags
- Modified A3::is_tag to allow @, # and $ in tag names.
- Reduced the precedence of tag parsing to ensure that durations are
  detected first.
2011-09-06 23:52:38 -04:00
Matt Kraai
ea3f0e8567 Bug #819
- Patch applied to fix problem with parsing, where this:
    aa'a
  is parsed as
    aa 'a

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2011-08-26 02:00:41 -04:00
Paul Beckingham
dab06f8672 Code Cleanup
- All objects now use the same convention for naming members.  The
  consistency is a good thing.
2011-08-25 21:54:28 -04:00
Paul Beckingham
9641dde54f Debug Mode
- No longer generates parsing diagrams if debug mode is off.
2011-08-23 07:14:26 -04:00
Paul Beckingham
589627852f Duration Bug
- Removed the unnecessary ::getInt parse before ::getNumber, which was
  causing "-1.2d" to not parse.
- Removed verbose debug statement.
2011-08-21 23:32:37 -04:00
Paul Beckingham
de9dbbbb3d A3, Arg
- Some attribute values (ie wait:tomorrow) when parsed, need to take
  the data type of the attribute (date) and use that as an implied type
  of the value (date literal).
- Arg renders type-less and category-less values as "", instead of "none".
  Cleaner output.
2011-08-21 14:24:26 -04:00
Paul Beckingham
7aa4efef8d Expression Refactor
- Refactoring complete.  Arg objects now uses enumerations for _type
  and _category, which should help with performance.
2011-08-21 01:06:50 -04:00
Paul Beckingham
215364958e Expressions Refactor - Clarified expansion rules
- Arg now has a _value member that reflects the value in play, rather
  than the input _raw value.  Only _value is used in eval.
- DOM expansion capabilities are now controlled by rc.dom.
2011-08-20 17:06:50 -04:00
Paul Beckingham
438e65036b Expression Refactor
- Arguments are now categorized as either "literal" or a specific
  category, with accompanying type.  Type is inferred for literals,
  and referenced for attributes.
2011-08-20 14:02:48 -04:00
Paul Beckingham
816b07e868 Expressions - Refactor
- The A3::Arg object is very similar to the E9::Term object, so the two are
  being merged.  First step is to separate A3::Arg into it's own space, then
  add a _type member.
- Added more valid stop characters as terminators for various arg types.
- Removed redundant E9 special handling for dates, which is already built in
  to the Date object.
2011-08-19 22:42:19 -04:00
Paul Beckingham
08fcb5362e Bug - Durations
- Duration were parsed as <int><unit> in A3, whereas <number><unit> is
  correct.
- Added Nibbler::str method for internal access.
- Nibbler::save, ::restore now return positions.  Useful for extracting
  substrings.
- Modified countdown.t to use the (now) correct units for durations.
2011-08-17 00:45:09 -04:00
Paul Beckingham
b0c8cff6a2 A3 - attribute modifier syntax
- Restored the <name>.<modifier>[:=]<value> syntax that was reduced
  to just <name>.<modifier>:<value> to make parsing easier.  Now that
  A3 is more sophisticated, we can have our sugar back.
2011-08-14 13:29:06 -04:00
Paul Beckingham
f3f6cd260a E9 - Typo
- In one of the dumbest typos yet, I entered "fasle" instead of "false"
  and the copy/pasted it around.
2011-08-14 10:04:04 -04:00
Paul Beckingham
5a95b96631 A3 Parsing
- Durations now parse at higher precedence than operators, so that durations
  like '-3d' are not parsed as '-' '3d'.
2011-08-14 00:55:53 -04:00
Paul Beckingham
dba950fcf7 A3 Parsing
- Added an 'until whitespace' clause to the attmod parser.  Results are
  better.
- Noted the need for more specific forms to be recognized.
2011-08-14 00:14:48 -04:00
Paul Beckingham
beac5ed7e9 Unit Tests - bug.489.t
- The command line construct "tags.none:" is translated into the expression
  "tags = ''", but instead of '=' I had entered '=='.  Force of C/C++/Perl
  habit.
2011-08-13 23:40:22 -04:00
Paul Beckingham
587f2a002f A3 Duration
- When parsing duration literals, look-ahead now prevents an ordinal
  such as '31st' (August 31st) from being interpreted as two tokens
  '31s' (duration) and 't' (word).  This is the same fix that was
  applied to A3::is_number.  I'll be there are more that I missed.
2011-08-13 22:29:39 -04:00
Paul Beckingham
30034f057b Bug - A3::extract_modifications
- Broadened the list of argument categories that are downgraded to
  'word' for the purpose of task modification.
2011-08-13 16:24:07 -04:00
Paul Beckingham
7aa7fe083f Parsing
- Added special look-ahead rules to remove cases where '3M' was considered
  a number.
2011-08-13 14:10:24 -04:00
Paul Beckingham
e238b94d1b Urgency
- Urgency recalc was not properly set with the task was modified.
- Corrected urgency formatting.
- Cleaned up some code in A3 and E9.
2011-08-12 23:08:54 -04:00
Paul Beckingham
ffa5bc43fe E9
- Working towards arg date/duration eval.
2011-08-06 00:59:14 -04:00
Paul Beckingham
9ce7f63d85 Bug
- Fixed bug where argument processing was not properly shut off by
  the terminator -- in A3::tokenize.
2011-07-31 16:18:25 -04:00
Paul Beckingham
a91b6d4564 Attribute Parsing
- Attributes do not contain spaces unless specifically quoted and
  escaped.
2011-07-31 15:19:06 -04:00
Paul Beckingham
a171f6e4ac Bug
- Fixed bug whereby arguments were categorized, then defaults were injected
  but no subsequent categorization occurred.
- Added debug diagnostics for default.command, 'modify' and 'information'
  default processing.
2011-07-31 14:01:41 -04:00
Paul Beckingham
ccd32cb7d6 Unit Tests
- add.t contained a broken test that did not take into account a
  (working) substitution.
2011-07-31 13:34:10 -04:00
Paul Beckingham
1884223a2e Arguments
- rc:___ and rc.___ arguments are no longer propagated to commands
  that modify tasks.
2011-07-31 11:18:16 -04:00
Paul Beckingham
100af304b7 A3
- Added copy ctor, operator=.
- Included proper handling of the _limit member.
2011-07-30 14:22:15 -04:00
Paul Beckingham
a26b4ca12f Expression Operators
- Implemented operator_equal, operator_inequal.
- Removed diagnostics for completed operators.
2011-07-28 23:38:37 -04:00
Paul Beckingham
0c08b29e48 Code Cleanup
- Eliminated obsolete Arguments.h, Arguments.cpp.
2011-07-26 00:25:57 -04:00
Matt Kraai
0e2da7f1d4 Code Cleanup
- When compiling the 2.0.0 branch of Taskwarrior with GCC 4.6.1, the compiler
  generates a number of warnings.  This patch eliminates these warnings.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2011-07-25 23:17:37 -04:00
Paul Beckingham
3d13ac9f12 Expression reboot
- A3::postfix implemented.
2011-07-25 01:33:23 -04:00
Paul Beckingham
af2f44ca5a Expression reboot
- Implemented selective ID/UUID detection, allowing only a single
  block of consecutive ID/UUID values to be considered a sequence.
- Implemented A3::sequence to expand task IDs and UUIDs into an
  algebraic filter.
2011-07-25 01:10:15 -04:00
Paul Beckingham
8e691d5c5f Expression reboot
- Implemented A3::expand to include all expandable types.
2011-07-24 23:20:06 -04:00
Paul Beckingham
5daabd2548 Expression reboot
- Implemented A3::extract_pattern.
- Implemented A3::infix, which inserts 'and' operators where necessary
  in expressions.
- Began implementation of A3::expand which converts old-style filters
  (pri:H) to the new algebraic style (priority = H).
2011-07-24 21:53:03 -04:00
Paul Beckingham
67fb1e9be4 Expression reboot
- Downgraded A3::extract_words to return a simple vector of strings.
  Any more is unnecessary.
2011-07-24 16:44:05 -04:00
Paul Beckingham
b30b187b4c Expression reboot
- Implemented A3::is_tag.
- Removed obsolte A3::extract_* code.
2011-07-24 14:46:22 -04:00
Paul Beckingham
b3a73f2da1 Expression reboot
- Implemented A3::is_id and A3::is_uuid.
- Obsolted old is_operator.
- Obsolted old is_modifier.
- Obsolted old is_expression.
2011-07-24 14:27:10 -04:00
Paul Beckingham
10c1203c87 Expression reboot
- Implemented A3::is_subst.
2011-07-24 13:41:04 -04:00
Paul Beckingham
c39f8bd6af Expressions reboot
- Implemented A3::is_dom obsoleting Nibbler::getDOM.
- Implemented A3::is_duration.
- Implemented A3::is_pattern to replace Nibbler::getQuoted call.
- Improved A3::is_attr, A3::is_attmod.
- Obsoleted A3::is_multipart.
2011-07-24 13:33:20 -04:00
Paul Beckingham
b55f47ec9a Expression reboot
- Implemented A3::is_modifier which canonicalized modifiers.
- Implemtned A3::is_attmod.
2011-07-24 10:57:30 -04:00
Paul Beckingham
94dfc68cca Expression reboot
- A3::tokenize recognizes strings, patterns, attr, ops, dates.
- A3::tokenize canonicalizes attributes.
2011-07-24 01:06:26 -04:00
Paul Beckingham
91225d808f Expression reboot
- A3 now tracks whether a command is read-only, and builds filters accordingly.
- Implemented extract_filter, extract_modfications and extract_words stubs.
- Removed all E9 implementation details - this is going to be written from
  scratch.
2011-07-23 23:39:11 -04:00
Paul Beckingham
abcda0bcfa Expression reboot
- More integration of A3 into Context.
- Now ready for filter/modification/word extraction.
2011-07-23 17:03:44 -04:00
Paul Beckingham
4fc4e0f637 Expressions reboot
- Now handles argument captures from argv, stdin.
- Now handles rc overrides, aliases, default command.
2011-07-23 15:24:39 -04:00
Paul Beckingham
5b5978952a Expressions reboot
- Created A3.{h,cpp} which will be a simpler, lightweight version of
  Arguments.{h,cpp} that does less, but does it better.
- Created E9.{h,cpp} which will be a better implementation of
  Expression.{h,cpp} that does less, but does it better.
- Integrated A3 into Context::initialize, and Arguments and A3 will
  coexist until A3 surpasses Arguments.
2011-07-23 13:38:33 -04:00