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

Make formatter compatible with 5.1 code #15

Merged

Conversation

keneanung
Copy link

@keneanung keneanung commented Apr 3, 2018

Resolves #14

@martin-eden martin-eden merged commit dbdddb1 into martin-eden:5.1-syntax_5.1 Apr 3, 2018
@martin-eden
Copy link
Owner

martin-eden commented Apr 3, 2018

Pull request accepted.

There is still grammar for hex numbers (which was introduced in 5.2). But I don't see how it may cause practical problems.

(Special thanks for removing new operators (which I forgot to mention in #13) and for changing comments correspondingly.)

@keneanung
Copy link
Author

According to https://www.lua.org/manual/5.1/manual.html part 2.1, hex numbers are already supported in 5.1, but maybe I overlooked something?

@martin-eden
Copy link
Owner

Yes, you're right. I've quick-checked this wrong:

$ lua5.1
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> 0x1
stdin:1: unexpected symbol near '0x1'

instead of

> print(0x1)
1

And also in 5.2 was added binary exponent part:

Hexadecimal constants also accept an optional fractional part plus an optional binary exponent, marked by a letter 'p' or 'P'.

SlySven added a commit to SlySven/Mudlet that referenced this pull request Mar 3, 2022
For the last few years we have been using the wrong branch as the one we
were on did not permit the use of `goto` as an identifier and "labels" as
targets for such `goto`s as version of Lua after 5.1 forbode that as it
became a command to uncontrollably jump around Lua scripts as it does in
the C (or BASIC) programming languages!

This change will pull in changes that @keneanung did to the lfc submodule
as:
* martin-eden/lua_code_formatter#15
* martin-eden/lua_code_formatter#16
but we had forgotten to use.

This will close Mudlet#5997.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
SlySven added a commit to Mudlet/Mudlet that referenced this pull request Mar 6, 2022
For the last few years we have been using the wrong branch as the one we
were on did not permit the use of `goto` as an identifier and "labels" as
targets for such `goto`s as version of Lua after 5.1 forbade that as it
became a command to uncontrollably jump around Lua scripts as it does in
the C (or BASIC) programming languages!

This change will pull in changes that @keneanung did to the lfc submodule
as:
* martin-eden/lua_code_formatter#15
* martin-eden/lua_code_formatter#16
but we had forgotten to use.

This will close #5997.

Also add some of the `./github/` sub-directory files, to the qmake project
file - so they show up in the QtCreator editor...!

There are further changes needed to the QMake `OTHER_FILES`, `INSTALLS`
and `DISTFILES` variables but they should be left to a further, separate PR.

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
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.

None yet

2 participants