~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/parser/rpp/pp-internal.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
 
3
  Copyright 2006 Hamish Rodda <rodda@kde.org>
 
4
 
 
5
  Permission to use, copy, modify, distribute, and sell this software and its
 
6
  documentation for any purpose is hereby granted without fee, provided that
 
7
  the above copyright notice appear in all copies and that both that
 
8
  copyright notice and this permission notice appear in supporting
 
9
  documentation.
 
10
 
 
11
  The above copyright notice and this permission notice shall be included in
 
12
  all copies or substantial portions of the Software.
 
13
 
 
14
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
15
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
16
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
17
  KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
18
  AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
19
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
20
*/
 
21
 
 
22
#include "pp-internal.h"
 
23
#include "chartools.h"
 
24
 
 
25
bool rpp::isComment(Stream& input)
 
26
{
 
27
  uint c1 = input;
 
28
  uint c2 = input.peek();
 
29
 
 
30
  return c1 == indexFromCharacter('/') && (c2 == indexFromCharacter('/') || c2 == indexFromCharacter('*'));
 
31
}
 
32
 
 
33
rpp::Stream& rpp::devnull()
 
34
{
 
35
  // Multithread safe
 
36
  static rpp::Stream null;
 
37
  return null;
 
38
}