svghmi/parse_labels.ysl2
changeset 3595 375626e60b63
parent 3594 30f7eade322f
equal deleted inserted replaced
3594:30f7eade322f 3595:375626e60b63
    68             if "not(regexp:test($freq,'^[0-9]*(\.[0-9]+)?[smh]?'))" {
    68             if "not(regexp:test($freq,'^[0-9]*(\.[0-9]+)?[smh]?'))" {
    69                 error > Widget id:«$id» label:«$full_decl» has wrong syntax of frequency forcing «$freq»
    69                 error > Widget id:«$id» label:«$full_decl» has wrong syntax of frequency forcing «$freq»
    70             }
    70             }
    71             attrib "freq" > «$freq»
    71             attrib "freq" > «$freq»
    72         }
    72         }
    73         foreach "str:split(substring-after($args, ':'), ':')" {
    73 
    74             arg {
       
    75                 attrib "value" > «.»
       
    76             }
       
    77         }
       
    78         // find "#" + JS expr at the end
    74         // find "#" + JS expr at the end
    79         const "tail", "substring-after($declaration,'@')";
    75         const "tail", "substring-after($declaration,'@')";
    80         const "taillen","string-length($tail)";
    76         const "taillen","string-length($tail)";
    81         const "has_enable", "contains($tail, '#')";
    77         const "has_enable", "contains($tail, '#')";
    82         const "paths" choose{
    78         const "paths" choose{
    86             otherwise value "$tail";
    82             otherwise value "$tail";
    87         }
    83         }
    88         if "$has_enable" {
    84         if "$has_enable" {
    89             const "enable_expr", "substring-after($tail,'#')";
    85             const "enable_expr", "substring-after($tail,'#')";
    90             attrib "enable_expr" value "$enable_expr";
    86             attrib "enable_expr" value "$enable_expr";
       
    87         }
       
    88 
       
    89         foreach "str:split(substring-after($args, ':'), ':')" {
       
    90             arg {
       
    91                 attrib "value" > «.»
       
    92             }
    91         }
    93         }
    92 
    94 
    93         // for stricter syntax checking, this should make error
    95         // for stricter syntax checking, this should make error
    94         // if $paths contains "@@" or ends with "@" (empty paths)
    96         // if $paths contains "@@" or ends with "@" (empty paths)
    95 
    97