Comments (2)
Here's a simple example:
import regex
schema Attr:
attr: {str:str}
check:
all k in attr {
regex.match(k, r"^[a-z][a-z0-9]{0,63}$")
}
a = Attr{
attr: {"+==": "aaa"}
}
from kcl.
thanks
from kcl.
Related Issues (20)
- [Bug] Dup output for the if stmt.
- [Enhancement] Solve different highlights for different primitives types HOT 1
- [bug] keywords and type highlight error
- [Enhancement] Dict to schema type upgrade for schema calling expressions
- [Enhancement] Add inlay hints for schema arguments.
- [Feature Request] Module-Private Members in KCL
- Show default values from models preview in the KCL language server HOT 3
- Unexpected type inference behavior with lambda functions and schema instantiation HOT 2
- `kcl fmt` misplaces comments for index signatures and fields in schemas
- kcl mod pull fails in version 0.9 and 0.10 HOT 4
- Add BLAKE-3 to crypto module HOT 4
- `kcl import` fails to process multiple CRDs separated by "---" in a single YAML file HOT 2
- Add built-in `is_nullable()` function for None/Undefined checks HOT 1
- Invalid `datetime` functions HOT 4
- Nixlang plugin or transpiler HOT 1
- [Bug] Schema Index signature value type lost the symbol information
- [Bug] No completion items for the string variable in the right side of the if compare condition expression
- [Bug] Config right value would not find the definition from the mixin protocol.
- I added template.render.ingress.app import, and kcl run reported an error. If not, the ide plug-in reported an error. HOT 3
- [bug] After updating dependencies through commands, lsp cannot be automatically updated
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 kcl.