/*
*******************************************************************************
*
-* Copyright (C) 1998-2008, International Business Machines
+* Copyright (C) 1998-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
#include "read.h"
#include "errmsg.h"
#include "unicode/ustring.h"
+#include "unicode/utf16.h"
#define OPENBRACE 0x007B
#define CLOSEBRACE 0x007D
static UBool isWhitespace (UChar32 c);
static UBool isNewline (UChar32 c);
-void resetLineNumber() {
+U_CFUNC void resetLineNumber() {
lineCount = 1;
}
never return eString twice in a row; instead, multiple adjacent
string tokens will be merged into one, with no intervening
space. */
-enum ETokenType getNextToken(UCHARBUF* buf,
- struct UString *token,
- uint32_t *linenumber, /* out: linenumber of token */
- struct UString *comment,
- UErrorCode *status) {
+U_CFUNC enum ETokenType
+getNextToken(UCHARBUF* buf,
+ struct UString *token,
+ uint32_t *linenumber, /* out: linenumber of token */
+ struct UString *comment,
+ UErrorCode *status) {
enum ETokenType result;
UChar32 c;
seekUntilNewline(buf, NULL, status);
break;
- case ASTERISK: /* "/*" */
- c2 = ucbuf_getc(buf, status); /* "/*c" */
- if(c2 == ASTERISK){ /* "/**" */
+ case ASTERISK: /* " / * " */
+ c2 = ucbuf_getc(buf, status); /* "/ * c" */
+ if(c2 == ASTERISK){ /* "/ * *" */
/* parse multi-line comment and store it in token*/
seekUntilEndOfComment(buf, token, status);
} else {
- ucbuf_ungetc(c2, buf); /* c2 is the non-asterisk following "/*". Include c2 back in buffer. */
+ ucbuf_ungetc(c2, buf); /* c2 is the non-asterisk following "/ *". Include c2 back in buffer. */
seekUntilEndOfComment(buf, NULL, status);
}
break;
}
}
-UChar32 unescape(UCHARBUF *buf,
- UErrorCode *status) {
+U_CFUNC UChar32 unescape(UCHARBUF *buf, UErrorCode *status) {
if (U_FAILURE(*status)) {
return U_EOF;
}