mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-06-16 01:54:56 +02:00
Problem was before that for example the input [0x000KKK] would produce a hexadecimal and a value token (for the respective parts) However, the more correct way is to have the whole input identified as a value token. basicly if the whole input between "=" and a special "end-of-assignment" token can't be identified as a string,bool,integer whatever. it should be identified as a value token.
76 lines
1.8 KiB
Text
76 lines
1.8 KiB
Text
================================================================================
|
|
Number - Integer
|
|
================================================================================
|
|
|
|
INTEGER_VALUE = 1234
|
|
NEGATIVE_INTEGER_VALUE = -1234
|
|
INVALID_INTEGER = 01234
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(document
|
|
(assignment
|
|
key: (identifier)
|
|
value: (number
|
|
(integer)))
|
|
(assignment
|
|
key: (identifier)
|
|
value: (number
|
|
(integer)))
|
|
(assignment
|
|
key: (identifier)
|
|
value: (value)))
|
|
|
|
================================================================================
|
|
Number - Float
|
|
================================================================================
|
|
|
|
FLOAT = 1234.23
|
|
FLOAT = -1234.23
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(document
|
|
(assignment
|
|
key: (identifier)
|
|
value: (number
|
|
(float)))
|
|
(assignment
|
|
key: (identifier)
|
|
value: (number
|
|
(float))))
|
|
|
|
================================================================================
|
|
Number - Hex
|
|
================================================================================
|
|
|
|
HEX = 0xff00ff
|
|
INVALID_HEX = 0xffUUOKJ
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(document
|
|
(assignment
|
|
key: (identifier)
|
|
value: (number
|
|
(hexadecimal)))
|
|
(assignment
|
|
key: (identifier)
|
|
value: (value)))
|
|
|
|
================================================================================
|
|
Boolean
|
|
================================================================================
|
|
|
|
BOOL_VALUE = true
|
|
BOOL_VALUE = false
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(document
|
|
(assignment
|
|
key: (identifier)
|
|
value: (boolean))
|
|
(assignment
|
|
key: (identifier)
|
|
value: (boolean)))
|