Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vim script 静的解析の光と闇

Kuniwak
August 22, 2015

Vim script 静的解析の光と闇

YAPC:Asia 2015 の LT Day2 の発表です。
http://yapcasia.org/2015/

Kuniwak

August 22, 2015
Tweet

More Decks by Kuniwak

Other Decks in Programming

Transcript

  1. 7JNTDSJQU੩తղੳͷ
 ޫͱҋ

  2. "CPVUNF

  3. Kuniwak

  4. 7JNTDSJQU੩తղੳͷ
 ޫͱҋ

  5. ޫͱҋͱ͍ͬͨͳɻ
 ͋Ε͸΢ιͩɻ

  6. VViimm ssccrriipptt静的解析の
 闇

  7. ಛʹม਺ͷղੳͰ
 ௧͍໨ʹ͖͋ͬͯͨ

  8. ۩ମతʹ͸ɿ w ະఆٛม਺ͷ࢖༻Λݕग़ w ະ࢖༻ม਺Λݕग़

  9. ࣮૷ͯ͠Έͨ͸͍͍΋ͷͷʜ w ଎߈ͰJTTVFཱ͕ͭͭ w ཱͪ͸͔ͩΔṖߏจͨͪ

  10. ʘ؁͑Δͳʗ

  11. None
  12. ʢ؁͍͑ͨʜʣ

  13. -W

  14. ม਺ղੳͷجຊ͸ɺ
 ม਺ͷએݴͱࢀরͷ௥੻

  15. એݴͱࢀরΛ௥੻͢Δ͜ͱͰʜ w એݴ͞Ε͍ͯͳ͍ͷʹࢀর͞Ε͍ͯΔ w એݴ͞ΕͯΔ͚Ͳࢀর͞Εͯͳ͍ Α͏ͳม਺Λݟ͚ͭͩ͢

  16. 7JNTDSJQUͷม਺એݴ

  17.  7JNTDSJQUͷม਺એݴ

  18. –:h redir lSFEJ<S>\WBS^ϝοηʔδΛม਺ʹ
 ϦμΠϨΫτ͠·͢ɻม਺͕ଘࡏ͠ͳ͍
 ৔߹͸ɺ࡞੒͞Ε·͢ɻz

  19. ίΠπɺม਺એݴ
 Ͱ͖Δͧʂ

  20. -W

  21. ม਺ղੳͷجຊ͸ɺ
 είʔϓΛ͓͑͞Δ͜ͱ

  22. είʔϓͷछྨΛ
 ΈͯΈΑ͏

  23. w NZ w PVS w MPDBM w TUBUF w ҉໧ͷHMPCBM

    1FSM 7JNTDSJQU w H w M w T w X w C w U w W w ҉໧ͷH w ҉໧ͷM w ҉໧ͷW
  24. ѹ౗తͰ͸ͳ͍͔ʂ

  25. ͔͠΋ʮ҉໧ͷʙʯ͕
 དͷDPVOU໰୊Λ
 Ҿ͖ى͜͢

  26. 100 0 100

  27. WDPVOU͕
 ࢀর͞ΕͯΔʂ

  28. ͞Βʹม਺ͱؔ਺͸ʜ

  29. var func

  30. ผۭؒͩίϨʂ

  31. -W

  32. ͋Δ഑ྻ͔Βผͷ
 ഑ྻΛͭ͘Δؔ਺NBQ

  33. จࣈྻ 1FSMͷNBQؔ਺ 7JNTDSJQUͷNBQؔ਺

  34. จࣈྻʹ͞ΕΔͱ
 ࣮ߦ࣌·ͰΘ͔Βͳ͍

  35. ͳͷͰɺଟ͘ͷ੩తݕࠪ πʔϧ͸ղੳΛఘΊΔ

  36. ͦ͜Ͱɺແࢹ͢ΔΑ͏ ʹ΍ͬͯΈͨͱ͜Ζʜ

  37. ޡܯࠂͷཛྷ

  38. ٽ͖ͳ͕ΒจࣈྻϦςϥϧ͚ͩ͸
 ղੳͰ͖ΔΑ͏ʹͨ͠ʜ

  39. ʘŞŞŞʜNBQؔ਺͸ ུ ʗ

  40. ΩʔೖྗΛӈͷΩʔೖྗʹׂΓ౰ͯΔ NBQίϚϯυ

  41. ม਺એݴίϚϯυ͕࣮ߦ͞ΕΔ NBQίϚϯυͰม਺એݴ

  42. Զ͸͢Ͱʹจࣈྻͷ৔߹ʹ
 ղੳ͢Δํ๏Λ஌͍ͬͯΔʜ
 ಉ͡खॱͰղੳͯ͠΍Δͧʂ

  43. ʘʜʗ

  44. ʘŞŞŞʜʗ

  45. NBQίϚϯυͰม਺એݴ Ωʔೖྗͷ࠶ݱͳͷͰɺҟ෺΋ೖΔ

  46. None
  47. řŕ

  48. ʘŞŞŞʜʗ

  49. ʘ୭͕࠶ؼల։͠ͳ͍ͱݴͬͨʁʗ

  50. ͜ΕΒͷจࣈ͕NBQ͞Εͯͳ͍ͱ͸ݶΒͳ͍ʂ NBQ͸࠶ؼల։͞ΕΔ

  51. řřŕ

  52. ʘ؁͑Δͳʗ

  53. ʢ؁͍͑ͨʜʣ

  54. ؁͍͑ͨͷͰɺղੳ͠΍͍͢
 ίʔυΛॻ͍ͯ΄͍͠

  55. ղੳ͠΍͍͢ίʔυ OPSFNBQ͸࠶ؼల։͞Εͳ͍ จࣈྻΛಈతʹૢ࡞͠ͳ͍

  56. ͦΜͳ͜ΜͳͰͰ͖ͨͷ͕

  57. Πϯετʔϧํ๏

  58. $ pip install vim-vint

  59. $ vint .vimrc .vimrc:6:10: Variable is not declared (see :help

    E738)
  60. Ұॹʹಇ͖·ͤΜ͔ʁ