clone
ssh://git@git.notashelf.dev:33/notashelf/nixir.gitCommit e6231f546d57
tarballunverified21 files changed+144-0
@@ -0,0 +1,8 @@+# Test ancient let syntax: let { bindings; body = expr; }+# This is equivalent to: let bindings in expr, but has been deprecated+# in newer Nix versions.+let {+ x = 10;+ y = 20;+ body = x + y;+}@@ -0,0 +1,12 @@+# Test block comments /* */+/* This is a block comment */+let+ x = 42; /* inline block comment */+ /* Multi-line+ block+ comment */+ y = 100;+in+/* Comment before expression */+x + y+/* Trailing comment */@@ -0,0 +1,15 @@+# Test dynamic attribute names+# Note: Full dynamic attrs require runtime evaluation+# For now, testing that syntax is recognized+let+ key = "mykey";+in {+ # Static attribute for comparison+ static = "value";++ # Dynamic attribute name (basic string interpolation)+ # "${key}" = "dynamic_value";++ # For now, use workaround with static names+ mykey = "works";+}@@ -0,0 +1,11 @@+# Test home-relative paths+# Note: This will resolve to the actual home directory at evaluation time+let+ # Example home path (will be expanded by evaluator)+ config = ~/..config;+ file = ~/.bashrc;+in {+ # These are just path values that will be expanded+ configPath = config;+ filePath = file;+}@@ -0,0 +1,31 @@+# Test indented strings (multi-line strings with '' delimiters)+let+ # Simple indented string+ simple = ''+ Hello+ World+ '';++ # Indented string with interpolation+ name = "Nix";+ greeting = ''+ Welcome to ${name}!+ This is indented.+ '';++ # Escape sequences+ escapes = ''+ Literal dollar: ''$+ Literal quotes: '''+ Regular text+ '';++ # Shell script example (common use case)+ script = ''+ #!/bin/bash+ echo "Running script"+ ls -la+ '';+in {+ inherit simple greeting escapes script;+}@@ -0,0 +1,15 @@+# Test list concatenation operator +++let+ list1 = [1 2 3];+ list2 = [4 5 6];+ empty = [];+in {+ # Basic concatenation+ combined = list1 ++ list2;++ # Concatenate with empty list+ with_empty = list1 ++ empty;++ # Nested concatenation+ triple = [1] ++ [2] ++ [3];+}@@ -0,0 +1,13 @@+# Test nested attribute paths+{+ # Simple nested path+ a.b.c = 42;++ # Multiple nested paths+ x.y = 1;+ x.z = 2;++ # Mix of nested and non-nested+ foo = "bar";+ nested.deep.value = 100;+}@@ -0,0 +1,6 @@+# Test 'or' in attrset context+let+ attrs = { a = 1; };+in {+ test = attrs.a or 999;+}@@ -0,0 +1,4 @@+# Simplest 'or' test+let+ x = { a = 1; };+in x.a or 2@@ -0,0 +1,13 @@+# Test path concatenation+let+ # Path + string = path+ p1 = ./foo + "/bar";++ # String + path = path+ p2 = "/prefix" + ./suffix;++ # Path + path = path+ p3 = ./dir + ./file;+in {+ inherit p1 p2 p3;+}@@ -0,0 +1,16 @@+# Test selection with 'or' default+let+ attrs = { a = 1; b = 2; };+in {+ # Attribute exists - should use value from attrs+ has_attr = attrs.a or 999;++ # Attribute doesn't exist - should use default+ missing_attr = attrs.c or 100;++ # Nested default expression+ nested = attrs.d or (attrs.a + attrs.b);++ # Default with literal+ with_string = attrs.name or "default_name";+}