Kaynağa Gözat

Fix error with ++L (consequence of support for L strings) (#26)

* Fix error with ++L (consequence of support for L strings)

* Update to tree-sitter 0.15.5
pull/27/head
calixteman 7 yıl önce
işlemeyi yapan: Max Brunsfeld
ebeveyn
işleme
c8061429cc
5 değiştirilmiş dosya ile 46792 ekleme ve 46698 silme
  1. +3
    -1
      corpus/expressions.txt
  2. +2
    -4
      grammar.js
  3. +6
    -12
      src/grammar.json
  4. +5
    -1
      src/node-types.json
  5. +46776
    -46680
      src/parser.c

+ 3
- 1
corpus/expressions.txt Dosyayı Görüntüle

@ -206,6 +206,7 @@ Math operators
int main() {
-a / b + c * -d;
a++ - ++b + c-- + --d;
++L;
}
---
@ -229,7 +230,8 @@ int main() {
(update_expression (identifier))
(update_expression (identifier)))
(update_expression (identifier)))
(update_expression (identifier)))))))
(update_expression (identifier))))
(expression_statement (update_expression (identifier))))))
============================================
The comma operator

+ 2
- 4
grammar.js Dosyayı Görüntüle

@ -772,8 +772,7 @@ module.exports = grammar({
},
char_literal: $ => seq(
optional('L'),
'\'',
choice('L\'', '\''),
choice(
$.escape_sequence,
token.immediate(/[^\n']/)
@ -787,8 +786,7 @@ module.exports = grammar({
),
string_literal: $ => seq(
optional('L'),
'"',
choice('L"', '"'),
repeat(choice(
token.immediate(prec(1, /[^\\"\n]+/)),
$.escape_sequence

+ 6
- 12
src/grammar.json Dosyayı Görüntüle

@ -4902,17 +4902,14 @@
"members": [
{
"type": "STRING",
"value": "L"
"value": "L9;4;
},
{
"type": "BLANK"
"type": "STRING",
"value": "'"
}
]
},
{
"type": "STRING",
"value": "'"
},
{
"type": "CHOICE",
"members": [
@ -4959,17 +4956,14 @@
"members": [
{
"type": "STRING",
"value": "L"
"value": "L\""
},
{
"type": "BLANK"
"type": "STRING",
"value": "\""
}
]
},
{
"type": "STRING",
"value": "\""
},
{
"type": "REPEAT",
"content": {

+ 5
- 1
src/node-types.json Dosyayı Görüntüle

@ -2822,13 +2822,17 @@
"named": true
},
{
"type": "L",
"type": "L9;4;,
"named": false
},
{
"type": "'",
"named": false
},
{
"type": "L\"",
"named": false
},
{
"type": "\"",
"named": false

+ 46776
- 46680
src/parser.c
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


Yükleniyor…
İptal
Kaydet