Skip to content

Commit 2f71c0b

Browse files
authored
Update not-scripting.pest
1 parent 14cfcea commit 2f71c0b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

not-scripting.pest

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ unary = { ( "!" | "-" ) ~ factor }
8383

8484
literal = _{ string | number | bool }
8585

86-
string = @{ "\"" ~ ( [^ "\""] | "\\\"" )* ~ "\"" | "'" ~ ( [^ "'"] | "\\'" )* ~ "'" }
86+
string = @{ "\"" ~ double_quoted_char* ~ "\"" | "'" ~ single_quoted_char* ~ "'" }
87+
88+
double_quoted_char = { (!"\"" ~ ANY) | ( "\\\\" ~ ANY ) }
89+
90+
single_quoted_char = { (!"'" ~ ANY) | ( "\\\\" ~ ANY ) }
8791

8892
number = @{ int | float }
8993

@@ -93,10 +97,10 @@ float = @{ "-"? ~ digit* ~ "." ~ digit+ }
9397

9498
bool = @{ "true" | "false" | "True" | "False" }
9599

96-
digit = @{ "0".."9" }
100+
digit = @{ '0'..'9' }
97101

98102
ident = @{ ascii_alpha ~ ( ascii_alpha | ascii_digit | "_" )* }
99103

100-
ascii_alpha = @{ "a".."z" | "A".."Z" }
104+
ascii_alpha = @{ 'a'..'z' | 'A'..'Z' }
101105

102-
ascii_digit = @{ "0".."9" }
106+
ascii_digit = @{ '0'..'9' }

0 commit comments

Comments
 (0)