Skip to content

Recognize clause heads not starting at the beginning of a line#54

Open
pvaibhav wants to merge 1 commit intoarthwang:masterfrom
pvaibhav:master
Open

Recognize clause heads not starting at the beginning of a line#54
pvaibhav wants to merge 1 commit intoarthwang:masterfrom
pvaibhav:master

Conversation

@pvaibhav
Copy link
Copy Markdown

This had been bugging me for a while.
When multiple clauses are written on the same line, e.g.:

father(mary, sam). father(june, sam).

The syntax highlight was only recognising the first clause. The
second one had to be placed on the next line.

This change allows clauses on the same line to be highlighted correctly.

Notes:

  1. VScode automatically upgrades tasks.json to v2 format.
  2. The syntaxes/prolog.tmLanguage.json file is a symlink to a private file in your home directory ( prolog.tmLanguage.json -> /Users/laowang/.vscode/extensions/vsc-prolog/syntaxes/prolog.swi.tmLanguage.json).
  3. The yml and json versions seem to be copies of each other just in a different format. Which one is canonical and which one is autogenerated? I changed them both manually.
  4. I could not quickly understand the difference between the bare syntax file, the swi version and the ecl version. So I changed the swi and ecl versions by hand.

Before:
CleanShot 2021-05-15 at 11 32 03@2x

After:
CleanShot 2021-05-15 at 11 33 17@2x

When multiple clauses are written on the same line, e.g.:

    father(mary, sam). father(june, sam).

The syntax highlight was only recognising the first clause. The
second one had to be placed on the next line.

This change allows clauses on the same line to be highlighted correctly.
@dr-impossible
Copy link
Copy Markdown

  1. Those symlinks should be changed to a relative path so that they don't break on another machine. e.g. ln -fs syntaxes/prolog.tmLanguage.json syntaxes/prolog.swi.tmLanguage.json

  2. The json versions of the syntax files are autogenerated from their yaml counterparts. The npm scripts syntax4swi and syntax4ecl generate the json files from the yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants