diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 741a5b0..02389cb 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -9,12 +9,7 @@
-
-
-
-
-
-
+
@@ -68,12 +63,12 @@
- {
- "selectedUrlAndAccountId": {
- "url": "https://github.com/Robert-M-Lucas/whython-8.git",
- "accountId": "dcb8df19-0b39-47e1-9073-4a54f7034be8"
+
+}]]>
@@ -134,10 +129,6 @@
-
-
-
-
@@ -279,6 +270,7 @@
+
diff --git a/build/out.asm b/build/out.asm
index 19ad520..a0801fe 100644
--- a/build/out.asm
+++ b/build/out.asm
@@ -139,14 +139,14 @@ _11:
mov qword [rbp-9], rax
mov rax, qword [rbp-9]
cmp rax, 0
- jz __36_24
+ jz __36_16
mov byte [rbp-1], 0
- jmp __36_25
- __36_24:
+ jmp __36_17
+ __36_16:
mov byte [rbp-1], 1
- __36_25:
+ __36_17:
cmp byte [rbp-1], 0
- jz _11_27
+ jz _11_19
mov rax, [rbp+16]
add rax, 0x0000000000000000
mov qword [rbp-25], rax
@@ -162,8 +162,8 @@ _11:
mov rdx, qword [rbp-25]
mov rax, qword [rbp-33]
mov qword [rdx+0], rax
- jmp _11_26
- _11_27:
+ jmp _11_18
+ _11_19:
mov rax, [rbp+16]
add rax, 0x0000000000000000
mov qword [rbp-25], rax
@@ -179,8 +179,8 @@ _11:
sub rsp, 0x0000000000000049
call _16
add rsp, 0x0000000000000049
- _11_28:
- _11_26:
+ _11_20:
+ _11_18:
leave
ret
@@ -226,14 +226,14 @@ _13:
mov qword [rbp-9], rax
mov rax, qword [rbp-9]
cmp rax, 0
- jz __36_0
+ jz __36_26
mov byte [rbp-1], 0
- jmp __36_1
- __36_0:
+ jmp __36_27
+ __36_26:
mov byte [rbp-1], 1
- __36_1:
+ __36_27:
cmp byte [rbp-1], 0
- jz _13_2
+ jz _13_28
mov rax, [rbp+16]
add rax, 0x0000000000000000
mov qword [rbp-49], rax
@@ -268,8 +268,8 @@ _13:
mov qword [rbp+24], rax
leave
ret
- _13_3:
- _13_2:
+ _13_29:
+ _13_28:
mov rax, [rbp+16]
add rax, 0x0000000000000000
mov qword [rbp-41], rax
@@ -365,14 +365,14 @@ _16:
mov qword [rbp-9], rax
mov rax, qword [rbp-9]
cmp rax, 0
- jz __36_29
+ jz __36_21
mov byte [rbp-1], 0
- jmp __36_30
- __36_29:
+ jmp __36_22
+ __36_21:
mov byte [rbp-1], 1
- __36_30:
+ __36_22:
cmp byte [rbp-1], 0
- jz _16_32
+ jz _16_24
mov rax, [rbp+16]
add rax, 0x0000000000000008
mov qword [rbp-25], rax
@@ -388,8 +388,8 @@ _16:
mov rdx, qword [rbp-25]
mov rax, qword [rbp-33]
mov qword [rdx+0], rax
- jmp _16_31
- _16_32:
+ jmp _16_23
+ _16_24:
mov rax, [rbp+16]
add rax, 0x0000000000000008
mov qword [rbp-25], rax
@@ -405,8 +405,8 @@ _16:
sub rsp, 0x0000000000000049
call _16
add rsp, 0x0000000000000049
- _16_33:
- _16_31:
+ _16_25:
+ _16_23:
leave
ret
@@ -419,14 +419,14 @@ _17:
mov qword [rbp-17], 0
mov rax, qword [rbp-9]
cmp rax, qword [rbp-17]
- jz __16_20
+ jz __16_0
mov byte [rbp-1], 0
- jmp __16_21
- __16_20:
+ jmp __16_1
+ __16_0:
mov byte [rbp-1], 1
- __16_21:
+ __16_1:
cmp byte [rbp-1], 0
- jz _17_22
+ jz _17_2
mov rax, [rbp+16]
add rax, 0x0000000000000000
mov qword [rbp-25], rax
@@ -435,8 +435,8 @@ _17:
mov qword [rbp+32], rax
leave
ret
- _17_23:
- _17_22:
+ _17_3:
+ _17_2:
mov rax, [rbp+16]
add rax, 0x0000000000000008
mov qword [rbp-25], rax
@@ -479,14 +479,14 @@ _18:
mov qword [rbp-9], rax
mov rax, qword [rbp-9]
cmp rax, 0
- jz __36_16
+ jz __36_30
mov byte [rbp-1], 0
- jmp __36_17
- __36_16:
+ jmp __36_31
+ __36_30:
mov byte [rbp-1], 1
- __36_17:
+ __36_31:
cmp byte [rbp-1], 0
- jz _18_18
+ jz _18_32
mov rax, [rbp+16]
add rax, 0x0000000000000008
mov qword [rbp-49], rax
@@ -521,8 +521,8 @@ _18:
mov qword [rbp+24], rax
leave
ret
- _18_19:
- _18_18:
+ _18_33:
+ _18_32:
mov rax, [rbp+16]
add rax, 0x0000000000000008
mov qword [rbp-41], rax
diff --git a/build/out.o b/build/out.o
index ce51e48..0325874 100644
Binary files a/build/out.o and b/build/out.o differ
diff --git a/build/out.out b/build/out.out
index 0fa6154..9ce01ed 100755
Binary files a/build/out.out and b/build/out.out differ
diff --git a/src/root/parser/use_parser.rs b/src/root/parser/use_parser.rs
index b0c8e57..0453c9d 100644
--- a/src/root/parser/use_parser.rs
+++ b/src/root/parser/use_parser.rs
@@ -35,6 +35,25 @@ pub fn parse_uses(s: Span) -> ParseResult> {
));
}
+ let mut path_rem = path;
+ while let Ok((rem, c)) = anychar::<_, ErrorTree>(path_rem) {
+ if c.is_alphanumeric() || c == '_' || c == '/' {
+ path_rem = rem;
+ continue;
+ }
+ let mut utf8 = [0u8; 4];
+ c.encode_utf8(&mut utf8);
+ let mut utf8_str = "[".to_string();
+ utf8_str += &utf8.map(|b| format!("{b:02X}")).join(", ");
+ utf8_str.push(']');
+
+
+ return Err(create_custom_error(
+ format!("Invalid character in path '{}' - UTF-8 bytes: {}. Allowed characters are alphanumerics, '_' and '/'", c, utf8_str),
+ path_rem,
+ ));
+ }
+
let path_buf = PathBuf::from(format!("{}.why", path));
found_paths.push((path_buf, Location::from_span(&path)));