[personal profile] rosefox posting in [community profile] style_system
I just tried to edit my style and got this error:

S2 Compiler Output at Sun Sep 13 02:31:23 2009
Error compiling layer:

Compile error: line 170, column 5: Can't override property 'font_base_size' of type string with new type int.
S2::NodeProperty, S2/NodeProperty.pm, 120
S2::NodePropGroup, S2/NodePropGroup.pm, 77
S2::Checker, S2/Checker.pm, 374
S2::Compiler, S2/Compiler.pm, 34


Context

166: property string font_base {
167: des = "Default Font for the page";
168: note = "This font will apply to the entire page as the base font. If you set any of the other font properties below, they will override this setting for that specific part of the page.";
169: }
170: property int font_base_size {
171: des = "Default Font Size for the page.";
172: }
173: property string font_header_title {
174: des = "Font for the Header Title";




What I can't figure out is why it expects it to be a string.

To confuse things further, this code has been in my style for ages and has always compiled fine before. It's completely unrelated to what I was changing. In fact, when I refresh the page and then hit "Save & compile" without making any changes at all to my existing and entirely functional style, I get that error.

Any idea how to fix it?

EDIT: I gave up and made all the ints into strings, and it mostly seems to be working okay except that now my menu bar is a million pixels high because it's supposed to be the header font size plus 8 and of course you can't add 8 to a string. I may just have to hardcode that. GRRR.

Date: 2009-09-13 04:27 pm (UTC)
branchandroot: oak against sky (Default)
From: [personal profile] branchandroot
*gales of laughter over your icon*

Well, perhaps you know, then. As I was just mentioning to Afuna, it really does seem useful to set those properties as math-able things. Does S2 allow for setting something as a float? And do you think that would work? I could forsee a bit of screwing around with "if no decimal add .0 to end" or "if increment equals % strip the .0 off again" to deal with non-decimals, but if it let people work with these things as numbers, it might be worth it.

Date: 2009-09-14 12:20 am (UTC)
av8rmike: Neo from Matrix, text: I know S2 (I know s2)
From: [personal profile] av8rmike
No, S2 doesn't include a float or double primitive. Other than this particular application, I can't think of many other places where you'd need support for decimals. Can you?
I would have to experiment to see if the language even allows converting between variable types.

Profile

Dreamwidth style system discussion

April 2025

S M T W T F S
  12345
6 78910 1112
13 141516171819
2021 2223242526
27282930   

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 14th, 2025 07:38 pm
Powered by Dreamwidth Studios