Skip to content

Commit

Permalink
Fixed test and updated status badge
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkmcc committed May 29, 2023
1 parent fa43e8f commit 5770cc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Common Expression Language (Rust)

[![Rust](https://github.com/clarkmcc/cel-rust/actions/workflows/rust.yml/badge.svg)](https://github.com/clarkmcc/cel-rust/actions/workflows/rust.yml)

The Common Expression Language (CEL) is a non-Turing complete language designed for simplicity, speed, safety, and
portability. CEL's C-like syntax looks nearly identical to equivalent expressions in C++, Go, Java, and TypeScript. CEL
is ideal for lightweight expression evaluation when a fully sandboxed scripting language is too resource intensive.
Expand All @@ -20,7 +22,9 @@ auth.claims.email_verified && resources.all(r, r.startsWith(auth.claims.email))
```

## Getting Started
This project includes a CEL-parser and an interpreter which means that it can be used to evaluate CEL-expressions. The library aims to be very simple to use, while still being fast, safe, and customizable.

This project includes a CEL-parser and an interpreter which means that it can be used to evaluate CEL-expressions. The
library aims to be very simple to use, while still being fast, safe, and customizable.

```rust
fn main() {
Expand Down
12 changes: 6 additions & 6 deletions interpreter/src/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ static NANOS_PER_MICRO: f64 = 1e3;
/// Parses a duration string into a [`Duration`]. Duration strings support the
/// following grammar:
///
/// DurationString -> Sign? Number Unit String?
/// Sign -> '-'
/// Number -> Digit+ ('.' Digit+)?
/// Digit -> '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
/// Unit -> 'h' | 'm' | 's' | 'ms' | 'us' | 'ns'
/// String -> DurationString
/// DurationString -> Sign? Number Unit String?
/// Sign -> '-'
/// Number -> Digit+ ('.' Digit+)?
/// Digit -> '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
/// Unit -> 'h' | 'm' | 's' | 'ms' | 'us' | 'ns'
/// String -> DurationString
///
/// # Examples
/// - `1h` parses as 1 hour
Expand Down

0 comments on commit 5770cc1

Please sign in to comment.