OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 time.Add(n); | 52 time.Add(n); |
53 time.Add(0); | 53 time.Add(0); |
54 } else { | 54 } else { |
55 // n + ":" | 55 // n + ":" |
56 if (!time.Add(n)) return false; | 56 if (!time.Add(n)) return false; |
57 in.Skip('.'); | 57 in.Skip('.'); |
58 } | 58 } |
59 } else if (in.Skip('.') && time.IsExpecting(n)) { | 59 } else if (in.Skip('.') && time.IsExpecting(n)) { |
60 time.Add(n); | 60 time.Add(n); |
61 if (!in.IsAsciiDigit()) return false; | 61 if (!in.IsAsciiDigit()) return false; |
62 int n = in.ReadUnsignedNumber(); | 62 int n = in.ReadMilliseconds(); |
63 time.AddFinal(n); | 63 time.AddFinal(n); |
64 } else if (tz.IsExpecting(n)) { | 64 } else if (tz.IsExpecting(n)) { |
65 tz.SetAbsoluteMinute(n); | 65 tz.SetAbsoluteMinute(n); |
66 } else if (time.IsExpecting(n)) { | 66 } else if (time.IsExpecting(n)) { |
67 time.AddFinal(n); | 67 time.AddFinal(n); |
68 // Require end, white space, "Z", "+" or "-" immediately after | 68 // Require end, white space, "Z", "+" or "-" immediately after |
69 // finalizing time. | 69 // finalizing time. |
70 if (!in.IsEnd() && !in.SkipWhiteSpace() && !in.Is('Z') && | 70 if (!in.IsEnd() && !in.SkipWhiteSpace() && !in.Is('Z') && |
71 !in.IsAsciiSign()) return false; | 71 !in.IsAsciiSign()) return false; |
72 } else { | 72 } else { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Ignore other characters. | 116 // Ignore other characters. |
117 in.Next(); | 117 in.Next(); |
118 } | 118 } |
119 } | 119 } |
120 return day.Write(out) && time.Write(out) && tz.Write(out); | 120 return day.Write(out) && time.Write(out) && tz.Write(out); |
121 } | 121 } |
122 | 122 |
123 } } // namespace v8::internal | 123 } } // namespace v8::internal |
124 | 124 |
125 #endif // V8_DATEPARSER_INL_H_ | 125 #endif // V8_DATEPARSER_INL_H_ |
OLD | NEW |