diff --git a/src/tmltranslator/TMLTextSpecification.java b/src/tmltranslator/TMLTextSpecification.java index 7d78767078316b0cd80da6f6ab9721f18e15c75a..88a1a21a14eb9bea8f85f9fd9b0ad836d13b322e 100755 --- a/src/tmltranslator/TMLTextSpecification.java +++ b/src/tmltranslator/TMLTextSpecification.java @@ -739,7 +739,7 @@ public class TMLTextSpecification { return -1; } - if (!checkParameter("LOSSYCHANNEL", _split, 3, 1, _lineNb)) { + if (!checkParameter("LOSSYCHANNEL", _split, 3, 9, _lineNb)) { return -1; } @@ -876,7 +876,7 @@ public class TMLTextSpecification { return -1; } - if (!checkParameter("LOSSYEVENT", _split, 3, 1, _lineNb)) { + if (!checkParameter("LOSSYEVENT", _split, 3, 9, _lineNb)) { return -1; } @@ -979,7 +979,7 @@ public class TMLTextSpecification { return -1; } - if (!checkParameter("LOSSYREQUEST", _split, 3, 1, _lineNb)) { + if (!checkParameter("LOSSYREQUEST", _split, 3, 9, _lineNb)) { return -1; } @@ -2408,6 +2408,11 @@ public class TMLTextSpecification { err = true; } break; + case 9: + if (!isANegativeOrPositiveNumeral(_split[_parameter])) { + err = true; + } + break; } } else { err = true; @@ -2444,6 +2449,13 @@ public class TMLTextSpecification { return _num.matches("\\d*"); } + public boolean isANegativeOrPositiveNumeral(String _num) { + if (_num.startsWith("-")) { + return isANumeral(_num.substring(1, _num.length())); + } + return isANumeral(_num); + } + public boolean isAValidUnit(String s) { if (s.compareTo("ns") == 0) { return true;