Skip to content

Commit 5d79e9e

Browse files
feat(codegen): implement bitwise NOT and constant folding; fix .as legacy refs (#25)
1 parent 73cdcf3 commit 5d79e9e

22 files changed

Lines changed: 296 additions & 22 deletions

.build/justfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ golden-path:
5252
dune build
5353
@echo "2. Running tests..."
5454
dune runtest
55-
@echo "3. Testing lexer on hello.as..."
56-
dune exec affinescript -- lex examples/hello.as
57-
@echo "4. Testing parser on ownership.as..."
58-
dune exec affinescript -- parse examples/ownership.as
55+
@echo "3. Testing lexer on hello.affine..."
56+
dune exec affinescript -- lex examples/hello.affine
57+
@echo "4. Testing parser on ownership.affine..."
58+
dune exec affinescript -- parse examples/ownership.affine
5959
@echo "=== Golden Path Complete ==="
6060

6161
# Prepare a release

conformance/invalid/001_unclosed_brace.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: unexpected end of file or missing '}'
44
error[E0002]: Parse error: unexpected end of input
5-
--> conformance/invalid/001_unclosed_brace.as:5:1
5+
--> conformance/invalid/001_unclosed_brace.affine:5:1
66
|
77
5 | // Missing closing brace
88
| ^ expected '}'

conformance/invalid/002_unclosed_string.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: unterminated string literal
44
error[E0001]: Lexical error: unterminated string literal
5-
--> conformance/invalid/002_unclosed_string.as:4:11
5+
--> conformance/invalid/002_unclosed_string.affine:4:11
66
|
77
4 | let s = "hello world
88
| ^ string literal not closed

conformance/invalid/003_bad_number.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: invalid hexadecimal literal
44
error[E0001]: Lexical error: invalid hexadecimal literal
5-
--> conformance/invalid/003_bad_number.as:4:11
5+
--> conformance/invalid/003_bad_number.affine:4:11
66
|
77
4 | let x = 0xGHI;
88
| ^^^^^ invalid hex digit 'G'

conformance/invalid/004_unexpected_token.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: expected identifier
44
error[E0002]: Parse error: expected identifier
5-
--> conformance/invalid/004_unexpected_token.as:4:7
5+
--> conformance/invalid/004_unexpected_token.affine:4:7
66
|
77
4 | let = 42;
88
| ^ expected identifier, found '='

conformance/invalid/005_missing_arrow.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: expected '->'
44
error[E0002]: Parse error: expected '->'
5-
--> conformance/invalid/005_missing_arrow.as:3:10
5+
--> conformance/invalid/005_missing_arrow.affine:3:10
66
|
77
3 | fn test() Int {
88
| ^ expected '->', found identifier

conformance/invalid/006_bad_operator.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: unknown operator or unexpected character
44
error[E0001]: Lexical error: unexpected character
5-
--> conformance/invalid/006_bad_operator.as:4:15
5+
--> conformance/invalid/006_bad_operator.affine:4:15
66
|
77
4 | let x = 1 @@ 2;
88
| ^ unexpected '@'

conformance/invalid/007_incomplete_effect.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: unexpected end of file or missing '}'
44
error[E0002]: Parse error: unexpected end of input
5-
--> conformance/invalid/007_incomplete_effect.as:4:28
5+
--> conformance/invalid/007_incomplete_effect.affine:4:28
66
|
77
4 | fn missing_return_type();
88
| ^ expected '}', found end of file

conformance/invalid/008_mismatched_parens.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: expected ')'
44
error[E0002]: Parse error: expected ')'
5-
--> conformance/invalid/008_mismatched_parens.as:4:16
5+
--> conformance/invalid/008_mismatched_parens.affine:4:16
66
|
77
4 | let x = (1 + 2;
88
| ^ expected ')', found ';'

conformance/invalid/009_reserved_keyword.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Exit code: 1
33
# Error pattern: expected identifier, found keyword
44
error[E0002]: Parse error: expected identifier
5-
--> conformance/invalid/009_reserved_keyword.as:4:7
5+
--> conformance/invalid/009_reserved_keyword.affine:4:7
66
|
77
4 | let fn = 42;
88
| ^^ expected identifier, found keyword 'fn'

0 commit comments

Comments
 (0)