Closed tamuratak closed 7 months ago
tree-sitter --version
tree-sitter 0.20.8 (9f398ca955d3329110d31ed523dac5275074948f)
A sequence of multiple characters enclosed in single-quotes, e.g., 'abc', causes errors. It is valid in C99. See
'abc'
An integer character constant is a sequence of one or more multibyte characters enclosed in single-quotes, as in 'x'.
typedef enum { iTunesESrcLibrary = 'kLib', iTunesESrcIPod = 'kPod', iTunesESrcAudioCD = 'kACD', iTunesESrcMP3CD = 'kMCD', iTunesESrcDevice = 'kDev', iTunesESrcRadioTuner = 'kTun', iTunesESrcSharedLibrary = 'kShd', iTunesESrcUnknown = 'kUnk' } iTunesESrc;
This outputs
(translation_unit [0, 0] - [9, 13] (type_definition [0, 0] - [9, 13] type: (enum_specifier [0, 8] - [9, 1] body: (enumerator_list [0, 13] - [9, 1] (enumerator [1, 4] - [1, 30] name: (identifier [1, 4] - [1, 21]) value: (char_literal [1, 24] - [1, 30] (character [1, 25] - [1, 26]) (ERROR [1, 26] - [1, 29] (identifier [1, 26] - [1, 29])))) (enumerator [2, 4] - [2, 27] name: (identifier [2, 4] - [2, 18]) value: (char_literal [2, 21] - [2, 27] (character [2, 22] - [2, 23]) (ERROR [2, 23] - [2, 26] (identifier [2, 23] - [2, 26])))) (enumerator [3, 4] - [3, 30] name: (identifier [3, 4] - [3, 21]) value: (char_literal [3, 24] - [3, 30] (character [3, 25] - [3, 26]) (ERROR [3, 26] - [3, 29] (identifier [3, 26] - [3, 29])))) (enumerator [4, 4] - [4, 28] name: (identifier [4, 4] - [4, 19]) value: (char_literal [4, 22] - [4, 28] (character [4, 23] - [4, 24]) (ERROR [4, 24] - [4, 27] (identifier [4, 24] - [4, 27])))) (enumerator [5, 4] - [5, 29] name: (identifier [5, 4] - [5, 20]) value: (char_literal [5, 23] - [5, 29] (character [5, 24] - [5, 25]) (ERROR [5, 25] - [5, 28] (identifier [5, 25] - [5, 28])))) (enumerator [6, 4] - [6, 33] name: (identifier [6, 4] - [6, 24]) value: (char_literal [6, 27] - [6, 33] (character [6, 28] - [6, 29]) (ERROR [6, 29] - [6, 32] (identifier [6, 29] - [6, 32])))) (enumerator [7, 4] - [7, 36] name: (identifier [7, 4] - [7, 27]) value: (char_literal [7, 30] - [7, 36] (character [7, 31] - [7, 32]) (ERROR [7, 32] - [7, 35] (identifier [7, 32] - [7, 35])))) (enumerator [8, 4] - [8, 30] name: (identifier [8, 4] - [8, 21]) value: (char_literal [8, 24] - [8, 30] (character [8, 25] - [8, 26]) (ERROR [8, 26] - [8, 29] (identifier [8, 26] - [8, 29])))))) declarator: (type_identifier [9, 2] - [9, 12])))
A sequence of multiple characters enclosed in single-quotes should be parsed without ERRORs.
No response
Thanks, I never knew about that actually! - fixed on master
Did you check existing issues?
Tree-Sitter CLI Version, if relevant (output of
tree-sitter --version
)tree-sitter 0.20.8 (9f398ca955d3329110d31ed523dac5275074948f)
Describe the bug
A sequence of multiple characters enclosed in single-quotes, e.g.,
'abc'
, causes errors. It is valid in C99. SeeSteps To Reproduce/Bad Parse Tree
This outputs
Expected Behavior/Parse Tree
A sequence of multiple characters enclosed in single-quotes should be parsed without ERRORs.
Repro
No response