Support vCard 4 LANG language-tag values
This commit is contained in:
@@ -1336,9 +1336,16 @@ macro genPropParsers(
|
|||||||
params = params))
|
params = params))
|
||||||
|
|
||||||
of vtText:
|
of vtText:
|
||||||
parseCase[1] = genAst(contents, typeName, pt):
|
if pn == pnLang:
|
||||||
p.validateType(params, pt)
|
parseCase[1] = genAst(contents, typeName, p):
|
||||||
contents.add(ac(typeName(value: p.readTextValue)))
|
let valueType = params.getSingleValue("VALUE")
|
||||||
|
if valueType.isSome and valueType.get != $vtLanguageTag:
|
||||||
|
p.error("parameter 'VALUE' must have the value '" & $vtLanguageTag & "'")
|
||||||
|
contents.add(ac(typeName(value: p.readTextValue)))
|
||||||
|
else:
|
||||||
|
parseCase[1] = genAst(contents, typeName, pt):
|
||||||
|
p.validateType(params, pt)
|
||||||
|
contents.add(ac(typeName(value: p.readTextValue)))
|
||||||
|
|
||||||
of vtTextList:
|
of vtTextList:
|
||||||
parseCase[1] = genAst(contents, typeName):
|
parseCase[1] = genAst(contents, typeName):
|
||||||
|
|||||||
Reference in New Issue
Block a user