• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

CS2113-AY1819S2-T09-1 / main / 617
92%

Build:
DEFAULT BRANCH: master
Ran 30 Mar 2019 03:53AM UTC
Jobs 1
Files 105
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
617

push

travis-ci

web-flow
[#119/#129] Logic: improve `FindCommand` to handle boolean expressions (#119)

`FindCommandParser#getKeywordsPredicate(...)` creates a predicate that 
does an implicit boolean OR operation when combining predicates.

This may not desirable for our users as they will not be able to have 
tighter search results 
e.g. Finding for module's `name` with both `Programming` and 
`Methodology`.

We aim to improve our `FindCommand` to improve flexibility in finding 
modules easily by treating the user command arguments as a boolean 
expression.

Consider the following example.

  find name/Structures || (code/CS2040C && credits/4)

We aim to tokenize it to:
* name/Structures
* ||
* (
* code/CS2040C
* &&
* credits/4
* )

Afterwards, we apply Shunting-yard algorithm to parse and process the 
arguments accordingly.

However, `StringTokenizer` is insufficient in extracting prefixed
arguments and boolean operators, as we want to keep boolean operators as
tokens. Likewise, `ArgumentTokenizer` is also not suitable, as we do not
want to use whitespace as delimiter for splitting and extracting
arguments.

Therefore, to enable us to improve the `find` command, let's implement:
* a custom `BooleanExpressionTokenizer` to extract prefixed arguments 
  and boolean operators as tokens
* a custom `BooleanExpressionParser`` which handles the parsing of the 
  argument tokens and apply Shunting-yard algorithm
* declare the operators supported (i.e. `&&` for logical AND, || `for` 
  logical OR, () to group expression to be evaluated first
* Refactor `FindCommandParser` to utilise 
  `BooleanExpressionParser#parse(...)`
* implement and modify unit tests for the `find` command to ensure that 
  the expected behaviour is intended
  
  [ 1/14] Logic: create `BooleanExpressionParser` class
  [ 2/14] Logic: create `Operator` class
  [ 3/14] Logic: add helper method on Operator
  [ 4/14] Logic: add helper method on Operator
  [ 5/14] Log... (continued)

137 of 137 new or added lines in 11 files covered. (100.0%)

2242 of 2585 relevant lines covered (86.73%)

0.87 hits per line

Jobs
ID Job ID Ran Files Coverage
1 617.1 30 Mar 2019 03:53AM UTC 0
86.73
Travis Job 617.1
Source Files on build 617
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #617
  • 087be90d on github
  • Prev Build on master (#579)
  • Next Build on master (#618)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc