From 85c5f17dcd09540e31dc879166502984e483609d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 18 Apr 2010 21:43:24 -0400 Subject: Have dmnsn_diagnostic() take a dmnsn_parse_location. --- dimension/directives.rules | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'dimension/directives.rules') diff --git a/dimension/directives.rules b/dimension/directives.rules index 82bdd8f..e199fe3 100644 --- a/dimension/directives.rules +++ b/dimension/directives.rules @@ -47,10 +47,8 @@ LANGUAGE_DIRECTIVE: "#include" STRING { dmnsn_delete_astnode($3); } | "#version" FLOAT ";" { - dmnsn_diagnostic(@$.first_filename, @$.first_line, - @$.first_column, - "WARNING: POV-Ray #version" - " backwards-compatibility not supported"); + dmnsn_diagnostic(@$, "WARNING: POV-Ray #version backwards-" + "compatibility not supported"); dmnsn_delete_astnode($2); } | "#debug" STRING { @@ -58,15 +56,11 @@ LANGUAGE_DIRECTIVE: "#include" STRING { dmnsn_delete_astnode($2); } | "#warning" STRING { - dmnsn_diagnostic(@$.first_filename, @$.first_line, - @$.first_column, - "WARNING: %s", (const char *)$2.ptr); + dmnsn_diagnostic(@$, "WARNING: %s", (const char *)$2.ptr); dmnsn_delete_astnode($2); } | "#error" STRING { - dmnsn_diagnostic(@$.first_filename, @$.first_line, - @$.first_column, - "%s", (const char *)$2.ptr); + dmnsn_diagnostic(@$, "%s", (const char *)$2.ptr); dmnsn_delete_astnode($2); YYERROR; } @@ -87,10 +81,8 @@ LANGUAGE_DIRECTIVE: "#include" STRING { unsigned int nparams_given = dmnsn_array_size($3.children); if (nparams_given != nparams) { - dmnsn_diagnostic(@$.first_filename, @$.first_line, - @$.first_column, - "wrong number of macro arguments" - " (%u; should be %u)", + dmnsn_diagnostic(@$, "wrong number of macro arguments" + " (%u; should be %u)", nparams_given, nparams); dmnsn_delete_astnode($3); YYERROR; -- cgit v1.2.3