Code Monkey home page Code Monkey logo

sbt-semantic-example's Introduction

Minimal template to play with the scala.meta semantic API

To use this project

$ git clone https://github.com/scalameta/sbt-semantic-example
$ cd sbt-semantic-example
$ sbt app/run

That should print out something like this

library/src/main/scala/Test.scala
---------------------------------
Dialect:
Scala211

Names:
[7..11): Test => _empty_.Test.
[20..29): printList => _empty_.Test.printList()V.
[33..37): Unit => _root_.scala.Unit#
[46..53): println => _root_.scala.Predef.println(Ljava/lang/Object;)V.
[54..58): List => _root_.scala.collection.immutable.List.

Denotations:
_empty_.Test. => final object Test
_empty_.Test.printList()V. => def printList: ()Unit

Sugars:
[58..58) [Int]

_root_.scala.Predef.println(Ljava/lang/Object;)V.

Edit Test.scala and run again.

For more documentation about the Scalameta Semantic API, see http://scalameta.org/tutorial/#SemanticAPI

Project Overview

This repository provides a minimal template to play with the new approach to semantic APIs proposed by Scalameta. Prominent parts of the project include:

  • plugins.sbt that enables the scalahost compiler plugin responsible for generating and persisting semantic databases.
  • build.sbt that shows how to use scalahost as a library to create a Mirror from a previously persisted semantic database and run semantic operations on the corresponding Scala code.
  • library/src/main/scala/Test.scala an example file that we want to analyze with the Semantic API.
  • app/src/main/scala/Main.scala that demonstrates how to load a Mirror, which is an implementation of the Scalameta Semantic API.

sbt-semantic-example's People

Contributors

xeno-by avatar olafurpg avatar raboof avatar scalawilliam avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.