From: <wol...@us...> - 2007-09-26 18:11:26
|
Revision: 6635 http://exist.svn.sourceforge.net/exist/?rev=6635&view=rev Author: wolfgang_m Date: 2007-09-26 11:11:25 -0700 (Wed, 26 Sep 2007) Log Message: ----------- Show line number with error "Default declarations have to come first". Modified Paths: -------------- trunk/eXist/src/org/exist/xquery/parser/XQuery.g trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java Modified: trunk/eXist/src/org/exist/xquery/parser/XQuery.g =================================================================== --- trunk/eXist/src/org/exist/xquery/parser/XQuery.g 2007-09-26 15:43:46 UTC (rev 6634) +++ trunk/eXist/src/org/exist/xquery/parser/XQuery.g 2007-09-26 18:11:25 UTC (rev 6635) @@ -217,10 +217,10 @@ importDecl | ( "declare" ( "default" | "boundary-space" | "ordering" | "construction" | "base-uri" | "copy-namespaces" | "namespace" ) ) => - setter + s:setter { if(!inSetters) - throw new TokenStreamException("Default declarations have to come first"); + throw new XPathException(#s, "Default declarations have to come first"); } | ( "declare" "option" ) Modified: trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java =================================================================== --- trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2007-09-26 15:43:46 UTC (rev 6634) +++ trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2007-09-26 18:11:25 UTC (rev 6635) @@ -735,6 +735,7 @@ returnAST = null; ASTPair currentAST = new ASTPair(); org.exist.xquery.parser.XQueryAST prolog_AST = null; + org.exist.xquery.parser.XQueryAST s_AST = null; boolean inSetters = true; { @@ -808,11 +809,12 @@ } if ( synPredMatched21 ) { setter(); + s_AST = (org.exist.xquery.parser.XQueryAST)returnAST; astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { if(!inSetters) - throw new TokenStreamException("Default declarations have to come first"); + throw new XPathException(s_AST, "Default declarations have to come first"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |