>> Line 228: if (matches && (predicate = DEFAULT_PREDICATES[matches[1]])) {
>> I will have to think about this stuff... I suggested a more general API
>> for registering formatters/predicates in one of the bugs. This doesn't
>> match what's in Python now.
>
> It might be better to work in JS first, our common language, then copy
> back to the other languages. Looking at this, I see I didn't follow
> what I did with formatters, though it seems that that slip was only in
> the JS version.
OK. This ties into the other thread about predicates taking
arguments. I still have to try the idea I outlined on that one bug.
>> http://codereview.appspot.com/124104/diff/1/2#newcode246
>> Line 246: if (predicate_target==null || predicate_target==undefined)
>> Please keep the style consistent and use spaces around ==, here and
>> throughout.
>
> Big breath... yes, I absolutely agree. <rant> But... I'm guessing you
> either have a small screen or you love Python with its indentation is
> a block metaphor, and you use vi. I use Eclipse, and every time I
> type } it formats the code above. All my stuff is perfectly consistent
> because of that. But I have to go back and convert tabs to spaces, and
> do everything by hand, and try and avoid hitting the } character,
> instead pasting it. And why is the indentation *two* spaces in JS???
> It makes me want to cry! Any coder worth their salt deserves at least
> one 30 inch monitor in each place they work (including home). You can
> quote me on that. It also demonstrates if a boss is worth *their*
> salt. </rant>
Blame Google for 2 spaces... I got used to that at work. I generally
have 3 windows of code side by side on 24" monitor.
But any editor, including Eclipse, will let you configure the style
for a particular project... you may just have to dig through a maze of
of dialog boxes to do it : ) The style is pretty straightforward --
80 cols and 2 space tabs, opening brace on the same line.
>> http://codereview.appspot.com/124104/diff/1/2#newcode253
>> Line 253: predicate_target: predicate_target, // public attribute
>> I think that sections blocks have names and no predicates, while "if"
>> blocks have predicates but no names.
>>
>> If that's the case then we should create a new "class" -- in Python I
>> created _PredicateSection and _Section, which derive from
>> _AbstractSection.
>
> Yes, but I wasn't sure when I started. I made it so I could do it any
> way I wanted. So I could even do this:
>
> {.section formatter-target|formatter|formatter ?perdicate-target|
> predicate?}
Yeah I don't think it works, there a lot of interactions that will
make it very confusing for an author to see what's going on. Remember
I did try to combine sections with predicates, but it is too
confusing. They can just be separate, and then it's all very clear,
and you don't lose anything.
>> http://codereview.appspot.com/124104/diff/1/2#newcode372
>> Line 372: var _SECTION_RE =
>> /^(?:(repeated)\s+)?section\s+(@|[A-Za-z0-9$_-]+)\s*$/;
>> I don't see why these changed.
>
> First, see the above comment. I was changing it when I was doing other
> things. But also, I think your version allowed this:
>
> {. section foo}
That may be the case... I don't think it's that big a deal, but that
could be tightened without changing a lot of other stuff.
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON
Template" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---