[Question]
  [
In this challenge, the goal is to find the values of some variables after a number of assignments are done. An example input:
```
a = 5
b = 4
c = a = b
a = 2
b = a
```
This would result in:
```
a = 2
b = 2
c = 4
```
Each statement will be one of the following:
* A variable name (`[a-z_]+`)
* A numeric value (`[0-9]+`)
* An assignment operation, with a variable name on the left and a statement on the right
You may assume that the input will be a list of statements, formatted however you want. Variable names will have differing lengths (if you need a hard value to gold within, assume 16 chars max).
Note that statements can contain more or less than one assignment (such as `a`, `23`, or `a = b = c = 4`), and that variables can appear that are never assigned to. Assume no undefined variables are used as values in an assignment (such as `a = undefined_variable`), and that no variable will be on both sides of an assignment (such as `a = a` or `a = a = 1`).
You can take input any way you wish (such as a string with a character to delimit statements, a list formatted as `[["a", 5], ["b", "a"]]`, etc.), and output can be in any consistent format (such as a hash map of names to values, or a list of values in the order that the variables first appeared).
Test cases:
```
a = 5                     -> a = 5
b = 512, c = a = 2        -> a = 2, b = 512, c = 2
def, 2, e = 8, 101        -> e = 8
                          -> 
a                         -> 
fgh = 4, i = 3, fgh = i   -> fgh = 3, i = 3
j = k = l = m = n = 14    -> j = 14, k = 14, l = 14, m = 14, n = 14
s = t = u = 6, t = v = 7  -> s = 6, t = 7, u = 6, v = 7
o = 3, o = p              -> [undefined]
q = r                     -> [undefined]
w = w = 2                 -> [undefined]
x = 4, x = x              -> [undefined]
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer per language wins!
  
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 22 [bytes](https://github.com/abrudz/SBCS)
```
{n⊣⍵{0::0⋄⍵⍎⍺}¨n←⎕NS⍬}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///vzrvUdfiR71bqw2srAwedbcAmY96@x717qo9tCLvUduER31T/YIf9a6p/Z8G4gGlupoPrTd@1DYRKBMc5AwkQzw8g/8DaedI9eLEnBJ1oCmpeYlJOanBjj4hXLFJ@RWZeekK@XlcXHnFQDPSFNQTgZSpuoJ6EpA2AdLJQBoklqQOkTOCyiWqA7XoaWg86lqkA7Ra89AKkHN8FA6tN9Lk4tKAmgRSmQw1CcY2hpqUAuKra@IyA2jEo64mHfVEkJJHvVtQpdRTUtOA5oBckwo0xwJIGxoY4jQNAA "APL (Dyalog Unicode) – Try It Online")
Takes a list of statements in the form of `a←b←3`, and returns a namespace which is essentially a hashmap of variable names to values. You can't print all the contents of it directly, but you can inspect individual variables like `ns.somevar` or list all names using `ns.⎕NL ¯2`.
Oh, and APL doesn't have any alphanumeric-only keywords!
```
{n⊣⍵{0::0⋄⍵⍎⍺}¨n←⎕NS⍬}  ⍝ ⍵: list of statements
               n←⎕NS⍬   ⍝ Create an empty namespace
   ⍵{        }¨         ⍝ For each statement...
          ⍵⍎⍺           ⍝ Try executing the statement inside the namespace
     0::0⋄              ⍝ ignoring any errors (undefined name)
 n⊣                     ⍝ Return the populated namespace
```
[Answer]
# [Python ~~3~~ 2](https://docs.python.org/2/), ~~80~~ ~~75~~ 69 bytes
*-5 bytes thanks to @Sisyphus*  
*-6 bytes thanks to @xnor*
```
g={}
for s in input():
 k=s.pop()
 for n in s:g[n]=g.get(k,k)
print g
```
[Try it online!](https://tio.run/##K6gsycjPM/r/P922upYrLb9IoVghMw@ICkpLNDStuBSybYv1CvILNDS5FECyICmFYqv06LxY23S99NQSjWydbE2ugqLMvBKF9P//o6PVE9V1FExjdaLVk4AMExAjGcgACwOFQHwQ0wimAsiLjQUA "Python 2 – Try It Online")
Takes input as a list of lists of terms, returns a dict of variable name to value.
## Explanation
```
def f(x,g={}):    # Save a few bytes by defining g as a default argument.
 for s in x:
  k=s.pop(-1)     # Take the last term, which is the value we'll be using.
  for n in s:     # For all *other* values:
   g[n]=g.get(k,k)    # .get(k, k) means "get the value called k, if not found use k raw" (numbers will not be found)
 return g
```
Note that it never actually differentiates between numbers and variables, just trusts that the input won't try to assign to a number. This means you *can* actually use it to assign to a number - this input:
```
[9, 5],
['b', 9],
['c', 'a', 'b'],
['a', 2],
['b', 9]
```
Will result in this output:
```
{9: 5, 'b': 5, 'c': 5, 'a': 2}
```
[Answer]
# [J](http://jsoftware.com/), 66 bytes
33 bytes for the `_ =: 1` special case …
```
(rplc&('a0';'_')@}.~&_6;".)&>@r0[0!:110@rplc&('_';'a0')[r0=:4!:5@1
```
[Try it online!](https://tio.run/##ZY87D4IwEID3@xWFgaOJkhYBTY2GxMTJyZWBIIKAz@AjLvrXkWs0Ghn65R5f79qqMR3M2UQxZD0mmGpP32Gz5WLe2PVpl1o2JgLHGCMPH87TioOx6XBrGtYiEoaSUoRvLW6tVuVRLSbKM5QfyoZDlhZHljOMaccAP7mtV7Xte3mhjg/8v7XSdelCSkFCcL8WrrO8Oy1JC3AhI3cEUsgfP@nY@aYg0YNSv@2Tlz@XKipsCTvCnnAgSK8z7kx1/ZkrIQAd3whD4M0L "J – Try It Online")
### How it otherwise works
```
(_6&}.;".)&>@r0[0!:110[r0=:4!:5@1
```
It's a mess! `m!:n` are special functions, that do stuff depending on `m` and `n`.
* `r0=:4!:5@1`: "4!:5 (1) produces a list of global names assigned since the last execution of 4!:5." Store as `r0`, so we can execute it again cheaply while it won't be overwritten.
* `0!:110` execute input string as script, ignoring any output/errors (so predefined values won't cause harm.)
* `r0` execute `4!:5@1` again, get boxed list of changed variables
* `&>` unbox and …
* `".` execute each variable to get its value
* `_6}&.` drop last 6 characters from the variable (which contain the namespace `_base_`.)
* `;` join name and result together
[Answer]
# JavaScript (ES6), 81 bytes
Expects a string in the format described in the challenge. Returns an array of `[name, value]` pairs.
```
s=>Object.keys(o={},eval(s.replace(/[_-z]+/g,"o.X$&"))).map(k=>[k.slice(1),o[k]])
```
[Try it online!](https://tio.run/##lZHRToMwFIbvfYqmMaaNXRG2OW/YK3hrQgjpWGFAoYQiiRqfHQ@FRaneSPLn9PznO3@bUIpBmLQr2n7T6LMcs3A04fH5VMq055V8M0SHH59MDkIRwzvZKpFK4kXJ5j2@93KGNX@5vcOUUl6LllThMaq4UQVAPmU6quKYjqlujFaSK52TjGCBQrTH6PdHKfI8ZMc3zs5pMv2AoRQOExFgdweGKypwM84yYxMlYfjEkP/grzKs7e789cwfOy4u8L/wLL/ApTuGCihbhua@wAs@t9tl7C6XYFYgBapBDcjf4etdpW2ZRaaqllovdcbdUANuD3oFPTJ7HEAHPIeab/vArpAF3KAkaTvd6yRxf/YctBqPXw "JavaScript (Node.js) – Try It Online")
### How?
We define an object `o` initially empty and add the prefix `"o.X"` to all variable names in the input string.
Example:
```
/* before */ "s = t = u = 6, t = v = 7"
/* after  */ "o.Xs = o.Xt = o.Xu = 6, o.Xt = o.Xv = 7"
```
We need the leading `X` to prevent the reserved property [`__proto__`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto) from being overridden this way.
Provided that the input string is in the expected format -- which is guaranteed by the challenge rules -- the transformed string can be safely `eval()`'uated. We then iterate on the keys of `o` to build a list of pairs consisting of 1) the key name without the leading `X` and 2) the final value associated to the key.
Without the `__proto__` issue, this could be done in just 45 bytes without any post-processing:
```
s=>(eval(s.replace(/[_-z]+/g,"o.$&",o={})),o)
```
[Try it online!](https://tio.run/##lVHbToQwEH3nKyaNMW2cBWFvvuCPGEMqW1iwSwlFHjR@Ow6FjVJ9keRkOufWJtRykDbvqrbfNOakxiIdbfrI1SA1t2GnWi1zxaOnbPP@fBeVyEx4c8vQpB@fQqARY24aa7QKtSl5wZmEFPYMfn9CQBSBkwMv8zKRcYKQ02FyJMzPkLhyJX7HSRU4uRSJDwjxfbzqcLSf@euZPzK@XbJ/2YvyTJfuECoaW4R5r9hin9ftIvvhmshXgiZcCA0h3rHrXbVb0VmmqZd5WeZs90stsT3hjXBAdxwIRzaX2m/6iFeTMwQByf25smAaBYWstPW7s6ztTG@yzP//c/dKHr8A "JavaScript (Node.js) – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~55~~ ~~51~~ 43 bytes
```
($=<||>;($@#2=#/.$)&~Fold~Reverse@#&/@#;$)&
```
[Try it online!](https://tio.run/##TYzNDoIwEITvPkUTCMGEiCCoCWJ60bPRJ6hQBOVHAbnw8@q43b14mHRmvtkWok1lIdosEnMSzqYeHobhGJg619xQs1f60pjOVR5PV9nJupFcM2yuBVDPlzorW57wU5RWUE@3SJRTv@h7wZjFmD@OFoQ7BN9xwbM@Ak/QJRjLBIEq1CsR7tE7a4dGgp7kkQLzkGW426CnPqPRE8ALlIMKUKmGjkewgdCCvni9xWuVO8w7GlV/Xyv/ZozAB0KtwmKcfw "Wolfram Language (Mathematica) – Try It Online")
-8 thanks to w123
[Answer]
# [Python 3.9rc2](https://www.python.org/downloads/release/python-390rc2/), 67 bytes
```
def f(x):
 g={}
 for*u,k in x:g|={n:g.get(k,k)for n in u}
 return g
```
No TIO link, as TIO doesn't support Python 3.9.
Borrows ideas from [Artemis' answer](https://codegolf.stackexchange.com/a/211447/48931), with the following improvements:
* We can use an iterable unpack `*u,k` in the for loop.
* In Python 3.9 we can merge dicts using `a|=b`, which is much shorter than the old `a.update(b)` and `{**a,**b}` methods.
[Answer]
# [Python 3](https://docs.python.org/3/), ~~159~~ ~~141~~ ~~152~~ 128 bytes
```
def f(s):
	g={}
	for k in s:
		if'='in k:
			*v,l=k.split('=')
			for r in v:
				try:g[r]=int(l)
				except:g[r]=g[l]
	return g
```
[Try it online!](https://tio.run/##ZY1BCsMgEEXX4yncqaUUSneBOUmaRZOolYgRY0JD6dmtWgqF7v5/8z7j93if3SWlUSqq@CIaAhqfLwJqDnSixtElIzCKIctlKgUO29HidFq8NZHngyiwDEIZbNWBGPZGt6FD4yK3VQH5GKSPH6xb2xEIMq7BUZ18KJ7ijLEa8UxuWFMm31dXx4QQhPzIPRmy2uOIw5@Y3g "Python 3 – Try It Online")
-18 bytes [thanks to](https://codegolf.stackexchange.com/questions/211446/find-the-result-of-some-assignment-statements/211448?noredirect=1#comment497987_211448) [pxeger](https://codegolf.stackexchange.com/users/97857/pxeger)
+11 bytes [thanks to](https://codegolf.stackexchange.com/questions/211446/find-the-result-of-some-assignment-statements/211448?noredirect=1#comment498204_211448) [Shaggy](https://codegolf.stackexchange.com/users/58974/shaggy) for pointing out a bug
-24 bytes [thanks to](https://codegolf.stackexchange.com/questions/211446/find-the-result-of-some-assignment-statements/211448?noredirect=1#comment498207_211448) [ovs](https://codegolf.stackexchange.com/users/64121/ovs)
Python really isn't my strong suit for golfing :/ Note the use of tabs rather than spaces, so the indentation levels are still a single byte each. Takes input as a list of lines with assignments separated by `=` (no spaces) and returns a dictionary of variables and values
[Answer]
# Batch, ~~331~~ ~~317~~ 72 bytes
```
@setlocal
@for /f "delims==" %%a in ('set')do @set %%a=
@set/a%*
@set
```
Takes a comma-separated list of assignments on the command line. Explanation:
```
@setlocal
```
Don't modify the parent environment.
```
@for /f "delims==" %%a in ('set')do @set %%a=
```
Delete all variables, including predefined variables such as `PATH`. We're only using shell builtins, so we don't need them.
```
@set/a%*
```
Evaluate the assignments.
```
@set
```
List all of the resulting variables.
[Answer]
# [SNOBOL4 (CSNOBOL4)](http://www.snobol4.org/csnobol4/), 183 bytes
```
	T =TABLE()
N	X =INPUT	:F(O)
R	X SPAN(&LCASE '_') . Y (' ' | RPOS(0)) . Z ='T<"' Y '">' Z	:S(R)
	EVAL(X)	:(N)
O	A =CONVERT(T,'ARRAY')
I	I =I + 1
	OUTPUT =A<I,1> ' = ' A<I,2>	:S(I)
END
```
[Try it online!](https://tio.run/##FY5Ni8JADIbPmV8RPJgEZVmXRaE4hVl3FgbKTJmO0noRPIse/Dj537vp4YHkCeR979fb@Xb5HkcoaIv7aTyLidCjDbHdF6j@OInJKrrWRZ43O9d5pBMJfuCATEj4xtymjj9lcke0VLYz0iPNasIjVB1nMeAPruFeoOIoJoFDu0vx4HPhsiSXsxtITICgybjAlYG0L9oArduG5arWHKtMy1c9/QxifPwdx7v6h/JU1maaXsrmHw "SNOBOL4 (CSNOBOL4) – Try It Online")
Takes input separated by newlines with spaces between the `=`, and returns in the same format.
[Answer]
# [Ruby](https://www.ruby-lang.org/), 63 bytes
```
def f(a)
a.reduce({}){|m,x|*r,k=x
r.map{|y|m[y]=m[k]||k}
m}
end
```
[Try it online!](https://tio.run/##jY/NboMwEITvfoqVOBAqK4oJ@bnwJMgHfkybOEYRCVEQ5tnprjFV2kNbDjO7K77RuO2KfpoqVUO9yiOWr1tVdaVaDWM0WMOf9q3lOn2ydm3y62B7a7JepibT0lo9MjMy1VTTFeksC/OQw07KCH77AsghhR3zTEGMiCWHLCxxdiHxj5CZiTkUhAocStqXDKwfUsCcojDgSJPYiJecABQyR8/81XJhhpF9Pe4fzCtQv39gk8R1OuG0ddN8xcOcFgAesNeWw4lsgc/0kya5kBiSBkUk3550RkYkHLT3i3fjvXG@hN4o5U7SoexdH7c@UA4@OIAbQnsOd7QDh27eHrSx6RM "Ruby – Try It Online")
I rarely golf in Ruby (tips appreciated) but I use it for work, and I liked [Artemis's clean answer](https://codegolf.stackexchange.com/a/211447/15469) so much that I decided to see what a translation into ruby would look like.
[Answer]
# [Scala](http://www.scala-lang.org/), 98 bytes
```
_./:(Map[String,String]()){case(m,a::b)=>val x=m.getOrElse(a,a);(m/:b.map(_->x))(_+_)case(m,_)=>m}
```
[Try it online!](https://tio.run/##dY/LboMwEEX3fMWIlUchpPQtqkHqortWXXTZRsgQQ11hgrCLkKJ8OzWGplIqvJi5vveMHzrnFR/22ZfIDbxwWYPojah3Gh6bBg5exysoYniW2ry78mZaWZfbLVBi@WbeB7MNNKThJmb/E4Z4yLkWTAU8jjOkZDy6JxWWwry2T5WNeMDxgalNnIWKNyxdJz0iS1cpzpOpHVPHwduJAozQhukYpvMRCBorTFUzf32@Pmp/VTAdWlSFuqmkYb71MDT78VPTbb8BWX8yRvzEtKITrRaI6Hkw3e77vpUAGd1El07lxGlSNsNzzj7b9YkQdO96dBEtThTlJ107Jenq5MhFXpOhb7p12hVDHd0t4n/BcfgB "Scala – Try It Online")
The statements have to be reversed (`List("2","b")` for "b=2"). The solutions below can't handle empty input.
# [Scala](http://www.scala-lang.org/), ~~96~~ 94 bytes
```
_./:(Map[String,String]()){(m,l)=>val x=m.getOrElse(l.last,l.last);(m/:l.init.map(_->x))(_+_)}
```
[Try it online!](https://tio.run/##dY/NTsMwEITveYqVT161dQn/CtpIHLiBOHCEKnJTJxg5aVQvVaSqzx7cpCqiKD54Pu@Md22fa6e79fLL5Awv2tZgWjb1ysNj08Au2moHRQLP1vN7v73xxtblYgGUhnxzPE@PZaAuU/NE/nck4k5WU4eUHnq2VKnS8OvmyXkjnXLa83QQfJDVPHHK1pZVpRuZzdIWUWaTDPddtDIFsPEsfQJDbwSCJgC7WorZ@fqoxaSQXoVopXzjLEsRaqh4ffjQMOGPSycTEaMIhnFCiIAAS7qJL3vKSdNAwcPzXHhnr0PC0H2v8UU8eqMoP@m6J0tXp4odzXti@qbbnpm2dDea1L/OvvsB "Scala – Try It Online")
Takes a `List[List[String]]` and returns a `Map[String,String]`
## Scala, 86 bytes
This is shorter, but the statements are reversed
```
_./:(Map[String,String]()){case(m,a::b)=>val x=m.getOrElse(a,a);(m/:b.map(_->x))(_+_)}
```
[Try it online!](https://tio.run/##dY/NboMwEITvPMXKJ69CSOm/qBaph95a9dBjGyFDDKUCgvAWIUV5duqYqFFT4YN3PN941zaZqtS4Tb90xvCiygb0wLrZGHhsW9h5vaogj@C5NPzutjfuyqZYr4Fim2@PZ/9oA41JsIrkfyIRd5kyWta@iqIUKT60HqgOCs2v3VNlkfIVPsh6FaVBrVqZLOMBUSaLBPejt9E5sDYsTQRTTwSC1gquGimW5@ujEYtcmsBG68C0VclSWA8D3h4@Mk34Q@kEO93rzmhE9DyYxgohrARI6Sa8dCojRZOyDM9z9r2uTglN966GF@Hsjbz4pGunSrr6dcrZvCGmb7p1mqmnu9mkOpH9@AM "Scala – Try It Online")
[Answer]
# JavaScript, ~~52~~ 88 bytes
+36 bytes to handle a single fecking edge case :\
```
a=>a.map(a=>a.map(k=>o[0+k]=o[0+v]|v,v=a.pop()),o={})&&JSON.stringify(o).split`0`.join``
```
[Try it online!](https://tio.run/##RYlNDsIgGETvwqKBiKQaXeIBXOjCJSGA/Qtt5SOlITHq2SsYo5uZ92Z6E02oJuvntYO6WVq@GH4w7GY8/sHADyDK1SB5riifkUZumAePCaHAHy9SFMfL@cTCPFnX2faOgbDgRzvrUrMerNN6qcAFGBs2QodbLAQyiO4lFeiK6C53hWjekmdLtP2@iTPVn1TKTzCDUohusjfp/29SErK8AQ)
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 85 bytes
```
G`=
+`=(.+(=.+))
$2¶$1
+rm`(^\4=(.+)¶(.+¶)*?.+=)(.+)$
$1$2
+m`^(.+)=.+¶((.+¶)*\1=)
$2
```
[Try it online!](https://tio.run/##LYzBDoIwAEPv/Y6ZbG4hboJ6aTz6AV4J2VRQVDgg@ml8AD82XeKlafuaDvXY9iEu5NGbePCE9pSZlsy0UhBunoSFHjovqzJPRM3TT@dJLfeZpkqNgLDCQXe@SpEJy/@otEw3MQYWwImFdebMQAdc6sY4U3Nn7MoCAWiuN@am5dok1wJ3Pvhkx542B14c@ebGjPxw@wU "Retina 0.8.2 – Try It Online") Link includes test suite that converts the input from comma separated to newline separated assignments with no spaces. Explanation:
```
G`=
```
Ignore statements that have no assignments.
```
+`=(.+(=.+))
$2¶$1
```
Split up assignment chains into individual assignments.
```
+rm`(^\4=(.+)¶(.+¶)*?.+=)(.+)$
$1$2
```
Substitute the values of variables used on the right-hand side of assignments. The matching is performed right-to-left so that the most recent value is used.
```
+m`^(.+)=.+¶((.+¶)*\1=)
$2
```
Remove superseded assignments.
[Answer]
# Java 10, 137 bytes
```
a->{var r=new java.util.TreeMap();for(var p:a)for(int l=p.length-1,i=l;i-->0;)r.put(p[i],p[l]instanceof Long?p[l]:r.get(p[l]));return r;}
```
Input as a Object-matrix (variables as Strings, values as Longs), output as a sorted HashMap.
[Try it online.](https://tio.run/##jVNLb9swDL7nVxA62agsxF2zDfGSYccBfRzaW@aD4siuXEXWZDlZYfi3Z5SdIC261jtQJumPj48SS77jUbl5OmSK1zXccKnbCYDUTticZwJuvQlQIo41Tir2YIW44ebb3boUmaMwfJeQBYO2Slcp8DDBsG6CR@24kxncgoYFHHi0bHfcgl1osX@bNQiTvLKBR5g5D72OrYBaGKaELtxjFFO5UImMouU0CS0zjQvMSqbUrFQqNRbTmahyuK508d375pYVwmNUGoaJFa6xGmzSHRLfnGnWCps79rir5Aa2OILg3lmpi57IwN@J2gW@5TPJtiWc0Nl1R1uyJvSqVzJCvRcd3kLt8vQfja7rx/JeNgTN4suXadD4OGQjcl9oCBKEfvVKPI1H4kayjnaaF48nwpLQT73S@9AcCS0R9ISiULYomtD4aoxmjUCH0hD6uS/mjR2hX86B/XH/XDuxZVXjmMELdEoHJCLMCiO4C2bT8IL80uTDUtWJDyrEjLH5jSA7BtojaP8fl/nnNFNUUI7ol0vUP9A@@NWute@S/6lxQeZALs6b9sNa/lyzjRDmoRreecDDY2P/ynHXuGMSzTKEnmfYTbrDXw)
**Explanation:**
```
a->{                            // Method with Object-matrix parameter & TreeMap return
  var r=new java.util.TreeMap();//  Create the result sorted HashMap
  for(var p:a)                  //  Loop over each Object-list of the input-matrix:
    for(int l=p.length-1,       //   Integer `l`, set to the last index of the list
        i=l;i-->0;)             //   Inner loop `i` in the range (length-1, 0]:
      r.put(                    //    Add to the result TreeMap:
         p[i],                  //     The `i`'th value of the list as key
         p[l]instanceof Long?   //     If the last item is a Long:
          p[l]                  //      Use that last item as value
         :                      //     Else:
          r.get(p[l]));         //      Get the value of this last item from the
                                //      result-Map, and use that as value
  return r;}                    //  Return the resulting TreeMap (sorted HashMap)
```
[Answer]
# [Red](http://www.red-lang.org), ~~74~~ 69 bytes
```
func[b][context collect[forall b[if set-word? first t: b/1[keep t]]]]
```
[Try it online!](https://tio.run/##bZBBUsMwDEX3PsW/AAMOLTDacAe2Gi1iR4ZQE3ccF7h96raB0tC/@pKe/tjK2k0v2rGYQFPYDZ6dsE9D0e8Cn2JUXzik3MYIx33AqOXmK@XuGaHPY0EhuFvLG9UtilRN25ycIoANqrglrOVkHWE1W0@oAye/THNmWjFizCKm9te2udhurnGdhhn6gZXwNFt7Zy93uBXBcXZNy@zw@nb@QU@4lz/9fpH8TtgQIuGDMBDsSv4/dqTD/XaEhzmpVp@Exxo17QE "Red – Try It Online")
Takes the input as a list of lists, in each of them `=` replaced with `:` (Red has `set-words` rather than assignment operator)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~30~~ 29 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
εRćÐþÊiU¯ʒXk_}θθ}δ‚€ˆ}¯.¡н}€θ
```
Ugh.. :/ Not the right language for the job.
Input as a list of lists.
[Try it online](https://tio.run/##yy9OTMpM/f//3NagI@2HJxzed7grM/TQ@lOTIrLja8/tOLej9tyWRw2zHjWtOd1We2i93qGFF/bWAnnndvz/Hx2tlKikYxqrE62UpKRjAqKTlXRAYkA@iAdkGUFlgezY2P@6unn5ujmJVZUA) or [verify all test cases](https://tio.run/##yy9OTMpM/V@m5JlXUFpipaBkX6nDpeRfWgLj/T@3NehI@@EJh/cd7soMPbT@1KSI7PjaczvO7ag9t@VRw6xHTWtOt9UeWq93aOGFvbVA3rkd/3UObbM/tEUz5tD6/9HR0UqJSjqmsTrRSklKOiYgOllJByQG5IN4QJYRVBbIjo3VUYBpgTCB4qaGRkj6jKASKalpIAPAUqlKOhZA2tDAECwJMwSqMi09A2p1ppKOMYgGiwB5UAVZQE42EOcAcS4Q5ynpGJpA5YqB/BIgLlXSMQNpBbHLlHTModL5UBOBtFIBzLxCIKcIxikHcsoRzq6AOgVIA3FsbOx/Xd28fN2cxKpKAA).
**Explanation:**
```
ε              # For each list in the (implicit) input-list:
 R             #  Reverse the list
  ć            #  Extract its head; pop and push remainder-list and first item separated
               #  to the stack
   Ð           #  Triplicate this value
    þ          #  Pop one copy, and only leave its digits
     Êi        #  If the top two copies are NOT the same (so it's not an integer):
       U       #   Pop and store the last copy in variable `X`
        ¯      #   Push the global_array
         ʒ     #   Filter it by:
          Xk   #    Where the index of `X`
            _  #    Is 0 (thus the key of the pair)
         }θ    #   After the filter: leave the last pair
           θ   #   Pop and leave its value
      }        #  Close the if-statement
       δ       #  For each value in the remainder-list:
        ‚      #   Pair it with the top value
         €     #  Then for-each pair in this list:
          ˆ    #   Add this pair to the global_array
}¯             # After the outer for-each: push the global_array
  .¡           # Group this list of pairs by:
    н          #  Its first value (the key)
   }€          # After the group-by: map over each group:
     θ         #  And only leave the last pair
               # (after which the top of the stack is output implicitly as result)
```
[Answer]
# [Perl 5](https://www.perl.org/) `-p`, 57 bytes
```
s/[a-z_]+/\$k{'$&'}/g;/=/&&eval}{say"$_=$k{$_}"for keys%k
```
[Try it online!](https://tio.run/##K0gtyjH9/79YPzpRtyo@Vls/RiW7Wl1FTb1WP91a31ZfTS21LDGntro4sVJJJd4WKKkSX6uUll@kkJ1aWaya/f9/SmoalxFXqoKtggWXoYHhv/yCksz8vOL/ur6megaGBv91CwA "Perl 5 – Try It Online")
[Answer]
# [R](https://www.r-project.org/), 172 bytes
Takes input as a list of strings, returns a named vector. Just `eval` in R with aggressive escaping using the `A` character.
```
function(i){i=paste(gsub('([a-z_])', 'A\\1',i)[grepl('=',i)],collapse=';')
eval(parse(text=i))
rm("i")
u=ls()
x=sapply(u,function(name)get(name))
names(x)=gsub('A','',u)
x}
```
[Try it online!](https://tio.run/##bVHLbsMgELzzFYgLuxI9OE0fUsUh35FEFnGJS4sdZEzktuq3u0utVE3tw4jZWXZ2BN1oz8aXpn0uvYs91@MxtVXvTi04/HQ6mNhbqGM6gIStufko9ygVl5vdrpDK4bbubPAgdS72qjp5b0K0Wj5JZNkagumihd4OvXaIrGtAOIEsaR8B2aCjCcG/Q1K/i1vTWKxtPxFk@YgwoJ5ibKSSUiWa/boOD8Jwze8EcnatVyAOuVOshOKiIpovrgTiv4vCkv4oZvJcMTOJlhzrF5pf5yWOyG0mk@YWdr2S/kbwhIbQEor1km@kDn0NT4T7bJqLM@FhwfbyjD8BlkL@7ZNXSeSiZbvxGw "R – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), ~~69~~ 103 bytes
```
import re
def f(x):g={};exec(re.sub('(^|\n)[^=]+($|\n)','',x).upper(),{},g);return eval(str(g).lower())
```
[Try it online!](https://tio.run/##FY3LDoIwEEX3/YouTGYmNkR0YyT9EpXExxRJoDRDUQzy7RV2N@ec5IZvfHX@kFLdhk6iFlZPdtrhSKfKTnPBIz9QOOuHOwKWv4unc2mvW9ysEwyAGSkbQmBBMtNsKiqE4yBe8/vWYB8FK8qa7rMGlILUPqJDAFiO1F6xtvqo8l2@kMX/AQ "Python 3 – Try It Online")
+34 bytes to remove no-op lines in the input and avoid undefined variables
Takes advantage of the fact that no python keywords are uppercase, and variable names for this challenge will all be lowercase.
Saves several bytes thanks to a comment on my original (invalid) answer by @ovs:
> 
> Note that your original answer could have been 35 bytes with exec(x,{},g), since exec does not add **builtins** to the locals dictionary. (This is still invalid)
> 
> 
> 
[Answer]
# [Pip](https://github.com/dloscutoff/pip) `-rl`, 57 bytes
```
{YDQaIx~'^.y.,wYXI~$'Fva.sxR:'^.v.,`.+|^$`v.y.n}Mg^sUQx^n
```
[Try it online!](https://tio.run/##K8gs@P@/OtIlMNGzok49Tq9ST6c8MsKzTkXdrSxRr7giyAooWKank6CnXROnklAGVJBX65seVxwaWBGX9/9/RiaXiRFXSqpCWnqGgglXpoIxF4iVyZWlkK2Qo5CrkKdgaMKVDFSQrGDGVaxQolCqkJL6X7coBwA "Pip – Try It Online")
Takes input (from stdin) and produces output (to stdout) as a series of lines, each of the form `a b c 5` (for `a = b = c = 5`). The output will have an extra blank line in it somewhere, which can be eliminated for +1 byte.
Pip is handicapped here by not having a dictionary/hashmap type. Our approach is to build the output as a string, using regex substitutions to update with new assignments. Further explanation available upon request, although I also hope to golf this more. Here's an [earlier, pre-golfed version](https://tio.run/##FcpPC4IwAIbx@/sp3oNQYQ2s0cFzCB0NOngZAzWdLZEsWfTnq695e@D3DGbwPrMN36BV6QgWh9yCR/dbKPESa82liFcaZBElYDYFpDulQadZRfxRkZ7EGOYeX5xzp3rvWwO5RVXz0rSUMNxhLoOOV1re2DORKMNQco@RDz5Z1X5zt38) which may be easier to decipher.
[Answer]
# [Haskell](https://www.haskell.org/), ~~177~~ ~~145~~ 141 bytes
```
r t=f(?)[](reverse.words.filter(/='=')<$>lines t)
s?(x:y)=f(#)s y where z|Just v<-lookup x s=v|1<2=read x;s#k=(k,z):[x|x<-s,fst x/=k]
f=foldl
```
[Try it online!](https://tio.run/##JY7BbsIwEETv@YoVIGFLCQjoKc2WM732GHKIlDWx7DqR1wSD8u@pK04z86QnTd@yIWuXxUNAJc6yboSniTzT7jH4jndK20Be7HGLW1ltvqx2xBBkxmcRy6dM1loyPOHRkyd4zd93DjBVhR0Gcx8hAuM0H6ojemo7iJ@8NihM/pJlHedYFZyrJMQ9miZTqAbb2SVQQggrdetTfFydTnG6uvfWq@y31S610WsXQKTz/0JZQi1@QmK3HC4uyEYufw "Haskell – Try It Online")
Ungolfed:
```
run :: Read v => String -> [(String, v)]
run input = foldl assign [] (reverse . words . filter (/='=') <$> lines input)
assign :: Read v => [(String, v)] -> [String] -> [(String, v)]
assign scope (first:keys) = foldl acons scope keys
  where value | Just v <- lookup first scope = v
              | otherwise = read first
        acons scope' k = (k, value) : [x | x <- scope', fst x /= k]
```
[Answer]
# [C# (Visual C# Interactive Compiler)](http://www.mono-project.com/docs/about-mono/releases/5.0.0/#csc), 128 bytes
```
x=>{var z=new Dictionary<string,string>();x.ForEach(l=>{var s=l.Pop();l.Any(o=>(z[o]=z.ContainsKey(s)?z[s]:s)=="");});Print(z);}
```
[Try it online!](https://tio.run/##VZDLTsMwEEX3/gorK1syFinlIVIHVVAkBIuKdle6MK7Tmho7it2SBPHtYVLaBYs7j@szI41VOFPBdGMVjXejFxPiaBal2o5CrIxb53leiK4W@fdeVrgVTn/hB3OAZdUcIXZkCc1q/uiriVQbYo8zQVg@9SW8WT52DfEiJ@3CL0XL772L0rjwrBsS6F27CMvbQIVIEpr90GwKSyNpoe4yhApf6X5vv9O4chch4ifHX7Vczf3ErQjls9KaSJI3l1CKCnLATibDCQDaahVJjUWO@1P@nUrqE4sFwJTyue8/hFCaoU6CeYne@5gOGFZQ9NYArXTBMDgauhuG0/MUIYmK9Qb6IcMG0gXDf71BHxC3IAv6BDlQOkQBUgTtQFfsUO5B178 "C# (Visual C# Interactive Compiler) – Try It Online")
[Answer]
# [PHP](https://php.net/), 65 bytes
```
eval(preg_filter('/([a-z_]+)/','\$$1',$argn));var_dump($GLOBALS);
```
[Try it online!](https://tio.run/##K8go@G9jXwAkU8sSczQKilLT49Myc0pSizTU9TWiE3Wr4mO1NfXVddRjVFQM1XVUEovS8zQ1rcsSi@JTSnMLNFTcffydHH2CNa3//y9WsFUoAeJSIDazBjPLgNjc@l9@QUlmfl7xf103AA "PHP – Try It Online")
Takes input as string with `;` as separator, outputs an array.
I'm not sure this is valid, as the rules for the output are not very precise: the result is present at the end, but there are other unnecessery things displayed before... For the first time PHP's `$` comes useful, as it allows to use keywords as var names (works with names such as `function`, `echo` etc)
]