Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 52 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,62 @@
# Binaries and compiled files
*.bin
*.exe
*.so
*.dll
*.dylib
*.o
*.a
/ez

# Build directories
dist/
context
*.txt
tmp/
bin/
build/
out/

# Coverage and profiling
*.out
*.html
*.prof
*.test

# IDE and editors
.idea/
.vscode/
*.swp
*.swo
*~
.project
.settings/
*.sublime-project
*.sublime-workspace

# OS files
.DS_Store
Thumbs.db

# Temp and logs
tmp/
*.log
*.tmp

# Environment and secrets
.env
.env.*
*.pem
*.key

# Project specific
context/
*.txt
*.ezdb

# Ignore JSON files except examples/json/data.json
*.json
!examples/json/data.json

# Ignore all .ez files by default (for local scratch/testing)
*.ez
coverage.out

# Keep tests and examples tracked
!integration-tests/
Expand Down
9 changes: 9 additions & 0 deletions integration-tests/fail/errors/E1017_unclosed_raw_string.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Error Test: E1017 - unclosed-raw-string
* Expected: "unclosed raw string literal"
*/

do main() {
temp s string = `this raw string never ends
}

13 changes: 13 additions & 0 deletions integration-tests/fail/errors/E2010_using_before_import.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Error Test: E2010 - using-before-import
* Expected: "cannot use module before importing"
*/

using math // using before import

import @math

do main() {
println("test")
}

9 changes: 9 additions & 0 deletions integration-tests/fail/errors/E2027_integer_parse_error.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Error Test: E2027 - integer-parse-error
* Expected: "cannot parse" or "parse" or "integer"
*/

do main() {
temp x int = 0xGG // invalid hex integer
}

14 changes: 14 additions & 0 deletions integration-tests/fail/errors/E2044_when_float_not_allowed.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Error Test: E2044 - when-float-not-allowed
* Expected: "float type not allowed in when statement"
*/

do main() {
temp x float = 3.14
when x {
is 1.0 { println("one") }
is 2.0 { println("two") }
default { println("other") }
}
}

12 changes: 12 additions & 0 deletions integration-tests/fail/errors/E2053_type_definition_in_function.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Error Test: E2053 - type-definition-in-function
* Expected: "type definitions must be at file level"
*/

do main() {
struct Person { // type definition inside function
name string
}
temp p Person = Person{name: "Alice"}
}

14 changes: 14 additions & 0 deletions integration-tests/fail/errors/E3029_float_enum_map_key.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Error Test: E3029 - float-enum-map-key
* Expected: "float-based enum cannot be used as map key"
*/

enum Status [float] {
ACTIVE = 1.0,
INACTIVE = 2.0
}

do main() {
temp m map[Status: string] = {} // float enum as map key
}

9 changes: 9 additions & 0 deletions integration-tests/fail/errors/E3034_any_type_not_allowed.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Error Test: E3034 - any-type-not-allowed
* Expected: "'any' type is reserved for internal use"
*/

do main() {
temp x any = 42 // 'any' type is reserved
}

11 changes: 11 additions & 0 deletions integration-tests/fail/errors/E4005_undefined_module_member.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Error Test: E4005 - undefined-module-member
* Expected: "not found in module"
*/

import @math

do main() {
temp x int = math.nonexistent_function() // Function doesn't exist
}

9 changes: 9 additions & 0 deletions integration-tests/fail/errors/E4007_module_not_imported.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Error Test: E4007 - module-not-imported
* Expected: "module not imported"
*/

do main() {
temp x int = math.abs(-5) // Using math without importing
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Error Test: E4015 - shadows-used-module-function
* Expected: "shadows a function from a used module"
*/

import & use @math

do main() {
temp abs int = 5 // shadows math.abs function
println(abs)
}

11 changes: 11 additions & 0 deletions integration-tests/fail/errors/E5019_range_step_not_integer.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Error Test: E5019 - range-step-not-integer
* Expected: "range step must be integer"
*/

do main() {
for i in range(0, 10, 2.5) { // step must be integer
println(i)
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Error Test: E5020 - range-in-operand-not-integer
* Expected: "left operand of 'in range()' must be integer"
*/

do main() {
temp x float = 5.0
if x in range(0, 10) { // float cannot be checked against range
println("in range")
}
}

10 changes: 10 additions & 0 deletions integration-tests/fail/errors/E5023_postfix_requires_integer.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Error Test: E5023 - postfix-requires-integer
* Expected: "postfix operator requires integer operand"
*/

do main() {
temp x float = 3.14
x++ // postfix operator needs integer operand
}

11 changes: 11 additions & 0 deletions integration-tests/fail/errors/E6002_module_not_found.ez
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Error Test: E6002 - module-not-found
* Expected: "module file not found"
*/

import @nonexistent_module

do main() {
println("test")
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Error Test: E6009 - private-access-denied
* Expected: "cannot access private member from outside module"
*/

import @std
import "./mylib"

using std

do main() {
// This should fail - private_var is private
println(mylib.private_var)
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* mylib.ez - Library with private variable
*/
module mylib

private temp private_var int = 42

temp public_var int = 100

Loading