libcel 1.0.2
libcel: ^1.0.2 copied to clipboard
A Dart implementation of the Common Expression Language (CEL) using PetitParser
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2025-09-06 #
Initial Checkin #
- Initial release of libcel - A Dart implementation of the Common Expression Language (CEL)
- Complete CEL expression parser using PetitParser v7.0.1
- Full support for all CEL operators:
- Arithmetic:
+
,-
,*
,/
,%
- Comparison:
==
,!=
,<
,<=
,>
,>=
,in
- Logical:
&&
,||
,!
- Conditional:
? :
- Arithmetic:
- Comprehensive built-in function library:
- Type conversion:
int()
,double()
,string()
,bool()
,type()
- Collection functions:
size()
,has()
,keys()
,values()
- String functions:
matches()
,contains()
,startsWith()
,endsWith()
,toLowerCase()
,toUpperCase()
,trim()
,replace()
,split()
- Math functions:
max()
,min()
- Date/time functions:
timestamp()
,duration()
,now()
,today()
- Type conversion:
- Support for complex data types:
- Primitives (null, bool, int, double, string)
- Lists with indexing and concatenation
- Maps with field access and key lookup
- Nested data structures
- Method call syntax for string and list operations
- Extensible function system for custom implementations
- Comprehensive error handling with
ParseError
andEvaluationError
- Full test coverage with 35+ test cases
- Complete documentation and examples
- Macro Functions: Full implementation of list comprehension functions
list.map(var, expression)
- Transform list elementslist.filter(var, condition)
- Filter by conditionlist.all(var, condition)
- Check if all matchlist.exists(var, condition)
- Check if any matcheslist.existsOne(var, condition)
- Check if exactly one matches- Support for nested macros and chaining
- Proper variable scoping and restoration
Known Limitations #
- Protocol buffer support not yet available
- Some advanced CEL features pending implementation