Add logical and comparison expressions

This commit is contained in:
2026-06-17 23:38:44 +09:00
parent 3f7dd7c692
commit 2fe54bda62
18 changed files with 6627 additions and 4620 deletions
+1
View File
@@ -51,6 +51,7 @@ export const nav = [
{ title: 'Composition', slug: 'language/expression/composition' },
{ title: 'Default', slug: 'language/expression/default' },
{ title: 'Arithmetic', slug: 'language/expression/arithmetic' },
{ title: 'Logical and Comparison', slug: 'language/expression/logical-and-comparison' },
{ title: 'String Interpolation', slug: 'language/expression/string-interpolation' },
],
},
+1 -1
View File
@@ -195,7 +195,7 @@ function isOperatorStart(char) {
function readOperator(source, start) {
let index = start + 1;
if (source[start] === '/' && source[index] === '/') return index + 1;
if ((source[start] === '&' || source[start] === '|' || source[start] === '/') && source[index] === source[start]) return index + 1;
if ((source[start] === '<' || source[start] === '>' || source[start] === '=' || source[start] === '!') && source[index] === '=') {
index += 1;
}
@@ -10,6 +10,7 @@ in
schema.Service & {
name = "api";
port = 9000 + 443;
feature.enable = 9000 + 443 > 9000 && true;
}
`,
'schemas/service.dcdl': `Service = {
Binary file not shown.