mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Change _=_ pair operator priority
This commit is contained in:
parent
311ff83d59
commit
86862be9f5
1 changed files with 19 additions and 16 deletions
|
|
@ -5,18 +5,19 @@ local binops_prio = {
|
|||
[1] = { ";" },
|
||||
[2] = { ":=", "+=", "-=", "//=", "/=", "*=", "%=", "^=" },
|
||||
[3] = { "," },
|
||||
[4] = { "|", "&", "~?", "~", "#" },
|
||||
[5] = { "!=", "==", ">=", "<=", "<", ">" },
|
||||
[6] = { "+", "-" },
|
||||
[7] = { "*", "//", "/", "%" },
|
||||
[8] = { "::", "=" },
|
||||
[9] = {}, -- unary operators
|
||||
[10] = { "^" },
|
||||
[11] = { ".", "!" },
|
||||
[12] = {}
|
||||
[4] = { "=" },
|
||||
[5] = { "|", "&", "~?", "~", "#" },
|
||||
[6] = { "!=", "==", ">=", "<=", "<", ">" },
|
||||
[7] = { "+", "-" },
|
||||
[8] = { "*", "//", "/", "%" },
|
||||
[9] = { "::" },
|
||||
[10] = {}, -- unary operators
|
||||
[11] = { "^" },
|
||||
[12] = { ".", "!" },
|
||||
[13] = {}
|
||||
}
|
||||
local pair_priority = 8
|
||||
local implicit_multiply_priority = 7.5 -- just above / so 1/2x gives 1/(2x)
|
||||
local pair_priority = 4
|
||||
local implicit_multiply_priority = 8.5 -- just above / so 1/2x gives 1/(2x)
|
||||
-- unop priority
|
||||
local prefix_unops_prio = {
|
||||
[1] = {},
|
||||
|
|
@ -27,10 +28,11 @@ local prefix_unops_prio = {
|
|||
[6] = {},
|
||||
[7] = {},
|
||||
[8] = {},
|
||||
[9] = { "-", "!" },
|
||||
[10] = {},
|
||||
[9] = {},
|
||||
[10] = { "-", "!" },
|
||||
[11] = {},
|
||||
[12] = { "&" }
|
||||
[12] = {},
|
||||
[13] = { "&" }
|
||||
}
|
||||
local suffix_unops_prio = {
|
||||
[1] = { ";" },
|
||||
|
|
@ -43,8 +45,9 @@ local suffix_unops_prio = {
|
|||
[8] = {},
|
||||
[9] = {},
|
||||
[10] = {},
|
||||
[11] = { "!" },
|
||||
[12] = {}
|
||||
[11] = {},
|
||||
[12] = { "!" },
|
||||
[13] = {}
|
||||
}
|
||||
|
||||
local function get_text_in_litteral(s, start_pos)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue