Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • vala vala
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 770
    • Issues 770
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 73
    • Merge requests 73
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • valavala
  • Merge requests
  • !18

Draft: Remove 'syntax error, ' and internalise ParseError

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Al Thomas requested to merge astavale/vala:remove-syntax-error into master Sep 20, 2018
  • Overview 4
  • Commits 2
  • Pipelines 0
  • Changes 2

Both the Vala and Genie parsers can throw a ParseError. At present this is caught and has the phrase 'syntax error, ' placed in front of the exception message. This makes it more difficult for translations because the message is now split. It also seems superfluous. For example missing the semi-colon at the end of a line gives error: syntax error, expected `;'. Well we know it is an error and the word 'syntax' doesn't add much. So this patch will make the message just error: expected `;' If that is too brief then the individual message should be updated, but that is part of a wider review.

Some code that causes syntax error, to be reported twice to the programmer has also been removed.

ParseError has a FAILED value. This is unused and so removed in the second patch. Given this changes the public API ParseError has also been made internal. The second patch is a bit more controversial, but would help understand how third parties use libvala for checking source files and reporting diagnostics.

Edited Nov 09, 2021 by Rico Tzschichholz
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: remove-syntax-error