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

Wrong locations with line endings LF on windows. #58

Closed
leitwolf opened this issue Aug 30, 2018 · 3 comments
Closed

Wrong locations with line endings LF on windows. #58

leitwolf opened this issue Aug 30, 2018 · 3 comments
Labels
incorrect parsing Valid Lua code fails to parse, is parsed incorrectly, or invalid Lua code is accepted

Comments

@leitwolf
Copy link

code:

--[[


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

]]

local json = {}
 

when with line endings LF (the correct line 14, not 12):

    "type": "Chunk",
    "body": [
        {
            "type": "LocalStatement",
            "variables": [
                {
                    "type": "Identifier",
                    "name": "json",
                    "loc": {
                        "start": {
                            "line": 12,
                            "column": 6
                        },
                        "end": {
                            "line": 12,
                            "column": 10
                        }
                    },
                    "isLocal": true
                }
            ],
            "init": [
                {
                    "type": "TableConstructorExpression",
                    "fields": [],
                    "loc": {
                        "start": {
                            "line": 12,
                            "column": 13
                        },
                        "end": {
                            "line": 12,
                            "column": 15
                        }
                    }
                }
            ],
            "loc": {
                "start": {
                    "line": 12,
                    "column": 0
                },
                "end": {
                    "line": 12,
                    "column": 15
                }
            }
        }
    ],
    "loc": {
        "start": {
            "line": 12,
            "column": 0
        },
        "end": {
            "line": 12,
            "column": 15
        }
    },
    "globals": []
}

correct with line endings CRLF.

system:
windows10 1803

@fstirlitz
Copy link
Owner

Fixed in 9255368, thank you.

@leitwolf
Copy link
Author

leitwolf commented Sep 1, 2018

npm still version 0.2.1.
would you please push the new version to npm?
thank you!

@fstirlitz
Copy link
Owner

I think it's something only @oxyc can do. And we haven't actually made a decision whether to make a release yet. A couple of issues are left to be resolved before that happens, like #33 and #54. So don't hold your breath. Sorry.

@fstirlitz fstirlitz added the incorrect parsing Valid Lua code fails to parse, is parsed incorrectly, or invalid Lua code is accepted label Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incorrect parsing Valid Lua code fails to parse, is parsed incorrectly, or invalid Lua code is accepted
Projects
None yet
Development

No branches or pull requests

2 participants