[josm-dev] Search and | ?

2008-12-20 Thread Russ Nelson
Hi.  Should | be used to separate two or terms of a search?  Or is
OR the only token?

I ask because | is not recognized by the tokenizer as a token, and
yet http://wiki.openstreetmap.org/wiki/JOSM/Search_function (used to
until I changed it) claim that | could be used to separate two or
terms of a search.

Just wondering: should I fix the code or leave the documentation fixed?

-- 
--my blog is athttp://blog.russnelson.com   | Delegislation is a slippery
Crynwr sells support for free software  | PGPok | slope to prosperity.
521 Pleasant Valley Rd. | +1 315-323-1241   | Fewer laws, more freedom.
Potsdam, NY 13676-3213  | Sheepdog  | (Not a GOP supporter).

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] new open location menu entry

2008-12-20 Thread Ævar Arnfjörð Bjarmason
On Fri, Dec 19, 2008 at 9:50 PM, Frederik Ramm frede...@remote.org wrote:
 Hi,

I have added an open location entry to the file menu which can be
 used to download any .osm file and directly import it into your working
 data set (or as a new layer).

 The way such downloads currently happen in JOSM is a bit haphazard, with
 the normal bounding box download, the relation completion download, and
 the new open location code all having some copy+pasted elements and
 generally hard to follow flow of control (either that or I'm just
 dense). I'll make an attempt to clean this up a bit.

Was this supposed to replace the Open File entry in the toolbar
(next to save/save as GPX) as it did?

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev


Re: [josm-dev] Search and | ?

2008-12-20 Thread Russ Nelson
Ævar Arnfjörð Bjarmason writes:
   Just wondering: should I fix the code or leave the documentation fixed?
  
  The code, | should work as OR but doesn't. There's a bug filed for
  this (which I didn't find).

Probably mine.

  I looked at it for a bit recently but didn't manage to fix it before
  getting distracted with other things, but I suspect one of the
  tokenizer rules is being too agressive and slurping up foo|bar as a
  literal token or something like that. At least that's how it gets
  parsed IIRC.

That's exactly the problem.  '|' ends up being a string rather than a
token.  If somebody checks this in, tell me and I'll restore the docs
to include | as a synonym for OR.  I've made other improvements to
the docs.  If somebody familiar with the intended operation could give
them a once-over look, I'd appreciate it.
http://wiki.openstreetmap.org/wiki/JOSM/Search_function 


nel...@nelson-desktop:~/osm/trunk$ svn diff
Index: src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java
===
--- src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java
(revision 1147)
+++ src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java
(working copy)
@@ -53,6 +53,8 @@
return (;
case ')':
return );
+   case '|':
+   return |;
case '':
s = new StringBuilder( );
for (int nc = search.read(); nc != -1  nc != 
''; nc = search.read())
@@ -69,7 +71,7 @@
return  +s.toString();
}
c = (char)next;
-   if (c == ' ' || c == '\t' || c == '' || c == 
':' || c == '(' || c == ')') {
+   if (c == ' ' || c == '\t' || c == '' || c == 
':' || c == '(' || c == ')' || c == '|') {
search.unread(next);
if (s.toString().equals(OR))
return |;


-- 
--my blog is athttp://blog.russnelson.com   | Delegislation is a slippery
Crynwr sells support for free software  | PGPok | slope to prosperity.
521 Pleasant Valley Rd. | +1 315-323-1241   | Fewer laws, more freedom.
Potsdam, NY 13676-3213  | Sheepdog  | (Not a GOP supporter).

___
josm-dev mailing list
josm-dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/josm-dev