ソースを参照

Fix comment containing backslash

pull/17/head
Calixte Denizet 7年前
コミット
338f99e8a0
4個のファイルの変更886行の追加856行の削除
  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 ファイルの表示

@ -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 ファイルの表示

@ -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 ファイルの表示

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

+ 871
- 854
src/parser.c
ファイル差分が大きすぎるため省略します
ファイルの表示


読み込み中…
キャンセル
保存