Page MenuHomeSoftware Heritage

grammar.js: Improve grammar and export tokens
ClosedPublic

Authored by KShivendu on Aug 17 2021, 9:05 PM.

Details

Summary
  • Export grammar tokens through tokens.js file (so that swh-web can use them)
  • Improvements in the grammar to better handle sort_by and limit
  • Introduce annotateFilter function in grammar.js to assign tree-sitter fields to different parts of a filter (field, op, value)

Diff Detail

Repository
rDSEA Archive search
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D6109 (id=22101)

Rebasing onto cad6ace509...

Current branch diff-target is up to date.
Changes applied before test
commit a76618ab8b1063fb23114195265051aba574eb80
Author: KShivendu <shivendu@iitbhilai.ac.in>
Date:   Wed Aug 18 00:28:15 2021 +0530

    grammar.js: Improve grammar and export tokens
    
    Summary:
    
    - Import/Export grammar tokens through tokens.js file (so that swh-search can use them)
    - Improvements in the grammar to better handle sort_by and limit
    - Introduce annotateFilter function in grammar.js to assign tree-sitter fields to
      different parts of a filter (field, op, value)
    
    Depends on D6108
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:

See https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/266/ for more details.

KShivendu edited the summary of this revision. (Show Details)

Build is green

Patch application report for D6109 (id=22102)

Rebasing onto cad6ace509...

Current branch diff-target is up to date.
Changes applied before test
commit b148b3c973f4ba6ad35a50ae7f94cbfefb4b89f4
Author: KShivendu <shivendu@iitbhilai.ac.in>
Date:   Wed Aug 18 00:28:15 2021 +0530

    grammar.js: Improve grammar and export tokens
    
    - Export grammar tokens through tokens.js file (so that swh-web can use them)
    - Improvements in the grammar to better handle sort_by and limit
    - Introduce annotateFilter function in grammar.js to assign tree-sitter fields to
      different parts of a filter (field, op, value)

See https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/267/ for more details.

vlorentz added inline comments.
query_language/grammar.js
1

while we're at it, this header should probably just have 2021 as date

185–186

why not function annotateFilter(field, op, value) {?

query_language/tokens.js
1

missing header

  • Changes suggested by vlorentz
  • Polish the code (add comments, improve formatting)
  • Squash

Build is green

Patch application report for D6109 (id=22103)

Rebasing onto cad6ace509...

Current branch diff-target is up to date.
Changes applied before test
commit c6d21fd64955de8b791193af007a70c228201592
Author: KShivendu <shivendu@iitbhilai.ac.in>
Date:   Wed Aug 18 00:28:15 2021 +0530

    grammar.js: Improve grammar and export tokens
    
    - Export grammar tokens through tokens.js file (so that swh-web can use them)
    - Improvements in the grammar to better handle sort_by and limit
    - Introduce annotateFilter function in grammar.js to assign tree-sitter fields to
      different parts of a filter (field, op, value)

See https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/268/ for more details.

  • tokens.js: Use concat in fields

Build is green

Patch application report for D6109 (id=22105)

Rebasing onto ee04e01ae0...

Current branch diff-target is up to date.
Changes applied before test
commit db47029f6c91a91395ae49b48dee142b9e0b5490
Author: KShivendu <shivendu@iitbhilai.ac.in>
Date:   Wed Aug 18 00:28:15 2021 +0530

    grammar.js: Improve grammar and export tokens
    
    - Export grammar tokens through tokens.js file (so that swh-web can use them)
    - Improvements in the grammar to better handle sort_by and limit
    - Introduce annotateFilter function in grammar.js to assign tree-sitter fields to
      different parts of a filter (field, op, value)

See https://jenkins.softwareheritage.org/job/DSEA/job/tests-on-diff/269/ for more details.

This revision is now accepted and ready to land.Aug 18 2021, 10:34 AM