소스 검색

Only allow identifiers after the '.' in a field expression

pull/2/head
Max Brunsfeld 9 년 전
부모
커밋
7930ba3917
4개의 변경된 파일29161개의 추가작업 그리고 31927개의 파일을 삭제
  1. +4
    -4
      grammar.js
  2. +1
    -1
      package.json
  3. +2
    -2
      src/grammar.json
  4. +29154
    -31920
      src/parser.c

+ 4
- 4
grammar.js 파일 보기

@ -17,7 +17,7 @@ const PREC = {
CAST: 13,
UNARY: 14,
FIELD: 15,
SUBSCRIPT: 16,
SUBSCRIPT: 16
};
module.exports = grammar({
@ -520,8 +520,8 @@ module.exports = grammar({
),
field_expression: $ => choice(
prec.left(PREC.FIELD, seq($._expression, '.', $._expression)),
prec.left(PREC.FIELD, seq($._expression, '->', $._expression))
prec.left(PREC.FIELD, seq($._expression, '.', $.identifier)),
prec.left(PREC.FIELD, seq($._expression, '->', $.identifier))
),
compound_literal_expression: $ => seq(
@ -613,7 +613,7 @@ module.exports = grammar({
repeat(choice(/[^\*]/, /\*[^/]/)),
'*/'
)
)),
))
}
});

+ 1
- 1
package.json 파일 보기

@ -17,7 +17,7 @@
"tree-sitter-compiler": ">= 0.0.45"
},
"scripts": {
"prepublish": "tree-sitter compile && node-gyp build",
"build": "tree-sitter compile && node-gyp build",
"test": "tree-sitter test"
}
}

+ 2
- 2
src/grammar.json 파일 보기

@ -2595,7 +2595,7 @@
},
{
"type": "SYMBOL",
"name": "_expression"
"name": "identifier"
}
]
}
@ -2616,7 +2616,7 @@
},
{
"type": "SYMBOL",
"name": "_expression"
"name": "identifier"
}
]
}

+ 29154
- 31920
src/parser.c
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


불러오는 중...
취소
저장