diff --git a/GRAMMAR.md b/GRAMMAR.md index 2970d7a..9fa3bea 100644 --- a/GRAMMAR.md +++ b/GRAMMAR.md @@ -17,7 +17,7 @@ NEWLINE = \n|\r\n EQUALS = = INTERPOLATION_START = {{ INTERPOLATION_END = }} -NAME = [a-zA-Z_-][a-zA-Z0-9_-]* +NAME = [a-zA-Z_][a-zA-Z0-9_-]* PLUS = + RAW_STRING = '[^'\r\n]*' STRING = "[^"]*" # also processes \n \r \t \" \\ escapes diff --git a/src/lib.rs b/src/lib.rs index 8645d14..9dc8ca8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1530,7 +1530,7 @@ fn tokenize(text: &str) -> Result, CompileError> { static ref EQUALS: Regex = token(r"=" ); static ref INTERPOLATION_END: Regex = token(r"[}][}]" ); static ref INTERPOLATION_START_TOKEN: Regex = token(r"[{][{]" ); - static ref NAME: Regex = token(r"([a-zA-Z_-][a-zA-Z0-9_-]*)"); + static ref NAME: Regex = token(r"([a-zA-Z_][a-zA-Z0-9_-]*)" ); static ref PLUS: Regex = token(r"[+]" ); static ref STRING: Regex = token("\"" ); static ref RAW_STRING: Regex = token(r#"'[^']*'"# );