Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(699)

Side by Side Diff: third_party/hunspell_new/src/parsers/manparser.cxx

Issue 1135173004: Rename third_party/hunspell_new back to third_party/hunspell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #include <cstdlib>
2 #include <cstring>
3 #include <cstdio>
4 #include <ctype.h>
5
6 #include "../hunspell/csutil.hxx"
7 #include "manparser.hxx"
8
9
10 #ifndef W32
11 using namespace std;
12 #endif
13
14 ManParser::ManParser() {
15 }
16
17 ManParser::ManParser(const char * wordchars)
18 {
19 init(wordchars);
20 }
21
22 ManParser::ManParser(unsigned short * wordchars, int len)
23 {
24 init(wordchars, len);
25 }
26
27 ManParser::~ManParser()
28 {
29 }
30
31 char * ManParser::next_token()
32 {
33 for (;;) {
34 switch (state)
35 {
36 case 1: // command arguments
37 if (line[actual][head] == ' ') state = 2;
38 break;
39 case 0: // dot in begin of line
40 if (line[actual][0] == '.') {
41 state = 1;
42 break;
43 } else {
44 state = 2;
45 }
46 // no break
47 case 2: // non word chars
48 if (is_wordchar(line[actual] + head)) {
49 state = 3;
50 token = head;
51 } else if ((line[actual][head] == '\\') &&
52 (line[actual][head + 1] == 'f') &&
53 (line[actual][head + 2] != '\0')) {
54 head += 2;
55 }
56 break;
57 case 3: // wordchar
58 if (! is_wordchar(line[actual] + head)) {
59 state = 2;
60 char * t = alloc_token(token, &head);
61 if (t) return t;
62 }
63 break;
64 }
65 if (next_char(line[actual], &head)) {
66 state = 0;
67 return NULL;
68 }
69 }
70 }
71
OLDNEW
« no previous file with comments | « third_party/hunspell_new/src/parsers/manparser.hxx ('k') | third_party/hunspell_new/src/parsers/testparser.cxx » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698