igochkov / vscode-ebnf Goto Github PK
View Code? Open in Web Editor NEWEBNF Tools for Visual Studio Code
License: MIT License
EBNF Tools for Visual Studio Code
License: MIT License
Toggling line comments (e.g. by pressing ctrl+/
) adds a C-style comment
ctrl+/
(or cmd+/
on macOS)Adds C-style line comment // ...
to the beginning of the line
Ideally it should add (* ... *)
style comment to the line
COMMENT is defined in the lexer. As a result, the parser has difficulties parsing it's own grammar, in particularly this line:
comment = ’(*’, {comment symbol}, ’*)’;
Everything between (*
and *)
is considered a comment by the lexer. Because the lexer has already matched the comment the parser sees only the rest, which is:
comment = ’’;
The solution is to define the comment rule in the parser, and not in the lexer, however it will 'pollute' the grammar with the comment rule everywhere. According the official EBNF grammar, a comment is allowed anywhere outside a <terminal string>
, <meta identifier>
, <integer>
or <special sequence>
.
comment = ’(*’, {comment symbol}, ’*)’;
comment symbol = comment | terminal string | special sequence | character;
If you press Enter just before the closing comment symbol, the closing comment symbol is removed.
Obviously it should not do that.
Typing a terminating symbol in comments triggers formatting.
Not desirable and has to be fixed.
The coloring is affected by a special '¬' character. Deleting the optional part with that character solves the problem and the coloring works fine again.
special-symbol = '+' | '-' | '*' | '/' | '¬' | '=' | '<' | '>' | '[' | ']' | '.' | ',' | ':' |
';' | '^' | '(' | ')' | '<>' | '<=' | '>=' | ':=' | '..' |
'and' | 'array' | 'begin' | 'case' | 'const' | 'div' | 'do' | 'downto' | 'else' |
'end' | 'file' | 'for' | 'function' | 'goto' | 'if' | 'in' | 'label' | 'mod' |
'nil' | 'not' | 'of' | 'or' | 'packed' | 'procedure' | 'program' | 'record' |
'repeat' | 'set' | 'then' | 'to' | 'type' | 'until' | 'var' | 'while' | 'with' ;
The coloring is incorrect when using the character '¬' in an ebnf option specification.
The coloring should be correct for a rule containing that character.
Remove all images from the package but the icon. Reference them from other location.
Create language server infrastructure
Extend .gitignore with *.vsix
Formatting code with partially invalid syntax causes code to be lost.
Before code formatting:
Afte code formatting:
All the code before the broken syntax is formatted properly, but everything after is deleted
Formatting a file with invalid syntax should not do anything to the file.
Formatting does really weird stuff with escaping and the | symbol if the newline option is turned off
letter = "A" | "B" | "C" | "D" | "E" | "F";
letter = "A"| "B"| "C"| "D"| "E"| "F";
"\\", "\\\\\\", '\\', "\", '\', '\\\\'
, it literally doesn't matter how many backslashesExplained above
Not do that
new name ebnf.configuration.json
I like the functionality of this extension a lot. However, it chooses syntax colors that aren't what I would expect.
I would expect strings in an EBNF specification to appear in the same color as constant strings in code, e.g. in a Python program. In my Visual Studio theme (Light Modern), this is red. But with this extension strings appear black.
This extension colors a non-terminal that's being defined (on the left side of '=') in the same color that Visual Studio uses for keywords in programming languages. In the Light Modern theme this is blue. That seems wrong to me, since a non-terminal is not a keyword. In my opinion, a non-terminal that's being defined should have the same color as a non-terminal that's being used (on the right side of '='). By analogy, if I write Python code such as
def foo(x):
return bar(x)
then VS Code displays 'foo' and 'bar' in the same color, even though 'foo' is a function that's being defined and 'bar' is a function that's being called. Simply put, they are both the same kind of thing, i.e. a function, so I think they should have the same color.
I know that these colors are a matter of opinion, so if you disagree you can simply close this. But I thought I would at least bring this up.
Please check the images on the README. Many are broken.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.