lua < %% is only inside comment or string npairs.add_rules({ Rule("%", "%", "lua") :with_pair(ts_conds.is_ts_node({'string','comment'})), Rule("$", "$", "lua") :with_pair(ts_conds.is_not_ts_node({'function'})) }) EOF