mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Keep Space Missions with Satellites in "except", leave "turn off the screen" alone, and part places after a compound country
"hide everything except space missions" (or "satellites") keeps both, as
switching either off takes the other. "turn off the screen" is no longer
read as a switch with "off the screen" taken off it, which left a place
search. A place joined after a compound country is another place ("near
Trinidad and Tobago and Barbados"), and a compound country after another
place stays whole ("near Paris and Trinidad and Tobago"). Only a word for a
kind of place written after a name ("Island", "City") drops a plan, so
"earthquakes lake tahoe" and "traffic tower bridge" keep theirs. Two doc
comments are back above their code.
Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
25d33a2e6f
commit
859aa172e7
4 files changed
+119
-16
No files matched your search
+27
-3
@@ -522,6 +522,9 @@ export function parseOmnibar(
|
||||
const extraPlaces = [];
|
||||
let previousHadPlace = false;
|
||||
let previousBarePlace = false;
|
||||
// Whether the clause before was a further place ("near Paris and
|
||||
// Trinidad"), which a compound name may go on ("and Tobago").
|
||||
let previousExtraPlace = false;
|
||||
let previousGo = false;
|
||||
// Whether a request was peeled off a "go to" clause, and how the place
|
||||
// was named: after "go to", after "near"/"in", or bare.
|
||||
@@ -561,6 +564,8 @@ export function parseOmnibar(
|
||||
const afterPlaceComma = previousHadPlace && separator === ',';
|
||||
// "trinidad and tobago": a bare place joined to a bare place by "and".
|
||||
const afterBarePlaceAnd = previousBarePlace && separator === 'and';
|
||||
const afterExtraPlace = previousExtraPlace;
|
||||
previousExtraPlace = false;
|
||||
const continuedLayer = previousLayerEnabled;
|
||||
const afterGo = previousGo;
|
||||
previousGo = false;
|
||||
@@ -607,10 +612,29 @@ export function parseOmnibar(
|
||||
afterPlace &&
|
||||
(separator === 'and' || separator === '&') &&
|
||||
compoundJoin(place.split(', ').at(-1), value);
|
||||
if (joinsName) place += `${joinsName}${value}`;
|
||||
else if (place && bare && afterBarePlaceAnd) place += ` and ${value}`;
|
||||
if (joinsName) {
|
||||
// The name is whole: a further "and" names another place ("near
|
||||
// Trinidad and Tobago and Barbados").
|
||||
place += `${joinsName}${value}`;
|
||||
previousHadPlace = true;
|
||||
previousBarePlace = false;
|
||||
return;
|
||||
}
|
||||
// "near Paris and Trinidad and Tobago": the further place is whole too.
|
||||
const joinsExtra =
|
||||
afterExtraPlace &&
|
||||
(separator === 'and' || separator === '&') &&
|
||||
compoundJoin(extraPlaces.at(-1), value);
|
||||
if (joinsExtra) {
|
||||
extraPlaces[extraPlaces.length - 1] += `${joinsExtra}${value}`;
|
||||
return;
|
||||
}
|
||||
if (place && bare && afterBarePlaceAnd) place += ` and ${value}`;
|
||||
else if (place && !afterPlaceComma) {
|
||||
if (separator === 'and') extraPlaces.push(value);
|
||||
if (separator === 'and') {
|
||||
extraPlaces.push(value);
|
||||
previousExtraPlace = true;
|
||||
}
|
||||
return;
|
||||
} else if (!place) {
|
||||
place = value;
|
||||
|
||||
Reference in new issue
Block a user