[GRASS-dev] Parser mess with incomplete parameters

Markus Metz markus.metz.giswork at googlemail.com
Thu Oct 27 15:59:49 EDT 2011


Markus Neteler wrote:
> GRASS 6.4.2svn (nc_spm_08):~ > v.to.rast input=hospitals =area layer=1
> column=cat output=hospitals use=attrLoading data...
> Reading features...
>  100%
> Writing raster map...
>  100%
> Converted areas: 0 of 0
> Converted points/lines: 160 of 160
> v.to.rast complete.
>
> It should NOT accept " =area".
>
> Interestingly, the parser is too relaxed and accepts nonsense:
>
> GRASS 6.4.2svn (nc_spm_08):~ > v.what.vect myhospitals qvect=urbanarea
> column=urb_name qcolumn=NAME =silly
>  100%
> ...
>
> GRASS 6.4.2svn (nc_spm_08):~ > v.what.vect myhospitals qvect=urbanarea
> column=urb_name qcolumn=NAME =silly ==d
>  100%
>  ...
>
> GRASS 6.4.2svn (nc_spm_08):~ > v.what.vect myhospitals qvect=urbanarea
> column=urb_name qcolumn=NAME =silly ==d layer=1
>  100%
>
> According to
>  http://trac.osgeo.org/grass/ticket/1477
> this was not the case in 6.4.1.
>
> Any ideas? I suspect this backport:
> http://trac.osgeo.org/grass/changeset/48233/grass/branches/releasebranch_6_4/lib/gis/parser.c
>
IMHO, the backport is correct, but does not fix all issues of the
parser, it's still too relaxed. And has at least one bug left. The
parser should probably exit with fatal error in case of some argument
of the form "=text", as other (non-GRASS) programs do.

my2c

Markus M


More information about the grass-dev mailing list