lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
List overview
Commits
September 2016
----- 2024 -----
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
commits@lists.geany.org
1 participants
80 discussions
Start a n
N
ew thread
[geany/geany] ba2209: Rename readLine() to readLineRaw()
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 30 Jul 2016 11:10:10 UTC Commit: ba2209e4a614731f7b1035af225bd9d2f1dcff07
https://github.com/geany/geany/commit/ba2209e4a614731f7b1035af225bd9d2f1dcf…
Log Message: ----------- Rename readLine() to readLineRaw() Plus make some minor changes in its implementation to match uctags. Modified Paths: -------------- ctags/main/entry.c ctags/main/lregex.c ctags/main/parse.c ctags/main/read.c ctags/main/read.h ctags/main/sort.c ctags/main/strlist.c Modified: ctags/main/entry.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -212,7 +212,7 @@ static long unsigned int updatePseudoTags (MIO *const mio) Assert (classLength < maxClassLength); mio_getpos (mio, &startOfLine); - line = readLine (TagFile.vLine, mio); + line = readLineRaw (TagFile.vLine, mio); while (line != NULL && line [0] == class [0]) { ++linesRead; @@ -228,12 +228,12 @@ static long unsigned int updatePseudoTags (MIO *const mio) } mio_getpos (mio, &startOfLine); } - line = readLine (TagFile.vLine, mio); + line = readLineRaw (TagFile.vLine, mio); } while (line != NULL) /* skip to end of file */ { ++linesRead; - line = readLine (TagFile.vLine, mio); + line = readLineRaw (TagFile.vLine, mio); } return linesRead; } @@ -253,7 +253,7 @@ static boolean isTagFile (const char *const filename) ok = TRUE; else if (mio != NULL) { - const char *line = readLine (TagFile.vLine, mio); + const char *line = readLineRaw (TagFile.vLine, mio); if (line == NULL) ok = TRUE; Modified: ctags/main/lregex.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -402,7 +402,7 @@ static void processLanguageRegex (const langType language, else { vString* const regex = vStringNew (); - while (readLine (regex, mio)) + while (readLineRaw (regex, mio)) addLanguageRegex (language, vStringValue (regex)); mio_free (mio); vStringDelete (regex); Modified: ctags/main/parse.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -170,7 +170,7 @@ static langType getInterpreterLanguage (const char *const fileName) if (fp != NULL) { vString* const vLine = vStringNew (); - const char* const line = readLine (vLine, fp); + const char* const line = readLineRaw (vLine, fp); if (line != NULL && line [0] == '#' && line [1] == '!') { const char* const lastSlash = strrchr (line, '/'); Modified: ctags/main/read.c 21 lines changed, 10 insertions(+), 11 deletions(-) =================================================================== @@ -532,17 +532,16 @@ extern const unsigned char *readLineFromInputFile (void) return result; } - /* - * Source file line reading with automatic buffer sizing + * Raw file line reading with automatic buffer sizing */ -extern char *readLine (vString *const vLine, MIO *const mio) +extern char *readLineRaw (vString *const vLine, MIO *const fp) { char *result = NULL; vStringClear (vLine); - if (mio == NULL) /* to free memory allocated to buffer */ - error (FATAL, "NULL MIO pointer"); + if (fp == NULL) /* to free memory allocated to buffer */ + error (FATAL, "NULL file pointer"); else { boolean reReadLine; @@ -555,15 +554,15 @@ extern char *readLine (vString *const vLine, MIO *const mio) do { char *const pLastChar = vStringValue (vLine) + vStringSize (vLine) -2; - MIOPos startOfLine; + long startOfLine; - mio_getpos (mio, &startOfLine); + startOfLine = mio_tell(fp); reReadLine = FALSE; *pLastChar = '\0'; - result = mio_gets (mio, vStringValue (vLine), (int) vStringSize (vLine)); + result = mio_gets (fp, vStringValue (vLine), (int) vStringSize (vLine)); if (result == NULL) { - if (! mio_eof (mio)) + if (! mio_eof (fp)) error (FATAL | PERROR, "Failure on attempt to read file"); } else if (*pLastChar != '\0' && @@ -572,7 +571,7 @@ extern char *readLine (vString *const vLine, MIO *const mio) /* buffer overflow */ reReadLine = vStringAutoResize (vLine); if (reReadLine) - mio_setpos (mio, &startOfLine); + mio_seek (fp, startOfLine, SEEK_SET); else error (FATAL | PERROR, "input line too big; out of memory"); } @@ -609,7 +608,7 @@ extern char *readSourceLine (vString *const vLine, MIOPos location, mio_setpos (File.fp, &location); if (pSeekValue != NULL) *pSeekValue = mio_tell (File.fp); - result = readLine (vLine, File.fp); + result = readLineRaw (vLine, File.fp); if (result == NULL) error (FATAL, "Unexpected end of file: %s", getInputFileName ()); mio_setpos (File.fp, &orignalPosition); Modified: ctags/main/read.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -111,7 +111,7 @@ extern int getNthPrevCFromInputFile (unsigned int nth, int def); extern int skipToCharacterInInputFile (int c); extern void ungetcToInputFile (int c); extern const unsigned char *readLineFromInputFile (void); -extern char *readLine (vString *const vLine, MIO *const mio); +extern char *readLineRaw (vString *const vLine, MIO *const fp); extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue); extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, const char *const fileName, const langType language ); Modified: ctags/main/sort.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -178,7 +178,7 @@ extern void internalSortTags (const boolean toStdout) failedSort (mio, NULL); for (i = 0 ; i < numTags && ! mio_eof (mio) ; ) { - line = readLine (vLine, mio); + line = readLineRaw (vLine, mio); if (line == NULL) { if (! mio_eof (mio)) Modified: ctags/main/strlist.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -97,7 +97,7 @@ extern stringList* stringListNewFromFile (const char* const fileName) while (! mio_eof (mio)) { vString* const str = vStringNew (); - readLine (str, mio); + readLineRaw (str, mio); vStringStripTrailing (str); if (vStringLength (str) > 0) stringListAdd (result, str); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] acdc44: Rename fileGetc() to getcFromInputFile()
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 30 Jul 2016 10:23:42 UTC Commit: acdc44074fc79183c5813b1fad5ca2151cfd2d1b
https://github.com/geany/geany/commit/acdc44074fc79183c5813b1fad5ca2151cfd2…
Log Message: ----------- Rename fileGetc() to getcFromInputFile() Modified Paths: -------------- ctags/main/get.c ctags/main/read.c ctags/main/read.h ctags/parsers/css.c ctags/parsers/fortran.c ctags/parsers/go.c ctags/parsers/haskell.c ctags/parsers/jscript.c ctags/parsers/json.c ctags/parsers/make.c ctags/parsers/php.c ctags/parsers/powershell.c ctags/parsers/rust.c ctags/parsers/sql.c ctags/parsers/verilog.c ctags/parsers/vhdl.c Modified: ctags/main/get.c 58 lines changed, 29 insertions(+), 29 deletions(-) =================================================================== @@ -180,7 +180,7 @@ static boolean readDirective (int c, char *const name, unsigned int maxLength) { if (i > 0) { - c = fileGetc (); + c = getcFromInputFile (); if (c == EOF || ! isalpha (c)) { fileUngetc (c); @@ -203,7 +203,7 @@ static void readIdentifier (int c, vString *const name) do { vStringPut (name, c); - c = fileGetc (); + c = getcFromInputFile (); } while (c != EOF && isident (c)); fileUngetc (c); vStringTerminate (name); @@ -334,7 +334,7 @@ static void directiveDefine (const int c) if (isident1 (c)) { readIdentifier (c, Cpp.directive.name); - nc = fileGetc (); + nc = getcFromInputFile (); fileUngetc (nc); parameterized = (boolean) (nc == '('); if (! isIgnore ()) @@ -353,7 +353,7 @@ static void directivePragma (int c) /* generate macro tag for weak name */ do { - c = fileGetc (); + c = getcFromInputFile (); } while (c == SPACE); if (isident1 (c)) { @@ -435,7 +435,7 @@ static boolean handleDirective (const int c) static Comment isComment (void) { Comment comment; - const int next = fileGetc (); + const int next = getcFromInputFile (); if (next == '*') comment = COMMENT_C; @@ -456,15 +456,15 @@ static Comment isComment (void) */ int skipOverCComment (void) { - int c = fileGetc (); + int c = getcFromInputFile (); while (c != EOF) { if (c != '*') - c = fileGetc (); + c = getcFromInputFile (); else { - const int next = fileGetc (); + const int next = getcFromInputFile (); if (next != '/') c = next; @@ -484,10 +484,10 @@ static int skipOverCplusComment (void) { int c; - while ((c = fileGetc ()) != EOF) + while ((c = getcFromInputFile ()) != EOF) { if (c == BACKSLASH) - fileGetc (); /* throw away next character, too */ + getcFromInputFile (); /* throw away next character, too */ else if (c == NEWLINE) break; } @@ -499,15 +499,15 @@ static int skipOverCplusComment (void) */ static int skipOverDComment (void) { - int c = fileGetc (); + int c = getcFromInputFile (); while (c != EOF) { if (c != '+') - c = fileGetc (); + c = getcFromInputFile (); else { - const int next = fileGetc (); + const int next = getcFromInputFile (); if (next != '/') c = next; @@ -528,10 +528,10 @@ static int skipToEndOfString (boolean ignoreBackslash) { int c; - while ((c = fileGetc ()) != EOF) + while ((c = getcFromInputFile ()) != EOF) { if (c == BACKSLASH && ! ignoreBackslash) - fileGetc (); /* throw away next character, too */ + getcFromInputFile (); /* throw away next character, too */ else if (c == DOUBLE_QUOTE) break; } @@ -546,7 +546,7 @@ static int isCxxRawLiteralDelimiterChar (int c) static int skipToEndOfCxxRawLiteralString (void) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c != '(' && ! isCxxRawLiteralDelimiterChar (c)) { @@ -573,15 +573,15 @@ static int skipToEndOfCxxRawLiteralString (void) { unsigned int i = 0; - while ((c = fileGetc ()) != EOF && i < delimLen && delim[i] == c) + while ((c = getcFromInputFile ()) != EOF && i < delimLen && delim[i] == c) i++; if (i == delimLen && c == DOUBLE_QUOTE) break; else fileUngetc (c); } } - while ((c = fileGetc ()) != EOF); + while ((c = getcFromInputFile ()) != EOF); c = STRING_SYMBOL; } return c; @@ -596,11 +596,11 @@ static int skipToEndOfChar (void) int c; int count = 0, veraBase = '\0'; - while ((c = fileGetc ()) != EOF) + while ((c = getcFromInputFile ()) != EOF) { ++count; if (c == BACKSLASH) - fileGetc (); /* throw away next character, too */ + getcFromInputFile (); /* throw away next character, too */ else if (c == SINGLE_QUOTE) break; else if (c == NEWLINE) @@ -639,7 +639,7 @@ extern int cppGetc (void) } else do { - c = fileGetc (); + c = getcFromInputFile (); process: switch (c) { @@ -698,7 +698,7 @@ extern int cppGetc (void) case BACKSLASH: { - int next = fileGetc (); + int next = getcFromInputFile (); if (next == NEWLINE) continue; @@ -709,12 +709,12 @@ extern int cppGetc (void) case '?': { - int next = fileGetc (); + int next = getcFromInputFile (); if (next != '?') fileUngetc (next); else { - next = fileGetc (); + next = getcFromInputFile (); switch (next) { case '(': c = '['; break; @@ -740,7 +740,7 @@ extern int cppGetc (void) */ case '<': { - int next = fileGetc (); + int next = getcFromInputFile (); switch (next) { case ':': c = '['; break; @@ -751,7 +751,7 @@ extern int cppGetc (void) } case ':': { - int next = fileGetc (); + int next = getcFromInputFile (); if (next == '>') c = ']'; else @@ -760,7 +760,7 @@ extern int cppGetc (void) } case '%': { - int next = fileGetc (); + int next = getcFromInputFile (); switch (next) { case '>': c = '}'; break; @@ -773,7 +773,7 @@ extern int cppGetc (void) default: if (c == '@' && Cpp.hasAtLiteralStrings) { - int next = fileGetc (); + int next = getcFromInputFile (); if (next == DOUBLE_QUOTE) { Cpp.directive.accept = FALSE; @@ -810,7 +810,7 @@ extern int cppGetc (void) (! isident (prev2) && (prev == 'L' || prev == 'u' || prev == 'U')) || (! isident (prev3) && (prev2 == 'u' && prev == '8'))) { - int next = fileGetc (); + int next = getcFromInputFile (); if (next != DOUBLE_QUOTE) fileUngetc (next); else Modified: ctags/main/read.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -455,7 +455,7 @@ static vString *iFileGetLine (void) /* Do not mix use of fileReadLine () and fileGetc () for the same file. */ -extern int fileGetc (void) +extern int getcFromInputFile (void) { int c; @@ -509,7 +509,7 @@ extern int fileSkipToCharacter (int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } Modified: ctags/main/read.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -106,7 +106,7 @@ extern void freeSourceFileResources (void); extern boolean fileOpen (const char *const fileName, const langType language); extern boolean fileEOF (void); extern void fileClose (void); -extern int fileGetc (void); +extern int getcFromInputFile (void); extern int fileGetNthPrevC (unsigned int nth, int def); extern int fileSkipToCharacter (int c); extern void fileUngetc (int c); Modified: ctags/parsers/css.c 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -60,7 +60,7 @@ static void parseSelector (vString *const string, const int firstChar) do { vStringPut (string, (char) c); - c = fileGetc (); + c = getcFromInputFile (); } while (isSelectorChar (c)); fileUngetc (c); vStringTerminate (string); @@ -74,9 +74,9 @@ static void readToken (tokenInfo *const token) getNextChar: - c = fileGetc (); + c = getcFromInputFile (); while (isspace (c)) - c = fileGetc (); + c = getcFromInputFile (); token->type = c; switch (c) @@ -90,9 +90,9 @@ static void readToken (tokenInfo *const token) do { vStringPut (token->string, c); - c = fileGetc (); + c = getcFromInputFile (); if (c == '\\') - c = fileGetc (); + c = getcFromInputFile (); } while (c != EOF && c != delimiter); if (c != EOF) @@ -103,7 +103,7 @@ static void readToken (tokenInfo *const token) case '/': /* maybe comment start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (d != '*') { fileUngetc (d); @@ -112,11 +112,11 @@ static void readToken (tokenInfo *const token) } else { - d = fileGetc (); + d = getcFromInputFile (); do { c = d; - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && ! (c == '*' && d == '/')); goto getNextChar; Modified: ctags/parsers/fortran.c 20 lines changed, 10 insertions(+), 10 deletions(-) =================================================================== @@ -523,7 +523,7 @@ static int skipLine (void) int c; do - c = fileGetc (); + c = getcFromInputFile (); while (c != EOF && c != '\n'); return c; @@ -546,7 +546,7 @@ static lineType getLineType (void) do /* read in first 6 "margin" characters */ { - int c = fileGetc (); + int c = getcFromInputFile (); /* 3.2.1 Comment_Line. A comment line is any line that contains * a C or an asterisk in column 1, or contains only blank characters @@ -628,7 +628,7 @@ static int getFixedFormChar (void) else #endif { - c = fileGetc (); + c = getcFromInputFile (); ++Column; } if (c == '\n') @@ -644,7 +644,7 @@ static int getFixedFormChar (void) } else if (c == '&') /* check for free source form */ { - const int c2 = fileGetc (); + const int c2 = getcFromInputFile (); if (c2 == '\n') longjmp (Exception, (int) ExceptionFixedFormat); else @@ -684,7 +684,7 @@ static int getFixedFormChar (void) Column = 5; do { - c = fileGetc (); + c = getcFromInputFile (); ++Column; } while (isBlank (c)); if (c == '\n') @@ -707,14 +707,14 @@ static int skipToNextLine (void) { int c = skipLine (); if (c != EOF) - c = fileGetc (); + c = getcFromInputFile (); return c; } static int getFreeFormChar (boolean inComment) { boolean advanceLine = FALSE; - int c = fileGetc (); + int c = getcFromInputFile (); /* If the last nonblank, non-comment character of a FORTRAN 90 * free-format text line is an ampersand then the next non-comment @@ -723,7 +723,7 @@ static int getFreeFormChar (boolean inComment) if (! inComment && c == '&') { do - c = fileGetc (); + c = getcFromInputFile (); while (isspace (c) && c != '\n'); if (c == '\n') { @@ -743,15 +743,15 @@ static int getFreeFormChar (boolean inComment) while (advanceLine) { while (isspace (c)) - c = fileGetc (); + c = getcFromInputFile (); if (c == '!' || (NewLine && c == '#')) { c = skipToNextLine (); NewLine = TRUE; continue; } if (c == '&') - c = fileGetc (); + c = getcFromInputFile (); else advanceLine = FALSE; } Modified: ctags/parsers/go.c 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -176,12 +176,12 @@ static void parseString (vString *const string, const int delimiter) boolean end = FALSE; while (!end) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == EOF) end = TRUE; else if (c == '\\' && delimiter != '`') { - c = fileGetc (); + c = getcFromInputFile (); if (c != '\'' && c != '\"') vStringPut (string, '\\'); vStringPut (string, c); @@ -200,7 +200,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); fileUngetc (c); /* always unget, LF might add a semicolon */ @@ -220,7 +220,7 @@ static void readToken (tokenInfo *const token) getNextChar: do { - c = fileGetc (); + c = getcFromInputFile (); token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); if (c == '\n' && (lastTokenType == TOKEN_IDENTIFIER || @@ -254,7 +254,7 @@ static void readToken (tokenInfo *const token) case '/': { boolean hasNewline = FALSE; - int d = fileGetc (); + int d = getcFromInputFile (); switch (d) { case '/': @@ -271,14 +271,14 @@ static void readToken (tokenInfo *const token) { do { - d = fileGetc (); + d = getcFromInputFile (); if (d == '\n') { hasNewline = TRUE; } } while (d != EOF && d != '*'); - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else @@ -306,7 +306,7 @@ static void readToken (tokenInfo *const token) case '<': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '-') token->type = TOKEN_LEFT_ARROW; else Modified: ctags/parsers/haskell.c 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -56,7 +56,7 @@ static void skip_rest_of_line(void) { int c; do { - c = fileGetc(); + c = getcFromInputFile(); } while (c != EOF && c != '\n'); } @@ -65,7 +65,7 @@ static int get_line(char *buf) int i = 0; int c; do { - c = fileGetc(); + c = getcFromInputFile(); buf[i++] = c; } while (c != EOF && c != '\n' && i < 1000); buf[i] = '\0'; @@ -75,10 +75,10 @@ static int get_line(char *buf) static int get_next_char(void) { int c, nxt; - c = fileGetc(); + c = getcFromInputFile(); if (c == EOF) return c; - nxt = fileGetc(); + nxt = getcFromInputFile(); if (nxt == EOF) return c; fileUngetc(nxt); @@ -116,12 +116,12 @@ static int isident(char c) static int get_token(char *token, int n) { - int c = fileGetc(); + int c = getcFromInputFile(); int i = n; while (c != EOF && isident(c) && i < 1000) { token[i] = c; i++; - c = fileGetc(); + c = getcFromInputFile(); } token[i] = '\0'; if (c == EOF) @@ -244,7 +244,7 @@ static void findHaskellTags (int is_literate) } if (is_literate && !in_tex_lit_code) { if (c == '>') { - c = fileGetc(); + c = getcFromInputFile(); if (c == ' ') { c = get_next_char(); if (!isident(c)) { @@ -294,7 +294,7 @@ static void findHaskellTags (int is_literate) continue; } do { - if ((c = fileGetc()) == EOF) + if ((c = getcFromInputFile()) == EOF) return; } while (c == ' ' || c == '\t'); arg[0] = c; Modified: ctags/parsers/jscript.c 28 lines changed, 14 insertions(+), 14 deletions(-) =================================================================== @@ -329,7 +329,7 @@ static int skipToCharacter (const int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } @@ -339,7 +339,7 @@ static void parseString (vString *const string, const int delimiter) boolean end = FALSE; while (! end) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == EOF) end = TRUE; else if (c == '\\') @@ -350,12 +350,12 @@ static void parseString (vString *const string, const int delimiter) * Also, handle the fact that <LineContinuation> produces an empty * sequence. * See ECMA-262 7.8.4 */ - c = fileGetc(); + c = getcFromInputFile(); if (c != '\r' && c != '\n') vStringPut(string, c); else if (c == '\r') { - c = fileGetc(); + c = getcFromInputFile(); if (c != '\n') fileUngetc (c); } @@ -383,18 +383,18 @@ static void parseRegExp (void) do { - c = fileGetc (); + c = getcFromInputFile (); if (! in_range && c == '/') { do /* skip flags */ { - c = fileGetc (); + c = getcFromInputFile (); } while (isalpha (c)); fileUngetc (c); break; } else if (c == '\\') - c = fileGetc (); /* skip next character */ + c = getcFromInputFile (); /* skip next character */ else if (c == '[') in_range = TRUE; else if (c == ']') @@ -412,7 +412,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); fileUngetc (c); /* unget non-identifier character */ @@ -441,7 +441,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt i = 0; do { - c = fileGetc (); + c = getcFromInputFile (); i++; } while (c == '\t' || c == ' ' || @@ -475,7 +475,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt case '+': case '-': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == c) /* ++ or -- */ token->type = TOKEN_POSTFIX_OPERATOR; else @@ -545,7 +545,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt break; case '\\': - c = fileGetc (); + c = getcFromInputFile (); if (c != '\\' && c != '"' && !isspace (c)) fileUngetc (c); token->type = TOKEN_CHARACTER; @@ -555,7 +555,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt case '/': { - int d = fileGetc (); + int d = getcFromInputFile (); if ( (d != '*') && /* is this the start of a comment? */ (d != '/') ) /* is a one line comment? */ { @@ -588,7 +588,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt do { skipToCharacter ('*'); - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else @@ -612,7 +612,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt /* skip shebang in case of e.g. Node.js scripts */ if (token->lineNumber > 1) token->type = TOKEN_UNDEFINED; - else if ((c = fileGetc ()) != '!') + else if ((c = getcFromInputFile ()) != '!') { fileUngetc (c); token->type = TOKEN_UNDEFINED; Modified: ctags/parsers/json.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -149,7 +149,7 @@ static void readTokenFull (tokenInfo *const token, vStringClear (token->string); do - c = fileGetc (); + c = getcFromInputFile (); while (c == '\t' || c == ' ' || c == '\r' || c == '\n'); token->lineNumber = getSourceLineNumber (); @@ -171,7 +171,7 @@ static void readTokenFull (tokenInfo *const token, token->type = TOKEN_STRING; while (TRUE) { - c = fileGetc (); + c = getcFromInputFile (); /* we don't handle unicode escapes but they are safe */ if (escaped) escaped = FALSE; @@ -196,7 +196,7 @@ static void readTokenFull (tokenInfo *const token, do { vStringPut (token->string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (c != EOF && isIdentChar (c)); vStringTerminate (token->string); Modified: ctags/parsers/make.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -41,10 +41,10 @@ static kindOption MakeKinds [] = { static int nextChar (void) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == '\\') { - c = fileGetc (); + c = getcFromInputFile (); if (c == '\n') c = nextChar (); } Modified: ctags/parsers/php.c 116 lines changed, 58 insertions(+), 58 deletions(-) =================================================================== @@ -493,7 +493,7 @@ static int skipToCharacter (const int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } @@ -502,9 +502,9 @@ static void parseString (vString *const string, const int delimiter) { while (TRUE) { - int c = fileGetc (); + int c = getcFromInputFile (); - if (c == '\\' && (c = fileGetc ()) != EOF) + if (c == '\\' && (c = getcFromInputFile ()) != EOF) vStringPut (string, (char) c); else if (c == EOF || c == delimiter) break; @@ -544,21 +544,21 @@ static void parseHeredoc (vString *const string) do { - c = fileGetc (); + c = getcFromInputFile (); } while (c == ' ' || c == '\t'); if (c == '\'' || c == '"') { quote = c; - c = fileGetc (); + c = getcFromInputFile (); } for (len = 0; len < (sizeof delimiter / sizeof delimiter[0]) - 1; len++) { if (! isIdentChar (c)) break; delimiter[len] = (char) c; - c = fileGetc (); + c = getcFromInputFile (); } delimiter[len] = 0; @@ -568,14 +568,14 @@ static void parseHeredoc (vString *const string) { if (c != quote) /* no closing quote for quoted identifier, give up */ goto error; - c = fileGetc (); + c = getcFromInputFile (); } if (c != '\r' && c != '\n') /* missing newline, give up */ goto error; do { - c = fileGetc (); + c = getcFromInputFile (); if (c != '\r' && c != '\n') vStringPut (string, (char) c); @@ -585,9 +585,9 @@ static void parseHeredoc (vString *const string) int nl = c; int extra = EOF; - c = fileGetc (); + c = getcFromInputFile (); for (len = 0; c != 0 && (c - delimiter[len]) == 0; len++) - c = fileGetc (); + c = getcFromInputFile (); if (delimiter[len] != 0) fileUngetc (c); @@ -602,7 +602,7 @@ static void parseHeredoc (vString *const string) } else if (c == ';') { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '\r' || d == '\n') { /* put back the semicolon since it's not part of the @@ -643,7 +643,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, (char) c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); fileUngetc (c); vStringTerminate (string); @@ -668,7 +668,7 @@ static boolean isSpace (int c) static int skipWhitespaces (int c) { while (isSpace (c)) - c = fileGetc (); + c = getcFromInputFile (); return c; } @@ -682,36 +682,36 @@ static boolean isOpenScriptLanguagePhp (int c) /* <script[:white:]+language[:white:]*= */ if (c != '<' || - tolower ((c = fileGetc ())) != 's' || - tolower ((c = fileGetc ())) != 'c' || - tolower ((c = fileGetc ())) != 'r' || - tolower ((c = fileGetc ())) != 'i' || - tolower ((c = fileGetc ())) != 'p' || - tolower ((c = fileGetc ())) != 't' || - ! isSpace ((c = fileGetc ())) || + tolower ((c = getcFromInputFile ())) != 's' || + tolower ((c = getcFromInputFile ())) != 'c' || + tolower ((c = getcFromInputFile ())) != 'r' || + tolower ((c = getcFromInputFile ())) != 'i' || + tolower ((c = getcFromInputFile ())) != 'p' || + tolower ((c = getcFromInputFile ())) != 't' || + ! isSpace ((c = getcFromInputFile ())) || tolower ((c = skipWhitespaces (c))) != 'l' || - tolower ((c = fileGetc ())) != 'a' || - tolower ((c = fileGetc ())) != 'n' || - tolower ((c = fileGetc ())) != 'g' || - tolower ((c = fileGetc ())) != 'u' || - tolower ((c = fileGetc ())) != 'a' || - tolower ((c = fileGetc ())) != 'g' || - tolower ((c = fileGetc ())) != 'e' || - (c = skipWhitespaces (fileGetc ())) != '=') + tolower ((c = getcFromInputFile ())) != 'a' || + tolower ((c = getcFromInputFile ())) != 'n' || + tolower ((c = getcFromInputFile ())) != 'g' || + tolower ((c = getcFromInputFile ())) != 'u' || + tolower ((c = getcFromInputFile ())) != 'a' || + tolower ((c = getcFromInputFile ())) != 'g' || + tolower ((c = getcFromInputFile ())) != 'e' || + (c = skipWhitespaces (getcFromInputFile ())) != '=') return FALSE; /* (php|'php'|"php")> */ - c = skipWhitespaces (fileGetc ()); + c = skipWhitespaces (getcFromInputFile ()); if (c == '"' || c == '\'') { quote = c; - c = fileGetc (); + c = getcFromInputFile (); } if (tolower (c) != 'p' || - tolower ((c = fileGetc ())) != 'h' || - tolower ((c = fileGetc ())) != 'p' || - (quote != 0 && (c = fileGetc ()) != quote) || - (c = skipWhitespaces (fileGetc ())) != '>') + tolower ((c = getcFromInputFile ())) != 'h' || + tolower ((c = getcFromInputFile ())) != 'p' || + (quote != 0 && (c = getcFromInputFile ()) != quote) || + (c = skipWhitespaces (getcFromInputFile ())) != '>') return FALSE; return TRUE; @@ -722,16 +722,16 @@ static int findPhpStart (void) int c; do { - if ((c = fileGetc ()) == '<') + if ((c = getcFromInputFile ()) == '<') { - c = fileGetc (); + c = getcFromInputFile (); /* <? and <?php, but not <?xml */ if (c == '?') { /* don't enter PHP mode on "<?xml", yet still support short open tags (<?) */ - if (tolower ((c = fileGetc ())) != 'x' || - tolower ((c = fileGetc ())) != 'm' || - tolower ((c = fileGetc ())) != 'l') + if (tolower ((c = getcFromInputFile ())) != 'x' || + tolower ((c = getcFromInputFile ())) != 'm' || + tolower ((c = getcFromInputFile ())) != 'l') { break; } @@ -755,10 +755,10 @@ static int skipSingleComment (void) int c; do { - c = fileGetc (); + c = getcFromInputFile (); if (c == '\r') { - int next = fileGetc (); + int next = getcFromInputFile (); if (next != '\n') fileUngetc (next); else @@ -767,7 +767,7 @@ static int skipSingleComment (void) /* ?> in single-line comments leaves PHP mode */ else if (c == '?') { - int next = fileGetc (); + int next = getcFromInputFile (); if (next == '>') InPhp = FALSE; else @@ -794,7 +794,7 @@ static void readToken (tokenInfo *const token) InPhp = TRUE; } else - c = fileGetc (); + c = getcFromInputFile (); c = skipWhitespaces (c); @@ -818,7 +818,7 @@ static void readToken (tokenInfo *const token) case '=': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '=' || d == '>') token->type = TOKEN_OPERATOR; else @@ -839,17 +839,17 @@ static void readToken (tokenInfo *const token) case '<': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '/') { /* </script[:white:]*> */ - if (tolower ((d = fileGetc ())) == 's' && - tolower ((d = fileGetc ())) == 'c' && - tolower ((d = fileGetc ())) == 'r' && - tolower ((d = fileGetc ())) == 'i' && - tolower ((d = fileGetc ())) == 'p' && - tolower ((d = fileGetc ())) == 't' && - (d = skipWhitespaces (fileGetc ())) == '>') + if (tolower ((d = getcFromInputFile ())) == 's' && + tolower ((d = getcFromInputFile ())) == 'c' && + tolower ((d = getcFromInputFile ())) == 'r' && + tolower ((d = getcFromInputFile ())) == 'i' && + tolower ((d = getcFromInputFile ())) == 'p' && + tolower ((d = getcFromInputFile ())) == 't' && + (d = skipWhitespaces (getcFromInputFile ())) == '>') { InPhp = FALSE; goto getNextChar; @@ -860,7 +860,7 @@ static void readToken (tokenInfo *const token) token->type = TOKEN_UNDEFINED; } } - else if (d == '<' && (d = fileGetc ()) == '<') + else if (d == '<' && (d = getcFromInputFile ()) == '<') { token->type = TOKEN_STRING; parseHeredoc (token->string); @@ -883,7 +883,7 @@ static void readToken (tokenInfo *const token) case '*': case '%': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d != '=') fileUngetc (d); token->type = TOKEN_OPERATOR; @@ -892,7 +892,7 @@ static void readToken (tokenInfo *const token) case '/': /* division or comment start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '/') /* single-line comment */ { skipSingleComment (); @@ -905,7 +905,7 @@ static void readToken (tokenInfo *const token) c = skipToCharacter ('*'); if (c != EOF) { - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else @@ -925,7 +925,7 @@ static void readToken (tokenInfo *const token) case '$': /* variable start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (! isIdentChar (d)) { fileUngetc (d); @@ -941,7 +941,7 @@ static void readToken (tokenInfo *const token) case '?': /* maybe the end of the PHP chunk */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '>') { InPhp = FALSE; Modified: ctags/parsers/powershell.c 24 lines changed, 12 insertions(+), 12 deletions(-) =================================================================== @@ -197,7 +197,7 @@ static int skipToCharacter (const int c) int d; do { - d = fileGetc (); + d = getcFromInputFile (); } while (d != EOF && d != c); return d; } @@ -206,9 +206,9 @@ static void parseString (vString *const string, const int delimiter) { while (TRUE) { - int c = fileGetc (); + int c = getcFromInputFile (); - if (c == '\\' && (c = fileGetc ()) != EOF) + if (c == '\\' && (c = getcFromInputFile ()) != EOF) vStringPut (string, (char) c); else if (c == EOF || c == delimiter) break; @@ -224,7 +224,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, (char) c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); fileUngetc (c); vStringTerminate (string); @@ -245,7 +245,7 @@ static boolean isSpace (int c) static int skipWhitespaces (int c) { while (isSpace (c)) - c = fileGetc (); + c = getcFromInputFile (); return c; } @@ -254,10 +254,10 @@ static int skipSingleComment (void) int c; do { - c = fileGetc (); + c = getcFromInputFile (); if (c == '\r') { - int next = fileGetc (); + int next = getcFromInputFile (); if (next != '\n') fileUngetc (next); else @@ -276,7 +276,7 @@ static void readToken (tokenInfo *const token) getNextChar: - c = fileGetc (); + c = getcFromInputFile (); c = skipWhitespaces (c); token->lineNumber = getSourceLineNumber (); @@ -307,7 +307,7 @@ static void readToken (tokenInfo *const token) case '<': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d == '#') { /* <# ... #> multiline comment */ @@ -316,7 +316,7 @@ static void readToken (tokenInfo *const token) c = skipToCharacter ('#'); if (c != EOF) { - c = fileGetc (); + c = getcFromInputFile (); if (c == '>') break; else @@ -344,7 +344,7 @@ static void readToken (tokenInfo *const token) case '/': case '%': { - int d = fileGetc (); + int d = getcFromInputFile (); if (d != '=') fileUngetc (d); token->type = TOKEN_OPERATOR; @@ -353,7 +353,7 @@ static void readToken (tokenInfo *const token) case '$': /* variable start */ { - int d = fileGetc (); + int d = getcFromInputFile (); if (! isIdentChar (d)) { fileUngetc (d); Modified: ctags/parsers/rust.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -141,7 +141,7 @@ static void writeCurTokenToStr (lexerState *lexer, vString *out_str) static void advanceChar (lexerState *lexer) { lexer->cur_c = lexer->next_c; - lexer->next_c = fileGetc(); + lexer->next_c = getcFromInputFile(); } /* Reads N characters from the file */ Modified: ctags/parsers/sql.c 18 lines changed, 9 insertions(+), 9 deletions(-) =================================================================== @@ -466,13 +466,13 @@ static void parseString (vString *const string, const int delimiter) boolean end = FALSE; while (! end) { - int c = fileGetc (); + int c = getcFromInputFile (); if (c == EOF) end = TRUE; /* else if (c == '\\') { - c = fileGetc(); // This maybe a ' or ". // + c = getcFromInputFile(); // This maybe a ' or ". // vStringPut(string, c); } */ @@ -493,7 +493,7 @@ static void parseIdentifier (vString *const string, const int firstChar) do { vStringPut (string, c); - c = fileGetc (); + c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); if (!isspace (c)) @@ -511,7 +511,7 @@ static void readToken (tokenInfo *const token) getNextChar: do { - c = fileGetc (); + c = getcFromInputFile (); token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); /* @@ -551,7 +551,7 @@ static void readToken (tokenInfo *const token) break; case '-': - c = fileGetc (); + c = getcFromInputFile (); if (c == '-') /* -- is this the start of a comment? */ { fileSkipToCharacter ('\n'); @@ -569,7 +569,7 @@ static void readToken (tokenInfo *const token) case '>': { const int initial = c; - int d = fileGetc (); + int d = getcFromInputFile (); if (d == initial) { if (initial == '<') @@ -586,7 +586,7 @@ static void readToken (tokenInfo *const token) } case '\\': - c = fileGetc (); + c = getcFromInputFile (); if (c != '\\' && c != '"' && c != '\'' && !isspace (c)) fileUngetc (c); token->type = TOKEN_CHARACTER; @@ -596,7 +596,7 @@ static void readToken (tokenInfo *const token) case '/': { - int d = fileGetc (); + int d = getcFromInputFile (); if ( (d != '*') && /* is this the start of a comment? */ (d != '/') ) /* is a one line comment? */ { @@ -610,7 +610,7 @@ static void readToken (tokenInfo *const token) do { fileSkipToCharacter ('*'); - c = fileGetc (); + c = getcFromInputFile (); if (c == '/') break; else Modified: ctags/parsers/verilog.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -122,21 +122,21 @@ static int vGetc (void) { int c; if (Ungetc == '\0') - c = fileGetc (); + c = getcFromInputFile (); else { c = Ungetc; Ungetc = '\0'; } if (c == '/') { - int c2 = fileGetc (); + int c2 = getcFromInputFile (); if (c2 == EOF) longjmp (Exception, (int) ExceptionEOF); else if (c2 == '/') /* strip comment until end-of-line */ { do - c = fileGetc (); + c = getcFromInputFile (); while (c != '\n' && c != EOF); } else if (c2 == '*') /* strip block comment */ @@ -152,7 +152,7 @@ static int vGetc (void) { int c2; do - c2 = fileGetc (); + c2 = getcFromInputFile (); while (c2 != '"' && c2 != EOF); c = '@'; } Modified: ctags/parsers/vhdl.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -119,21 +119,21 @@ static int vGetc (void) { int c; if (Ungetc == '\0') - c = fileGetc (); + c = getcFromInputFile (); else { c = Ungetc; Ungetc = '\0'; } if (c == '-') { - int c2 = fileGetc (); + int c2 = getcFromInputFile (); if (c2 == EOF) longjmp (Exception, (int) ExceptionEOF); else if (c2 == '-') /* strip comment until end-of-line */ { do - c = fileGetc (); + c = getcFromInputFile (); while (c != '\n' && c != EOF); } else -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 357e4f: Rename fileUngetc() to ungetcToInputFile()
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 30 Jul 2016 10:31:59 UTC Commit: 357e4fe1bd55861e5a6f70b3d2417a05ca2b29a0
https://github.com/geany/geany/commit/357e4fe1bd55861e5a6f70b3d2417a05ca2b2…
Log Message: ----------- Rename fileUngetc() to ungetcToInputFile() Modified Paths: -------------- ctags/main/get.c ctags/main/read.c ctags/main/read.h ctags/parsers/css.c ctags/parsers/fortran.c ctags/parsers/go.c ctags/parsers/haskell.c ctags/parsers/jscript.c ctags/parsers/json.c ctags/parsers/make.c ctags/parsers/php.c ctags/parsers/powershell.c ctags/parsers/sql.c ctags/parsers/verilog.c Modified: ctags/main/get.c 36 lines changed, 18 insertions(+), 18 deletions(-) =================================================================== @@ -183,7 +183,7 @@ static boolean readDirective (int c, char *const name, unsigned int maxLength) c = getcFromInputFile (); if (c == EOF || ! isalpha (c)) { - fileUngetc (c); + ungetcToInputFile (c); break; } } @@ -205,7 +205,7 @@ static void readIdentifier (int c, vString *const name) vStringPut (name, c); c = getcFromInputFile (); } while (c != EOF && isident (c)); - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (name); } @@ -335,7 +335,7 @@ static void directiveDefine (const int c) { readIdentifier (c, Cpp.directive.name); nc = getcFromInputFile (); - fileUngetc (nc); + ungetcToInputFile (nc); parameterized = (boolean) (nc == '('); if (! isIgnore ()) makeDefineTag (vStringValue (Cpp.directive.name), parameterized); @@ -445,7 +445,7 @@ static Comment isComment (void) comment = COMMENT_D; else { - fileUngetc (next); + ungetcToInputFile (next); comment = COMMENT_NONE; } return comment; @@ -550,7 +550,7 @@ static int skipToEndOfCxxRawLiteralString (void) if (c != '(' && ! isCxxRawLiteralDelimiterChar (c)) { - fileUngetc (c); + ungetcToInputFile (c); c = skipToEndOfString (FALSE); } else @@ -578,7 +578,7 @@ static int skipToEndOfCxxRawLiteralString (void) if (i == delimLen && c == DOUBLE_QUOTE) break; else - fileUngetc (c); + ungetcToInputFile (c); } } while ((c = getcFromInputFile ()) != EOF); @@ -605,14 +605,14 @@ static int skipToEndOfChar (void) break; else if (c == NEWLINE) { - fileUngetc (c); + ungetcToInputFile (c); break; } else if (count == 1 && strchr ("DHOB", toupper (c)) != NULL) veraBase = c; else if (veraBase != '\0' && ! isalnum (c)) { - fileUngetc (c); + ungetcToInputFile (c); break; } } @@ -687,7 +687,7 @@ extern int cppGetc (void) { c = skipOverCplusComment (); if (c == NEWLINE) - fileUngetc (c); + ungetcToInputFile (c); } else if (comment == COMMENT_D) c = skipOverDComment (); @@ -703,15 +703,15 @@ extern int cppGetc (void) if (next == NEWLINE) continue; else - fileUngetc (next); + ungetcToInputFile (next); break; } case '?': { int next = getcFromInputFile (); if (next != '?') - fileUngetc (next); + ungetcToInputFile (next); else { next = getcFromInputFile (); @@ -727,8 +727,8 @@ extern int cppGetc (void) case '-': c = '~'; break; case '=': c = '#'; goto process; default: - fileUngetc ('?'); - fileUngetc (next); + ungetcToInputFile ('?'); + ungetcToInputFile (next); break; } } @@ -745,7 +745,7 @@ extern int cppGetc (void) { case ':': c = '['; break; case '%': c = '{'; break; - default: fileUngetc (next); + default: ungetcToInputFile (next); } goto enter; } @@ -755,7 +755,7 @@ extern int cppGetc (void) if (next == '>') c = ']'; else - fileUngetc (next); + ungetcToInputFile (next); goto enter; } case '%': @@ -765,7 +765,7 @@ extern int cppGetc (void) { case '>': c = '}'; break; case ':': c = '#'; goto process; - default: fileUngetc (next); + default: ungetcToInputFile (next); } goto enter; } @@ -781,7 +781,7 @@ extern int cppGetc (void) break; } else - fileUngetc (next); + ungetcToInputFile (next); } else if (c == 'R' && Cpp.hasCxxRawLiteralStrings) { @@ -812,7 +812,7 @@ extern int cppGetc (void) { int next = getcFromInputFile (); if (next != DOUBLE_QUOTE) - fileUngetc (next); + ungetcToInputFile (next); else { Cpp.directive.accept = FALSE; Modified: ctags/main/read.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -416,7 +416,7 @@ static int iFileGetc (void) return c; } -extern void fileUngetc (int c) +extern void ungetcToInputFile (int c) { const size_t len = sizeof File.ungetchBuf / sizeof File.ungetchBuf[0]; Modified: ctags/main/read.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -109,7 +109,7 @@ extern void fileClose (void); extern int getcFromInputFile (void); extern int fileGetNthPrevC (unsigned int nth, int def); extern int fileSkipToCharacter (int c); -extern void fileUngetc (int c); +extern void ungetcToInputFile (int c); extern const unsigned char *fileReadLine (void); extern char *readLine (vString *const vLine, MIO *const mio); extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue); Modified: ctags/parsers/css.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -62,7 +62,7 @@ static void parseSelector (vString *const string, const int firstChar) vStringPut (string, (char) c); c = getcFromInputFile (); } while (isSelectorChar (c)); - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (string); } @@ -106,7 +106,7 @@ static void readToken (tokenInfo *const token) int d = getcFromInputFile (); if (d != '*') { - fileUngetc (d); + ungetcToInputFile (d); vStringPut (token->string, c); token->type = c; } Modified: ctags/parsers/fortran.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -648,7 +648,7 @@ static int getFixedFormChar (void) if (c2 == '\n') longjmp (Exception, (int) ExceptionFixedFormat); else - fileUngetc (c2); + ungetcToInputFile (c2); } } while (Column == 0) @@ -691,7 +691,7 @@ static int getFixedFormChar (void) Column = 0; else if (Column > 6) { - fileUngetc (c); + ungetcToInputFile (c); c = ' '; } break; @@ -734,7 +734,7 @@ static int getFreeFormChar (boolean inComment) advanceLine = TRUE; else { - fileUngetc (c); + ungetcToInputFile (c); c = '&'; } } Modified: ctags/parsers/go.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -203,7 +203,7 @@ static void parseIdentifier (vString *const string, const int firstChar) c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); - fileUngetc (c); /* always unget, LF might add a semicolon */ + ungetcToInputFile (c); /* always unget, LF might add a semicolon */ } static void readToken (tokenInfo *const token) @@ -264,7 +264,7 @@ static void readToken (tokenInfo *const token) * continue through the next * newline. A line comment acts * like a newline. */ - fileUngetc ('\n'); + ungetcToInputFile ('\n'); goto getNextChar; case '*': do @@ -282,14 +282,14 @@ static void readToken (tokenInfo *const token) if (c == '/') break; else - fileUngetc (c); + ungetcToInputFile (c); } while (c != EOF && c != '\0'); - fileUngetc (hasNewline ? '\n' : ' '); + ungetcToInputFile (hasNewline ? '\n' : ' '); goto getNextChar; default: token->type = TOKEN_OTHER; - fileUngetc (d); + ungetcToInputFile (d); break; } } @@ -311,7 +311,7 @@ static void readToken (tokenInfo *const token) token->type = TOKEN_LEFT_ARROW; else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_OTHER; } } Modified: ctags/parsers/haskell.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -81,7 +81,7 @@ static int get_next_char(void) nxt = getcFromInputFile(); if (nxt == EOF) return c; - fileUngetc(nxt); + ungetcToInputFile(nxt); if (c == '-' && nxt == '-') { skip_rest_of_line(); @@ -127,7 +127,7 @@ static int get_token(char *token, int n) if (c == EOF) return 0; if (i != n) { - fileUngetc(c); + ungetcToInputFile(c); return 1; } else { return 0; Modified: ctags/parsers/jscript.c 20 lines changed, 10 insertions(+), 10 deletions(-) =================================================================== @@ -357,7 +357,7 @@ static void parseString (vString *const string, const int delimiter) { c = getcFromInputFile(); if (c != '\n') - fileUngetc (c); + ungetcToInputFile (c); } } else if (c == delimiter) @@ -368,7 +368,7 @@ static void parseString (vString *const string, const int delimiter) end = TRUE; /* we don't want to eat the newline itself to let the automatic * semicolon insertion code kick in */ - fileUngetc (c); + ungetcToInputFile (c); } else vStringPut (string, c); @@ -390,7 +390,7 @@ static void parseRegExp (void) { c = getcFromInputFile (); } while (isalpha (c)); - fileUngetc (c); + ungetcToInputFile (c); break; } else if (c == '\\') @@ -415,7 +415,7 @@ static void parseIdentifier (vString *const string, const int firstChar) c = getcFromInputFile (); } while (isIdentChar (c)); vStringTerminate (string); - fileUngetc (c); /* unget non-identifier character */ + ungetcToInputFile (c); /* unget non-identifier character */ } static keywordId analyzeToken (vString *const name) @@ -480,7 +480,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt token->type = TOKEN_POSTFIX_OPERATOR; else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_BINARY_OPERATOR; } break; @@ -547,7 +547,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt case '\\': c = getcFromInputFile (); if (c != '\\' && c != '"' && !isspace (c)) - fileUngetc (c); + ungetcToInputFile (c); token->type = TOKEN_CHARACTER; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); @@ -559,7 +559,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt if ( (d != '*') && /* is this the start of a comment? */ (d != '/') ) /* is a one line comment? */ { - fileUngetc (d); + ungetcToInputFile (d); switch (LastTokenType) { case TOKEN_CHARACTER: @@ -592,7 +592,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt if (c == '/') break; else - fileUngetc (c); + ungetcToInputFile (c); } while (c != EOF && c != '\0'); goto getNextChar; } @@ -601,7 +601,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt skipToCharacter ('\n'); /* if we care about newlines, put it back so it is seen */ if (include_newlines) - fileUngetc ('\n'); + ungetcToInputFile ('\n'); goto getNextChar; } } @@ -614,7 +614,7 @@ static void readTokenFull (tokenInfo *const token, boolean include_newlines, vSt token->type = TOKEN_UNDEFINED; else if ((c = getcFromInputFile ()) != '!') { - fileUngetc (c); + ungetcToInputFile (c); token->type = TOKEN_UNDEFINED; } else Modified: ctags/parsers/json.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -200,7 +200,7 @@ static void readTokenFull (tokenInfo *const token, } while (c != EOF && isIdentChar (c)); vStringTerminate (token->string); - fileUngetc (c); + ungetcToInputFile (c); switch (lookupKeyword (vStringValue (token->string), Lang_json)) { case KEYWORD_true: token->type = TOKEN_TRUE; break; Modified: ctags/parsers/make.c 10 lines changed, 5 insertions(+), 5 deletions(-) =================================================================== @@ -58,7 +58,7 @@ static void skipLine (void) c = nextChar (); while (c != EOF && c != '\n'); if (c == '\n') - fileUngetc (c); + ungetcToInputFile (c); } static int skipToNonWhite (int c) @@ -119,7 +119,7 @@ static void readIdentifier (const int first, vString *const id) vStringPut (id, c); c = nextChar (); } - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (id); } @@ -159,14 +159,14 @@ static void findMakeTags (void) else if (variable_possible && c == '?') { c = nextChar (); - fileUngetc (c); + ungetcToInputFile (c); variable_possible = (c == '='); } else if (variable_possible && c == ':' && stringListCount (identifiers) > 0) { c = nextChar (); - fileUngetc (c); + ungetcToInputFile (c); if (c != '=') { unsigned int i; @@ -207,7 +207,7 @@ static void findMakeTags (void) c = nextChar (); } if (c == '\n') - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (name); vStringStripTrailing (name); newMacro (name); Modified: ctags/parsers/php.c 34 lines changed, 17 insertions(+), 17 deletions(-) =================================================================== @@ -590,14 +590,14 @@ static void parseHeredoc (vString *const string) c = getcFromInputFile (); if (delimiter[len] != 0) - fileUngetc (c); + ungetcToInputFile (c); else { /* line start matched the delimiter, now check whether there * is anything after it */ if (c == '\r' || c == '\n') { - fileUngetc (c); + ungetcToInputFile (c); break; } else if (c == ';') @@ -608,14 +608,14 @@ static void parseHeredoc (vString *const string) /* put back the semicolon since it's not part of the * string. we can't put back the newline, but it's a * whitespace character nobody cares about it anyway */ - fileUngetc (';'); + ungetcToInputFile (';'); break; } else { /* put semicolon in the string and continue */ extra = ';'; - fileUngetc (d); + ungetcToInputFile (d); } } } @@ -634,7 +634,7 @@ static void parseHeredoc (vString *const string) return; error: - fileUngetc (c); + ungetcToInputFile (c); } static void parseIdentifier (vString *const string, const int firstChar) @@ -645,7 +645,7 @@ static void parseIdentifier (vString *const string, const int firstChar) vStringPut (string, (char) c); c = getcFromInputFile (); } while (isIdentChar (c)); - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (string); } @@ -739,7 +739,7 @@ static int findPhpStart (void) /* <script language="php"> */ else { - fileUngetc (c); + ungetcToInputFile (c); if (isOpenScriptLanguagePhp ('<')) break; } @@ -760,7 +760,7 @@ static int skipSingleComment (void) { int next = getcFromInputFile (); if (next != '\n') - fileUngetc (next); + ungetcToInputFile (next); else c = next; } @@ -771,7 +771,7 @@ static int skipSingleComment (void) if (next == '>') InPhp = FALSE; else - fileUngetc (next); + ungetcToInputFile (next); } } while (InPhp && c != EOF && c != '\n' && c != '\r'); return c; @@ -823,7 +823,7 @@ static void readToken (tokenInfo *const token) token->type = TOKEN_OPERATOR; else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_EQUAL_SIGN; } break; @@ -856,7 +856,7 @@ static void readToken (tokenInfo *const token) } else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_UNDEFINED; } } @@ -867,7 +867,7 @@ static void readToken (tokenInfo *const token) } else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_UNDEFINED; } break; @@ -885,7 +885,7 @@ static void readToken (tokenInfo *const token) { int d = getcFromInputFile (); if (d != '=') - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_OPERATOR; break; } @@ -909,15 +909,15 @@ static void readToken (tokenInfo *const token) if (c == '/') break; else - fileUngetc (c); + ungetcToInputFile (c); } } while (c != EOF && c != '\0'); goto getNextChar; } else { if (d != '=') - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_OPERATOR; } break; @@ -928,7 +928,7 @@ static void readToken (tokenInfo *const token) int d = getcFromInputFile (); if (! isIdentChar (d)) { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_UNDEFINED; } else @@ -949,7 +949,7 @@ static void readToken (tokenInfo *const token) } else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_UNDEFINED; } break; Modified: ctags/parsers/powershell.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -226,7 +226,7 @@ static void parseIdentifier (vString *const string, const int firstChar) vStringPut (string, (char) c); c = getcFromInputFile (); } while (isIdentChar (c)); - fileUngetc (c); + ungetcToInputFile (c); vStringTerminate (string); } @@ -259,7 +259,7 @@ static int skipSingleComment (void) { int next = getcFromInputFile (); if (next != '\n') - fileUngetc (next); + ungetcToInputFile (next); else c = next; } @@ -320,14 +320,14 @@ static void readToken (tokenInfo *const token) if (c == '>') break; else - fileUngetc (c); + ungetcToInputFile (c); } } while (c != EOF); goto getNextChar; } else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_UNDEFINED; } break; @@ -346,7 +346,7 @@ static void readToken (tokenInfo *const token) { int d = getcFromInputFile (); if (d != '=') - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_OPERATOR; break; } @@ -356,7 +356,7 @@ static void readToken (tokenInfo *const token) int d = getcFromInputFile (); if (! isIdentChar (d)) { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_UNDEFINED; } else Modified: ctags/parsers/sql.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -497,7 +497,7 @@ static void parseIdentifier (vString *const string, const int firstChar) } while (isIdentChar (c)); vStringTerminate (string); if (!isspace (c)) - fileUngetc (c); /* unget non-identifier character */ + ungetcToInputFile (c); /* unget non-identifier character */ } static void readToken (tokenInfo *const token) @@ -560,7 +560,7 @@ static void readToken (tokenInfo *const token) else { if (!isspace (c)) - fileUngetc (c); + ungetcToInputFile (c); token->type = TOKEN_OPERATOR; } break; @@ -579,7 +579,7 @@ static void readToken (tokenInfo *const token) } else { - fileUngetc (d); + ungetcToInputFile (d); token->type = TOKEN_UNDEFINED; } break; @@ -588,7 +588,7 @@ static void readToken (tokenInfo *const token) case '\\': c = getcFromInputFile (); if (c != '\\' && c != '"' && c != '\'' && !isspace (c)) - fileUngetc (c); + ungetcToInputFile (c); token->type = TOKEN_CHARACTER; token->lineNumber = getSourceLineNumber (); token->filePosition = getInputFilePosition (); @@ -601,7 +601,7 @@ static void readToken (tokenInfo *const token) (d != '/') ) /* is a one line comment? */ { token->type = TOKEN_FORWARD_SLASH; - fileUngetc (d); + ungetcToInputFile (d); } else { @@ -614,7 +614,7 @@ static void readToken (tokenInfo *const token) if (c == '/') break; else - fileUngetc (c); + ungetcToInputFile (c); } while (c != EOF && c != '\0'); goto getNextChar; } Modified: ctags/parsers/verilog.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -145,7 +145,7 @@ static int vGetc (void) } else { - fileUngetc (c2); + ungetcToInputFile (c2); } } else if (c == '"') /* strip string contents */ -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] bf2b64: Rename fileGetNthPrevC() to getNthPrevCFromInputFile()
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 30 Jul 2016 10:51:24 UTC Commit: bf2b64239a7958168ae1ffc9e9623c320e14d2ab
https://github.com/geany/geany/commit/bf2b64239a7958168ae1ffc9e9623c320e14d…
Log Message: ----------- Rename fileGetNthPrevC() to getNthPrevCFromInputFile() Modified Paths: -------------- ctags/main/get.c ctags/main/read.c ctags/main/read.h Modified: ctags/main/get.c 6 lines changed, 3 insertions(+), 3 deletions(-) =================================================================== @@ -802,9 +802,9 @@ extern int cppGetc (void) * "xxx(raw)xxx"; * * which is perfectly valid (yet probably very unlikely). */ - int prev = fileGetNthPrevC (1, '\0'); - int prev2 = fileGetNthPrevC (2, '\0'); - int prev3 = fileGetNthPrevC (3, '\0'); + int prev = getNthPrevCFromInputFile (1, '\0'); + int prev2 = getNthPrevCFromInputFile (2, '\0'); + int prev3 = getNthPrevCFromInputFile (3, '\0'); if (! isident (prev) || (! isident (prev2) && (prev == 'L' || prev == 'u' || prev == 'U')) || Modified: ctags/main/read.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -493,7 +493,7 @@ extern int getcFromInputFile (void) /* returns the nth previous character (0 meaning current), or def if nth cannot * be accessed. Note that this can't access previous line data. */ -extern int fileGetNthPrevC (unsigned int nth, int def) +extern int getNthPrevCFromInputFile (unsigned int nth, int def) { const unsigned char *base = (unsigned char *) vStringValue (File.line); const unsigned int offset = File.ungetchIdx + 1 + nth; Modified: ctags/main/read.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -107,7 +107,7 @@ extern boolean fileOpen (const char *const fileName, const langType language); extern boolean fileEOF (void); extern void fileClose (void); extern int getcFromInputFile (void); -extern int fileGetNthPrevC (unsigned int nth, int def); +extern int getNthPrevCFromInputFile (unsigned int nth, int def); extern int skipToCharacterInInputFile (int c); extern void ungetcToInputFile (int c); extern const unsigned char *fileReadLine (void); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 61278d: Rename fileSkipToCharacter() to skipToCharacterInInputFile()
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 30 Jul 2016 10:50:57 UTC Commit: 61278d40314db93beab70377f593cce586e7f312
https://github.com/geany/geany/commit/61278d40314db93beab70377f593cce586e7f…
Log Message: ----------- Rename fileSkipToCharacter() to skipToCharacterInInputFile() Modified Paths: -------------- ctags/main/read.c ctags/main/read.h ctags/parsers/go.c ctags/parsers/sql.c Modified: ctags/main/read.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -504,7 +504,7 @@ extern int fileGetNthPrevC (unsigned int nth, int def) return def; } -extern int fileSkipToCharacter (int c) +extern int skipToCharacterInInputFile (int c) { int d; do Modified: ctags/main/read.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -108,7 +108,7 @@ extern boolean fileEOF (void); extern void fileClose (void); extern int getcFromInputFile (void); extern int fileGetNthPrevC (unsigned int nth, int def); -extern int fileSkipToCharacter (int c); +extern int skipToCharacterInInputFile (int c); extern void ungetcToInputFile (int c); extern const unsigned char *fileReadLine (void); extern char *readLine (vString *const vLine, MIO *const mio); Modified: ctags/parsers/go.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -258,7 +258,7 @@ static void readToken (tokenInfo *const token) switch (d) { case '/': - fileSkipToCharacter ('\n'); + skipToCharacterInInputFile ('\n'); /* Line comments start with the * character sequence // and * continue through the next Modified: ctags/parsers/sql.c 8 lines changed, 4 insertions(+), 4 deletions(-) =================================================================== @@ -554,7 +554,7 @@ static void readToken (tokenInfo *const token) c = getcFromInputFile (); if (c == '-') /* -- is this the start of a comment? */ { - fileSkipToCharacter ('\n'); + skipToCharacterInInputFile ('\n'); goto getNextChar; } else @@ -609,7 +609,7 @@ static void readToken (tokenInfo *const token) { do { - fileSkipToCharacter ('*'); + skipToCharacterInInputFile ('*'); c = getcFromInputFile (); if (c == '/') break; @@ -620,7 +620,7 @@ static void readToken (tokenInfo *const token) } else if (d == '/') /* is this the start of a comment? */ { - fileSkipToCharacter ('\n'); + skipToCharacterInInputFile ('\n'); goto getNextChar; } } @@ -639,7 +639,7 @@ static void readToken (tokenInfo *const token) if (isKeyword (token, KEYWORD_rem)) { vStringClear (token->string); - fileSkipToCharacter ('\n'); + skipToCharacterInInputFile ('\n'); goto getNextChar; } else if (isKeyword (token, KEYWORD_NONE)) -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 1e36d2: Add separate "input" entry to sInputFile and use it
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sat, 30 Jul 2016 09:53:26 UTC Commit: 1e36d2367e2b1180a84d7830b0f0e79be2dc44c8
https://github.com/geany/geany/commit/1e36d2367e2b1180a84d7830b0f0e79be2dc4…
Log Message: ----------- Add separate "input" entry to sInputFile and use it This patch basically just replaces sInputFile.name -> sInputFile.input.name sInputFile.lineNumber -> sInputFile.input.lineNumber plus some minor related stuff. Modified Paths: -------------- ctags/main/entry.c ctags/main/read.c ctags/main/read.h ctags/main/vstring.c ctags/main/vstring.h ctags/parsers/sh.c Modified: ctags/main/entry.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -387,7 +387,7 @@ extern void makeTagEntry (const tagEntryInfo *const tag) { Assert (tag->name != NULL); if (tag->name [0] == '\0') - error (WARNING, "ignoring null tag in %s", vStringValue (File.name)); + error (WARNING, "ignoring null tag in %s", getInputFileName ()); else { int length = 0; Modified: ctags/main/read.c 25 lines changed, 13 insertions(+), 12 deletions(-) =================================================================== @@ -37,7 +37,7 @@ static MIOPos StartOfLine; /* holds deferred position of start of line */ extern void freeSourceFileResources (void) { - vStringDelete (File.name); + vStringDelete (File.input.name); vStringDelete (File.path); vStringDelete (File.source.name); vStringDelete (File.line); @@ -52,9 +52,9 @@ static void setInputFileName (const char *const fileName) const char *const head = fileName; const char *const tail = baseFilename (head); - if (File.name != NULL) - vStringDelete (File.name); - File.name = vStringNewInit (fileName); + if (File.input.name != NULL) + vStringDelete (File.input.name); + File.input.name = vStringNewInit (fileName); if (File.path != NULL) vStringDelete (File.path); @@ -76,10 +76,11 @@ static void setSourceFileParameters (vString *const fileName, const langType lan if (File.source.tagPath != NULL) eFree (File.source.tagPath); if (! Option.tagRelative || isAbsolutePath (vStringValue (fileName))) - File.source.tagPath = eStrdup (vStringValue (fileName)); + File.source.tagPath = vStringNewCopy (fileName); else File.source.tagPath = - relativeFilename (vStringValue (fileName), TagFile.directory); + vStringNewOwn (relativeFilename (vStringValue (fileName), + TagFile.directory)); if (vStringLength (fileName) > TagFile.max.file) TagFile.max.file = vStringLength (fileName); @@ -266,7 +267,7 @@ extern boolean fileOpen (const char *const fileName, const langType language) mio_getpos (File.fp, &StartOfLine); mio_getpos (File.fp, &File.filePosition); File.currentLine = NULL; - File.lineNumber = 0L; + File.input.lineNumber = 0L; File.eof = FALSE; File.newLine = TRUE; @@ -312,7 +313,7 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, mio_getpos (File.fp, &StartOfLine); mio_getpos (File.fp, &File.filePosition); File.currentLine = NULL; - File.lineNumber = 0L; + File.input.lineNumber = 0L; File.eof = FALSE; File.newLine = TRUE; @@ -337,8 +338,8 @@ extern void fileClose (void) * and is incremented upon each newline. */ if (Option.printTotals) - addTotals (0, File.lineNumber - 1L, - getFileSize (vStringValue (File.name))); + addTotals (0, File.input.lineNumber - 1L, + getFileSize (vStringValue (File.input.name))); mio_free (File.fp); File.fp = NULL; @@ -356,7 +357,7 @@ static void fileNewline (void) { File.filePosition = StartOfLine; File.newLine = FALSE; - File.lineNumber++; + File.input.lineNumber++; File.source.lineNumber++; DebugStatement ( if (Option.breakLine == File.lineNumber) lineBreak (); ) DebugStatement ( debugPrintf (DEBUG_RAW, "%6ld: ", File.lineNumber); ) @@ -610,7 +611,7 @@ extern char *readSourceLine (vString *const vLine, MIOPos location, *pSeekValue = mio_tell (File.fp); result = readLine (vLine, File.fp); if (result == NULL) - error (FATAL, "Unexpected end of file: %s", vStringValue (File.name)); + error (FATAL, "Unexpected end of file: %s", getInputFileName ()); mio_setpos (File.fp, &orignalPosition); return result; Modified: ctags/main/read.h 29 lines changed, 17 insertions(+), 12 deletions(-) =================================================================== @@ -25,11 +25,11 @@ /* * MACROS */ -#define getInputLineNumber() File.lineNumber +#define getInputLineNumber() File.input.lineNumber #define getInputFileName() vStringValue (File.source.name) #define getInputFilePosition() File.filePosition #define getSourceFileName() vStringValue (File.source.name) -#define getSourceFileTagPath() File.source.tagPath +#define getSourceFileTagPath() vStringValue (File.source.tagPath) #define getSourceLanguage() File.source.language #define getSourceLanguageName() getLanguageName (File.source.language) #define getSourceLineNumber() File.source.lineNumber @@ -60,15 +60,25 @@ enum eCharacters { CHAR_SYMBOL = ('C' + 0x80) }; -/* Maintains the state of the current source file. +/* Maintains the state of the current input file. */ +typedef struct sInputFileInfo { + vString *name; /* name to report for input file */ + vString *tagPath; /* path of input file relative to tag file */ + unsigned long lineNumber;/* line number in the input file */ + unsigned long lineNumberOrigin; /* The value set to `lineNumber' + when `resetInputFile' is called + on the input stream. + This is needed for nested stream. */ + boolean isHeader; /* is input file a header file? */ + langType language; /* language of input file */ +} inputFileInfo; + typedef struct sInputFile { - vString *name; /* name of input file */ vString *path; /* path of input file (if any) */ vString *line; /* last line read from file */ const unsigned char* currentLine; /* current line being worked on */ MIO *fp; /* stream used for reading the file */ - unsigned long lineNumber; /* line number in the input file */ MIOPos filePosition; /* file position of current line */ unsigned int ungetchIdx; int ungetchBuf[3]; /* characters that were ungotten */ @@ -79,13 +89,8 @@ typedef struct sInputFile { * was defined. This may be different from the input file when #line * directives are processed (i.e. the input file is preprocessor output). */ - struct sSource { - vString *name; /* name to report for source file */ - char *tagPath; /* path of source file relative to tag file */ - unsigned long lineNumber;/* line number in the source file */ - boolean isHeader; /* is source file a header file? */ - langType language; /* language of source file */ - } source; + inputFileInfo input; /* name, lineNumber */ + inputFileInfo source; } inputFile; /* Modified: ctags/main/vstring.c 10 lines changed, 10 insertions(+), 0 deletions(-) =================================================================== @@ -234,4 +234,14 @@ extern void vStringSetLength (vString *const string) string->length = strlen (string->buffer); } +extern vString *vStringNewOwn (char *s) +{ + vString *r; + + r = vStringNewInit (s); + eFree (s); + + return r; +} + /* vi:set tabstop=4 shiftwidth=4: */ Modified: ctags/main/vstring.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -79,6 +79,8 @@ extern void vStringCopyToLower (vString *const dest, const vString *const src); extern void vStringSetLength (vString *const string); extern void vStringTruncate (vString *const string, const size_t length); +extern vString *vStringNewOwn (char *s); + #endif /* _VSTRING_H */ /* vi:set tabstop=4 shiftwidth=4: */ Modified: ctags/parsers/sh.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -43,7 +43,7 @@ static kindOption ShKinds [] = { */ static boolean hackReject (const vString* const tagName) { - const char *const scriptName = baseFilename (vStringValue (File.name)); + const char *const scriptName = baseFilename (getInputFileName ()); boolean result = (boolean) (strcmp (scriptName, "configure") == 0 && strcmp (vStringValue (tagName), "main") == 0); return result; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 7ac17b: Eliminate readNextChar() and pushBackChar()
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Fri, 29 Jul 2016 22:40:37 UTC Commit: 7ac17b662facd503d0c822cd61726f329b3a4607
https://github.com/geany/geany/commit/7ac17b662facd503d0c822cd61726f329b3a4…
Log Message: ----------- Eliminate readNextChar() and pushBackChar() Modified Paths: -------------- ctags/main/read.c Modified: ctags/main/read.c 39 lines changed, 14 insertions(+), 25 deletions(-) =================================================================== @@ -31,17 +31,6 @@ inputFile File; /* globally read through macros */ static MIOPos StartOfLine; /* holds deferred position of start of line */ - -/* Read a character choosing automatically between file or buffer, depending - * on which mode we are. - */ -#define readNextChar() (mio_getc (File.fp)) - -/* Replaces ungetc() for file. In case of buffer we'll perform the same action: - * fpBufferPosition-- and write of the param char into the buf. - */ -#define pushBackChar(c) (mio_ungetc (File.fp, c)) - /* * FUNCTION DEFINITIONS */ @@ -127,7 +116,7 @@ static int skipWhite (void) { int c; do - c = readNextChar (); + c = mio_getc (File.fp); while (c == ' ' || c == '\t'); return c; } @@ -139,9 +128,9 @@ static unsigned long readLineNumber (void) while (c != EOF && isdigit (c)) { lNum = (lNum * 10) + (c - '0'); - c = readNextChar (); + c = mio_getc (File.fp); } - pushBackChar (c); + mio_ungetc (File.fp, c); if (c != ' ' && c != '\t') lNum = 0; @@ -164,17 +153,17 @@ static vString *readFileName (void) if (c == '"') { - c = readNextChar (); /* skip double-quote */ + c = mio_getc (File.fp); /* skip double-quote */ quoteDelimited = TRUE; } while (c != EOF && c != '\n' && (quoteDelimited ? (c != '"') : (c != ' ' && c != '\t'))) { vStringPut (fileName, c); - c = readNextChar (); + c = mio_getc (File.fp); } if (c == '\n') - pushBackChar (c); + mio_ungetc (File.fp, c); vStringPut (fileName, '\0'); return fileName; @@ -188,13 +177,13 @@ static boolean parseLineDirective (void) if (isdigit (c)) { - pushBackChar (c); + mio_ungetc (File.fp, c); result = TRUE; } - else if (c == 'l' && readNextChar () == 'i' && - readNextChar () == 'n' && readNextChar () == 'e') + else if (c == 'l' && mio_getc (File.fp) == 'i' && + mio_getc (File.fp) == 'n' && mio_getc (File.fp) == 'e') { - c = readNextChar (); + c = mio_getc (File.fp); if (c == ' ' || c == '\t') { DebugStatement ( lineStr = "line"; ) @@ -380,7 +369,7 @@ static int iFileGetc (void) { int c; readnext: - c = readNextChar (); + c = mio_getc (File.fp); /* If previous character was a newline, then we're starting a line. */ @@ -395,7 +384,7 @@ static int iFileGetc (void) { mio_setpos (File.fp, &StartOfLine); - c = readNextChar (); + c = mio_getc (File.fp); } } } @@ -413,10 +402,10 @@ static int iFileGetc (void) * used forms if line breaks: LF (UNIX), CR (MacIntosh), and * CR-LF (MS-DOS) are converted into a generic newline. */ - const int next = readNextChar (); /* is CR followed by LF? */ + const int next = mio_getc (File.fp); /* is CR followed by LF? */ if (next != NEWLINE) - pushBackChar (next); + mio_ungetc (File.fp, next); c = NEWLINE; /* convert CR into newline */ File.newLine = TRUE; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 282ed7: Define ARRAY_SIZE() and use it instead of KIND_COUNT()
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Thu, 28 Jul 2016 21:56:05 UTC Commit: 282ed7def72c8e736eb45a88d07b705a2667f3dc
https://github.com/geany/geany/commit/282ed7def72c8e736eb45a88d07b705a2667f…
Log Message: ----------- Define ARRAY_SIZE() and use it instead of KIND_COUNT() Modified Paths: -------------- ctags/main/parse.h ctags/main/routines.h ctags/parsers/abaqus.c ctags/parsers/abc.c ctags/parsers/asciidoc.c ctags/parsers/asm.c ctags/parsers/basic.c ctags/parsers/c.c ctags/parsers/conf.c ctags/parsers/css.c ctags/parsers/diff.c ctags/parsers/docbook.c ctags/parsers/erlang.c ctags/parsers/fortran.c ctags/parsers/go.c ctags/parsers/haskell.c ctags/parsers/haxe.c ctags/parsers/jscript.c ctags/parsers/json.c ctags/parsers/latex.c ctags/parsers/lua.c ctags/parsers/make.c ctags/parsers/markdown.c ctags/parsers/matlab.c ctags/parsers/nsis.c ctags/parsers/objc.c ctags/parsers/pascal.c ctags/parsers/perl.c ctags/parsers/php.c ctags/parsers/powershell.c ctags/parsers/python.c ctags/parsers/r.c ctags/parsers/rest.c ctags/parsers/ruby.c ctags/parsers/rust.c ctags/parsers/sh.c ctags/parsers/sql.c ctags/parsers/tcl.c ctags/parsers/txt2tags.c ctags/parsers/verilog.c ctags/parsers/vhdl.c Modified: ctags/main/parse.h 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -22,8 +22,6 @@ /* * MACROS */ -#define KIND_COUNT(kindTable) (sizeof(kindTable)/sizeof(kindOption)) - #define LANG_AUTO (-1) #define LANG_IGNORE (-2) Modified: ctags/main/routines.h 28 lines changed, 28 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2002, Darren Hiebert +* +* This source code is released for free distribution under the terms of the +* GNU General Public License version 2 or (at your option) any later version. +* +* External interface to routines.c +*/ +#ifndef CTAGS_MAIN_ROUTINES_H +#define CTAGS_MAIN_ROUTINES_H + +/* +* INCLUDE FILES +*/ +#include "general.h" /* must always come first */ + +#include <stdio.h> + +#include "mio.h" + +/* +* MACROS +*/ +#define ARRAY_SIZE(X) (sizeof (X) / sizeof (X[0])) + +#endif /* CTAGS_MAIN_ROUTINES_H */ + +/* vi:set tabstop=4 shiftwidth=4: */ Modified: ctags/parsers/abaqus.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -17,6 +17,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -119,7 +120,7 @@ extern parserDefinition* AbaqusParser (void) static const char *const extensions [] = { "inp", NULL }; parserDefinition * def = parserNew ("Abaqus"); def->kinds = AbaqusKinds; - def->kindCount = KIND_COUNT (AbaqusKinds); + def->kindCount = ARRAY_SIZE (AbaqusKinds); def->extensions = extensions; def->parser = findAbaqusTags; return def; Modified: ctags/parsers/abc.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -118,7 +119,7 @@ extern parserDefinition* AbcParser (void) parserDefinition* const def = parserNew ("Abc"); def->kinds = AbcKinds; - def->kindCount = KIND_COUNT (AbcKinds); + def->kindCount = ARRAY_SIZE (AbcKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findAbcTags; Modified: ctags/parsers/asciidoc.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -21,6 +21,7 @@ #include "read.h" #include "vstring.h" #include "nestlevel.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -224,7 +225,7 @@ extern parserDefinition* AsciidocParser (void) parserDefinition* const def = parserNew ("Asciidoc"); def->kinds = AsciidocKinds; - def->kindCount = KIND_COUNT (AsciidocKinds); + def->kindCount = ARRAY_SIZE (AsciidocKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findAsciidocTags; Modified: ctags/parsers/asm.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -370,7 +370,7 @@ extern parserDefinition* AsmParser (void) }; parserDefinition* def = parserNew ("Asm"); def->kinds = AsmKinds; - def->kindCount = KIND_COUNT (AsmKinds); + def->kindCount = ARRAY_SIZE (AsmKinds); def->extensions = extensions; def->patterns = patterns; def->parser = findAsmTags; Modified: ctags/parsers/basic.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -249,7 +249,7 @@ parserDefinition *FreeBasicParser (void) static char const *extensions[] = { "bas", "bi", "bb", "pb", NULL }; parserDefinition *def = parserNew ("FreeBasic"); def->kinds = BasicKinds; - def->kindCount = KIND_COUNT (BasicKinds); + def->kindCount = ARRAY_SIZE (BasicKinds); def->extensions = extensions; def->parser = findBasicTags; return def; Modified: ctags/parsers/c.c 16 lines changed, 8 insertions(+), 8 deletions(-) =================================================================== @@ -3282,7 +3282,7 @@ extern parserDefinition* CParser (void) static const char *const extensions [] = { "c", "pc", "sc", NULL }; parserDefinition* def = parserNew ("C"); def->kinds = CKinds; - def->kindCount = KIND_COUNT (CKinds); + def->kindCount = ARRAY_SIZE (CKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeCParser; @@ -3301,7 +3301,7 @@ extern parserDefinition* CppParser (void) }; parserDefinition* def = parserNew ("C++"); def->kinds = CKinds; - def->kindCount = KIND_COUNT (CKinds); + def->kindCount = ARRAY_SIZE (CKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeCppParser; @@ -3313,7 +3313,7 @@ extern parserDefinition* JavaParser (void) static const char *const extensions [] = { "java", NULL }; parserDefinition* def = parserNew ("Java"); def->kinds = JavaKinds; - def->kindCount = KIND_COUNT (JavaKinds); + def->kindCount = ARRAY_SIZE (JavaKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeJavaParser; @@ -3325,7 +3325,7 @@ extern parserDefinition* DParser (void) static const char *const extensions [] = { "d", "di", NULL }; parserDefinition* def = parserNew ("D"); def->kinds = DKinds; - def->kindCount = KIND_COUNT (DKinds); + def->kindCount = ARRAY_SIZE (DKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeDParser; @@ -3337,7 +3337,7 @@ extern parserDefinition* GLSLParser (void) static const char *const extensions [] = { "glsl", "frag", "vert", NULL }; parserDefinition* def = parserNew ("GLSL"); def->kinds = CKinds; - def->kindCount = KIND_COUNT (CKinds); + def->kindCount = ARRAY_SIZE (CKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeGLSLParser; @@ -3349,7 +3349,7 @@ extern parserDefinition* FeriteParser (void) static const char *const extensions [] = { "fe", NULL }; parserDefinition* def = parserNew ("Ferite"); def->kinds = CKinds; - def->kindCount = KIND_COUNT (CKinds); + def->kindCount = ARRAY_SIZE (CKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeFeriteParser; @@ -3361,7 +3361,7 @@ extern parserDefinition* CsharpParser (void) static const char *const extensions [] = { "cs", NULL }; parserDefinition* def = parserNew ("C#"); def->kinds = CsharpKinds; - def->kindCount = KIND_COUNT (CsharpKinds); + def->kindCount = ARRAY_SIZE (CsharpKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeCsharpParser; @@ -3373,7 +3373,7 @@ extern parserDefinition* ValaParser (void) static const char *const extensions [] = { "vala", NULL }; parserDefinition* def = parserNew ("Vala"); def->kinds = ValaKinds; - def->kindCount = KIND_COUNT (ValaKinds); + def->kindCount = ARRAY_SIZE (ValaKinds); def->extensions = extensions; def->parser2 = findCTags; def->initialize = initializeValaParser; Modified: ctags/parsers/conf.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -18,6 +18,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -117,7 +118,7 @@ extern parserDefinition* ConfParser (void) static const char *const extensions [] = { "conf", NULL }; parserDefinition* const def = parserNew ("Conf"); def->kinds = ConfKinds; - def->kindCount = KIND_COUNT (ConfKinds); + def->kindCount = ARRAY_SIZE (ConfKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findConfTags; Modified: ctags/parsers/css.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -263,7 +263,7 @@ extern parserDefinition* CssParser (void) static const char *const extensions [] = { "css", NULL }; parserDefinition* def = parserNew ("CSS"); def->kinds = CssKinds; - def->kindCount = KIND_COUNT (CssKinds); + def->kindCount = ARRAY_SIZE (CssKinds); def->extensions = extensions; def->parser = findCssTags; return def; Modified: ctags/parsers/diff.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -127,7 +127,7 @@ extern parserDefinition* DiffParser (void) static const char *const extensions [] = { "diff", NULL }; parserDefinition* const def = parserNew ("Diff"); def->kinds = DiffKinds; - def->kindCount = KIND_COUNT (DiffKinds); + def->kindCount = ARRAY_SIZE (DiffKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findDiffTags; Modified: ctags/parsers/docbook.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -144,7 +145,7 @@ extern parserDefinition* DocBookParser (void) parserDefinition* def = parserNew ("Docbook"); def->extensions = extensions; def->kinds = DocBookKinds; - def->kindCount = KIND_COUNT (DocBookKinds); + def->kindCount = ARRAY_SIZE (DocBookKinds); def->parser = findDocBookTags; return def; } Modified: ctags/parsers/erlang.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -185,7 +185,7 @@ extern parserDefinition *ErlangParser (void) static const char *const extensions[] = { "erl", "ERL", "hrl", "HRL", NULL }; parserDefinition *def = parserNew ("Erlang"); def->kinds = ErlangKinds; - def->kindCount = KIND_COUNT (ErlangKinds); + def->kindCount = ARRAY_SIZE (ErlangKinds); def->extensions = extensions; def->parser = findErlangTags; return def; Modified: ctags/parsers/fortran.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -2351,7 +2351,7 @@ extern parserDefinition* FortranParser (void) }; parserDefinition* def = parserNew ("Fortran"); def->kinds = FortranKinds; - def->kindCount = KIND_COUNT (FortranKinds); + def->kindCount = ARRAY_SIZE (FortranKinds); def->extensions = extensions; def->parser2 = findFortranTags; def->initialize = initializeFortran; @@ -2369,7 +2369,7 @@ extern parserDefinition* F77Parser (void) }; parserDefinition* def = parserNew ("F77"); def->kinds = FortranKinds; - def->kindCount = KIND_COUNT (FortranKinds); + def->kindCount = ARRAY_SIZE (FortranKinds); def->extensions = extensions; def->parser2 = findFortranTags; def->initialize = initializeF77; Modified: ctags/parsers/go.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -833,7 +833,7 @@ extern parserDefinition *GoParser (void) static const char *const extensions[] = { "go", NULL }; parserDefinition *def = parserNew ("Go"); def->kinds = GoKinds; - def->kindCount = KIND_COUNT (GoKinds); + def->kindCount = ARRAY_SIZE (GoKinds); def->extensions = extensions; def->parser = findGoTags; def->initialize = initialize; Modified: ctags/parsers/haskell.c 5 lines changed, 3 insertions(+), 2 deletions(-) =================================================================== @@ -27,6 +27,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* @@ -337,7 +338,7 @@ extern parserDefinition* HaskellParser (void) parserDefinition* def = parserNew ("Haskell"); def->kinds = HaskellKinds; - def->kindCount = KIND_COUNT(HaskellKinds); + def->kindCount = ARRAY_SIZE(HaskellKinds); def->extensions = extensions; def->parser = findNormalHaskellTags; return def; @@ -348,7 +349,7 @@ extern parserDefinition* LiterateHaskellParser (void) static const char *const extensions [] = { "lhs", NULL }; parserDefinition* def = parserNew ("Literate Haskell"); def->kinds = HaskellKinds; - def->kindCount = KIND_COUNT(HaskellKinds); + def->kindCount = ARRAY_SIZE(HaskellKinds); def->extensions = extensions; def->parser = findLiterateHaskellTags; return def; Modified: ctags/parsers/haxe.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -23,6 +23,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * MACROS @@ -223,7 +224,7 @@ extern parserDefinition* HaxeParser (void) * New definitions for parsing instead of regex */ def->kinds = HxKinds; - def->kindCount = KIND_COUNT (HxKinds); + def->kindCount = ARRAY_SIZE (HxKinds); def->parser = findHxTags; /*def->initialize = initialize;*/ return def; Modified: ctags/parsers/jscript.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1920,7 +1920,7 @@ extern parserDefinition* JavaScriptParser (void) * New definitions for parsing instead of regex */ def->kinds = JsKinds; - def->kindCount = KIND_COUNT (JsKinds); + def->kindCount = ARRAY_SIZE (JsKinds); def->parser = findJsTags; def->initialize = initialize; Modified: ctags/parsers/json.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -386,7 +386,7 @@ extern parserDefinition* JsonParser (void) parserDefinition *const def = parserNew ("JSON"); def->extensions = extensions; def->kinds = JsonKinds; - def->kindCount = KIND_COUNT (JsonKinds); + def->kindCount = ARRAY_SIZE (JsonKinds); def->parser = findJsonTags; def->initialize = initialize; Modified: ctags/parsers/latex.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -237,7 +238,7 @@ extern parserDefinition* LaTeXParser (void) static const char *const extensions [] = { "tex", "sty", "idx", NULL }; parserDefinition * def = parserNew ("LaTeX"); def->kinds = TeXKinds; - def->kindCount = KIND_COUNT (TeXKinds); + def->kindCount = ARRAY_SIZE (TeXKinds); def->extensions = extensions; def->parser = findTeXTags; return def; Modified: ctags/parsers/lua.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -122,7 +122,7 @@ extern parserDefinition* LuaParser (void) static const char* const extensions [] = { "lua", NULL }; parserDefinition* def = parserNew ("Lua"); def->kinds = LuaKinds; - def->kindCount = KIND_COUNT (LuaKinds); + def->kindCount = ARRAY_SIZE (LuaKinds); def->extensions = extensions; def->parser = findLuaTags; return def; Modified: ctags/parsers/make.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -228,7 +228,7 @@ extern parserDefinition* MakefileParser (void) static const char *const extensions [] = { "mak", "mk", NULL }; parserDefinition* const def = parserNew ("Make"); def->kinds = MakeKinds; - def->kindCount = KIND_COUNT (MakeKinds); + def->kindCount = ARRAY_SIZE (MakeKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findMakeTags; Modified: ctags/parsers/markdown.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -19,6 +19,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -96,7 +97,7 @@ extern parserDefinition* MarkdownParser (void) parserDefinition* const def = parserNew ("Markdown"); def->kinds = MarkdownKinds; - def->kindCount = KIND_COUNT (MarkdownKinds); + def->kindCount = ARRAY_SIZE (MarkdownKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findMarkdownTags; Modified: ctags/parsers/matlab.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "parse.h" #include "read.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -141,7 +142,7 @@ extern parserDefinition* MatlabParser (void) static const char *const extensions [] = { "m", NULL }; parserDefinition* def = parserNew ("Matlab"); def->kinds = MatlabKinds; - def->kindCount = KIND_COUNT (MatlabKinds); + def->kindCount = ARRAY_SIZE (MatlabKinds); def->extensions = extensions; def->parser = findMatlabTags; return def; Modified: ctags/parsers/nsis.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -19,6 +19,7 @@ #include "read.h" #include "main.h" #include "vstring.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -138,7 +139,7 @@ extern parserDefinition* NsisParser (void) }; parserDefinition* def = parserNew ("NSIS"); def->kinds = NsisKinds; - def->kindCount = KIND_COUNT (NsisKinds); + def->kindCount = ARRAY_SIZE (NsisKinds); def->extensions = extensions; def->parser = findNsisTags; return def; Modified: ctags/parsers/objc.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1142,7 +1142,7 @@ extern parserDefinition *ObjcParser (void) static const char *const extensions[] = { "m", "h", NULL }; parserDefinition *def = parserNew ("ObjectiveC"); def->kinds = ObjcKinds; - def->kindCount = KIND_COUNT (ObjcKinds); + def->kindCount = ARRAY_SIZE (ObjcKinds); def->extensions = extensions; def->parser = findObjcTags; def->initialize = objcInitialize; Modified: ctags/parsers/pascal.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -350,7 +350,7 @@ extern parserDefinition* PascalParser (void) parserDefinition* def = parserNew ("Pascal"); def->extensions = extensions; def->kinds = PascalKinds; - def->kindCount = KIND_COUNT (PascalKinds); + def->kindCount = ARRAY_SIZE (PascalKinds); def->parser = findPascalTags; return def; } Modified: ctags/parsers/perl.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -374,7 +374,7 @@ extern parserDefinition* PerlParser (void) static const char *const extensions [] = { "pl", "pm", "plx", "perl", NULL }; parserDefinition* def = parserNew ("Perl"); def->kinds = PerlKinds; - def->kindCount = KIND_COUNT (PerlKinds); + def->kindCount = ARRAY_SIZE (PerlKinds); def->extensions = extensions; def->parser = findPerlTags; return def; Modified: ctags/parsers/php.c 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -1491,7 +1491,7 @@ extern parserDefinition* PhpParser (void) static const char *const extensions [] = { "php", "php3", "php4", "php5", "phtml", NULL }; parserDefinition* def = parserNew ("PHP"); def->kinds = PhpKinds; - def->kindCount = KIND_COUNT (PhpKinds); + def->kindCount = ARRAY_SIZE (PhpKinds); def->extensions = extensions; def->parser = findPhpTags; def->initialize = initializePhpParser; @@ -1503,7 +1503,7 @@ extern parserDefinition* ZephirParser (void) static const char *const extensions [] = { "zep", NULL }; parserDefinition* def = parserNew ("Zephir"); def->kinds = PhpKinds; - def->kindCount = KIND_COUNT (PhpKinds); + def->kindCount = ARRAY_SIZE (PhpKinds); def->extensions = extensions; def->parser = findZephirTags; def->initialize = initializeZephirParser; Modified: ctags/parsers/powershell.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "vstring.h" #include "keyword.h" #include "entry.h" +#include "routines.h" #include <string.h> #define SCOPE_SEPARATOR "::" @@ -619,7 +620,7 @@ extern parserDefinition* PowerShellParser (void) static const char *const extensions [] = { "ps1", "psm1", NULL }; parserDefinition* def = parserNew ("PowerShell"); def->kinds = PowerShellKinds; - def->kindCount = KIND_COUNT (PowerShellKinds); + def->kindCount = ARRAY_SIZE (PowerShellKinds); def->extensions = extensions; def->parser = findPowerShellTags; return def; Modified: ctags/parsers/python.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -833,7 +833,7 @@ extern parserDefinition *PythonParser (void) static const char *const extensions[] = { "py", "pyx", "pxd", "pxi" ,"scons", NULL }; parserDefinition *def = parserNew ("Python"); def->kinds = PythonKinds; - def->kindCount = KIND_COUNT (PythonKinds); + def->kindCount = ARRAY_SIZE (PythonKinds); def->extensions = extensions; def->parser = findPythonTags; return def; Modified: ctags/parsers/r.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -21,6 +21,7 @@ #include "entry.h" #include "read.h" #include "vstring.h" +#include "routines.h" /*#define R_REGEX*/ @@ -191,7 +192,7 @@ extern parserDefinition* RParser (void) parserDefinition* const def = parserNew ("R"); #ifndef R_REGEX def->kinds = RKinds; - def->kindCount = KIND_COUNT (RKinds); + def->kindCount = ARRAY_SIZE (RKinds); #endif def->extensions = extensions; #ifndef R_REGEX Modified: ctags/parsers/rest.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -20,6 +20,7 @@ #include "read.h" #include "vstring.h" #include "nestlevel.h" +#include "routines.h" /* * DATA DEFINITIONS @@ -200,7 +201,7 @@ extern parserDefinition* RestParser (void) parserDefinition* const def = parserNew ("reStructuredText"); def->kinds = RestKinds; - def->kindCount = KIND_COUNT (RestKinds); + def->kindCount = ARRAY_SIZE (RestKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findRestTags; Modified: ctags/parsers/ruby.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -549,7 +549,7 @@ extern parserDefinition* RubyParser (void) static const char *const extensions [] = { "rb", "ruby", NULL }; parserDefinition* def = parserNew ("Ruby"); def->kinds = RubyKinds; - def->kindCount = KIND_COUNT (RubyKinds); + def->kindCount = ARRAY_SIZE (RubyKinds); def->extensions = extensions; def->parser = findRubyTags; return def; Modified: ctags/parsers/rust.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -978,7 +978,7 @@ extern parserDefinition *RustParser (void) static const char *const extensions[] = { "rs", NULL }; parserDefinition *def = parserNew ("Rust"); def->kinds = rustKinds; - def->kindCount = KIND_COUNT (rustKinds); + def->kindCount = ARRAY_SIZE (rustKinds); def->extensions = extensions; def->parser = findRustTags; Modified: ctags/parsers/sh.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -105,7 +105,7 @@ extern parserDefinition* ShParser (void) }; parserDefinition* def = parserNew ("Sh"); def->kinds = ShKinds; - def->kindCount = KIND_COUNT (ShKinds); + def->kindCount = ARRAY_SIZE (ShKinds); def->extensions = extensions; def->parser = findShTags; return def; Modified: ctags/parsers/sql.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2356,7 +2356,7 @@ extern parserDefinition* SqlParser (void) static const char *const extensions [] = { "sql", NULL }; parserDefinition* def = parserNew ("SQL"); def->kinds = SqlKinds; - def->kindCount = KIND_COUNT (SqlKinds); + def->kindCount = ARRAY_SIZE (SqlKinds); def->extensions = extensions; def->parser = findSqlTags; def->initialize = initialize; Modified: ctags/parsers/tcl.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -139,7 +139,7 @@ extern parserDefinition* TclParser (void) static const char *const extensions [] = { "tcl", "tk", "wish", "itcl", NULL }; parserDefinition* def = parserNew ("Tcl"); def->kinds = TclKinds; - def->kindCount = KIND_COUNT (TclKinds); + def->kindCount = ARRAY_SIZE (TclKinds); def->extensions = extensions; def->parser = findTclTags; return def; Modified: ctags/parsers/txt2tags.c 3 lines changed, 2 insertions(+), 1 deletions(-) =================================================================== @@ -22,6 +22,7 @@ #include "read.h" #include "nestlevel.h" #include "vstring.h" +#include "routines.h" /* as any character may happen in an input, use something highly unlikely */ @@ -188,7 +189,7 @@ extern parserDefinition* Txt2tagsParser (void) parserDefinition* const def = parserNew ("Txt2tags"); def->kinds = Txt2tagsKinds; - def->kindCount = KIND_COUNT (Txt2tagsKinds); + def->kindCount = ARRAY_SIZE (Txt2tagsKinds); def->patterns = patterns; def->extensions = extensions; def->parser = findTxt2tagsTags; Modified: ctags/parsers/verilog.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -326,7 +326,7 @@ extern parserDefinition* VerilogParser (void) static const char *const extensions [] = { "v", NULL }; parserDefinition* def = parserNew ("Verilog"); def->kinds = VerilogKinds; - def->kindCount = KIND_COUNT (VerilogKinds); + def->kindCount = ARRAY_SIZE (VerilogKinds); def->extensions = extensions; def->parser = findVerilogTags; def->initialize = initialize; Modified: ctags/parsers/vhdl.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -288,7 +288,7 @@ extern parserDefinition* VhdlParser (void) static const char *const extensions [] = { "vhdl", "vhd", NULL }; parserDefinition* def = parserNew ("Vhdl"); def->kinds = VhdlKinds; - def->kindCount = KIND_COUNT (VhdlKinds); + def->kindCount = ARRAY_SIZE (VhdlKinds); def->extensions = extensions; def->parser = findVhdlTags; def->initialize = initialize; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] ae8dc5: Add keywordTable to parserDefinition and use a common way to initialize keywords
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Fri, 29 Jul 2016 20:50:11 UTC Commit: ae8dc545cec1eb7e951d5c36d053615ea548b486
https://github.com/geany/geany/commit/ae8dc545cec1eb7e951d5c36d053615ea548b…
Log Message: ----------- Add keywordTable to parserDefinition and use a common way to initialize keywords Modified Paths: -------------- ctags/main/parse.c ctags/main/parse.h ctags/parsers/asm.c ctags/parsers/fortran.c ctags/parsers/go.c ctags/parsers/jscript.c ctags/parsers/objc.c ctags/parsers/php.c ctags/parsers/sql.c ctags/parsers/vhdl.c Modified: ctags/main/parse.c 39 lines changed, 35 insertions(+), 4 deletions(-) =================================================================== @@ -19,6 +19,7 @@ #include "mio.h" #include "entry.h" +#include "keyword.h" #include "main.h" #define OPTION_WRITE #include "options.h" @@ -293,12 +294,24 @@ extern void enableLanguage (const langType language, const boolean state) LanguageTable [language]->enabled = state; } +static void initializeParserOne (langType lang) +{ + parserDefinition *const parser = LanguageTable [lang]; + + installKeywordTable (lang); + + if ((parser->initialize != NULL) && (parser->initialized == FALSE)) + { + parser->initialize (lang); + parser->initialized = TRUE; + } +} + static void initializeParsers (void) { - unsigned int i; - for (i = 0 ; i < LanguageCount ; ++i) - if (LanguageTable [i]->initialize != NULL) - (LanguageTable [i]->initialize) ((langType) i); + int i; + for (i = 0; i < LanguageCount; i++) + initializeParserOne(i); } extern void initializeParsing (void) @@ -654,4 +667,22 @@ extern boolean parseFile (const char *const fileName) return tagFileResized; } +extern void installKeywordTable (const langType language) +{ + parserDefinition* lang; + unsigned int i; + + Assert (0 <= language && language < (int) LanguageCount); + lang = LanguageTable [language]; + + if ((lang->keywordTable != NULL) && (lang->keywordInstalled == FALSE)) + { + for (i = 0; i < lang->keywordCount; ++i) + addKeyword (lang->keywordTable [i].name, + language, + lang->keywordTable [i].id); + lang->keywordInstalled = TRUE; + } +} + /* vi:set tabstop=4 shiftwidth=4 nowrap: */ Modified: ctags/main/parse.h 7 lines changed, 7 insertions(+), 0 deletions(-) =================================================================== @@ -65,6 +65,11 @@ typedef struct { boolean enabled; /* currently enabled? */ stringList* currentPatterns; /* current list of file name patterns */ stringList* currentExtensions; /* current list of extensions */ + const keywordTable *keywordTable; + unsigned int keywordCount; + + unsigned int initialized:1; /* initialize() is called or not */ + unsigned int keywordInstalled:1; /* keywordTable is installed or not. */ } parserDefinition; typedef parserDefinition* (parserDefinitionFunc) (void); @@ -114,6 +119,8 @@ extern boolean processKindOption (const char *const option, const char *const pa extern void printKindOptions (void); extern boolean parseFile (const char *const fileName); +extern void installKeywordTable (const langType language); + /* Regex interface */ #ifdef HAVE_REGEX extern void findRegexTags (void); Modified: ctags/parsers/asm.c 14 lines changed, 2 insertions(+), 12 deletions(-) =================================================================== @@ -110,17 +110,6 @@ static const opKind OpKinds [] = { /* * FUNCTION DEFINITIONS */ -static void buildAsmKeywordHash (void) -{ - const size_t count = sizeof (AsmKeywords) / sizeof (AsmKeywords [0]); - size_t i; - for (i = 0 ; i < count ; ++i) - { - const keywordTable* const p = AsmKeywords + i; - addKeyword (p->name, Lang_asm, (int) p->id); - } -} - static opKeyword analyzeOperator (const vString *const op) { vString *keyword = vStringNew (); @@ -353,7 +342,6 @@ static void findAsmTags (void) static void initialize (const langType language) { Lang_asm = language; - buildAsmKeywordHash (); } extern parserDefinition* AsmParser (void) @@ -375,6 +363,8 @@ extern parserDefinition* AsmParser (void) def->patterns = patterns; def->parser = findAsmTags; def->initialize = initialize; + def->keywordTable = AsmKeywords; + def->keywordCount = ARRAY_SIZE (AsmKeywords); return def; } Modified: ctags/parsers/fortran.c 18 lines changed, 4 insertions(+), 14 deletions(-) =================================================================== @@ -416,18 +416,6 @@ static boolean insideInterface (void) return result; } -static void buildFortranKeywordHash (const langType language) -{ - const size_t count = - sizeof (FortranKeywordTable) / sizeof (FortranKeywordTable [0]); - size_t i; - for (i = 0 ; i < count ; ++i) - { - const keywordTable* const p = &FortranKeywordTable [i]; - addKeyword (p->name, language, (int) p->id); - } -} - /* * Tag generation functions */ @@ -2331,13 +2319,11 @@ static boolean findFortranTags (const unsigned int passCount) static void initializeFortran (const langType language) { Lang_fortran = language; - buildFortranKeywordHash (language); } static void initializeF77 (const langType language) { Lang_f77 = language; - buildFortranKeywordHash (language); } extern parserDefinition* FortranParser (void) @@ -2355,6 +2341,8 @@ extern parserDefinition* FortranParser (void) def->extensions = extensions; def->parser2 = findFortranTags; def->initialize = initializeFortran; + def->keywordTable = FortranKeywordTable; + def->keywordCount = ARRAY_SIZE (FortranKeywordTable); return def; } @@ -2373,6 +2361,8 @@ extern parserDefinition* F77Parser (void) def->extensions = extensions; def->parser2 = findFortranTags; def->initialize = initializeF77; + def->keywordTable = FortranKeywordTable; + def->keywordCount = ARRAY_SIZE (FortranKeywordTable); return def; } /* vi:set tabstop=4 shiftwidth=4: */ Modified: ctags/parsers/go.c 10 lines changed, 2 insertions(+), 8 deletions(-) =================================================================== @@ -133,15 +133,7 @@ static boolean isIdentChar (const int c) static void initialize (const langType language) { - size_t i; - const size_t count = - sizeof (GoKeywordTable) / sizeof (GoKeywordTable[0]); Lang_go = language; - for (i = 0; i < count; ++i) - { - const keywordTable *const p = &GoKeywordTable[i]; - addKeyword (p->name, language, (int) p->id); - } } static tokenInfo *newToken (void) @@ -837,5 +829,7 @@ extern parserDefinition *GoParser (void) def->extensions = extensions; def->parser = findGoTags; def->initialize = initialize; + def->keywordTable = GoKeywordTable; + def->keywordCount = ARRAY_SIZE (GoKeywordTable); return def; } Modified: ctags/parsers/jscript.c 17 lines changed, 3 insertions(+), 14 deletions(-) =================================================================== @@ -180,18 +180,6 @@ static boolean isIdentChar (const int c) c == '@' || c == '_' || c == '#'); } -static void buildJsKeywordHash (void) -{ - const size_t count = sizeof (JsKeywordTable) / - sizeof (JsKeywordTable [0]); - size_t i; - for (i = 0 ; i < count ; ++i) - { - const keywordTable* const p = &JsKeywordTable [i]; - addKeyword (p->name, Lang_js, (int) p->id); - } -} - static tokenInfo *newToken (void) { tokenInfo *const token = xMalloc (1, tokenInfo); @@ -1888,9 +1876,8 @@ static void parseJsFile (tokenInfo *const token) static void initialize (const langType language) { - Assert (sizeof (JsKinds) / sizeof (JsKinds [0]) == JSTAG_COUNT); + Assert (ARRAY_SIZE (JsKinds) == JSTAG_COUNT); Lang_js = language; - buildJsKeywordHash (); } static void findJsTags (void) @@ -1923,6 +1910,8 @@ extern parserDefinition* JavaScriptParser (void) def->kindCount = ARRAY_SIZE (JsKinds); def->parser = findJsTags; def->initialize = initialize; + def->keywordTable = JsKeywordTable; + def->keywordCount = ARRAY_SIZE (JsKeywordTable); return def; } Modified: ctags/parsers/objc.c 17 lines changed, 2 insertions(+), 15 deletions(-) =================================================================== @@ -144,18 +144,6 @@ typedef struct _lexingState { const unsigned char *cp; /* position in stream */ } lexingState; -static void initKeywordHash (void) -{ - const size_t count = sizeof (objcKeywordTable) / sizeof (keywordTable); - size_t i; - - for (i = 0; i < count; ++i) - { - addKeyword (objcKeywordTable[i].name, Lang_ObjectiveC, - (int) objcKeywordTable[i].id); - } -} - /*////////////////////////////////////////////////////////////////////// //// Lexing */ static boolean isNum (char c) @@ -1133,8 +1121,6 @@ static void findObjcTags (void) static void objcInitialize (const langType language) { Lang_ObjectiveC = language; - - initKeywordHash (); } extern parserDefinition *ObjcParser (void) @@ -1146,6 +1132,7 @@ extern parserDefinition *ObjcParser (void) def->extensions = extensions; def->parser = findObjcTags; def->initialize = objcInitialize; - + def->keywordTable = objcKeywordTable; + def->keywordCount = ARRAY_SIZE (objcKeywordTable); return def; } Modified: ctags/parsers/php.c 17 lines changed, 4 insertions(+), 13 deletions(-) =================================================================== @@ -238,17 +238,6 @@ static struct { static vString *CurrentNamespace; -static void buildPhpKeywordHash (const langType language) -{ - const size_t count = sizeof (PhpKeywordTable) / sizeof (PhpKeywordTable[0]); - size_t i; - for (i = 0; i < count ; i++) - { - const keywordTable* const p = &PhpKeywordTable[i]; - addKeyword (p->name, language, (int) p->id); - } -} - static const char *accessToString (const accessType access) { static const char *const names[COUNT_ACCESS] = { @@ -1477,13 +1466,11 @@ static void findZephirTags (void) static void initializePhpParser (const langType language) { Lang_php = language; - buildPhpKeywordHash (language); } static void initializeZephirParser (const langType language) { Lang_zephir = language; - buildPhpKeywordHash (language); } extern parserDefinition* PhpParser (void) @@ -1495,6 +1482,8 @@ extern parserDefinition* PhpParser (void) def->extensions = extensions; def->parser = findPhpTags; def->initialize = initializePhpParser; + def->keywordTable = PhpKeywordTable; + def->keywordCount = ARRAY_SIZE (PhpKeywordTable); return def; } @@ -1507,6 +1496,8 @@ extern parserDefinition* ZephirParser (void) def->extensions = extensions; def->parser = findZephirTags; def->initialize = initializeZephirParser; + def->keywordTable = PhpKeywordTable; + def->keywordCount = ARRAY_SIZE (PhpKeywordTable); return def; } Modified: ctags/parsers/sql.c 17 lines changed, 3 insertions(+), 14 deletions(-) =================================================================== @@ -396,18 +396,6 @@ static boolean isMatchedEnd(tokenInfo *const token, int nest_lvl) return terminated; } -static void buildSqlKeywordHash (void) -{ - const size_t count = sizeof (SqlKeywordTable) / - sizeof (SqlKeywordTable [0]); - size_t i; - for (i = 0 ; i < count ; ++i) - { - const keywordTable* const p = &SqlKeywordTable [i]; - addKeyword (p->name, Lang_sql, (int) p->id); - } -} - static tokenInfo *newToken (void) { tokenInfo *const token = xMalloc (1, tokenInfo); @@ -2335,9 +2323,8 @@ static void parseSqlFile (tokenInfo *const token) static void initialize (const langType language) { - Assert (sizeof (SqlKinds) / sizeof (SqlKinds [0]) == SQLTAG_COUNT); + Assert (ARRAY_SIZE (SqlKinds) == SQLTAG_COUNT); Lang_sql = language; - buildSqlKeywordHash (); } static void findSqlTags (void) @@ -2360,6 +2347,8 @@ extern parserDefinition* SqlParser (void) def->extensions = extensions; def->parser = findSqlTags; def->initialize = initialize; + def->keywordTable = SqlKeywordTable; + def->keywordCount = ARRAY_SIZE (SqlKeywordTable); return def; } Modified: ctags/parsers/vhdl.c 10 lines changed, 2 insertions(+), 8 deletions(-) =================================================================== @@ -106,15 +106,7 @@ static keywordTable VhdlKeywordTable [] = { static void initialize (const langType language) { - size_t i; - const size_t count = sizeof (VhdlKeywordTable) / - sizeof (VhdlKeywordTable [0]); Lang_vhdl = language; - for (i = 0 ; i < count ; ++i) - { - const keywordTable* const p = &VhdlKeywordTable [i]; - addKeyword (p->name, language, (int) p->id); - } } static void vUngetc (int c) @@ -292,6 +284,8 @@ extern parserDefinition* VhdlParser (void) def->extensions = extensions; def->parser = findVhdlTags; def->initialize = initialize; + def->keywordTable = VhdlKeywordTable; + def->keywordCount = ARRAY_SIZE (VhdlKeywordTable); return def; } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 3dd1fb: Rename "mio" member of sInputFile to "fp"
by Jiří Techet
10 Sep '16
10 Sep '16
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Fri, 29 Jul 2016 22:32:59 UTC Commit: 3dd1fb4853952d8fd80963952a03299e9b2c8012
https://github.com/geany/geany/commit/3dd1fb4853952d8fd80963952a03299e9b2c8…
Log Message: ----------- Rename "mio" member of sInputFile to "fp" Modified Paths: -------------- ctags/main/get.c ctags/main/read.c ctags/main/read.h ctags/parsers/c.c Modified: ctags/main/get.c 12 lines changed, 6 insertions(+), 6 deletions(-) =================================================================== @@ -843,25 +843,25 @@ extern char *getArglistFromFilePos(MIOPos startPosition, const char *tokenName) char *arglist = NULL; long pos1, pos2; - pos2 = mio_tell(File.mio); + pos2 = mio_tell(File.fp); - mio_getpos(File.mio, &originalPosition); - mio_setpos(File.mio, &startPosition); - pos1 = mio_tell(File.mio); + mio_getpos(File.fp, &originalPosition); + mio_setpos(File.fp, &startPosition); + pos1 = mio_tell(File.fp); if (pos2 > pos1) { size_t len = pos2 - pos1; result = (char *) g_malloc(len + 1); - if (result != NULL && (len = mio_read(File.mio, result, 1, len)) > 0) + if (result != NULL && (len = mio_read(File.fp, result, 1, len)) > 0) { result[len] = '\0'; arglist = getArglistFromStr(result, tokenName); } g_free(result); } - mio_setpos(File.mio, &originalPosition); + mio_setpos(File.fp, &originalPosition); return arglist; } Modified: ctags/main/read.c 52 lines changed, 26 insertions(+), 26 deletions(-) =================================================================== @@ -35,12 +35,12 @@ static MIOPos StartOfLine; /* holds deferred position of start of line */ /* Read a character choosing automatically between file or buffer, depending * on which mode we are. */ -#define readNextChar() (mio_getc (File.mio)) +#define readNextChar() (mio_getc (File.fp)) /* Replaces ungetc() for file. In case of buffer we'll perform the same action: * fpBufferPosition-- and write of the param char into the buf. */ -#define pushBackChar(c) (mio_ungetc (File.mio, c)) +#define pushBackChar(c) (mio_ungetc (File.fp, c)) /* * FUNCTION DEFINITIONS @@ -260,22 +260,22 @@ extern boolean fileOpen (const char *const fileName, const langType language) /* If another file was already open, then close it. */ - if (File.mio != NULL) + if (File.fp != NULL) { - mio_free (File.mio); /* close any open source file */ - File.mio = NULL; + mio_free (File.fp); /* close any open source file */ + File.fp = NULL; } - File.mio = mio_new_file_full (fileName, openMode, g_fopen, fclose); - if (File.mio == NULL) + File.fp = mio_new_file_full (fileName, openMode, g_fopen, fclose); + if (File.fp == NULL) error (WARNING | PERROR, "cannot open \"%s\"", fileName); else { opened = TRUE; setInputFileName (fileName); - mio_getpos (File.mio, &StartOfLine); - mio_getpos (File.mio, &File.filePosition); + mio_getpos (File.fp, &StartOfLine); + mio_getpos (File.fp, &File.filePosition); File.currentLine = NULL; File.lineNumber = 0L; File.eof = FALSE; @@ -305,9 +305,9 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, /* Check whether a file of a buffer were already open, then close them. */ - if (File.mio != NULL) { - mio_free (File.mio); /* close any open source file */ - File.mio = NULL; + if (File.fp != NULL) { + mio_free (File.fp); /* close any open source file */ + File.fp = NULL; } /* check if we got a good buffer */ @@ -318,10 +318,10 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, opened = TRUE; - File.mio = mio_new_memory (buffer, buffer_size, NULL, NULL); + File.fp = mio_new_memory (buffer, buffer_size, NULL, NULL); setInputFileName (fileName); - mio_getpos (File.mio, &StartOfLine); - mio_getpos (File.mio, &File.filePosition); + mio_getpos (File.fp, &StartOfLine); + mio_getpos (File.fp, &File.filePosition); File.currentLine = NULL; File.lineNumber = 0L; File.eof = FALSE; @@ -342,7 +342,7 @@ extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size, extern void fileClose (void) { - if (File.mio != NULL) + if (File.fp != NULL) { /* The line count of the file is 1 too big, since it is one-based * and is incremented upon each newline. @@ -351,8 +351,8 @@ extern void fileClose (void) addTotals (0, File.lineNumber - 1L, getFileSize (vStringValue (File.name))); - mio_free (File.mio); - File.mio = NULL; + mio_free (File.fp); + File.fp = NULL; } } @@ -393,7 +393,7 @@ static int iFileGetc (void) goto readnext; else { - mio_setpos (File.mio, &StartOfLine); + mio_setpos (File.fp, &StartOfLine); c = readNextChar (); } @@ -405,7 +405,7 @@ static int iFileGetc (void) else if (c == NEWLINE) { File.newLine = TRUE; - mio_getpos (File.mio, &StartOfLine); + mio_getpos (File.fp, &StartOfLine); } else if (c == CRETURN) { @@ -420,7 +420,7 @@ static int iFileGetc (void) c = NEWLINE; /* convert CR into newline */ File.newLine = TRUE; - mio_getpos (File.mio, &StartOfLine); + mio_getpos (File.fp, &StartOfLine); } DebugStatement ( debugPutc (DEBUG_RAW, c); ) return c; @@ -615,14 +615,14 @@ extern char *readSourceLine (vString *const vLine, MIOPos location, MIOPos orignalPosition; char *result; - mio_getpos (File.mio, &orignalPosition); - mio_setpos (File.mio, &location); + mio_getpos (File.fp, &orignalPosition); + mio_setpos (File.fp, &location); if (pSeekValue != NULL) - *pSeekValue = mio_tell (File.mio); - result = readLine (vLine, File.mio); + *pSeekValue = mio_tell (File.fp); + result = readLine (vLine, File.fp); if (result == NULL) error (FATAL, "Unexpected end of file: %s", vStringValue (File.name)); - mio_setpos (File.mio, &orignalPosition); + mio_setpos (File.fp, &orignalPosition); return result; } Modified: ctags/main/read.h 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -67,7 +67,7 @@ typedef struct sInputFile { vString *path; /* path of input file (if any) */ vString *line; /* last line read from file */ const unsigned char* currentLine; /* current line being worked on */ - MIO *mio; /* stream used for reading the file */ + MIO *fp; /* stream used for reading the file */ unsigned long lineNumber; /* line number in the input file */ MIOPos filePosition; /* file position of current line */ unsigned int ungetchIdx; Modified: ctags/parsers/c.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2586,7 +2586,7 @@ static int parseParens (statementInfo *const st, parenInfo *const info) --depth; } if (st->argEndPosition == 0) - st->argEndPosition = mio_tell (File.mio); + st->argEndPosition = mio_tell (File.fp); if (! info->isNameCandidate) initToken (token); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
Older →
Jump to page:
1
2
3
4
5
6
7
8
Results per page:
10
25
50
100
200