# Smilies Right-Associative?

**URL:** <https://boards.straightdope.com/t/smilies-right-associative/110894>\
**Category:** About This Message Board\
**Created:** [May 26, 2002, 6:52am UTC](https://boards.straightdope.com/t/smilies-right-associative/110894 "2002-05-26T06:52:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [May 26, 2002, 6:52am UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/1 "2002-05-26T06:52:49Z")

</div>

It certainly seems so. For example:  
(:rolleyes:) produces a malformed token (:rolleyes with a grin smilie at the end. Given the left-associative nature of English (we read left-to-right), this is the Wrong Thing. My example _should_ produce a rolleyes smilie encased in parenthesis, as (: is not a valid token.

Is this universally true given all combinations of smilies? Is there an easy way to fix this?

---

<div class="post-metadata">

**Author:** ![White\_Lightning](https://avatars.discourse-cdn.com/v4/letter/w/f04885/32.png) [@White\_Lightning](https://boards.straightdope.com/u/White_Lightning)\
**Post date:** [May 26, 2002, 5:23pm UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/2 "2002-05-26T17:23:25Z")

</div>

It’s not that it’s right-associative, it’s just that any combination of characters in your post that _can_ produce a smiley _will_ produce a smiley. The lesson to be learned from your example, I think, is that the ascii-graphic type smileys take precedence over the smileys with codes that are words, and the vB software checks for them first.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [May 27, 2002, 7:57am UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/3 "2002-05-27T07:57:54Z")

</div>

Test: (:rolleyes:)  
Test: (:rolleyes:\*\*)

Two ways that I can tell (tested on IE 5.5 in Windows 95), neither of which is particularly easy:

(:rolleyes:)  
(:rolleyes:\*\*)

---

<div class="post-metadata">

**Author:** ![Arnold\_Winkelried](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@Arnold\_Winkelried](https://boards.straightdope.com/u/Arnold_Winkelried)\
**Post date:** [May 27, 2002, 3:13pm UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/4 "2002-05-27T15:13:22Z")

</div>

> [@](#):
>
> \*Originally posted by Derleth \*  
> Is this universally true given all combinations of smilies? Is there an easy way to fix this?

a) Don’t know.  
b) Not without modifying the source code, which we don’t do.

---

<div class="post-metadata">

**Author:** ![Protesilaus](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@Protesilaus](https://boards.straightdope.com/u/Protesilaus)\
**Post date:** [May 28, 2002, 4:15am UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/5 "2002-05-28T04:15:36Z")

</div>

:rolleyes:rolleyes:

---

<div class="post-metadata">

**Author:** ![Protesilaus](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@Protesilaus](https://boards.straightdope.com/u/Protesilaus)\
**Post date:** [May 28, 2002, 4:17am UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/6 "2002-05-28T04:17:34Z")

</div>

Looks like they are left-associative, but 🙂 has higher presidence than :rolleyes:.

---

<div class="post-metadata">

**Author:** ![waterj2](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@waterj2](https://boards.straightdope.com/u/waterj2)\
**Post date:** [May 28, 2002, 5:16am UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/7 "2002-05-28T05:16:46Z")

</div>

I think this has been done before, and a precedence was worked out. Probably goes through the text searching for one token at a time.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [May 28, 2002, 5:58am UTC](https://boards.straightdope.com/t/smilies-right-associative/110894/8 "2002-05-28T05:58:18Z")

</div>

OK. Left-associative, but with precedence rules.

Interesting enough to keep a geek happy. 🙂

Thanks.

Test zone:

:wally:rolleyes:
