| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ | 3 * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/ |
| 4 * Copyright (C) 2010 Google, Inc. All Rights Reserved. | 4 * Copyright (C) 2010 Google, Inc. All Rights Reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 while (*expectedCharacters) | 53 while (*expectedCharacters) |
| 54 source.advanceAndASSERTIgnoringCase(*expectedCharacters++); | 54 source.advanceAndASSERTIgnoringCase(*expectedCharacters++); |
| 55 } | 55 } |
| 56 | 56 |
| 57 inline void advanceStringAndASSERT(SegmentedString& source, const char* expected
Characters) | 57 inline void advanceStringAndASSERT(SegmentedString& source, const char* expected
Characters) |
| 58 { | 58 { |
| 59 while (*expectedCharacters) | 59 while (*expectedCharacters) |
| 60 source.advanceAndASSERT(*expectedCharacters++); | 60 source.advanceAndASSERT(*expectedCharacters++); |
| 61 } | 61 } |
| 62 | 62 |
| 63 #if COMPILER(MSVC) | |
| 64 // We need to disable the "unreachable code" warning because we want to assert | |
| 65 // that some code points aren't reached in the state machine. | |
| 66 #pragma warning(disable: 4702) | |
| 67 #endif | |
| 68 | |
| 69 #define BEGIN_STATE(prefix, stateName) case prefix::stateName: stateName: | 63 #define BEGIN_STATE(prefix, stateName) case prefix::stateName: stateName: |
| 70 #define END_STATE() ASSERT_NOT_REACHED(); break; | 64 #define END_STATE() ASSERT_NOT_REACHED(); break; |
| 71 | 65 |
| 72 // We use this macro when the HTML5 spec says "reconsume the current input | 66 // We use this macro when the HTML5 spec says "reconsume the current input |
| 73 // character in the <mumble> state." | 67 // character in the <mumble> state." |
| 74 #define RECONSUME_IN(prefix, stateName) \ | 68 #define RECONSUME_IN(prefix, stateName) \ |
| 75 do { \ | 69 do { \ |
| 76 m_state = prefix::stateName; \ | 70 m_state = prefix::stateName; \ |
| 77 goto stateName; \ | 71 goto stateName; \ |
| 78 } while (false) | 72 } while (false) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 97 m_state = prefix::stateName; \ | 91 m_state = prefix::stateName; \ |
| 98 if (source.isEmpty() || !m_inputStreamPreprocessor.peek(source)) \ | 92 if (source.isEmpty() || !m_inputStreamPreprocessor.peek(source)) \ |
| 99 return haveBufferedCharacterToken(); \ | 93 return haveBufferedCharacterToken(); \ |
| 100 cc = m_inputStreamPreprocessor.nextInputCharacter(); \ | 94 cc = m_inputStreamPreprocessor.nextInputCharacter(); \ |
| 101 goto stateName; \ | 95 goto stateName; \ |
| 102 } while (false) | 96 } while (false) |
| 103 | 97 |
| 104 } | 98 } |
| 105 | 99 |
| 106 #endif // MarkupTokenizerInlines_h | 100 #endif // MarkupTokenizerInlines_h |
| OLD | NEW |