Selaa lähdekoodia

Fix comment containing backslash

pull/17/head
Calixte Denizet 7 vuotta sitten
vanhempi
commit
338f99e8a0
4 muutettua tiedostoa jossa 886 lisäystä ja 856 poistoa
  1. +13
    -0
      corpus/expressions.txt
  2. +1
    -1
      grammar.js
  3. +1
    -1
      src/grammar.json
  4. +871
    -854
      src/parser.c

+ 13
- 0
corpus/expressions.txt Näytä tiedosto

@ -437,3 +437,16 @@ Comments with escaped newlines
(translation_unit
(comment))
==============================================
Comments with escaped chars and newlines
==============================================
// one \a \b \
two
// one \c \d
---
(translation_unit
(comment)
(comment))

+ 1
- 1
grammar.js Näytä tiedosto

@ -763,7 +763,7 @@ module.exports = grammar({
// http://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment/36328890#36328890
comment: $ => token(choice(
seq('//', /(\\[.\n]|[^\\\n])*/),
seq('//', /(\\(.|\n)|[^\\\n])*/),
seq(
'/*',
/[^*]*\*+([^/*][^*]*\*+)*/,

+ 1
- 1
src/grammar.json Näytä tiedosto

@ -4439,7 +4439,7 @@
},
{
"type": "PATTERN",
"value": "(\\\\[.\\n]|[^\\\\\\n])*"
"value": "(\\\\(.|\\n)|[^\\\\\\n])*"
}
]
},

+ 871
- 854
src/parser.c
File diff suppressed because it is too large
Näytä tiedosto


Ladataan…
Peruuta
Tallenna