Skip to content

Commit

Permalink
accept multiple pragma values
Browse files Browse the repository at this point in the history
Per bdb2bb5610 "QML: Allow pragmas with multiple values."
  • Loading branch information
yuja committed Mar 18, 2023
1 parent ca15763 commit e663294
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ module.exports = grammar(require('tree-sitter-typescript/typescript/grammar'), {
field('name', $.identifier), // PragmaId
optional(seq(
':',
field('value', $.identifier),
// TODO: or insert 'values': (ui_pragma_value_list ..)?
sep1(field('value', $.identifier), ','),
)),
$._semicolon,
),
Expand Down
5 changes: 5 additions & 0 deletions test/corpus/declarative-ui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Pragma and imports

pragma Singleton
pragma ListPropertyAssignBehavior: Append
pragma ValueTypeBehavior: Copy, Addressable
import QtQuick
import Qt.labs.platform as Platform
import QtQuick.Controls 2
Expand All @@ -21,6 +22,10 @@ Item {}
(ui_pragma
name: (identifier)
value: (identifier))
(ui_pragma
name: (identifier)
value: (identifier)
value: (identifier))
(ui_import
source: (identifier))
(ui_import
Expand Down

0 comments on commit e663294

Please sign in to comment.