Rename match to match_text for lexer user code blocks
This commit is contained in:
1 parent
47ad55ee2c
commit
d596d47cef
23 files changed
+124
-106
No files matched your search
@@ -60,7 +60,7 @@ token rbracket /\]/;
|
||||
token comma /,/;
|
||||
token colon /:/;
|
||||
token number /-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][-+]?[0-9]+)?/ <<
|
||||
let n: f64 = std::str::from_utf8(match_).unwrap().parse().unwrap();
|
||||
let n: f64 = std::str::from_utf8(match_text).unwrap().parse().unwrap();
|
||||
$$ = JSONValue::Number(n);
|
||||
>>
|
||||
token true <<
|
||||
@@ -106,11 +106,11 @@ string: /\\t/ <<
|
||||
>>
|
||||
string: /\\u[0-9a-fA-F]{4}/ <<
|
||||
/* Not actually going to encode the code point for this example... */
|
||||
let s: String = ['{', match_[2] as char, match_[3] as char, match_[4] as char, match_[5] as char, '}'].iter().collect();
|
||||
let s: String = ['{', match_text[2] as char, match_text[3] as char, match_text[4] as char, match_text[5] as char, '}'].iter().collect();
|
||||
${context.string_value}.push_str(&s);
|
||||
>>
|
||||
string: /[^\\]/ <<
|
||||
${context.string_value}.push(match_[0] as char);
|
||||
${context.string_value}.push(match_text[0] as char);
|
||||
>>
|
||||
Start -> Value <<
|
||||
$$ = $1;
|
||||
|
||||
Reference in new issue
Block a user