question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

🐛 Bug Report

While antlr4 is a supported syntax in prism, it does not look like it’s supported in D2. This is likely due to the syntax not being included with D2. If this is the case, what is the best course of action?

To Reproduce

Enter this antlr4 snippet and use antlr4 or g4 per the prism instructions as the language:

grammar JSON;

json
   : value
   ;

obj
   : '{' pair (',' pair)* '}'
   | '{' '}'
   ;

Expected behavior

image

Actual Behavior

image

Your Environment

packages.json

{
  "name": "website",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "docusaurus": "docusaurus",
    "start": "docusaurus start",
    "build": "docusaurus build",
    "swizzle": "docusaurus swizzle",
    "deploy": "docusaurus deploy"
  },
  "dependencies": {
    "@docusaurus/core": "^2.0.0-alpha.58",
    "@docusaurus/preset-classic": "^2.0.0-alpha.58",
    "classnames": "^2.2.6",
    "docusaurus-plugin-internaldocs-fb": "^0.3.3",
    "react": "^16.8.4",
    "react-dom": "^16.8.4"
  },
  "resolutions": {
    "prism-react-renderer": "1.1.0"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
omrycommented, Jul 21, 2020

Reading the docs, swizzle is to be used when I add my own language support. I am trying to use an existing language supported by prism here.

If you want to add highlighting for languages not yet supported by Prism, you can swizzle prism-include-languages

0reactions
omrycommented, Jul 21, 2020

It is enough, not sure if Prism somehow brings the language syntax at runtime or if it’s comes packages with all of them after all. it’s small enough (1.17K).

Read more comments on GitHub >

github_iconTop Results From Across the Web

antlr4/lexer-rules.md at master - GitHub
The action conforms to the syntax of the target language. ANTLR copies the action's contents into the generated code verbatim; there is no...
Read more >
ANTLR
What is ANTLR? ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured ...
Read more >
An introduction to language lexing and parsing with ANTLR
ANTLR 4 allows you to define lexer and parser rules in a single combined grammar file. This makes it really easy to get...
Read more >
The ANTLR Mega Tutorial - Federico Tomassetti
The definitive ANTLR mega tutorial on ANTLR4. ... It is called ANTLR4 grammar syntax support and is created by one of the main...
Read more >
ANTLR4 grammar syntax support - Visual Studio Marketplace
Extension for Visual Studio Code - Language support for ANTLR4 grammar files. ... Syntax coloring for ANTLR grammars (.g and .g4 files).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found