cssprovider: Improve error handling for import errors
We don't want to include the whitespace after an import statement. Because people tend to add newlines after @import, we report the wrong lines for failed imports. And that's bad.
This commit is contained in:
parent
a213b0b33e
commit
6f9cc94fae
@ -1790,7 +1790,7 @@ parse_import (GtkCssScanner *scanner)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_gtk_css_parser_try (scanner->parser, ";", TRUE))
|
if (!_gtk_css_parser_try (scanner->parser, ";", FALSE))
|
||||||
{
|
{
|
||||||
gtk_css_provider_invalid_token (scanner->provider, scanner, "semicolon");
|
gtk_css_provider_invalid_token (scanner->provider, scanner, "semicolon");
|
||||||
_gtk_css_parser_resync (scanner->parser, TRUE, 0);
|
_gtk_css_parser_resync (scanner->parser, TRUE, 0);
|
||||||
@ -1818,6 +1818,8 @@ parse_import (GtkCssScanner *scanner)
|
|||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
|
|
||||||
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_IMPORT);
|
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_IMPORT);
|
||||||
|
_gtk_css_parser_skip_whitespace (scanner->parser);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user