Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ziglang/zig
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d4c1ed95acb1
Choose a base ref
...
head repository: ziglang/zig
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 75afe73c6623
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 3, 2017

  1. Copy the full SHA
    1ef6cb1 View commit details
  2. Merge pull request #581 from Dimenus/line_endings

    Add support for windows line endings with c macros within a c_import.
    andrewrk authored Nov 3, 2017
    Copy the full SHA
    75afe73 View commit details
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/c_tokenizer.cpp
5 changes: 4 additions & 1 deletion src/c_tokenizer.cpp
Original file line number Diff line number Diff line change
@@ -91,6 +91,9 @@
IDENT_START: \
case DIGIT

#define LINE_ENDING \
'\r': \
case '\n'

static void begin_token(CTokenize *ctok, CTokId id) {
assert(ctok->cur_tok == nullptr);
@@ -191,7 +194,7 @@ void tokenize_c_macro(CTokenize *ctok, const uint8_t *c) {
case '\\':
ctok->state = CTokStateBackslash;
break;
case '\n':
case LINE_ENDING:
goto found_end_of_macro;
case IDENT_START:
ctok->state = CTokStateIdentifier;