Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreting [] in tex production #44

Open
buggymcbugfix opened this issue Nov 21, 2018 · 6 comments
Open

Interpreting [] in tex production #44

buggymcbugfix opened this issue Nov 21, 2018 · 6 comments

Comments

@buggymcbugfix
Copy link
Contributor

I have a terminal []—is there a way of "escaping" it for purposes of tex production?

Right now I am using a workaround like this:

  | [] c A :: :: Box {{ com Box }} {{ tex \square_{[[c]]} [[A]] }}
@buggymcbugfix
Copy link
Contributor Author

buggymcbugfix commented Nov 21, 2018

PS: I am using this terminal in more than one production.

@PeterSewell
Copy link
Contributor

PeterSewell commented Nov 21, 2018 via email

@buggymcbugfix
Copy link
Contributor Author

Hm, no I didn't mean a parameterised terminal. I guess this is a parsing issue: I just want [] to be interpreted as a terminal. Let me give you a small (counter) example.

terminals ::=
  | <> :: :: diamond {{ tex \lozenge }}
  | [] :: :: box     {{ tex \square }}

A, B :: 'Type_' ::=
  | <> e A :: :: Diamond {{ tex [[<>]]_{[[e]]} [[A]] }}  % ok
  | [] c A :: :: Box     {{ tex [[[]]]_{[[c]]} [[A]] }}  % nope
  | ...

So, here <> does the thing I want, but [] doesn't; I believe that this is because [] interferes with the quoting [[-]] syntax.

@francesco-zappa-nardelli
Copy link
Contributor

@buggymcbugfix
Copy link
Contributor Author

Hey, thanks for that suggestion! I had tried that, alas, it does not work.

@PeterSewell
Copy link
Contributor

PeterSewell commented Nov 21, 2018 via email

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

No branches or pull requests

3 participants