Comments (8)
Hey Nik,
It probably means that there's a bug somewhere :) Can you post the corresponding source? I'll have a look.
from fstar-mode.el.
https://github.com/mitls/mitls-fstar/blob/master/src/tls/ConnInvariant.fst
I'm using GNU Emacs 24.5.1 (i686-pc-mingw32)
Thanks!
from fstar-mode.el.
Thanks Nik. This seems to be due to the heuristic for guessing whether something is a variable or a function; it highlights things as functions if it sees anything looking like an argument before seeing an equal sign after a let-binding. Since syntax highlighting works on a per-line basis in Emacs, it gets confused about the last two definitions, and accidentally highlights the first of the two differently because of the final space.
The indentation code is actually pretty complex, due to having to to look ahead arbitrarily far. I wonder if it wouldn't be better to simplify it and always highlight things after a let
the same.
Do we have a quick-reference cheatsheet for F* that we could highlight manually? It would serve as a nice test suite for highlighting code.
from fstar-mode.el.
Apparently tuareg mode uses a simple heuristic, in which the name after let is always colored as a function, unless it is immediately followed by an =
sign. It breaks with let a \n = 1
, but this sounds acceptable.
I'll try implementing that for F* too.
from fstar-mode.el.
Also, looking at the highlighting again, I think I was a bit too enthusiastic about highlighting arguments in let
s. Maybe I should revisit that too.
from fstar-mode.el.
I think distinguishing function from non-functions is overrated, particularly as only the definition site is (maybe) colored, not the uses also.
Can we color all identifiers uniformly? I wouldn't mind if the definitions were in the orange-ish shade used now and the uses were black.
from fstar-mode.el.
Sure, that sounds good!
from fstar-mode.el.
Ok, done I think :) The updated package should be on MELPA in a few hours.
I tried to simplify the highlighting and make it more robust. F*'s syntax is not the easiest to parse with regular expressions :)
I'd be interested in experimenting with a way to make highlighting better, through e.g. an external process that actually understands F*'s syntax.
from fstar-mode.el.
Related Issues (20)
- F* over TRAMP crashes HOT 17
- No company completion HOT 4
- fstar-mode over docker-tramp HOT 5
- fstar-jump-to-definition on a module should jump to the fsti if it exists HOT 1
- Code that typechecks normally from the command line can crash fstar-mode HOT 1
- Cleanup of compiler hacking subp-prover args in fstar-mode.el HOT 6
- `nil` confusion HOT 2
- fslit seems to no longer work very well HOT 6
- can't include file in subdirectory with fslit HOT 4
- Weird display of the highlighted blocks HOT 1
- Highlight sladmit
- c-c c-v verify should ask to save the current file HOT 5
- fstar literate setup problems on Ubuntu 22.04 and emacs 28 HOT 4
- Not all errors going to *Flycheck errors*
- Open not always working HOT 1
- c-c c-r reload better description HOT 3
- elaborate trace mode HOT 2
- Definition lookup works only once
- Using F* remotely, over TRAMP HOT 5
- advancing is missing a bunch of new top-level constructs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fstar-mode.el.