OSL Script node: Slider with value range between 0 and 1 (like Fac)
March 14 2016
The markup enclosed in the [[  ]] is known as &quot;suggested metadata&quot;, it's shown in the OSL specifications pdf, something like this:
surface wood
            [[ string help = &quot;Realistic wood shader&quot; ]]
    (
        float Kd = 0.5
            [[ string help = &quot;Diffuse reflectivity&quot;,
                float min = 0, float max = 1 ]] ,
        color woodcolor = color (.7, .5, .3)
            [[ string help = &quot;Base color of the wood&quot; ]],
        color ringcolor = 0.25 * woodcolor
            [[ string help = &quot;Color of the dark rings&quot; ]],
        string texturename = &quot;wood.tx&quot;
            [[ string help = &quot;Texture map for the grain&quot;,
                string widget = &quot;filename&quot; ]],
        int pattern = 0
            [[ string widget = &quot;mapper&quot;,
                string options = &quot;oak:0|elm:1|walnut:2&quot; ]]
    )

is not currently supported, it gets ignored.
Until someone implements the parsing of suggested metadata the best you can do is implement the clamp yourself in your OSL code. The UI would still allow you to input values outside that range, therefore cosmetically this isn't a good solution, but if you make your code  deal with unwanted extreme values appropriately you'll still get stuff done.
Later when metadata parsing is implemented it's easy enough to strip away your clamping code.

related: Can a Script node using OSL have a checkbox?