Merge pull request #21866 from Paulb23/fix_scientific_notation_highlight_issue_21435

Fixed scientific notation not highlighting correctly, issue 21435
This commit is contained in:
George Marques 2018-09-09 18:21:33 -03:00 committed by GitHub
commit af290f7b7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -121,8 +121,8 @@ Map<int, TextEdit::HighlighterInfo> GDScriptSyntaxHighlighter::_get_line_syntax_
is_hex_notation = false; is_hex_notation = false;
} }
// check for dot or underscore or 'x' for hex notation in floating point number // check for dot or underscore or 'x' for hex notation in floating point number or 'e' for scientific notation
if ((str[j] == '.' || str[j] == 'x' || str[j] == '_') && !in_word && prev_is_number && !is_number) { if ((str[j] == '.' || str[j] == 'x' || str[j] == '_' || str[j] == 'e') && !in_word && prev_is_number && !is_number) {
is_number = true; is_number = true;
is_symbol = false; is_symbol = false;
is_char = false; is_char = false;

View File

@ -6400,8 +6400,8 @@ Map<int, TextEdit::HighlighterInfo> TextEdit::_get_line_syntax_highlighting(int
is_hex_notation = false; is_hex_notation = false;
} }
// check for dot or underscore or 'x' for hex notation in floating point number // check for dot or underscore or 'x' for hex notation in floating point number or 'e' for scientific notation
if ((str[j] == '.' || str[j] == 'x' || str[j] == '_' || str[j] == 'f') && !in_word && prev_is_number && !is_number) { if ((str[j] == '.' || str[j] == 'x' || str[j] == '_' || str[j] == 'f' || str[j] == 'e') && !in_word && prev_is_number && !is_number) {
is_number = true; is_number = true;
is_symbol = false; is_symbol = false;
is_char = false; is_char = false;