Comments (4)
I've decided returning nil for an undefined variable instead of an error doesn't hurt and made it the default behavior.
I've also added your example to the unit tests.
from gval.
Hi,
sorry for the late answer. I've missed your issue.
that is actually not a bug but a matter of how you define the language. You can override this behavior with a custom ident parser. It can be merged into the language with:
gval.PrefixMetaPrefix(scanner.Ident, customParseIdent)
I keep this issue open, since I think. This should be an optional part of the framework.
from gval.
We have a case where we want to actually error on unknown parameters. It would be great if it was easy to change this behaviour or show in docs how to achieve this with current functionality.
from gval.
You can achieve this with a custom VariableSelector.
There is an example on how to write a custom VariableSelector
in the godoc: https://godoc.org/github.com/PaesslerAG/gval#VariableSelector
If you have suggestions for better documention feel free to contribute :-)
from gval.
Related Issues (20)
- how to visit json node whose key with special characters,like $
- no error return when compare with two data which with different type HOT 1
- getting list of parsed variables before expression is evaluated for validation HOT 6
- Passing a context to the custom functions HOT 1
- feat request: null safe operator
- feature request: add metadata in evaluable HOT 5
- functions inside expression are evaluated in coroutine and on panic are not recovered thus crashing whole application
- How to get rendered expressions HOT 4
- Publish new version for DecimalArithmetic HOT 2
- Allow variables to overload functoins HOT 2
- Allow dashes in identfiers HOT 1
- I need to check string contains using gval expression
- Feature Request: high order functions (collection)
- Evaluating strings with backslashes raises parsing errors HOT 1
- Move `parseIf` operator in `base` HOT 2
- evaluate with operator in value not expected HOT 1
- how to parse complex json with jsonpath?
- Hexadecimal support HOT 2
- Allow single quotes for Strings to allow parsing JSONPath HOT 1
- LineFeed in string results in error on Evaluate
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gval.