morbig icon indicating copy to clipboard operation
morbig copied to clipboard

Positions are still wrong

Open yurug opened this issue 7 years ago • 1 comments

The column numbers of starting position are still wrong, as demonstrated by the following example:

true

which produces the following JSON for the word true:

"CmdName_Word",
                                      {
                                        "value": [
                                          "Word",
                                          "true",
                                          [ [ "WordName", "true" ] ]
                                        ],
                                        "position": {
                                          "start_p": {
                                            "pos_fname": "true.sh",
                                            "pos_lnum": 1,
                                            "pos_bol": 0,
                                            "pos_cnum": 4
                                          },
                                          "end_p": {
                                            "pos_fname": "true.sh",
                                            "pos_lnum": 2,
                                            "pos_bol": 5,
                                            "pos_cnum": 5
                                          }
                                        }
                                      }

yurug avatar Mar 17 '19 10:03 yurug

This is, as of today, still the case. It has to do with the fact that Morbig, once it has delimited a token, only knows the position of the delimiter, and not the token itself. It would require a form of "position-aware" token buffer.

Niols avatar Nov 25 '19 16:11 Niols